/* Hermes Agent Dashboard - design system: dark, premium AI/tech aesthetic.
   Indigo -> violet gradient accent with a cyan highlight, glassmorphic
   surfaces, soft glow shadows, spring-like micro-interactions. Built on the
   original Stripe/Linear-inspired base, elevated 2026-09-22. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #08090d;
  --bg-elevated: #0c0e14;
  --surface: #12141c;
  --surface-2: #191c27;
  --surface-glass: rgba(20, 22, 32, 0.72);
  --sidebar-bg: #0a0b11;
  --border: #24273a;
  --border-soft: #1a1c29;
  --fg: #f2f3f8;
  --muted: #8b90a8;
  --muted-soft: #5c6180;

  --primary: #6366f1;
  --primary-soft: #818cf8;
  --primary-fg: #ffffff;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.45);
  --primary-glow-soft: rgba(99, 102, 241, 0.14);

  --accent-2: #22d3ee;
  --accent-2-soft: rgba(34, 211, 238, 0.14);

  --gradient-brand: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #22d3ee 100%);
  --gradient-primary-btn: linear-gradient(135deg, #818cf8 0%, #6366f1 60%, #4f46e5 100%);

  --accent: #34d399;
  --accent-soft: rgba(52, 211, 153, 0.14);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.14);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.14);

  --ring: rgba(99, 102, 241, 0.4);
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --sidebar-w: 244px;
  --font-ui: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 10px 30px rgba(0, 0, 0, 0.4);
  --shadow-card-hover: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(99, 102, 241, 0.18);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(ellipse 900px 500px at 15% -10%, rgba(99, 102, 241, 0.12), transparent 60%),
    radial-gradient(ellipse 700px 500px at 100% 0%, rgba(34, 211, 238, 0.08), transparent 55%);
  background-attachment: fixed;
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}

:focus-visible {
  outline: 2px solid var(--primary-soft);
  outline-offset: 2px;
  border-radius: 4px;
}

svg {
  display: block;
  flex-shrink: 0;
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translate(-50%, -14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ---------- Layout: app shell with persistent sidebar ---------- */

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

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-soft);
  padding: var(--space-5) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 1.05rem;
  padding: 0 var(--space-2) var(--space-6);
  color: var(--fg);
  letter-spacing: -0.01em;
}

.sidebar-brand .logo-dot {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--gradient-brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 0.9rem;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset, 0 4px 18px var(--primary-glow);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 11px var(--space-3);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background-color 180ms var(--ease-out), color 180ms var(--ease-out), transform 150ms var(--ease-out);
  cursor: pointer;
  position: relative;
}

.sidebar-link svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.sidebar-link:hover {
  background: var(--surface-2);
  color: var(--fg);
  transform: translateX(2px);
}

.sidebar-link.active {
  background: var(--primary-glow-soft);
  color: var(--primary-soft);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.3) inset;
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  border-radius: 3px;
  background: var(--gradient-brand);
}

.sidebar-link.logout {
  margin-top: auto;
  color: var(--danger);
}

.sidebar-link.logout:hover {
  background: var(--danger-soft);
  transform: translateX(2px);
}

.main {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-6) 48px;
}

.page-title {
  font-size: 1.9rem;
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0 0 var(--space-2);
  letter-spacing: -0.02em;
  animation: fadeSlideUp 400ms var(--ease-out) both;
}

.page-subtitle {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 0 var(--space-6);
  max-width: 68ch;
  animation: fadeSlideUp 400ms var(--ease-out) 40ms both;
}

/* Chi trang nao co the trang thai (vi du .live-dot) di kem VAN BAN moi can
   flex de badge nam gon tren cung 1 hang - cac trang con lai chi la doan
   van thuong, dung display:flex tren <p> lam trinh duyet tach van ban thanh
   nhieu "flex item" theo tung doan bi ngat boi the con (vd <strong>), gay
   xuong dong vo duyen o giua cau thay vi ngat dung theo chieu rong container
   (phat hien qua phan hoi that cua nguoi dung 2026-09-22). */
.page-subtitle--flex {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  max-width: none;
}

.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 4px 12px 4px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
}

.live-dot::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: pulseDot 1.8s ease-in-out infinite;
}

.live-dot.on { color: var(--accent); }
.live-dot.off { color: var(--danger); }

