@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700&family=Syne:wght@600;700;800&display=swap');

:root {
  --ink: #0b1220;
  --ink-soft: #1a2436;
  --mist: #eef2f6;
  --paper: #f7f9fc;
  --elev: #ffffff;
  --line: rgba(11, 18, 32, 0.08);
  --line-strong: rgba(11, 18, 32, 0.14);
  --muted: #5c6b7e;
  --accent: #0eb8a5;
  --accent-deep: #0a8f80;
  --accent-glow: rgba(14, 184, 165, 0.16);
  --accent-ink: #045a51;
  --danger: #e11d48;
  --danger-soft: #ffe4e8;
  --ok: #059669;
  --ok-soft: #d1fae5;
  --warn: #d97706;
  --shadow: 0 1px 0 rgba(11,18,32,.04), 0 12px 32px -16px rgba(11,18,32,.18);
  --shadow-sm: 0 1px 2px rgba(11,18,32,.05);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Figtree", system-ui, sans-serif;
  --display: "Syne", "Figtree", system-ui, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", ui-monospace, monospace;
  --nav-w: 260px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --bg: var(--paper);
  --bg-elev: var(--elev);
  --bg-muted: var(--mist);
  --text: var(--ink);
  --text-muted: var(--muted);
  --border: var(--line);
}

[data-theme="dark"] {
  --ink: #eef3f8;
  --ink-soft: #c5d0dc;
  --mist: #151c28;
  --paper: #0b1018;
  --elev: #121a26;
  --line: rgba(238, 243, 248, 0.08);
  --line-strong: rgba(238, 243, 248, 0.14);
  --muted: #8b9aaf;
  --accent: #2dd4bf;
  --accent-deep: #5eead4;
  --accent-glow: rgba(45, 212, 191, 0.14);
  --accent-ink: #99f6e4;
  --danger: #fb7185;
  --danger-soft: #3f1520;
  --ok: #34d399;
  --ok-soft: #0f2e24;
  --warn: #fbbf24;
  --shadow: 0 1px 0 rgba(0,0,0,.2), 0 18px 40px -20px rgba(0,0,0,.55);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.25);
  --bg: var(--paper);
  --bg-elev: var(--elev);
  --bg-muted: var(--mist);
  --text: var(--ink);
  --text-muted: var(--muted);
  --border: var(--line);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  background:
    radial-gradient(900px 420px at 0% -10%, var(--accent-glow), transparent 55%),
    radial-gradient(700px 360px at 100% 0%, rgba(11,18,32,.04), transparent 50%),
    var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[data-theme="dark"] body {
  background:
    radial-gradient(800px 400px at 0% 0%, var(--accent-glow), transparent 55%),
    radial-gradient(600px 300px at 100% 0%, rgba(45,212,191,.05), transparent 45%),
    var(--bg);
}
a { color: var(--accent-deep); text-decoration: none; }
a:hover { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-glow); color: var(--text); }

