/* ─────────────────────────────────────────────────────────────────────────
   anon-edge — app.css
   Premium neutral + indigo accent · Light & dark mode · Left sidebar layout
   ───────────────────────────────────────────────────────────────────────── */

/* ── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Light theme (default) ─────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg:          #f7f7fb;
  --surface:     #ffffff;
  --surface-2:   #f2f2f7;
  --border:      #e5e5ec;

  /* Text */
  --text:        #0d0d12;
  --text-muted:  #68687a;

  /* Primary (near-black, used sparingly) */
  --primary:     #0d0d12;
  --primary-h:   #1a1a24;
  --primary-10:  rgba(13,13,18,.06);
  --primary-20:  rgba(13,13,18,.12);

  /* Accent — Indigo */
  --accent:      #6366f1;
  --accent-h:    #4f46e5;
  --accent-fg:   #ffffff;
  --accent-10:   rgba(99,102,241,.08);
  --accent-20:   rgba(99,102,241,.16);
  --accent-ring: rgba(99,102,241,.22);

  /* Auth page ambient orbs */
  --auth-orb-1:  rgba(99,102,241,.07);
  --auth-orb-2:  rgba(139,92,246,.05);

  /* Status */
  --danger:      #e02424;
  --danger-h:    #b91c1c;
  --danger-10:   rgba(224,36,36,.08);
  --success:     #15803d;
  --warning:     #b45309;

  /* Layout */
  --radius:      12px;
  --radius-sm:   8px;
  --radius-xs:   6px;

  /* Shadows */
  --shadow:      0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.06);
  --shadow-md:   0 2px 8px rgba(0,0,0,.05), 0 16px 48px rgba(0,0,0,.08);
  --shadow-sm:   0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);

  /* Transitions */
  --transition:  .14s cubic-bezier(0.4, 0, 0.2, 1);

  /* Sidebar */
  --sidebar-bg:       #ffffff;
  --sidebar-border:   #e5e5ec;
  --sidebar-width:    240px;
  --sidebar-width-sm: 56px;
  --nav-active-bg:    var(--accent-10);
  --nav-active-fg:    var(--accent);
  --nav-active-bar:   var(--accent);
  --nav-hover-bg:     #f2f2f7;

  color-scheme: light;
}

/* ── Dark theme — OS preference ────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #0b0b10;
    --surface:     #141419;
    --surface-2:   #1f1f27;
    --border:      #2c2c38;
    --text:        #ededf5;
    --text-muted:  #82828f;
    --primary:     #ededf5;
    --primary-h:   #ffffff;
    --primary-10:  rgba(237,237,245,.06);
    --primary-20:  rgba(237,237,245,.12);
    --accent:      #818cf8;
    --accent-h:    #6366f1;
    --accent-fg:   #ffffff;
    --accent-10:   rgba(129,140,248,.1);
    --accent-20:   rgba(129,140,248,.18);
    --accent-ring: rgba(129,140,248,.26);
    --auth-orb-1:  rgba(99,102,241,.15);
    --auth-orb-2:  rgba(139,92,246,.11);
    --danger:      #f87171;
    --danger-h:    #ef4444;
    --danger-10:   rgba(248,113,113,.1);
    --success:     #34d399;
    --warning:     #fbbf24;
    --shadow:      0 1px 3px rgba(0,0,0,.5), 0 6px 20px rgba(0,0,0,.45);
    --shadow-md:   0 2px 12px rgba(0,0,0,.55), 0 20px 60px rgba(0,0,0,.5);
    --shadow-sm:   0 1px 4px rgba(0,0,0,.45);
    --sidebar-bg:       #141419;
    --sidebar-border:   #2c2c38;
    --nav-hover-bg:     #1c1c24;
    color-scheme: dark;
  }
}

/* ── Manual overrides (attribute selector beats :root) ──────────────────── */
[data-theme="light"] {
  --bg: #f7f7fb; --surface: #ffffff; --surface-2: #f2f2f7; --border: #e5e5ec;
  --text: #0d0d12; --text-muted: #68687a;
  --primary: #0d0d12; --primary-h: #1a1a24;
  --primary-10: rgba(13,13,18,.06); --primary-20: rgba(13,13,18,.12);
  --accent: #6366f1; --accent-h: #4f46e5; --accent-fg: #ffffff;
  --accent-10: rgba(99,102,241,.08); --accent-20: rgba(99,102,241,.16); --accent-ring: rgba(99,102,241,.22);
  --auth-orb-1: rgba(99,102,241,.07); --auth-orb-2: rgba(139,92,246,.05);
  --danger: #e02424; --danger-h: #b91c1c; --danger-10: rgba(224,36,36,.08);
  --success: #15803d; --warning: #b45309;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.06);
  --shadow-md: 0 2px 8px rgba(0,0,0,.05), 0 16px 48px rgba(0,0,0,.08);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --sidebar-bg: #ffffff; --sidebar-border: #e5e5ec;
  --nav-active-bg: var(--accent-10); --nav-active-fg: var(--accent); --nav-active-bar: var(--accent);
  --nav-hover-bg: #f2f2f7;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0b0b10; --surface: #141419; --surface-2: #1f1f27; --border: #2c2c38;
  --text: #ededf5; --text-muted: #82828f;
  --primary: #ededf5; --primary-h: #ffffff;
  --primary-10: rgba(237,237,245,.06); --primary-20: rgba(237,237,245,.12);
  --accent: #818cf8; --accent-h: #6366f1; --accent-fg: #ffffff;
  --accent-10: rgba(129,140,248,.1); --accent-20: rgba(129,140,248,.18); --accent-ring: rgba(129,140,248,.26);
  --auth-orb-1: rgba(99,102,241,.15); --auth-orb-2: rgba(139,92,246,.11);
  --danger: #f87171; --danger-h: #ef4444; --danger-10: rgba(248,113,113,.1);
  --success: #34d399; --warning: #fbbf24;
  --shadow: 0 1px 3px rgba(0,0,0,.5), 0 6px 20px rgba(0,0,0,.45);
  --shadow-md: 0 2px 12px rgba(0,0,0,.55), 0 20px 60px rgba(0,0,0,.5);
  --shadow-sm: 0 1px 4px rgba(0,0,0,.45);
  --sidebar-bg: #141419; --sidebar-border: #2c2c38;
  --nav-active-bg: var(--accent-10); --nav-active-fg: var(--accent); --nav-active-bar: var(--accent);
  --nav-hover-bg: #1c1c24;
  color-scheme: dark;
}

