:root {
    /* brand — reference tokens (aswaq emerald / zid violet) */
    --c-aswaq: #10b981;
    --c-aswaq-deep: #0b8f5f;
    --c-aswaq-soft: rgba(16, 185, 129, .14);
    --c-zid: #8b5cf6;
    --c-zid-deep: #7c3aed;
    --c-zid-soft: rgba(139, 92, 246, .14);

    /* surfaces — dark (default) */
    --bg: #0e1320;
    --panel: #161d2e;
    --panel-2: #1d2638;
    --border: #28334d;
    --text: #e8edf6;
    --muted: #8a95ad;

    --accent: var(--c-aswaq);
    --accent-2: var(--c-zid);

    --green: #23c07a;
    --amber: #e8a33d;
    --red: #e5484d;

    --radius: 10px;
    --shadow: 0 6px 20px rgba(0, 0, 0, .35);

    --font-sans: 'Inter', 'Cairo', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
}

[data-theme="light"] {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --panel-2: #eef1f7;
    --border: #d9e0ec;
    --text: #1b2434;
    --muted: #5c6a84;
    --shadow: 0 6px 20px rgba(23, 32, 55, .10);
    --c-aswaq-soft: rgba(16, 185, 129, .12);
    --c-zid-soft: rgba(139, 92, 246, .12);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.5;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- layout ---------- */

.app-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }

.sidebar {
    background: var(--panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand { display: flex; gap: 10px; align-items: center; padding: 0 8px 16px; }
.brand-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 9px;
background: linear-gradient(135deg, var(--c-aswaq), var(--c-zid));
    color: #fff; font-weight: 800; font-size: 20px;
}
.brand strong { display: block; font-size: 15px; }
.brand span { font-size: 12px; color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-link {
    display: block; padding: 9px 12px; border-radius: 8px;
    color: var(--muted); font-weight: 500;
}
.nav-link:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--c-aswaq-soft); color: var(--c-aswaq); }

.sidebar-foot { font-size: 12px; color: var(--muted); text-align: center; }

.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 28px; border-bottom: 1px solid var(--border);
    background: var(--panel);
}
.topbar h1 { margin: 0; font-size: 19px; }
.whoami { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }

.content { padding: 26px 28px 60px; }

/* ---------- cards ---------- */

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow);
}
.card h2, .card h3 { margin: 0 0 12px; font-size: 15px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
@media (max-width: 1000px) { .grid-2 { grid-template-columns: 1fr; } }

.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; }
.metric-card { display: flex; flex-direction: column; gap: 4px; }
.metric-label { color: var(--muted); font-size: 13px; }
.metric-value { font-size: 30px; font-weight: 700; }
.metric-value.negative { color: var(--red); }
.metric-value.small { font-size: 18px; }
.metric-sub { color: var(--muted); font-size: 12px; }

/* ---------- pills & status ---------- */

.pill {
    display: inline-block; padding: 2px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 600; white-space: nowrap;
    border: 1px solid var(--border); color: var(--muted);
}
.pill.healthy, .pill.active, .pill.approved, .pill.passed, .pill.success, .pill.connected, .pill.online { color: var(--green); border-color: var(--green); }
.pill.degraded, .pill.expiring, .pill.pending, .pill.warning, .pill.connecteddegraded, .pill.recentlyseen { color: var(--amber); border-color: var(--amber); }
.pill.error, .pill.failed, .pill.critical, .pill.suspended, .pill.suspended, .pill.revoked,
.pill.needsreauthorization, .pill.deactivated, .pill.offlineorstale { color: var(--red); border-color: var(--red); }
.pill.na, .pill.neverseen { color: var(--muted); }

/* ---------- tables ---------- */

.table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.table th {
    text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
    color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border);
}
.table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: none; }
.table code { background: var(--panel-2); padding: 1px 6px; border-radius: 5px; font-size: 12px; font-family: var(--font-mono); }

/* ---------- forms ---------- */

