:root {
  --navy-950: #061426;
  --navy-900: #081b33;
  --navy-800: #0b2e4a;
  --navy-700: #123d61;
  --gold-500: #c79a3b;
  --gold-100: #fff3d6;
  --green-600: #15803d;
  --green-100: #dcfce7;
  --yellow-600: #ca8a04;
  --yellow-100: #fef9c3;
  --red-600: #dc2626;
  --red-100: #fee2e2;
  --blue-600: #2563eb;
  --blue-100: #dbeafe;
  --purple-600: #7c3aed;
  --purple-100: #ede9fe;
  --slate-950: #020617;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 12px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #eef3f8;
  color: var(--slate-800);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body.dark-mode {
  background: #07111f;
  color: #dbeafe;
  --white: #0f1b2d;
  --slate-950: #f8fafc;
  --slate-800: #e2e8f0;
  --slate-700: #cbd5e1;
  --slate-600: #94a3b8;
  --slate-500: #8fa3b8;
  --slate-400: #64748b;
  --slate-300: #334155;
  --slate-200: #22324a;
  --slate-100: #142238;
  --slate-50: #0b1728;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 14px 34px rgba(0, 0, 0, 0.34);
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.46);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 180ms ease;
}

.app-shell.sidebar-hidden {
  grid-template-columns: 0 minmax(0, 1fr);
}

.app-shell.sidebar-hidden .sidebar {
  transform: translateX(-100%);
  visibility: hidden;
}

.sidebar-backdrop {
  display: none;
}

body.sidebar-drawer-open {
  overflow: hidden;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background: linear-gradient(180deg, var(--navy-950) 0%, var(--navy-900) 52%, #04101f 100%);
  color: #dbeafe;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 180ms ease, visibility 180ms ease;
}

.brand-block {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-nav {
  height: calc(100vh - 154px);
  overflow-y: auto;
  padding-bottom: 18px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  color: var(--navy-950);
  font-weight: 900;
  background: linear-gradient(135deg, #f9d67a, var(--gold-500));
  border-radius: 11px;
  box-shadow: 0 10px 28px rgba(199, 154, 59, 0.28);
}

.brand-logo {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  object-fit: cover;
  background: var(--white);
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.brand-title {
  margin: 0;
  color: var(--white);
  font-size: 15px;
  line-height: 1.2;
  font-weight: 800;
}

.brand-subtitle {
  display: none;
}

.sidebar-section {
  padding: 14px 12px 2px;
}

.sidebar-section-title {
  margin: 10px 8px 8px;
  color: #8fa3b8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 9px 10px;
  margin-bottom: 3px;
  color: #c6d6e6;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 650;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--white);
}

.sidebar-link.active {
  background: linear-gradient(90deg, rgba(199, 154, 59, 0.24), rgba(199, 154, 59, 0.08));
  color: var(--white);
  box-shadow: inset 3px 0 0 var(--gold-500);
}

.sidebar-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--gold-500);
  border: 1px solid rgba(199, 154, 59, 0.25);
  border-radius: 6px;
}

.sidebar-icon svg,
.icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.sidebar-badge {
  margin-left: auto;
  min-width: 22px;
  padding: 2px 7px;
  color: #172033;
  background: #f5c75f;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.sidebar-footer {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 12px;
  background: linear-gradient(180deg, rgba(4, 16, 31, 0.72), #04101f 55%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.logout-button {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 12px;
  color: #fee2e2;
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.28);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 850;
}

.logout-button:hover {
  color: #ffffff;
  background: rgba(220, 38, 38, 0.2);
}

.main-area {
  min-width: 0;
}

.top-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 26px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--slate-200);
  backdrop-filter: blur(14px);
}

body.dark-mode .top-header {
  background: rgba(15, 27, 45, 0.92);
}

.header-left {
  display: flex;
  gap: 14px;
  align-items: center;
  min-width: 0;
}

.hamburger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  color: var(--navy-800);
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.header-user {
  position: relative;
}

.user-button {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 6px 10px 6px 6px;
  color: var(--slate-700);
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}

.avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--white);
  background: linear-gradient(135deg, var(--navy-800), var(--gold-500));
  border-radius: 50%;
  font-size: 12px;
  font-weight: 900;
}

.user-name {
  font-size: 13px;
  font-weight: 850;
}