/* ── Base ───────────────────────────────────────────────────────────────── */
html { font-size: 15.5px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Helvetica, Arial, sans-serif;
  font-feature-settings: 'cv11', 'ss01';
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; font-weight: 700; letter-spacing: -.025em; }

input[type=checkbox],
input[type=radio] { accent-color: var(--accent); }

code {
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', ui-monospace, monospace;
  font-size: .875em;
  background: var(--surface-2);
  padding: .15em .4em;
  border-radius: 5px;
  border: 1px solid var(--border);
}

/* ── Theme toggle ───────────────────────────────────────────────────────── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.theme-toggle:hover { background: var(--border); color: var(--text); }

/* Light → show moon; Dark → show sun */
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun  { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}
[data-theme="dark"]  .theme-toggle .icon-sun  { display: block; }
[data-theme="dark"]  .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun  { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

.theme-toggle--fixed {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 200;
  box-shadow: var(--shadow-sm);
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  padding: .58em 1.2em;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition),
              transform var(--transition), opacity var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn--primary {
  background: var(--accent);
  color: var(--accent-fg);
  box-shadow: 0 1px 2px rgba(99,102,241,.2), 0 4px 10px rgba(99,102,241,.14);
}
.btn--primary:hover:not(:disabled) {
  background: var(--accent-h);
  box-shadow: 0 2px 8px rgba(99,102,241,.35), 0 8px 24px rgba(99,102,241,.14);
  transform: translateY(-1px);
  text-decoration: none;
}
.btn--primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(99,102,241,.2);
}

.btn--danger  {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 1px 2px rgba(224,36,36,.2);
}
.btn--danger:hover:not(:disabled) {
  background: var(--danger-h);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(224,36,36,.28);
}
.btn--danger:active:not(:disabled) { transform: translateY(0); }

.btn--ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn--ghost:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--accent-20);
  text-decoration: none;
}

.btn--sm  { padding: .3em .75em; font-size: .8rem; }
.btn--full { width: 100%; justify-content: center; }

/* Icon-only buttons */
.btn-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: .3em .45em;
  border-radius: var(--radius-xs);
  transition: color var(--transition), background var(--transition);
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
.btn-icon:hover { color: var(--text); background: var(--surface-2); }
.btn-icon.btn-danger:hover { color: var(--danger); background: var(--danger-10); }
.btn-icon.btn-star.starred { color: var(--warning); }

