/* SONAN Vault — Mobile-First Design System */
@import url('https://fonts.googleapis.com/css2?family=Audiowide&display=swap');

:root {
  --navy:       #0f172a;
  --navy2:      #1e293b;
  --blue:       #2563eb;
  --blue2:      #1d4ed8;
  --blue-lt:    #dbeafe;
  --green:      #16a34a;
  --green-lt:   #dcfce7;
  --red:        #dc2626;
  --red-lt:     #fee2e2;
  --gold:       #f59e0b;
  --purple:     #7c3aed;
  --bg:         #f8fafc;
  --card:       #ffffff;
  --surface:    #f1f5f9;
  --border:     #e2e8f0;
  --text:       #0f172a;
  --muted:      #64748b;
  --radius:     14px;
  --shadow:     0 2px 16px rgba(0,0,0,.08);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.14);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top:    env(safe-area-inset-top, 0px);
  /* SONAN DIGITAL brand */
  --brand-red:  #C8102E;
  --brand-blue: #1D98F0;
  /* Aurora brand */
  --aurora:     #62cd2d;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  overscroll-behavior: none;
}
button, input, select, textarea { font-family: inherit; -webkit-appearance: none; appearance: none; }
a { color: var(--blue); text-decoration: none; }

/* ── AUTH PAGES ──────────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh;
  min-height: -webkit-fill-available;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(20px, env(safe-area-inset-top, 20px)) 20px max(20px, env(safe-area-inset-bottom, 20px));
  background: linear-gradient(160deg, #0f172a 0%, #1e3a8a 60%, #0f172a 100%);
}
.auth-card {
  background: #fff;
  border-radius: 24px;
  padding: 40px 28px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 24px 64px rgba(0,0,0,.35);
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo .mark { font-size: 3rem; }
.auth-logo h1 { font-family: 'Audiowide', sans-serif; font-size: 1.5rem; font-weight: 400; color: var(--aurora); margin-top: 10px; letter-spacing: .5px; text-transform: uppercase; }
.auth-logo p  { color: var(--muted); font-size: .875rem; margin-top: 4px; }
.auth-brand { font-family: 'Audiowide', sans-serif; font-size: 1rem; font-weight: 400; color: var(--brand-red); letter-spacing: .5px; margin-bottom: 4px; }
.auth-brand span { color: var(--brand-blue); }

/* Aurora name + tagline reusable classes */
.aurora-name { font-family: 'Audiowide', sans-serif; color: var(--aurora); font-weight: 400; letter-spacing: .4px; text-transform: uppercase; }
.aurora-tagline { font-family: 'Audiowide', sans-serif; color: var(--muted); font-weight: 400; letter-spacing: .3px; text-transform: uppercase; font-size: .8em; }