.user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  width: 190px;
  padding: 8px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
}

.user-menu-name {
  display: none;
  padding: 10px 12px 12px;
  border-bottom: 1px solid var(--slate-200);
}

.user-menu-name strong,
.user-menu-name span {
  display: block;
}

.user-menu-name strong {
  color: var(--slate-900);
  font-size: 13px;
  line-height: 1.25;
}

.user-menu-name span {
  margin-top: 3px;
  color: var(--slate-500);
  font-size: 11px;
  font-weight: 750;
}

.user-menu a,
.user-menu button {
  display: flex;
  gap: 9px;
  align-items: center;
  width: 100%;
  padding: 10px;
  color: var(--slate-700);
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 750;
  text-align: left;
}

.user-menu a:hover,
.user-menu button:hover {
  background: var(--slate-50);
  color: var(--navy-800);
}

body.dark-mode .user-menu a:hover,
body.dark-mode .user-menu button:hover {
  color: var(--gold-500);
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  background: var(--slate-100);
  border: 1px solid var(--slate-200);
  border-radius: 999px;
}

.theme-option {
  min-height: 32px;
  padding: 6px 11px;
  color: var(--slate-600);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.theme-option.active {
  color: var(--navy-800);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

body.dark-mode .theme-option.active {
  color: var(--gold-500);
}

.page-kicker {
  margin: 0 0 4px;
  color: var(--gold-500);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-title {
  margin: 0;
  color: var(--slate-950);
  font-size: 26px;
  line-height: 1.12;
  font-weight: 850;
}

.page-description {
  margin: 6px 0 0;
  max-width: 760px;
  color: var(--slate-500);
  font-size: 14px;
  line-height: 1.45;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-box {
  position: relative;
}

.search-box input {
  width: 260px;
  height: 40px;
  padding: 0 14px 0 38px;
  color: var(--slate-800);
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  outline: none;
}

.search-box input:focus,
.control:focus,
.form-control:focus {
  border-color: rgba(199, 154, 59, 0.75);
  box-shadow: 0 0 0 3px rgba(199, 154, 59, 0.16);
}

.search-symbol {
  position: absolute;
  left: 13px;
  top: 50%;
  color: var(--slate-400);
  transform: translateY(-50%);
}

.content {
  padding: 26px;
}

.section {
  margin-bottom: 26px;
}

.section-header {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title {
  margin: 0;
  color: var(--slate-950);
  font-size: 18px;
  line-height: 1.25;
  font-weight: 850;
}

.section-note {
  margin: 4px 0 0;
  color: var(--slate-500);
  font-size: 13px;
}

.grid {
  display: grid;
  gap: 16px;
}

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

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

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

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

.card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

[data-export-card] {
  position: relative;
}

.card-tools {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 4;
  display: flex;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 150ms ease, transform 150ms ease;
}

[data-export-card]:hover .card-tools,
[data-export-card]:focus-within .card-tools {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--slate-600);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.tool-btn:hover {
  color: var(--navy-800);
  border-color: rgba(199, 154, 59, 0.55);
  transform: translateY(-1px);
}

.card-tools + .kpi-top,
.card-tools + .section-title {
  padding-right: 76px;
}

.card-pad {
  padding: 18px;
}

.kpi-card {
  position: relative;
  min-height: 168px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.96)),
    radial-gradient(circle at 84% 12%, rgba(199, 154, 59, 0.22), transparent 28%);
  box-shadow: var(--shadow-md);
}

body.dark-mode .kpi-card {
  background:
    linear-gradient(180deg, rgba(15, 27, 45, 0.96), rgba(11, 23, 40, 0.96)),
    radial-gradient(circle at 84% 12%, rgba(199, 154, 59, 0.16), transparent 28%);
}

.kpi-card::after {
  content: "";
  position: absolute;
  right: -44px;
  top: -44px;
  width: 110px;
  height: 110px;
  background: rgba(199, 154, 59, 0.12);
  border-radius: 50%;
}

.kpi-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.kpi-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--navy-800);
  background: var(--gold-100);
  border: 1px solid rgba(199, 154, 59, 0.28);
  border-radius: 8px;
}

body.dark-mode .kpi-icon {
  color: var(--gold-500);
  background: rgba(199, 154, 59, 0.12);
}

.kpi-label {
  margin: 0;
  color: var(--slate-500);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.kpi-value {
  margin: 12px 0 0;
  color: var(--slate-950);
  font-size: 32px;
  line-height: 1;
  font-weight: 900;
}

.kpi-spark {
  display: flex;
  gap: 4px;
  align-items: end;
  height: 32px;
  margin-top: 14px;
}

.kpi-spark span {
  width: 100%;
  min-width: 8px;
  background: linear-gradient(180deg, var(--gold-500), var(--navy-800));
  border-radius: 999px 999px 2px 2px;
}

.insight-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  background: linear-gradient(135deg, var(--navy-950), var(--navy-800));
  color: var(--white);
  border: none;
  box-shadow: var(--shadow-lg);
}

.insight-card .section-title,
.insight-card .section-note {
  color: var(--white);
}

.insight-card .section-note {
  color: #cbd5e1;
}

.insight-card::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -80px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(199, 154, 59, 0.34), transparent 68%);
}

