:root {
  --ink: #001332;
  --ink-2: #001b45;
  --muted: #66768b;
  --line: #dce5ef;
  --line-strong: #cbd9e8;
  --soft: #f4f8fc;
  --soft-blue: #edf6ff;
  --white: #ffffff;
  --blue: #0877ff;
  --blue-bright: #1590ff;
  --blue-dark: #0068f4;
  --green: #13a86b;
  --amber: #d27a0b;
  --red: #c43a49;
  --shadow-sm: 0 10px 30px rgba(18, 68, 119, .08);
  --shadow: 0 24px 70px rgba(18, 68, 119, .14);
  --radius-sm: 14px;
  --radius: 22px;
  --radius-lg: 30px;
  --sidebar: 274px;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 0%, rgba(8, 119, 255, .11), transparent 31rem),
    linear-gradient(180deg, #f8fbff 0%, #f3f7fb 100%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .42;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(47, 100, 157, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 100, 157, .035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, #000, transparent 92%);
}
body.sidebar-open { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: var(--blue-dark); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 30;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 28px 22px 22px;
  color: #dce9f9;
  background:
    radial-gradient(circle at 20% 0%, rgba(21, 144, 255, .26), transparent 18rem),
    linear-gradient(165deg, #001b45 0%, #001332 58%, #000d25 100%);
  box-shadow: 20px 0 60px rgba(0, 25, 63, .11);
}
.app-sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .12;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.15) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, #000, transparent 82%);
}
.app-sidebar > * { position: relative; z-index: 1; }
.sidebar-brand {
  display: block;
  margin-bottom: 28px;
  text-decoration: none;
}
.sidebar-brand img { width: 172px; height: auto; }
.sidebar-brand small {
  display: block;
  margin-top: 8px;
  color: #84a7cf;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.account-panel {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 22px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  background: rgba(255,255,255,.07);
  backdrop-filter: blur(14px);
}
.account-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue-bright), var(--blue-dark));
  box-shadow: 0 10px 24px rgba(0, 104, 244, .28);
  font-weight: 850;
}
.account-panel strong,
.account-panel small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-panel strong { color: #fff; font-size: .89rem; }
.account-panel small { margin-top: 3px; color: #9eb9d7; font-size: .72rem; }
.nav-label {
  margin: 0 0 9px 12px;
  color: #7292b8;
  font-size: .65rem;
  font-weight: 850;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.app-nav { display: grid; gap: 7px; }
.app-nav a {
  position: relative;
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: #cfe0f3;
  font-size: .9rem;
  font-weight: 720;
  text-decoration: none;
  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}
.app-nav a:hover { color: #fff; background: rgba(255,255,255,.07); transform: translateX(2px); }
.app-nav a.active {
  color: #fff;
  border-color: rgba(91, 174, 255, .28);
  background: linear-gradient(135deg, rgba(21,144,255,.25), rgba(8,119,255,.12));
  box-shadow: inset 0 1px rgba(255,255,255,.07), 0 12px 28px rgba(0, 53, 125, .18);
}
.nav-icon {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  color: #8fb8e5;
  background: rgba(255,255,255,.07);
}
.app-nav a.active .nav-icon { color: #fff; background: rgba(8,119,255,.72); }
.nav-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-footer { margin-top: auto; padding-top: 24px; }
.sidebar-footer a { color: #8ca8c8; font-size: .78rem; text-decoration: none; }
.sidebar-footer a:hover { color: #fff; }
.sidebar-footer p { margin: 8px 0 0; color: #6685a9; font-size: .69rem; line-height: 1.5; }

.app-main { min-width: 0; }
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 34px;
  border-bottom: 1px solid rgba(205, 220, 236, .76);
  background: rgba(248, 251, 255, .82);
  backdrop-filter: blur(18px);
}
.topbar-title { display: flex; align-items: center; gap: 12px; }
.topbar-mark { width: 32px; height: 32px; }
.topbar-title span { color: var(--muted); font-size: .77rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-home {
  color: #435970;
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
}
.topbar-home:hover { color: var(--blue); }
.sidebar-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
}
.sidebar-toggle span { display: block; width: 19px; height: 2px; margin: 4px auto; border-radius: 2px; background: currentColor; }

.app-content {
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 38px 38px 64px;
}
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.page-heading-copy { min-width: 0; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
  color: var(--blue-dark);
  font-size: .69rem;
  font-weight: 850;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 5px rgba(8,119,255,.1); }
h1, h2, h3 { color: var(--ink); }
h1 { margin: 0; font-size: clamp(2rem, 3.4vw, 3rem); line-height: 1.02; letter-spacing: -.045em; }
h2 { margin: 0; font-size: 1.18rem; letter-spacing: -.02em; }
h3 { margin: 0; font-size: 1rem; }
.page-heading p { max-width: 720px; margin: 11px 0 0; color: var(--muted); line-height: 1.65; }

.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.users-layout { grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); align-items: start; }
.qr-edit-layout { grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); align-items: start; }
.rules-layout { grid-template-columns: minmax(0, 1fr) minmax(390px, .85fr); align-items: start; }

.card {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border: 1px solid rgba(205, 220, 236, .9);
  border-radius: var(--radius);
  background: rgba(255,255,255,.9);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(16px);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.9), transparent);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.card-header p { margin: 6px 0 0; color: var(--muted); font-size: .86rem; line-height: 1.5; }
.card-subtitle { margin: 5px 0 0; color: var(--muted); font-size: .83rem; line-height: 1.55; }
.card + .card { margin-top: 20px; }
.card.sticky-card { position: sticky; top: 100px; }

.metric-card {
  min-height: 162px;
  padding: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgba(8,119,255,.12), transparent 11rem),
    rgba(255,255,255,.94);
}
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.metric-label { color: #52677e; font-size: .78rem; font-weight: 780; letter-spacing: .04em; text-transform: uppercase; }
.metric-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  color: var(--blue);
  background: var(--soft-blue);
}
.metric-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.metric-value { margin-top: 18px; color: var(--ink); font-size: 2.65rem; font-weight: 850; line-height: .95; letter-spacing: -.055em; }
.metric-note { margin-top: 8px; color: var(--muted); font-size: .76rem; }

.btn, button.btn, form button[type="submit"] {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue-bright), var(--blue-dark));
  box-shadow: 0 12px 26px rgba(8,119,255,.22);
  cursor: pointer;
  font-weight: 780;
  line-height: 1.1;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.btn:hover, button.btn:hover, form button[type="submit"]:hover { transform: translateY(-1px); box-shadow: 0 16px 34px rgba(8,119,255,.28); }
.btn-secondary,
.btn-muted {
  color: var(--ink);
  border-color: var(--line-strong);
  background: #fff;
  box-shadow: none;
}
.btn-secondary:hover,
.btn-muted:hover { border-color: #a9c1dc; background: #f8fbff; box-shadow: 0 9px 22px rgba(24,72,120,.08); }
.btn-danger,
form button.btn-danger {
  color: #a72e3c;
  border-color: #f0c7cd;
  background: #fff7f8;
  box-shadow: none;
}
.btn-danger:hover,
form button.btn-danger:hover { background: #fff0f2; box-shadow: none; }
.btn-small { min-height: 38px; padding: 0 13px; border-radius: 11px; font-size: .8rem; }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.action-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.dashboard-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; }

.msg {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
  padding: 14px 16px;
  border: 1px solid;
  border-radius: 15px;
  font-size: .9rem;
  font-weight: 680;
}
.msg::before { content: ""; flex: 0 0 auto; width: 9px; height: 9px; margin-top: .32em; border-radius: 50%; background: currentColor; }
.ok { color: #087046; border-color: #bee8d5; background: #effbf6; }
.err { color: #9e2d3b; border-color: #f0c3ca; background: #fff3f5; }

label {
  display: block;
  margin: 0 0 7px;
  color: #233a55;
  font-size: .79rem;
  font-weight: 760;
}
.field { margin-top: 17px; }
.field:first-child { margin-top: 0; }
.field-note, .muted { color: var(--muted); font-size: .76rem; line-height: 1.55; }
.field-note { display: block; margin-top: 7px; }
input, select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  outline: none;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 0 rgba(8, 54, 105, .02);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
textarea { min-height: 120px; padding-top: 12px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #99a8b8; }
input:focus, select:focus, textarea:focus {
  border-color: rgba(8,119,255,.65);
  box-shadow: 0 0 0 4px rgba(8,119,255,.11);
}
input.animation-text-input {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .04em;
}
input[type="file"] { min-height: auto; padding: 11px 12px; background: #f9fbfe; }
input[type="color"] { height: 50px; padding: 5px; cursor: pointer; }
input[type="checkbox"], input[type="radio"] { width: 18px; min-height: 18px; accent-color: var(--blue); }
input[type="range"] {
  min-height: 28px;
  padding: 0;
  border: 0;
  box-shadow: none;
  accent-color: var(--blue);
  background: transparent;
}
.inline-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.inline-grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.animation-text-grid { align-items: start; }
.animation-text-grid .field { margin-top: 0; }
.checkbox-row { display: inline-flex; align-items: center; gap: 9px; margin-top: 18px; color: var(--ink); cursor: pointer; }
.checkbox-row input { margin: 0; }
.day-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.day-picker label { position: relative; margin: 0; cursor: pointer; }
.day-picker input { position: absolute; opacity: 0; pointer-events: none; }
.day-picker span {
  display: grid;
  min-width: 46px;
  min-height: 38px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: #496077;
  background: #fff;
  font-size: .74rem;
  font-weight: 800;
  text-transform: uppercase;
}
.day-picker input:checked + span { color: #fff; border-color: var(--blue); background: var(--blue); box-shadow: 0 8px 18px rgba(8,119,255,.2); }

.form-section {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.form-section:first-of-type { padding-top: 0; border-top: 0; }
.form-section:last-of-type { padding-bottom: 0; }
.form-section-title { margin-bottom: 16px; }
.form-section-title strong { display: block; font-size: .95rem; }
.form-section-title span { display: block; margin-top: 4px; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.form-section-title-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.form-section-title-inline strong { display: inline-block; }
.unlock-hint {
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 1px dashed rgba(8,119,255,.24);
  border-radius: 14px;
  color: #43617f;
  background: linear-gradient(180deg, #f7fbff, #ffffff);
  font-size: .8rem;
  line-height: 1.55;
}
.info-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px 0 11px;
  border: 1px solid rgba(8,119,255,.24);
  border-radius: 999px;
  color: var(--blue-dark);
  background: linear-gradient(135deg, rgba(237,246,255,.98), rgba(255,255,255,.98));
  box-shadow: 0 8px 18px rgba(8,119,255,.10);
  cursor: pointer;
  font-size: .78rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .01em;
  white-space: nowrap;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.info-trigger:hover,
.info-trigger:focus-visible {
  border-color: rgba(8,119,255,.45);
  background: linear-gradient(135deg, #f7fbff, #ffffff);
  box-shadow: 0 10px 24px rgba(8,119,255,.16), 0 0 0 4px rgba(8,119,255,.11);
  transform: translateY(-1px);
}
.info-trigger-icon {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue-bright), var(--blue-dark));
  box-shadow: 0 8px 18px rgba(8,119,255,.2);
  font-size: .88rem;
  line-height: 1;
}
.info-trigger-copy {
  padding-right: 1px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.custom-domain-modal[hidden] { display: none; }
.custom-domain-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
}
.custom-domain-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 19, 50, .58);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.custom-domain-modal-panel {
  position: relative;
  width: min(100%, 760px);
  max-height: min(88vh, 920px);
  overflow: auto;
  padding: 24px;
  border: 1px solid rgba(205, 220, 236, .9);
  border-radius: 28px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 28px 90px rgba(0, 19, 50, .28);
}
.custom-domain-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.custom-domain-modal-head h2 {
  margin: 0;
  font-size: 1.25rem;
}
.custom-domain-modal-body {
  display: grid;
  gap: 18px;
  color: #2c425b;
  line-height: 1.65;
}
.custom-domain-modal-section h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.25;
}
.custom-domain-modal-section p {
  margin: 0 0 10px;
}
.custom-domain-modal-section p:last-of-type {
  margin-bottom: 0;
}
.custom-domain-modal-section ol,
.custom-domain-modal-section ul {
  margin: 10px 0 0 22px;
  padding: 0;
}
.custom-domain-modal-section li + li {
  margin-top: 8px;
}
.custom-domain-modal pre {
  margin: 12px 0;
  padding: 14px 16px;
  overflow: auto;
  border: 1px solid #dce5ef;
  border-radius: 16px;
  color: #ecf4ff;
  background: #0b1730;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82rem;
  line-height: 1.6;
}
.custom-domain-modal pre code {
  padding: 0;
  color: inherit;
  background: transparent;
}
.qr-edit-layout-locked {
  grid-template-columns: minmax(0, 1fr);
}

.table-scroll { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 13px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: #6d7f93; font-size: .67rem; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
td { color: #2c425b; font-size: .84rem; line-height: 1.5; overflow-wrap: anywhere; }
tbody tr { transition: background .18s ease; }
tbody tr:hover { background: #f8fbff; }
tbody tr:last-child td { border-bottom: 0; }
td strong { color: var(--ink); }
td small { color: var(--muted); }
.url-link { display: inline-block; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.qr-actions { display: flex; justify-content: flex-end; gap: 8px; }
.status-badge, .rule-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 820;
}
.status-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-active { color: #087046; background: #e9f9f2; }
.status-inactive { color: #7b8797; background: #eef2f6; }
.rule-badge { color: var(--blue-dark); background: var(--soft-blue); text-transform: uppercase; letter-spacing: .05em; }
.empty-state { padding: 44px 20px; text-align: center; }
.empty-state img { width: 76px; margin: 0 auto 18px; opacity: .85; }
.empty-state h3 { font-size: 1.05rem; }
.empty-state p { max-width: 420px; margin: 8px auto 18px; color: var(--muted); line-height: 1.6; }

.preview-card { overflow-wrap: anywhere; }
.qr-preview-shell {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 360px;
  padding: 26px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(45deg, #f1f5fa 25%, transparent 25%),
    linear-gradient(-45deg, #f1f5fa 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f1f5fa 75%),
    linear-gradient(-45deg, transparent 75%, #f1f5fa 75%), #fff;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-size: 24px 24px;
}
.qr-preview-box {
  display: inline-block;
  max-width: 100%;
  padding: 16px;
  border: 1px solid #dce6f0;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(8,58,111,.13);
}
.qr-preview-box img { max-width: 100%; height: auto; }
.logo-upload {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}
.logo-upload input[type="hidden"] { display: none; }
.logo-dropzone {
  display: grid;
  gap: 12px;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  padding: 16px;
  border: 1px dashed #a9c1dc;
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfdff, #f4f9ff);
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background .18s ease;
}
.logo-dropzone:hover,
.logo-dropzone:focus-visible,
.logo-dropzone.is-dragover {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(8,119,255,.11);
  background: #fff;
  transform: translateY(-1px);
}
.logo-dropzone.is-uploading { opacity: .78; cursor: progress; }
.logo-dropzone-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  color: var(--blue);
  background: var(--soft-blue);
}
.logo-dropzone-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.logo-dropzone-copy strong {
  display: block;
  color: var(--ink);
  font-size: .9rem;
}
.logo-dropzone-copy small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.45;
}
.logo-dropzone-state {
  align-self: start;
  justify-self: end;
  padding: 7px 10px;
  border-radius: 999px;
  color: #53677f;
  background: #edf3f8;
  font-size: .69rem;
  font-weight: 820;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.logo-dropzone-state[data-state="ready"] { color: #087046; background: #e9f9f2; }
.logo-dropzone-state[data-state="busy"] { color: #8b6426; background: #fff6e8; }
.logo-dropzone-state[data-state="error"] { color: #9e2d3b; background: #fff3f5; }
.preview-details { display: grid; gap: 12px; margin-top: 20px; }
.detail-row { padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; background: #f9fbfe; }
.detail-row span { display: block; margin-bottom: 5px; color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.detail-row a, .detail-row code { display: block; color: var(--ink); font-size: .78rem; overflow-wrap: anywhere; }
code { padding: 3px 7px; border-radius: 7px; background: #eef4fa; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.delete-qr-form {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #f0c3ca;
  border-radius: 18px;
  background: #fff7f8;
}
.delete-qr-form .field { margin-top: 0; }
.delete-qr-form .field-note { color: #9e2d3b; }
.delete-qr-form .btn-danger,
.delete-qr-form button.btn-danger {
  width: 100%;
  margin-top: 14px;
}

.rule-help {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.rule-help article { padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: #f9fbfe; }
.rule-help strong { display: block; font-size: .76rem; }
.rule-help span { display: block; margin-top: 4px; color: var(--muted); font-size: .68rem; line-height: 1.45; }
#geo-map { height: 340px; margin-top: 10px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 17px; background: var(--soft); }
.leaflet-container { font-family: inherit; }

.chart-card { padding-bottom: 16px; }
.scan-chart {
  display: flex;
  min-height: 240px;
  align-items: end;
  gap: clamp(6px, 1.2vw, 14px);
  padding: 34px 12px 12px;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(237,246,255,.48), transparent);
}
.scan-bar-group { display: grid; min-width: 42px; flex: 1 0 42px; gap: 8px; justify-items: center; }
.scan-bar-track { display: flex; width: 100%; height: 160px; align-items: end; justify-content: center; }
.scan-bar { width: min(28px, 70%); min-height: 3px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, var(--blue-bright), var(--blue-dark)); box-shadow: 0 8px 18px rgba(8,119,255,.2); }
.scan-bar-value { color: var(--ink); font-size: .7rem; font-weight: 800; }
.scan-bar-label { color: var(--muted); font-size: .63rem; white-space: nowrap; }

.auth-body {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(360px, .9fr) minmax(460px, 1.1fr);
  background: #f6f9fd;
}
.auth-brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(34px, 5vw, 76px);
  color: #fff;
  background:
    radial-gradient(circle at 82% 13%, rgba(8,119,255,.42), transparent 24rem),
    linear-gradient(150deg, #001b45 0%, #001332 58%, #000b20 100%);
}
.auth-brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .13;
  background-image:
    linear-gradient(rgba(255,255,255,.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.2) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, #000, transparent 90%);
}
.auth-brand-panel > * { position: relative; z-index: 1; }
.auth-brand-panel .auth-logo { width: 174px; }
.auth-brand-copy { max-width: 560px; }
.auth-brand-copy .eyebrow { color: #79b9ff; }
.auth-brand-copy .eyebrow::before { background: #1590ff; box-shadow: 0 0 0 5px rgba(21,144,255,.14); }
.auth-brand-copy h1 { color: #fff; font-size: clamp(2.8rem, 5vw, 5.6rem); line-height: .94; }
.auth-brand-copy h1 span { color: #56aaff; }
.auth-brand-copy p { max-width: 520px; margin: 24px 0 0; color: #b7cae1; font-size: 1rem; line-height: 1.75; }
.auth-benefits { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.auth-benefits span { padding: 9px 12px; border: 1px solid rgba(255,255,255,.15); border-radius: 999px; color: #dceafa; background: rgba(255,255,255,.06); font-size: .72rem; font-weight: 700; }
.auth-brand-foot { color: #7190b5; font-size: .72rem; }
.auth-form-panel { display: grid; place-items: center; padding: 34px; }
.auth-wrap { width: min(100%, 500px); }
.auth-mobile-logo { display: none; width: 146px; margin-bottom: 28px; }
.auth-card {
  padding: clamp(28px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow);
}
.auth-card h2 { font-size: 2rem; letter-spacing: -.04em; }
.auth-card > p { margin: 10px 0 26px; color: var(--muted); line-height: 1.6; }
.auth-card .field { margin-top: 18px; }
.auth-card button { width: 100%; margin-top: 24px; }
.auth-footer { margin-top: 20px; color: var(--muted); font-size: .82rem; text-align: center; }
.auth-footer a { font-weight: 750; text-decoration: none; }
.auth-back { display: inline-flex; align-items: center; gap: 7px; margin-top: 20px; color: var(--muted); font-size: .78rem; font-weight: 700; text-decoration: none; }
.auth-back:hover { color: var(--blue); }

.geo-body { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.geo-card { width: min(100%, 470px); padding: 34px; border: 1px solid var(--line); border-radius: 28px; background: rgba(255,255,255,.95); box-shadow: var(--shadow); text-align: center; }
.geo-card .brand-mark { width: 82px; margin: 0 auto 18px; }
.geo-card h1 { font-size: 2rem; }
.geo-card p { color: var(--muted); line-height: 1.65; }
.geo-card .btn { margin-top: 10px; }
.geo-loading { display: flex; justify-content: center; gap: 7px; margin: 22px 0 8px; }
.geo-loading i { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); animation: bounce 1.2s infinite ease-in-out; }
.geo-loading i:nth-child(2) { animation-delay: .15s; }
.geo-loading i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .35; } 40% { transform: translateY(-7px); opacity: 1; } }

@media (max-width: 1120px) {
  :root { --sidebar: 238px; }
  .app-content { padding-inline: 26px; }
  .qr-edit-layout, .rules-layout { grid-template-columns: 1fr; }
  .card.sticky-card { position: relative; top: auto; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(84vw, 300px);
    height: 100vh;
    transform: translateX(-105%);
    transition: transform .24s ease;
  }
  body.sidebar-open .app-sidebar { transform: translateX(0); }
  body.sidebar-open::after { content: ""; position: fixed; inset: 0; z-index: 25; background: rgba(0,17,45,.48); backdrop-filter: blur(3px); }
  .sidebar-toggle { display: inline-block; }
  .app-topbar { padding: 0 20px; }
  .app-content { padding: 28px 20px 50px; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
  .users-layout, .qr-edit-layout, .rules-layout { grid-template-columns: 1fr; }
  .metric-card { min-height: 132px; }
  .rule-help { grid-template-columns: 1fr; }
  .auth-body { grid-template-columns: 1fr; }
  .auth-brand-panel { display: none; }
  .auth-form-panel { min-height: 100vh; }
  .auth-mobile-logo { display: block; }
}

@media (max-width: 720px) {
  .app-topbar { min-height: 66px; }
  .topbar-title .topbar-mark { display: none; }
  .topbar-actions .topbar-home { display: none; }
  .app-content { padding: 24px 14px 44px; }
  .page-heading { align-items: stretch; flex-direction: column; }
  .page-heading .btn { width: 100%; }
  h1 { font-size: 2rem; }
  .card { padding: 18px; border-radius: 18px; }
  .inline-grid, .inline-grid.three { grid-template-columns: 1fr; }
  .dashboard-header { align-items: stretch; flex-direction: column; }
  .dashboard-header .btn { width: 100%; }
  .qr-table { display: block; width: 100%; }
  .qr-table thead { display: none; }
  .qr-table tbody, .qr-table tr, .qr-table td { display: block; width: 100%; }
  .qr-table tr { margin-bottom: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 4px 14px rgba(8,43,99,.05); }
  .qr-table td { padding: 7px 0; border: 0; }
  .qr-table td::before { content: attr(data-label); display: block; margin-bottom: 3px; color: var(--muted); font-size: .64rem; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
  .qr-table td:first-child::before, .qr-table td:last-child::before { display: none; }
  .qr-actions { justify-content: stretch; margin-top: 8px; }
  .qr-actions .btn, .qr-actions form, .qr-actions form button { flex: 1; width: 100%; }
  .url-link { max-width: 100%; white-space: normal; }
  .qr-preview-shell { min-height: 290px; padding: 16px; }
  .logo-dropzone { grid-template-columns: 1fr; justify-items: start; }
  .logo-dropzone-state { justify-self: start; }
  .auth-form-panel { padding: 20px 14px; }
  .auth-card { padding: 26px 20px; border-radius: 22px; }
  .geo-card { padding: 28px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