/* Small bordered action button */
.btn-sm {
  padding: .28em .7em;
  font-size: .8rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition), border-color var(--transition);
}
.btn-sm:hover { border-color: var(--accent-20); }
.btn-sm.btn-danger { border-color: transparent; color: var(--danger); }
.btn-sm.btn-danger:hover { background: var(--danger-10); border-color: var(--danger); }

/* ── Form elements ──────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: .3em; margin-bottom: 1rem; }
.field label {
  font-size: .72rem;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.field-hint { font-weight: 400; font-size: .8rem; color: var(--text-muted); text-transform: none; letter-spacing: 0; }
.field--check { flex-direction: row; align-items: center; gap: .5em; }
.field--check label {
  font-size: .875rem;
  color: var(--text);
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

input[type=text],
input[type=email],
input[type=password],
select,
textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .9rem;
  font-family: inherit;
  padding: .63em .875em;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
input::placeholder { color: var(--text-muted); opacity: .55; }

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M0 0l6 8 6-8z' fill='%2368687a'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75em center;
  padding-right: 2.25em;
}

progress {
  width: 100%; height: 4px; border-radius: 2px; overflow: hidden;
  appearance: none; background: var(--surface-2); border: none; display: block;
}
progress::-webkit-progress-bar   { background: var(--surface-2); border-radius: 2px; }
progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--accent), #a78bfa);
  border-radius: 2px;
  transition: width .25s;
}
progress::-moz-progress-bar { background: var(--accent); border-radius: 2px; }

/* ── Messages ───────────────────────────────────────────────────────────── */
.msg {
  padding: .75em 1em;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  margin-bottom: 1rem;
}
.msg--error   { background: var(--danger-10); border: 1px solid rgba(224,36,36,.2); color: var(--danger); }
.msg--success { background: rgba(21,128,61,.08); border: 1px solid rgba(21,128,61,.2); color: var(--success); }
.msg--info    { background: var(--accent-10); border: 1px solid var(--accent-20); color: var(--text-muted); }

.loading, .empty, .error {
  color: var(--text-muted);
  font-size: .875rem;
  padding: 2.5rem 0;
  text-align: center;
}
.error { color: var(--danger); }

/* ── Toast notifications ────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: .75em 1.15em;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  color: var(--text);
  z-index: 9999;
  opacity: 0;
  transform: translateY(8px) scale(.98);
  transition: opacity .2s, transform .2s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: .6em;
}
.toast--show { opacity: 1; transform: translateY(0) scale(1); }
.toast--success { border-color: rgba(21,128,61,.28); }
.toast--success::before {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
}
.toast--error { border-color: rgba(224,36,36,.28); }
.toast--error::before {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
  flex-shrink: 0;
}

/* ── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .15em .6em;
  border-radius: 100px;
  font-size: .68rem;
  font-weight: 700;
  vertical-align: middle;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.badge--lock    { background: rgba(180,83,9,.1); color: var(--warning); }
.badge--guest   { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.badge--role    { background: var(--accent-10); color: var(--accent); border: 1px solid var(--accent-20); }
.badge--pending { background: rgba(180,83,9,.1); color: var(--warning); border: 1px solid rgba(180,83,9,.22); }
.badge--disabled{ background: var(--danger-10); color: var(--danger); border: 1px solid rgba(224,36,36,.2); }

/* ═══════════════════════════════════════════════════════════════════════════
   AUTH PAGES — Shared foundation
   ═══════════════════════════════════════════════════════════════════════════ */

/* Ambient gradient background — subtle two-orb composition */
.page-login,
.page-guest,
.page-setup {
  background:
    radial-gradient(ellipse 65% 50% at 8% 65%, var(--auth-orb-1) 0%, transparent 60%),
    radial-gradient(ellipse 55% 40% at 92% 12%, var(--auth-orb-2) 0%, transparent 55%),
    var(--bg);
}

/* Base card */
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