.kpi-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
  color: var(--slate-500);
  font-size: 12px;
}

.kpi-trend {
  color: var(--green-600);
  font-weight: 850;
}

.filter-bar {
  display: grid;
  grid-template-columns: 1.45fr repeat(5, minmax(145px, 1fr)) auto;
  gap: 10px;
  padding: 14px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.control,
.form-control {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  color: var(--slate-800);
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  outline: none;
}

textarea.form-control {
  min-height: 92px;
  resize: vertical;
}

.btn {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

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

.btn-primary {
  color: var(--white);
  background: var(--navy-800);
  box-shadow: 0 10px 22px rgba(6, 27, 51, 0.18);
}

.btn-gold {
  color: #172033;
  background: var(--gold-500);
  box-shadow: 0 10px 22px rgba(199, 154, 59, 0.2);
}

.btn-secondary {
  color: var(--slate-700);
  background: var(--white);
  border-color: var(--slate-200);
}

.btn-danger {
  color: var(--white);
  background: var(--red-600);
}

.btn-ghost {
  color: var(--slate-600);
  background: transparent;
  border-color: transparent;
}

.btn-icon {
  width: 38px;
  min-width: 38px;
  padding: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.badge-green {
  color: var(--green-600);
  background: var(--green-100);
}

.badge-yellow {
  color: #854d0e;
  background: var(--yellow-100);
}

.badge-gold {
  color: #593f09;
  background: rgba(199, 154, 59, 0.18);
  border: 1px solid rgba(199, 154, 59, 0.28);
}

.badge-red {
  color: var(--red-600);
  background: var(--red-100);
}

.badge-blue {
  color: var(--blue-600);
  background: var(--blue-100);
}

.badge-purple {
  color: var(--purple-600);
  background: var(--purple-100);
}

.badge-grey {
  color: var(--slate-600);
  background: var(--slate-100);
}

.chart-card {
  min-height: 390px;
}

.chart-shell {
  display: grid;
  place-items: center;
  min-height: 290px;
  padding: 8px;
}

.chart-canvas {
  width: 100%;
  height: 290px;
}

.chart-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  color: var(--slate-500);
  font-size: 12px;
  font-weight: 750;
}

.chart-row {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.donut {
  width: 162px;
  height: 162px;
  border-radius: 50%;
  background:
    conic-gradient(var(--green-600) 0 31%, var(--yellow-600) 31% 58%, var(--red-600) 58% 75%, var(--slate-400) 75% 100%);
  position: relative;
}

.donut::after {
  content: "72%";
  position: absolute;
  inset: 28px;
  display: grid;
  place-items: center;
  color: var(--navy-900);
  background: var(--white);
  border-radius: 50%;
  font-size: 26px;
  font-weight: 900;
}

.legend {
  display: grid;
  gap: 9px;
}

.legend-item {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--slate-600);
  font-size: 12px;
  font-weight: 700;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.bar-chart {
  display: grid;
  gap: 12px;
  width: 100%;
}

.bar-line {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) 42px;
  gap: 10px;
  align-items: center;
  color: var(--slate-600);
  font-size: 12px;
  font-weight: 750;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  background: var(--slate-100);
  border-radius: 999px;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--navy-800), var(--gold-500));
  border-radius: 999px;
}

