/* ─────────────────────────────────────────────────────────────────────────
   anon-edge — app.css
   Clean modern design · Light & dark mode
   ───────────────────────────────────────────────────────────────────────── */

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

/* ── Light theme (default) ─────────────────────────────────────────────── */
:root {
  --bg:          #f0f2f5;
  --surface:     #ffffff;
  --surface-2:   #e8eaf0;
  --border:      #dcdee8;
  --text:        #10111a;
  --text-muted:  #7a7d98;
  --primary:     #5b6ef5;
  --primary-h:   #4558e8;
  --primary-10:  rgba(91,110,245,.1);
  --primary-20:  rgba(91,110,245,.2);
  --danger:      #ef4444;
  --danger-h:    #dc2626;
  --danger-10:   rgba(239,68,68,.1);
  --success:     #16a34a;
  --warning:     #d97706;
  --radius:      12px;
  --radius-sm:   8px;
  --shadow:      0 1px 3px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.09);
  --shadow-sm:   0 1px 3px rgba(0,0,0,.06);
  --transition:  .15s ease;
  color-scheme:  light;
}

/* ── Dark theme — OS preference ────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:         #0d0e17;
    --surface:    #13141e;
    --surface-2:  #191b28;
    --border:     #23253a;
    --text:       #dde1f5;
    --text-muted: #575f84;
    --primary:    #6b7fff;
    --primary-h:  #5b6ef5;
    --primary-10: rgba(107,127,255,.12);
    --primary-20: rgba(107,127,255,.22);
    --danger:     #e05353;
    --danger-h:   #c83e3e;
    --danger-10:  rgba(224,83,83,.12);
    --success:    #34d374;
    --warning:    #f5a623;
    --shadow:     0 4px 28px rgba(0,0,0,.55);
    --shadow-sm:  0 1px 4px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}

/* ── Manual overrides — higher specificity via attribute selector ────────
   (attribute selectors beat :root pseudo-class, so these always win)     */
[data-theme="light"] {
  --bg: #f0f2f5; --surface: #ffffff; --surface-2: #e8eaf0; --border: #dcdee8;
  --text: #10111a; --text-muted: #7a7d98;
  --primary: #5b6ef5; --primary-h: #4558e8;
  --primary-10: rgba(91,110,245,.1); --primary-20: rgba(91,110,245,.2);
  --danger: #ef4444; --danger-h: #dc2626; --danger-10: rgba(239,68,68,.1);
  --success: #16a34a; --warning: #d97706;
  --shadow: 0 1px 3px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.09);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0d0e17; --surface: #13141e; --surface-2: #191b28; --border: #23253a;
  --text: #dde1f5; --text-muted: #575f84;
  --primary: #6b7fff; --primary-h: #5b6ef5;
  --primary-10: rgba(107,127,255,.12); --primary-20: rgba(107,127,255,.22);
  --danger: #e05353; --danger-h: #c83e3e; --danger-10: rgba(224,83,83,.12);
  --success: #34d374; --warning: #f5a623;
  --shadow: 0 4px 28px rgba(0,0,0,.55); --shadow-sm: 0 1px 4px rgba(0,0,0,.3);
  color-scheme: dark;
}

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

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

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; font-weight: 600; }

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

/* ── Theme toggle button ────────────────────────────────────────────────── */
.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 mode → show moon (click to go dark) */
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }

/* Dark mode → show sun (click to go light) */
@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; }