/* Gradient top accent stripe */
.auth-card::before {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 55%, #a78bfa 100%);
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════════════════════════════ */
.page-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.login-box { width: 100%; max-width: 400px; padding: 2.25rem 2rem; }

.login-header { text-align: center; margin-bottom: 2rem; padding-top: 1.25rem; }
.login-logo-text {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -.04em;
  margin-bottom: .4rem;
  color: var(--text);
}
.login-logo {
  height: 288px;
  width: auto;
  max-width: 100%;
  display: block;
}
.login-header p { font-size: .875rem; color: var(--text-muted); margin-top: .25rem; }
.step-hint { color: var(--text-muted); font-size: .875rem; margin-bottom: 1.25rem; text-align: center; }

/* ═══════════════════════════════════════════════════════════════════════════
   GUEST PAGE
   ═══════════════════════════════════════════════════════════════════════════ */
.page-guest {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.guest-box { width: 100%; max-width: 480px; padding: 2.25rem 2rem; }

.guest-header { text-align: center; margin-bottom: 1.5rem; padding-top: 1.25rem; }
.guest-header h1 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -.04em;
}
.guest-header h1::before {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-20);
  flex-shrink: 0;
}
.guest-subtitle { color: var(--text-muted); font-size: .9rem; margin-top: .2rem; }
.guest-note { margin-top: .75rem; color: var(--text); font-style: italic; font-size: .875rem; }

.guest-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 2.5rem;
  text-align: center;
  margin-bottom: 1rem;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  cursor: pointer;
}
.guest-upload-area:hover { border-color: var(--accent); background: var(--accent-10); }
.guest-upload-area.dragover {
  border-color: var(--accent);
  background: var(--accent-10);
  box-shadow: 0 0 0 4px var(--accent-ring);
}

.guest-file-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
  color: var(--text-muted);
  font-size: .9rem;
}
.guest-file-icon { font-size: 2.25rem; line-height: 1; }
.guest-file-label:hover { color: var(--text); }
input[type=file]#file-input { display: none; }
.guest-file-name { font-size: .85rem; color: var(--text-muted); margin-top: .5rem; word-break: break-all; }

.guest-result {
  margin-top: 1.5rem;
  padding: 1rem 1.1rem;
  background: var(--accent-10);
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent-20);
  font-size: .875rem;
  word-break: break-all;
}
.guest-result a { color: var(--accent); font-weight: 500; }

.status-success { color: var(--success); }
.status-error   { color: var(--danger); }
.status-info    { color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════════════════
   SETUP PAGE
   ═══════════════════════════════════════════════════════════════════════════ */
.page-setup {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1.5rem;
}

.setup-box { width: 100%; max-width: 520px; padding: 2.25rem 2rem; margin: auto 0; }

.setup-header { text-align: center; margin-bottom: 2rem; padding-top: 1.25rem; }
.setup-header h1 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -.04em;
}
.setup-header h1::before {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-20);
  flex-shrink: 0;
}
.setup-subtitle { color: var(--text-muted); font-size: .9rem; margin-top: .25rem; }
.setup-loading { text-align: center; color: var(--text-muted); padding: 2rem 0; }

.setup-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.setup-section:last-of-type { border-bottom: none; }
.setup-section h2 { font-size: 1rem; font-weight: 700; margin-bottom: .6rem; letter-spacing: -.015em; }
.setup-section p  { font-size: .875rem; color: var(--text-muted); margin-bottom: 1rem; }