.line-chart {
  width: 100%;
  min-height: 220px;
}

.heatmap {
  display: grid;
  grid-template-columns: 130px repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.heatmap-cell {
  min-height: 38px;
  display: grid;
  place-items: center;
  padding: 7px;
  color: var(--slate-700);
  background: var(--slate-100);
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.heatmap-head {
  color: var(--slate-500);
  background: transparent;
}

.heat-low {
  background: var(--green-100);
  color: var(--green-600);
}

.heat-mid {
  background: var(--yellow-100);
  color: #854d0e;
}

.heat-high {
  background: var(--red-100);
  color: var(--red-600);
}

.table-wrap {
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

body.dark-mode tbody tr:hover td {
  background: #101f34;
}

.table-panel {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
}

.table-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--slate-200);
}

.table-toolbar .search-box input {
  width: 100%;
}

.table-footer {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px;
  border-top: 1px solid var(--slate-200);
}

.pagination {
  display: flex;
  gap: 6px;
  align-items: center;
}

.pagination .btn[disabled] {
  opacity: 0.45;
  pointer-events: none;
}

.action-group {
  display: flex;
  gap: 6px;
  align-items: center;
}

.action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: var(--slate-600);
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 8px;
}

.action-icon.primary {
  color: var(--white);
  background: var(--navy-800);
  border-color: var(--navy-800);
}

.action-icon.danger {
  color: var(--red-600);
  background: var(--red-100);
  border-color: #fecaca;
}

.action-icon:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  padding: 12px 14px;
  color: var(--slate-500);
  background: var(--slate-50);
  border-bottom: 1px solid var(--slate-200);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
}

td {
  padding: 14px;
  color: var(--slate-700);
  border-bottom: 1px solid var(--slate-100);
  font-size: 13px;
  vertical-align: middle;
}

tbody tr:hover td {
  background: #fbfdff;
}

.row-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 28px;
  color: var(--navy-800);
  background: #eef6ff;
  border: 1px solid #d9ebff;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 900;
}

.expand-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(2, 6, 23, 0.68);
  backdrop-filter: blur(8px);
}

.expand-overlay[hidden] {
  display: none !important;
}

.expand-dialog {
  position: relative;
  width: min(1180px, 96vw);
  max-height: 92vh;
  overflow: auto;
  background: var(--white);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
}

