/* Dangerous VPN — design system */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --bg-base: #07080d;
  --bg-elevated: rgba(14, 16, 24, 0.72);
  --bg-card: rgba(18, 20, 32, 0.55);
  --bg-input: rgba(255, 255, 255, 0.04);
  --bg-hover: rgba(255, 255, 255, 0.06);

  --text-primary: #f4f6fb;
  --text-secondary: #9aa3b8;
  --text-muted: #6b7289;

  --accent-cyan: #22d3ee;
  --accent-violet: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #22d3ee 0%, #8b5cf6 55%, #6366f1 100%);
  --accent-glow: rgba(34, 211, 238, 0.35);

  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  --success: #34d399;
  --success-bg: rgba(52, 211, 153, 0.12);
  --warning: #fbbf24;
  --danger: #f87171;
  --danger-bg: rgba(248, 113, 113, 0.12);
  --info-bg: rgba(99, 102, 241, 0.12);
  --info-text: #a5b4fc;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-sm: 0 4px 24px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 12px 48px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 40px var(--accent-glow);

  --header-h: 72px;
  --container: 1120px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-base: #f0f2f8;
  --bg-elevated: rgba(255, 255, 255, 0.85);
  --bg-card: rgba(255, 255, 255, 0.72);
  --bg-input: rgba(15, 23, 42, 0.04);
  --bg-hover: rgba(15, 23, 42, 0.06);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --accent-glow: rgba(99, 102, 241, 0.2);

  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.14);

  --success-bg: rgba(52, 211, 153, 0.15);
  --danger-bg: rgba(248, 113, 113, 0.12);
  --info-bg: rgba(99, 102, 241, 0.1);
  --info-text: #4338ca;

  --shadow-sm: 0 4px 24px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 12px 48px rgba(15, 23, 42, 0.12);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Aurora background */
.bg-aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-aurora::before,
.bg-aurora::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  animation: auroraDrift 18s ease-in-out infinite alternate;
}

.bg-aurora::before {
  width: 55vw;
  height: 55vw;
  top: -15%;
  left: -10%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.35), transparent 70%);
}

.bg-aurora::after {
  width: 50vw;
  height: 50vw;
  bottom: -20%;
  right: -10%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.4), transparent 70%);
  animation-delay: -9s;
}

#bgCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.35;
}

@keyframes auroraDrift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(4%, 6%) scale(1.08); }
}

/* Layout */
.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: min(100%, var(--container));
  margin: 0 auto;
  padding-inline: clamp(24px, 4vw, 40px);
}

.page-content {
  flex: 1;
  padding: 28px 0 48px;
  animation: pageIn 0.5s ease both;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-link:hover { text-decoration: none; }

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-gradient);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-glow);
  flex-shrink: 0;
}

.brand-icon svg { width: 22px; height: 22px; color: #fff; }

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-name {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
}

.theme-toggle {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-secondary);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.theme-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-link {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  position: relative;
  transition: color var(--transition), background var(--transition);
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  text-decoration: none;
}

.nav-link.is-active {
  color: var(--text-primary);
  background: var(--bg-hover);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  border: 0;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition);
  white-space: nowrap;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btnPrimary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btnPrimary:hover { box-shadow: 0 8px 32px var(--accent-glow); }

.btnSecondary {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}

.btnSecondary:hover { background: var(--bg-hover); }

.btnDanger {
  background: var(--danger);
  color: #fff;
}

.btnGhost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.btnGhost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btnRow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btnRow-stack {
  flex-direction: column;
  align-items: stretch;
}

.btnRow-stack .btn {
  width: 100%;
  white-space: normal;
  text-align: center;
  line-height: 1.3;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.8125rem;
}

.btn-block { width: 100%; }

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
}

/* Cards */
.glass-card,
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}

.glass-card:hover,
.kpi-card:hover,
.platform-card:hover {
  border-color: var(--border-strong);
}

.page-card {
  margin-top: 8px;
}