.boot {
  min-height: 100vh;
  display: grid;
  place-items: center;
  gap: .75rem;
  color: var(--text-muted);
  font-weight: 500;
}
.boot::before {
  content: "";
  width: 36px; height: 36px;
  border-radius: 12px;
  background: url('/assets/logo.svg') center/cover no-repeat;
  animation: pulse 1.2s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(.92); opacity: .7; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ——— Login ——— */
.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  position: relative;
  overflow: hidden;
}
.login-hero {
  position: relative;
  padding: clamp(2rem, 5vw, 4rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #f4f7fa;
  background:
    radial-gradient(600px 400px at 20% 20%, rgba(14,184,165,.35), transparent 60%),
    linear-gradient(155deg, #0b1220 0%, #122033 55%, #0a8f80 140%);
  animation: fade .5s var(--ease);
}
.login-hero::after {
  content: "";
  position: absolute;
  inset: auto -20% -30% 20%;
  height: 70%;
  background: radial-gradient(circle at 30% 30%, rgba(14,184,165,.25), transparent 55%);
  pointer-events: none;
}
.login-hero .mark {
  width: 52px; height: 52px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.login-hero h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  letter-spacing: -.04em;
  line-height: 1.05;
  margin: 0 0 1rem;
  max-width: 11ch;
}
.login-hero p {
  margin: 0;
  max-width: 32ch;
  color: rgba(244,247,250,.72);
  font-size: 1.05rem;
}
.login-panel {
  display: grid;
  place-items: center;
  padding: 2rem;
  animation: rise .45s var(--ease) both;
}
.login-card {
  width: min(400px, 100%);
  background: color-mix(in srgb, var(--elev) 88%, transparent);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: 2rem 2rem 1.75rem;
  box-shadow: var(--shadow);
}
.login-card .brand-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.5rem;
}
.login-card .brand-row img { width: 40px; height: 40px; border-radius: 12px; }
.login-card .brand-row strong {
  font-family: var(--display);
  font-size: 1.35rem;
  letter-spacing: -.03em;
}
.login-card .brand-row strong span { color: var(--accent); }
.login-card .sub {
  color: var(--text-muted);
  margin: -.75rem 0 1.5rem;
  font-size: .95rem;
}
.login-card .btn { width: 100%; height: 46px; font-size: 1rem; }
@media (max-width: 900px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { min-height: 36vh; padding: 1.75rem; }
  .login-hero h1 { font-size: 2rem; max-width: none; }
}

/* ——— Shell ——— */
.shell {
  display: flex;
  min-height: 100vh;
  animation: fade .35s var(--ease);
}
.nav {
  width: var(--nav-w);
  margin: .85rem 0 .85rem .85rem;
  background: color-mix(in srgb, var(--elev) 92%, transparent);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 1rem .85rem;
  display: flex;
  flex-direction: column;
  gap: .2rem;
  position: sticky;
  top: .85rem;
  height: calc(100vh - 1.7rem);
  box-shadow: var(--shadow-sm);
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .55rem .65rem 1.1rem;
  text-decoration: none;
  color: var(--text);
}
.brand:hover { text-decoration: none; color: var(--text); }
.brand img {
  width: 36px; height: 36px;
  border-radius: 11px;
  flex-shrink: 0;
}
.brand .word {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -.03em;
  line-height: 1.1;
}
.brand .word span { color: var(--accent); }
.brand .tag {
  display: block;
  font-family: var(--font);
  font-weight: 500;
  font-size: .68rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: .1rem;
}
.nav-section {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: .65rem .75rem .35rem;
}
.nav a[data-nav] {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .62rem .75rem;
  border-radius: 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: .94rem;
  transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}
.nav a[data-nav] .ico {
  width: 1.25rem;
  opacity: .75;
  display: grid;
  place-items: center;
}
.nav a[data-nav]:hover {
  background: var(--bg-muted);
  color: var(--text);
  text-decoration: none;
}
.nav a[data-nav].active {
  background: var(--accent-glow);
  color: var(--accent-ink);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent);
}
.nav a[data-nav].active .ico { opacity: 1; }
.nav-foot {
  margin-top: auto;
  padding: .85rem .65rem .35rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .45rem .5rem;
}
.user-chip .avatar {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: .85rem;
}
.user-chip .meta { min-width: 0; }
.user-chip .name {
  font-weight: 600;
  font-size: .9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-chip .role {
  font-size: .72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.nav-actions { display: flex; gap: .4rem; }
.main {
  flex: 1;
  min-width: 0;
  padding: 1.35rem 1.5rem 3rem;
  animation: rise .4s var(--ease) both;
}
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.35rem;
}
.topbar h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.55rem, 2.4vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -.03em;
}
.topbar .lede {
  margin: .25rem 0 0;
  color: var(--text-muted);
  font-size: .92rem;
}

