:root {
  --bg: #08080a;
  --surface: #0f0f13;
  --surface-elevated: #16161d;
  --surface-card: #1c1c24;
  --surface-hover: #22222b;
  --surface-raised: #282830;
  --border: #2a2a35;
  --border-light: #3a3a48;
  --gold: #c9a84c;
  --gold-hover: #dbb95a;
  --gold-dim: rgba(201, 168, 76, 0.12);
  --gold-glow: rgba(201, 168, 76, 0.25);
  --text: #efeff1;
  --text-secondary: #9d9da8;
  --text-muted: #5c5c6a;
  --danger: #dc3e3e;
  --danger-dim: rgba(220, 62, 62, 0.12);
  --success: #2b8a4e;
  --success-dim: rgba(43, 138, 78, 0.12);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --sidebar-w: 220px;
  --transition: 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  --content-w: 1200px;
}

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

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

.noise-overlay {
  position: fixed; inset: 0; pointer-events: none; z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }
input[type="password"]::-webkit-credentials-auto-fill-button,
input[type="password"]::-webkit-textfield-decoration-container {
  display: none !important;
}
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
  display: none;
}

/* ─── App / Auth ─── */
.app-page { min-height: 100vh; }
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 2rem; }
.auth-page .auth-page { min-height: 0; padding: 0; }
.guest-content { width: 100%; }

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem;
  width: 100%;
  max-width: 420px;
  animation: fadeUp 0.6s ease;
}
.auth-brand { text-align: center; margin-bottom: 2rem; }
.auth-brand-icon { font-size: 2rem; color: var(--gold); display: block; margin-bottom: 0.5rem; }
.auth-brand h1 { font-family: var(--font-display); font-weight: 700; font-size: 2rem; color: var(--text); letter-spacing: -0.5px; }
.auth-tagline { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.2rem; }
.auth-form { display: flex; flex-direction: column; gap: 1.25rem; }
.auth-switch { text-align: center; margin-top: 1.5rem; font-size: 0.85rem; color: var(--text-secondary); }
.auth-switch a { color: var(--gold); font-weight: 500; }
.auth-switch a:hover { color: var(--gold-hover); }

/* ─── Form Fields ─── */
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field label { font-size: 0.78rem; font-weight: 500; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.4px; }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
}
.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--surface-elevated) inset !important;
  caret-color: var(--text);
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-muted); }
.field-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.1rem; }
.optional { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-muted); font-size: 0.75rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }

.input-suffix { display: flex; align-items: stretch; }
.input-suffix input { border-top-right-radius: 0; border-bottom-right-radius: 0; flex: 1; }
.input-suffix input:-webkit-autofill,
.input-suffix input:-webkit-autofill:hover,
.input-suffix input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--surface-elevated) inset !important;
  caret-color: var(--text);
}
.input-suffix > :last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.btn-suffix {
  display: flex; align-items: center; justify-content: center;
  padding: 0 0.8rem;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0;
  color: var(--text-secondary);
  transition: color var(--transition), background var(--transition);
}
.btn-suffix + .btn-suffix { border-left: 1px solid var(--border); }
.btn-suffix:hover { color: var(--gold); background: var(--gold-dim); }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem; font-weight: 500;
  border: 1px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--gold); border-color: var(--gold); color: #0a0a0b; }
.btn-primary:hover { background: var(--gold-hover); border-color: var(--gold-hover); }
.btn-block { width: 100%; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.78rem; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); border-color: var(--border); }
.btn-danger-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-danger-ghost:hover { background: var(--danger-dim); color: var(--danger); border-color: transparent; }

/* ─── Sidebar ─── */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  transition: transform var(--transition);
}
.sidebar-header { padding: 1.5rem 1.25rem 0.75rem; display: flex; align-items: baseline; gap: 0.5rem; }
.brand { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; color: var(--gold); letter-spacing: -0.3px; }
.brand-sub { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.2px; }
.sidebar-user { padding: 1rem 1.25rem; display: flex; align-items: center; gap: 0.65rem; border-bottom: 1px solid var(--border); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--gold-dim); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.5px;
  flex-shrink: 0;
}
.user-info { display: flex; flex-direction: column; }
.user-name { font-size: 0.85rem; font-weight: 500; }
.user-status { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.6px; }
.user-status.unlocked { color: var(--success); }
.user-status.locked { color: var(--text-muted); }

.sidebar-section-label {
  padding: 1.25rem 1.25rem 0.5rem;
  font-size: 0.6rem; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--text-muted); font-weight: 600;
}
.sidebar-groups { flex: 1; padding: 0 0.5rem; display: flex; flex-direction: column; gap: 2px; }