.expand-close {
  position: sticky;
  top: 14px;
  z-index: 2;
  float: right;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin: 14px 14px 0 0;
  color: var(--slate-700);
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.expand-content {
  padding: 22px;
}

.expand-content .card {
  box-shadow: none;
}

.expand-content .chart-card {
  min-height: 620px;
}

.expand-content .chart-shell {
  min-height: 500px;
}

.expand-content .chart-canvas {
  height: 500px;
}

.export-clone {
  position: fixed;
  left: -99999px;
  top: 0;
  width: 900px;
  background: var(--white);
}

tr:last-child td {
  border-bottom: none;
}

.table-title {
  color: var(--slate-950);
  font-weight: 850;
}

.table-sub {
  margin-top: 3px;
  color: var(--slate-500);
  font-size: 12px;
}

.progress {
  height: 8px;
  overflow: hidden;
  background: var(--slate-100);
  border-radius: 999px;
}

.progress-fill {
  height: 100%;
  background: var(--gold-500);
  border-radius: 999px;
}

.component-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.component-nav a {
  padding: 8px 10px;
  color: var(--slate-600);
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
}

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

.field {
  display: grid;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

.label {
  color: var(--slate-700);
  font-size: 12px;
  font-weight: 850;
}

.help {
  color: var(--slate-500);
  font-size: 12px;
}

.error-text {
  color: var(--red-600);
  font-size: 12px;
  font-weight: 750;
}

.upload-box {
  display: grid;
  place-items: center;
  min-height: 116px;
  padding: 18px;
  color: var(--slate-500);
  background: var(--slate-50);
  border: 1px dashed var(--slate-300);
  border-radius: 8px;
  text-align: center;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.choice {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 9px 11px;
  color: var(--slate-700);
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

.toggle {
  position: relative;
  width: 46px;
  height: 26px;
  background: var(--navy-800);
  border-radius: 999px;
}

.toggle::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 4px;
  width: 18px;
  height: 18px;
  background: var(--white);
  border-radius: 50%;
}

.alert {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
}

.alert strong {
  display: block;
  margin-bottom: 2px;
  color: var(--slate-950);
}

.alert-info {
  background: var(--blue-100);
  color: #1d4ed8;
}

.alert-warning {
  background: var(--yellow-100);
  color: #854d0e;
}

.modal-preview {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(8, 27, 51, 0.88), rgba(8, 27, 51, 0.72));
  border-radius: 8px;
}

.modal-box {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(420px, calc(100% - 32px));
  padding: 18px;
  background: var(--white);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, -50%);
}

.login-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  min-height: 460px;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.login-panel {
  padding: 34px;
}

.login-art {
  display: grid;
  align-content: center;
  padding: 34px;
  color: var(--white);
  background:
    radial-gradient(circle at 30% 30%, rgba(199, 154, 59, 0.42), transparent 28%),
    linear-gradient(145deg, var(--navy-950), var(--navy-800));
}

body.dark-mode .login-art {
  background:
    radial-gradient(circle at 30% 30%, rgba(199, 154, 59, 0.32), transparent 28%),
    linear-gradient(145deg, #020617, var(--navy-900));
}

body.dark-mode .modal-preview {
  background: linear-gradient(135deg, rgba(2, 6, 23, 0.92), rgba(8, 27, 51, 0.78));
}

.login-art h3 {
  margin: 0;
  font-size: 26px;
  line-height: 1.14;
}

.login-art p {
  margin: 12px 0 0;
  color: #cbd5e1;
  line-height: 1.55;
}

.refresh-chip {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  color: var(--navy-800);
  background: #edf6ff;
  border: 1px solid #cfe6ff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.refresh-dot {
  width: 8px;
  height: 8px;
  background: var(--green-600);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(21, 128, 61, 0.12);
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.page-break {
  height: 1px;
  margin: 28px 0;
  background: var(--slate-200);
}

.back-row {
  margin-bottom: -10px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 520px);
  background:
    radial-gradient(circle at 18% 18%, rgba(199, 154, 59, 0.16), transparent 26%),
    linear-gradient(135deg, #061b33 0%, #0b2e4a 56%, #04101f 100%);
}

.login-visual {
  position: relative;
  display: grid;
  align-content: space-between;
  min-height: 100vh;
  padding: 42px;
  color: #ffffff;
  overflow: hidden;
}

.login-visual::before,
.login-visual::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.login-visual::before {
  inset: 86px 10% auto auto;
  width: min(520px, 70vw);
  aspect-ratio: 1;
  border: 1px solid rgba(199, 154, 59, 0.22);
  border-radius: 50%;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle, #000 45%, transparent 70%);
}

.login-visual::after {
  right: 52px;
  bottom: 84px;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(199, 154, 59, 0.38), transparent 62%);
  filter: blur(4px);
}

.login-brand {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 14px;
  align-items: center;
}

.login-logo {
  width: 56px;
  height: 56px;
  object-fit: cover;
  background: #ffffff;
  border: 2px solid rgba(199, 154, 59, 0.65);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.login-brand-title {
  margin: 0;
  max-width: 420px;
  font-size: 18px;
  line-height: 1.22;
}

.login-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 680px;
}

.login-hero-copy h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: 0;
}

.login-hero-copy p {
  max-width: 560px;
  margin: 18px 0 0;
  color: #cbd5e1;
  font-size: 16px;
  line-height: 1.7;
}

.login-security-row {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.login-auth-panel {
  display: grid;
  place-items: center;
  padding: 34px;
  background: rgba(248, 250, 252, 0.94);
}

.login-card {
  width: min(100%, 430px);
  padding: 30px;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.24);
}

.login-card h2 {
  margin: 0;
  color: var(--navy-900);
  font-size: 28px;
  line-height: 1.18;
}

.login-card > p {
  margin: 9px 0 24px;
  color: var(--slate-600);
  line-height: 1.55;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--slate-600);
  font-size: 13px;
}