.totp-setup {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.qr-container { display: flex; flex-direction: column; align-items: center; gap: .75rem; }
.qr-image { border-radius: 10px; border: 4px solid #fff; box-shadow: 0 2px 16px rgba(0,0,0,.12); }
.qr-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  color: var(--text-muted);
  font-size: .8rem;
  text-align: center;
}
.qr-icon { font-size: 1.5rem; }
.totp-manual { flex: 1; }
.totp-label {
  font-size: .72rem;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: .4rem;
}
.totp-secret {
  display: block;
  font-family: 'SF Mono', 'Cascadia Code', ui-monospace, monospace;
  font-size: .95rem;
  letter-spacing: .12em;
  padding: .65em .85em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  user-select: all;
  word-break: break-all;
}

.setup-done { text-align: center; padding: 1.5rem 0; }
.setup-done-msg { font-size: 1.1rem; color: var(--success); margin-bottom: 1.5rem; font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════════════════
   DASHBOARD — Sidebar layout
   ═══════════════════════════════════════════════════════════════════════════ */
.page-dashboard { display: flex; flex-direction: row; min-height: 100vh; }

/* Main content area */
.dashboard-main {
  flex: 1;
  min-width: 0;
  padding: 2.5rem 3rem;
  overflow-y: auto;
}

/* Keep pane content readable at wide viewports */
.tab-pane .pane-inner { max-width: 860px; }
/* File panes: use all available width so long filenames are visible */
[data-pane="public"] .pane-inner,
[data-pane="private"] .pane-inner { max-width: none; }

/* Pane fade-in animation */
.tab-pane { animation: fadein .18s cubic-bezier(0.4, 0, 0.2, 1); }
@keyframes fadein {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

/* Pane typography */
.pane-title {
  font-size: 1.55rem;
  font-weight: 800;
  margin-bottom: .3rem;
  letter-spacing: -.04em;
  color: var(--text);
}
.pane-desc {
  font-size: .875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}
.pane-notice {
  padding: .7em 1em;
  background: var(--accent-10);
  border: 1px solid var(--accent-20);
  border-radius: var(--radius-sm);
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

/* ── Left sidebar ───────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: visible;
  flex-shrink: 0;
  z-index: 50;
  transition: width var(--transition), min-width var(--transition);
}

.sidebar.is-collapsed {
  width: var(--sidebar-width-sm);
  min-width: var(--sidebar-width-sm);
}

/* Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: 1.15rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-brand__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  box-shadow: 0 0 6px var(--accent-ring);
}
.sidebar-brand__logo {
  height: 24px;
  width: auto;
  flex-shrink: 0;
  display: block;
}
.sidebar-brand__name {
  font-weight: 800;
  font-size: .95rem;
  letter-spacing: -.035em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition);
}

/* Nav list */
.sidebar-nav { list-style: none; padding: .5rem 0; margin: 0; }

/* Nav item button */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  width: 100%;
  padding: .58rem 1rem;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: .875rem;
  font-weight: 500;
  font-family: inherit;
  text-align: left;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.sidebar-item:hover { background: var(--nav-hover-bg); color: var(--text); }
.sidebar-item.active {
  background: var(--nav-active-bg);
  color: var(--nav-active-fg);
  border-left-color: var(--nav-active-bar);
  font-weight: 600;
}
.sidebar-item.active .sidebar-icon { color: var(--accent); }

.sidebar-icon { flex-shrink: 0; width: 16px; height: 16px; }
.sidebar-label { overflow: hidden; white-space: nowrap; transition: opacity var(--transition); }

/* Collapsed — center icons, hide text */
.sidebar.is-collapsed .sidebar-brand     { justify-content: center; padding: 1.15rem 0; }
.sidebar.is-collapsed .sidebar-brand__name,
.sidebar.is-collapsed .sidebar-label,
.sidebar.is-collapsed .sidebar-section-label,
.sidebar.is-collapsed .sidebar-section-chevron,
.sidebar.is-collapsed .sidebar-username  { opacity: 0; width: 0; overflow: hidden; pointer-events: none; }
.sidebar.is-collapsed .sidebar-item      { padding: .58rem 0; justify-content: center; gap: 0; }
.sidebar.is-collapsed .sidebar-section-toggle { padding: .4rem 0; justify-content: center; }
.sidebar.is-collapsed .sidebar-bottom    { flex-direction: column; padding: .75rem 0; align-items: center; gap: .6rem; }
.sidebar.is-collapsed .user-pill         { flex: none; padding: 0; gap: 0; }
.sidebar.is-collapsed .sidebar-collapse-btn svg { transform: rotate(180deg); }

/* Admin section group */
.sidebar-section {
  margin-top: .25rem;
  border-top: 1px solid var(--border);
  padding-top: .25rem;
}
.sidebar-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: .4rem 1rem .4rem 1.1rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: .68rem;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: .1em;
  text-transform: uppercase;
  transition: color var(--transition);
}
.sidebar-section-toggle:hover { color: var(--accent); }
.sidebar-section-chevron { transition: transform .2s ease; flex-shrink: 0; }
.sidebar-section-toggle[aria-expanded="false"] .sidebar-section-chevron { transform: rotate(-90deg); }
.sidebar-nav--admin { overflow: hidden; transition: max-height .25s ease; max-height: 200px; }
.sidebar-nav--admin.is-hidden { max-height: 0; }

/* Collapse toggle (sticks half-outside right edge) */
.sidebar-collapse-btn {
  position: absolute;
  bottom: 1rem;
  right: -12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: color var(--transition), background var(--transition), border-color var(--transition);
  z-index: 10;
  box-shadow: var(--shadow-sm);
}
.sidebar-collapse-btn:hover {
  color: var(--accent);
  background: var(--accent-10);
  border-color: var(--accent-20);
}

/* Bottom section */
.sidebar-spacer { flex: 1; }
.sidebar-bottom {
  border-top: 1px solid var(--border);
  padding: .6rem .75rem;
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-shrink: 0;
}

/* User pill — avatar + username */
.user-pill {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex: 1;
  min-width: 0;
  padding: .3rem .4rem;
  border-radius: var(--radius-xs);
  transition: background var(--transition);
}
.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
  box-shadow: 0 1px 4px rgba(99,102,241,.35);
}
.sidebar-username {
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.sidebar-bottom-actions { display: flex; align-items: center; gap: .3rem; flex-shrink: 0; }

/* Disk usage bar */
.sidebar-disk {
  padding: .6rem .75rem .5rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  transition: opacity var(--transition);
}
.disk-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: .3rem;
}
.disk-label-text {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
}
.disk-label-value {
  font-size: .68rem;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.disk-bar {
  height: 4px;
  background: var(--surface-2);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: .3rem;
}
.disk-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 100px;
  width: 0%;
  transition: width .4s ease;
}
.disk-bar-fill.is-warn  { background: var(--warning); }
.disk-bar-fill.is-crit  { background: var(--danger); }
.disk-free {
  font-size: .67rem;
  color: var(--text-muted);
  opacity: .75;
}
.sidebar.is-collapsed .sidebar-disk { opacity: 0; pointer-events: none; height: 0; padding: 0; border: none; overflow: hidden; }

/* Mobile top bar + drawer */
.mobile-topbar { display: none; }
.mobile-brand  { font-weight: 800; font-size: .95rem; letter-spacing: -.035em; }
.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .3rem;
  border-radius: var(--radius-xs);
  transition: background var(--transition);
}
.hamburger:hover { background: var(--surface-2); }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 98;
  opacity: 0;
  transition: opacity .2s;
  backdrop-filter: blur(2px);
}
.sidebar-backdrop.is-visible { opacity: 1; }