/* ---------- Stat tiles ---------- */

.stat-grid {
  display: grid;
  /* Home co dung 5 the (2026-09-22) - 240px khien the thu 5 roi xuong hang
     rieng le tren man hinh rong (240*5 + gap > khong gian con lai cua .main).
     Giam nguong toi thieu de ca 5 vua 1 hang tren desktop, van tu dong xep
     lai (auto-fit) tren man hinh hep. */
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.stat-tile {
  background: linear-gradient(165deg, var(--surface) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-card);
  transition: transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out), border-color 220ms var(--ease-out);
  animation: fadeSlideUp 420ms var(--ease-out) both;
}

.stat-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(99, 102, 241, 0.35);
}

.stat-tile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.stat-tile-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.stat-tile-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--primary-glow-soft);
  color: var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.22) inset;
}

.stat-tile-icon svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
}

.stat-tile-value {
  font-size: 2.1rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

.stat-tile-delta {
  font-size: 0.78rem;
  color: var(--muted-soft);
  margin-top: 4px;
}

.stat-tile-delta.up {
  color: var(--accent);
}

/* ---------- Card ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-card);
  animation: fadeSlideUp 420ms var(--ease-out) both;
}

.form-page {
  max-width: 640px;
  margin: 0 auto;
}

.form-page.narrow {
  max-width: 420px;
}

.card-title {
  font-weight: 600;
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 var(--space-1);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.card-hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 var(--space-4);
}

/* ---------- Form controls ---------- */

.field {
  margin-bottom: var(--space-4);
}

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: var(--space-2);
}

.field input[type='text'],
.field input[type='password'],
.field input[type='number'],
.field textarea,
.field select {
  width: 100%;
  padding: 14px var(--space-4);
  font-size: 0.98rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--fg);
  transition: border-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out), background-color 180ms var(--ease-out);
}

.field textarea {
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}

.field input:hover,
.field textarea:hover,
.field select:hover {
  border-color: var(--muted-soft);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
  outline: none;
  background: var(--surface);
}

.field input[type='file'] {
  width: 100%;
  padding: 12px var(--space-4);
  font-size: 0.9rem;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  background: var(--bg-elevated);
  color: var(--muted);
}

.field input[type='file']::file-selector-button {
  margin-right: var(--space-3);
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  background: var(--surface-2);
  color: var(--fg);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background-color 180ms var(--ease-out);
}

.field input[type='file']:hover::file-selector-button {
  background: var(--border);
}

.field-help {
  font-size: 0.8rem;
  color: var(--muted-soft);
  margin-top: var(--space-1);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

/* ---------- Visibility picker (radio-card, public/confidential toggles) ---------- */

.visibility-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--space-3);
}

.visibility-option {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  cursor: pointer;
  transition: border-color 180ms var(--ease-out), background-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}

.visibility-option:hover {
  border-color: var(--muted-soft);
}

.visibility-option input[type='radio'] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.visibility-option-dot {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 180ms var(--ease-out);
}

.visibility-option-dot::after {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-spring);
}

.visibility-option-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.visibility-option-title {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--fg);
}

.visibility-option-hint {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

.visibility-option:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-glow-soft);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.3) inset;
}

.visibility-option:has(input:checked) .visibility-option-dot {
  border-color: var(--primary);
}

.visibility-option:has(input:checked) .visibility-option-dot::after {
  opacity: 1;
  transform: scale(1);
}

.visibility-option:has(input:focus-visible) {
  outline: 2px solid var(--primary-soft);
  outline-offset: 2px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: 14px var(--space-4);
  border-radius: var(--radius);
  border: none;
  background: var(--gradient-primary-btn);
  color: var(--primary-fg);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--primary-glow-soft);
  transition: transform 160ms var(--ease-spring), box-shadow 220ms var(--ease-out), filter 180ms var(--ease-out);
  text-decoration: none;
}

.btn:hover:not(:disabled) {
  filter: brightness(1.08);
  box-shadow: 0 8px 26px var(--primary-glow);
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: scale(0.97) translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--fg);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn-secondary:hover:not(:disabled) {
  background: #212639;
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: none;
}

/* Dung cho danh sach lich co dinh (2026-09-22) - nut nho, gon trong 1 hang
   the, khong can chiem het chieu rong nhu .btn mac dinh. */