/* Fixed-position toggle for pages without a header */
.theme-toggle--fixed {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 200;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  padding: .55em 1.15em;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), box-shadow 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(--primary);
  color: #fff;
  box-shadow: 0 1px 3px rgba(91,110,245,.3), 0 2px 8px rgba(91,110,245,.15);
}
.btn--primary:hover:not(:disabled) {
  background: var(--primary-h);
  box-shadow: 0 2px 6px rgba(91,110,245,.4), 0 4px 14px rgba(91,110,245,.2);
  text-decoration: none;
}
.btn--danger  { background: var(--danger); color: #fff; }
.btn--danger:hover:not(:disabled)  { background: var(--danger-h); }
.btn--ghost   { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn--ghost:hover:not(:disabled) { background: var(--border); 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: 6px;
  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); }
.btn-icon.btn-star.starred { color: var(--warning); }

/* Small bordered button (rename, actions) */
.btn-sm {
  padding: .28em .7em;
  font-size: .8rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition);
}
.btn-sm:hover { background: var(--border); }
.btn-sm.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-sm.btn-danger:hover { background: var(--danger); color: #fff; }

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

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;
  padding: .6em .8em;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-10);
}
input::placeholder { color: var(--text-muted); opacity: .75; }

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='%237a7d98'/%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: var(--primary); border-radius: 2px; transition: width .25s; }
progress::-moz-progress-bar      { background: var(--primary); 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(239,68,68,.25); color: var(--danger); }
.msg--success { background: rgba(22,163,74,.09); border: 1px solid rgba(22,163,74,.25); color: var(--success); }
.msg--info    { background: var(--primary-10); border: 1px solid var(--primary-20); color: var(--primary); }

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

/* ── Toast notifications ────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: .7em 1.1em;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  color: var(--text);
  z-index: 9999;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s;
  max-width: 360px;
}
.toast--show    { opacity: 1; transform: translateY(0); }
.toast--success { border-color: rgba(22,163,74,.35);  color: var(--success); }
.toast--error   { border-color: rgba(239,68,68,.35);  color: var(--danger); }

/* ── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .1em .55em;
  border-radius: 5px;
  font-size: .7rem;
  font-weight: 600;
  vertical-align: middle;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.badge--lock     { background: rgba(217,119,6,.12); color: var(--warning); }
.badge--guest    { background: var(--primary-10);   color: var(--primary); }
.badge--role     { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.badge--pending  { background: rgba(217,119,6,.1); color: var(--warning); border: 1px solid rgba(217,119,6,.25); }
.badge--disabled { background: var(--danger-10); color: var(--danger); border: 1px solid rgba(239,68,68,.2); }

/* ═══════════════════════════════════════════════════════════════════════════
   AUTH CARD BASE  (shared by login, guest, setup)
   ═══════════════════════════════════════════════════════════════════════════ */
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden; /* clips the ::before accent bar to rounded corners */
}

/* Gradient top accent */
.auth-card::before {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--primary) 0%, #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: 2rem 2rem 2rem;
}

.login-header { text-align: center; margin-bottom: 2rem; padding-top: 1.25rem; }
.login-header h1 {
  font-size: 1.5rem;
  letter-spacing: -.03em;
  color: var(--text);
}
.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: 2rem 2rem 2rem;
}

.guest-header { text-align: center; margin-bottom: 1.5rem; padding-top: 1.25rem; }
.guest-header h1 { font-size: 1.4rem; letter-spacing: -.025em; }
.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.25rem;
  text-align: center;
  margin-bottom: 1rem;
  transition: border-color var(--transition), background var(--transition);
  cursor: pointer;
}
.guest-upload-area:hover { border-color: var(--primary); background: var(--primary-10); }

.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: 2rem; 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(--primary); margin-top: .5rem; word-break: break-all; }

.guest-result {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: .875rem;
  word-break: break-all;
}
.guest-result a { color: var(--primary); }

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

/* ═══════════════════════════════════════════════════════════════════════════
   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: 2rem 2rem 2rem;
  margin: auto 0;
}

.setup-header { text-align: center; margin-bottom: 2rem; padding-top: 1.25rem; }
.setup-header h1 { font-size: 1.4rem; letter-spacing: -.025em; }
.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; margin-bottom: .75rem; color: var(--text); }
.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: 8px; border: 4px solid #fff; }
.qr-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  color: var(--primary);
  font-size: .8rem;
  text-align: center;
}
.qr-icon { font-size: 1.5rem; }

.totp-manual { flex: 1; }
.totp-label  { font-size: .8rem; color: var(--text-muted); margin-bottom: .4rem; }
.totp-secret {
  display: block;
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
  font-size: 1rem;
  letter-spacing: .1em;
  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; }

/* ═══════════════════════════════════════════════════════════════════════════
   DASHBOARD
   ═══════════════════════════════════════════════════════════════════════════ */