.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { gap: 8px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: 13px; color: var(--muted); }
input, select, button, summary {
    font: inherit; color: var(--text);
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
}
input:focus, select:focus { outline: 2px solid var(--accent); border-color: transparent; }
input.mini { width: 110px; padding: 5px 8px; }
.form-card { max-width: 520px; }

.btn {
    display: inline-block; cursor: pointer; text-align: center;
    border: 1px solid var(--border); border-radius: 8px;
    padding: 8px 14px; color: var(--text); background: var(--panel-2);
    text-decoration: none; font-weight: 500;
}
.btn:hover { text-decoration: none; filter: brightness(1.15); }
.btn-primary { background: var(--c-aswaq); border: none; color: #fff; }
.btn-primary:hover { background: var(--c-aswaq-deep); }
.btn-danger { background: var(--red); border: none; color: #fff; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-row { display: flex; gap: 8px; margin-top: 12px; }
.inline { display: inline-flex; gap: 6px; margin-right: 6px; }
.inline-reset { display: inline; }

/* ---------- filter toolbar ---------- */

.filter-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-toolbar:empty { display: none; }
.filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.filter-search { width: 230px; max-width: 100%; flex: 0 0 auto; }
.filter-date { width: 152px; max-width: 100%; flex: 0 0 auto; }
.filter-select { width: 158px; max-width: 100%; flex: 0 0 auto; }
.filter-form button { flex: 0 0 auto; }

@media (max-width: 640px) {
    .filter-form { flex-direction: column; align-items: stretch; width: 100%; }
    .filter-form .filter-search,
    .filter-form .filter-date,
    .filter-form .filter-select { width: 100%; }
    .filter-form button { flex: 1 0 auto; }
}

/* ---------- layout helpers ---------- */

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.toolbar form { align-items: flex-end; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 20px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab { padding: 8px 14px; color: var(--muted); border-radius: 8px 8px 0 0; font-weight: 500; }
.tab:hover { text-decoration: none; color: var(--text); }
.tab.active { background: var(--panel-2); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }

.dl { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; word-break: break-word; }
.dl dd.ok { color: var(--green); }
.dl dd.bad { color: var(--red); }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.negative { color: var(--red); }
.json { background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px; overflow-x: auto; white-space: pre-wrap; font-size: 12px; font-family: var(--font-mono); }

.activity { list-style: none; margin: 0; padding: 0; }
.activity li { border-bottom: 1px solid var(--border); padding: 10px 0; }
.activity li:last-child { border-bottom: none; }
.activity a { display: flex; flex-direction: column; gap: 2px; color: var(--text); }
.activity time { color: var(--muted); font-size: 12px; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { border-bottom: 1px solid var(--border); padding: 8px 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.list li:last-child { border-bottom: none; }

.progress { height: 6px; background: var(--panel-2); border-radius: 999px; overflow: hidden; width: 120px; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

.flash {
    margin: 16px 28px 0; padding: 10px 14px; border-radius: 8px;
    border: 1px solid var(--border); background: var(--panel-2);
}
.flash.success { border-color: var(--green); color: var(--green); }
.flash.error { border-color: var(--red); color: var(--red); }
.flash.warning { border-color: var(--amber); color: var(--amber); }

/* ---------- auth ---------- */

.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-card { width: 360px; max-width: calc(100vw - 32px); }
.auth-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 24px; }
.auth-title { font-size: 20px; font-weight: 700; margin-bottom: 16px; }
.auth-card .flash { margin: 0 0 14px; }

.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.perm { display: flex; gap: 10px; align-items: flex-start; padding: 8px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.perm input { margin-top: 4px; }
/* ---------- licensing ---------- */
.card.highlight { border-color: var(--amber); background: var(--panel-2); }
.form-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.license-key { background: var(--panel-1); border: 1px dashed var(--border); padding: 10px 14px; font-size: 15px; letter-spacing: 1px; overflow-x: auto; border-radius: 8px; margin: 4px 0 0; font-family: var(--font-mono); }

/* ---------- shell v2 (reference design system) ---------- */

.brand { padding: 0; }
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }

.env-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 3px 8px; border: 1px solid var(--border); border-radius: 999px; }
.env-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok, var(--green)); box-shadow: 0 0 0 3px var(--c-aswaq-soft); }
.env-badge.warn i { background: var(--amber); box-shadow: 0 0 0 3px rgba(232, 163, 61, .16); }
.env-badge.danger i { background: var(--red); box-shadow: 0 0 0 3px rgba(229, 72, 77, .16); }

.nav-group { margin: 14px 0 4px; padding: 0 12px; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.nav-group:first-of-type { margin-top: 4px; }
.nav-link { display: flex; align-items: center; gap: 10px; }
.nav-link .nav-icon { stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.nav-icon { width: 16px; height: 16px; flex: 0 0 16px; }

.sidebar-foot { font-size: 11px; line-height: 1.5; padding-top: 12px; border-top: 1px solid var(--border); text-align: left; }
.sb-scope-label { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); display: block; margin-bottom: 2px; }
.sb-version { display: block; color: var(--muted); margin-top: 2px; }

.topbar { gap: 16px; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); min-width: 0; flex: 1; }
.crumbs a { color: var(--accent-2); }
.crumbs a:hover { text-decoration: underline; }
.crumbs .sep { opacity: .6; }
.crumbs .here { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.top-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border); background: var(--panel-2); color: var(--muted); cursor: pointer; padding: 0; }
.icon-btn:hover { color: var(--text); filter: brightness(1.12); text-decoration: none; }
.icon-btn svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:focus-visible, .btn:focus-visible, .nav-link:focus-visible, .tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.bell-wrap { position: relative; }
.bell-badge { position: absolute; top: -5px; right: -5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--panel); }

