:root {
  --app-sidebar: #0f172a;
  --app-sidebar-muted: #94a3b8;
  --app-sidebar-hover: rgba(255, 255, 255, 0.06);
  --app-accent: #3ec1d5;
  --app-accent-strong: #14788c;
  --app-bg: #f1f5f9;
  --app-line: #e2e8f0;
  --bs-primary: #14788c;
  --bs-primary-rgb: 20, 120, 140;
  --bs-link-color: #14788c;
  --bs-link-hover-color: #0e6d80;
  --bs-body-font-family: "Source Sans 3", system-ui, -apple-system, sans-serif;
  --bs-body-color: #0f172a;
  --bs-secondary-color: #64748b;
  --bs-border-radius: 0.65rem;
}

body {
  background: var(--app-bg);
  font-size: 1rem;
  line-height: 1.5;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 2000;
}

.btn-primary {
  --bs-btn-bg: #14788c;
  --bs-btn-border-color: #14788c;
  --bs-btn-hover-bg: #0e6d80;
  --bs-btn-hover-border-color: #0e6d80;
  --bs-btn-active-bg: #0c6172;
  --bs-btn-active-border-color: #0c6172;
  --bs-btn-color: #fff;
  --bs-btn-focus-shadow-rgb: 62, 193, 213;
}

.form-control,
.form-select,
.btn {
  min-height: 44px;
}

.btn-sm {
  min-height: 36px;
}

.btn-icon {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.55rem;
}

.app-shell {
  display: flex;
  min-height: 100dvh;
}

.app-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--app-sidebar);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
  z-index: 1040;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.25rem 1rem;
  color: #fff;
  text-decoration: none;
}

.app-brand:hover {
  color: #fff;
}

.app-brand-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background-color: var(--app-accent);
  -webkit-mask: url("../img/logo-icon.png") center / contain no-repeat;
  mask: url("../img/logo-icon.png") center / contain no-repeat;
}

.brand-alo {
  color: var(--app-accent);
}

.auth-card .brand-alo {
  color: var(--app-accent-strong);
}

.auth-card .app-brand-mark {
  background-color: var(--app-accent-strong);
}

.app-brand strong {
  display: block;
  font-size: 0.95rem;
  line-height: 1.2;
}

.app-brand small {
  color: var(--app-sidebar-muted);
}

.app-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem 1rem;
}

.app-nav-label {
  margin: 1rem 0.6rem 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--app-sidebar-muted);
}

.app-nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 44px;
  padding: 0.55rem 0.75rem;
  border-radius: 0.6rem;
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 500;
}

.app-nav-link i {
  font-size: 1.1rem;
  width: 1.25rem;
  text-align: center;
}

.app-nav-link:hover {
  background: var(--app-sidebar-hover);
  color: #fff;
}

.app-nav-link.active {
  background: rgba(62, 193, 213, 0.22);
  color: #fff;
}

.app-sidebar-footer {
  margin-top: auto;
  padding: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  height: 64px;
  background: #fff;
  border-bottom: 1px solid var(--app-line);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.25rem;
}

.app-topbar h1 {
  font-size: 1.15rem;
  font-weight: 650;
  margin: 0;
}

.app-content {
  padding: 1.5rem;
  flex: 1;
}

.sidebar-backdrop {
  display: none;
}

.panel-card {
  background: #fff;
  border: 1px solid var(--app-line);
  border-radius: 0.9rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.panel-card .card-header {
  background: #fff;
  border-bottom: 1px solid var(--app-line);
  border-radius: 0.9rem 0.9rem 0 0;
  padding: 1rem 1.25rem;
}

.panel-card .card-body {
  padding: 1.25rem;
}

.table thead th {
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 600;
  white-space: nowrap;
}

tr.is-inactive > :not(.td-actions) {
  color: #64748b;
}

.home-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 96px;
  padding: 1.15rem 1.25rem;
  background: #fff;
  border: 1px solid var(--app-line);
  border-radius: 0.9rem;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 180ms ease, transform 180ms ease;
}

.home-card:hover {
  border-color: #7ed4e3;
  color: inherit;
  transform: translateY(-1px);
}

.home-card strong,
.home-card small {
  display: block;
}

.home-card small {
  color: #64748b;
}

.home-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 0.7rem;
  background: #d7f3f8;
  color: #14788c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.auth-shell {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(900px 420px at 10% -10%, rgba(62, 193, 213, 0.28), transparent 60%),
    var(--app-bg);
}

.auth-card {
  width: min(440px, 100%);
  background: #fff;
  border: 1px solid var(--app-line);
  border-radius: 1rem;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
  padding: 2rem;
}

@media (max-width: 991.98px) {
  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 200ms ease-out;
  }

  .app-sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-backdrop.is-open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 1030;
  }

  .app-content {
    padding: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-sidebar,
  .home-card {
    transition: none;
  }
}