.login-check {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.login-forgot {
  color: var(--navy-800);
  font-weight: 850;
}

.login-submit {
  justify-content: center;
  width: 100%;
}

.login-footnote {
  margin-top: 18px;
  padding-top: 18px;
  color: var(--slate-500);
  border-top: 1px solid var(--slate-200);
  font-size: 12px;
  line-height: 1.55;
}

@media (max-width: 1200px) {
  .grid-4,
  .grid-6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

@media (max-width: 960px) {
  .app-shell,
  .app-shell.sidebar-hidden {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 70;
    width: min(86vw, 326px);
    height: 100dvh;
    transform: translateX(-104%);
    visibility: hidden;
    box-shadow: 24px 0 80px rgba(2, 6, 23, 0.38);
  }

  .app-shell.sidebar-hidden .sidebar {
    transform: translateX(-104%);
    visibility: hidden;
  }

  .app-shell.sidebar-mobile-open .sidebar {
    transform: translateX(0);
    visibility: visible;
  }

  .app-shell.sidebar-mobile-open .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(2, 6, 23, 0.5);
    border: 0;
    backdrop-filter: blur(3px);
  }

  .sidebar-nav {
    height: calc(100dvh - 154px);
    max-height: none;
  }

  .sidebar-footer {
    position: absolute;
  }

  .top-header {
    padding: 13px 16px;
  }

  .page-title {
    max-width: 52vw;
    font-size: 20px;
    line-height: 1.14;
  }

  .content {
    padding: 20px;
  }

  .chart-shell {
    min-height: 250px;
  }

  .chart-canvas {
    height: 250px;
  }
}

@media (max-width: 760px) {
  .top-header {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }

  .header-left {
    flex: 1 1 190px;
    gap: 10px;
  }

  .header-actions {
    flex: 1 1 100%;
    justify-content: space-between;
  }

  .hamburger,
  .user-button {
    min-width: 40px;
    min-height: 40px;
    height: 40px;
  }

  .hamburger {
    width: 40px;
  }

  .user-button {
    gap: 7px;
    padding: 5px 8px 5px 5px;
  }

  .user-name {
    display: none;
  }

  .user-menu {
    right: 0;
    min-width: 236px;
  }

  .user-menu-name {
    display: block;
  }

  .theme-option {
    min-height: 30px;
    padding: 5px 9px;
    font-size: 11px;
  }

  .refresh-chip {
    min-height: 30px;
    padding: 6px 8px;
    font-size: 11px;
  }

  .page-kicker {
    margin-bottom: 2px;
    font-size: 10px;
  }

  .page-title {
    max-width: 100%;
    font-size: 18px;
  }

  .content {
    padding: 16px;
  }

  .grid-2,
  .grid-3,
  .grid-4,
  .grid-6,
  .form-grid,
  .login-preview {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    grid-template-columns: 1fr;
  }

  .section {
    margin-bottom: 18px;
  }

  .section-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .section-title {
    font-size: 16px;
  }

  .section-note,
  .help,
  .alert {
    font-size: 12px;
  }

  .kpi-value {
    font-size: 30px;
  }

  .kpi-icon {
    width: 38px;
    height: 38px;
  }

  .card-pad {
    padding: 16px;
  }

  .table-toolbar {
    grid-template-columns: 1fr;
  }

  .table-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .pagination {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .search-box input {
    width: 100%;
  }

  .chart-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .heatmap {
    grid-template-columns: 1fr 1fr;
  }

  .table-wrap {
    overflow-x: auto;
  }

  table {
    min-width: 820px;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-visual {
    min-height: auto;
    padding: 26px;
    gap: 40px;
  }

  .login-auth-panel {
    padding: 22px;
  }

  .login-options {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .top-header {
    padding: 11px 12px;
  }

  .header-actions {
    gap: 7px;
  }

  .theme-switch {
    order: 1;
  }

  [data-refresh-slot] {
    order: 2;
  }

  .header-user {
    order: 3;
  }

  .refresh-chip {
    max-width: 142px;
  }

  .content {
    padding: 12px;
  }

  .sidebar {
    width: min(90vw, 318px);
  }

  .brand-title {
    font-size: 13px;
  }

  .brand-logo {
    width: 42px;
    height: 42px;
  }

  .brand-block {
    min-height: 74px;
    padding: 12px;
  }

  .sidebar-nav {
    height: calc(100dvh - 140px);
  }

  .login-auth-panel,
  .login-visual {
    padding: 18px;
  }

  .login-card {
    padding: 22px;
  }
}