/* ── Upload dropzone ────────────────────────────────────────────────────── */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  margin-bottom: 1.25rem;
  user-select: none;
}
.upload-area:hover, .upload-area.dragover {
  border-color: var(--accent);
  background: var(--accent-10);
}
.upload-area.dragover { box-shadow: 0 0 0 4px var(--accent-ring); }
.upload-area.uploading { opacity: .6; pointer-events: none; }
.dropzone-hint { color: var(--text-muted); font-size: .9rem; }
.dropzone-hint strong { color: var(--accent); font-weight: 600; }
.upload-option {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  font-size: .8rem;
  color: var(--text-muted);
  cursor: pointer;
  margin-top: .75rem;
}

.upload-progress { margin-bottom: 1rem; }
.progress-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: .4rem;
}
.progress-label { font-size: .78rem; color: var(--text-muted); }
.btn-cancel-upload {
  font-size: .75rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: .15em .5em;
  border-radius: var(--radius-xs);
  transition: color var(--transition), background var(--transition);
  line-height: 1;
}
.btn-cancel-upload:hover { color: var(--danger); background: var(--danger-10); }

/* ── Modal ──────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 1rem;
  animation: modal-fade-in .15s ease;
}
@keyframes modal-fade-in { from { opacity: 0 } to { opacity: 1 } }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  width: 100%; max-width: 480px; overflow: hidden;
  animation: modal-slide-in .18s ease;
}
@keyframes modal-slide-in { from { transform: translateY(8px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem .75rem; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: .975rem; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.modal-close {
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  padding: .25rem; border-radius: 6px; display: flex; align-items: center;
  transition: color var(--transition), background var(--transition);
}
.modal-close:hover { color: var(--text); background: var(--surface-2); }
.modal-body { padding: 1.1rem 1.25rem; }
.modal-filename { font-size: .8rem; color: var(--text-muted); margin-bottom: 1rem; word-break: break-all; }
.modal-footer {
  padding: .85rem 1.25rem; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: .5rem;
}
/* Password input with eye toggle */
.pw-input-wrap { position: relative; }
.pw-input-wrap input { width: 100%; padding-right: 2.4rem; }
.btn-pw-eye {
  position: absolute; right: .6rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  display: flex; align-items: center; padding: .2rem;
  transition: color var(--transition);
}
.btn-pw-eye:hover { color: var(--text); }
/* Success panel */
.pw-success-hint {
  font-size: .82rem; color: var(--text-muted); margin-bottom: 1rem;
  padding: .6rem .85rem; background: var(--accent-10); border: 1px solid var(--accent-20);
  border-radius: var(--radius-sm); line-height: 1.55;
}
.pw-copy-row {
  display: flex; align-items: center; gap: .5rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .55rem .75rem;
}
.pw-display {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: .9rem; flex: 1; min-width: 0; word-break: break-all;
  color: var(--text); letter-spacing: .03em; user-select: all;
}
.btn--danger-ghost {
  background: none; border: 1px solid transparent; color: var(--danger);
  padding: .4em .85em; border-radius: var(--radius-sm); font-size: .875rem;
  font-family: inherit; font-weight: 500; cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.btn--danger-ghost:hover { background: var(--danger-10); border-color: var(--danger); }

/* ── File list ──────────────────────────────────────────────────────────── */
/* ── File search ──────────────────────────────────────────────────────── */
.file-search-wrap {
  margin-bottom: .65rem;
}
.file-search-field {
  position: relative;
  display: flex;
  align-items: center;
}
.file-search-icon {
  position: absolute;
  left: .65rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  display: block;
  line-height: 0;
}
.file-search-input {
  flex: 1;
  min-width: 0;
  padding: .5rem .75rem .5rem 2.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: .875rem;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.file-search-input::placeholder { color: var(--text-muted); opacity: .7; }
.file-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-10);
}
/* Hide the browser's default clear (×) button — we clear on Escape */
.file-search-input::-webkit-search-cancel-button { display: none; }
.search-count {
  display: block;
  font-size: .72rem;
  color: var(--text-muted);
  margin-top: .3rem;
  padding-left: .1rem;
}
.search-count[hidden] { display: none; }