.group-item {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: all var(--transition);
  border-left: 2px solid transparent;
}
.group-item:hover { background: var(--surface-hover); color: var(--text); }
.group-item.active {
  background: var(--gold-dim); color: var(--gold);
  border-left-color: var(--gold);
}
.group-icon { display: flex; opacity: 0.6; flex-shrink: 0; }
.group-item.active .group-icon { opacity: 1; }
.group-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-shared-badge { font-size: 0.55rem; text-transform: uppercase; letter-spacing: 0.3px; color: var(--text-muted); background: var(--surface-elevated); padding: 1px 5px; border-radius: 4px; }

.sidebar-actions { padding: 0.5rem; display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--border); margin-top: auto; }
.sidebar-btn {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  background: none; border: none;
  color: var(--text-secondary); font-size: 0.82rem;
  transition: all var(--transition);
  width: 100%; text-align: left;
}
.sidebar-btn:hover { background: var(--surface-hover); color: var(--text); }
.sidebar-footer { padding: 0.5rem; border-top: 1px solid var(--border); }
.lock-btn:hover { color: var(--success); }
.logout-btn:hover { color: var(--danger); }
.sidebar-btn-export { border-top: 1px solid var(--border); margin-top: auto; border-radius: 0; }

/* Sidebar backdrop (mobile) */
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 99;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
}

/* Sidebar toggle button */
.sidebar-toggle {
  display: none;
  position: fixed; top: 1rem; left: 1rem; z-index: 50;
  width: 40px; height: 40px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  align-items: center; justify-content: center;
  transition: all var(--transition);
}
.sidebar-toggle:hover { background: var(--surface-hover); color: var(--text); }
.sidebar-toggle svg { transition: transform var(--transition); }

/* ─── Main Content ─── */
.main-content {
  margin-left: var(--sidebar-w);
  padding: 2.5rem 1rem;
  min-height: 100vh;
  transition: margin-left var(--transition);
}

