:root {
  --bg: #e8f0ef;
  --ink: #0f2430;
  --muted: #5a7380;
  --line: #d3e0e2;
  --card: #ffffff;
  --brand: #0a7c74;
  --brand-2: #06635d;
  --brand-soft: #e4f6f3;
  --accent: #d97706;
  --ok: #0f7a3c;
  --warn: #9a6b00;
  --err: #b42318;
  --shadow: 0 8px 24px rgba(15, 36, 48, 0.07);
  --radius: 14px;
  --sidebar: #063f3c;
  --sidebar-2: #0a5852;
}
* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html, body {
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
}
body {
  color: var(--ink);
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  background:
    radial-gradient(1000px 420px at 0% -5%, rgba(10, 124, 116, 0.16) 0%, transparent 55%),
    radial-gradient(800px 360px at 100% 0%, rgba(217, 119, 6, 0.12) 0%, transparent 50%),
    linear-gradient(180deg, #edf4f3 0%, var(--bg) 40%);
  min-height: 100vh;
}
a { color: var(--brand-2); text-decoration: none; }
.shell {
  display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh;
  width: 100%; max-width: 100%;
}
.shell > * { min-width: 0; }
.sidebar-backdrop { display: none; }
.sidebar {
  background: linear-gradient(185deg, var(--sidebar-2) 0%, var(--sidebar) 70%);
  color: #e8fffb;
  padding: 26px 18px;
  box-shadow: inset -1px 0 0 rgba(255,255,255,.06);
}
.brand {
  font-size: 19px; font-weight: 800; letter-spacing: -.02em;
  padding: 4px 8px 18px; border-bottom: 1px solid rgba(255,255,255,.12);
}
.brand small {
  display: block; opacity: .72; font-weight: 500; font-size: 11px;
  margin-top: 6px; letter-spacing: .04em; text-transform: uppercase;
}
.nav { margin-top: 20px; display: grid; gap: 4px; }
.nav a {
  color: #d7f5f0;
  padding: 11px 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13.5px;
  transition: background .15s ease, transform .15s ease;
}
.nav a.active {
  background: rgba(255,255,255,.16);
  box-shadow: inset 3px 0 0 #7ee0d4;
}
.nav a:hover { background: rgba(255,255,255,.1); }
.main { padding: 24px 28px 40px; width: 100%; max-width: 1280px; min-width: 0; overflow-x: hidden; }
.top {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: rgba(255,255,255,.82); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px 18px; box-shadow: var(--shadow); backdrop-filter: blur(8px);
  flex-wrap: nowrap;
}
.top h1 { margin: 0; font-size: 22px; letter-spacing: -.02em; font-weight: 800; }
.top p, .top-sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.top-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; flex-wrap: nowrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 10px; padding: 10px 16px;
  background: var(--brand); color: #fff; font-weight: 700; cursor: pointer;
  width: auto; margin-top: 0; font-family: inherit; font-size: 13.5px;
  transition: background .15s ease, transform .1s ease;
}
.btn:hover { background: var(--brand-2); }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: #1d6fd8; }
.btn.secondary:hover { background: #1557ad; }
.btn.ghost { background: #fff; color: var(--brand-2); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--brand); background: var(--brand-soft); }
.btn.danger { background: var(--err); }
.btn.sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; align-items: center; }
.grid { display: grid; gap: 16px; margin-top: 18px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.cards-2 { grid-template-columns: 1.15fr 1fr; }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); max-width: 100%; min-width: 0;
}
.grid > * { min-width: 0; }
.card h3 {
  margin: 0 0 10px; font-size: 15px; font-weight: 750; letter-spacing: -.01em;
  display: flex; align-items: center; gap: 8px;
}
.card h3::before {
  content: ""; width: 4px; height: 16px; border-radius: 4px; background: var(--brand); flex-shrink: 0;
}
.muted { color: var(--muted); font-size: 13px; line-height: 1.45; }
.kpi-value { font-size: 28px; font-weight: 800; margin-top: 6px; letter-spacing: -.03em; color: var(--ink); }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
label { display: block; margin-top: 10px; font-size: 12px; font-weight: 700; color: #3d5a68; }
input, select, textarea {
  width: 100%; margin-top: 6px; padding: 11px 12px; border-radius: 10px;
  border: 1px solid #c5d5da; background: #fff; font-family: inherit; font-size: 14px; color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(10, 124, 116, 0.18);
}
form.card > button[type=submit], .modal form > button[type=submit] { width: 100%; margin-top: 14px; }
.table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border-radius: 10px; border: 1px solid var(--line);
  max-width: 100%; width: 100%;
}
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
th {
  color: #4a6674; text-transform: uppercase; font-size: 11px; letter-spacing: .05em;
  background: #f4f9f8; font-weight: 700;
}
tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: #f0faf8; }
.badge {
  display: inline-block; border-radius: 999px; padding: 4px 9px; font-size: 12px; font-weight: 700;
  background: #e3f0ff; color: #155ca8;
}
.badge.ok { background: #d9f7e5; color: var(--ok); }
.badge.warn { background: #fff1c9; color: var(--warn); }
.badge.err { background: #ffe1dd; color: var(--err); }
.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 12px; font-size: 13px; font-weight: 700; color: var(--muted);
}
.crumbs a { color: var(--brand-2); }
.crumbs-sep { opacity: .45; }
.hierarchy-hint {
  margin-top: 14px; padding: 12px 14px; font-size: 13px;
  background: linear-gradient(180deg, #f3fbf9 0%, #fff 100%);
}
.hierarchy-hint a { font-weight: 800; }
.alert {
  margin-top: 16px; padding: 12px 16px; border-radius: 12px; font-weight: 600; font-size: 14px;
  border: 1px solid transparent;
}
.alert.ok { background: #e6f8ee; color: #0d6a36; border-color: #b7e8c8; }
.alert.err { background: #ffece9; color: #8f1d14; border-color: #f5c4bc; }
.auth-wrap { max-width: 440px; margin: 10vh auto; }
.auth-wrap .card { padding: 22px; }
.hero-panel {
  border-radius: 16px; padding: 22px 24px; color: #fff;
  background: linear-gradient(135deg, #0a7c74 0%, #0f6a8a 55%, #c97810 120%);
  box-shadow: var(--shadow);
}
.hero-panel h2 { margin: 0 0 8px; font-size: 22px; letter-spacing: -.02em; }
.hero-panel p { margin: 0 0 10px; opacity: .95; line-height: 1.5; }
.hero-panel .btn { background: #fff; color: var(--brand-2); }
.hero-panel .btn.secondary { background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.35); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.hero-actions .btn { margin: 0; }
.token {
  font-family: ui-monospace, Consolas, monospace; letter-spacing: 1px; background: #f0f7ff;
  border: 1px dashed #9db7d8; border-radius: 8px; padding: 4px 8px; font-size: 12px;
}
.filters {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px;
  margin-top: 14px; padding: 14px; background: rgba(255,255,255,.75);
  border: 1px solid var(--line); border-radius: 12px;
}
.filter-item label { margin-top: 0; }
.filter-actions { display: flex; gap: 8px; align-items: end; }
.pager {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line);
}
.pager-info { color: var(--muted); font-size: 13px; }
.pager-links { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pager-links a {
  min-width: 32px; height: 32px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-weight: 700; font-size: 13px;
}
.pager-links a:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.pager-current {
  min-width: 32px; height: 32px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; background: var(--brand); color: #fff; font-weight: 800; font-size: 13px;
}
.tabs {
  display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap;
  padding: 6px; background: rgba(255,255,255,.7); border: 1px solid var(--line); border-radius: 12px;
  width: fit-content; max-width: 100%;
}
.tabs a, .tabs .tab {
  padding: 9px 16px; border-radius: 8px; border: 0;
  background: transparent; font-weight: 700; font-size: 13px; color: var(--muted);
}
.tabs a.active, .tabs .tab.active { background: var(--brand); color: #fff; }
.tabs a:not(.active):hover { background: var(--brand-soft); color: var(--brand-2); }
.bell-wrap { position: relative; }
.bell-btn {
  position: relative; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; font-size: 18px; flex-shrink: 0;
}
.bell-count {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; border-radius: 999px;
  background: var(--err); color: #fff; font-size: 11px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 4px;
}
.bell-panel {
  display: none; position: absolute; right: 0; top: 48px; width: 360px; max-height: 420px; overflow: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); z-index: 40;
}
.bell-panel.open { display: block; }
.bell-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff;
}
.bell-panel-head strong { font-size: 14px; }
.bell-close {
  width: 32px; height: 32px; border: 0; border-radius: 8px; background: #f3f6f8;
  font-size: 20px; line-height: 1; cursor: pointer; color: var(--ink);
}
.bell-item { padding: 12px 14px; border-bottom: 1px solid var(--line); display: block; color: inherit; text-decoration: none; }
a.bell-item:hover { background: #f4f8f8; }
.bell-item strong { display: block; font-size: 13px; overflow-wrap: anywhere; }
.bell-msg { overflow-wrap: anywhere; word-break: break-word; font-size: 13px; line-height: 1.4; margin-top: 4px; }
.bell-item span { color: var(--muted); font-size: 12px; display: block; margin-top: 6px; }
.bell-cta { color: var(--brand) !important; font-weight: 700; }
.bell-foot { padding: 10px 14px; }
.modal-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(15, 36, 48, .48); z-index: 50;
  align-items: center; justify-content: center; padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal {
  width: min(560px, 100%); max-height: 90vh; overflow: auto;
  background: #fff; border-radius: 16px; padding: 20px; box-shadow: 0 20px 50px rgba(15,36,48,.2);
}
.modal h3 { margin: 0 0 8px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ===== Settings layout ===== */
.settings-intro {
  margin-top: 18px; margin-bottom: 4px;
}
.settings-intro h2 {
  margin: 0; font-size: 20px; letter-spacing: -.02em; font-weight: 800;
}
.settings-intro p {
  margin: 6px 0 0; color: var(--muted); font-size: 14px; max-width: 62ch;
}
.settings-stack {
  display: flex; flex-direction: column; gap: 16px; margin-top: 16px;
}
.settings-split {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.settings-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.settings-panel-head {
  padding: 18px 20px 14px;
  background: linear-gradient(180deg, #f5fbfa 0%, #fff 100%);
  border-bottom: 1px solid var(--line);
}
.settings-kicker {
  display: inline-block;
  font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--brand); margin-bottom: 4px;
}
.settings-panel-head h3 {
  margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.02em;
}
.settings-panel-head h3::before { display: none; }
.settings-panel-head p {
  margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; max-width: 70ch;
}
.settings-body { padding: 18px 20px 8px; }
.settings-side-action {
  padding: 0 20px 18px;
  display: flex; gap: 8px; flex-wrap: wrap;
}
.settings-side-action .btn { width: auto; }
.settings-divider {
  height: 1px; background: var(--line); margin: 4px 20px;
}
.form-section-label {
  font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  color: #6a8490; margin: 6px 0 10px; padding-top: 6px;
}
.form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px;
}
.form-grid .field label { margin-top: 0; }
.form-grid .field.span-2 { grid-column: 1 / -1; }
.form-actions {
  display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 10px;
}
.form-actions .btn { width: auto; min-width: 120px; }
.check-row {
  display: flex; align-items: center; gap: 10px; margin-top: 12px;
  font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer;
}
.check-row input {
  width: 16px; height: 16px; margin: 0; accent-color: var(--brand); flex-shrink: 0;
}
.rights-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  padding: 16px;
}
.role-pick { display: flex; flex-direction: column; gap: 6px; }
.role-pick a {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px; border-radius: 10px;
  background: #fff; border: 1px solid var(--line);
  text-decoration: none; color: var(--ink); font-weight: 700; font-size: 13px;
}
.role-pick a small { font-weight: 500; color: var(--muted); font-size: 11px; }
.role-pick a.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.role-pick a.active small { color: rgba(255,255,255,.85); }
.rights-panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.perm-group { margin: 0 0 16px; }
.perm-group h4 { margin: 0 0 8px; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-2); }
.perm-list { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 16px; }
.perm-list label {
  display: flex; gap: 8px; align-items: flex-start;
  font-size: 13px; font-weight: 500; cursor: pointer; padding: 6px 0;
}
.perm-list input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--brand); flex-shrink: 0; }
.role-pill {
  display: inline-block; padding: 3px 8px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-2); font-size: 12px; font-weight: 700;
}
.pricing-example {
  margin: 12px 0 0; padding: 12px 14px; border-radius: 10px;
  background: var(--brand-soft); font-size: 13px; color: var(--ink); line-height: 1.5;
}
.property-pricing .settings-body { padding-top: 0; }
.meter-pick-list {
  max-height: 220px; overflow-y: auto; margin: 10px 0 14px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.modal-wide { max-width: 560px; }
.meter-assign-panel { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
@media (max-width: 900px) {
  .rights-layout { grid-template-columns: 1fr; padding: 12px; }
  .role-pick { flex-direction: row; flex-wrap: wrap; }
  .role-pick a { flex: 1 1 calc(50% - 6px); }
  .perm-list { grid-template-columns: 1fr; }
}
.time-now {
  margin: 0 0 10px; font-size: 13px; color: var(--muted);
  padding: 10px 12px; background: var(--brand-soft); border-radius: 10px;
}
.time-now strong { color: var(--ink); }

.tabs-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
}
.tabs-scroll a { white-space: nowrap; flex-shrink: 0; }
.dash-analytics {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) 260px;
  gap: 18px;
  align-items: stretch;
  margin: 16px 0 20px;
}
.sales-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px 20px 16px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.sales-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.sales-title { display: flex; align-items: center; gap: 10px; }
.sales-title h3 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.sales-kicker {
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.sales-ico {
  width: 36px; height: 36px; border-radius: 12px; flex-shrink: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,.18), transparent 40%),
    linear-gradient(135deg, #0a7c74, #14b8a6);
  box-shadow: 0 6px 14px rgba(10,124,116,.25);
  position: relative;
}
.sales-ico::after {
  content: "";
  position: absolute; left: 8px; right: 8px; bottom: 9px; height: 10px;
  border-bottom: 2px solid rgba(255,255,255,.9);
  border-left: 2px solid rgba(255,255,255,.9);
  transform: skewX(-18deg);
}
.sales-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sales-toggles, .sales-ranges { display: flex; gap: 6px; flex-wrap: wrap; }
.chart-type-btn, .sales-ranges a {
  border: 1px solid var(--line);
  background: #f7fbfb;
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.chart-type-btn.active { background: #2563eb; color: #fff; border-color: #2563eb; }
.sales-ranges a.active { background: #f59e0b; color: #fff; border-color: #f59e0b; }
.sales-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 14px 0 10px;
  color: var(--muted);
  font-size: 13px;
}
.sales-meta strong { color: #d97706; font-size: 16px; font-weight: 800; }
.sales-chart-wrap {
  height: 280px;
  position: relative;
  background: linear-gradient(180deg, #f8fcfc 0%, #fff 70%);
  border-radius: 14px;
  padding: 8px 4px 0;
}
.dash-summary { display: flex; flex-direction: column; gap: 10px; }
.summary-box {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px 14px;
  box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.summary-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(15,36,48,.1);
  border-color: #bcd4d2;
}
.summary-icon {
  width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0;
}
.summary-copy { min-width: 0; flex: 1; display: grid; gap: 1px; }
.summary-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.summary-value { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.summary-sub { font-size: 11px; color: var(--muted); }
.summary-chevron { color: #9ab0b6; font-size: 22px; font-weight: 700; line-height: 1; }
.summary-box.tone-green .summary-icon { background: #dcfce7; }
.summary-box.tone-yellow .summary-icon { background: #fef3c7; }
.summary-box.tone-pink .summary-icon { background: #fce7f3; }
.summary-box.tone-blue .summary-icon { background: #dbeafe; }
.summary-box.tone-orange .summary-icon { background: #ffedd5; }
.dash-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}
.dash-strip > div, .dash-strip > a {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
}
.dash-strip > a:hover { border-color: var(--brand); }
.dash-strip span { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.dash-strip strong { display: block; margin-top: 4px; font-size: 16px; font-weight: 800; }
.wallet-toolbar { margin: 16px 0 0; }
.withdraw-panel { margin-top: 14px; }
.withdraw-panel[hidden], .wallet-toolbar .btn[hidden] { display: none; }
.withdraw-dest {
  padding: 12px 14px;
  border-radius: 12px;
  background: #f4f8f8;
  border: 1px solid var(--line);
}
.withdraw-dest strong { display: block; font-size: 18px; letter-spacing: .02em; }
.withdraw-dest span { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.withdraw-process { margin-bottom: 0; border: 1px solid var(--brand); }
.wd-row-focus td { background: #e7f6f2; }
.dash-alert {
  display: block;
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
}
.dash-alert:hover { border-color: #f97316; }
@media (max-width: 1100px) {
  .dash-strip { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 980px) {
  .dash-analytics { grid-template-columns: 1fr; }
  .dash-summary { display: grid; grid-template-columns: 1fr 1fr; }
  .dash-strip { grid-template-columns: 1fr 1fr; }
}
.dash-head {
  display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap;
  margin-top: 14px; margin-bottom: 2px;
}
.dash-clock {
  display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 0; background: transparent; border: 0; box-shadow: none; font-weight: 600;
}
.dash-clock-cal {
  width: 18px; height: 18px; border: 1.5px solid #8aa0ad; border-radius: 4px; position: relative; flex-shrink: 0;
}
.dash-clock-cal::before {
  content: ""; position: absolute; left: 3px; right: 3px; top: 5px; height: 1.5px; background: #8aa0ad;
}
.dash-clock-cal::after {
  content: ""; position: absolute; width: 2px; height: 4px; background: #8aa0ad; top: -2px; left: 4px;
  box-shadow: 7px 0 0 #8aa0ad;
}
.dash-clock-date {
  color: #5d7380; font-size: 14px; font-weight: 600;
}
.dash-clock-time {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 86px; padding: 6px 12px; border-radius: 999px;
  background: #16a34a; color: #fff; font-size: 13px; font-weight: 800;
  font-variant-numeric: tabular-nums; letter-spacing: .02em;
}
.top-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.top-title { min-width: 0; overflow: hidden; }
.nav-toggle {
  display: none;
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; font-size: 20px; flex-shrink: 0; line-height: 1;
}

@media (max-width: 1100px) {
  .cards-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 980px) {
  .shell {
    display: block;
    width: 100%;
    max-width: 100%;
  }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: min(280px, 86vw);
    z-index: 80; transform: translateX(-110%); transition: transform .2s ease;
    overflow: auto; box-shadow: none; padding: 18px 14px;
  }
  body.nav-open .sidebar { transform: translateX(0); box-shadow: 8px 0 30px rgba(0,0,0,.25); }
  .sidebar-backdrop {
    display: block; position: fixed; inset: 0; background: rgba(15,36,48,.45);
    z-index: 75; opacity: 0; pointer-events: none; transition: opacity .2s ease;
  }
  body.nav-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .brand { padding-bottom: 12px; }
  .nav { grid-template-columns: 1fr; }
  .cards-2, .cards-3, .settings-split { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .field.span-2 { grid-column: auto; }
  .main {
    display: block;
    padding: 10px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  /* One compact header row: menu | title | bell + logout */
  .top {
    padding: 10px 12px;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    flex-direction: row;
    flex-wrap: nowrap;
  }
  .top-left {
    width: auto;
    flex: 1;
    min-width: 0;
    align-items: center;
    gap: 8px;
  }
  .top-title { min-width: 0; overflow: hidden; }
  .top h1 {
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .top-sub { display: none; }
  .top-actions {
    width: auto;
    max-width: none;
    flex-shrink: 0;
    flex-wrap: nowrap;
    gap: 6px;
    justify-content: flex-end;
  }
  .btn-logout {
    padding: 8px 10px;
    font-size: 12px;
    white-space: nowrap;
  }
  .bell-btn, .nav-toggle { width: 38px; height: 38px; }

  /* Notifications stay fully on screen */
  .bell-panel {
    position: fixed;
    left: 10px;
    right: 10px;
    top: 64px;
    width: auto !important;
    max-width: none;
    max-height: min(70vh, 460px);
    z-index: 90;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .bell-msg, .bell-item strong, .bell-item {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .tabs, .tabs-sub, .tabs-scroll {
    width: 100%; max-width: 100%;
    overflow-x: auto; flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .tabs a, .tabs-sub a, .tabs-scroll a {
    white-space: nowrap; flex-shrink: 0;
    padding: 8px 12px; font-size: 12px;
  }
  .toolbar {
    gap: 8px; width: 100%;
    display: flex; flex-wrap: wrap;
  }
  .toolbar .btn {
    flex: 0 1 auto;
    width: auto;
    min-width: 0;
    padding: 9px 12px;
    font-size: 12.5px;
    white-space: nowrap;
  }
  .toolbar form { display: inline-flex; margin: 0; }
  .filters { grid-template-columns: 1fr; width: 100%; max-width: 100%; padding: 10px; }
  .filter-actions { grid-column: 1 / -1; }
  .filter-actions .btn { width: auto; }
  .table-wrap { max-width: 100%; }
  table { min-width: 520px; }
  .kpi-value { font-size: 20px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
  .hero-panel { padding: 16px; overflow-wrap: anywhere; }
  .hero-panel h2 { font-size: 18px; }
  .hero-panel .btn, .hero-actions .btn {
    display: inline-flex;
    width: auto;
    margin: 0;
    padding: 9px 12px;
    font-size: 12.5px;
  }
  .modal {
    width: min(100%, 560px);
    max-width: calc(100vw - 20px);
    padding: 14px;
  }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .btn { flex: 1 1 auto; }
  .form-actions { display: flex; flex-direction: column; gap: 8px; }
  .form-actions .btn, .settings-side-action .btn { width: 100%; min-width: 0; }
  .settings-side-action { flex-direction: column; }
  .settings-panel, .settings-body, .card { max-width: 100%; }
  .row-actions { gap: 6px; }
  .dash-head { justify-content: flex-end; margin-top: 10px; }
  .dash-clock { justify-content: flex-end; max-width: 100%; gap: 6px; flex-wrap: wrap; }
  .dash-clock-date { font-size: 11px; max-width: 100%; }
  .dash-clock-time { min-width: 72px; padding: 5px 10px; font-size: 12px; }
  .token { word-break: break-all; white-space: normal; }
  input, select, textarea { max-width: 100%; font-size: 16px; }
  .pager { gap: 8px; }
  .pager-links { width: 100%; }
}

@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .auth-wrap { margin: 4vh 12px; max-width: none; width: auto; }
  .pager { flex-direction: column; align-items: flex-start; }
  .main { padding: 8px; }
  .card { padding: 12px; }
  table { min-width: 460px; font-size: 12px; }
  th, td { padding: 8px; }
  .top h1 { font-size: 15px; }
  .btn-logout { padding: 8px 9px; }
}

@media (min-width: 981px) and (max-width: 1200px) {
  .shell { grid-template-columns: 220px minmax(0, 1fr); }
  .main { padding: 18px 20px 32px; }
}

.wallet-statement-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.wallet-statement-head h3 { margin: 0; }
.wallet-statement-filter select {
  min-width: 180px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.statement-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.statement-table .money-in { color: var(--ok); font-weight: 600; }
.statement-table .money-out { color: var(--err); font-weight: 600; }
.wallet-fee-preview {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--brand-soft);
  border: 1px solid #c6ebe4;
  font-size: 14px;
}
.wallet-fee-notice {
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f4f8f8;
  border: 1px solid var(--line);
  font-size: 14px;
}
.wallet-fee-notice.ok {
  background: var(--brand-soft);
  border-color: #c6ebe4;
}
.wallet-fee-notice.err {
  background: #fdecec;
  border-color: #f3c0bc;
}
.wallet-fee-notice .fee-line { margin: 0 0 4px; }
.wallet-fee-notice .fee-warn { color: var(--err); font-weight: 600; margin-top: 6px; }
.fee-tier-table input {
  width: 100%;
  min-width: 90px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.fee-tier-table td { vertical-align: middle; }