.page-dashboard { display: flex; flex-direction: column; min-height: 100vh; }

/* ── Site header ────────────────────────────────────────────────────────── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .7rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.site-header__brand {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -.02em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.brand-accent {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}
.site-header__user { display: flex; align-items: center; gap: .6rem; }
.header-username { font-size: .875rem; color: var(--text-muted); }

/* ── Dashboard layout ───────────────────────────────────────────────────── */
.dashboard-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

/* ── Tab nav ────────────────────────────────────────────────────────────── */
.tab-nav {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.75rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: .875rem;
  font-weight: 500;
  padding: .9rem 1.1rem;
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── Tab pane ───────────────────────────────────────────────────────────── */
.tab-pane { animation: fadein .18s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

.pane-title { font-size: 1rem; font-weight: 600; margin-bottom: .4rem; }
.pane-desc  { font-size: .875rem; color: var(--text-muted); margin-bottom: 1.25rem; }
.pane-notice {
  padding: .65em 1em;
  background: var(--primary-10);
  border: 1px solid var(--primary-20);
  border-radius: var(--radius-sm);
  font-size: .85rem;
  color: var(--primary);
  margin-bottom: 1.25rem;
}

/* ── Upload dropzone ────────────────────────────────────────────────────── */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 1.75rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  margin-bottom: 1.25rem;
  user-select: none;
}
.upload-area:hover, .upload-area.dragover {
  border-color: var(--primary);
  background: var(--primary-10);
}
.upload-area.uploading { opacity: .6; pointer-events: none; }
.dropzone-hint { color: var(--text-muted); font-size: .9rem; }
.dropzone-hint strong { color: var(--text); }
.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-label { font-size: .78rem; color: var(--text-muted); display: block; margin-top: .35rem; }

/* ── File list ──────────────────────────────────────────────────────────── */
.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-row {
  display: grid;
  grid-template-columns: 2rem 3rem 1fr auto;
  align-items: center;
  gap: .75rem;
  padding: .65rem .75rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.file-row:last-child { border-bottom: none; }
.file-row:hover { background: var(--surface-2); }

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

.file-thumb {
  width: 3rem;
  height: 3rem;
  border-radius: 6px;
  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 { font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-name a { color: var(--text); }
.file-name a:hover { color: var(--primary); text-decoration: none; }
.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: .65rem .9rem;
  border-bottom: 1px solid var(--border);
  font-size: .875rem;
  transition: background var(--transition);
}
.ip-row:last-child { border-bottom: none; }
.ip-row:hover { background: var(--surface-2); }
.ip-addr { font-family: 'SF Mono', 'Cascadia Code', monospace; font-size: .85rem; }
.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: .7rem .9rem;
  border-bottom: 1px solid var(--border);
  font-size: .875rem;
  transition: background var(--transition);
}
.user-row:last-child { border-bottom: none; }
.user-row:hover { background: var(--surface-2); }
.user-name  { font-weight: 600; min-width: 7rem; }
.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: .65rem .9rem;
  border-bottom: 1px solid var(--border);
  font-size: .875rem;
  transition: background var(--transition);
}
.token-row:last-child { border-bottom: none; }
.token-row:hover { background: var(--surface-2); }
.token-note { flex: 1; }
.token-by   { font-size: .75rem; color: var(--text-muted); }
.token-status          { font-size: .75rem; font-weight: 600; padding: .15em .55em; border-radius: 4px; text-transform: uppercase; letter-spacing: .03em; }
.token-status.active   { background: rgba(22,163,74,.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); }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .site-header { padding: .6rem 1rem; }
  .dashboard-layout { padding: 0 1rem 2rem; }
  .file-row { grid-template-columns: 2rem 1fr auto; }
  .file-thumb { display: none; }
  .login-box, .guest-box, .setup-box { padding: 1.75rem 1.25rem 1.75rem; }
  .totp-setup { flex-direction: column; }
  .inline-form__fields { flex-direction: column; }
  .inline-form__fields input, .inline-form__fields select { min-width: 0; }
}