/* ─── Flash ─── */
.flash-container {
  position: fixed; top: 1rem; left: 50%; transform: translateX(-50%); z-index: 999;
  display: flex; flex-direction: column; gap: 0.4rem;
  pointer-events: none;
}
.flash {
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  border: 1px solid transparent;
  animation: slideDown 0.3s ease;
  transition: opacity 0.4s ease, transform 0.4s ease;
  backdrop-filter: blur(12px);
  pointer-events: auto;
}
.flash-success { background: var(--success-dim); border-color: rgba(43, 138, 78, 0.3); color: #6ee7b7; }
.flash-error { background: var(--danger-dim); border-color: rgba(220, 62, 62, 0.3); color: #fca5a5; }
.flash-info { background: rgba(167, 139, 250, 0.1); border-color: rgba(167, 139, 250, 0.2); color: #a5b4fc; }
.flash-warning { background: rgba(251, 191, 36, 0.1); border-color: rgba(251, 191, 36, 0.2); color: #fde68a; }

/* ─── Vault ─── */
.vault {
  width: 100%;
}
.vault-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 2rem;
  animation: fadeUp 0.5s ease;
}
.vault-header-left { }
.vault-title { font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; color: var(--text); letter-spacing: -0.4px; }
.vault-desc { font-size: 0.9rem; color: var(--text-secondary); margin-top: 0.2rem; }
.vault-header-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

.unlock-vault {
  max-width: 420px; margin: 4rem auto; text-align: center;
  background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 3rem 2.5rem; animation: fadeUp 0.5s ease;
}
.unlock-icon { color: var(--gold); margin-bottom: 1rem; opacity: 0.5; }
.unlock-vault h2 { font-family: var(--font-display); font-size: 1.4rem; margin-bottom: 0.5rem; }
.unlock-vault p { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 1.5rem; }
.unlock-form { display: flex; gap: 0.5rem; max-width: 320px; margin: 0 auto; }
.unlock-form input {
  flex: 1; padding: 0.7rem 0.9rem;
  background: var(--surface-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-size: 0.9rem; text-align: center;
  outline: none; transition: border-color var(--transition);
}
.unlock-form input:focus { border-color: var(--gold); }

/* ─── Vault Toolbar ─── */
.vault-toolbar {
  margin-bottom: 1.5rem;
  animation: fadeUp 0.5s ease; animation-delay: 0.1s; animation-fill-mode: both;
}
.search-bar {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0 1rem; width: 100%; max-width: 100%; transition: border-color var(--transition);
}
.search-bar:focus-within { border-color: var(--gold); }
.search-icon { color: var(--text-muted); flex-shrink: 0; }
.search-bar input {
  flex: 1; padding: 0.65rem 0; background: none; border: none; color: var(--text); font-size: 0.9rem; outline: none;
}
.search-bar input:-webkit-autofill,
.search-bar input:-webkit-autofill:hover,
.search-bar input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--surface-card) inset !important;
  caret-color: var(--text);
}
.search-clear { color: var(--text-muted); font-size: 1.2rem; line-height: 1; padding: 0 0.25rem; }
.search-clear:hover { color: var(--text); }

/* ─── Entry Grid ─── */
.entries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0.75rem;
}

.entry-card {
  display: flex; flex-direction: column;
  background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  transition: all var(--transition);
  animation: fadeUp 0.4s ease both;
  gap: 0.75rem;
}
.entry-card:hover {
  border-color: var(--border-light);
  background: var(--surface-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.25);
}
.entry-card-main { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.entry-icon {
  color: var(--gold); opacity: 0.4; display: flex; flex-shrink: 0;
  width: 36px; height: 36px; align-items: center; justify-content: center;
  background: var(--surface-elevated); border-radius: var(--radius-sm);
}
.entry-meta { display: flex; flex-direction: column; min-width: 0; }
.entry-title { font-size: 0.95rem; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-url { font-size: 0.75rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 0.05rem; }
.entry-card-footer {
  display: flex; justify-content: flex-end; gap: 0.25rem;
  padding-top: 0.5rem; border-top: 1px solid var(--border);
}
.inline { display: inline; }

/* ─── Empty State ─── */
.empty-state { text-align: center; padding: 4rem 1rem; animation: fadeUp 0.5s ease; }
.empty-icon { color: var(--text-muted); margin-bottom: 1rem; opacity: 0.35; }
.empty-state h2 { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: 0.5rem; }
.empty-state p { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 1.25rem; }

/* ─── Form Page ─── */
.form-page { max-width: 720px; margin: 0 auto; }
.form-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 2rem; }
.form-header h1 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; }
.entry-form { display: flex; flex-direction: column; gap: 1.25rem; }
.entry-form .field textarea { resize: vertical; min-height: 80px; }
.form-submit { display: flex; gap: 0.75rem; margin-top: 0.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }

/* ─── Detail Page ─── */
.detail-page { max-width: 720px; margin: 0 auto; }
.detail-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.detail-nav-actions { display: flex; gap: 0.25rem; align-items: center; }
.detail-card { background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.detail-card-header {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.75rem 1.5rem; border-bottom: 1px solid var(--border);
}
.detail-icon { color: var(--gold); opacity: 0.45; display: flex; }
.detail-title { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; letter-spacing: -0.3px; }
.detail-url { font-size: 0.85rem; color: var(--gold); margin-top: 0.1rem; display: inline-block; }
.detail-url:hover { text-decoration: underline; }
.detail-body { padding: 0.25rem 1.5rem; }
.detail-row { display: flex; align-items: flex-start; justify-content: space-between; padding: 1rem 0; border-bottom: 1px solid var(--border); gap: 1rem; }
.detail-row:last-child { border-bottom: none; }
.detail-row.meta { padding: 0.7rem 0; }
.detail-row.notes { flex-direction: column; }
.detail-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); white-space: nowrap; min-width: 80px; }
.detail-value { font-size: 0.9rem; color: var(--text); word-break: break-all; text-align: right; }
.detail-value.mono { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 0.85rem; }
.detail-value.muted { color: var(--text-muted); font-size: 0.8rem; }
.detail-value-row { display: flex; align-items: center; gap: 0.5rem; justify-content: flex-end; }
.detail-value-row .detail-value { text-align: right; }

.btn-copy {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid var(--border); color: var(--text-muted);
  transition: all var(--transition); flex-shrink: 0;
}
.btn-copy:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-dim); }
.btn-copy.copied { border-color: var(--success); color: var(--success); background: var(--success-dim); }