/* Forms */
.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  margin-bottom: .4rem;
  color: var(--text-muted);
  letter-spacing: .01em;
}
.field input, .field select, .field textarea,
.input, .select {
  width: 100%;
  padding: .7rem .85rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus,
.input:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; }
.row > * { flex: 1; min-width: 140px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .62rem 1.1rem;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #041513;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: -.01em;
  white-space: nowrap;
  transition: transform .15s var(--ease), background .15s, box-shadow .15s;
  box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 8px 18px -10px rgba(14,184,165,.7);
}
.btn:hover { background: var(--accent-deep); color: #fff; transform: translateY(-1px); }
.btn:active { transform: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
  box-shadow: none;
  font-weight: 600;
}
.btn-ghost:hover { background: var(--bg-muted); color: var(--text); }
.btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(225,29,72,.55);
}
.btn-danger:hover { filter: brightness(1.05); color: #fff; }
.btn-sm { padding: .4rem .7rem; font-size: .82rem; border-radius: 10px; }

.alert {
  padding: .8rem 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  font-size: .9rem;
  font-weight: 500;
  animation: rise .25s var(--ease);
}
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-ok { background: var(--ok-soft); color: var(--ok); }

/* KPI */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .85rem;
  margin-bottom: 1.25rem;
}
.kpi {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.1rem 1.15rem 1rem;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform .2s var(--ease), box-shadow .2s;
  animation: rise .45s var(--ease) both;
}
.kpi:nth-child(2) { animation-delay: .04s; }
.kpi:nth-child(3) { animation-delay: .08s; }
.kpi:nth-child(4) { animation-delay: .12s; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), transparent);
  border-radius: 3px 0 0 3px;
}
.kpi .label {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: .35rem;
}
.kpi .value {
  font-family: var(--display);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: 1.1;
}
.kpi .delta { font-size: .78rem; margin-top: .35rem; font-weight: 600; }
.kpi .delta.up { color: var(--ok); }
.kpi .delta.down { color: var(--danger); }
.kpi .delta.flat { color: var(--text-muted); }

.grid-2 {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.panel {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.1rem 1.2rem 1.15rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
  animation: rise .4s var(--ease) both;
}
.panel h2 {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-size: .98rem;
  font-weight: 700;
  letter-spacing: -.02em;
}
.chart-box { position: relative; height: 270px; }
.chart-box.sm { height: 210px; }

.table-wrap { overflow-x: auto; border-radius: 12px; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
table.data th, table.data td {
  text-align: left;
  padding: .75rem .55rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.data th {
  color: var(--text-muted);
  font-weight: 650;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: color-mix(in srgb, var(--accent-glow) 45%, transparent); }
.mono { font-family: var(--mono); font-size: .84rem; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: .18rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  background: var(--bg-muted);
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-off { background: var(--danger-soft); color: var(--danger); }
.badge-admin { background: var(--accent-glow); color: var(--accent-ink); }

.range-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
  padding: .3rem;
  background: var(--bg-muted);
  border-radius: 999px;
  border: 1px solid var(--line);
}
.range-bar .chip {
  border: 0;
  background: transparent;
  padding: .4rem .75rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: background .15s, color .15s;
}
.range-bar .chip:hover { color: var(--text); }
.range-bar .chip.active {
  background: var(--bg-elev);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.range-bar label.check {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .82rem;
  color: var(--text-muted);
  margin-left: .35rem;
  padding-right: .5rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 20, .55);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 50;
  padding: 1rem;
  animation: fade .2s ease;
}
.modal {
  width: min(520px, 100%);
  background: var(--bg-elev);
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  padding: 1.35rem;
  box-shadow: var(--shadow);
  max-height: 90vh;
  overflow: auto;
  animation: rise .25s var(--ease);
}
.modal h3 {
  margin: 0 0 1rem;
  font-family: var(--display);
  letter-spacing: -.02em;
}
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  margin-bottom: 1rem;
}
.toolbar .spacer { flex: 1; }
.empty {
  text-align: center;
  padding: 2.75rem 1rem;
  color: var(--text-muted);
  font-weight: 500;
}
.snippet {
  background: var(--bg-muted);
  border-radius: 12px;
  padding: .85rem;
  font-family: var(--mono);
  font-size: .8rem;
  word-break: break-all;
  border: 1px solid var(--line);
}
.dim-list { list-style: none; margin: 0; padding: 0; }
.dim-list li {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--line);
  font-size: .9rem;
}
.dim-list li:last-child { border-bottom: 0; }
.dim-list .bar-wrap { flex: 1; display: flex; align-items: center; gap: .55rem; min-width: 0; }
.dim-list .bar {
  height: 6px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 40%, #3b82f6));
  min-width: 2px;
}
.qr-box { display: grid; place-items: center; padding: 1rem; }
.qr-box canvas { image-rendering: pixelated; border-radius: 8px; }

.mobile-toggle {
  display: none;
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 40;
  width: 48px; height: 48px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  box-shadow: var(--shadow);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}
.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8,12,20,.4);
  z-index: 15;
}

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .shell { flex-direction: column; }
  .nav {
    position: fixed;
    left: .75rem;
    top: .75rem;
    bottom: .75rem;
    width: min(280px, 86vw);
    height: auto;
    margin: 0;
    transform: translateX(calc(-100% - 1rem));
    transition: transform .28s var(--ease);
    z-index: 30;
  }
  .shell.nav-open .nav { transform: none; }
  .shell.nav-open .nav-backdrop { display: block; }
  .mobile-toggle { display: inline-flex; }
  .main { padding: 1rem 1rem 5rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .kpis { grid-template-columns: 1fr; }
}

