/* ==========================================================================
   GO-RECHARGE admin panel (workstream B).
   Builds on the tokens in app.css (blue, clay shadows, Fredoka/Nunito) but is
   denser and data-first: tables, filters, KPI cards, status chips.
   Every class is prefixed "a-" (and base rules are scoped to .adm) because this
   file is also linked from the public layout: nothing here touches the shop.
   The admin is English-only and always LTR.
   ========================================================================== */

.adm {
    --a-side-w: 252px;
    --a-top-h: 60px;
    --a-side-bg: #0B2D6B;
    --a-side-bg-2: #0A2558;
    --a-side-ink: #C9D8F5;
    --a-card-r: 18px;
    --a-line: #E3EAF6;
    --a-soft: #F6F9FE;
    --a-shadow: 0 10px 24px -18px rgba(16, 64, 150, .45), 0 1px 0 rgba(16, 64, 150, .04);
    --a-ok: #0E7C55;   --a-ok-bg: #E3F6EE;
    --a-info: #0F5FCC; --a-info-bg: #E6F0FF;
    --a-warn: #8A5200; --a-warn-bg: #FFF1CC;
    --a-bad: #B4280A;  --a-bad-bg: #FFE9E3;
    --a-muted: #55657F; --a-muted-bg: #EEF2F8;

    background: #EEF3FB;
    font-size: 15px;
    line-height: 1.5;
}

.adm h1, .adm h2, .adm h3, .adm h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: .1px; margin: 0; }
.adm table { border-collapse: collapse; }
.adm code, .adm .a-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86em; }
.adm textarea, .adm input, .adm select { font: inherit; }
.adm a { text-decoration: none; }
.adm a:hover { text-decoration: underline; }

/* ---------- Shell ---------- */

.a-shell { display: flex; min-height: 100vh; min-height: 100dvh; }

.a-side {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    z-index: 60;
    width: var(--a-side-w);
    max-width: 86vw;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--a-side-bg), var(--a-side-bg-2));
    color: var(--a-side-ink);
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: 0 0 40px rgba(5, 20, 60, .35);
}
.a-side.is-open { transform: translateX(0); }