.file-toolbar {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem .75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-size: .85rem;
}
.file-toolbar label { display: flex; align-items: center; gap: .4em; cursor: pointer; color: var(--text-muted); }

.file-list {
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  overflow: hidden;
}
.file-section-header {
  padding: .3rem .75rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.file-row {
  display: grid;
  grid-template-columns: 2rem 3rem 1fr auto;
  align-items: center;
  gap: .75rem;
  padding: .7rem .75rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  transition: background var(--transition), border-color var(--transition);
}
.file-row:last-child { border-bottom: none; }
.file-row:hover {
  background: var(--surface-2);
  border-left-color: var(--accent);
}

.file-check input[type=checkbox] { cursor: pointer; }

.file-thumb {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-xs);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-thumb--empty { color: var(--text-muted); font-size: 1.25rem; }

.file-info { min-width: 0; }
.file-name {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .875rem;
  font-weight: 500;
  white-space: nowrap;
}
.file-name a { white-space: nowrap; color: var(--text); }
.file-name a:hover { color: var(--accent); text-decoration: none; }
.file-name-badges { display: flex; align-items: center; gap: .25rem; }
.file-meta { font-size: .75rem; color: var(--text-muted); margin-top: .1rem; }

.file-actions { display: flex; align-items: center; gap: .1rem; }

/* ── Inline forms (whitelist, users, tokens) ────────────────────────────── */
.inline-form { margin-bottom: 1.5rem; }
.inline-form__fields {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: .6rem;
}
.inline-form__fields input,
.inline-form__fields select { flex: 1; min-width: 140px; }
.field-group { display: flex; align-items: center; gap: .5rem; white-space: nowrap; font-size: .875rem; color: var(--text-muted); }
.field-group select { flex: none; width: auto; }

/* ── List containers ────────────────────────────────────────────────────── */
.list-container { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }

/* IP rows */
.ip-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem .75rem;
  padding: .7rem .9rem;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  font-size: .875rem;
  transition: background var(--transition), border-color var(--transition);
}
.ip-row:last-child { border-bottom: none; }
.ip-row:hover { background: var(--surface-2); border-left-color: var(--accent-20); }
.ip-addr { font-family: 'SF Mono', 'Cascadia Code', ui-monospace, monospace; font-size: .85rem; font-weight: 500; }
.ip-note { color: var(--text-muted); font-size: .8rem; flex: 1; }
.ip-by   { font-size: .75rem; color: var(--text-muted); }

/* User rows */
.user-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem .75rem;
  padding: .75rem .9rem;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  font-size: .875rem;
  transition: background var(--transition), border-color var(--transition);
}
.user-row:last-child { border-bottom: none; }
.user-row:hover { background: var(--surface-2); border-left-color: var(--accent-20); }
.user-name  { font-weight: 700; min-width: 7rem; letter-spacing: -.01em; }
.user-email { color: var(--text-muted); font-size: .8rem; flex: 1; min-width: 10rem; }
.user-actions { display: flex; gap: .4rem; flex-wrap: wrap; margin-left: auto; }