/* ——— Filters / pager / toasts / range picker ——— */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: .65rem .75rem;
  background: var(--bg-muted);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.filter-bar .input { max-width: 280px; flex: 1 1 180px; }
.filter-bar .select { max-width: 160px; }
.filter-bar .spacer { flex: 1; min-width: .5rem; }
.bulk-bar {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .25rem .35rem .25rem .65rem;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
}
.code-row {
  display: flex;
  align-items: center;
  gap: .35rem;
}
.code-prefix {
  color: var(--text-muted);
  white-space: nowrap;
  font-size: .85rem;
}
.col-actions {
  white-space: nowrap;
  text-align: right;
}
.col-actions .btn { margin-left: .15rem; }
.col-check { width: 2rem; }
.cell-url { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.back-link {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-muted);
}
.back-link:hover { color: var(--accent); }

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-top: 1rem;
}
.pager-meta {
  font-size: .85rem;
  color: var(--text-muted);
  font-weight: 600;
}
.pager-btns {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  align-items: center;
}
.pager-num.active {
  background: var(--accent-glow) !important;
  color: var(--accent-ink) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
}
.pager-gap { color: var(--text-muted); padding: 0 .25rem; }

.toast-host {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  pointer-events: none;
}
.toast {
  min-width: 200px;
  max-width: 360px;
  padding: .75rem 1rem;
  border-radius: 12px;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  font-weight: 600;
  font-size: .9rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: none; }
.toast-ok { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.toast-error {
  border-color: color-mix(in srgb, #ef4444 50%, var(--line));
  color: #b91c1c;
}

.modal-sm { width: min(400px, 100%); }
.modal-msg { margin: 0 0 1rem; color: var(--text-muted); line-height: 1.45; }
.check {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .92rem;
  font-weight: 500;
  margin: .25rem 0 1rem;
  cursor: pointer;
}

.range-picker { position: relative; }
.range-trigger {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem .85rem;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  color: var(--text);
  font-weight: 600;
  font-size: .88rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
.range-trigger:hover { border-color: var(--accent); }
.range-picker.open .range-trigger {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.range-ico { opacity: .7; flex-shrink: 0; }
.range-caret { opacity: .5; font-size: .75rem; }
.range-pop {
  position: absolute;
  top: calc(100% + .4rem);
  right: 0;
  z-index: 45;
  width: min(420px, 92vw);
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: .85rem;
  animation: rise .18s var(--ease);
}
.range-pop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .85rem;
}
.range-presets {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.range-preset {
  border: 0;
  background: transparent;
  text-align: left;
  padding: .5rem .65rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: .88rem;
  color: var(--text-muted);
}
.range-preset:hover { background: var(--bg-muted); color: var(--text); }
.range-preset.active {
  background: var(--accent-glow);
  color: var(--accent-ink);
}
.range-custom-title {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: .55rem;
}
.range-custom .field { margin-bottom: .65rem; }
.range-custom .field span {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: .25rem;
}
.range-compare { margin: .35rem 0 .75rem; font-size: .85rem; }

@media (max-width: 560px) {
  .range-pop-grid { grid-template-columns: 1fr; }
  .col-actions .btn { margin-bottom: .2rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
