:root { color-scheme: light; --ink:#172033; --muted:#667085; --line:#d9dee8; --panel:#fff; --bg:#f5f7fb; --brand:#0f766e; --danger:#b42318; --ok:#067647; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 15px; }
a { color: var(--brand); text-decoration: none; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 240px 1fr; }
.sidebar { background: #091326; color: #f9fafb; padding: 24px 18px; }
.brand { font-weight: 900; font-size: 19px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; letter-spacing: -.01em; }
a.brand { color: #fff; text-decoration: none; }
.brand-logo { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg,#059669,#0ea5e9); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 900; box-shadow: 0 4px 10px rgba(5,150,105,.4); }
.brand-accent { color: #34d399; }
.brand-img { height: 74px; width: auto; max-width: 100%; display: block; }
.user-card { background: #1d2939; border-radius: 8px; padding: 12px; margin-bottom: 20px; color: #e5e7eb; }
.user-card .user-name { font-weight: 700; font-size: 14px; }
.user-card .user-email { font-size: 11px; color: #98a2b3; word-break: break-all; margin-top: 2px; }
.user-card .user-roles { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.user-card .user-role { display: inline-block; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; background: #0f766e; padding: 2px 8px; border-radius: 999px; font-weight: 700; }
.user-orgs { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 4px; }
.user-orgs-label { display: block; flex: 1 0 100%; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: #98a2b3; margin-bottom: 2px; }
.org-chip { background: #344054; color: #e5e7eb; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.muted-chip { font-size: 11px; color: #98a2b3; font-style: italic; }
.trial-chip { display: inline-block; margin-top: 8px; background: rgba(5,150,105,.18); color: #34d399; border: 1px solid rgba(52,211,153,.35); padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.trial-chip.trial-warning { background: rgba(217,119,6,.18); color: #fbbf24; border-color: rgba(251,191,36,.4); }
.trial-chip.trial-expired { background: rgba(220,38,38,.18); color: #f87171; border-color: rgba(248,113,113,.4); }
.panel .trial-chip, .topbar .trial-chip { margin-top: 0; margin-left: 6px; background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.panel .trial-chip.trial-warning, .topbar .trial-chip.trial-warning { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.panel .trial-chip.trial-expired, .topbar .trial-chip.trial-expired { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.nav { display: grid; gap: 4px; }
.nav a { color: #e5e7eb; padding: 10px 12px; border-radius: 8px; display: flex; align-items: center; gap: 10px; font-size: 14px; transition: background .15s, color .15s; position: relative; }
.nav a:hover { background: #1d2939; }
.nav a.active { background: linear-gradient(90deg,rgba(5,150,105,.25),rgba(14,165,233,.15)); color: #fff; font-weight: 700; }
.nav a.active::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; background: #34d399; border-radius: 0 3px 3px 0; }
.nav-sub { display: grid; gap: 4px; margin: 2px 0 2px 14px; padding-left: 10px; border-left: 1px solid #1d2939; }
.nav-sub a { font-size: 13px; padding: 8px 10px; color: #cbd5e1; }
.main { padding: 28px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; }
h1 { margin: 0; font-size: 28px; letter-spacing: 0; }
h2 { margin: 0 0 14px; font-size: 18px; }
.muted { color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.panel, .card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.button, button { border: 0; border-radius: 8px; background: var(--brand); color: #fff; padding: 10px 14px; font-weight: 700; cursor: pointer; }
.button.secondary { background: #344054; }
.button.ghost { background: #eef4f3; color: var(--brand); }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: inherit; background: #fff; }
label { display: grid; gap: 6px; font-weight: 700; color: #344054; }
form.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; align-items: end; }
.check-list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.check-list label { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.check-list input { width: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 11px 12px; vertical-align: top; }
th { background: #eef2f7; color: #344054; font-size: 13px; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 8px; font-size: 12px; font-weight: 800; background: #eef2f7; color: #344054; }
.badge.ok { background: #dcfae6; color: var(--ok); }
.badge.danger { background: #fee4e2; color: var(--danger); }
.flash { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; background: #dcfae6; color: var(--ok); font-weight: 700; }
.flash-warning { background: #fef0c7; color: #b54708; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login .panel { width: min(420px, 100%); }
.login-box { width: min(420px, 100%); display: grid; gap: 20px; justify-items: center; }
.login-box .panel { width: 100%; }
.login-brand img { height: 110px; width: auto; max-width: 100%; display: block; mix-blend-mode: multiply; }
.nav-toggle { display: none; position: fixed; top: 12px; left: 12px; z-index: 30; background: #101828; color: #fff; border: 0; padding: 10px 12px; border-radius: 8px; font-size: 18px; line-height: 1; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(16,24,40,.55); z-index: 18; }
.sidebar-backdrop.open { display: block; }

/* Tablet */
@media (max-width: 960px) {
    .shell { grid-template-columns: 200px 1fr; }
    .sidebar { padding: 18px 14px; }
    .main { padding: 22px; }
    h1 { font-size: 24px; }
}

/* Mobile */
@media (max-width: 720px) {
    .shell { grid-template-columns: 1fr; }
    .nav-toggle { display: inline-flex; }
    .sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: 260px; max-width: 80vw; z-index: 20; transform: translateX(-100%); transition: transform .2s ease; overflow-y: auto; }
    .sidebar.open { transform: translateX(0); box-shadow: 4px 0 16px rgba(0,0,0,.25); }
    .main { padding: 64px 14px 22px; max-width: 100vw; overflow-x: hidden; }
    .topbar { flex-direction: column; align-items: stretch; gap: 8px; }
    h1 { font-size: 22px; }
    h2 { font-size: 16px; }
    .panel, .card { padding: 14px; }
    .grid { grid-template-columns: 1fr; gap: 12px; }
    table { display: block; width: 100%; overflow-x: auto; white-space: nowrap; border-radius: 0; }
    table thead th, table tbody td { padding: 9px 10px; font-size: 13px; }
    .actions { width: 100%; }
    .button, button { padding: 10px 12px; font-size: 14px; }
    form.grid-form { grid-template-columns: 1fr; }
    .check-list { grid-template-columns: 1fr 1fr; }
    .filters, .filters-row, .toolbar .filters { grid-template-columns: 1fr 1fr !important; }
    .toolbar-actions { flex-direction: column; align-items: stretch; }
    .view-tabs { width: 100%; }
    .view-tabs button { flex: 1; padding: 8px; font-size: 13px; }
    .due-cards { grid-template-columns: 1fr !important; }
    .gauges, .gauge-block { flex-direction: column; align-items: flex-start; }
    .gauge-ring { width: 90px !important; height: 90px !important; }
}

/* Small phones */
@media (max-width: 420px) {
    .filters, .filters-row, .toolbar .filters { grid-template-columns: 1fr !important; }
    .check-list { grid-template-columns: 1fr; }
    .login { padding: 14px; }
    h1 { font-size: 20px; }
}

.inline-form { display: inline; }
.danger-btn { background: #fee4e2; color: #b42318; border: 0; padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 700; cursor: pointer; }