/* Token rows */
.token-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem .75rem;
  padding: .7rem .9rem;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  font-size: .875rem;
  transition: background var(--transition), border-color var(--transition);
}
.token-row:last-child { border-bottom: none; }
.token-row:hover { background: var(--surface-2); border-left-color: var(--accent-20); }
.token-note { flex: 1; }
.token-by   { font-size: .75rem; color: var(--text-muted); }
.token-status {
  font-size: .68rem;
  font-weight: 700;
  padding: .15em .6em;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.token-status.active  { background: rgba(21,128,61,.1); color: var(--success); }
.token-status.used    { background: var(--surface-2); color: var(--text-muted); }
.token-status.expired { background: var(--danger-10); color: var(--danger); }

/* Client IP hint (admin whitelist) */
.client-ip-hint { font-size: .8rem; color: var(--text-muted); margin-bottom: .75rem; }

/* ── API key reveal banner ───────────────────────────────────────────────── */
.apikey-reveal {
  padding: .9rem 1rem;
  background: var(--accent-10);
  border: 1px solid var(--accent-20);
  border-radius: var(--radius-sm);
  margin-bottom: .75rem;
}
.apikey-reveal__header {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .78rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: .6rem;
}
.apikey-reveal__row {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.apikey-reveal__code {
  flex: 1;
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', ui-monospace, monospace;
  font-size: .8rem;
  word-break: break-all;
  background: var(--surface);
  border: 1px solid var(--accent-20);
  border-radius: var(--radius-sm);
  padding: .45rem .7rem;
  user-select: all;
}

/* ── API key list rows ───────────────────────────────────────────────────── */
.apikey-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--border);
}
.apikey-row:last-child { border-bottom: none; }
.apikey-row:hover { background: var(--surface-2); }
.apikey-row__info {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  min-width: 0;
}
.apikey-row__label {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.apikey-row__meta {
  font-size: .75rem;
  color: var(--text-muted);
}
.apikey-row__key {
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', ui-monospace, monospace;
  font-size: .72rem;
  color: var(--text-muted);
  word-break: break-all;
}
.apikey-row__actions {
  display: flex;
  gap: .5rem;
  flex-shrink: 0;
}

/* ── Push / API key instructions ────────────────────────────────────────── */
.push-instructions {
  margin-top: 1.75rem;
  padding: 1.1rem 1.25rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.push-instructions__title {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: .6rem;
}
.push-instructions__desc {
  font-size: .825rem;
  color: var(--text-muted);
  margin-bottom: .85rem;
  line-height: 1.55;
}
.push-instructions__label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: .3rem;
}
.push-instructions__code {
  display: block;
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', ui-monospace, monospace;
  font-size: .8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .7rem .9rem;
  margin-bottom: 1rem;
  white-space: pre;
  overflow-x: auto;
  line-height: 1.6;
  color: var(--text);
}

/* ── Curl command builder ─────────────────────────────────────────────────── */
.curl-builder {
  margin-top: .75rem;
}
/* Full-width file path row sits directly in .curl-builder */
.curl-builder > .curl-builder__field {
  margin-bottom: .6rem;
}
/* Key + type row */
.curl-builder__fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px;
  gap: .6rem;
  margin-bottom: .65rem;
  align-items: end;
}
.curl-builder__field {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.curl-builder__label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: .28rem;
}
.curl-builder__input,
.curl-builder__select {
  font-size: .825rem;
  padding: .38rem .55rem;
  width: 100%;
  box-sizing: border-box;
}
/* Restore right padding so the native select arrow stays visible */
.curl-builder__select { padding-right: 2.25em; }
.curl-builder__select:disabled { opacity: .55; cursor: not-allowed; }
.curl-builder__output { margin-bottom: .5rem; }

/* ── Responsive ≤ 767px ─────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .page-dashboard { flex-direction: column; }

  .mobile-topbar {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 90;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99;
    box-shadow: 8px 0 32px rgba(0,0,0,.2);
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-backdrop { display: block; }
  .sidebar-collapse-btn { display: none; }

  .dashboard-main { padding: 1.5rem 1.25rem; }

  .file-row { grid-template-columns: 2rem 1fr auto; }
  .file-thumb { display: none; }

  .login-box, .guest-box, .setup-box { padding: 1.75rem 1.25rem; }
  .totp-setup { flex-direction: column; }
  .inline-form__fields { flex-direction: column; }
  .inline-form__fields input, .inline-form__fields select { min-width: 0; }
}
