    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    :root {
      --bg: #0f172a;
      --surface: #1e293b;
      --border: #334155;
      --accent: #3b82f6;
      --accent-hover: #2563eb;
      --danger: #ef4444;
      --danger-hover: #dc2626;
      --success: #22c55e;
      --warning: #f59e0b;
      --text: #f1f5f9;
      --text-muted: #94a3b8;
    }
    body { font-family: system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }
    #app { display: flex; flex-direction: column; min-height: 100vh; }

    /* ─── Header ─── */
    header {
      background: var(--surface); border-bottom: 1px solid var(--border);
      padding: 0 24px; height: 52px; display: flex; align-items: center; gap: 16px; flex-shrink: 0;
    }
    header .logo { font-size: .95rem; font-weight: 800; letter-spacing: .06em; color: var(--accent); }
    header .breadcrumb { font-size: .8rem; color: var(--text-muted); }
    header .spacer { flex: 1; }
    header .no-key-warn { font-size: .78rem; color: var(--warning); }

    /* ─── Layout ─── */
    .layout { display: flex; flex: 1; overflow: hidden; }

    /* ─── Sidebar ─── */
    nav { width: 196px; background: var(--surface); border-right: 1px solid var(--border); padding: 16px 0; flex-shrink: 0; }
    nav a {
      display: block; padding: 9px 20px; font-size: .875rem;
      color: var(--text-muted); cursor: pointer; border-left: 3px solid transparent;
      transition: all .15s; user-select: none;
    }
    nav a:hover { color: var(--text); background: rgba(255,255,255,.04); }
    nav a.active { color: var(--text); border-left-color: var(--accent); background: rgba(59,130,246,.1); }

    /* ─── Main ─── */
    main { flex: 1; padding: 28px 32px; overflow-y: auto; max-width: 1080px; }

    /* ─── Toolbar ─── */
    .toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
    .toolbar-title { font-size: 1.05rem; font-weight: 700; flex: 1; }

    /* ─── Card ─── */
    .card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 20px; margin-bottom: 16px; }
    .card-title { font-size: .75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 18px; }

    /* ─── Table ─── */
    .table-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 16px; }
    table { width: 100%; border-collapse: collapse; font-size: .875rem; }
    th { padding: 9px 14px; text-align: left; border-bottom: 1px solid var(--border); color: var(--text-muted); font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; background: rgba(255,255,255,.02); white-space: nowrap; }
    td { padding: 10px 14px; border-bottom: 1px solid rgba(51,65,85,.5); vertical-align: middle; }
    tr:last-child td { border-bottom: none; }
    tr.clickable { cursor: pointer; }
    tr.clickable:hover td { background: rgba(255,255,255,.03); }

    /* ─── Buttons ─── */
    button { cursor: pointer; border: none; border-radius: 6px; font-size: .875rem; font-weight: 500; padding: 7px 14px; transition: background .15s, opacity .15s; line-height: 1.4; }
    .btn-primary { background: var(--accent); color: #fff; }
    .btn-primary:hover { background: var(--accent-hover); }
    .btn-danger  { background: var(--danger); color: #fff; }
    .btn-danger:hover  { background: var(--danger-hover); }
    .btn-ghost   { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
    .btn-ghost:hover   { color: var(--text); border-color: var(--text-muted); }
    .btn-sm { padding: 4px 10px; font-size: .8rem; }
    button:disabled { opacity: .45; cursor: not-allowed; }

    /* ─── Forms ─── */
    .form-group { margin-bottom: 14px; }
    label { display: block; font-size: .79rem; color: var(--text-muted); margin-bottom: 5px; font-weight: 500; }
    input, select, textarea {
      width: 100%; background: var(--bg); border: 1px solid var(--border);
      border-radius: 6px; color: var(--text); padding: 8px 11px;
      font-size: .875rem; outline: none; transition: border-color .15s;
    }
    input:focus, select:focus, textarea:focus { border-color: var(--accent); }
    input:disabled { opacity: .5; cursor: not-allowed; }
    .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
    .form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

    /* ─── Tabs ─── */
    .tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
    .tab { padding: 9px 18px; font-size: .875rem; cursor: pointer; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all .15s; user-select: none; }
    .tab:hover { color: var(--text); }
    .tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

    /* ─── Badges ─── */
    .badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; white-space: nowrap; }
    .badge-green  { background: rgba(34,197,94,.15);  color: #86efac; }
    .badge-red    { background: rgba(239,68,68,.15);  color: #fca5a5; }
    .badge-yellow { background: rgba(245,158,11,.15); color: #fcd34d; }
    .badge-blue   { background: rgba(59,130,246,.15); color: #93c5fd; }

    /* ─── Alerts ─── */
    .alert { padding: 11px 15px; border-radius: 6px; font-size: .875rem; margin-bottom: 14px; }
    .alert-error   { background: rgba(239,68,68,.12);  border: 1px solid rgba(239,68,68,.3);  color: #fca5a5; }
    .alert-success { background: rgba(34,197,94,.12);  border: 1px solid rgba(34,197,94,.3);  color: #86efac; }
    .alert-info    { background: rgba(59,130,246,.12); border: 1px solid rgba(59,130,246,.3); color: #93c5fd; }

    /* ─── Spinner ─── */
    .spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.25); border-top-color: currentColor; border-radius: 50%; animation: spin .55s linear infinite; vertical-align: middle; }
    @keyframes spin { to { transform: rotate(360deg); } }

    /* ─── Empty state ─── */
    .empty-state { text-align: center; padding: 36px 20px; color: var(--text-muted); font-size: .875rem; }

    /* ─── Misc ─── */
    .mono { font-family: 'SF Mono','Fira Code','Cascadia Code',monospace; font-size: .82em; }
    .tr  { text-align: right; }
    .muted { color: var(--text-muted); }
    .back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: .875rem; cursor: pointer; margin-bottom: 18px; user-select: none; }
    .back-link:hover { color: var(--text); }
    .cents { font-variant-numeric: tabular-nums; }

    /* ─── Inmate detail header ─── */
    .detail-hero { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
    .avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; font-weight: 700; flex-shrink: 0; }
    .hero-info h2 { font-size: 1.15rem; font-weight: 700; }
    .hero-info .sub { font-size: .82rem; color: var(--text-muted); margin-top: 3px; }

    /* ─── Modal ─── */
    .modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: flex; align-items: center; justify-content: center; z-index: 200; }
    .modal { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 24px; width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; }
    .modal-title { font-size: 1rem; font-weight: 700; margin-bottom: 20px; }
    .modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

    /* ─── Pagination ─── */
    .pagination { display: flex; align-items: center; gap: 12px; margin-top: 10px; font-size: .82rem; color: var(--text-muted); }

    /* ─── Login screen ─── */
    .login-screen { position: fixed; inset: 0; background: var(--bg); display: flex; align-items: center; justify-content: center; z-index: 300; }
    .login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 36px 32px; width: 100%; max-width: 380px; box-shadow: 0 24px 48px rgba(0,0,0,.4); }
    .login-logo { font-size: 1.5rem; font-weight: 800; letter-spacing: .08em; color: var(--accent); text-align: center; margin-bottom: 4px; }
    .login-sub { text-align: center; font-size: .82rem; color: var(--text-muted); margin-bottom: 28px; }
    .login-footer { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
    .btn-login { width: 100%; padding: 10px; font-size: .95rem; font-weight: 600; }
    .user-chip { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--text-muted); }
    .user-chip strong { color: var(--text); }