.a-side__head {
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--a-top-h);
    padding: 0 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    flex-shrink: 0;
}
.a-side__brand { display: flex; align-items: center; gap: 10px; color: #fff; font: 600 1.05rem/1 var(--font-display); }
.a-side__brand:hover { text-decoration: none; }
.a-side__brand svg { flex-shrink: 0; }
.a-side__badge {
    margin-inline-start: auto;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
}
.a-side__close {
    display: grid;
    place-items: center;
    width: 36px; height: 36px;
    margin-inline-start: 4px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    cursor: pointer;
}

.a-nav { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 10px 16px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.a-nav__group + .a-nav__group { margin-top: 12px; }
.a-nav__label {
    padding: 6px 10px 4px;
    color: rgba(201, 216, 245, .6);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .9px;
    text-transform: uppercase;
}
.a-nav__item {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 40px;
    padding: 8px 10px;
    border-radius: 12px;
    color: var(--a-side-ink);
    font-weight: 600;
    font-size: .93rem;
    transition: background .15s, color .15s;
}
.a-nav__item:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.a-nav__item.is-active {
    background: #fff;
    color: var(--blue-block);
    box-shadow: 0 8px 16px -10px rgba(0, 0, 0, .5), inset 0 -3px 0 rgba(16, 64, 150, .08);
}
.a-nav__item svg { flex-shrink: 0; opacity: .9; }
.a-nav__badge {
    margin-inline-start: auto;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: #F59E0B;
    color: #fff;
    font-size: .72rem;
    font-weight: 800;
}
.a-nav__badge.is-bad { background: #EF4444; }
.a-nav__item.is-active .a-nav__badge { box-shadow: none; }

.a-side__foot { padding: 10px; border-top: 1px solid rgba(255, 255, 255, .08); flex-shrink: 0; }
.a-side__foot form { margin: 0; }
.a-side__foot .a-nav__item { width: 100%; border: 0; background: transparent; cursor: pointer; text-align: start; font: inherit; font-weight: 600; }

.a-scrim {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(8, 24, 60, .45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
}
.a-scrim.is-open { opacity: 1; pointer-events: auto; }

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

.a-top {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--a-top-h);
    padding: 0 12px;
    background: rgba(255, 255, 255, .82);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
    backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid var(--a-line);
}
.a-top__menu, .a-iconbtn {
    position: relative;
    display: grid;
    place-items: center;
    width: 40px; height: 40px;
    flex-shrink: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
}
.a-top__menu:hover, .a-iconbtn:hover { background: var(--blue-tint); }
.a-iconbtn.is-on { color: var(--blue); }
.a-iconbtn__dot {
    position: absolute;
    top: 3px; inset-inline-end: 2px;
    min-width: 18px; height: 18px;
    padding: 0 5px;
    display: grid; place-items: center;
    border-radius: 999px;
    background: #EF4444;
    color: #fff;
    font-size: .66rem;
    font-weight: 800;
}
.a-top__title { min-width: 0; flex: 1; font: 600 1.12rem/1.2 var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-top__user { display: flex; align-items: center; gap: 8px; padding: 4px; border-radius: 999px; color: var(--ink); font-weight: 600; font-size: .9rem; }
.a-top__user:hover { background: var(--blue-tint); text-decoration: none; }
.a-top__user span:last-child { display: none; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-inline-end: 8px; }
.a-avatar {
    display: grid;
    place-items: center;
    width: 32px; height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--blue-tint);
    color: var(--blue-block);
    font-weight: 800;
    font-size: .85rem;
}

.a-content { width: 100%; max-width: 1440px; margin: 0 auto; padding: 16px 16px 48px; }

@media (min-width: 640px) {
    .a-top { padding: 0 20px; }
    .a-top__user span:last-child { display: inline; }
    .a-content { padding: 22px 22px 56px; }
}

@media (min-width: 1100px) {
    .a-side { position: sticky; top: 0; height: 100vh; height: 100dvh; transform: none; box-shadow: none; flex-shrink: 0; }
    .a-side__close, .a-top__menu, .a-scrim { display: none; }
    .a-top { padding: 0 28px; }
    .a-content { padding: 26px 28px 64px; }
}

/* ---------- Page head ---------- */

.a-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.a-head h1 { font-size: 1.45rem; line-height: 1.2; }
.a-head p { color: var(--ink-2); font-size: .92rem; margin-top: 3px; }
.a-head__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.a-crumb { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 6px; color: var(--ink-2); font-size: .85rem; font-weight: 700; }

/* ---------- Cards ---------- */

.a-card {
    background: var(--surface);
    border: 1px solid var(--a-line);
    border-radius: var(--a-card-r);
    box-shadow: var(--a-shadow);
    min-width: 0;
}
.a-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--a-line);
}
.a-card__head h2 { font-size: 1.02rem; }
.a-card__head p { color: var(--ink-2); font-size: .85rem; }
.a-card__body { padding: 16px; }
.a-card__foot { padding: 12px 16px; border-top: 1px solid var(--a-line); }
.a-card--flush .a-card__body { padding: 0; }
.a-card--tint { background: var(--a-soft); }
.a-card--warn { border-color: #F6D58A; background: #FFFBEF; }
.a-card--bad { border-color: #F6B8A8; background: #FFF6F3; }
.a-card--ok { border-color: #A9E2C9; background: #F3FCF8; }

.a-grid { display: grid; gap: 14px; }
.a-grid + .a-grid, .a-card + .a-card, .a-grid + .a-card, .a-card + .a-grid, .a-stack > * + * { margin-top: 14px; }
.a-grid--2, .a-grid--3, .a-grid--4, .a-grid--main { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) {
    .a-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .a-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .a-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
    .a-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .a-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .a-grid--main { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
}

/* ---------- KPI ---------- */

.a-kpis { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .a-kpis { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; } }
.a-kpi {
    position: relative;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--a-line);
    border-radius: var(--a-card-r);
    box-shadow: var(--a-shadow);
    min-width: 0;
}
.a-kpi__label { color: var(--ink-2); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.a-kpi__value { margin-top: 4px; font: 600 1.45rem/1.15 var(--font-display); color: var(--ink); overflow-wrap: anywhere; }
.a-kpi__sub { margin-top: 4px; color: var(--ink-2); font-size: .8rem; }
.a-kpi__delta { font-weight: 800; }
.a-kpi__delta.is-up { color: var(--a-ok); }
.a-kpi__delta.is-down { color: var(--a-bad); }
.a-kpi--blue { background: linear-gradient(140deg, #1677F2, #0F5FCC); border-color: transparent; color: #fff; }
.a-kpi--blue .a-kpi__label, .a-kpi--blue .a-kpi__sub { color: rgba(255, 255, 255, .82); }
.a-kpi--blue .a-kpi__value { color: #fff; }
.a-kpi--warn { background: #FFF8E6; border-color: #F6D58A; }
.a-kpi--bad { background: #FFF1EC; border-color: #F6B8A8; }
.a-kpi--ok { background: #EFFAF5; border-color: #A9E2C9; }
.a-kpi a.a-kpi__link { position: absolute; inset: 0; border-radius: inherit; }

/* ---------- Chips ---------- */

.a-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 800;
    line-height: 1.6;
    white-space: nowrap;
    background: var(--a-muted-bg);
    color: var(--a-muted);
}
.a-chip--ok { background: var(--a-ok-bg); color: var(--a-ok); }
.a-chip--info { background: var(--a-info-bg); color: var(--a-info); }
.a-chip--warn { background: var(--a-warn-bg); color: var(--a-warn); }
.a-chip--bad { background: var(--a-bad-bg); color: var(--a-bad); }
.a-chip--muted { background: var(--a-muted-bg); color: var(--a-muted); }
.a-chip--violet { background: #EEE9FF; color: #5B3FD9; }
.a-chip--outline { background: transparent; box-shadow: inset 0 0 0 1px currentColor; }
.a-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }

.a-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--a-muted); }
.a-dot--ok { background: #12A36F; } .a-dot--warn { background: #F0A30A; } .a-dot--bad { background: #E5482A; } .a-dot--info { background: var(--blue); }

/* ---------- Buttons ---------- */

.a-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    padding: 8px 16px;
    border: 0;
    border-radius: 12px;
    background: var(--blue);
    color: #fff;
    font: 700 .9rem/1.2 var(--font-ui);
    text-align: center;
    cursor: pointer;
    box-shadow: 0 8px 14px -10px rgba(16, 96, 214, .9), inset 0 -3px 0 rgba(0, 0, 0, .12);
    transition: background .15s, transform .1s;
    white-space: nowrap;
}
.a-btn:hover { background: var(--blue-press); text-decoration: none; color: #fff; }
.a-btn:active { transform: translateY(1px); }
.a-btn:disabled, .a-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.a-btn--sm { min-height: 32px; padding: 5px 11px; font-size: .82rem; border-radius: 10px; }
.a-btn--xs { min-height: 28px; padding: 3px 9px; font-size: .78rem; border-radius: 9px; }
.a-btn--ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--a-line); }
.a-btn--ghost:hover { background: var(--blue-tint); color: var(--blue-block); }
.a-btn--soft { background: var(--blue-tint); color: var(--blue-block); box-shadow: none; }
.a-btn--soft:hover { background: #D8E8FF; color: var(--blue-block); }
.a-btn--danger { background: #D9381E; box-shadow: 0 8px 14px -10px rgba(200, 50, 20, .9), inset 0 -3px 0 rgba(0, 0, 0, .12); }
.a-btn--danger:hover { background: #B92D16; }
.a-btn--danger-ghost { background: var(--surface); color: #B4280A; box-shadow: inset 0 0 0 1.5px #F2C4B8; }
.a-btn--danger-ghost:hover { background: #FFF1EC; color: #B4280A; }
.a-btn--ok { background: #0E9665; box-shadow: 0 8px 14px -10px rgba(14, 150, 101, .9), inset 0 -3px 0 rgba(0, 0, 0, .12); }
.a-btn--ok:hover { background: #0B7C54; }
.a-btn--block { width: 100%; }
.a-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.a-btns form { margin: 0; }
.a-link { color: var(--blue); font-weight: 700; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-weight: 700; }
.a-link:hover { text-decoration: underline; }
.a-link--bad { color: #B4280A; }

/* ---------- Forms ---------- */

.a-form { display: grid; gap: 14px; }
.a-form--2 { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .a-form--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .a-form--2 .a-span { grid-column: 1 / -1; } }
.a-field { display: grid; gap: 5px; min-width: 0; }
.a-field > label, .a-label { font-weight: 700; font-size: .86rem; color: var(--ink); }
.a-hint { color: var(--ink-2); font-size: .8rem; }
.a-error { color: var(--a-bad); font-size: .82rem; font-weight: 700; }
.a-input, .a-select, .a-textarea {
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    border: 1.5px solid #D6E1F2;
    border-radius: 11px;
    background: #fff;
    color: var(--ink);
    font-size: .92rem;
    transition: border-color .15s, box-shadow .15s;
}
.a-textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.a-input:focus, .a-select:focus, .a-textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(22, 119, 242, .18); }
.a-input--sm, .a-select--sm { min-height: 32px; padding: 4px 9px; font-size: .84rem; border-radius: 9px; }
.a-input[readonly] { background: var(--a-soft); }
.a-input.is-invalid, .a-textarea.is-invalid, .a-select.is-invalid { border-color: #E5482A; }
.a-secret { position: relative; }
.a-secret .a-chip { position: absolute; inset-inline-end: 8px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.a-secret .a-input { padding-inline-end: 72px; }

.a-check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-weight: 600; font-size: .9rem; }
.a-check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--blue); flex-shrink: 0; }

.a-switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border: 1px solid var(--a-line); border-radius: 14px; background: var(--a-soft); cursor: pointer; }
.a-switch__text { min-width: 0; }
.a-switch__text strong { display: block; font-size: .92rem; }
.a-switch__text span { color: var(--ink-2); font-size: .8rem; }
.a-switch input { appearance: none; -webkit-appearance: none; position: relative; width: 46px; height: 26px; margin: 0; flex-shrink: 0; border-radius: 999px; background: #C9D4E5; cursor: pointer; transition: background .15s; }
.a-switch input::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); transition: transform .18s; }
.a-switch input:checked { background: var(--blue); }
.a-switch input:checked::after { transform: translateX(20px); }
.a-switch input:focus-visible { box-shadow: var(--focus); }

.a-fieldset { border: 0; padding: 0; margin: 0; }
.a-section-title { display: flex; align-items: center; gap: 8px; font: 600 1rem/1.3 var(--font-display); margin-bottom: 4px; }

/* ---------- Toolbar / tabs ---------- */

.a-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--a-line); }
.a-toolbar form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; flex: 1 1 260px; justify-content: flex-end; }
.a-toolbar .a-input { flex: 1 1 200px; min-width: 0; max-width: 360px; }
.a-tabs { display: flex; gap: 4px; overflow-x: auto; max-width: 100%; padding-bottom: 2px; scrollbar-width: none; }
.a-tabs::-webkit-scrollbar { display: none; }
.a-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 10px;
    background: var(--a-soft);
    color: var(--ink-2);
    font-size: .84rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: inset 0 0 0 1px var(--a-line);
}
.a-tab:hover { color: var(--blue-block); text-decoration: none; }
.a-tab.is-active { background: var(--blue); color: #fff; box-shadow: none; }
.a-tab__count { padding: 0 6px; border-radius: 999px; background: rgba(0, 0, 0, .07); font-size: .72rem; }
.a-tab.is-active .a-tab__count { background: rgba(255, 255, 255, .22); }

/* ---------- Tables ---------- */

.a-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.a-table { width: 100%; font-size: .87rem; }
.a-table th {
    padding: 9px 12px;
    background: var(--a-soft);
    color: var(--ink-2);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .5px;
    text-align: start;
    text-transform: uppercase;
    white-space: nowrap;
    border-bottom: 1px solid var(--a-line);
}
.a-table td { padding: 10px 12px; border-bottom: 1px solid #EEF2F8; vertical-align: top; }
.a-table tbody tr:last-child td { border-bottom: 0; }
.a-table tbody tr:hover td { background: #FAFCFF; }
.a-table .is-num, .a-table th.is-num { text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
.a-table .is-nowrap { white-space: nowrap; }
.a-table .is-actions { text-align: end; white-space: nowrap; }
.a-table .is-empty { padding: 36px 12px; text-align: center; color: var(--ink-2); }
.a-table tr.is-flag td { background: #FFFBEF; }
.a-table tr.is-bad td { background: #FFF6F3; }
.a-table--compact td { padding: 7px 10px; }
.a-cell-main { font-weight: 700; color: var(--ink); }
.a-cell-sub { display: block; color: var(--ink-2); font-size: .78rem; margin-top: 1px; }
.a-trunc { display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

/* ---------- Lists, definition rows ---------- */

.a-dl { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; margin: 0; }
.a-dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--a-line); }
.a-dl > div:last-child { border-bottom: 0; }
.a-dl dt { color: var(--ink-2); font-size: .85rem; font-weight: 600; flex-shrink: 0; }
.a-dl dd { margin: 0; text-align: end; font-weight: 700; font-size: .88rem; min-width: 0; overflow-wrap: anywhere; }

.a-list { list-style: none; margin: 0; padding: 0; }
.a-list > li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; border-bottom: 1px solid #EEF2F8; }
.a-list > li:last-child { border-bottom: 0; }

/* ---------- Flash / notices ---------- */

.a-flash { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; margin-bottom: 14px; border-radius: 14px; font-weight: 600; font-size: .9rem; border: 1px solid; }
.a-flash svg { flex-shrink: 0; margin-top: 1px; }
.a-flash--ok { background: var(--a-ok-bg); border-color: #A9E2C9; color: #075C3E; }
.a-flash--bad { background: var(--a-bad-bg); border-color: #F6B8A8; color: #8E1F07; }
.a-flash--warn { background: var(--a-warn-bg); border-color: #F6D58A; color: #6E4100; }
.a-flash--info { background: var(--a-info-bg); border-color: #BCD5FB; color: #0A4AA3; }
.a-flash ul { margin: 4px 0 0; padding-inline-start: 18px; }

.a-empty { padding: 34px 16px; text-align: center; color: var(--ink-2); font-size: .92rem; }
.a-muted { color: var(--ink-2); }
.a-small { font-size: .8rem; }
.a-strong { font-weight: 800; }
.a-ok { color: var(--a-ok); } .a-bad { color: var(--a-bad); } .a-warn { color: var(--a-warn); }
.a-nowrap { white-space: nowrap; }
.a-right { text-align: end; }
.a-mt { margin-top: 14px; } .a-mt-sm { margin-top: 8px; } .a-mb { margin-bottom: 14px; }
.a-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.a-row--between { justify-content: space-between; }
.a-spacer { flex: 1; }
.a-divider { height: 1px; background: var(--a-line); margin: 14px 0; border: 0; }

.a-code {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 9px;
    background: #0E1B33;
    color: #7CF0C0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .84rem;
    user-select: all;
    white-space: nowrap;
}
.a-pre { margin: 0; padding: 12px; max-height: 360px; overflow: auto; border-radius: 12px; background: #0E1B33; color: #D6E4FF; font-size: .78rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }

/* ---------- Pagination ---------- */

.a-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--a-line); font-size: .85rem; color: var(--ink-2); }
.a-pager__links { display: flex; flex-wrap: wrap; gap: 4px; }
.a-pager__links a, .a-pager__links span { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 9px; border-radius: 10px; background: var(--a-soft); color: var(--ink); font-weight: 700; box-shadow: inset 0 0 0 1px var(--a-line); }
.a-pager__links a:hover { background: var(--blue-tint); text-decoration: none; }
.a-pager__links .is-active { background: var(--blue); color: #fff; box-shadow: none; }
.a-pager__links .is-disabled { opacity: .45; }

/* ---------- Charts (server-rendered, no library) ---------- */

.a-bars { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding-top: 8px; }
.a-bars__col { position: relative; flex: 1 1 0; min-width: 6px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.a-bars__bar { display: block; width: 100%; min-height: 2px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #4D9BFF, #1677F2); transition: filter .15s; }
.a-bars__col:hover .a-bars__bar { filter: brightness(1.12); }
.a-bars__col.is-zero .a-bars__bar { background: #DCE6F5; }
.a-bars__col.is-today .a-bars__bar { background: linear-gradient(180deg, #2BD39A, #0E9665); }
.a-bars__tip {
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    z-index: 3;
    transform: translateX(-50%);
    padding: 4px 8px;
    border-radius: 8px;
    background: var(--ink);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .12s;
}
.a-bars__col:hover .a-bars__tip, .a-bars__col:focus .a-bars__tip { opacity: 1; }
.a-bars__axis { display: flex; justify-content: space-between; margin-top: 6px; color: var(--ink-2); font-size: .72rem; font-weight: 700; }
.a-chart-scroll { overflow-x: auto; padding-top: 30px; margin-top: -22px; }
.a-chart-scroll > .a-bars, .a-chart-scroll > .a-bars__axis { min-width: 520px; }

.a-meter { height: 10px; border-radius: 999px; background: #E6EDF8; overflow: hidden; }
.a-meter span { display: block; height: 100%; border-radius: inherit; background: var(--blue); }
.a-meter--ok span { background: #12A36F; } .a-meter--warn span { background: #F0A30A; } .a-meter--bad span { background: #E5482A; }
.a-split { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: #E6EDF8; }
.a-split span { display: block; height: 100%; }
.a-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: .8rem; color: var(--ink-2); font-weight: 700; }
.a-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; }

.a-hbars { display: grid; gap: 9px; }
.a-hbar { display: grid; grid-template-columns: minmax(80px, 30%) minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: .85rem; }
.a-hbar__label { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-hbar__value { font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- Health list ---------- */

.a-health { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .a-health { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1300px) { .a-health { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.a-health__item { display: flex; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--a-soft); border: 1px solid var(--a-line); font-size: .84rem; }
.a-health__item strong { display: block; font-size: .88rem; }
.a-health__item p { color: var(--ink-2); overflow-wrap: anywhere; }
.a-health__item .a-dot { margin-top: 6px; flex-shrink: 0; }
.a-health__item.is-error { background: #FFF6F3; border-color: #F6B8A8; }
.a-health__item.is-warn { background: #FFFBEF; border-color: #F6D58A; }

/* ---------- Modal-ish confirm panel (details) ---------- */

.a-danger-zone { border: 1.5px dashed #F2C4B8; border-radius: 14px; padding: 12px 14px; background: #FFF9F7; }
.a-danger-zone summary { cursor: pointer; font-weight: 800; color: #B4280A; list-style: none; }
.a-danger-zone summary::-webkit-details-marker { display: none; }
.a-danger-zone[open] summary { margin-bottom: 10px; }
.a-disclosure summary { cursor: pointer; font-weight: 800; color: var(--blue-block); list-style: none; }
.a-disclosure summary::-webkit-details-marker { display: none; }
.a-disclosure[open] summary { margin-bottom: 10px; }

/* ---------- Timeline / threads ---------- */

.a-timeline { list-style: none; margin: 0; padding: 0; }
.a-timeline li { position: relative; padding: 0 0 14px 22px; font-size: .86rem; }
.a-timeline li::before { content: ""; position: absolute; left: 5px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.a-timeline li::after { content: ""; position: absolute; left: 8.5px; top: 16px; bottom: 0; width: 1px; background: var(--a-line); }
.a-timeline li:last-child::after { display: none; }
.a-timeline time { display: block; color: var(--ink-2); font-size: .76rem; font-weight: 700; }

.a-thread { display: flex; flex-direction: column; gap: 10px; padding: 14px; max-height: 560px; overflow-y: auto; background: var(--a-soft); }
.a-bubble { max-width: 82%; padding: 9px 12px; border-radius: 14px 14px 14px 4px; background: #fff; border: 1px solid var(--a-line); font-size: .9rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.a-bubble--me { align-self: flex-end; border-radius: 14px 14px 4px 14px; background: var(--blue); border-color: var(--blue); color: #fff; }
.a-bubble--sys { align-self: center; max-width: 92%; background: #FFF8E6; border-color: #F6D58A; font-size: .82rem; }
.a-bubble time { display: block; margin-top: 4px; font-size: .7rem; opacity: .7; }
.a-bubble img { display: block; max-width: 100%; max-height: 260px; margin-top: 6px; border-radius: 10px; }

/* ---------- Two-pane (inbox / chat) ---------- */

.a-pane { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 1000px) { .a-pane { grid-template-columns: 340px minmax(0, 1fr); align-items: start; } }
.a-pane__list { max-height: 70vh; overflow-y: auto; }
.a-pane__item { display: block; padding: 12px 14px; border-bottom: 1px solid #EEF2F8; color: var(--ink); }
.a-pane__item:hover { background: #FAFCFF; text-decoration: none; }
.a-pane__item.is-active { background: var(--blue-tint); box-shadow: inset 3px 0 0 var(--blue); }
.a-pane__item.is-unread .a-cell-main::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-inline-end: 6px; border-radius: 50%; background: var(--blue); vertical-align: 1px; }
.a-mailframe { width: 100%; min-height: 380px; border: 1px solid var(--a-line); border-radius: 12px; background: #fff; }

/* ---------- Misc ---------- */

.a-op { display: inline-flex; align-items: center; gap: 6px; }
.a-op img { width: 20px; height: 20px; border-radius: 6px; object-fit: contain; background: #fff; box-shadow: 0 0 0 1px var(--a-line); }
.a-cover { width: 56px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--a-soft); box-shadow: 0 0 0 1px var(--a-line); }
.a-cover--lg { width: 100%; max-width: 360px; height: auto; aspect-ratio: 16 / 9; }

.a-todo { display: flex; align-items: flex-start; gap: 10px; }
.a-todo.is-done .a-todo__body { text-decoration: line-through; color: var(--ink-2); }
.a-todo__body { flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

.a-login { display: grid; place-items: center; min-height: 70vh; }
.a-login .a-card { width: 100%; max-width: 420px; }

[data-async][aria-busy="true"] { opacity: .6; }
.a-skeleton { height: 14px; border-radius: 6px; background: linear-gradient(90deg, #EEF2F8, #F7F9FD, #EEF2F8); background-size: 200% 100%; animation: a-shimmer 1.2s infinite; }
@keyframes a-shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
    .a-side, .a-scrim, .a-bars__bar, .a-switch input::after { transition: none; }
    .a-skeleton { animation: none; }
}

@media print {
    .a-side, .a-top, .a-scrim, .a-btn, .a-btns, .a-toolbar form { display: none !important; }
    .adm { background: #fff; }
    .a-card, .a-kpi { box-shadow: none; }
}
