  :root {
    --bg: #191127;
    --surface: #2a1647;
    --card: #23133a;
    --border: #3a1c63;
    --accent: #883CF0;
    --accent2: #7c3aed;
    --accent3: #f59e0b;
    --danger: #ef4444;
    --success: #10b981;
    --text: #e8e8f0;
    --muted: #6b6b8a;
    --glow: 0 0 40px rgba(124,58,237,0.25);
  }

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  body {
    font-family: 'DM Mono', monospace;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
  }

  /* GRID BACKGROUND */
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
      linear-gradient(rgba(124,58,237,0.04) 1px, transparent 1px),
      linear-gradient(90deg, rgba(124,58,237,0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
    z-index: 0;
  }

  /* GLOW ORB */
  body::after {
    content: '';
    position: fixed;
    top: -200px;
    right: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(124,58,237,0.15) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
  }

  .wrapper { position: relative; z-index: 1; }

  /* ── HEADER ── */
  header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 2.5rem;
    border-bottom: 1px solid var(--border);
    background: #180f26;
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .logo {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .logo-icon {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 1rem;
  }

  .logo span { color: var(--accent); }

  nav { display: flex; gap: 0.25rem; }

  nav button {
    background: none;
    border: none;
    color: var(--muted);
    font-family: 'DM Mono', monospace;
    font-size: 0.78rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.5px;
  }

  nav button:hover, nav button.active {
    color: var(--text);
    background: var(--card);
  }

  nav button.active { color: var(--accent2); }

  .header-actions { display: flex; gap: 0.75rem; align-items: center; }

  /* ── BUTTON STYLES ── */
  .btn {
    font-family: 'DM Mono', monospace;
    font-size: 0.78rem;
    letter-spacing: 0.5px;
    padding: 0.5rem 1.1rem;
    border-radius: 7px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
  }

  .btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 20px rgba(124,58,237,0.4);
  }

  .btn-primary:hover {
    background: #6d28d9;
    transform: translateY(-1px);
    box-shadow: 0 0 30px rgba(124,58,237,0.6);
  }

  .btn-ghost {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
  }

  .btn-ghost:hover { color: var(--text); border-color: var(--accent); }

  .btn-danger {
    background: rgba(239,68,68,0.15);
    color: var(--danger);
    border: 1px solid rgba(239,68,68,0.3);
  }

  .btn-danger:hover { background: rgba(239,68,68,0.25); }

  /* ── MAIN LAYOUT ── */
  .main {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: calc(100vh - 65px);
  }

  /* ── SIDEBAR ── */
  .sidebar {
    border-right: 1px solid var(--border);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .sidebar-section-label {
    font-size: 0.65rem;
    color: var(--muted);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 0 0.5rem;
    margin-bottom: 0.4rem;
  }

  .sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--muted);
    transition: all 0.2s;
    border: 1px solid transparent;
  }

  .sidebar-item:hover { color: var(--text); background: var(--card); }

  .sidebar-item.active {
    color: var(--text);
    background: var(--card);
    border-color: var(--border);
  }

  .sidebar-item .icon { font-size: 1rem; width: 20px; text-align: center; }

  .badge {
    margin-left: auto;
    background: var(--accent);
    color: #fff;
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 10px;
  }

  .badge.warn { background: var(--accent3); color: #000; }
  .badge.danger { background: var(--danger); }

  /* ── CONTENT ── */
  .content { padding: 2rem 2.5rem; overflow-y: auto; }

  /* TABS */
  .tab-pane { display: none; }
  .tab-pane.active { display: block; }

  /* ── STATS ROW ── */
  .stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
  }

  .stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s;
  }

  .stat-card:hover { transform: translateY(-2px); }

  .stat-card::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
  }

  .stat-card.violet::after { background: linear-gradient(90deg, var(--accent), transparent); }
  .stat-card.cyan::after   { background: linear-gradient(90deg, var(--accent2), transparent); }
  .stat-card.amber::after  { background: linear-gradient(90deg, var(--accent3), transparent); }
  .stat-card.red::after    { background: linear-gradient(90deg, var(--danger), transparent); }

  .stat-label { font-size: 0.7rem; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 0.5rem; }
  .stat-value { font-family: 'Syne', sans-serif; font-size: 2rem; font-weight: 700; }
  .stat-sub   { font-size: 0.7rem; color: var(--muted); margin-top: 0.25rem; }

  /* ── SECTION HEADER ── */
  .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
  }

  .section-title {
    font-family: 'Syne', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
  }

  /* ── SEARCH BAR ── */
  .search-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
  }

  .search-input-wrap {
    flex: 1;
    position: relative;
  }

  .search-input-wrap input {
    width: 100%;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: 'DM Mono', monospace;
    font-size: 0.82rem;
    padding: 0.65rem 1rem 0.65rem 2.5rem;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
  }

  .search-input-wrap input:focus { border-color: var(--accent); }
  .search-input-wrap input::placeholder { color: var(--muted); }

  .search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 0.9rem;
  }

  /* ── PASSWORD TABLE ── */
  .pw-list { display: flex; flex-direction: column; gap: 0.5rem; }

  .pw-item {
    display: grid;
    grid-template-columns: 40px 1fr 180px 120px 100px;
    align-items: center;
    gap: 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.9rem 1rem;
    cursor: pointer;
    transition: all 0.2s;
  }

  .pw-item:hover { border-color: var(--accent); box-shadow: var(--glow); }

  .pw-favicon {
    width: 36px; height: 36px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 1.1rem;
    font-weight: bold;
    background: var(--surface);
    border: 1px solid var(--border);
    font-family: 'Syne', sans-serif;
  }

  .pw-name { font-size: 0.9rem; font-family: 'Syne', sans-serif; font-weight: 600; }
  .pw-email { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }

  .pw-password {
    font-size: 0.8rem;
    letter-spacing: 3px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .pw-password .eye-btn {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px;
    transition: color 0.15s;
  }

  .pw-password .eye-btn:hover { color: var(--accent2); }

  .strength-bar {
    display: flex;
    gap: 3px;
    align-items: center;
  }

  .strength-bar .seg {
    height: 4px;
    flex: 1;
    border-radius: 2px;
    background: var(--border);
  }

  .strength-bar .seg.filled.weak   { background: var(--danger); }
  .strength-bar .seg.filled.fair   { background: var(--accent3); }
  .strength-bar .seg.filled.strong { background: var(--success); }

  .pw-actions { display: flex; gap: 0.4rem; justify-content: flex-end; }

  .icon-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--muted);
    width: 28px; height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    display: grid;
    place-items: center;
    transition: all 0.15s;
  }

  .icon-btn:hover { color: var(--text); border-color: var(--accent); }
  .icon-btn.copy:hover { color: var(--accent2); }
  .icon-btn.edit:hover { color: var(--accent); }
  .icon-btn.del:hover  { color: var(--danger); border-color: var(--danger); }

  /* ── MODAL ── */
  .modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(4px);
    z-index: 200;
    place-items: center;
  }

  .modal-overlay.open { display: grid; }

  .modal {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    width: min(520px, 95vw);
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.25s ease;
  }

  @keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }

  .modal-title {
    font-family: 'Syne', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
  }

  .modal-close {
    position: absolute;
    top: 1.2rem; right: 1.2rem;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1.2rem;
    cursor: pointer;
  }

  .modal-close:hover { color: var(--text); }

  /* ── FORM ── */
  .form-group { margin-bottom: 1.1rem; }
  .form-label { font-size: 0.72rem; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 0.4rem; display: block; }

  .form-input {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: 'DM Mono', monospace;
    font-size: 0.85rem;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
  }

  .form-input:focus { border-color: var(--accent); }

  .pw-field-wrap { position: relative; }
  .pw-field-wrap .toggle-vis {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.9rem;
  }

  /* STRENGTH METER (modal) */
  .strength-meter { margin-top: 0.4rem; }
  .strength-segs { display: flex; gap: 4px; margin-bottom: 0.25rem; }
  .strength-segs .s { height: 5px; flex: 1; border-radius: 3px; background: var(--border); transition: background 0.3s; }
  .strength-label { font-size: 0.7rem; color: var(--muted); }

  /* GENERATOR */
  .gen-options { display: flex; gap: 1.5rem; flex-wrap: wrap; margin: 0.75rem 0; }
  .gen-option { display: flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; color: var(--muted); cursor: pointer; }
  .gen-option input[type=checkbox] { accent-color: var(--accent); }

  .gen-length { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.75rem; }
  .gen-length input[type=range] { flex: 1; accent-color: var(--accent); }
  .gen-length span { font-size: 0.85rem; color: var(--accent2); min-width: 24px; }

  .generated-pw {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    letter-spacing: 2px;
    color: var(--accent2);
    word-break: break-all;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }

  .modal-footer { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.5rem; }

  /* ── HEALTH TAB ── */
  .health-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 2rem; }

  .health-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
  }

  .health-card-title { font-family: 'Syne', sans-serif; font-size: 0.9rem; font-weight: 700; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; }

  .issue-list { display: flex; flex-direction: column; gap: 0.5rem; }
  .issue-item { display: flex; align-items: center; gap: 0.75rem; font-size: 0.78rem; padding: 0.5rem; background: var(--surface); border-radius: 6px; }
  .issue-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
  .issue-dot.red    { background: var(--danger); }
  .issue-dot.yellow { background: var(--accent3); }
  .issue-dot.green  { background: var(--success); }
  .issue-name { flex: 1; }
  .issue-tag { font-size: 0.65rem; padding: 2px 7px; border-radius: 10px; }
  .issue-tag.red    { background: rgba(239,68,68,0.15); color: var(--danger); }
  .issue-tag.yellow { background: rgba(245,158,11,0.15); color: var(--accent3); }

  /* SCORE RING */
  .score-ring-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem; }
  .score-ring { position: relative; width: 120px; height: 120px; }
  .score-ring svg { transform: rotate(-90deg); }
  .score-ring-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Syne', sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
  }
  .score-ring-text small { font-size: 0.6rem; color: var(--muted); font-family: 'DM Mono', monospace; font-weight: 400; }

  /* ── GENERATOR TAB ── */
  .gen-tab-card {
    max-width: 600px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 2rem;
  }

  .big-pw-display {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    font-size: 1.15rem;
    letter-spacing: 3px;
    color: var(--accent2);
    word-break: break-all;
    min-height: 70px;
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    position: relative;
  }

  .copy-float {
    position: absolute;
    top: 0.75rem; right: 0.75rem;
  }

  /* ── SETTINGS TAB ── */
  .settings-section { margin-bottom: 2rem; }
  .settings-section-title { font-family: 'Syne', sans-serif; font-size: 0.9rem; font-weight: 700; border-bottom: 1px solid var(--border); padding-bottom: 0.6rem; margin-bottom: 1rem; }

  .setting-row { display: flex; align-items: center; justify-content: space-between; padding: 0.85rem 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
  .setting-info-label { font-size: 0.85rem; }
  .setting-info-sub { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }

  /* TOGGLE */
  .toggle { position: relative; width: 42px; height: 24px; }
  .toggle input { display: none; }
  .toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
  }
  .toggle-slider::after {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    background: #fff;
    border-radius: 50%;
    top: 3px; left: 3px;
    transition: transform 0.2s;
  }
  .toggle input:checked + .toggle-slider { background: var(--accent); }
  .toggle input:checked + .toggle-slider::after { transform: translateX(18px); }

  /* ── TOAST ── */
  .toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem 1.25rem;
    font-size: 0.8rem;
    z-index: 999;
    transform: translateY(80px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .toast.show { transform: translateY(0); opacity: 1; }
  .toast.success { border-color: var(--success); }
  .toast.warn { border-color: var(--accent3); }
  .toast .toast-icon { font-size: 1rem; }

  /* ── EMPTY STATE ── */
  .empty-state { text-align: center; padding: 4rem; color: var(--muted); }
  .empty-state .big { font-size: 3rem; margin-bottom: 1rem; }
  .empty-state p { font-size: 0.85rem; }

  /* ── HERO (landing) ── */
  .hero { text-align: center; padding: 5rem 2rem 3rem; }
  .hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(124,58,237,0.1);
    border: 1px solid rgba(124,58,237,0.3);
    border-radius: 20px;
    padding: 0.3rem 0.9rem;
    font-size: 0.72rem;
    color: #a78bfa;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
  }

  .hero h1 {
    font-family: 'Syne', sans-serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.25rem;
    letter-spacing: -1.5px;
  }

  .hero h1 em { font-style: normal; color: var(--accent2); }

  .hero p { color: var(--muted); font-size: 1rem; max-width: 520px; margin: 0 auto 2rem; }

  .hero-btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

  /* FEATURE CARDS */
  .features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; max-width: 900px; margin: 0 auto; }

  .feature-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s;
  }

  .feature-card:hover { border-color: var(--accent); transform: translateY(-3px); }
  .feature-icon { font-size: 1.75rem; margin-bottom: 0.75rem; }
  .feature-title { font-family: 'Syne', sans-serif; font-size: 0.95rem; font-weight: 700; margin-bottom: 0.4rem; }
  .feature-desc { font-size: 0.78rem; color: var(--muted); line-height: 1.6; }

  /* ── LIST HEADER ── */
  .list-header {
    display: grid;
    grid-template-columns: 40px 1fr 180px 120px 100px;
    gap: 1rem;
    padding: 0 1rem;
    font-size: 0.65rem;
    color: var(--muted);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
  }

  /* Responsive */
  @media(max-width: 900px) {
    .main { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .pw-item { grid-template-columns: 36px 1fr 80px; }
    .pw-item > *:nth-child(3), .pw-item > *:nth-child(4) { display: none; }
  }