:root {
  --bg-canvas: #e9eef4;
  --bg-panel: rgba(249, 251, 253, 0.88);
  --bg-panel-strong: rgba(255, 255, 255, 0.94);
  --bg-subtle: #f3f6fa;
  --bg-soft: #eef3f8;
  --border-soft: rgba(100, 116, 139, 0.18);
  --border-strong: rgba(71, 85, 105, 0.22);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --brand-teal: #0f766e;
  --brand-sky: #0284c7;
  --brand-ink: #0b1220;
  --accent: var(--brand-teal);
  --accent-soft: rgba(15, 118, 110, 0.1);
  --accent-strong: #115e59;
  --warning: #d97706;
  --danger: #dc2626;
  --brand-gradient: linear-gradient(135deg, #14b8a6, #38bdf8);
  --brand-gradient-dark: linear-gradient(135deg, #0b1220 0%, #162338 52%, #115e59 100%);
}

html {
  scroll-behavior: smooth;
}

body.app-body {
  min-height: 100vh;
  color: var(--text-main);
  background:
    radial-gradient(circle at top left, rgba(20, 184, 166, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.12), transparent 20%),
    radial-gradient(circle at bottom right, rgba(245, 158, 11, 0.08), transparent 22%),
    linear-gradient(180deg, #f5f7fb 0%, var(--bg-canvas) 52%, #dde6ef 100%);
}

.app-shell {
  min-height: 100vh;
}

.app-navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(237, 243, 248, 0.82);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(18px);
}

.app-navbar-inner {
  width: min(100%, 1600px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.app-brand-mark {
  display: grid;
  height: 3rem;
  width: 3rem;
  place-items: center;
  border-radius: 1rem;
  color: #ecfeff;
  background: var(--brand-gradient);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 10px 24px rgba(20, 184, 166, 0.22);
  position: relative;
  overflow: hidden;
}

.app-brand-mark::after {
  content: "";
  position: absolute;
  inset: auto -30% -45% auto;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.brand-initials {
  position: relative;
  z-index: 1;
  font-size: 0.98rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.brand-divider {
  width: 100%;
  height: 1px;
  background: rgba(148, 163, 184, 0.35);
}

.brand-tagline {
  margin: 0.65rem 0 0;
  font-size: 0.85rem;
  color: rgba(248, 250, 252, 0.8);
}

.app-brand-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  color: #0f172a;
}

.app-brand-subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.74rem;
  color: #64748b;
}

.app-nav-state {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.app-nav-menu {
  display: none;
  width: 100%;
  order: 3;
  flex-basis: 100%;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem 0 0;
}

.app-nav-menu.is-open {
  display: flex;
}

.app-nav-state:checked ~ .app-nav-menu {
  display: flex;
}

.app-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.app-nav-link-top {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  font-weight: 600;
  color: #334155;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.64);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.app-nav-link-top:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(100, 116, 139, 0.2);
}

.app-nav-link-top.is-active {
  color: #0f172a;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.18), rgba(125, 211, 252, 0.16));
  border-color: rgba(20, 184, 166, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.app-nav-icon {
  width: 1rem;
  text-align: center;
}

.app-nav-user {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.app-logout-link-top {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: center;
  padding: 0.9rem 1rem;
  font-weight: 600;
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.12);
  border-radius: 1rem;
  background: rgba(255, 245, 245, 0.95);
}

.app-content {
  width: 100%;
  min-width: 0;
}

.app-topbar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.85rem;
  height: 2.85rem;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border-soft);
  border-radius: 0.9rem;
  cursor: pointer;
}

.app-topbar-toggle:focus-visible {
  outline: 3px solid rgba(20, 184, 166, 0.18);
  outline-offset: 2px;
}

.app-nav-state:checked + .app-topbar-toggle {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(15, 118, 110, 0.24);
}

.app-topbar-kicker {
  margin: 0;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.app-topbar-title {
  margin: 0.15rem 0 0;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
}

.app-topbar-meta {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.app-topbar-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 0.95rem;
  font-size: 0.83rem;
  font-weight: 700;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
}

.app-main {
  width: min(100%, 1600px);
  margin: 0 auto;
  padding: 0.9rem 1rem 1rem;
}

.app-footer {
  width: min(100%, 1600px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1rem 1.2rem;
  color: var(--text-muted);
}

.surface-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: 1.2rem;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(14px);
}

.surface-panel-strong {
  background: var(--bg-panel-strong);
  border: 1px solid var(--border-soft);
  border-radius: 1.2rem;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

.metric-card {
  position: relative;
  overflow: hidden;
  padding: 1.1rem;
  border-radius: 1.15rem;
  border: 1px solid var(--border-soft);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(242, 247, 251, 0.92));
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.metric-card::after {
  content: "";
  position: absolute;
  inset: auto -10% -30% auto;
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.08);
}

.metric-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
}

.section-heading {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.section-copy {
  margin: 0.25rem 0 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.table-shell {
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: 1.25rem;
  background: rgba(250, 252, 254, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.table-modern {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table-modern thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 1rem;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #334155;
  background: rgba(237, 242, 247, 0.96);
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.table-modern tbody td {
  padding: 1rem;
  vertical-align: top;
  border-bottom: 1px solid rgba(226, 232, 240, 0.72);
}

.table-modern tbody tr:hover {
  background: rgba(240, 246, 250, 0.82);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1rem;
}

.field-label {
  display: block;
  margin-bottom: 0.55rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #475569;
}

.field-control {
  width: 100%;
  min-height: 2.85rem;
  padding: 0.72rem 0.95rem;
  color: var(--text-main);
  background: rgba(250, 252, 254, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 1rem;
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.field-control:focus {
  border-color: rgba(13, 148, 136, 0.54);
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.12);
}

.btn-modern {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 2.85rem;
  padding: 0.72rem 1rem;
  font-weight: 700;
  border-radius: 0.9rem;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease;
}

.btn-modern:hover {
  transform: translateY(-1px);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
  background: rgba(244, 247, 251, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 999px;
}

.chip-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.8rem;
  font-size: 0.78rem;
  font-weight: 800;
  border-radius: 999px;
}

.hero-banner {
  position: relative;
  overflow: hidden;
  padding: 1.2rem 1.25rem;
  border-radius: 1.25rem;
  background:
    radial-gradient(circle at top right, rgba(45, 212, 191, 0.22), transparent 25%),
    radial-gradient(circle at bottom left, rgba(56, 189, 248, 0.14), transparent 20%),
    var(--brand-gradient-dark);
  color: #f8fafc;
  box-shadow: 0 22px 46px rgba(15, 23, 42, 0.16);
}

.hero-banner.hero-banner--login {
  padding: 2.75rem 2.85rem;
  border-radius: 1.8rem;
  isolation: isolate;
  min-height: 22rem;
  background:
    linear-gradient(135deg, rgba(11, 18, 32, 0.32) 0%, rgba(22, 35, 56, 0.28) 52%, rgba(17, 94, 89, 0.26) 100%),
    url("../images/image.png");
  background-size: cover;
  background-position: center 35%;
  background-repeat: no-repeat;
}

.hero-banner.hero-banner--login::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at top left, rgba(45, 212, 191, 0.18), transparent 30%),
    radial-gradient(circle at bottom right, rgba(56, 189, 248, 0.16), transparent 30%);
  pointer-events: none;
}

.hero-banner.hero-banner--login > * {
  position: relative;
  z-index: 1;
}

@media (min-width: 1024px) {
  .hero-banner.hero-banner--login {
    min-height: 28rem;
  }
}

.hero-banner::before {
  content: "";
  position: absolute;
  inset: auto -3rem -3rem auto;
  width: 12rem;
  height: 12rem;
  border-radius: 999px;
  background: rgba(45, 212, 191, 0.14);
}

.hero-banner > * {
  position: relative;
}

.page-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-card {
  padding: 1.2rem;
  background: rgba(249, 251, 253, 0.92);
  border: 1px solid var(--border-soft);
  border-radius: 1.2rem;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.06);
}

.form-section {
  padding: 1rem;
  background: linear-gradient(180deg, rgba(244, 247, 251, 0.96), rgba(239, 244, 248, 0.9));
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 1rem;
}

.form-section-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
}

.form-section-copy {
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1rem;
}

.helper-copy {
  margin-top: 0.55rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.empty-state {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted);
}

.stat-tile {
  padding: 1rem 1.1rem;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 1.25rem;
  background: rgba(243, 247, 251, 0.96);
}

.stat-tile-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.stat-tile-value {
  margin-top: 0.55rem;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1rem;
}

.detail-card {
  padding: 0.95rem 1rem;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 1rem;
  background: rgba(243, 247, 251, 0.92);
}

.detail-label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.detail-value {
  margin-top: 0.45rem;
  font-weight: 700;
  color: var(--text-main);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(circle at top left, rgba(20, 184, 166, 0.18), transparent 24%),
    radial-gradient(circle at right, rgba(37, 99, 235, 0.18), transparent 28%),
    linear-gradient(135deg, #e2e8f0 0%, #f8fafc 100%);
}

.login-panel {
  width: min(100%, 430px);
  padding: 2rem;
  border-radius: 1.75rem;
  background: rgba(249, 251, 253, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.15);
  backdrop-filter: blur(12px);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.login-brand .app-brand-mark {
  height: 3.25rem;
  width: 3.25rem;
  border-radius: 1.1rem;
}

.error-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(circle at top left, rgba(20, 184, 166, 0.16), transparent 24%),
    radial-gradient(circle at right, rgba(37, 99, 235, 0.14), transparent 28%),
    linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
}

.error-card {
  width: min(100%, 580px);
  padding: 2.25rem;
  text-align: center;
  border-radius: 1.9rem;
  background: rgba(249, 251, 253, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.14);
}

.transition-all {
  transition: all 0.3s ease;
}

.hover-scale:hover {
  transform: scale(1.05);
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.card-hover {
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
  .form-grid-2,
  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-navbar-inner,
  .app-main,
  .app-footer {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1280px) {
  .detail-grid.detail-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .app-navbar-inner {
    gap: 1.5rem;
  }

  .app-nav-menu {
    display: flex !important;
    order: initial;
    flex-basis: auto;
    flex: 1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    min-width: 0;
  }

  .app-nav-list {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .app-nav-link-top {
    white-space: nowrap;
  }

  .app-nav-user {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
  }

  .app-logout-link-top {
    justify-content: center;
  }

  .app-topbar-toggle {
    display: none;
  }

  .app-nav-state:checked ~ .app-nav-menu {
    display: flex !important;
  }

  .filter-grid.filter-grid-6 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 1279.98px) {
  .app-navbar-inner {
    flex-wrap: wrap;
  }

  .app-nav-menu.is-open {
    margin-top: 0.25rem;
    padding: 0.85rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 1.15rem;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  }

  .app-nav-state:checked ~ .app-nav-menu {
    margin-top: 0.25rem;
    padding: 0.85rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 1.15rem;
    background: rgba(244, 248, 252, 0.96);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.08);
  }
}

@media print {
  .no-print,
  .app-navbar,
  .app-footer {
    display: none !important;
  }

  .app-main {
    padding: 0 !important;
  }

  .print-only {
    display: block !important;
  }
}