/* ─── Manage Page ─── */
.manage-page { max-width: 900px; margin: 0 auto; }
.manage-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; }
.manage-header h1 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; }
.manage-list { display: flex; flex-direction: column; gap: 0.5rem; }
.manage-card {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.25rem; gap: 1rem;
  transition: all var(--transition);
}
.manage-card:hover { border-color: var(--border-light); background: var(--surface-hover); }
.manage-card-main { display: flex; align-items: center; gap: 0.85rem; flex: 1; min-width: 0; }
.manage-card-icon { color: var(--text-muted); display: flex; }
.manage-card-info { display: flex; flex-direction: column; min-width: 0; }
.manage-card-name { font-size: 0.9rem; font-weight: 500; }
.manage-card-desc { font-size: 0.78rem; color: var(--text-secondary); }
.manage-card-count { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.1rem; }
.manage-card-right { display: flex; align-items: center; gap: 1rem; flex-shrink: 0; }
.manage-shares { display: flex; align-items: center; gap: 0.5rem; }
.shared-label { font-size: 0.7rem; color: var(--text-muted); }
.shared-avatars { display: flex; }
.shared-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface-elevated); border: 2px solid var(--surface-card);
  color: var(--text-secondary); font-size: 0.55rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  margin-left: -6px;
}
.shared-avatar:first-child { margin-left: 0; }
.shared-badge { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.3px; color: var(--text-muted); padding: 2px 8px; border: 1px solid var(--border); border-radius: 4px; }
.manage-actions { display: flex; gap: 0.15rem; }

/* ─── Modals ─── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.7);
  display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  width: 100%; max-width: 440px;
  animation: fadeUp 0.25s ease;
}
.modal-sm { max-width: 380px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem 0; }
.modal-header h3 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.4rem; line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 1.25rem 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.modal-desc { font-size: 0.85rem; color: var(--text-secondary); }
.modal-footer { display: flex; justify-content: flex-end; gap: 0.5rem; padding: 1rem 1.5rem; border-top: 1px solid var(--border); }

/* ─── Export Picker ─── */
.export-picker { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.5rem; }
.export-opt { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; padding: 1rem 0.4rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); cursor: pointer; transition: all var(--transition); }
.export-opt:hover { border-color: var(--gold-dim); background: var(--surface-hover); }
.export-opt.active { border-color: var(--gold); background: var(--gold-dim); }
.export-opt.active .export-opt-icon { color: var(--gold); }
.export-opt.active .export-opt-label { color: var(--gold); }
.export-opt-icon { color: var(--text-secondary); transition: color var(--transition); line-height: 1; }
.export-opt-label { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); transition: color var(--transition); }
.export-opt-desc { font-size: 0.62rem; color: var(--text-muted); }

/* ─── Tree & Context Menu ─── */
.group-nest { padding-left: calc(var(--depth, 0) * 14px); }
.sidebar-groups { padding: 0 0.25rem; }

.ctx-menu {
  position: fixed; z-index: 2000;
  background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.35rem; min-width: 180px;
  display: none; flex-direction: column; gap: 2px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  backdrop-filter: blur(16px);
}
.ctx-menu.open { display: flex; }
.ctx-item {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.45rem 0.7rem; border-radius: var(--radius-sm);
  font-size: 0.82rem; color: var(--text-secondary);
  cursor: pointer; transition: all var(--transition);
  list-style: none; border: none; background: none; width: 100%;
}
.ctx-item:hover { background: var(--surface-hover); color: var(--text); }
.ctx-item svg { flex-shrink: 0; }
.ctx-danger:hover { background: var(--danger-dim); color: var(--danger); }
.ctx-divider { height: 1px; background: var(--border); margin: 0.2rem 0.4rem; }

/* ─── Footer ─── */
.app-footer { text-align: center; padding: 1.5rem 0 2rem; font-size: 0.7rem; color: var(--text-muted); border-top: 1px solid var(--border); margin-top: 3rem; }

/* ─── Animations ─── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Responsive ─── */
@media (max-width: 1200px) {
  .entries-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

@media (max-width: 1024px) {
  .main-content { padding: 2rem 0.75rem; }
  .vault-title { font-size: 1.5rem; }
  .entries-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .manage-page { max-width: 100%; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.open { display: block; }
  .sidebar-toggle { display: flex; }

  .main-content { margin-left: 0; padding: 1.25rem 0.5rem; padding-top: 4rem; }

  .vault-header { flex-direction: column; gap: 0.75rem; }
  .vault-title { font-size: 1.35rem; }

  .entries-grid { grid-template-columns: 1fr; gap: 0.5rem; }

  .field-row { grid-template-columns: 1fr; }
  .form-page { max-width: 100%; }
  .detail-page { max-width: 100%; }

  .manage-card { flex-direction: column; align-items: flex-start; }
  .manage-card-right { width: 100%; justify-content: space-between; }

  .entry-card { gap: 0.5rem; }
}

@media (max-width: 480px) {
  .main-content { padding: 1rem; padding-top: 3.75rem; }
  .auth-card { padding: 2rem 1.5rem; }
  .unlock-vault { padding: 2rem 1.5rem; }
  .vault-header-actions .btn { font-size: 0.8rem; padding: 0.5rem 0.9rem; }
}