.btn-sm {
  padding: 8px 14px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm, 8px);
  box-shadow: none;
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.22);
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 700ms linear infinite;
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn.is-loading .btn-spinner {
  display: inline-block;
}

.btn.is-loading .btn-label {
  opacity: 0.75;
}

/* ---------- Status / feedback ---------- */

.status-line {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: var(--space-3);
  white-space: pre-wrap;
}

.status-line.success {
  color: var(--accent);
}

.status-line.error {
  color: var(--danger);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--muted);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge.online {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ---------- Toast (save confirmation etc.) ---------- */

#toastRoot {
  position: fixed;
  top: 22px;
  left: 50%;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border-radius: 999px;
  background: var(--surface-glass);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--fg);
  animation: toastIn 320ms var(--ease-spring) both;
  transform: translateX(-50%);
  white-space: nowrap;
}

.toast .toast-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast.success .toast-icon { background: var(--accent-soft); color: var(--accent); }
.toast.error .toast-icon { background: var(--danger-soft); color: var(--danger); }
.toast .toast-icon svg { width: 12px; height: 12px; }

/* ---------- Charts (hourly activity) ---------- */

.hourly-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 110px;
  margin-top: var(--space-3);
}

.hourly-bar {
  flex: 1;
  min-height: 3px;
  border-radius: 4px 4px 1px 1px;
  background: linear-gradient(180deg, var(--primary-soft), var(--primary));
  transition: transform 200ms var(--ease-out), filter 200ms var(--ease-out);
  transform-origin: bottom;
}

.hourly-bar:hover {
  filter: brightness(1.25);
  transform: scaleY(1.03);
}

.hourly-labels {
  display: flex;
  gap: 3px;
  margin-top: 6px;
}

.hourly-labels span {
  flex: 1;
  text-align: center;
  font-size: 10px;
  color: var(--muted-soft);
}

/* ---------- Data table (top threads / model breakdown) ---------- */

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--space-3);
  font-size: 0.88rem;
}

.data-table th {
  text-align: left;
  color: var(--muted-soft);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-soft);
}

.data-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border-soft);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr {
  transition: background-color 150ms var(--ease-out);
}

.data-table tbody tr:hover {
  background: var(--surface-2);
}

.rank-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.progress-track {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  margin-top: 5px;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--gradient-brand);
  transition: width 500ms var(--ease-out);
}

/* ---------- Skeleton loading ---------- */

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius);
}

/* ---------- Trace entries (legacy, still referenced by nothing but kept
   for style-class compatibility if a future debug page reuses it) ---------- */

.trace-entry {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-3);
  box-shadow: var(--shadow-card);
}

.trace-meta {
  font-size: 0.75rem;
  color: var(--muted-soft);
  margin-bottom: var(--space-2);
  font-family: var(--font-mono);
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.empty-state {
  color: var(--muted);
  text-align: center;
  padding: var(--space-6) 0;
  font-size: 0.9rem;
}

/* ---------- Auth (login) standalone layout ---------- */

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 0%, #131a2e 0%, var(--bg) 60%);
}

#brainCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: var(--surface-glass);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6) var(--space-6) 40px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04) inset, 0 24px 70px rgba(0, 0, 0, 0.55), 0 0 50px var(--primary-glow-soft);
  animation: fadeSlideUp 500ms var(--ease-out) both;
}

.auth-title {
  font-size: 1.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0 0 var(--space-5);
  text-align: center;
  letter-spacing: -0.01em;
}

/* ---------- QR box (accounts page) ---------- */

.qr-box {
  width: 220px;
  height: 220px;
  margin: var(--space-4) auto 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: block;
  box-shadow: 0 0 0 6px var(--surface-2), 0 12px 30px rgba(0, 0, 0, 0.4);
}

.qr-box[hidden] {
  display: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: var(--space-3) var(--space-4);
  }

  .sidebar-brand {
    padding: 0 var(--space-2) 0 0;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .sidebar-link span {
    display: none;
  }

  .sidebar-link.active::before {
    display: none;
  }

  .sidebar-link.logout {
    margin-top: 0;
    margin-left: auto;
  }

  .main {
    padding: var(--space-4);
    max-width: 100%;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .stat-tile-value {
    font-size: 1.7rem;
  }

  #twoColGrid {
    grid-template-columns: 1fr !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
