/* ==========================================================================
   Cloud Browser Session Manager CRM
   Local, dependency-free stylesheet. No CDN or icon font is required, which
   keeps the Content-Security-Policy strict (script-src 'self').
   ========================================================================== */

:root {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --text: #0f172a;
    --text-muted: #64748b;
    --text-soft: #94a3b8;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #dbeafe;
    --success: #15803d;
    --success-soft: #dcfce7;
    --warning: #b45309;
    --warning-soft: #fef3c7;
    --danger: #b91c1c;
    --danger-soft: #fee2e2;
    --info: #0e7490;
    --info-soft: #cffafe;
    --sidebar: #0b1220;
    --sidebar-soft: #111c31;
    --sidebar-text: #cbd5e1;
    --sidebar-muted: #64748b;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow: 0 8px 24px rgba(15, 23, 42, .08);
    --shadow-lg: 0 24px 60px rgba(15, 23, 42, .18);
    --sidebar-width: 256px;
    --topbar-height: 76px;
    --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }
h1, h2, h3, h4, h5, h6 { margin: 0 0 .5rem; line-height: 1.25; font-weight: 650; letter-spacing: -.015em; }
h1 { font-size: 1.65rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1rem; }
small { font-size: .8125rem; }
code, pre, .mono { font-family: var(--mono); font-size: .8125rem; }
pre { margin: 0; padding: 1rem; background: #0f172a; color: #e2e8f0; border-radius: var(--radius-sm); overflow: auto; white-space: pre-wrap; word-break: break-word; }
code { background: #eef2f7; color: #0f172a; padding: .12rem .35rem; border-radius: 5px; }
pre code { background: transparent; color: inherit; padding: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.25rem 0; }

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; flex: 0 0 auto; vertical-align: -.2em; }
.icon-lg { width: 22px; height: 22px; }
.icon-xl { width: 28px; height: 28px; }

/* --------------------------------------------------------------------------
   App shell
   -------------------------------------------------------------------------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #0b1220 0%, #0e1728 100%);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: 60;
    border-right: 1px solid rgba(148, 163, 184, .12);
}
.sidebar-brand { padding: 1.25rem 1.15rem 1rem; }
.brand-link { display: flex; gap: .75rem; align-items: center; color: #fff; text-decoration: none; }
.brand-link:hover { color: #fff; text-decoration: none; }
.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    color: #fff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, .35);
    flex: 0 0 auto;
}
.brand-mark .icon { width: 21px; height: 21px; }
.brand-mark-lg { width: 46px; height: 46px; border-radius: 14px; }
.brand-mark-lg .icon { width: 26px; height: 26px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: var(--sidebar-muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }

.sidebar-nav { padding: .5rem .7rem 1rem; overflow-y: auto; flex: 1; }
.nav-section { margin: 1.1rem .55rem .4rem; font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: var(--sidebar-muted); font-weight: 700; }
.nav-section:first-child { margin-top: .35rem; }
.nav-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .62rem .7rem;
    margin-bottom: .15rem;
    border-radius: 9px;
    color: var(--sidebar-text);
    font-weight: 500;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}
.nav-link:hover { background: rgba(148, 163, 184, .1); color: #fff; text-decoration: none; }
.nav-link.active { background: linear-gradient(90deg, rgba(37, 99, 235, .95), rgba(37, 99, 235, .65)); color: #fff; box-shadow: 0 6px 16px rgba(37, 99, 235, .25); }
.nav-link .icon { width: 18px; height: 18px; opacity: .85; }
.nav-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #ef4444; color: #fff; font-size: .68rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.nav-dot { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; }
.sidebar-footer { padding: .9rem; border-top: 1px solid rgba(148, 163, 184, .12); }
.sidebar-user { display: flex; align-items: center; gap: .65rem; }
.sidebar-user-meta { display: flex; flex-direction: column; min-width: 0; }
.sidebar-user-meta strong { font-size: .82rem; color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-meta small { color: var(--sidebar-muted); font-size: .72rem; }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-width); display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .85rem 1.6rem;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.topbar-title { min-width: 0; flex: 1; }
.topbar-eyebrow { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-soft); font-weight: 700; }
.topbar-title h1 { margin: 0; font-size: 1.3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: .55rem; }
.content { flex: 1; padding: 1.5rem 1.6rem 2rem; max-width: 1500px; width: 100%; margin: 0 auto; }
.app-footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 1.6rem 1.4rem; color: var(--text-soft); font-size: .75rem; flex-wrap: wrap; }
.nav-toggle { display: none; }
.nav-scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 55; }

/* --------------------------------------------------------------------------
   Avatars, dropdown
   -------------------------------------------------------------------------- */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e3a8a;
    font-weight: 700;
    font-size: .8rem;
    flex: 0 0 auto;
}
.avatar-sm { width: 30px; height: 30px; font-size: .7rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.1rem; }
.dropdown { position: relative; }
.dropdown-toggle { display: flex; align-items: center; gap: .5rem; padding: .35rem .45rem; border-radius: 10px; cursor: pointer; list-style: none; border: 1px solid transparent; }
.dropdown-toggle::-webkit-details-marker { display: none; }
.dropdown-toggle:hover { background: var(--surface-muted); border-color: var(--border); }
.user-menu-name { font-weight: 600; font-size: .82rem; }
.user-menu .icon { width: 15px; height: 15px; color: var(--text-muted); }
.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + .45rem);
    min-width: 230px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: .4rem;
    z-index: 70;
}
.dropdown-header { padding: .65rem .7rem; display: flex; flex-direction: column; }
.dropdown-header small { color: var(--text-muted); }
.dropdown-item {
    display: flex;
    align-items: center;
    gap: .55rem;
    width: 100%;
    padding: .55rem .7rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    text-decoration: none;
}
.dropdown-item:hover { background: var(--surface-muted); color: var(--text); text-decoration: none; }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item .icon { width: 16px; height: 16px; }
.dropdown-divider { height: 1px; background: var(--border); margin: .35rem 0; }
.notification-button { position: relative; }
.notification-dot { position: absolute; top: 1px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: #ef4444; color: #fff; font-size: .62rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; border: 2px solid #fff; }

/* --------------------------------------------------------------------------
   Cards, page header, stats
   -------------------------------------------------------------------------- */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-header h2 { margin-bottom: .25rem; }
.page-header p { margin: 0; color: var(--text-muted); }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.breadcrumb { display: flex; gap: .4rem; align-items: center; list-style: none; padding: 0; margin: 0 0 .45rem; font-size: .78rem; color: var(--text-soft); flex-wrap: wrap; }
.breadcrumb li { display: flex; align-items: center; gap: .4rem; }
.breadcrumb a { color: var(--text-muted); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 1.25rem; overflow: hidden; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .95rem 1.15rem; border-bottom: 1px solid var(--border); background: var(--surface); flex-wrap: wrap; }
.card-header h3 { margin: 0; font-size: .98rem; }
.card-header p { margin: .15rem 0 0; color: var(--text-muted); font-size: .8rem; }
.card-body { padding: 1.15rem; }
.card-body.tight { padding: .85rem 1rem; }
.card-footer { padding: .85rem 1.15rem; border-top: 1px solid var(--border); background: var(--surface-muted); }
.card.flush { overflow: visible; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { position: relative; padding: 1.05rem 1.1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.stat::after { content: ""; position: absolute; inset: auto -20px -30px auto; width: 90px; height: 90px; border-radius: 50%; background: var(--primary-soft); opacity: .5; }
.stat-label { display: flex; align-items: center; gap: .45rem; color: var(--text-muted); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat-label .icon { width: 16px; height: 16px; }
.stat-value { font-size: 1.85rem; font-weight: 700; letter-spacing: -.03em; margin-top: .35rem; position: relative; z-index: 1; }
.stat-hint { color: var(--text-muted); font-size: .76rem; position: relative; z-index: 1; }
.stat.success::after { background: var(--success-soft); }
.stat.warning::after { background: var(--warning-soft); }
.stat.danger::after { background: var(--danger-soft); }
.stat.info::after { background: var(--info-soft); }

.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-sidebar { grid-template-columns: minmax(0, 1.65fr) minmax(280px, .9fr); }
.section-title { display: flex; align-items: center; gap: .5rem; font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin: 0 0 .8rem; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .52rem .85rem;
    border: 1px solid transparent;
    border-radius: 9px;
    font: inherit;
    font-weight: 600;
    font-size: .82rem;
    line-height: 1.3;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
    white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: 3px solid rgba(37, 99, 235, .3); outline-offset: 1px; }
.btn[disabled], .btn.disabled { opacity: .55; pointer-events: none; }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(37, 99, 235, .22); }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-secondary { background: #334155; color: #fff; }
.btn-secondary:hover { background: #1e293b; color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #166534; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #991b1b; color: #fff; }
.btn-warning { background: #d97706; color: #fff; }
.btn-warning:hover { background: #b45309; color: #fff; }
.btn-outline { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { background: var(--surface-muted); color: var(--text); border-color: #94a3b8; }
.btn-outline-primary { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary-soft); color: var(--primary-dark); }
.btn-outline-danger { background: transparent; border-color: #fca5a5; color: var(--danger); }
.btn-outline-danger:hover { background: var(--danger-soft); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-muted); color: var(--text); }
.btn-sm { padding: .35rem .6rem; font-size: .76rem; border-radius: 7px; }
.btn-sm .icon { width: 14px; height: 14px; }
.btn-lg { padding: .72rem 1.1rem; font-size: .9rem; }
.btn-block { width: 100%; }
.btn-icon { padding: .5rem; width: 38px; height: 38px; }
.btn-icon.btn-sm { width: 30px; height: 30px; padding: .3rem; }
.btn-group { display: inline-flex; gap: .35rem; flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   Badges and status
   -------------------------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: .25rem; padding: .22rem .5rem; border-radius: 999px; font-size: .7rem; font-weight: 700; line-height: 1.35; white-space: nowrap; }
.text-bg-success { background: var(--success-soft); color: #166534; }
.text-bg-primary { background: var(--primary-soft); color: #1e40af; }
.text-bg-secondary { background: #e2e8f0; color: #334155; }
.text-bg-danger { background: var(--danger-soft); color: #991b1b; }
.text-bg-warning { background: var(--warning-soft); color: #92400e; }
.text-bg-info { background: var(--info-soft); color: #155e75; }
.text-bg-dark { background: #1e293b; color: #f8fafc; }
.text-bg-light { background: #f1f5f9; color: #475569; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-soft); }
.dot.success { background: #22c55e; }
.dot.danger { background: #ef4444; }
.dot.warning { background: #f59e0b; }
.dot.live { box-shadow: 0 0 0 4px rgba(34, 197, 94, .16); }

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
.table-wrap { width: 100%; overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.table th, .table td { padding: .7rem .85rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table thead th { background: var(--surface-muted); color: var(--text-muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; white-space: nowrap; }
.table tbody tr:hover { background: #f8fafc; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { display: flex; gap: .3rem; justify-content: flex-end; flex-wrap: wrap; }
.table-sm th, .table-sm td { padding: .5rem .65rem; }
.table-compact { font-size: .78rem; }
.table-empty td { padding: 2.4rem 1rem; text-align: center; color: var(--text-muted); }
.table-meta { color: var(--text-muted); font-size: .74rem; }
.truncate { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle; }
.mono-cell { font-family: var(--mono); font-size: .75rem; }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form-grid .span-2 { grid-column: span 2; }
.form-group, .mb-3 { margin-bottom: 1rem; }
.form-label { display: block; margin-bottom: .35rem; font-weight: 600; font-size: .8rem; color: #334155; }
.form-label .req { color: var(--danger); }
.form-control, .form-select {
    display: block;
    width: 100%;
    padding: .55rem .7rem;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: .85rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus, .form-select:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .16); }
.form-control::placeholder { color: #a8b3c2; }
.form-control:disabled, .form-select:disabled { background: #f1f5f9; color: var(--text-muted); }
textarea.form-control { min-height: 110px; resize: vertical; }
.form-text { display: block; margin-top: .3rem; color: var(--text-muted); font-size: .75rem; }
.form-error { display: block; margin-top: .3rem; color: var(--danger); font-size: .76rem; }
.form-check { display: flex; align-items: flex-start; gap: .5rem; padding: .3rem 0; }
.form-check-input { width: 16px; height: 16px; margin-top: .18rem; accent-color: var(--primary); flex: 0 0 auto; }
.form-check-label { font-size: .84rem; }
.form-actions { display: flex; gap: .6rem; justify-content: flex-end; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); flex-wrap: wrap; }
.input-group { display: flex; gap: .4rem; }
.input-group .form-control { flex: 1; }
.fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin: 0 0 1.25rem; }
.fieldset legend { padding: 0 .4rem; font-weight: 700; font-size: .82rem; color: var(--text-muted); }
.help-box { padding: .75rem .9rem; background: var(--surface-muted); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); color: var(--text-muted); font-size: .78rem; }
.filter-bar { display: flex; gap: .55rem; align-items: flex-end; flex-wrap: wrap; }
.filter-bar .form-group { margin: 0; min-width: 150px; }
.filter-bar .form-control, .filter-bar .form-select { min-width: 150px; }
.filter-bar .grow { flex: 1; min-width: 210px; }

/* --------------------------------------------------------------------------
   Alerts
   -------------------------------------------------------------------------- */
.flash-stack { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1.1rem; }
.flash-floating { position: fixed; right: 1.2rem; bottom: 1.2rem; width: min(380px, calc(100vw - 2rem)); z-index: 200; margin: 0; }
.alert { display: flex; gap: .65rem; align-items: flex-start; padding: .75rem .9rem; border-radius: 10px; border: 1px solid transparent; font-size: .82rem; }
.alert-icon { flex: 0 0 auto; display: inline-flex; margin-top: .05rem; }
.alert-icon .icon { width: 17px; height: 17px; }
.alert-body { flex: 1; }
.alert-close { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0 .1rem; opacity: .65; }
.alert-close:hover { opacity: 1; }
.alert-close .icon { width: 15px; height: 15px; }
.alert-success { background: var(--success-soft); border-color: #bbf7d0; color: #14532d; }
.alert-danger { background: var(--danger-soft); border-color: #fecaca; color: #7f1d1d; }
.alert-warning { background: var(--warning-soft); border-color: #fde68a; color: #78350f; }
.alert-info { background: var(--info-soft); border-color: #a5f3fc; color: #164e63; }
.inline-note { display: flex; gap: .5rem; align-items: flex-start; padding: .7rem .85rem; border-radius: var(--radius-sm); background: var(--surface-muted); border: 1px solid var(--border); color: var(--text-muted); font-size: .78rem; }
.inline-note .icon { margin-top: .1rem; }

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */
.pagination { display: flex; gap: .25rem; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.page-item .page-link { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 .5rem; border: 1px solid var(--border); border-radius: 7px; color: var(--text-muted); font-size: .78rem; background: #fff; text-decoration: none; }
.page-item .page-link:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.page-item.active .page-link { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-item.disabled .page-link { opacity: .45; pointer-events: none; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1.15rem; border-top: 1px solid var(--border); flex-wrap: wrap; }
.table-footer .meta { color: var(--text-muted); font-size: .76rem; }

/* --------------------------------------------------------------------------
   Empty states, lists, charts
   -------------------------------------------------------------------------- */
.empty-state { padding: 2.5rem 1.5rem; text-align: center; color: var(--text-muted); }
.empty-state .empty-icon { width: 54px; height: 54px; border-radius: 16px; background: var(--surface-muted); color: var(--text-soft); display: inline-flex; align-items: center; justify-content: center; margin-bottom: .75rem; }
.empty-state .empty-icon .icon { width: 26px; height: 26px; }
.empty-state h3 { color: var(--text); font-size: 1rem; margin-bottom: .35rem; }
.empty-state p { margin: 0 auto .9rem; max-width: 420px; font-size: .82rem; }
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; gap: .75rem; padding: .75rem 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.list-item:last-child { border-bottom: 0; padding-bottom: 0; }
.list-item:first-child { padding-top: 0; }
.list-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-muted); color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.list-icon .icon { width: 17px; height: 17px; }
.list-body { flex: 1; min-width: 0; }
.list-body strong { display: block; font-size: .84rem; }
.list-body p { margin: .1rem 0 0; color: var(--text-muted); font-size: .78rem; }
.list-meta { color: var(--text-soft); font-size: .72rem; white-space: nowrap; }
.chart { width: 100%; height: 240px; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart-legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .76rem; color: var(--text-muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.chart-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.progress { height: 7px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: inherit; }
.kv { display: grid; grid-template-columns: minmax(120px, .55fr) minmax(0, 1fr); gap: .45rem 1rem; font-size: .82rem; margin: 0; }
.kv dt { color: var(--text-muted); font-weight: 500; }
.kv dd { margin: 0; word-break: break-word; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.15rem; flex-wrap: wrap; }
.tab { padding: .55rem .8rem; border-radius: 8px 8px 0 0; color: var(--text-muted); font-weight: 600; font-size: .82rem; border-bottom: 2px solid transparent; text-decoration: none; }
.tab:hover { color: var(--text); background: var(--surface-muted); text-decoration: none; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.metric-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px dashed var(--border); font-size: .82rem; }
.metric-row:last-child { border-bottom: 0; }
.metric-row span:first-child { color: var(--text-muted); }
.metric-row strong { font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.d-block { display: block !important; }
.d-none { display: none !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-1 { flex: 1 1 auto; }
.align-items-center { align-items: center !important; }
.align-items-start { align-items: flex-start !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-end { justify-content: flex-end !important; }
.gap-1 { gap: .25rem !important; }
.gap-2 { gap: .5rem !important; }
.gap-3 { gap: .75rem !important; }
.gap-4 { gap: 1rem !important; }
.w-100 { width: 100% !important; }
.text-end { text-align: right !important; }
.text-center { text-align: center !important; }
.text-muted { color: var(--text-muted) !important; }
.text-soft { color: var(--text-soft) !important; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-primary { color: var(--primary) !important; }
.text-nowrap { white-space: nowrap; }
.text-break { word-break: break-word; }
.fw-semibold { font-weight: 600 !important; }
.fw-bold { font-weight: 700 !important; }
.fs-sm { font-size: .8rem !important; }
.fs-xs { font-size: .72rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: .25rem !important; }
.mb-2 { margin-bottom: .5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: .25rem !important; }
.mt-2 { margin-top: .5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.me-1 { margin-right: .25rem !important; }
.me-2 { margin-right: .5rem !important; }
.ms-1 { margin-left: .25rem !important; }
.ms-2 { margin-left: .5rem !important; }
.p-0 { padding: 0 !important; }
.p-3 { padding: 1rem !important; }
.py-2 { padding-top: .5rem !important; padding-bottom: .5rem !important; }
.border-top { border-top: 1px solid var(--border) !important; }
.rounded { border-radius: var(--radius) !important; }
.overflow-hidden { overflow: hidden !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
.row { display: flex; flex-wrap: wrap; gap: 1rem; }
.col { flex: 1 1 0; min-width: 0; }
.col-6 { flex: 0 0 calc(50% - .5rem); min-width: 0; }
.col-4 { flex: 0 0 calc(33.333% - .67rem); min-width: 0; }
.col-3 { flex: 0 0 calc(25% - .75rem); min-width: 0; }
.g-3 { gap: 1rem; }
hr.soft { border-color: var(--border); opacity: .7; }

/* --------------------------------------------------------------------------
   Auth pages
   -------------------------------------------------------------------------- */
.auth-body { min-height: 100vh; background: radial-gradient(circle at 10% 10%, #dbeafe 0, transparent 40%), radial-gradient(circle at 90% 90%, #cffafe 0, transparent 45%), #f8fafc; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); }
.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: 2.5rem clamp(1.5rem, 6vw, 4.5rem); background: rgba(255, 255, 255, .92); box-shadow: var(--shadow-lg); }
.auth-brand { display: flex; gap: .8rem; align-items: center; margin-bottom: 2rem; }
.auth-brand strong { display: block; font-size: 1rem; }
.auth-brand small { color: var(--text-muted); font-size: .76rem; }
.auth-panel h1 { font-size: 1.55rem; margin-bottom: .35rem; }
.auth-subtitle { color: var(--text-muted); margin-bottom: 1.4rem; }
.auth-aside { position: relative; display: flex; align-items: center; padding: 3rem clamp(2rem, 7vw, 6rem); background: linear-gradient(135deg, #0b1220 0%, #12264a 55%, #0e7490 100%); color: #e2e8f0; overflow: hidden; }
.auth-aside::before, .auth-aside::after { content: ""; position: absolute; border-radius: 50%; filter: blur(2px); opacity: .35; }
.auth-aside::before { width: 320px; height: 320px; background: radial-gradient(circle, #38bdf8, transparent 65%); top: -80px; right: -60px; }
.auth-aside::after { width: 380px; height: 380px; background: radial-gradient(circle, #6366f1, transparent 65%); bottom: -120px; left: -100px; }
.auth-aside-inner { position: relative; z-index: 1; max-width: 520px; }
.auth-aside h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); color: #fff; margin-bottom: 1rem; }
.auth-aside p { color: #cbd5e1; font-size: .95rem; line-height: 1.7; }
.auth-points { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; gap: .8rem; }
.auth-points li { display: flex; gap: .65rem; align-items: center; color: #e2e8f0; font-size: .88rem; }
.auth-points .icon { color: #38bdf8; width: 20px; height: 20px; }
.auth-links { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.1rem; font-size: .8rem; flex-wrap: wrap; }
.auth-footer-note { margin-top: 1.6rem; color: var(--text-soft); font-size: .72rem; }
.auth-card { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.4rem; background: #fff; box-shadow: var(--shadow-sm); }
.password-meter { display: flex; gap: .3rem; margin-top: .45rem; }
.password-meter span { height: 5px; flex: 1; border-radius: 99px; background: #e2e8f0; }
.password-meter span.on { background: var(--success); }
.password-meter.weak span.on { background: var(--danger); }
.password-meter.fair span.on { background: var(--warning); }

/* --------------------------------------------------------------------------
   Browser viewer
   -------------------------------------------------------------------------- */
.browser-body { height: 100vh; overflow: hidden; background: #070b14; color: #e2e8f0; }
.browser-shell { display: flex; flex-direction: column; height: 100vh; }
.browser-bar { display: flex; align-items: center; gap: .75rem; padding: .55rem .8rem; background: #0b1220; border-bottom: 1px solid #1e293b; flex-wrap: wrap; z-index: 20; }
.browser-bar .btn { color: #cbd5e1; }
.browser-bar .btn:hover { background: #16233b; color: #fff; }
.browser-title { display: flex; flex-direction: column; min-width: 0; }
.browser-title strong { font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.browser-title small { color: #64748b; font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.browser-status { display: inline-flex; align-items: center; gap: .4rem; font-size: .74rem; color: #94a3b8; padding: .25rem .55rem; border-radius: 999px; background: #111c31; border: 1px solid #1e293b; }
.browser-status.live { color: #86efac; }
.browser-status.warn { color: #fcd34d; }
.browser-status.error { color: #fca5a5; }
.browser-actions { display: flex; align-items: center; gap: .3rem; margin-left: auto; flex-wrap: wrap; }
.browser-main { flex: 1; min-height: 0; display: flex; }
.browser-screen { flex: 1; min-width: 0; position: relative; background: #000; display: flex; align-items: center; justify-content: center; }
.browser-screen canvas { max-width: 100%; max-height: 100%; outline: none; }
.browser-screen .viewer-placeholder { text-align: center; color: #94a3b8; padding: 2rem; max-width: 560px; }
.browser-screen .viewer-placeholder h2 { color: #e2e8f0; font-size: 1.1rem; }
.browser-screen .viewer-placeholder p { font-size: .84rem; }
.browser-screen .viewer-placeholder code { background: #111c31; color: #e2e8f0; }
.browser-side { width: 300px; flex: 0 0 300px; background: #0b1220; border-left: 1px solid #1e293b; display: flex; flex-direction: column; min-height: 0; }
.browser-side-header { padding: .7rem .9rem; border-bottom: 1px solid #1e293b; display: flex; align-items: center; justify-content: space-between; }
.browser-side-header h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: #94a3b8; margin: 0; }
.browser-side-body { padding: .9rem; overflow-y: auto; flex: 1; }
.browser-side .kv { font-size: .76rem; grid-template-columns: 100px minmax(0, 1fr); }
.browser-side .kv dt { color: #64748b; }
.browser-side .kv dd { color: #e2e8f0; }
.browser-side .list-item { border-color: #1e293b; }
.browser-side .list-icon { background: #111c31; color: #94a3b8; }
.browser-side .list-body strong { color: #e2e8f0; }
.browser-side .list-body p, .browser-side .list-meta { color: #64748b; }
.browser-controls { display: grid; gap: .45rem; }
.browser-controls .btn { width: 100%; justify-content: flex-start; }
.browser-hint { color: #64748b; font-size: .74rem; line-height: 1.5; }
.browser-toast { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); background: #111c31; border: 1px solid #1e293b; color: #e2e8f0; padding: .55rem .9rem; border-radius: 999px; font-size: .78rem; z-index: 300; box-shadow: var(--shadow-lg); }
.browser-upload { display: none; }
.screen-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(7, 11, 20, .72); color: #e2e8f0; z-index: 5; }
.screen-overlay .overlay-card { background: #0b1220; border: 1px solid #1e293b; border-radius: var(--radius); padding: 1.4rem 1.6rem; text-align: center; max-width: 440px; }
.screen-overlay h2 { font-size: 1.05rem; }
.screen-overlay p { color: #94a3b8; font-size: .82rem; }
.browser-empty { height: 100%; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.browser-empty .empty-state { color: #94a3b8; }
.browser-empty .empty-state h3 { color: #e2e8f0; }

/* --------------------------------------------------------------------------
   Error page (rendered by App::renderError)
   -------------------------------------------------------------------------- */
.error-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 1.5rem; }
.error-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 2.2rem; max-width: 480px; text-align: center; }
.error-code { font-size: 3.2rem; font-weight: 800; letter-spacing: -.04em; color: var(--primary); line-height: 1; margin-bottom: .4rem; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
    .grid-sidebar { grid-template-columns: minmax(0, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .browser-side { width: 270px; flex-basis: 270px; }
}
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
    body.nav-open .sidebar { transform: translateX(0); }
    .main { margin-left: 0; }
    .nav-toggle { display: inline-flex; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .auth-panel { min-height: 100vh; }
    .browser-side { display: none; }
}
@media (max-width: 720px) {
    .content { padding: 1.1rem 1rem 1.6rem; }
    .topbar { padding: .75rem 1rem; }
    .topbar-eyebrow { display: none; }
    .user-menu-name { display: none; }
    .grid-2, .grid-3, .form-grid { grid-template-columns: minmax(0, 1fr); }
    .form-grid .span-2 { grid-column: auto; }
    .col-6, .col-4, .col-3 { flex: 1 1 100%; }
    .app-footer { padding: .9rem 1rem 1.2rem; }
    .stat-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
    .table th, .table td { padding: .55rem .6rem; }
    .browser-bar { gap: .4rem; }
    .browser-title { max-width: 140px; }
}
@media print {
    .sidebar, .topbar, .app-footer, .page-actions, .btn, .pagination { display: none !important; }
    .main { margin: 0; }
    .content { padding: 0; }
    .card { box-shadow: none; border-color: #999; }
}
