    /* ================================================================
       Iswe Solutions Ltd — palette taken from the logo
       navy #213965 · red #F52205 · green #53E90B · cyan #00FEFE · yellow #F9FF01
       The raw logo greens/yellows/cyans are too light for text on white, so
       each has a darkened text-safe counterpart; the raw values are kept for
       the brand rule and chart-like fills.
       ================================================================ */
    :root {
      --iswe-navy:        #213965;
      --iswe-navy-dark:   #16274a;
      --iswe-navy-soft:   #33507f;
      --iswe-red:         #F52205;
      --iswe-red-dark:    #c81a02;
      --iswe-green:       #53E90B;
      --iswe-cyan:        #00FEFE;
      --iswe-yellow:      #F9FF01;

      /* text-safe variants */
      --ok:      #1f9b12;
      --warn:    #a67c00;
      --danger:  #c81a02;
      --info:    #00849b;

      --ink:          #1b2536;
      --muted:        #667089;
      --border:       #dfe4ee;
      --border-soft:  #eef1f7;
      --surface:      #ffffff;
      --surface-soft: #f6f8fc;
      --shadow:       0 8px 24px rgba(33, 57, 101, .07);
      --shadow-lg:    0 16px 44px rgba(33, 57, 101, .11);
      --radius:       12px;
    }

    * { scrollbar-width: thin; }

    body {
      min-height: 100vh; margin: 0;
      background: var(--surface-soft);
      color: var(--ink);
      font-family: 'Manrope', 'Segoe UI', system-ui, sans-serif;
      font-size: .92rem;
    }

    /* Brand rule — the four logo colours, used as a hairline accent */
    .brand-rule {
      height: 3px; flex-shrink: 0;
      background: linear-gradient(90deg,
        var(--iswe-red)    0%,   var(--iswe-red)    25%,
        var(--iswe-yellow) 25%,  var(--iswe-yellow) 50%,
        var(--iswe-green)  50%,  var(--iswe-green)  75%,
        var(--iswe-cyan)   75%,  var(--iswe-cyan)   100%);
    }

    /* ── Sidebar ─────────────────────────────────────────────────── */
    #sidebar {
      width: 252px; flex-shrink: 0;
      min-height: 100vh; position: sticky; top: 0;
      background: var(--iswe-navy);
      display: flex; flex-direction: column;
    }
    #sidebar .brand {
      padding: 1.15rem 1rem 1rem;
      background: #fff;
      border-bottom: 3px solid transparent;
    }
    #sidebar .brand img { width: 100%; max-width: 168px; display: block; margin: 0 auto; }
    #sidebar .brand .product {
      margin-top: .55rem; text-align: center;
      font-size: .68rem; font-weight: 700; letter-spacing: .13em;
      text-transform: uppercase; color: var(--iswe-navy);
    }
    #sidebar .nav-section {
      padding: 1.1rem 1.15rem .35rem;
      font-size: .64rem; font-weight: 800; letter-spacing: .14em;
      text-transform: uppercase; color: rgba(255,255,255,.42);
    }
    #sidebar .nav-link {
      color: rgba(255,255,255,.82); border-radius: 8px;
      margin: 1px .6rem; padding: .5rem .7rem;
      font-weight: 500; font-size: .88rem;
      display: flex; align-items: center; gap: .6rem;
      transition: background .15s ease, color .15s ease;
    }
    #sidebar .nav-link:hover { background: rgba(255,255,255,.09); color: #fff; }
    #sidebar .nav-link.active {
      background: #fff; color: var(--iswe-navy); font-weight: 700;
      box-shadow: inset 3px 0 0 var(--iswe-red);
    }
    #sidebar .nav-link i { width: 17px; text-align: center; font-size: .95rem; }
    #sidebar .nav-link .badge-count {
      margin-left: auto; font-size: .68rem; font-weight: 700;
      background: var(--iswe-red); color: #fff;
      border-radius: 10px; padding: 1px 7px;
    }
    #sidebar .sidebar-foot {
      margin-top: auto; padding: 1rem 1.15rem;
      font-size: .7rem; line-height: 1.5;
      color: rgba(255,255,255,.45);
      border-top: 1px solid rgba(255,255,255,.1);
    }

    /* ── Main ────────────────────────────────────────────────────── */
    #main { flex: 1; min-width: 0; padding: 1.6rem 1.9rem 3rem; }

    .topbar {
      display: flex; align-items: flex-start; justify-content: space-between;
      gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem;
    }
    .topbar h1 {
      font-size: 1.3rem; font-weight: 800; margin: 0;
      color: var(--iswe-navy); letter-spacing: -.01em;
      display: flex; align-items: center; gap: .55rem;
    }
    .topbar .subtitle { font-size: .82rem; color: var(--muted); margin-top: .2rem; }

    /* ── Panels ──────────────────────────────────────────────────── */
    .panel {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      overflow: hidden;
    }
    .panel-head {
      display: flex; align-items: center; justify-content: space-between;
      gap: .75rem; flex-wrap: wrap;
      padding: .8rem 1.1rem;
      border-bottom: 1px solid var(--border-soft);
      background: linear-gradient(180deg, #fbfcfe 0%, #f7f9fd 100%);
    }
    .panel-head h6 {
      margin: 0; font-size: .72rem; font-weight: 800;
      letter-spacing: .1em; text-transform: uppercase; color: var(--iswe-navy);
      display: flex; align-items: center; gap: .45rem;
    }
    .panel-head h6 i { color: var(--iswe-red); font-size: .9rem; }
    .panel-body { padding: 1.1rem; }
    .panel-body.tight { padding: 0; }

    /* Field groups inside a panel */
    .field-group { margin-bottom: 1.15rem; }
    .field-group:last-child { margin-bottom: 0; }
    .field-group > .legend {
      font-size: .68rem; font-weight: 800; letter-spacing: .1em;
      text-transform: uppercase; color: var(--muted);
      padding-bottom: .45rem; margin-bottom: .75rem;
      border-bottom: 1px dashed var(--border);
    }

    /* ── Stat tiles ──────────────────────────────────────────────── */
    .stat {
      display: block; text-decoration: none; color: inherit;
      background: var(--surface); border: 1px solid var(--border);
      border-radius: var(--radius); padding: .85rem 1rem;
      box-shadow: var(--shadow); height: 100%;
      border-top: 3px solid var(--border);
      transition: transform .14s ease, box-shadow .14s ease;
    }
    a.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); color: inherit; }
    .stat .label {
      font-size: .68rem; font-weight: 700; letter-spacing: .08em;
      text-transform: uppercase; color: var(--muted);
    }
    .stat .value { font-size: 1.75rem; font-weight: 800; line-height: 1.1; margin-top: .15rem; }
    .stat.is-total    { border-top-color: var(--iswe-navy); }
    .stat.is-total    .value { color: var(--iswe-navy); }
    .stat.is-ok       { border-top-color: var(--iswe-green); }
    .stat.is-ok       .value { color: var(--ok); }
    .stat.is-warn     { border-top-color: var(--iswe-yellow); }
    .stat.is-warn     .value { color: var(--warn); }
    .stat.is-danger   { border-top-color: var(--iswe-red); }
    .stat.is-danger   .value { color: var(--danger); }
    .stat.is-info     { border-top-color: var(--iswe-cyan); }
    .stat.is-info     .value { color: var(--info); }
    .stat.is-active   { box-shadow: 0 0 0 2px var(--iswe-navy), var(--shadow); }

    /* ── Tables ──────────────────────────────────────────────────── */
    .bf-table { width: 100%; border-collapse: collapse; }
    .bf-table thead th {
      background: #f7f9fd; color: var(--muted);
      font-size: .68rem; text-transform: uppercase; letter-spacing: .08em;
      font-weight: 800; border-bottom: 1px solid var(--border);
      padding: .6rem .95rem; white-space: nowrap; text-align: left;
    }
    .bf-table tbody td { padding: .65rem .95rem; vertical-align: middle; border-bottom: 1px solid var(--border-soft); }
    .bf-table tbody tr:last-child td { border-bottom: none; }
    .bf-table tbody tr:hover { background: #fbfcff; }
    .table-scroll { overflow-x: auto; }

    /* ── Badges ──────────────────────────────────────────────────── */
    .st {
      display: inline-block; font-size: .7rem; font-weight: 700;
      letter-spacing: .03em; text-transform: uppercase;
      border-radius: 20px; padding: .18rem .6rem; white-space: nowrap;
    }
    .st-active      { background: #e6f8e2; color: #1a7a0f; border: 1px solid #b9e8ad; }
    .st-pending     { background: #fdf7dd; color: #8a6a00; border: 1px solid #f0e39a; }
    .st-expiring    { background: #fff1e0; color: #a34b00; border: 1px solid #ffd0a1; }
    .st-expired     { background: #fdecea; color: #b01a02; border: 1px solid #f7c1b9; }
    .st-tampered    { background: #fdeee2; color: #a34b00; border: 1px solid #f6cfae; }
    .st-locked      { background: #f6dedb; color: #7d1103; border: 1px solid #e6b0a8; }
    .st-deactivated { background: #eef1f6; color: #4a5468; border: 1px solid #d7dde8; }
    .st-in  { background: #e2f8fb; color: #00697d; border: 1px solid #a9e6ef; }
    .st-out { background: #eaeffa; color: var(--iswe-navy); border: 1px solid #c3d1ee; }
    .st-adm { background: #f3ecfa; color: #5b3391; border: 1px solid #dccdf0; }

    /* ── Key pill ────────────────────────────────────────────────── */
    .key-pill {
      font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
      font-size: .78rem; background: #eef2fa; color: var(--iswe-navy);
      border: 1px solid #d6e0f2; border-radius: 5px; padding: .1rem .45rem;
      white-space: nowrap;
    }
    .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; }

    /* ── Meta list (label / value rows) ──────────────────────────── */
    .meta { width: 100%; font-size: .84rem; }
    .meta td { padding: .38rem 0; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
    .meta tr:last-child td { border-bottom: none; }
    .meta td:first-child { color: var(--muted); width: 42%; font-weight: 500; }

    /* ── Forms ───────────────────────────────────────────────────── */
    label.form-label { color: var(--muted); font-size: .76rem; font-weight: 700; letter-spacing: .02em; margin-bottom: .22rem; }
    .form-control, .form-select {
      background: #fff; border-color: #cfd7e6; color: var(--ink);
      border-radius: 8px; font-size: .88rem;
    }
    .form-control:focus, .form-select:focus {
      border-color: var(--iswe-navy); box-shadow: 0 0 0 3px rgba(33, 57, 101, .13);
    }
    .form-hint { font-size: .75rem; color: var(--muted); margin-top: .22rem; }

    /* ── Buttons ─────────────────────────────────────────────────── */
    .btn { border-radius: 8px; font-weight: 600; font-size: .84rem; }
    .btn-brand { background: var(--iswe-navy); color: #fff; border: 1px solid var(--iswe-navy); }
    .btn-brand:hover { background: var(--iswe-navy-dark); border-color: var(--iswe-navy-dark); color: #fff; }
    .btn-accent { background: var(--iswe-red); color: #fff; border: 1px solid var(--iswe-red); }
    .btn-accent:hover { background: var(--iswe-red-dark); border-color: var(--iswe-red-dark); color: #fff; }
    .btn-outline-brand { background: transparent; color: var(--iswe-navy); border: 1px solid #c3cee3; }
    .btn-outline-brand:hover { background: var(--iswe-navy); color: #fff; border-color: var(--iswe-navy); }

    /* ── Alerts ──────────────────────────────────────────────────── */
    .alert { border-radius: 10px; border-width: 1px; font-size: .87rem; }
    .alert-strip { border-left: 4px solid transparent; }
    .alert-strip.warning { border-left-color: var(--iswe-yellow); }
    .alert-strip.danger  { border-left-color: var(--iswe-red); }
    .alert-strip.info    { border-left-color: var(--iswe-cyan); }
    .alert-strip.success { border-left-color: var(--iswe-green); }

    /* ── Misc ────────────────────────────────────────────────────── */
    .progress { height: 6px; background: #e9edf5; border-radius: 3px; }
    .text-muted { color: var(--muted) !important; }
    .hint-inline { font-size: .74rem; color: var(--muted); font-weight: 500; }
    .token-box {
      background: #f7f9fd; border: 1px solid var(--border);
      border-radius: 10px; padding: .9rem;
      font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
      font-size: .78rem; word-break: break-all; color: var(--iswe-navy);
    }
    .guest-card {
      background: #fff; border: 1px solid var(--border);
      border-radius: 16px; box-shadow: var(--shadow-lg);
      overflow: hidden; width: 100%; max-width: 400px;
    }

    @media (max-width: 900px) {
      #sidebar { width: 100%; min-height: auto; position: static; }
      #sidebar .nav { flex-direction: row !important; flex-wrap: wrap; }
      .layout { flex-direction: column; }
      #main { padding: 1.1rem; }
    }