.whoami { border-left: 1px solid var(--border); padding-left: 14px; }
.whoami .user-name { font-weight: 600; color: var(--text); }

@media (max-width: 900px) {
    .app-shell { grid-template-columns: 210px 1fr; }
    .content { padding: 18px 16px 40px; }
    .topbar { padding: 12px 16px; }
}

/* ---------- status dot for health strips (reference) ---------- */
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.status-dot.ok { background: var(--green); }
.status-dot.warn { background: var(--amber); }
.status-dot.bad { background: var(--red); }
.status-dot.na { background: var(--muted); }

/* ---------- global dashboard (reference UI-2) ---------- */

.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tag-live { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .08em; font-family: var(--font-mono); color: #34d399; background: var(--c-aswaq-soft); border: 1px solid rgba(16, 185, 129, .25); }
.page-intro { color: var(--muted); font-size: 12px; margin: 4px 0 0; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.kpi-card { display: flex; flex-direction: column; gap: 2px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 16px 14px; box-shadow: var(--shadow); }
.kpi-card.attention { border-color: rgba(229, 72, 77, .4); }
a.kpi-card { color: var(--text); text-decoration: none; transition: border-color .15s ease; }
a.kpi-card:hover { border-color: var(--c-aswaq); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.kpi-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.kpi-icon { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 7px; background: var(--panel-2); color: var(--muted); }
.kpi-icon svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.kpi-card:hover .kpi-icon { color: var(--c-aswaq); }
.kpi-value-row { display: flex; align-items: baseline; gap: 8px; }
.kpi-value { font-size: 26px; font-weight: 700; font-family: var(--font-mono); color: var(--text); }
.kpi-value.negative { color: var(--red); }
.kpi-trend { font-size: 11px; font-weight: 600; color: var(--muted); }
.kpi-trend.ok { color: var(--green); }
.kpi-trend.warn { color: var(--amber); }
.kpi-trend.bad { color: var(--red); }
.kpi-sub { font-size: 11px; color: var(--muted); margin-top: 3px; }

.matrix-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.matrix-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.matrix-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.matrix-title { font-size: 13px; font-weight: 600; color: var(--text); }
.matrix-meta { font-size: 10px; font-family: var(--font-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.stack-bar { display: flex; height: 7px; width: 100%; border-radius: 999px; overflow: hidden; background: var(--panel-2); margin-bottom: 12px; }
.stack-seg.ok { background: var(--green); }
.stack-seg.warn { background: var(--amber); }
.stack-seg.bad { background: var(--red); }
.stack-seg.zid { background: var(--c-zid); }
.stack-seg.na { background: var(--muted); }
.matrix-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 6px 10px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 11px; font-family: var(--font-mono); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.legend-item strong { font-weight: 600; color: var(--text); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
.legend-dot.ok { background: var(--green); }
.legend-dot.warn { background: var(--amber); }
.legend-dot.bad { background: var(--red); }
.legend-dot.zid { background: var(--c-zid); }
.legend-dot.na { background: var(--muted); }

.split-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 1100px) { .split-grid { grid-template-columns: 2fr 1fr; } }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.panel-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--text); margin: 0; }
.panel-title.attention { color: var(--red); }
.panel-badge { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: rgba(229, 72, 77, .12); color: var(--red); border: 1px solid rgba(229, 72, 77, .3); }
.panel-more { font-size: 12px; color: var(--accent-2); white-space: nowrap; }
.panel-foot { padding-top: 12px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.panel-foot .mono { font-family: var(--font-mono); }

.sev-badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.sev-critical { background: rgba(229, 72, 77, .14); color: var(--red); border: 1px solid rgba(229, 72, 77, .35); }
.sev-error { background: rgba(229, 72, 77, .10); color: var(--red); border: 1px solid rgba(229, 72, 77, .25); }
.sev-warning { background: rgba(232, 163, 61, .14); color: var(--amber); border: 1px solid rgba(232, 163, 61, .35); }
.sev-info { background: var(--c-zid-soft); color: var(--c-zid); border: 1px solid rgba(139, 92, 246, .3); }

.feed { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.feed-item { display: flex; gap: 10px; align-items: flex-start; }
.feed-icon { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 999px; flex: 0 0 26px; margin-top: 1px; }
.feed-icon svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.feed-icon.connection { background: rgba(16, 185, 129, .14); color: var(--green); border: 1px solid rgba(16, 185, 129, .3); }
.feed-icon.license { background: rgba(139, 92, 246, .14); color: var(--c-zid); border: 1px solid rgba(139, 92, 246, .3); }
.feed-icon.audit { background: var(--panel-2); color: var(--muted); border: 1px solid var(--border); }
.feed-icon.error { background: rgba(229, 72, 77, .12); color: var(--red); border: 1px solid rgba(229, 72, 77, .3); }
.feed-body { flex: 1; min-width: 0; }
.feed-title { font-size: 12.5px; font-weight: 600; color: var(--text); }
.feed-title a { color: var(--text); }
.feed-title a:hover { color: var(--c-aswaq); }
.feed-detail { font-size: 11px; color: var(--muted); margin-top: 1px; }
.feed-meta { font-size: 10px; color: var(--muted); font-family: var(--font-mono); margin-top: 2px; }

.empty-note { padding: 18px 4px; color: var(--muted); font-size: 12.5px; }

.time-ago { white-space: nowrap; }

.page-head-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; }
.right { text-align: right; }

/* ---------- UI-3: Customers workspace ---------- */

.ws-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 18px; background: linear-gradient(120deg, var(--panel), var(--panel-2)); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 12px; }
.ws-head h2 { margin: 0; font-size: 20px; }
.ws-head .page-intro { display: block; margin-top: 2px; }

.health-strip { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.strip-item { flex: 1 1 150px; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.strip-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.strip-value { font-size: 12.5px; font-weight: 600; font-family: var(--font-mono); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip-value.ok { color: var(--green); }
.strip-value.warn { color: var(--amber); }
.strip-value.bad { color: var(--red); }
.strip-value.na { color: var(--muted); }

.attention-banner { display: flex; gap: 10px; align-items: baseline; padding: 10px 14px; border-radius: var(--radius); background: rgba(229, 72, 77, .10); color: var(--red); border: 1px solid rgba(229, 72, 77, .35); margin-bottom: 12px; font-size: 12.5px; }

.menu { position: relative; display: inline-block; }
.menu summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover { text-decoration: none; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 200px; background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.menu-panel a { display: block; padding: 7px 10px; border-radius: 7px; color: var(--text); font-size: 12.5px; }
.menu-panel a:hover { background: var(--panel); color: var(--c-aswaq); text-decoration: none; }

.pager { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 16px; }
.pager-info { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }
.pager a, .pager .btn-ghost[aria-disabled="true"] { }
.pager .btn-ghost[aria-disabled="true"] { opacity: .45; pointer-events: none; }

.field-error { display: block; font-size: 11px; color: var(--red); margin-top: 3px; }
.validation-summary { padding: 10px 14px; border-radius: var(--radius); background: rgba(229, 72, 77, .10); border: 1px solid rgba(229, 72, 77, .35); color: var(--red); font-size: 12.5px; margin-bottom: 12px; }
.validation-summary:empty { display: none; }

.btn-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.form-card { max-width: 760px; }

/* ---------- UI-4: Customer 360 workspace tabs ---------- */

.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 18px; }
.summary-card { display: flex; flex-direction: column; gap: 10px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.summary-card h4 { margin: 0; font-size: 13px; font-weight: 700; }
.summary-card .dl { font-size: 12.5px; }
.summary-card .dl dt { color: var(--muted); font-weight: 500; margin-top: 6px; }
.summary-card .dl dd { margin-top: 1px; }
.summary-card-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 8px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin: 14px 0; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius); }
.tile-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.tile-value { font-size: 22px; font-weight: 700; font-family: var(--font-mono); color: var(--text); word-break: break-word; }
.tile-value .pill { font-size: 11px; vertical-align: middle; }
.tile-value.ok { color: var(--green); }
.tile-value.warn { color: var(--amber); }
.tile-value.bad { color: var(--red); }
.tile-sub { font-size: 11.5px; color: var(--muted); word-break: break-word; }

.progress { height: 8px; margin: 2px 0 4px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--border); overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--c-aswaq), var(--green)); border-radius: 999px; min-width: 2px; }

.ledger-note { margin: 0 0 4px; }

.empty-ok { padding: 22px 6px; color: var(--muted); }
.empty-ok h4 { margin: 0 0 4px; font-size: 14px; color: var(--green); }
.empty-ok p { margin: 0; font-size: 12.5px; }

.btn[disabled], .btn.disabled { opacity: .5; cursor: not-allowed; filter: none; }

/* ---------- UI-5: global observability (Error Center / Audit / ZID fleet) ---------- */

.overflow-x-auto { overflow-x: auto; }
.summary-card .tile-value { font-size: 30px; }
.summary-card .pill { align-self: flex-start; }
td .break-safe { word-break: break-word; }
table .fleet-status { white-space: nowrap; }

/* ---------- UI-7: one-time license key reveal, journey steps, language switcher ---------- */

.license-reveal { border-color: var(--c-aswaq); }
.license-key-row { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; margin-top: 6px; }
.license-key-row .license-key { flex: 1 1 320px; margin: 0; }

/* Activation keys are latin: keep them LTR and left-aligned even inside an RTL document. */
.license-key,
.license-key code,
code.license-key { direction: ltr; text-align: left; unicode-bidi: isolate; }

.warning {
    margin: 12px 0 0;
    padding: 10px 14px;
    border-radius: var(--radius);
    border: 1px solid rgba(229, 72, 77, .40);
    background: rgba(229, 72, 77, .10);
    color: var(--red);
    font-size: 13px;
}

.detail-list { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 10px 0 0; }
.detail-list dt { color: var(--muted); font-size: 12.5px; }
.detail-list dd { margin: 0; font-size: 13.5px; word-break: break-word; }

.journey { margin: 10px 0 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 6px; }
.journey li { font-size: 13px; }

/* Language switcher ------------------------------------------------------ */

.lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; background: var(--panel-1); }
.lang-opt {
    padding: 5px 12px;
    font-size: 12px;
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
    border-inline-end: 1px solid var(--border);
}
.lang-opt:last-child { border-inline-end: 0; }
.lang-opt:hover { background: var(--panel-2); color: var(--text); }
.lang-opt.current { background: var(--c-aswaq); color: #fff; font-weight: 600; cursor: default; }

/* ---------- UI-8: right-to-left (Arabic) ---------- */

[dir="rtl"] .app-shell { direction: rtl; }

/* Grid auto-placement follows the inline direction, so the sidebar column moves to the right
   edge on its own - no explicit grid-column juggling needed. Its divider flips with the flow. */
[dir="rtl"] .sidebar { border-inline-start: 1px solid var(--border); border-inline-end: 0; }
[dir="rtl"] .main { min-width: 0; }

/* Dots, bars and other directional fills read left-to-right only by convention. */
[dir="rtl"] .progress-fill { background: linear-gradient(270deg, var(--c-aswaq), var(--green)); }

[dir="rtl"] .detail-list { grid-template-columns: 1fr; gap: 2px; }
[dir="rtl"] .detail-list dt { margin-top: 8px; }
[dir="rtl"] .detail-list dt:first-of-type { margin-top: 0; }

[dir="rtl"] .nav-icon, [dir="rtl"] .icon-btn svg, [dir="rtl"] .btn svg { transform: scaleX(-1); }

[dir="rtl"] table { text-align: right; }
[dir="rtl"] th, [dir="rtl"] td { text-align: right; }

/* Numeric columns and machine identifiers stay LTR so digits and hex read correctly. */
[dir="rtl"] .tile-value,
[dir="rtl"] .metric-value,
[dir="rtl"] code,
[dir="rtl"] pre,
[dir="rtl"] .pill,
[dir="rtl"] .break-safe { direction: ltr; text-align: left; unicode-bidi: isolate; }

/* Inline typed-confirmation panel ---------------------------------------- */

.confirm-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    padding: 12px 14px;
    border: 1px solid rgba(229, 72, 77, .40);
    border-radius: var(--radius);
    background: rgba(229, 72, 77, .08);
}
.confirm-panel[hidden] { display: none; }
.confirm-hint { margin: 0; font-size: 12.5px; color: var(--text); }
.confirm-panel input {
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--panel-1);
    color: var(--text);
    font-family: var(--font-mono);
    letter-spacing: 1px;
    max-width: 260px;
}
.btn.copied { border-color: var(--green); color: var(--green); }

/* ---------- Brand Platform Footer & Auth Pillars ---------- */
.auth-pillars {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
    justify-content: center;
}
.auth-pillar {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(139, 92, 246, 0.12);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.25);
    letter-spacing: 0.3px;
}
.auth-footer {
    margin-top: 28px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 11.5px;
    color: var(--muted);
    text-align: center;
}
.auth-footer-copy { margin-bottom: 4px; }
.auth-footer-meta { display: flex; justify-content: center; gap: 8px; align-items: center; }
.auth-footer-link { color: var(--muted); text-decoration: none; }
.auth-footer-link:hover { color: var(--text); }

.app-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    margin-top: 40px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--muted);
    background: var(--panel);
}
.app-footer .footer-left { display: flex; align-items: center; gap: 8px; }
.app-footer .footer-right { display: flex; align-items: center; gap: 8px; }
.app-footer .footer-link { color: var(--muted); text-decoration: none; }
.app-footer .footer-link:hover { color: var(--text); }
[dir="rtl"] .app-footer { direction: rtl; }

