:root {
  --ink: #5a321f;
  --muted: #7c695b;
  --surface: #ffffff;
  --surface-soft: #fffaf3;
  --line: #eadbc8;
  --primary: #4f9dce;
  --primary-deep: #357fae;
  --mint: #79b990;
  --mint-deep: #4f9a72;
  --danger: #c85d55;
  --shadow: 0 16px 38px rgba(90, 50, 31, 0.12);
  --shadow-soft: 0 8px 22px rgba(90, 50, 31, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans Thai", "Sarabun", sans-serif;
  background: #fbf6ee;
}

a { color: inherit; }

.admin-shell { display: flex; min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  display: flex;
  flex: 0 0 244px;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
  padding: 28px 18px 22px;
  color: #fffaf3;
  background: #69acd3;
  box-shadow: 12px 0 36px rgba(90, 50, 31, 0.12);
}

.brand,
.mobile-brand,
.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  color: inherit;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
}

.brand span,
.mobile-brand span,
.login-brand span { color: inherit; }

.brand-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 3px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 6px 14px rgba(90, 50, 31, 0.16);
}

.sidebar-label {
  margin: 46px 12px 12px;
  color: rgba(234, 244, 255, 0.65);
  font-size: 12px;
  font-weight: 700;
}

.sidebar nav {
  display: grid;
  gap: 5px;
  min-height: 0;
  padding-right: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
  scrollbar-width: thin;
}

nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 15px;
  font-weight: 650;
  text-decoration: none;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.12); }
nav a:focus-visible,
.logout-link:focus-visible,
.primary-link:focus-visible,
.back-link:focus-visible,
button:focus-visible,
input:focus-visible,
.row-link:focus-visible { outline: 3px solid #8ddcf2; outline-offset: 3px; }

nav a.active {
  color: var(--ink);
  background: #fffaf3;
  box-shadow: 0 8px 18px rgba(90, 50, 31, 0.15);
}

.nav-mark {
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  place-items: center;
  overflow: hidden;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.14);
}