/* Typography */
.page-title {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.page-lead {
  margin: 0 0 24px;
  color: var(--text-secondary);
  font-size: 1rem;
}

.muted { color: var(--text-secondary); }
.text-mono {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  word-break: break-all;
}

/* Alerts */
.alert,
.notice {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  border: 1px solid;
}

.alert {
  border-color: rgba(248, 113, 113, 0.35);
  background: var(--danger-bg);
  color: var(--danger);
}

.notice {
  border-color: rgba(99, 102, 241, 0.3);
  background: var(--info-bg);
  color: var(--info-text);
}

[data-theme="light"] .alert { color: #b91c1c; }
[data-theme="light"] .notice { color: var(--info-text); }

/* Forms */
.formRow {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input,
select.input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input::placeholder { color: var(--text-muted); }

.input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}

.input-group {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.input-group .input { flex: 1; }

/* Grid & KPI */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

.kpi,
.kpi-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border);
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.kpi-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.kpi-value {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.kpi b { font-size: 1.5rem; font-weight: 800; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.pill-success { color: var(--success); border-color: rgba(52, 211, 153, 0.3); background: var(--success-bg); }
.pill-warning { color: var(--warning); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-live {
  background: var(--success-bg);
  color: var(--success);
}

.badge-live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.table th,
.table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-input);
}

.table tbody tr {
  transition: background var(--transition);
}

.table tbody tr:hover { background: var(--bg-hover); }
.table tbody tr:last-child td { border-bottom: 0; }

/* Admin daily usage — full-bleed pivot */
body.admin-usage-body .site-footer { display: none; }

body.admin-usage-body .page-content {
  padding: 8px 0 0;
}

body.admin-usage-body .page-content > .container {
  width: 100%;
  max-width: none;
  margin: 0;
  padding-left: 8px;
  padding-right: 8px;
}

.admin-usage-page {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  min-height: calc(100vh - var(--header-h) - 16px);
}

.admin-usage-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  flex: 0 0 auto;
}

.admin-usage-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.875rem;
  white-space: nowrap;
}

.admin-usage-filters {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.admin-usage-presets {
  display: inline-flex;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.admin-usage-chip {
  padding: 4px 10px;
  font-size: 0.75rem;
  line-height: 1.2;
  color: var(--text-secondary);
  text-decoration: none;
  border-right: 1px solid var(--border);
  background: transparent;
  white-space: nowrap;
}

.admin-usage-chip:last-child { border-right: 0; }
.admin-usage-chip:hover { background: var(--bg-hover); color: var(--text); }
.admin-usage-chip.is-active {
  background: var(--bg-input);
  color: var(--text);
  font-weight: 600;
}

.admin-usage-range {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.admin-usage-date {
  box-sizing: border-box;
  width: 8.25rem;
  max-width: 8.25rem;
  min-width: 0;
  flex: 0 0 8.25rem;
  padding: 4px 6px;
  min-height: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.75rem;
  line-height: 1.2;
}

.admin-usage-date:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.15);
}

.admin-usage-dash {
  flex: 0 0 auto;
  font-size: 0.75rem;
}

.admin-usage-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  height: 28px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.admin-usage-btn:hover {
  background: var(--bg-hover);
  text-decoration: none;
}

.admin-usage-btn-primary {
  border: 0;
  background: var(--accent-gradient);
  color: #fff;
}

.admin-usage-note {
  margin: 0;
  font-size: 0.75rem;
  flex: 0 0 auto;
}

.admin-usage-matrix-wrap {
  flex: 1 1 auto;
  width: 100%;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  min-height: 0;
  height: calc(100vh - var(--header-h) - 72px);
}

.admin-usage-matrix {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  min-width: 100%;
  table-layout: auto;
  font-size: 0.75rem;
}

.admin-usage-matrix th,
.admin-usage-matrix td {
  padding: 4px 6px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  white-space: nowrap;
  text-align: center;
  vertical-align: middle;
}

.admin-usage-matrix thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--bg-input);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.6875rem;
  letter-spacing: 0.02em;
}

.admin-usage-matrix th.sortable {
  cursor: pointer;
  user-select: none;
}

.admin-usage-matrix th.sortable:hover {
  color: var(--text);
}

.admin-usage-matrix th.sortable.sort-asc::after {
  content: " ▲";
  font-size: 0.6rem;
}

.admin-usage-matrix th.sortable.sort-desc::after {
  content: " ▼";
  font-size: 0.6rem;
}

.admin-usage-matrix .sticky-col {
  position: sticky;
  z-index: 2;
  background: var(--bg-elevated);
  text-align: left;
}

.admin-usage-matrix thead .sticky-col {
  z-index: 4;
  background: var(--bg-input);
}

.admin-usage-matrix .sticky-id {
  left: 0;
  min-width: 72px;
  width: 72px;
}

.admin-usage-matrix .sticky-user {
  left: 72px;
  min-width: 96px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  border-right: 1px solid var(--border);
}

.admin-usage-matrix .day-col {
  min-width: 48px;
}

.admin-usage-matrix .sum-col {
  font-weight: 600;
  min-width: 56px;
  background: var(--bg-input);
}

.admin-usage-matrix tbody tr:hover td {
  background: var(--bg-hover);
}

.admin-usage-matrix tbody tr:hover .sticky-col,
.admin-usage-matrix tbody tr:hover .sum-col {
  background: var(--bg-hover);
}

.admin-usage-matrix .is-traffic {
  font-weight: 600;
  color: var(--text);
}

.admin-usage-matrix .is-active {
  color: var(--text-muted);
}

.admin-usage-matrix .is-empty {
  color: transparent;
}