/* Auth footer */
.auth-footer {
  text-align: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: .75rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.auth-footer-brand { font-family: 'Audiowide', sans-serif; font-weight: 400; color: var(--brand-red); }
.auth-footer-brand span { color: var(--brand-blue); }
.auth-footer a { color: var(--muted); }
.auth-notice {
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px;
  padding: 12px 14px; font-size: .82rem; color: #1e40af; margin-bottom: 20px; line-height: 1.6;
}
.auth-notice.warning { background: #fef3c7; border-color: #fcd34d; color: #92400e; }

/* ── LAYOUT ──────────────────────────────────────────────── */
.vault-layout { display: flex; flex-direction: column; min-height: 100vh; min-height: -webkit-fill-available; }

/* Topbar */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: max(12px, env(safe-area-inset-top, 12px)) 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 56px;
}
.topbar-logo { font-family: 'Audiowide', sans-serif; font-size: 1.5rem; font-weight: 400; color: var(--brand-red); letter-spacing: .5px; line-height: 1.2; }
.topbar-logo span { color: var(--brand-blue); }
.topbar-sub { font-size: .8rem; letter-spacing: .3px; margin-top: 2px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }

/* Vault bar */
#vault-bar { scrollbar-width: none; }
#vault-bar::-webkit-scrollbar { display: none; }
#vault-bar button:hover { opacity: .85; }
#vault-bar button:active { transform: scale(.96); }

/* App footer */
.app-footer {
  padding: 14px 16px calc(14px + var(--safe-bottom));
  border-top: 1px solid var(--border);
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-size: .85rem;
  color: var(--muted);
  text-align: center;
}
.app-footer-product { display: flex; align-items: center; gap: 7px; }
.app-footer-appname { font-family: 'Audiowide', sans-serif; font-weight: 400; color: var(--aurora); font-size: 1rem; letter-spacing: .4px; text-transform: uppercase; }
.app-footer-tagline { font-family: 'Audiowide', sans-serif; font-weight: 400; color: var(--muted); font-size: 1rem; letter-spacing: .3px; text-transform: uppercase; }
.app-footer-by { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; justify-content: center; }
.app-footer-brand { font-family: 'Audiowide', sans-serif; font-weight: 400; color: var(--brand-red); }
.app-footer-brand span { color: var(--brand-blue); }
.app-footer-group-co { font-family: 'Audiowide', sans-serif; font-weight: 400; color: var(--brand-red); font-size: .65rem; letter-spacing: .3px; }
.app-footer-sep { opacity: .35; }
.app-footer-build { margin-top: 2px; }
.build-sha {
  font-family: 'SF Mono', 'Courier New', ui-monospace, monospace;
  font-size: .7rem;
  letter-spacing: .04em;
  opacity: .7;
  user-select: all;
}

/* ── LOGO IMAGES ─────────────────────────────────────────── */
.sidebar-logo-img { height: 38px; width: auto; display: block; margin-bottom: 6px; }
.topbar-logo-img  { height: 40px; width: auto; display: block; }

/* ── ALPHABETICAL GROUPS ─────────────────────────────────── */
.alpha-group { margin-bottom: 6px; }
.alpha-header {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; cursor: pointer; border-radius: 10px;
  background: var(--surface); border: none; width: 100%; text-align: left;
  transition: background .15s;
  user-select: none;
}
.alpha-header:hover { background: var(--border); }
.alpha-letter { font-size: 1rem; font-weight: 800; color: var(--navy); min-width: 22px; }
.alpha-count { font-size: .75rem; color: var(--muted); font-weight: 500; }
.alpha-chevron { margin-left: auto; font-size: .75rem; color: var(--muted); transition: transform .2s; }
.alpha-header.collapsed .alpha-chevron { transform: rotate(-90deg); }
.alpha-body { display: flex; flex-direction: column; gap: 8px; padding: 8px 0 4px; }

/* Page content */
.page {
  flex: 1;
  padding: 16px;
  padding-bottom: calc(80px + var(--safe-bottom));  /* space for bottom nav */
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
}

/* Bottom tab navigation (mobile-first) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  padding-bottom: var(--safe-bottom);
}
.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  gap: 3px;
  min-height: 56px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: .65rem;
  font-weight: 600;
  transition: color .15s;
  -webkit-tap-highlight-color: transparent;
}
.nav-tab .tab-icon { font-size: 1.4rem; line-height: 1; display: flex; align-items: center; justify-content: center; height: 24px; }
.nav-tab.active { color: var(--blue); }
.nav-tab.active .tab-icon { transform: scale(1.1); }

/* FAB — add button */
.fab {
  position: fixed;
  bottom: calc(72px + var(--safe-bottom));
  right: 20px;
  z-index: 90;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 1.6rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(37,99,235,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
}
.fab:active { transform: scale(.93); box-shadow: 0 2px 10px rgba(37,99,235,.3); }

/* ── SEARCH ─────────────────────────────────────────────── */
.search-wrap { display: flex; gap: 8px; margin-bottom: 14px; align-items: center; }
.alpha-toggle-btn {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .15s, color .15s, background .15s;
  padding: 0;
}
.alpha-toggle-btn:hover { border-color: var(--blue); color: var(--blue); background: #eff6ff; }
.search-input {
  flex: 1;
  padding: 11px 14px 11px 40px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: .9rem;
  outline: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 12px center;
  -webkit-appearance: none;
}
.search-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.cat-select {
  padding: 11px 12px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: .85rem;
  background: #fff;
  cursor: pointer;
  outline: none;
  color: var(--text);
  max-width: 130px;
}

/* ── STATS ───────────────────────────────────────────────── */
.stats-row { display: flex; gap: 10px; margin-bottom: 14px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
.stats-row::-webkit-scrollbar { display: none; }
.stat-pill {
  flex: 1;
  min-width: 90px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  text-align: center;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.stat-pill .num { font-size: 1.6rem; font-weight: 800; color: var(--navy); line-height: 1; }
.stat-pill .lbl { font-size: .65rem; color: var(--muted); margin-top: 5px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }

/* ── ENTRY CARDS ─────────────────────────────────────────── */
.entries-list { display: flex; flex-direction: column; gap: 10px; }
.entry-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
  cursor: pointer;
  transition: box-shadow .2s, transform .15s, border-color .2s;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
.entry-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.1); transform: translateY(-1px); border-color: var(--brand-blue); }
.entry-card:active { box-shadow: 0 1px 6px rgba(0,0,0,.06); transform: none; border-color: var(--blue); }
.entry-header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.entry-icon {
  width: 42px; height: 42px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; font-weight: 800; flex-shrink: 0;
  letter-spacing: -.01em;
  /* bg + color set inline by JS based on category */
}
.entry-label { font-weight: 700; font-size: 1rem; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-sub { font-size: .78rem; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-badge { margin-left: auto; flex-shrink: 0; }

.entry-fields { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.entry-field-chip {
  background: var(--bg);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: .75rem;
  color: var(--muted);
}
.entry-field-chip strong { color: var(--text); font-weight: 500; }

.totp-mini {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1px solid #86efac;
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.totp-mini .code { font-family: 'SF Mono', 'Courier New', monospace; font-size: 1.25rem; font-weight: 800; letter-spacing: .15em; color: var(--green); }
.totp-mini .label { font-size: .72rem; color: var(--muted); }

.entry-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.entry-actions .btn-sm {
  border-radius: 99px;
  font-size: .72rem;
  padding: 5px 13px;
  min-height: 29px;
  font-weight: 500;
  letter-spacing: .01em;
}
.entry-actions .btn-outline {
  background: var(--surface);
  border: none;
  color: #475569;
}
.entry-actions .btn-outline:hover, .entry-actions .btn-outline:active {
  background: var(--blue);
  color: #fff;
}
.entry-actions .btn-ghost.btn-sm {
  border-radius: 8px;
  color: var(--muted);
}
.entry-actions .btn-ghost.btn-sm:hover { background: var(--surface); color: var(--text); }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: .875rem; font-weight: 600;
  cursor: pointer; border: none;
  transition: all .15s;
  min-height: 44px; /* iOS minimum touch target */
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:active { background: var(--blue2); transform: scale(.97); }
.btn-success { background: var(--green); color: #fff; }
.btn-danger  { background: var(--red); color: #fff; }
.btn-outline { background: #fff; color: var(--navy); border: 1.5px solid var(--border); }
.btn-outline:active { border-color: var(--blue); color: var(--blue); }
.btn-ghost   { background: transparent; color: var(--muted); padding: 10px; }
.btn-ghost:active { background: var(--bg); }
.btn-sm { padding: 7px 14px; font-size: .8rem; min-height: 36px; border-radius: 8px; }
.btn-icon { padding: 10px; min-width: 44px; }
.btn-block { width: 100%; }

/* ── FORMS ───────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: .8rem; font-weight: 600; color: var(--navy); margin-bottom: 6px; }

/* Checkboxes — visible border in all states */
input[type=checkbox] {
  appearance: none; -webkit-appearance: none;
  width: 20px; height: 20px; min-width: 20px;
  border: 2px solid #94a3b8;
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: border-color .15s, background .15s;
  flex-shrink: 0;
}
input[type=checkbox]:checked {
  background: var(--blue);
  border-color: var(--blue);
}
input[type=checkbox]:checked::after {
  content: '';
  position: absolute;
  left: 4px; top: 1px;
  width: 8px; height: 12px;
  border: 2px solid #fff;
  border-top: none; border-left: none;
  transform: rotate(45deg);
}
input[type=checkbox]:focus { outline: 2px solid var(--blue); outline-offset: 2px; }
.form-control {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 1rem; /* 16px prevents iOS zoom */
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .15s;
  -webkit-appearance: none;
}
.form-control:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-control.mono { font-family: 'SF Mono', 'Courier New', monospace; letter-spacing: .04em; }
.input-row { display: flex; gap: 8px; align-items: flex-start; }
.input-row .form-control { flex: 1; }
.form-hint { font-size: .75rem; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

/* Password strength */
.pw-strength-bar { height: 4px; border-radius: 2px; margin-top: 6px; transition: all .3s; background: #e2e8f0; }
.pw-strength-bar::after { content: ''; display: block; height: 100%; border-radius: 2px; transition: all .3s; }
.pw-s0::after { width: 15%; background: var(--red); }
.pw-s1::after { width: 35%; background: #f97316; }
.pw-s2::after { width: 60%; background: #eab308; }
.pw-s3::after { width: 80%; background: #22c55e; }
.pw-s4::after { width: 100%; background: var(--green); }

/* ── BADGES ──────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 20px; font-size: .72rem; font-weight: 600; white-space: nowrap; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-green  { background: var(--green-lt); color: #15803d; }
.badge-purple { background: #f3e8ff; color: var(--purple); }
.badge-gray   { background: #f1f5f9; color: #475569; }
.badge-orange { background: #ffedd5; color: #c2410c; }

/* ── CARDS / SECTIONS ────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-weight: 700; font-size: .95rem; color: var(--navy); }
.card-body { padding: 16px; }
.section-label { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin: 16px 0 8px; }

/* ── TOTP VIEW ───────────────────────────────────────────── */
.totp-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.totp-card-label { font-weight: 700; font-size: .95rem; color: var(--navy); margin-bottom: 10px; }
.totp-code-big { font-family: 'SF Mono', 'Courier New', monospace; font-size: 2rem; font-weight: 800; letter-spacing: .2em; color: var(--green); }
.totp-progress { height: 3px; background: var(--border); border-radius: 2px; margin-top: 10px; overflow: hidden; }
.totp-progress-fill { height: 100%; background: var(--green); border-radius: 2px; transition: width 1s linear; }

/* ── GENERATOR ───────────────────────────────────────────── */
.gen-output {
  font-family: 'SF Mono', 'Courier New', monospace;
  font-size: .95rem;
  letter-spacing: .04em;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  word-break: break-all;
  min-height: 56px;
  margin-bottom: 12px;
  color: var(--navy);
  font-weight: 600;
  line-height: 1.5;
}
.gen-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.gen-option {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1.5px solid var(--border);
  border-radius: 10px; padding: 10px 12px;
  cursor: pointer; font-size: .85rem; font-weight: 500;
  transition: border-color .15s;
}
.gen-option input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--blue); cursor: pointer; }
.gen-option.checked { border-color: var(--blue); background: #eff6ff; color: var(--blue); }

/* ── IMPORT ──────────────────────────────────────────────── */
.import-drop {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.import-drop.drag, .import-drop:active { border-color: var(--blue); background: #eff6ff; }
.import-drop .drop-icon { font-size: 2.5rem; margin-bottom: 10px; }

/* ── MODAL ───────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 200;
  align-items: flex-end; /* Sheet from bottom on mobile */
  justify-content: center;
  padding: 0;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff;
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 -8px 40px rgba(0,0,0,.2);
  padding-bottom: var(--safe-bottom);
}
.modal-handle { width: 40px; height: 4px; background: #e2e8f0; border-radius: 2px; margin: 10px auto 0; }
.modal-header {
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: #fff; z-index: 1;
}
.modal-title { font-size: 1.1rem; font-weight: 700; color: var(--navy); }
.modal-body { padding: 16px 20px; }
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex; gap: 10px; flex-direction: column;
}
.modal-footer .btn { width: 100%; }
.btn-close { background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--muted); padding: 6px; border-radius: 8px; min-height: auto; }

/* ── EMPTY STATE ─────────────────────────────────────────── */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-icon { font-size: 3.5rem; margin-bottom: 14px; }
.empty h3 { font-size: 1.1rem; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.empty p { font-size: .875rem; }

/* ── LOCK BUTTON ─────────────────────────────────────────── */
.lock-btn-top {
  background: none; border: none; padding: 8px; cursor: pointer;
  font-size: 1.2rem; min-height: 44px; min-width: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; color: var(--muted);
}
.lock-btn-top:active { background: var(--bg); }

/* ── DESKTOP OVERRIDES ───────────────────────────────────── */
@media (min-width: 768px) {
  .vault-layout { flex-direction: row; }

  /* Sidebar on desktop */
  .bottom-nav { display: none; }
  .desktop-sidebar {
    width: 240px;
    min-width: 240px;
    background: #fff;
    border-right: 1px solid var(--border);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 0;
  }
  .desktop-sidebar-logo { padding: 0 20px; border-bottom: 1px solid var(--border); margin-bottom: 0; min-height: 76px; height: 76px; display: flex; align-items: center; justify-content: center; box-sizing: border-box; }
  .sidebar-aurora-name { font-family: 'Audiowide', sans-serif; font-size: 2rem; font-weight: 400; color: var(--aurora); letter-spacing: .5px; text-transform: uppercase; line-height: 1; }
  .desktop-nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 20px; font-size: .875rem; color: var(--muted);
    cursor: pointer; border: none; background: none; width: 100%; text-align: left;
    transition: all .15s; border-left: 3px solid transparent;
    border-radius: 0;
  }
  .desktop-nav-item:hover { color: var(--text); background: var(--surface); }
  .desktop-nav-item.active { color: var(--blue); background: #eff6ff; border-left-color: var(--brand-blue); font-weight: 600; }
  .desktop-nav-icon { font-size: 1rem; width: 20px; text-align: center; display: flex; align-items: center; }
  .desktop-sidebar-footer { margin-top: auto; padding: 16px 20px; border-top: 1px solid var(--border); }
  .desktop-lock-btn { width: 100%; padding: 9px 14px; background: transparent; border: none; color: var(--red); border-radius: 8px; font-size: .8rem; cursor: pointer; display: flex; align-items: center; gap: 7px; transition: background .15s; }
  .desktop-lock-btn:hover { background: var(--red-lt); }

  .main-content { flex: 1; display: flex; flex-direction: column; background: var(--bg); }
  .topbar { padding: 0 28px; background: #fff; min-height: 76px; height: 76px; }
  .topbar-sub { flex-direction: row; align-items: center; gap: 6px; flex-wrap: nowrap; white-space: nowrap; }
  .lock-btn-top { display: none; }

  .page { padding: 28px 32px; max-width: none; padding-bottom: 48px; }
  .entries-list { display: flex; flex-direction: column; gap: 10px; }
  .fab { display: none; }
  .topbar-add-btn { display: flex !important; }

  /* Modal as centered dialog on desktop */
  .modal-overlay { align-items: center; padding: 20px; }
  .modal { border-radius: 20px; max-width: 560px; padding-bottom: 0; }
  .modal-handle { display: none; }
  .modal-footer { flex-direction: row; justify-content: flex-end; }
  .modal-footer .btn { width: auto; }
  .form-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 767px) {
  .desktop-sidebar { display: none; }
  .topbar-add-btn { display: none !important; }
  .form-grid { grid-template-columns: 1fr; }
}