.nav-mark img { display: block; width: 100%; height: 100%; object-fit: cover; }
.nav-mark svg { width: 17px; height: 17px; stroke-width: 2.1; }
nav a.active .nav-mark { background: #eaf6fc; }
.mobile-nav-logout { display: none; }

.sidebar-foot { margin-top: auto; padding: 20px 12px 0; }
.admin-presence { display: flex; align-items: center; gap: 8px; color: rgba(255, 255, 255, 0.72); font-size: 12px; }
.admin-presence span { width: 8px; height: 8px; border-radius: 50%; background: #75e6b6; box-shadow: 0 0 0 4px rgba(117, 230, 182, 0.14); }
.logout-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; color: #fff; font-size: 13px; font-weight: 700; text-decoration: none; }
.logout-link img { width: 24px; height: 24px; border-radius: 8px; object-fit: cover; }
.logout-link:hover { text-decoration: underline; }

.dashboard-main { width: min(100%, 1440px); margin: 0 auto; padding: 34px 42px 52px; }
.content-main { padding-top: 34px; }

.topbar,
.section-heading,
.chart-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar { margin-bottom: 28px; }
.eyebrow { margin: 0 0 5px; color: #8291a9; font-size: 12px; font-weight: 750; letter-spacing: 0; text-transform: uppercase; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; color: var(--ink); font-size: clamp(26px, 3vw, 34px); line-height: 1.18; letter-spacing: 0; }
h2 { margin: 0; color: var(--ink); font-size: 22px; line-height: 1.25; letter-spacing: 0; }
h3 { margin: 0; color: var(--ink); font-size: 17px; line-height: 1.3; letter-spacing: 0; }
.title-detail { color: #60718c; font-size: 0.58em; font-weight: 650; }
.date-chip,
.chart-note {
  padding: 9px 12px;
  border: 1px solid #d7e6fb;
  border-radius: 999px;
  color: #3973bc;
  background: #edf6ff;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.welcome-panel {
  position: relative;
  display: grid;
  min-height: 294px;
  grid-template-columns: minmax(300px, 45%) 1fr;
  overflow: hidden;
  border: 1px solid rgba(140, 181, 229, 0.4);
  border-radius: 24px;
  background: linear-gradient(112deg, #fff6e9 0%, #fffdf8 46%, #eaf6fc 100%);
  box-shadow: var(--shadow);
}

.welcome-panel::after { display: none; }

.welcome-copy { z-index: 1; align-self: center; padding: 42px 0 42px 42px; }
.welcome-copy h2 { margin: 0 0 12px; font-size: clamp(28px, 3.5vw, 42px); line-height: 1.12; }
.welcome-copy > p:not(.eyebrow) { max-width: 440px; margin: 0; color: #60718c; font-size: 16px; line-height: 1.6; }
.primary-link {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  margin-top: 24px;
  padding: 0 19px;
  border-radius: 14px;
  color: #fff;
  background: #4f9dce;
  box-shadow: 0 10px 18px rgba(79, 157, 206, 0.24);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.primary-link:hover { transform: translateY(-2px); box-shadow: 0 14px 24px rgba(79, 157, 206, 0.32); }
.welcome-panel img { z-index: 1; align-self: end; width: 100%; height: 100%; min-height: 294px; object-fit: cover; object-position: left center; }

.metrics-section { margin-top: 36px; }
.section-heading { margin-bottom: 16px; }
.section-heading > span { color: #8a98ab; font-size: 12px; }
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.metric-card {
  display: flex;
  min-height: 132px;
  align-items: flex-start;
  gap: 15px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.metric-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.metric-profit-positive { border-color: #bdeee0; background: linear-gradient(135deg, #fbfffd, #eefcf7); }
.metric-profit-positive strong { color: #27876c; }
.metric-profit-negative { border-color: #f3d0d2; background: linear-gradient(135deg, #fffdfd, #fff2f2); }
.metric-profit-negative strong { color: #c14f56; }
.metric-card p { margin: 0 0 4px; color: #657590; font-size: 13px; font-weight: 700; }
.metric-card > div:last-child { min-width: 0; }
.metric-card strong { display: block; color: #1b3457; font-size: clamp(20px, 1.8vw, 27px); line-height: 1.15; letter-spacing: 0; white-space: nowrap; }
.metric-card span:not(.metric-icon) { display: block; margin-top: 6px; color: #8796aa; font-size: 12px; }
.metric-icon { display: grid; flex: 0 0 50px; width: 50px; height: 50px; place-items: center; overflow: hidden; border-radius: 15px; box-shadow: 0 6px 14px rgba(51, 88, 134, 0.1); }
.metric-icon img { display: block; width: 100%; height: 100%; object-fit: cover; }
.metric-icon-line { color: #2f7de1; background: #eaf3ff; }
.metric-icon-line svg { width: 25px; height: 25px; stroke-width: 2; }
.metric-mint .metric-icon-line { color: #27876c; background: #e8f8f1; }
.metric-peach .metric-icon-line { color: #bf7332; background: #fff1e6; }
.metric-lilac .metric-icon-line { color: #7458bb; background: #f1ebff; }
.metric-rose .metric-icon-line { color: #c65067; background: #ffedf2; }

.overview-panels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.overview-card {
  position: relative;
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.overview-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.panel-icon {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
}
.panel-icon img { width: 100%; height: 100%; border-radius: 13px; object-fit: cover; }
.panel-blue { color: #2f7de1; background: #eaf3ff; }
.panel-mint { color: #27876c; background: #e8f8f1; }
.panel-rose { color: #c65067; background: #ffedf2; }

.activity-list { display: grid; }
.activity-row,
.payment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 45px;
  border-bottom: 1px solid #edf1f7;
}
.activity-row:last-child,
.payment-row:last-child { border-bottom: 0; }
.activity-row span { color: #5c6f8a; font-size: 13px; }
.activity-row strong { color: #1b3457; font-size: 13px; white-space: nowrap; }

.summary-stack { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; overflow: hidden; border-radius: 13px; background: #e4ebf6; }
.summary-stack > div { min-width: 0; padding: 14px 12px; background: #f8fbff; }
.summary-stack span,
.status-grid span { display: block; color: #718199; font-size: 11px; font-weight: 700; }
.summary-stack strong,
.status-grid strong { display: block; margin-top: 5px; color: #1b3457; font-size: 17px; font-variant-numeric: tabular-nums; }

.status-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.status-grid > div { min-width: 0; padding: 13px; border-radius: 13px; background: #f7faff; }
.status-grid .status-alert { background: #fff0f1; }
.status-grid .status-alert strong { color: var(--danger); }
.anchor-target { position: absolute; top: -18px; }

.payments-card { margin-top: 18px; }
.payments-card h2 { font-size: 19px; }
.text-link { color: #2674d2; font-size: 13px; font-weight: 750; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.payment-summary { display: flex; flex-wrap: wrap; gap: 10px; margin: -4px 0 10px; }
.payment-summary > span { padding: 7px 10px; border-radius: 999px; color: #60718c; background: #f3f7fc; font-size: 12px; }
.payment-list { display: grid; }
.payment-row { min-height: 58px; }
.payment-row > div { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.payment-row > div:last-child { align-items: flex-end; }
.payment-row strong { color: #1b3457; font-size: 14px; }
.payment-row span { color: #7d8da3; font-size: 12px; }
.status-badge { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 8px; border-radius: 999px; font-weight: 750; }
.status-paid { color: #237a60 !important; background: #e8f8f1; }
.status-pending { color: #9a651d !important; background: #fff4da; }
.status-failed, .status-expired, .status-canceled { color: #b84952 !important; background: #fff0f1; }
.empty-state { padding: 20px; border-radius: 13px; color: #7c8da5; background: #f7faff; font-size: 13px; text-align: center; }

.charts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; margin-top: 36px; }
.chart-box,
.data-section,
.detail-section {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.chart-box { min-height: 370px; padding: 22px; }
.chart-wide { grid-column: auto; }
.chart-title { margin-bottom: 16px; }
.chart-title .eyebrow { margin-bottom: 3px; }
.chart-axis-caption { margin: 6px 0 0; color: #7b8ba0; font-size: 12px; font-weight: 650; line-height: 1.5; }
.chart-mobile-summary { display: none; }
.chart-canvas,
.chart-wide .chart-canvas { position: relative; height: 270px; }
.tier-chart-canvas { height: 300px; }
.chart-canvas canvas { width: 100% !important; height: 100% !important; max-width: 100%; }

.content-main .cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 28px; }
.content-main .card { min-height: 126px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow-soft); }
.card .label { color: #6c7d96; font-size: 13px; font-weight: 700; }
.card .value { margin-top: 8px; color: var(--ink); font-size: 25px; font-weight: 800; }
.card .sub { margin-top: 5px; color: #8796aa; font-size: 12px; }
.neg { color: var(--danger) !important; }

.data-section,
.detail-section { padding: 24px; margin-bottom: 22px; }
.data-section .section-heading { margin-bottom: 20px; }
.table-wrap { overflow-x: auto; border: 1px solid #edf1f7; border-radius: 14px; }
table { width: 100%; min-width: 600px; border-collapse: collapse; background: #fff; }
th, td { padding: 14px 16px; border-bottom: 1px solid #edf1f7; color: #3f526e; font-size: 14px; text-align: left; white-space: nowrap; }
th { color: #657590; background: #f7faff; font-size: 12px; font-weight: 800; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td, tr:hover td { background: #f8fbff; }
.row-link { color: #266fc9; font-weight: 800; text-decoration: none; }
.row-link:hover { color: #154f97; text-decoration: underline; }
.profile-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 18px; }
.profile-row .label { margin-bottom: 4px; color: #7e8ca0; font-size: 12px; font-weight: 750; }
.back-link { color: #2c70c5; font-size: 14px; font-weight: 750; text-decoration: none; }
.back-link:hover { text-decoration: underline; }

.user-edit-form { display: flex; flex-direction: column; gap: 14px; max-width: 360px; }
.user-edit-form label { color: var(--ink); font-size: 14px; font-weight: 750; }
.user-edit-form label:has(input[type="checkbox"]) { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.user-edit-form input[type="checkbox"] { width: auto; min-height: 0; }
.user-edit-form select { width: 100%; min-height: 50px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: #fff; font: inherit; }
.user-edit-form button { width: auto; padding: 0 24px; }

.detail-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.detail-section-heading h2 { font-size: 23px; }
.ai-month-badge { padding: 7px 10px; border-radius: 999px; color: #28745e; background: #e8f8f1; font-size: 12px; font-weight: 800; white-space: nowrap; }
.ai-cost-table-wrap { overflow-x: auto; border: 1px solid #e4edf8; border-radius: 14px; }

/* Dedicated admin sections */
.section-page { container-type: inline-size; }

.section-intro {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  min-height: 132px;
  padding: 22px 24px;
  overflow: hidden;
  border: 1px solid #cfe0f5;
  border-radius: 18px;
  background: linear-gradient(115deg, #f8fbff, #edf6ff);
  box-shadow: var(--shadow-soft);
}

.section-intro-mint { border-color: #cceadf; background: linear-gradient(115deg, #fbfffd, #eefaf5); }
.section-intro-rose { border-color: #f1d9df; background: linear-gradient(115deg, #fffdfd, #fff2f5); }
.section-intro-peach { border-color: #f2dfc8; background: linear-gradient(115deg, #fffefa, #fff6e9); }
.section-intro-sky { border-color: #cce7ef; background: linear-gradient(115deg, #fbfeff, #edfafd); }
.section-intro h2 { font-size: clamp(22px, 2.3vw, 29px); }
.section-intro p:not(.eyebrow) { max-width: 760px; margin: 7px 0 0; color: #60718c; line-height: 1.65; }

.section-intro-icon,
.section-kpi-icon {
  display: grid;
  overflow: hidden;
  place-items: center;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 10px 25px rgba(46, 89, 137, 0.12);
}

.section-intro-icon { width: 76px; height: 76px; }
.section-intro-icon img,
.section-kpi-icon img { display: block; width: 100%; height: 100%; object-fit: cover; }

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 999px;
  color: #28745e;
  background: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.live-pill span { width: 8px; height: 8px; border-radius: 50%; background: #45bd91; box-shadow: 0 0 0 4px rgba(69, 189, 145, 0.14); }

.section-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.section-kpi {
  display: flex;
  min-width: 0;
  min-height: 116px;
  align-items: center;
  gap: 14px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.section-kpi-mint { border-color: #d8eee6; }
.section-kpi-rose { border-color: #f0dce1; }
.section-kpi-peach { border-color: #f0e2d1; }
.section-kpi-sky { border-color: #d7eaf1; }
.section-kpi-icon { flex: 0 0 48px; width: 48px; height: 48px; border-radius: 14px; }
.section-kpi > div:last-child { min-width: 0; }
.section-kpi p { margin: 0; color: #687a94; font-size: 12px; font-weight: 750; }
.section-kpi strong { display: block; margin-top: 4px; color: #1b3457; font-size: clamp(19px, 1.7vw, 25px); line-height: 1.2; font-variant-numeric: tabular-nums; }
.section-kpi span { display: block; margin-top: 5px; color: #8a98ab; font-size: 11px; }

.section-analytics {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.8fr);
  gap: 16px;
  margin-top: 18px;
}
.section-chart,
.section-insights {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.section-chart-canvas { position: relative; height: 300px; }
.section-chart-doughnut { max-width: 560px; margin-inline: auto; }
.section-chart-canvas canvas { width: 100% !important; height: 100% !important; }

.insight-list { display: grid; gap: 1px; overflow: hidden; border-radius: 14px; background: #e5edf7; }
.insight-row { display: grid; gap: 5px; min-height: 64px; align-content: center; padding: 12px 14px; background: #f8fbff; }
.insight-row span { color: #73839b; font-size: 11px; font-weight: 700; }
.insight-row strong { color: #1b3457; font-size: 14px; line-height: 1.4; }

.section-data { margin-top: 18px; }
.section-table { min-width: 760px; }
.section-table td { vertical-align: middle; }
.section-table small { display: block; margin-top: 3px; color: #8a98ab; font-size: 11px; }
.table-value { color: #314b6d; font-weight: 650; }

.section-empty {
  display: grid;
  min-height: 220px;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px dashed #cfdaea;
  border-radius: 14px;
  color: #7b8ca4;
  background: #f8fbff;
  text-align: center;
}
.section-empty img { width: 64px; height: 64px; border-radius: 18px; object-fit: cover; }
.section-empty strong { color: #2b4669; font-size: 16px; }
.section-empty span { font-size: 12px; }
.ai-summary-grid,
.ai-cost-table { min-width: 790px; }
.ai-summary-grid {
  display: grid;
  grid-template-columns: 22% 10% 19% 19% 15% 15%;
  align-items: stretch;
  border-bottom: 1px solid #dce8f7;
  background: linear-gradient(90deg, #f2f8ff, #fbfdff);
}
.ai-summary-intro { grid-column: span 2; padding: 15px 16px; border-right: 1px solid #dce8f7; }
.ai-summary-intro span,
.ai-summary-stat span { display: block; color: #7c8da5; font-size: 12px; font-weight: 750; }
.ai-summary-intro strong { display: block; margin-top: 3px; color: #1d3a61; font-size: 15px; }
.ai-summary-stat { padding: 15px 12px; border-right: 1px solid #dce8f7; }
.ai-summary-stat:last-child { border-right: 0; }
.ai-summary-stat strong { display: block; margin-top: 4px; color: #1b365b; font-size: 17px; line-height: 1.15; }
.ai-cost-table { min-width: 790px; table-layout: fixed; }
.ai-cost-table col:nth-child(1) { width: 22%; }
.ai-cost-table col:nth-child(2) { width: 10%; }
.ai-cost-table col:nth-child(3),
.ai-cost-table col:nth-child(4) { width: 19%; }
.ai-cost-table col:nth-child(5),
.ai-cost-table col:nth-child(6) { width: 15%; }
.ai-cost-table th,
.ai-cost-table td { padding-left: 16px; padding-right: 16px; }

.login-page { min-height: 100vh; background: #fff6e9; }
.login-layout { display: grid; min-height: 100vh; grid-template-columns: minmax(0, 1.12fr) minmax(400px, 0.88fr); }
.login-visual { position: relative; overflow: hidden; min-height: 620px; color: var(--ink); background: #fff6e9; }
.login-visual::after { display: none; }
.login-brand { position: absolute; z-index: 2; top: 34px; left: 46px; }
.login-visual-copy { position: absolute; z-index: 2; left: 46px; bottom: 58px; }
.login-visual-copy p { margin: 0 0 8px; color: #6b594c; font-size: 14px; font-weight: 700; }
.login-visual-copy strong { font-size: clamp(26px, 3.2vw, 42px); line-height: 1.22; }
.login-visual > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.login-panel { display: grid; place-items: center; padding: 40px; background: #fffdf8; }
.login-form { width: min(100%, 390px); }
.mobile-brand { display: none; color: var(--ink); margin-bottom: 44px; }
.login-form h1 { margin-bottom: 10px; font-size: 32px; }
.login-description { margin: 0 0 30px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.login-form label { display: block; margin-bottom: 8px; color: var(--ink); font-size: 14px; font-weight: 750; }
input { width: 100%; min-height: 50px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: #fff; font: inherit; transition: border-color 180ms ease, box-shadow 180ms ease; }
input::placeholder { color: #9aa8ba; }
input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79, 157, 206, 0.15); outline: 0; }
button { width: 100%; min-height: 50px; margin-top: 18px; border: 0; border-radius: 13px; color: var(--ink); background: var(--primary); box-shadow: 0 10px 20px rgba(79, 157, 206, 0.24); cursor: pointer; font: inherit; font-weight: 800; transition: transform 180ms ease, box-shadow 180ms ease; }
button:hover { transform: translateY(-2px); box-shadow: 0 14px 25px rgba(79, 157, 206, 0.3); }
.error { margin: 0 0 18px; padding: 11px 13px; border-radius: 11px; color: #aa3e46; background: #fff0f1; font-size: 13px; line-height: 1.45; }
.login-note { margin: 18px 0 0; color: #8997aa; font-size: 12px; text-align: center; }

@media (max-width: 1080px) {
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-panels { grid-template-columns: 1fr 1fr; }
  .overview-panels .overview-card:last-child { grid-column: 1 / -1; }
  .content-main .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-analytics { grid-template-columns: 1fr; }
  .section-insights .insight-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-main { padding: 30px 28px 46px; }
}

@media (max-width: 820px) {
  .admin-shell { display: block; }
  .sidebar { position: static; align-self: auto; height: auto; max-height: none; min-height: auto; padding: 18px; }
  .sidebar-label, .sidebar-foot { display: none; }
  .sidebar nav { display: flex; gap: 6px; margin-top: 18px; padding: 0 0 4px; overflow-x: auto; overflow-y: hidden; }
  .sidebar nav a { flex: 0 0 auto; min-height: 42px; padding: 8px 10px; font-size: 13px; }
  .mobile-nav-logout { display: flex; }
  .dashboard-main { padding: 24px 18px 38px; }
  .welcome-panel { grid-template-columns: 1fr; min-height: auto; }
  .welcome-copy { padding: 30px 28px 26px; }
  .welcome-panel img { min-height: 230px; margin-top: 0; object-position: left center; }
  .charts { grid-template-columns: 1fr; }
  .chart-wide { grid-column: auto; }
  .login-layout { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; padding: 28px 22px; }
  .mobile-brand { display: inline-flex; }
}

@media (max-width: 560px) {
  .topbar, .section-heading, .chart-title { align-items: flex-start; flex-direction: column; }
  .date-chip { white-space: normal; }
  .metrics-grid, .content-main .cards { grid-template-columns: 1fr; }
  .overview-panels { grid-template-columns: 1fr; }
  .overview-panels .overview-card:last-child { grid-column: auto; }
  .summary-stack { grid-template-columns: 1fr; }
  .payment-row { align-items: flex-start; }
  .payment-row > div:last-child { align-items: flex-end; }
  .metric-card { min-height: 116px; }
  .section-intro {
    grid-template-columns: 60px minmax(0, 1fr);
    gap: 14px;
    padding: 18px;
  }
  .section-intro-icon { width: 60px; height: 60px; border-radius: 15px; }
  .section-intro .live-pill { grid-column: 1 / -1; width: max-content; }
  .section-intro p:not(.eyebrow) { font-size: 14px; }
  .section-kpis { grid-template-columns: 1fr; }
  .section-kpi { min-height: 100px; }
  .section-chart, .section-insights { padding: 18px; }
  .section-chart-canvas { height: 240px; }
  .section-chart-doughnut { height: 280px; }
  .section-insights .insight-list { grid-template-columns: 1fr; }
  .chart-box, .data-section, .detail-section { padding: 18px; }
  .chart-box { min-height: 0; }
  .chart-title { gap: 8px; }
  .chart-axis-caption { font-size: 11px; }
  .chart-note { padding: 7px 10px; }
  .chart-mobile-summary { display: block; margin: 10px 0 0; color: #244d7b; font-size: 13px; font-weight: 750; line-height: 1.5; }
  .chart-canvas, .chart-wide .chart-canvas { height: 220px; }
  .tier-chart-canvas { height: 280px; }
  .sidebar nav { margin-left: -4px; margin-right: -4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