@media (max-width: 900px) {
  .admin-usage-filters {
    flex-wrap: wrap;
    margin-left: 0;
    width: 100%;
  }
}

/* Hero login */
.hero-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: stretch;
  min-height: auto;
}

.hero-layout .login-card {
  order: -1;
}

@media (min-width: 960px) {
  .hero-layout {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 48px;
    align-items: center;
    min-height: calc(100vh - var(--header-h) - 120px);
  }

  .hero-layout .login-card {
    order: 0;
  }
}

.hero-content h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.hero-content h1 span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-lead {
  margin: 0 0 28px;
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 520px;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}

.stat-chip {
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.stat-chip strong {
  display: block;
  font-size: 1.125rem;
  font-weight: 800;
}

.stat-chip span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.feature-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--accent-cyan);
}

.feature-item h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 700;
}

.feature-item p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.login-card {
  padding: 32px;
}

.login-card h2 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 800;
}

.login-card .login-sub {
  margin: 0 0 24px;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

/* Platform cards */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.platform-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.platform-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
  text-decoration: none;
}

.platform-card svg { color: var(--accent-cyan); }
.platform-card span { font-weight: 700; font-size: 0.9375rem; }

/* Topup tiles */
.amount-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.amount-tile {
  margin: 0;
}

.amount-tile .btn {
  width: 100%;
  min-height: 72px;
  padding: 12px;
  flex-direction: column;
  gap: 4px;
  white-space: normal;
  text-align: center;
}

.amount-tile .amount-value {
  font-size: 1.125rem;
  line-height: 1.25;
  word-break: break-word;
}

.amount-tile .amount-days {
  font-size: 0.75rem;
  opacity: 0.85;
  font-weight: 500;
}

/* Quick actions */
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.quick-actions .btn {
  flex: 1 1 0;
  min-width: 140px;
}

.cabinet-sub-row {
  align-items: center;
}

.cabinet-sub-row .input {
  min-height: auto;
  padding: 8px 14px;
  font-size: 0.8125rem;
  line-height: 1.35;
  word-break: break-all;
}

.cabinet-sub-row .btn {
  flex-shrink: 0;
  align-self: center;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.pagination-info {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* Import page */
.import-page {
  min-height: calc(100vh - var(--header-h) - 80px);
  display: grid;
  place-items: center;
}

.import-card {
  max-width: 520px;
  width: 100%;
  text-align: center;
}

.import-card .import-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 18px;
  background: var(--accent-gradient);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-glow);
}

.import-card .import-logo svg { width: 32px; height: 32px; color: #fff; }

.import-links {
  margin-top: 16px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.import-hint {
  margin-top: 20px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  text-align: left;
  line-height: 1.6;
}

.import-hint code {
  display: block;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-hover);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  word-break: break-all;
}

.download-section {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.download-title {
  font-weight: 700;
  margin-bottom: 16px;
}

/* Footer */
.site-footer {
  padding: 24px 0 32px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.875rem;
  text-decoration: none;
}

.footer-links a:hover { color: var(--text-primary); text-decoration: none; }

.footer-copy {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* Section spacing */
.section { margin-bottom: 24px; }
.section-title {
  margin: 0 0 16px;
  font-size: 1.125rem;
  font-weight: 700;
}

/* Admin */
.admin-search-card { margin-bottom: 20px; }
.admin-result-card { margin-bottom: 20px; }

/* Mobile nav */
@media (max-width: 900px) {
  .nav-toggle { display: grid; place-items: center; }

  /* Flex so fixed .site-nav leaves the flow — brand stays left, not cramped against toggles */
  .header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
  }

  .header-actions {
    justify-self: unset;
    flex-shrink: 0;
  }

  .brand-link {
    min-width: 0;
    margin-right: auto;
  }

  .site-nav {
    position: fixed;
    top: var(--header-h);
    right: 0;
    width: min(320px, 85vw);
    height: calc(100vh - var(--header-h));
    flex-direction: column;
    align-items: stretch;
    padding: 20px;
    gap: 8px;
    background: var(--bg-elevated);
    border-left: 1px solid var(--border);
    backdrop-filter: blur(20px);
    transform: translateX(100%);
    transition: transform var(--transition);
    overflow-y: auto;
    z-index: 100;
  }

  .site-nav.is-open { transform: translateX(0); }

  .nav-link {
    border-radius: var(--radius-sm);
    padding: 12px 16px;
  }

  .nav-overlay {
    position: fixed;
    inset: 0;
    top: var(--header-h);
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
  }

  .nav-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .bg-aurora::before,
  .bg-aurora::after {
    animation: none;
  }

  #bgCanvas { display: none; }
}

/* Standalone import (no header) */
body.standalone {
  min-height: 100vh;
}

body.standalone .app-shell {
  min-height: 100vh;
  justify-content: center;
  padding: 24px 16px;
}
