/* Inter (self-hosted, CSP-safe) — consistent typeface across all devices. */
/* Inter — self-hosted STATIC weights (reliable on iOS; no variable axis to mis-render). */
@font-face { font-family:'Inter'; font-style:normal; font-weight:400; font-display:swap; src:url('/assets/fonts/inter-latin-400.woff2') format('woff2'); unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family:'Inter'; font-style:normal; font-weight:400; font-display:swap; src:url('/assets/fonts/inter-ext-400.woff2') format('woff2'); unicode-range:U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family:'Inter'; font-style:normal; font-weight:500; font-display:swap; src:url('/assets/fonts/inter-latin-500.woff2') format('woff2'); unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family:'Inter'; font-style:normal; font-weight:500; font-display:swap; src:url('/assets/fonts/inter-ext-500.woff2') format('woff2'); unicode-range:U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family:'Inter'; font-style:normal; font-weight:600; font-display:swap; src:url('/assets/fonts/inter-latin-600.woff2') format('woff2'); unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family:'Inter'; font-style:normal; font-weight:600; font-display:swap; src:url('/assets/fonts/inter-ext-600.woff2') format('woff2'); unicode-range:U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family:'Inter'; font-style:normal; font-weight:700; font-display:swap; src:url('/assets/fonts/inter-latin-700.woff2') format('woff2'); unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family:'Inter'; font-style:normal; font-weight:700; font-display:swap; src:url('/assets/fonts/inter-ext-700.woff2') format('woff2'); unicode-range:U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family:'Inter'; font-style:normal; font-weight:800; font-display:swap; src:url('/assets/fonts/inter-latin-800.woff2') format('woff2'); unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family:'Inter'; font-style:normal; font-weight:800; font-display:swap; src:url('/assets/fonts/inter-ext-800.woff2') format('woff2'); unicode-range:U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family:'Inter'; font-style:normal; font-weight:900; font-display:swap; src:url('/assets/fonts/inter-latin-900.woff2') format('woff2'); unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family:'Inter'; font-style:normal; font-weight:900; font-display:swap; src:url('/assets/fonts/inter-ext-900.woff2') format('woff2'); unicode-range:U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ============================================================================
   Zebroon License Control — one dedicated stylesheet.
   Design language: modern dashboard, line/row-based, full pages (not card-walls).
   Everything is driven by tokens below; components reuse them — no one-off styles.
   ========================================================================== */

:root {
    /* Type */
    --font: 'Inter', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

    /* Neutrals (slightly cool, deliberately chosen — not pure grey) */
    --bg: #f5f7f9;
    --surface: #ffffff;
    --ink: #0f1b2d;
    --muted: #667487;
    --faint: #94a1b2;
    --line: #e5e9ef;
    --line-strong: #d3d9e2;

    /* Brand accent — Zebroon teal */
    --accent: #0d9488;
    --accent-strong: #0b7f75;
    --accent-ink: #ffffff;
    --accent-soft: #e7faf6;

    /* Semantic */
    --ok: #0f9d6a;       --ok-soft: #e7f7ef;
    --warn: #b7791f;     --warn-soft: #fbf3e2;
    --danger: #d64545;   --danger-soft: #fdecec;

    /* Sidebar */
    --sidebar: #0f1b2d;
    --sidebar-ink: #aab6c6;
    --sidebar-ink-strong: #ffffff;
    --sidebar-active: #1b2a41;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(15, 27, 45, .04), 0 1px 3px rgba(15, 27, 45, .05);
    --sidebar-w: 236px;
}

* { box-sizing: border-box; }

/* The hidden attribute must always win, even over display:flex utilities
   like .fld — otherwise toggled panels (e.g. Resend vs SMTP) stay visible. */
[hidden] { display: none !important; }

html, body {
    margin: 0;
    padding: 0;
}
/* Stop iOS Safari inflating text (font "changing" on iPhone). */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
.mono { font-family: var(--font-mono); font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.ta-right { text-align: right; }
.wrap { word-break: break-all; white-space: normal; }
.mb { margin-bottom: 12px; }

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

.app { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: var(--sidebar);
    color: var(--sidebar-ink);
    display: flex;
    flex-direction: column;
    padding: 22px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
}
.brand {
    font-weight: 800;
    font-size: 17px;
    color: var(--sidebar-ink-strong);
    letter-spacing: -.01em;
    padding: 4px 10px 20px;
    line-height: 1.25;
}
.brand span {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--faint);
    margin-top: 2px;
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-ink);
    font-weight: 500;
    transition: background .12s, color .12s;
}
.nav-link .ico { flex: none; opacity: .8; }
.nav-link:hover { background: var(--sidebar-active); color: var(--sidebar-ink-strong); }
.nav-link:hover .ico { opacity: 1; }
.nav-link.active { background: var(--sidebar-active); color: var(--sidebar-ink-strong); }
.nav-link.active .ico { opacity: 1; color: var(--accent); }
.sidebar-foot {
    margin-top: auto;
    padding: 14px 12px 4px;
    border-top: 1px solid rgba(255, 255, 255, .07);
}
.who { display: block; color: var(--sidebar-ink-strong); font-weight: 600; margin-bottom: 4px; }
a.who:hover, a.who.active { color: var(--accent); }
.foot-links { display: flex; gap: 14px; }
.foot-link { color: var(--faint); font-size: 13px; }
.foot-link:hover, .foot-link.active { color: var(--sidebar-ink-strong); }

.main { flex: 1; min-width: 0; }

.page { max-width: 1600px; margin: 0 auto; padding: 30px 40px 64px; }
.page-narrow { max-width: 760px; }

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 16px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--line);
}
.page-header h1 { font-size: 22px; font-weight: 750; letter-spacing: -.02em; margin: 0; }
.h1-key { display: flex; align-items: center; gap: 12px; font-size: 18px; }
.back-link { color: var(--muted); font-size: 13px; font-weight: 500; }
.back-link:hover { color: var(--accent); }
.header-actions { display: flex; gap: 8px; }

.section-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--faint);
    margin: 28px 0 10px;
}

/* Flash */
.flash {
    max-width: 1600px;
    margin: 18px auto -6px;
    padding: 11px 16px;
    background: var(--ok-soft);
    color: var(--ok);
    border: 1px solid #c6ead8;
    border-radius: var(--radius-sm);
    font-weight: 500;
    width: calc(100% - 80px);
}

/* --------------------------------------------------------------- stats bar */
/* One divided line — intentionally not four cards. */
.stats {
    display: flex;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.stat {
    flex: 1;
    padding: 18px 22px;
    border-left: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.stat:first-child { border-left: 0; }
.stat-num { font-size: 26px; font-weight: 750; letter-spacing: -.02em; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.tone-ok { color: var(--ok); }
.tone-warn { color: var(--warn); }
.tone-muted { color: var(--faint); }

/* ------------------------------------------------------------------ panel */
/* A single full-width surface that holds a table or a block — one per section. */
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.panel-pad { padding: 24px 26px; }

/* ------------------------------------------------------------------ table */
.table { width: 100%; border-collapse: collapse; }
.table th {
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--faint);
    padding: 14px 22px;
    border-bottom: 1px solid var(--line);
    background: #fbfcfd;
}
.table td {
    padding: 16px 22px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbfc; }
.table th.ta-right { text-align: right; }
.row-link { cursor: pointer; }
.link:hover { color: var(--accent); }
.empty { text-align: center; color: var(--faint); padding: 34px 18px; }

/* -------------------------------------------------------------- pagination */
.pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
}
.pagination-info { color: var(--muted); font-size: 13px; margin-right: auto; }
.page-num {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    background: var(--surface);
}
.page-num:hover { border-color: var(--accent); color: var(--accent); }
.page-num.is-current { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.page-nums { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.page-arrow { padding: 0; }
.page-arrow .ico { display: block; }
.page-num.is-disabled { opacity: .4; pointer-events: none; }
.page-gap { color: var(--muted); padding: 0 2px; user-select: none; }

/* --------------------------------------------------------------- searchbar */
.searchbar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    padding: 0 14px;
    height: 42px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
}
.searchbar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.searchbar-icon { color: var(--faint); flex: none; }
.searchbar input {
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 14px;
    color: var(--ink);
    height: 100%;
}
.searchbar-clear { color: var(--muted); font-size: 13px; font-weight: 600; }
.searchbar-clear:hover { color: var(--accent); }

/* ----------------------------------------------------------------- pills */
.pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.4;
}
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-danger { background: var(--danger-soft); color: var(--danger); }
.pill-muted { background: #eef1f5; color: var(--muted); }

/* ---------------------------------------------------------------- buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 16px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 650;
    cursor: pointer;
    transition: background .12s, border-color .12s, color .12s;
    white-space: nowrap;
    background: none;
}
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-warn { background: var(--warn-soft); color: var(--warn); border-color: #ecdcb8; }
.btn-warn:hover { background: #f6e9cf; }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: #f4cccc; }
.btn-danger:hover { background: #fbdcdc; }
.inline { display: inline; }
.linkbtn {
    background: none; border: 0; color: var(--accent); cursor: pointer;
    font: inherit; font-size: 12px; font-weight: 600; padding: 0 0 0 6px; text-decoration: underline;
}

/* ------------------------------------------------------------ detail list */
.detail-list { margin: 0; }
.detail-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 16px;
    padding: 12px 22px;
    border-bottom: 1px solid var(--line);
}
.detail-row:last-child { border-bottom: 0; }
.detail-row dt { color: var(--muted); font-weight: 600; margin: 0; }
.detail-row dd { margin: 0; }
.renew-form { display: inline-flex; gap: 8px; margin-left: 14px; align-items: center; vertical-align: middle; }
.renew-form input[type=date] { width: auto; height: 34px; padding: 0 10px; }
.renew-form .btn { height: 34px; }

/* support / updates entitlement */
.support-state { display: flex; align-items: center; gap: 10px; }
.support-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.support-actions form { display: inline; }
.support-sep { width: 1px; align-self: stretch; min-height: 24px; background: var(--line-strong); margin: 0 4px; }

/* key/value connect block */
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 14px; align-items: center; padding: 8px 0; }
.kv + .kv { border-top: 1px solid var(--line); }
.kv-key { color: var(--muted); font-weight: 600; }
.kv-val {
    background: #f6f8fa; border: 1px solid var(--line); border-radius: 6px;
    padding: 6px 10px; display: inline-block; color: var(--ink);
}
.kv-val-wrap { display: flex; align-items: center; gap: 8px; min-width: 0; }
/* Eye toggle for masked secrets (license key, install ID). */
.secret-toggle {
    display: inline-flex; align-items: center; justify-content: center; flex: none;
    width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px;
    background: var(--surface); color: var(--muted); cursor: pointer; transition: color .12s, border-color .12s;
}
.secret-toggle:hover { color: var(--ink); border-color: var(--line-2); }
.secret-field.is-shown .secret-toggle { color: var(--accent); border-color: var(--accent); }
.secret-field .kv-val { letter-spacing: .04em; }
.kv-val-wrap .kv-val { min-width: 0; overflow-x: auto; white-space: nowrap; }
.kv-val-wrap .kv-val.wrap { white-space: normal; word-break: break-all; }
.connect-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.connect-head p { margin: 0; }

.copy-icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--faint);
    cursor: pointer;
    transition: color .12s, background .12s;
}
.copy-icon:hover { color: var(--accent); background: var(--accent-soft); }
.copy-icon svg { display: block; }
.copy-icon .icon-check { display: none; }
.copy-icon.is-copied { color: var(--ok); background: var(--ok-soft); }
.copy-icon.is-copied .icon-copy { display: none; }
.copy-icon.is-copied .icon-check { display: block; }
.h1-key .copy-icon { width: 24px; height: 24px; margin-left: 2px; vertical-align: middle; }

/* ------------------------------------------------------------------ forms */
.form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: visible; }
.form-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 20px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
    align-items: start;
}
.form-label { color: var(--ink); font-weight: 600; padding-top: 9px; }
.form-control { max-width: 420px; }
.form-hint { color: var(--muted); font-size: 12.5px; margin: 6px 0 0; }
.form-actions { display: flex; gap: 10px; padding: 18px 22px; }

/* full-width record forms: two-column field grid that fills the page */
.fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 28px;
    padding: 24px 26px;
}
.fld { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.fld.span-2 { grid-column: 1 / -1; }
.fld > label { font-size: 12px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.fld > label .muted { text-transform: none; letter-spacing: 0; font-weight: 500; }
.fld .form-hint { margin: 0; }
.fld .form-check { padding-top: 3px; }
.fields + .form-actions { padding: 18px 26px; border-top: 1px solid var(--line); }
@media (max-width: 720px) { .fields { grid-template-columns: 1fr; } }

/* in-form tab bar (Details / API connection) */
.form-tabs { margin: 0 26px; padding-top: 6px; }
button.tab { background: none; border: 0; font: inherit; cursor: pointer; }
[data-panel][hidden] { display: none; }

/* required input fields editor */
.fields-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 26px 4px; }
.fields-editor-head, .field-row {
    display: grid;
    grid-template-columns: 1.3fr 1fr 0.9fr 1.5fr 92px 40px;
    gap: 10px;
    align-items: center;
    padding: 0 26px;
}
.fields-editor-head {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--faint);
    padding-top: 6px;
    padding-bottom: 8px;
}
.field-row { padding-top: 8px; padding-bottom: 8px; }
.field-row input, .field-row select { height: 38px; }
.field-row .form-check { justify-content: center; }
.empty-fields { color: var(--faint); font-size: 13px; padding: 6px 26px 4px; margin: 0; }
.icon-btn-danger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; padding: 0; border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm); background: var(--surface); color: var(--faint); cursor: pointer;
    transition: color .12s, border-color .12s, background .12s;
}
.icon-btn-danger:hover { color: var(--danger); border-color: #f4cccc; background: var(--danger-soft); }
.form .fields-head + .fields-editor-head { padding-top: 0; }
@media (max-width: 820px) {
    .fields-editor-head { display: none; }
    .field-row { grid-template-columns: 1fr 1fr; }
    .field-row .form-check { justify-content: flex-start; }
}

/* allowed-countries picker */
.allowed-count { font-size: 13px; }
.country-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 8px;
}
.country {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color .12s, background .12s;
    min-width: 0;
}
.country:hover { border-color: var(--line-strong); background: #fafbfc; }
.country input { width: 16px; height: 16px; flex: none; }
.country .flag { font-size: 20px; line-height: 1; flex: none; }
.country .cname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.country .ccode { color: var(--faint); font-size: 11px; font-weight: 700; letter-spacing: .04em; flex: none; }
.country .csym { color: var(--muted); font-weight: 650; flex: none; min-width: 22px; text-align: right; }
.country:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.country.is-hidden { display: none; }

/* ---------------------------------------------- table picker (countries/currency) */
.table-picker .toolbar { flex-wrap: wrap; align-items: center; gap: 10px; }
.table-picker .toolbar .searchbar { flex: 1; min-width: 220px; margin-bottom: 0; }
.table-picker .toolbar .pick-filters { margin: 0; }
/* Every control in the toolbar shares one height so none sits taller than the rest. */
.table-picker .toolbar .btn,
.table-picker .toolbar .region-select,
.table-picker .toolbar .searchbar input { height: 42px; }
/* Select all / Clear stay secondary via lighter text/padding — but the same height. */
.table-picker .toolbar .tp-bulk { display: inline-flex; gap: 6px; }
.table-picker .toolbar .tp-bulk .btn.btn-sm { height: 42px; padding: 0 14px; }
.tp-edit-row { display: none; }
.table-picker .tp-count { margin-left: auto; font-size: 13px; white-space: nowrap; }
.table-picker .tp-count span { font-weight: 700; color: var(--ink); }
.table-picker .table td { vertical-align: middle; }
.tp-check { text-align: center; }
.tp-check input, .tp-default input { width: 16px; height: 16px; }
.table .flag { font-size: 18px; vertical-align: -2px; margin-right: 4px; }
tr[data-tp-row]:has(.tp-check input:checked) > td { background: #f4fbf9; }
tr[data-tp-row]:has(.tp-check input:checked):hover > td { background: #eef8f5; }

/* default star control (in a table cell) */
.tp-default { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--faint); }
.tp-default input { position: absolute; opacity: 0; width: 0; height: 0; }
.tp-default .cd-star { font-size: 15px; line-height: 1; }
.tp-default .cd-text { font-size: 11px; font-weight: 700; letter-spacing: .03em; display: none; }
.tp-default:hover { color: var(--warn); }
tr:has(.tp-default input:checked) .tp-default { color: var(--warn); }
tr:has(.tp-default input:checked) .tp-default .cd-text { display: inline; }

/* per-currency format cell + popup */
.fmt-cell { white-space: nowrap; }
.fmt-cell .fmt-preview { color: var(--muted); margin-right: 10px; }
.modal-title { margin: 0 0 18px; font-size: 17px; font-weight: 750; letter-spacing: -.01em; }
.modal-card .field { text-align: left; margin-bottom: 14px; }
.fmt-modal-example { margin: 2px 0 20px; color: var(--muted); font-size: 13px; }
.fmt-modal-example strong { color: var(--ink); font-size: 15px; }

/* client-side pagination uses <button> page-nums */
button.page-num { font: inherit; cursor: pointer; }
.table-picker .pagination { margin-top: 14px; }

/* currency-rate rows */
.rate-head, .rate-row {
    display: grid;
    grid-template-columns: 1.5fr 1.4fr 1fr 1.2fr 40px;
    gap: 10px;
    align-items: center;
}
.rate-head {
    font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
    color: var(--faint); padding: 8px 0 4px;
}
.rate-row { padding: 6px 0; }
.rate-row select, .rate-row input { height: 40px; }
.live-cell { display: inline-flex; align-items: center; gap: 8px; }
.live-cell .live-val { color: var(--muted); }
.live-cell .linkbtn { padding: 0; }
.rate-input-row { display: flex; gap: 10px; align-items: stretch; }
.rate-input-row input { flex: 1; }
.rate-input-row .btn { flex: none; height: 40px; }
/* the rate form popup is larger than the default confirm modal */
#rate-modal .modal-card { max-width: 560px; padding: 28px 30px; }
.rate-input-row .fee-type { flex: none; width: 110px; }

/* payment gateways list */
.gw-list { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.gw-region { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); background: #fbfcfd; padding: 9px 16px; border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); }
.gw-region:first-child { border-top: 0; }
.gw-row { display: flex; align-items: center; gap: 13px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.gw-row:last-child { border-bottom: 0; }
.gw-row.is-on { background: var(--accent-soft); }
.gw-logo {
    position: relative; flex: none; width: 38px; height: 38px; border-radius: 9px; overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--sidebar); color: #fff; font-weight: 800; font-size: 15px;
}
.gw-logo .gw-logo-txt { position: relative; z-index: 0; }
.gw-logo .gw-logo-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 5px; background: #fff; z-index: 1; }
/* Inline brand SVG/wordmark on a white tile — CSP-safe, no external favicon fetch. */
.gw-logo .gw-logo-mark { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; background: #fff; padding: 4px; overflow: hidden; }
.gw-logo .gw-logo-mark svg { max-width: 100%; max-height: 100%; }
.gw-logo .gw-logo-mark .pay-word { font-size: 7.5px; font-weight: 800; line-height: 1; white-space: nowrap; letter-spacing: -.2px; }
.gw-row.is-on .gw-logo { background: var(--accent); }
.gw-info { flex: 1; min-width: 0; }
.gw-name { font-weight: 650; }
.gw-desc { color: var(--muted); font-size: 12.5px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gw-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.gw-status[hidden] { display: none; }
@media (max-width: 640px) { .gw-desc { white-space: normal; } .gw-actions { gap: 6px; } }

#gw-modal .modal-card { max-width: 600px; padding: 28px 30px; }
#gw-modal .modal-card textarea { width: 100%; font: inherit; resize: vertical; }
#gw-modal .field { margin-bottom: 16px; }
#gw-modal [data-gw-fields] { margin-bottom: 4px; }
#gw-modal .modal-actions { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
/* deposit rate + fee cell */
.rate-val { display: inline-flex; align-items: baseline; gap: 6px; justify-content: flex-end; }
.rate-tag { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.fee-pill { margin-top: 5px; }
.fee-pill[hidden] { display: none; }
@media (max-width: 720px) { .rate-head { display: none; } .rate-row { grid-template-columns: 1fr 1fr; } }

/* region grouping + filters */
.pick-controls { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.pick-controls .searchbar { flex: 1; min-width: 200px; }
.pick-filters { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.pick-controls .pick-filters { margin-bottom: 0; }
.pick-filters-label { font-size: 12px; font-weight: 650; color: var(--muted); }
.region-select { width: auto; min-width: 150px; height: 42px; }
.region-group { margin-bottom: 20px; }
.region-group:last-child { margin-bottom: 0; }
.region-group.is-hidden { display: none; }
.region-head { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin: 0 0 9px; }

/* currency chip: enable (checkbox) + default (star) */
.curr-chip { gap: 6px; }
.curr-enable { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; cursor: pointer; margin: 0; }
.curr-chip:has(.curr-enable input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.curr-default {
    flex: none; display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer; margin: 0;
    color: var(--faint); background: var(--surface); transition: color .12s, background .12s, border-color .12s;
}
.curr-default input { position: absolute; opacity: 0; width: 0; height: 0; }
.curr-default .cd-star { font-size: 14px; line-height: 1; }
.curr-default .cd-text { font-size: 11px; font-weight: 700; letter-spacing: .03em; display: none; }
.curr-default:hover { color: var(--warn); border-color: var(--warn); }
/* the selected default: gold star + visible "Default" pill */
.curr-chip:has(.curr-default input:checked) .curr-default {
    color: #fff; background: var(--warn); border-color: var(--warn);
}
.curr-chip:has(.curr-default input:checked) .curr-default .cd-star { color: #ffd66b; }
.curr-chip:has(.curr-default input:checked) .curr-default .cd-text { display: inline; }
.curr-chip:has(.curr-default input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

/* button icons */
.btn .ico { flex: none; }
.btn-sm .ico { width: 13px; height: 13px; }

/* hover info tooltip on labels */
.info-tip {
    position: relative;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-left: 5px;
    color: var(--faint);
    cursor: help;
    outline: none;
}
.info-tip:hover, .info-tip:focus-visible { color: var(--accent); }
.info-tip .ico { display: block; }
.info-tip::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 9px);
    transform: translateX(-50%);
    width: max-content;
    max-width: 240px;
    background: var(--ink);
    color: #fff;
    padding: 8px 11px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.45;
    letter-spacing: 0;
    text-transform: none;
    box-shadow: 0 8px 24px rgba(15, 27, 45, .26);
    opacity: 0;
    visibility: hidden;
    transition: opacity .12s ease;
    z-index: 60;
    pointer-events: none;
}
.info-tip::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: calc(100% + 4px);
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--ink);
    opacity: 0;
    visibility: hidden;
    transition: opacity .12s ease;
    z-index: 60;
    pointer-events: none;
}
.info-tip:hover::after, .info-tip:focus-visible::after,
.info-tip:hover::before, .info-tip:focus-visible::before { opacity: 1; visibility: visible; }
@media (prefers-reduced-motion: reduce) { .info-tip::after, .info-tip::before { transition: none; } }

.prefix-input { display: flex; align-items: stretch; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; }
.prefix-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.prefix-input .prefix { display: flex; align-items: center; padding: 0 10px; background: #eef2f6; color: var(--muted); font-family: var(--font-mono); font-size: 12.5px; white-space: nowrap; border-right: 1px solid var(--line-strong); }
.prefix-input input { border: 0; border-radius: 0; }
.prefix-input input:focus { box-shadow: none; }

/* releases */
.release-form .field { margin-bottom: 16px; }
.flabel { display: block; font-size: 12px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.flabel .muted { text-transform: none; letter-spacing: 0; font-weight: 500; }
.release-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.release-form input[type=file] { width: 100%; padding: 10px 12px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); background: #fafbfc; font-size: 13px; color: var(--muted); cursor: pointer; }
.release-form input[type=file]:hover { border-color: var(--accent); }
.release-submit { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.release-actions { display: flex; gap: 12px; justify-content: flex-end; align-items: center; }
.linkbtn.danger { color: var(--danger); }
@media (max-width: 820px) { .release-grid { grid-template-columns: 1fr; } }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }

input[type=text], input[type=password], input[type=date], input[type=email], input[type=tel], input[type=number], select, textarea {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    color: var(--ink);
    background: var(--surface);
    outline: 0;
    transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ------------------------------------------------------------------ login */
.bare {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; padding: 24px;
    position: relative; overflow: hidden;
    background:
        radial-gradient(1100px 640px at 12% -12%, rgba(13, 148, 136, .30), transparent 58%),
        radial-gradient(900px 620px at 112% 8%, rgba(16, 157, 106, .18), transparent 55%),
        radial-gradient(760px 560px at 50% 128%, rgba(23, 58, 92, .55), transparent 62%),
        linear-gradient(165deg, #0b1524 0%, #0f1b2d 46%, #0b2733 100%);
}
.bare::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image: radial-gradient(rgba(255, 255, 255, .055) 1.2px, transparent 1.2px);
    background-size: 24px 24px;
    -webkit-mask-image: radial-gradient(ellipse 72% 72% at 50% 44%, #000 34%, transparent 78%);
            mask-image: radial-gradient(ellipse 72% 72% at 50% 44%, #000 34%, transparent 78%);
}
.bare::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(460px 240px at 50% 34%, rgba(13, 148, 136, .22), transparent 70%);
}
.login-wrap {
    width: 100%; max-width: 380px; position: relative; z-index: 1;
    animation: login-rise .5s cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes login-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .login-wrap { animation: none; } }
.login-card {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, .65);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(3, 10, 20, .45), 0 2px 8px rgba(3, 10, 20, .30);
    padding: 32px 30px;
    position: relative;
}
.login-card::before {
    content: ""; position: absolute; left: 30px; right: 30px; top: 0; height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    border-radius: 0 0 3px 3px;
}
/* Password field with show/hide eye toggle */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 46px; }
.pw-toggle {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; padding: 0; border: 0; background: none; cursor: pointer;
    color: var(--faint); border-radius: 8px; transition: color .12s, background .12s;
}
.pw-toggle:hover { color: var(--muted); background: rgba(15, 27, 45, .05); }
.pw-toggle .icon-off { display: none; }
.pw-toggle.is-on { color: var(--accent); }
.pw-toggle.is-on .icon-eye { display: none; }
.pw-toggle.is-on .icon-off { display: inline; }
.login-brand { font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.login-brand span { color: var(--accent); }
.login-sub { color: var(--muted); margin: 4px 0 22px; }
.alert { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; margin-bottom: 16px; }
.alert-danger { background: var(--danger-soft); color: var(--danger); border: 1px solid #f4cccc; }
.login-alt { margin: 14px 0 0; text-align: center; font-size: 13px; }
.login-alt a { color: var(--muted); }
.login-alt a:hover { color: var(--accent); }
.twofa-enable, .twofa-disable { margin-top: 14px; max-width: 320px; }
.totp-qr { margin: 6px 0 18px; }
.totp-qr img, .totp-qr canvas { display: block; border-radius: 6px; }
.totp-qr table { border-collapse: collapse; }

/* honeypot — visually removed, still in the DOM for bots */
.hp { position: absolute !important; left: -9999px !important; top: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ------------------------------------------------------ confirm modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 27, 45, .45);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 200;
}
.modal-overlay.is-open { display: flex; }
.modal-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(15, 27, 45, .28);
    padding: 24px;
    animation: modal-pop .12s ease-out;
}
@keyframes modal-pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
/* Roomier width for the password / PIN / login-restriction modals. */
#pwd-modal .modal-card, #pin-modal .modal-card, #lock-modal .modal-card { max-width: 520px; padding: 26px 28px; }
.modal-message { margin: 0 0 20px; color: var(--ink); font-size: 15px; line-height: 1.55; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.modal-actions .btn { min-width: 130px; justify-content: center; }
@media (prefers-reduced-motion: reduce) { .modal-card { animation: none; } }

/* confirmation dialog */
.confirm-card { max-width: 430px; padding: 26px 26px 22px; }
.confirm-head { display: flex; gap: 15px; align-items: flex-start; margin-bottom: 22px; }
.confirm-icon {
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--danger-soft);
    color: var(--danger);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.confirm-title { margin: 1px 0 5px; font-size: 16.5px; font-weight: 750; letter-spacing: -.01em; color: var(--ink); }
.confirm-card .modal-message { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.btn-solid-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-solid-danger:hover { background: #c23b3b; border-color: #c23b3b; }
.btn-solid-danger:focus-visible { outline: 2px solid var(--danger); outline-offset: 2px; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 820px) {
    /* Sidebar becomes an off-canvas drawer, opened by the hamburger. */
    .app { flex-direction: row; }
    .sidebar {
        position: fixed; top: 0; left: 0; height: 100vh; width: 264px;
        flex: 0 0 264px; padding: 22px 14px; overflow-y: auto;
        flex-direction: column; align-items: stretch;
        transform: translateX(-100%); transition: transform .22s ease; z-index: 90;
    }
    html.nav-collapsed .sidebar { display: flex; }        /* desktop-collapse must not hide the drawer */
    html.nav-open .sidebar { transform: translateX(0); box-shadow: 0 0 44px rgba(2, 6, 23, .4); }
    .brand { padding: 4px 10px 20px; }
    .brand span { display: block; }
    .nav { flex-direction: column; }
    .sidebar-foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.07); padding: 14px 12px 4px; display: block; }
    .nav-backdrop { display: none; position: fixed; inset: 0; background: rgba(2, 6, 23, .45); z-index: 85; }
    html.nav-open .nav-backdrop { display: block; }

    .page { padding: 20px 16px 50px; }
    .stats { flex-wrap: wrap; }
    .stat { flex-basis: 50%; }
    .detail-row, .form-row { grid-template-columns: 1fr; gap: 6px; }
    .form-label { padding-top: 0; }
}

/* reseller-specific */
.flash-warn { background: var(--warn-soft); color: var(--warn); border-color: #ecdcb8; }
.flash-danger { background: var(--danger-soft); color: var(--danger); border-color: #f4cccc; }
.checklist { list-style: none; margin: 8px 0 0; padding: 0; }
.checklist li { padding: 7px 0; color: var(--ink); border-top: 1px solid var(--line); }
.checklist li:first-child { border-top: 0; }

/* ---------------------------------------------------- sidebar sub-nav */
.subnav {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin: 2px 0 4px 12px;
    padding-left: 12px;
    border-left: 1px solid rgba(255, 255, 255, .09);
}
.subnav-link {
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-ink);
    font-size: 13px;
    font-weight: 500;
    transition: background .12s, color .12s;
}
.subnav-link:hover { color: var(--sidebar-ink-strong); }
.subnav-link.active { color: var(--accent); font-weight: 600; }

/* ---------------------------------------------------------- tab bar */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--line);
    margin: -6px 0 22px;
    overflow-x: auto;               /* scroll the tab strip instead of wrapping/overflowing */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 14px;
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;            /* keep each tab label on one line */
    flex: 0 0 auto;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: #eef1f5;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}
.tab.is-active .tab-count { background: var(--accent-soft); color: var(--accent-strong); }

/* -------------------------------------------------- toolbar (search + action) */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.toolbar .searchbar { margin-bottom: 0; flex: 1; }
.toolbar .btn { flex: none; }

/* small helpers reused across the admin */
.price-cost { color: var(--muted); }
.price-sale { font-weight: 650; }
.text-strong { font-weight: 650; }
.cell-sub { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.form-check { display: flex; align-items: center; gap: 9px; }
.form-check input[type=checkbox] { width: 16px; height: 16px; }
.form-two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 820px) { .form-two { grid-template-columns: 1fr; } }

/* ============================================ users: account + wallet ==== */
/* two-column layout: form on the left, wallet on the right */
.split-cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.split-cols > .form { margin: 0; }
.edit-main { min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.edit-main > .form { margin: 0; }
.act-log > .card-title { padding-bottom: 0; }
.act-sub { margin: 6px 0 16px; padding: 0 26px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.act-log .table-scroll { border-top: 1px solid var(--line); }
.act-log .pagination { margin: 0; padding: 14px 26px; }
@media (max-width: 720px) { .act-sub, .act-log .pagination { padding-left: 18px; padding-right: 18px; } }

.card-title { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; color: var(--ink); margin-bottom: 16px; }
.card-title .ico { flex: none; display: block; width: 17px; height: 17px; color: var(--accent); }
.card-title.sm { font-size: 13px; margin-bottom: 12px; color: var(--muted); }
.card-title.sm .ico { width: 14px; height: 14px; }

/* solid green button (credit) — mirrors .btn-solid-danger */
.btn-solid-ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn-solid-ok:hover { background: #0c8b5d; border-color: #0c8b5d; }
.btn-solid-ok:focus-visible { outline: 2px solid var(--ok); outline-offset: 2px; }

/* phone field: fixed dialing-code prefix + input */
.phone-input { display: flex; align-items: stretch; height: 40px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.phone-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.phone-dial { display: inline-flex; align-items: center; padding: 0 12px; background: #f3f5f8; border-right: 1px solid var(--line); color: var(--ink); font-weight: 650; font-size: 14px; white-space: nowrap; }
.phone-input input { height: 100%; border: none !important; box-shadow: none !important; border-radius: 0; flex: 1; }
.phone-input input:focus { box-shadow: none !important; }

/* wallet card */
.wallet-panel { display: flex; flex-direction: column; gap: 18px; }
.wallet-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.wallet-balance { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; padding: 14px 0 16px; border-bottom: 1px solid var(--line); }
.wallet-balance-label { flex: 1 0 100%; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.wallet-balance-amt { font-size: 30px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.wallet-balance-cur { font-size: 13px; font-weight: 700; color: var(--muted); }
/* Stacked full-width rows so long currency amounts never overflow. */
.wallet-totals { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 16px; }
.wallet-totals > div { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; background: var(--bg, #f6f8fa); border-radius: var(--radius-sm); }
.wallet-totals small { flex: none; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.wt-up, .wt-down { text-align: right; font-weight: 700; font-size: 14px; word-break: break-word; }
.wt-up { color: var(--ok); }
.wt-down { color: var(--danger); }
.wallet-actions { display: flex; gap: 10px; }
.wallet-actions .btn { flex: 1; justify-content: center; }

/* wallet history */
.wallet-history { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.muted-note { color: var(--muted); font-size: 13px; margin: 4px 0 2px; }
.table-tight th, .table-tight td { padding: 8px 8px; font-size: 12.5px; }
.table-tight th:first-child, .table-tight td:first-child { padding-left: 2px; }
.table-tight th:last-child, .table-tight td:last-child { padding-right: 2px; }
.tx-pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.tx-credit { background: var(--ok-soft); color: var(--ok); }
.tx-debit { background: var(--danger-soft); color: var(--danger); }
.tx-mailed { margin-left: 4px; color: var(--muted); font-size: 12px; }

/* wallet modal head + credit/debit icon tint */
.modal-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 6px; }
.modal-head .modal-message { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.confirm-icon.is-credit { background: var(--ok-soft); color: var(--ok); }
.confirm-icon.is-debit { background: var(--danger-soft); color: var(--danger); }
[data-wallet-modal] .modal-card { max-width: 480px; }
[data-wallet-modal] .modal-actions { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }

@media (max-width: 900px) {
    .split-cols { grid-template-columns: 1fr; }
}

/* phone prefix empty state + transactions inline bits */
.phone-dial.is-empty { color: var(--faint); font-weight: 600; }
.cell-sub-inline { font-size: 11px; color: var(--muted); font-weight: 600; }

/* ------------------------------------------ user profile: wallet activity */
.wallet-activity { margin-top: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.acttabs { display: flex; gap: 4px; padding: 0 18px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.acttab { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 13px 14px; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.acttab .ico { width: 14px; height: 14px; }
.acttab:hover { color: var(--ink); }
.acttab.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.acttab-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; background: #eef1f5; color: var(--muted); font-size: 11px; font-weight: 700; }
.acttab.is-active .acttab-count { background: var(--accent-soft); color: var(--accent-strong); }
.actpanel { display: none; padding: 6px 4px 4px; }
.actpanel.is-active { display: block; }
.actpanel .table { margin: 0; }
.actpanel .muted-note { padding: 22px 20px; }

/* form card header (e.g. "Account details") — pad it so the icon sits inside the card */
.form > .card-title { padding: 22px 26px 0; margin-bottom: 0; }
.form > .card-title + .fields { padding-top: 14px; }

/* ------------------------------------------------ user profile: security */
.sec-card { margin-top: 0; }
.sec-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.sec-row:first-of-type { border-top: 0; }
.sec-info { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.sec-label { font-size: 13px; font-weight: 650; color: var(--ink); }
.sec-state .pill { font-size: 11px; }
.sec-hint { font-size: 12px; color: var(--faint); white-space: nowrap; }
.sec-row .btn { flex: none; }

/* transactions button count badge in the header */
.btn-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 17px; padding: 0 6px; margin-left: 2px; border-radius: 999px; background: #eef1f5; color: var(--muted); font-size: 11px; font-weight: 700; }

/* input + inline action button (password generate) */
.input-with-btn { display: flex; gap: 8px; align-items: stretch; }
.input-with-btn input { flex: 1; min-width: 0; }
/* Match the Generate button height to the input exactly (override .btn-sm's fixed 32px). */
.input-with-btn .btn { flex: none; height: auto; align-self: stretch; padding-top: 0; padding-bottom: 0; }

/* Searchable multi-country picker (login restrictions). */
.cpick { position: relative; }
/* One clean search field: leading magnifier + borderless input + chips wrap. */
.cpick-control { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; min-height: 46px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); cursor: text; transition: border-color .12s, box-shadow .12s; }
.cpick-control:focus, .cpick-control:focus-within { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cpick-lead { display: inline-flex; flex: none; color: var(--muted); }
.cpick-caret { display: none; }   /* searchable field — no select-style caret */
/* Kill the global input[type=text] border/ring on the inner search box (higher specificity). */
.cpick .cpick-search { flex: 1 1 100px; min-width: 100px; width: auto; height: auto; border: 0; background: none; box-shadow: none; color: var(--ink); font: inherit; padding: 2px 0; margin: 0; outline: none; }
.cpick .cpick-search:focus { border: 0; box-shadow: none; }
.cpick-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 9px; background: color-mix(in srgb, var(--accent) 13%, var(--surface)); color: var(--ink); border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent); border-radius: 999px; font-size: 13px; font-weight: 500; line-height: 1.4; }
.cpick-chip button { border: 0; background: none; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; padding: 0; font-size: 15px; line-height: 1; }
.cpick-chip button:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--ink); }
/* Options list — its own rounded panel below the field, rendered inline (never clipped). */
.cpick-menu { margin-top: 8px; max-height: 244px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(15,27,45,.10); padding: 5px; }
.cpick-opt { display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: 9px; cursor: pointer; font-size: 14px; color: var(--ink); transition: background .1s; }
.cpick-opt:hover, .cpick-opt.is-active { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.cpick-opt.is-sel { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.cpick-flag { flex: none; font-size: 18px; line-height: 1; }
.cpick-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cpick-opt.is-sel .cpick-name { font-weight: 600; }
/* Right-aligned check — a hollow ring by default, fills accent once selected. */
.cpick-opt .cpick-check { order: 3; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; flex: none; color: transparent; background: transparent; border: 1.5px solid var(--line-strong); transition: all .12s; }
.cpick-opt:hover .cpick-check { border-color: var(--accent); }
.cpick-opt.is-sel .cpick-check { color: #fff; background: var(--accent); border-color: var(--accent); }
.cpick-empty { padding: 16px; text-align: center; color: var(--muted); font-size: 13px; }

/* Searchable single-select (progressive enhancement of a long native <select>). */
select.ss-native { display: none !important; }
.ss { position: relative; }
.ss-control { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.ss-control:focus, .ss.is-open .ss-control { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ss-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-value.is-ph { color: var(--muted); }
.ss-caret { display: inline-flex; flex: none; color: var(--muted); transition: transform .15s; }
.ss.is-open .ss-caret { transform: rotate(180deg); }
.ss-menu { position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(15,27,45,.16); padding: 8px; }
.ss-search-wrap { display: flex; align-items: center; gap: 8px; padding: 0 8px; margin-bottom: 6px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); }
.ss-search-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ss-search-ico { display: inline-flex; flex: none; color: var(--muted); }
.ss .ss-search { flex: 1; border: 0; background: none; box-shadow: none; color: var(--ink); font: inherit; padding: 9px 0; outline: none; }
.ss .ss-search:focus { border: 0; box-shadow: none; }
.ss-list { max-height: 260px; overflow-y: auto; }
.ss-opt { padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-opt:hover, .ss-opt.is-active { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.ss-opt.is-sel { background: color-mix(in srgb, var(--accent) 12%, transparent); font-weight: 600; }
.ss-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 13px; }
.ss-list::-webkit-scrollbar { width: 8px; }
.ss-list::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }

/* Danger ("More actions") menu on the edit-user header — deletion tucked behind it. */
.danger-menu { position: relative; }
.danger-menu > summary { list-style: none; cursor: pointer; gap: 6px; }
.danger-menu > summary::-webkit-details-marker { display: none; }
.danger-menu .dm-chev { display: inline-flex; transition: transform .15s; }
.danger-menu[open] .dm-chev { transform: rotate(180deg); }
.danger-menu-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; width: 260px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(15,27,45,.16); padding: 12px; }
.danger-menu-panel .dm-hint { margin: 0 0 10px; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.dm-delete { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; padding: 9px 12px; border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); border-radius: 9px; background: color-mix(in srgb, var(--danger) 8%, transparent); color: var(--danger); font: inherit; font-weight: 600; cursor: pointer; transition: background .12s; }
.dm-delete:hover { background: var(--danger); color: #fff; }
.cpick-menu::-webkit-scrollbar { width: 8px; }
.cpick-menu::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
/* Modals scroll when taller than the viewport; on phones actions & input rows wrap. */
.modal-card { max-height: 90vh; overflow-y: auto; overflow-x: hidden; }
@media (max-width: 480px) {
    .modal-actions { flex-wrap: wrap; }
    .modal-actions .btn { flex: 1 1 auto; justify-content: center; }
    .modal-actions .btn[style*="margin-right:auto"], .modal-actions .btn[style*="margin-right: auto"] { flex-basis: 100%; }
    .input-with-btn { flex-wrap: wrap; }
    .input-with-btn input { flex: 1 1 100%; }
    .input-with-btn .btn { flex: 1 1 auto; justify-content: center; }
}

/* accent-tinted modal icon (password / pin) */
.confirm-icon.is-accent { background: var(--accent-soft); color: var(--accent-strong); }

/* ==================================================================== tickets */
.filter-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 16px; padding: 10px 16px; background: var(--accent-soft); border: 1px solid #bfeee7; border-radius: var(--radius-sm); font-size: 13px; }
.filter-banner .ico { vertical-align: -2px; }

/* segmented status filter */
.seg { display: inline-flex; background: #eef1f5; border-radius: var(--radius-sm); padding: 3px; flex: none; }
.seg-btn { padding: 7px 14px; border-radius: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg-btn:hover { color: var(--ink); }
.seg-btn.is-active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }

/* awaiting-reply dot on the list */
.dot-new { display: inline-block; width: 8px; height: 8px; margin-left: 5px; border-radius: 50%; background: var(--warn); vertical-align: middle; }

/* ticket meta line under the title */
.ticket-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; }

/* conversation thread */
.thread { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.bubble-row { display: flex; }
.bubble-row.is-customer { justify-content: flex-start; }
.bubble-row.is-admin { justify-content: flex-end; }
.bubble { max-width: 76%; border: 1px solid var(--line); border-radius: 14px; padding: 12px 15px; background: var(--surface); box-shadow: var(--shadow); }
.bubble-row.is-admin .bubble { background: var(--accent-soft); border-color: #bfeee7; }
.bubble-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.bubble-who { font-weight: 700; font-size: 13px; color: var(--ink); }
.bubble-role { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 1px 6px; border-radius: 999px; }
.role-admin { background: var(--accent); color: #fff; }
.role-cust { background: #e2e8f0; color: var(--muted); }
.bubble-time { margin-left: auto; font-size: 11.5px; color: var(--faint); }
.bubble-body { font-size: 14px; line-height: 1.55; color: var(--ink); word-wrap: break-word; }

/* reply composer */
.reply-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.reply-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.reply-head .card-title { margin: 0; }
.reply-box textarea { width: 100%; resize: vertical; }
.reply-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.reply-buttons { display: flex; gap: 10px; margin-left: auto; }
.reply-closed { display: flex; align-items: center; gap: 8px; padding: 16px 18px; background: #f6f8fa; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); font-size: 14px; }
.reply-closed .ico { color: var(--ok); }

/* quick replies */
.quick-replies { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.qr-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.qr-chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 12.5px; font-weight: 600; cursor: pointer; transition: border-color .12s, background .12s; }
.qr-chip:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.qr-chip .ico { color: var(--muted); }

/* quick-reply manager */
.canned-list { display: flex; flex-direction: column; gap: 12px; padding: 20px 26px; }
.canned-item { display: flex; gap: 12px; align-items: flex-start; }
.canned-fields { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.canned-item .canned-remove { flex: none; margin-top: 2px; }

/* ---------------------------------------------- brand assets & uploads */
.brand-logo { max-height: 30px; max-width: 100%; display: block; }
/* three brand-asset uploads on one row */
.asset-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.asset-cell { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.asset-cell > label { font-size: 12px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.asset-row .asset-field { flex-direction: column; align-items: stretch; gap: 10px; }
.asset-row .asset-preview { width: 100%; height: 84px; }
@media (max-width: 720px) { .asset-row { grid-template-columns: 1fr; } }

.asset-field { display: flex; gap: 14px; align-items: flex-start; }
.asset-preview { flex: none; width: 96px; height: 64px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #f6f8fa; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.asset-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.asset-empty { flex-direction: column; gap: 3px; color: var(--faint); font-size: 11px; }
.asset-controls { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.asset-input { font-size: 13px; }
.asset-input::file-selector-button { margin-right: 10px; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.asset-input::file-selector-button:hover { border-color: var(--accent); color: var(--accent); }
.asset-remove { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }

/* ---------------------------------------------------------- banners */
.banner-grid { display: flex; flex-direction: column; gap: 12px; }
.banner-card { display: flex; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; align-items: center; }
.banner-card.is-off { opacity: .62; }
.banner-thumb { flex: none; width: 168px; height: 84px; border-radius: var(--radius-sm); overflow: hidden; background: #f0f2f5; }
.banner-thumb img { width: 100%; height: 100%; object-fit: cover; }
.banner-body { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; flex-wrap: wrap; }
.banner-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.banner-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 12px; flex-wrap: wrap; }
.banner-actions { display: flex; gap: 8px; flex: none; }

/* ------------------------------------------------------- legal editor */
.legal-editor { display: flex; flex-direction: column; gap: 10px; padding: 20px 26px; }
.legal-page { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.legal-page summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; cursor: pointer; font-weight: 650; list-style: none; background: #fafbfc; }
.legal-page summary::-webkit-details-marker { display: none; }
.legal-page[open] summary { border-bottom: 1px solid var(--line); }
.legal-slug { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.legal-slug .ico { color: var(--accent); }
.legal-url { font-size: 12px; color: var(--faint); }
.legal-fields { display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.legal-fields textarea { width: 100%; resize: vertical; font-size: 13.5px; line-height: 1.6; }

/* ------------------------------------------------------- HTML editor */
.html-editor { border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.html-editor:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.he-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; padding: 7px 8px; background: #fafbfc; border-bottom: 1px solid var(--line); }
.he-btn { min-width: 30px; height: 28px; padding: 0 8px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.he-btn:hover { background: #eef1f5; }
.he-btn.is-active { background: var(--accent-soft); color: var(--accent-strong); }
.he-sep { width: 1px; height: 18px; background: var(--line-strong); margin: 0 3px; }
.he-source-toggle { margin-left: auto; font-family: var(--font-mono); }
.he-surface { min-height: 240px; max-height: 520px; overflow-y: auto; padding: 14px 16px; font-size: 14px; line-height: 1.6; outline: 0; }
.he-surface:empty::before { content: 'Write your page content…'; color: var(--faint); }
.he-surface h2 { font-size: 20px; margin: 14px 0 8px; }
.he-surface h3 { font-size: 16px; margin: 12px 0 6px; }
.he-surface p { margin: 0 0 10px; }
.he-surface ul, .he-surface ol { margin: 0 0 10px; padding-left: 22px; }
.he-surface a { color: var(--accent); text-decoration: underline; }
.he-code { width: 100%; min-height: 240px; max-height: 520px; padding: 14px 16px; border: 0; border-radius: 0; font-family: var(--font-mono); font-size: 13px; line-height: 1.6; resize: vertical; outline: 0; }
.asset-row .asset-input { max-width: 100%; font-size: 12px; }
.asset-row .asset-input::file-selector-button { padding: 5px 10px; font-size: 12px; }

/* centered prompt dialog input */
.prompt-input { width: 100%; margin-top: 4px; }
#prompt-modal .modal-title { margin: 0 0 4px; font-size: 15px; font-weight: 700; color: var(--ink); }

/* --------------------------------------------------- transactions report */
.report-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 20px 0 18px; }
.report-filters .region-select, .report-filters .date-input, .report-filters .btn { height: 42px; }
.report-filters .date-input { width: 160px; min-width: 0; flex: none; }
.report-filters .region-select { width: auto; min-width: 130px; flex: none; }
.report-filters .btn { flex: none; }
.tx-order { background: var(--accent-soft); color: var(--accent-strong); }
.print-head { display: none; }
.print-head h2 { margin: 0 0 2px; font-size: 18px; }
.print-head p { margin: 0; color: var(--muted); font-size: 13px; }
.table tfoot td { padding: 12px 18px; border-top: 2px solid var(--line-strong); background: #fbfcfd; }

/* ---------------------------------------------------------------- print */
@media print {
    .sidebar, .no-print, .pagination, .flash, .report-filters,
    .page-header .header-actions { display: none !important; }
    .app { display: block; }
    .main { width: 100%; }
    .page { max-width: 100%; padding: 0; }
    .print-head { display: block; margin: 0 0 14px; }
    .panel { box-shadow: none; border: 1px solid #ccc; }
    .stats { box-shadow: none; }
    body { background: #fff; }
    a[href]::after { content: ''; }
}

/* ------------------------------------------------- API access / developer */
.api-cred { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.api-cred:last-of-type { border-bottom: 0; }
.api-cred-label { flex: none; width: 92px; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.api-cred-val { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 12.5px; color: var(--ink); background: #f6f8fa; border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px; overflow-x: auto; }
.code-block { margin: 0; padding: 14px 16px; background: var(--ink); color: #e6edf3; border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6; overflow-x: auto; white-space: pre; }

/* ------------------------------------------------- floating toast (flash) */
.toast {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-8px);
    z-index: 400; display: flex; align-items: center; gap: 10px;
    max-width: min(92vw, 460px); padding: 12px 14px 12px 15px;
    background: var(--ink); color: #fff; border-radius: 12px;
    box-shadow: 0 12px 40px rgba(15, 27, 45, .30);
    font-size: 14px; font-weight: 500; opacity: 0;
    animation: toast-in .22s cubic-bezier(.2,.8,.2,1) forwards;
}
.toast.is-hiding { animation: toast-out .25s ease forwards; }
.toast-ico { flex: none; display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; border-radius: 50%; background: var(--ok); color: #fff; }
.toast-msg { flex: 1; min-width: 0; line-height: 1.4; }
.toast-x { flex: none; background: none; border: 0; color: rgba(255,255,255,.6); cursor: pointer; padding: 2px; display: inline-flex; }
.toast-x:hover { color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(-8px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(-50%) translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .toast, .toast.is-hiding { animation: none; opacity: 1; } }

/* API docs — example responses wrap into a small code block (never clipped) */
.api-resp {
    display: block; margin-top: 6px; padding: 8px 10px;
    background: #f6f8fa; border: 1px solid var(--line); border-radius: 6px;
    font-family: var(--font-mono); font-size: 11.5px; line-height: 1.5; color: var(--muted);
    white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word;
}

/* ==================================================================== dashboard */
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 20px; }
.metric-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.metric-top { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.metric-ico { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border-radius: 9px; background: #eef1f5; color: var(--muted); }
.metric-ico.is-accent { background: var(--accent-soft); color: var(--accent-strong); }
.metric-label { font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.metric-value { font-size: 27px; font-weight: 780; letter-spacing: -.02em; color: var(--ink); line-height: 1.1; }
.metric-sub { margin-top: 5px; font-size: 12.5px; color: var(--muted); }

.dash-cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; margin-bottom: 20px; }
.chart-card { padding: 18px 20px; }
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.chart-sub { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.chart-body { margin: 10px 0 4px; }
.area-chart { display: block; width: 100%; }
.chart-axis { display: flex; justify-content: space-between; gap: 4px; margin-top: 6px; }
.axis-tick { flex: 1; font-size: 10.5px; color: var(--faint); text-align: center; white-space: nowrap; }

/* donut */
.donut-wrap { display: flex; align-items: center; gap: 20px; margin-top: 14px; flex-wrap: wrap; }
.donut { flex: none; }
.donut-num { font-size: 26px; font-weight: 800; fill: var(--ink); }
.donut-cap { font-size: 11px; fill: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.donut-legend { flex: 1; min-width: 140px; display: flex; flex-direction: column; gap: 9px; }
.legend-row { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.legend-dot { flex: none; width: 10px; height: 10px; border-radius: 3px; }
.legend-label { flex: 1; color: var(--ink); }
.legend-val { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

/* order-volume bars */
.bars { display: flex; align-items: flex-end; gap: 5px; height: 150px; margin: 16px 0 4px; }
.bar-col { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.bar-fill { width: 100%; background: linear-gradient(180deg, var(--accent), var(--accent-strong)); border-radius: 4px 4px 0 0; transition: opacity .12s; }
.bar-col:hover .bar-fill { opacity: .78; }

/* system tallies */
.tally-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.tally { display: flex; flex-direction: column; gap: 3px; padding: 12px; background: #f8fafc; border: 1px solid var(--line); border-radius: var(--radius-sm); transition: border-color .12s, background .12s; }
.tally:hover { border-color: var(--accent); background: var(--accent-soft); }
.tally-n { font-size: 20px; font-weight: 750; color: var(--ink); letter-spacing: -.01em; }
.tally-l { font-size: 11.5px; color: var(--muted); }

@media (max-width: 1000px) {
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .dash-cols { grid-template-columns: 1fr; }
    .tally-grid { grid-template-columns: repeat(2, 1fr); }
}

/* wallet currency movement */
.wallet-move { display: flex; flex-direction: column; gap: 16px; margin-top: 14px; }
.wm-row { display: flex; flex-direction: column; gap: 6px; }
.wm-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.wm-cur { font-size: 13px; font-weight: 750; color: var(--ink); letter-spacing: .02em; }
.wm-bal { font-size: 14px; font-weight: 700; color: var(--ink); }
.wm-bal small { font-size: 11px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.wm-bars { display: flex; flex-direction: column; gap: 4px; }
.wm-bar { height: 8px; background: #eef1f5; border-radius: 999px; overflow: hidden; }
.wm-fill { display: block; height: 100%; border-radius: 999px; }
.wm-in { background: var(--ok); }
.wm-out { background: var(--danger); }
.wm-legend { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; font-weight: 650; }

/* 6-up tally grid for the full-width overview */
.tally-grid-6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1000px) { .tally-grid-6 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 620px) { .tally-grid-6 { grid-template-columns: repeat(2, 1fr); } }

/* order pipeline tiles (project-55 style: dot + count + progress track) */
.status-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 14px; }
.status-tile { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 13px 14px; background: #fafbfc; }
.st-label { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.st-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.st-num { display: block; margin: 6px 0 8px; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.st-track { height: 6px; border-radius: 999px; background: #eef1f5; overflow: hidden; }
.st-fill { display: block; height: 100%; border-radius: 999px; transition: width .5s; }
.st-dot.tone-ok, .st-fill.tone-ok { background: var(--ok); } .st-num.tone-ok { color: var(--ok); }
.st-dot.tone-warn, .st-fill.tone-warn { background: var(--warn); } .st-num.tone-warn { color: var(--warn); }
.st-dot.tone-danger, .st-fill.tone-danger { background: var(--danger); } .st-num.tone-danger { color: var(--danger); }
.st-dot.tone-muted, .st-fill.tone-muted { background: var(--faint); } .st-num.tone-muted { color: var(--ink); }

/* wallet balance panel (available balance hero) */
.dash-eyebrow { margin: 0; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .16em; color: var(--muted); }
.dash-balance { margin: 12px 0 2px; font-size: 34px; font-weight: 820; letter-spacing: -.025em; color: var(--ink); line-height: 1; }
.dash-balance-sub { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.wallet-panel-dash .wallet-move { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }

/* recent orders rows */
.recent-list { display: flex; flex-direction: column; margin-top: 8px; }
.recent-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.recent-row:first-child { border-top: 0; }
.recent-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.recent-side { display: flex; align-items: center; gap: 10px; flex: none; }

/* ============================================================ dashboard v2 */
.dash-grid { display: grid; gap: 16px; margin-bottom: 16px; align-items: start; }
.dash-grid-hero { grid-template-columns: 1.15fr 0.85fr; }
.dash-grid-2 { grid-template-columns: 1fr 1fr; }
.dpanel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.dpanel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dpanel-head h3 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.dpanel-head p { margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.chip { flex: none; padding: 5px 12px; border-radius: 999px; background: #eff2f6; color: var(--muted); font-size: 12px; font-weight: 650; }
.chip-white { background: #fff; border: 1px solid var(--line); }

/* activity chart frame */
.chart-frame { margin-top: 16px; border: 1px solid #e6ebf1; background: #f7f9fb; border-radius: 16px; padding: 14px; }
.chart-frame-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.legend-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.lchip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; background: #fff; font-size: 12px; font-weight: 650; color: var(--muted); }
.lchip-dot { width: 9px; height: 9px; border-radius: 50%; }
.chart-inner { background: #fff; border: 1px solid #e6ebf1; border-radius: 14px; padding: 12px; }
.mline { display: block; }
.mline-y { font-size: 10px; fill: var(--faint); }
.mline-x { font-size: 10.5px; fill: var(--muted); }

/* activity summary cards */
.sum-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.sum-card { border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; }
.sum-label { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.sum-dot { width: 9px; height: 9px; border-radius: 50%; }
.sum-num { margin: 8px 0 3px; font-size: 24px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.sum-note { margin: 0; font-size: 11.5px; color: var(--faint); }

/* finance cards */
.fin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.fin-card { border: 1px solid; border-radius: 12px; padding: 13px 15px; }
.fin-label { margin: 0; display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.fin-dot { width: 8px; height: 8px; border-radius: 50%; }
.fin-num { margin: 8px 0 0; font-size: 23px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.fin-blue { border-color: #cfe0fc; background: #eff5ff; } .fin-blue .fin-label { color: #2563eb; }
.fin-amber { border-color: #fce7bd; background: #fff8ec; } .fin-amber .fin-label { color: #b7791f; }
.fin-green { border-color: #bfe8d4; background: #eefaf3; } .fin-green .fin-label { color: #0f9d6a; }
.fin-teal { border-color: #bdeae6; background: #ecfaf8; } .fin-teal .fin-label { color: #0d9488; }

/* gauge cards */
.gauge-frame { margin-top: 14px; border: 1px solid #e6ebf1; background: #f7f9fb; border-radius: 14px; padding: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gauge-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px; box-shadow: var(--shadow); }
.gauge-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gauge-badge { font-size: 11px; font-weight: 700; color: var(--ok); background: var(--ok-soft); border-radius: 999px; padding: 2px 9px; }
.gauge-cap { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; color: var(--faint); }
.gauge-ring { display: flex; justify-content: center; margin: 10px 0; }
.ring { width: 104px; height: 104px; }
.ring-num { font-size: 15px; font-weight: 800; fill: var(--ink); }
.gauge-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #eef1f5; border-radius: 12px; padding: 9px 14px; font-size: 13px; font-weight: 650; color: var(--ink); }
.gauge-btn:hover { background: #e3e8ef; }
.gauge-btn .ico { color: var(--muted); }

/* order updates */
.order-updates { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.ou-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: 10px; padding: 11px 14px; transition: background .12s; }
.ou-row:hover { background: #fafbfc; }
.ou-ok { border-left-color: var(--ok); } .ou-warn { border-left-color: var(--warn); }
.ou-danger { border-left-color: var(--danger); } .ou-muted { border-left-color: var(--faint); }
.ou-main { min-width: 0; }
.ou-title { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 650; color: var(--ink); }
.ou-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.ou-dot.tone-ok { background: var(--ok); } .ou-dot.tone-warn { background: var(--warn); }
.ou-dot.tone-danger { background: var(--danger); } .ou-dot.tone-muted { background: var(--faint); }
.ou-sub { display: block; margin-top: 3px; padding-left: 16px; font-size: 12px; color: var(--muted); }
.ou-side { flex: none; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ou-amt { font-size: 13.5px; font-weight: 700; color: var(--ink); }

/* buy credit by currency */
.ccy-list { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.ccy-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.ccy-name { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; color: var(--ink); }
.ccy-dot { width: 10px; height: 10px; border-radius: 50%; }
.ccy-count { font-size: 12px; font-weight: 400; color: var(--faint); }
.ccy-amt { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.ccy-track { height: 10px; background: #eef1f5; border-radius: 999px; overflow: hidden; }
.ccy-fill { display: block; height: 100%; border-radius: 999px; transition: width .5s; }

.empty-box { border: 1px dashed var(--line-strong); background: #f8fafc; border-radius: 12px; padding: 22px; text-align: center; color: var(--muted); font-size: 13px; margin-top: 6px; }

@media (max-width: 1000px) {
    .dash-grid-hero, .dash-grid-2 { grid-template-columns: 1fr; }
    .sum-cards, .fin-grid, .gauge-frame { grid-template-columns: 1fr 1fr; }
}

/* ============================================================ dashboard v3 */
.dash2 .dpanel { border-radius: 16px; }
.eyebrow { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.chip-link { background: var(--accent-soft); color: var(--accent-strong); }
.chip-link:hover { background: #d6f5ef; }

/* hero */
.hero { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 22px 24px 8px; margin-bottom: 16px; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kpi-strip { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0; margin: 18px 0 10px; }
.kpi { flex: 1; min-width: 150px; padding: 4px 24px; border-left: 1px solid var(--line); }
.kpi:first-child { padding-left: 0; border-left: 0; }
.kpi-label { display: block; font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.kpi-value { display: block; margin: 6px 0 4px; font-size: 30px; font-weight: 800; letter-spacing: -.025em; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1; }
.kpi-hero .kpi-value { font-size: 38px; color: var(--accent-strong); }
.kpi-delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi-delta.up { color: var(--ok); font-weight: 650; }
.kpi-delta.up .ico { transform: rotate(-90deg); }
.hero-chart { margin: 6px -8px 0; }
.hero-axis { display: flex; justify-content: space-between; padding: 0 4px 12px; }
.hero-axis span { flex: 1; font-size: 10.5px; color: var(--faint); text-align: center; }
.hero-axis span:first-child { text-align: left; } .hero-axis span:last-child { text-align: right; }

/* two-column row */
.dash2-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; align-items: start; }

/* order pipeline (row-based, not tiles) */
.pipe-list { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.pipe-row { display: grid; grid-template-columns: 120px 1fr auto; align-items: center; gap: 14px; }
.pipe-label { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.pipe-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.pipe-track { height: 8px; background: #eef1f5; border-radius: 999px; overflow: hidden; }
.pipe-fill { display: block; height: 100%; border-radius: 999px; transition: width .5s; }
.pipe-num { font-size: 15px; font-weight: 750; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pipe-num small { font-size: 11px; font-weight: 600; color: var(--faint); margin-left: 6px; }
.pipe-dot.tone-ok, .pipe-fill.tone-ok { background: var(--ok); }
.pipe-dot.tone-warn, .pipe-fill.tone-warn { background: var(--warn); }
.pipe-dot.tone-danger, .pipe-fill.tone-danger { background: var(--danger); }
.pipe-dot.tone-muted, .pipe-fill.tone-muted { background: var(--faint); }

/* flush panel that holds a full-bleed table */
.dpanel-flush { padding: 0; overflow: hidden; }
.dpanel-flush .table th:first-child, .dpanel-flush .table td:first-child { padding-left: 26px; }
.dpanel-flush .table th:last-child, .dpanel-flush .table td:last-child { padding-right: 26px; }

@media (max-width: 1000px) {
    .dash2-cols { grid-template-columns: 1fr; }
    .kpi { border-left: 0; padding: 8px 0; min-width: 45%; }
}

/* ============================ top bar + notification bell ============== */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 40px 0; }
@media (max-width: 720px) { .topbar { padding: 12px 20px 0; } }

/* hamburger toggle for the left sidebar (works on all screen sizes) */
.nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px;
    background: var(--surface, #fff); color: var(--ink); cursor: pointer; transition: border-color .15s, background .15s;
}
.nav-toggle:hover { border-color: var(--accent); background: rgba(13,148,136,.06); }
/* collapsed state: hide the sidebar; main reflows to full width automatically */
html.nav-collapsed .sidebar { display: none; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.notif { position: relative; }
.notif-bell {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px;
    background: var(--surface, #fff); color: var(--ink); cursor: pointer; transition: border-color .15s, background .15s;
}
.notif-bell:hover { border-color: var(--accent); background: rgba(13,148,136,.06); }
.notif-count {
    position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--danger, #dc2626); color: #fff; font-size: 11px; font-weight: 700;
    border-radius: 999px; border: 2px solid var(--surface, #fff);
}
.notif-panel {
    position: absolute; top: 46px; right: 0; width: 340px; max-width: 86vw; z-index: 60;
    background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 12px;
    box-shadow: 0 18px 40px rgba(2,6,23,.16); overflow: hidden;
}
.notif-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 13px;
}
.notif-clear { border: 0; background: none; color: var(--accent); font-size: 12px; cursor: pointer; font-weight: 600; }
.notif-list { max-height: 60vh; overflow-y: auto; }
.notif-empty { padding: 26px 14px; text-align: center; color: var(--muted, #64748b); font-size: 13px; }
.notif-item {
    display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line);
    text-decoration: none; color: inherit; transition: background .12s;
}
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: rgba(13,148,136,.05); }
.notif-item.is-unread { background: rgba(13,148,136,.07); }
.notif-ico { font-size: 16px; line-height: 1.3; flex: none; }
.notif-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.notif-title { font-weight: 600; font-size: 13px; }
.notif-body { font-size: 12px; color: var(--muted, #64748b); overflow: hidden; text-overflow: ellipsis; }
.notif-ago { font-size: 11px; color: var(--muted, #94a3b8); margin-top: 2px; }

/* sidebar attention badge */
.nav-badge {
    margin-left: auto; min-width: 18px; height: 18px; padding: 0 6px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--danger, #dc2626); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px;
}
.nav-link.active .nav-badge { background: #fff; color: var(--accent); }

/* ============================ small shared bits ======================= */
.page-sub { margin: 3px 0 0; color: var(--muted, #64748b); font-size: 13px; max-width: 70ch; }
.opt { color: var(--muted, #94a3b8); font-weight: 400; font-size: 12px; }
.inline-form { display: inline-flex; margin: 0; }
.btn-xs { padding: 5px 9px; font-size: 12px; gap: 4px; }
.btn-xs-danger { color: var(--danger, #dc2626); }
.btn-xs-danger:hover { background: rgba(220,38,38,.08); border-color: var(--danger, #dc2626); }
.subfilter { display: flex; gap: 8px; margin: 4px 0 16px; flex-wrap: wrap; }
.subfilter .chip { cursor: pointer; text-decoration: none; }
.chip-on { background: var(--accent); color: #fff; border-color: var(--accent); }
.check-row { display: flex; flex-wrap: wrap; gap: 18px; }
.big-check { font-weight: 600; }
.section-title { font-weight: 700; font-size: 14px; }
.cron-hint {
    display: flex; align-items: flex-start; gap: 8px; margin-top: 16px;
    padding: 12px 14px; border: 1px dashed var(--line); border-radius: 10px;
    background: rgba(13,148,136,.04); font-size: 13px; color: var(--muted, #475569);
}
.cron-hint code { background: rgba(2,6,23,.06); padding: 2px 6px; border-radius: 5px; }
.email-count-note { margin-left: 12px; color: var(--muted, #64748b); font-size: 13px; align-self: center; }
.mini-track { height: 6px; border-radius: 999px; background: rgba(2,6,23,.08); overflow: hidden; max-width: 160px; }
.mini-fill { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

/* ============================ announcement popup ====================== */
.announce-overlay { display: none; align-items: center; justify-content: center; }
.announce-overlay.is-open { display: flex; }
.announce-card { position: relative; max-width: 460px; width: 92%; text-align: left; padding: 26px; }
.announce-x {
    position: absolute; top: 12px; right: 12px; border: 0; background: none; color: var(--muted, #94a3b8);
    cursor: pointer; padding: 4px; border-radius: 6px;
}
.announce-x:hover { background: rgba(2,6,23,.06); color: var(--ink); }
.announce-title { margin: 0 0 10px; font-size: 19px; }
.announce-title[hidden] { display: none; }
.announce-body { color: var(--ink); line-height: 1.6; }
.announce-body :is(h2,h3) { margin: 12px 0 6px; }
.announce-body p { margin: 0 0 10px; }

/* ============================ maintenance page ======================== */
/* Maintenance page — full-viewport, theme-aware. Scoped tokens so light/dark
   both look considered. Covers the whole screen regardless of the wrapper. */
.maint {
    --m-bg: #eef2f7; --m-glow: rgba(13,148,136,.16); --m-glow-2: rgba(56,189,248,.12);
    --m-card: #ffffff; --m-card-brd: #e7ecf2; --m-ink: #0f172a; --m-muted: #647084;
    --m-accent: #0d9488; --m-accent-soft: rgba(13,148,136,.12); --m-line: #eef1f5;
    --m-shadow: 0 30px 70px -20px rgba(15,23,42,.28);
    position: fixed; inset: 0; z-index: 60; overflow: auto;
    display: grid; place-items: center; padding: 28px;
    color: var(--m-ink);
    background:
        radial-gradient(900px 460px at 22% -8%, var(--m-glow), transparent 60%),
        radial-gradient(760px 420px at 82% 108%, var(--m-glow-2), transparent 60%),
        var(--m-bg);
}
.maint-card {
    position: relative; width: 100%; max-width: 430px; text-align: center;
    padding: 40px 36px 30px; border-radius: 26px;
    background: var(--m-card); border: 1px solid var(--m-card-brd);
    box-shadow: var(--m-shadow);
    animation: maintIn .5s cubic-bezier(.2,.7,.25,1) both;
}
.maint-card::before {   /* soft top sheen */
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background: linear-gradient(180deg, rgba(255,255,255,.5), transparent 34%);
    mix-blend-mode: overlay;
}
@keyframes maintIn { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }

.maint-brand {
    font-weight: 800; font-size: 14px; letter-spacing: .04em; text-transform: uppercase;
    color: var(--m-muted); margin-bottom: 26px;
}
.maint-brand img { max-height: 40px; width: auto; text-transform: none; }

.maint-icon {
    position: relative; width: 74px; height: 74px; margin: 0 auto 22px; border-radius: 22px;
    display: flex; align-items: center; justify-content: center; color: var(--m-accent);
    background: var(--m-accent-soft);
    box-shadow: 0 10px 26px -8px var(--m-accent-soft), inset 0 0 0 1px rgba(13,148,136,.18);
}
.maint-icon::before, .maint-icon::after {   /* pulsing rings */
    content: ""; position: absolute; inset: 0; border-radius: inherit;
    border: 1.5px solid var(--m-accent); opacity: 0; animation: maintPulse 2.8s ease-out infinite;
}
.maint-icon::after { animation-delay: 1.4s; }
@keyframes maintPulse { 0% { opacity: .5; transform: scale(1); } 100% { opacity: 0; transform: scale(1.55); } }

.maint-pill {
    display: inline-flex; align-items: center; gap: 7px; margin-bottom: 14px;
    padding: 5px 12px 5px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
    letter-spacing: .05em; text-transform: uppercase; color: var(--m-accent);
    background: var(--m-accent-soft); border: 1px solid rgba(13,148,136,.22);
}
.maint-pill .dot {
    width: 7px; height: 7px; border-radius: 50%; background: var(--m-accent);
    box-shadow: 0 0 0 0 var(--m-accent); animation: maintDot 1.8s ease-out infinite;
}
@keyframes maintDot {
    0% { box-shadow: 0 0 0 0 rgba(13,148,136,.5); } 70% { box-shadow: 0 0 0 7px rgba(13,148,136,0); } 100% { box-shadow: 0 0 0 0 rgba(13,148,136,0); }
}

.maint-card h1 { margin: 0 0 12px; font-size: 27px; line-height: 1.15; font-weight: 800; color: var(--m-ink); text-wrap: balance; }
.maint-body { color: var(--m-muted); line-height: 1.65; font-size: 15px; }
.maint-body p { margin: 0 0 10px; }
.maint-body p:last-child { margin-bottom: 0; }

.maint-progress {
    position: relative; height: 5px; margin: 26px auto 4px; max-width: 200px;
    border-radius: 999px; overflow: hidden; background: var(--m-accent-soft);
}
.maint-progress span {
    position: absolute; top: 0; left: 0; height: 100%; width: 40%; border-radius: inherit;
    background: linear-gradient(90deg, transparent, var(--m-accent), transparent);
    animation: maintBar 1.9s ease-in-out infinite;
}
@keyframes maintBar { 0% { left: -45%; } 100% { left: 105%; } }

.maint-admin {
    margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--m-line);
    display: flex; flex-direction: column; gap: 14px; align-items: center;
}
.maint-admin > span { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--m-muted); }
.maint-admin-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

@media (prefers-color-scheme: dark) {
    .maint {
        --m-bg: #070b14; --m-glow: rgba(13,148,136,.22); --m-glow-2: rgba(56,189,248,.12);
        --m-card: #0f1728; --m-card-brd: #1e2a3f; --m-ink: #eaf0f8; --m-muted: #93a1b5;
        --m-accent: #2dd4bf; --m-accent-soft: rgba(45,212,191,.12); --m-line: #1e2a3f;
        --m-shadow: 0 34px 80px -24px rgba(0,0,0,.7);
    }
    .maint-card::before { background: linear-gradient(180deg, rgba(255,255,255,.06), transparent 34%); }
}
:root[data-theme="dark"] .maint {
    --m-bg: #070b14; --m-glow: rgba(13,148,136,.22); --m-glow-2: rgba(56,189,248,.12);
    --m-card: #0f1728; --m-card-brd: #1e2a3f; --m-ink: #eaf0f8; --m-muted: #93a1b5;
    --m-accent: #2dd4bf; --m-accent-soft: rgba(45,212,191,.12); --m-line: #1e2a3f;
    --m-shadow: 0 34px 80px -24px rgba(0,0,0,.7);
}
:root[data-theme="dark"] .maint-card::before { background: linear-gradient(180deg, rgba(255,255,255,.06), transparent 34%); }
:root[data-theme="light"] .maint {
    --m-bg: #eef2f7; --m-glow: rgba(13,148,136,.16); --m-glow-2: rgba(56,189,248,.12);
    --m-card: #ffffff; --m-card-brd: #e7ecf2; --m-ink: #0f172a; --m-muted: #647084;
    --m-accent: #0d9488; --m-accent-soft: rgba(13,148,136,.12); --m-line: #eef1f5;
    --m-shadow: 0 30px 70px -20px rgba(15,23,42,.28);
}
@media (prefers-reduced-motion: reduce) {
    .maint-card, .maint-icon::before, .maint-icon::after, .maint-pill .dot, .maint-progress span { animation: none; }
    .maint-icon::before, .maint-icon::after { display: none; }
}

/* read-only static field (e.g. fixed account currency in the wallet popup) */
.fld-static {
    background: rgba(2,6,23,.04); color: var(--muted, #475569);
    cursor: default; border-style: dashed;
}
.fld-static:focus { outline: none; box-shadow: none; }
@media (prefers-color-scheme: dark) {
    .fld-static { background: rgba(148,163,184,.10); color: #94a3b8; }
}

/* transaction edit page */
.edit-cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }
.panel-pad { padding: 24px 26px; }
.review-summary { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 9px; }
.review-summary > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13px; }
.review-summary span { color: var(--muted, #64748b); }
.review-summary strong { font-weight: 600; }
[data-review-transfer][hidden] { display: none; }
@media (max-width: 860px) { .edit-cols { grid-template-columns: 1fr; } }

/* ============================ global responsive pass ================== */
@media (max-width: 820px) {
    /* Wide content (tables) scrolls inside its own box — the page never scrolls sideways. */
    .panel { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table { min-width: 560px; }

    .page-header { flex-wrap: wrap; gap: 10px; }
    .header-actions { flex-wrap: wrap; }
    .form-actions { flex-wrap: wrap; }

    .kv { grid-template-columns: 1fr; gap: 4px; }

    /* Collapse the large two-column content grids. */
    .form-two, .split-cols, .edit-cols, .release-grid,
    .dash-grid-hero, .dash-grid-2, .dash-cols, .fin-grid, .gauge-frame,
    .sum-cards { grid-template-columns: 1fr !important; }

    /* API "required fields" editor stacks; drop its column header. */
    .field-row { grid-template-columns: 1fr; }
    .fields-editor-head { display: none; }
}
@media (max-width: 560px) {
    .kpi-strip .kpi { flex-basis: 50%; }
    .metric-grid, .tally-grid, .status-tiles { grid-template-columns: 1fr 1fr; }
}

/* services multi-select + icon actions */
.col-check { width: 34px; text-align: center; }
.col-check input { width: 16px; height: 16px; cursor: pointer; }
.icon-act {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px;
    background: var(--surface, #fff); color: var(--muted, #475569); cursor: pointer;
    transition: border-color .12s, background .12s, color .12s;
}
.icon-act:hover { border-color: var(--accent); color: var(--accent); background: rgba(13,148,136,.06); }
.icon-act-warn:hover { border-color: var(--warn, #d97706); color: var(--warn, #d97706); background: rgba(217,119,6,.08); }
.bulk-bar {
    display: flex; align-items: center; gap: 10px; margin: 0 0 14px;
    padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px;
    background: rgba(13,148,136,.05);
}
.bulk-count { margin-right: auto; font-size: 13px; color: var(--ink); }

/* service sync page */
.sync-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 18px 0 12px; }
.sync-search { flex: 1 1 320px; margin: 0; }
.sync-opt { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted, #475569); white-space: nowrap; }

/* collapsible category group rows (single aligned table) */
.sync-table .col-check input { width: 16px; height: 16px; cursor: pointer; }
.sync-ghead > td { background: var(--surface-2, #f7f9fb); border-top: 1px solid var(--line); }
.sync-ghead td[colspan] { padding: 0; }
.sync-ghead td[colspan] > * { vertical-align: middle; }
.sync-ghead .group-toggle {
    display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
    border: 0; background: none; color: var(--muted, #64748b); cursor: pointer; border-radius: 6px;
    transition: transform .15s, background .12s; margin: 8px 4px 8px 0;
}
.sync-ghead .group-toggle:hover { background: rgba(2,6,23,.06); }
.sync-ghead.is-collapsed .group-toggle { transform: rotate(-90deg); }
.ghead-name { font-weight: 700; font-size: 13.5px; }
.ghead-meta { margin-left: 12px; font-size: 12px; color: var(--muted, #64748b); white-space: nowrap; }
.ghead-meta strong { color: var(--ok, #0d9488); }
.sync-ghead.is-allsynced .ghead-name { color: var(--muted, #64748b); font-weight: 600; }
.sync-ghead:hover > td { background: rgba(13,148,136,.05); }
.sync-row.is-synced { opacity: .62; }
.sync-row.is-synced .col-check input { cursor: not-allowed; }
.sync-actionbar { display: flex; align-items: center; gap: 14px; margin: 0 0 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(13,148,136,.05); flex-wrap: wrap; }
.sync-selall { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
.sync-selcount { margin-right: auto; font-size: 13px; color: var(--ink); }
.sync-empty { padding: 26px; text-align: center; color: var(--muted, #64748b); font-size: 13px; }
.icon-act-danger:hover { border-color: var(--danger, #dc2626); color: var(--danger, #dc2626); background: rgba(220,38,38,.08); }

/* searchable select (combobox) */
.combo { position: relative; }
.combo-trigger {
    width: 100%; display: flex; align-items: center; gap: 8px; text-align: left;
    padding: 10px 12px; border: 1px solid var(--line-strong, var(--line)); border-radius: var(--radius-sm);
    background: var(--surface, #fff); color: var(--ink); font: inherit; cursor: pointer;
}
.combo-trigger:hover { border-color: var(--accent); }
.combo-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-label.is-placeholder { color: var(--muted, #94a3b8); }
.combo-trigger .ico { flex: none; color: var(--muted, #64748b); transition: transform .15s; }
.combo.is-open .combo-trigger .ico { transform: rotate(180deg); }
.combo-panel {
    position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 6px);
    background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 12px;
    box-shadow: 0 18px 40px rgba(2,6,23,.16); overflow: hidden; max-width: 100%;
}
.combo-search { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.combo-search .ico { color: var(--muted, #94a3b8); flex: none; }
.combo-search input { flex: 1; border: 0; outline: none; font: inherit; background: none; color: var(--ink); }
.combo-list { max-height: 320px; overflow-y: auto; padding: 6px; }
.combo-opt {
    padding: 9px 11px; border-radius: 8px; cursor: pointer; font-size: 13.5px; color: var(--ink);
    white-space: normal; overflow-wrap: anywhere; line-height: 1.35;
}
.combo-opt:hover { background: rgba(13,148,136,.08); }
.combo-opt.is-selected { background: rgba(13,148,136,.12); font-weight: 600; }
.combo-opt[hidden] { display: none; }
.combo-code { color: var(--muted, #94a3b8); font-family: var(--font-mono); font-size: 12px; }
.combo-empty { padding: 16px 11px; text-align: center; color: var(--muted, #64748b); font-size: 13px; }

/* keep the service edit/new form a comfortable reading width on large screens */
form[data-seo-autofill] { max-width: 1040px; }

/* ============================ security / admin UI ===================== */
/* honeypot — visually + a11y hidden, still submitted by bots */
.hp-field { position: absolute !important; left: -9999px; top: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* permission grid (admin form) */
.perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; margin-top: 4px; }
@media (max-width: 640px) { .perm-grid { grid-template-columns: 1fr; } }
.perm-check { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.perm-list { display: grid; gap: 8px; margin-top: 6px; }
.perm-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.perm-row .ico { color: var(--ok, #0d9488); flex: none; }
.perm-row span.muted .ico, .perm-row .muted { color: var(--muted, #94a3b8); }

/* 2FA + code inputs */
.code-input { letter-spacing: .4em; font-family: var(--font-mono); text-align: center; font-size: 18px; }
.twofa-hint { color: var(--muted, #64748b); font-size: 13px; margin: 0 0 14px; }
.twofa-back { margin-top: 14px; font-size: 13px; }
.twofa-steps { margin: 0; padding-left: 20px; display: grid; gap: 20px; }
.twofa-steps > li { padding-left: 6px; }
.twofa-qr { display: flex; gap: 20px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
#totp-qr { width: 176px; height: 176px; }
#totp-qr:empty { width: auto; height: auto; }
.twofa-key { display: flex; flex-direction: column; gap: 4px; }
.twofa-secret { font-size: 16px; letter-spacing: .1em; background: rgba(2,6,23,.05); padding: 8px 10px; border-radius: 8px; }
.disable-2fa { margin-top: 12px; display: grid; gap: 6px; }

/* error pages */
.errpage { max-width: 520px; margin: 8vh auto; text-align: center; }
.errcode { font-size: 68px; font-weight: 800; color: var(--accent); line-height: 1; letter-spacing: -.02em; }
.errpage h1 { margin: 8px 0 6px; }

/* ============================ service live preview ==================== */
.svc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 22px; align-items: start; }
.svc-layout form[data-seo-autofill] { max-width: none; }
@media (max-width: 980px) { .svc-layout { grid-template-columns: 1fr; } .svc-preview { order: -1; } }

.svc-preview { position: sticky; top: 16px; }
.svc-preview-head {
    display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700;
    letter-spacing: .1em; text-transform: uppercase; color: var(--muted, #94a3b8); margin: 0 0 10px 2px;
}
.svc-preview-head .ico { color: var(--accent); }
.svc-card { background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 20px; }
.svc-title { margin: 0 0 8px; font-size: 18px; line-height: 1.3; }
.svc-title.is-empty { color: var(--muted, #94a3b8); font-weight: 600; }
.svc-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.svc-price { font-size: 20px; font-weight: 800; color: var(--accent); }
.svc-delivery { font-size: 12.5px; color: var(--muted, #64748b); }
.svc-desc { font-size: 13px; color: var(--ink); line-height: 1.55; }
.svc-desc:empty { display: none; }
.svc-desc :is(h2, h3) { font-size: 14px; margin: 10px 0 4px; }
.svc-desc p { margin: 0 0 8px; }
.svc-order { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 16px; }
.svc-order-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted, #64748b); margin-bottom: 12px; }
.svc-order-fields { display: grid; gap: 12px; margin-bottom: 14px; }
.svc-order-empty { font-size: 12.5px; color: var(--muted, #94a3b8); margin: 0; }
.pv-field { display: flex; flex-direction: column; gap: 5px; }
.pv-flabel { font-size: 12px; font-weight: 600; color: var(--muted, #475569); }
.pv-req { color: var(--danger, #dc2626); }
.pv-field input, .pv-field select, .pv-field textarea {
    width: 100%; padding: 8px 10px; border: 1px solid var(--line-strong, var(--line)); border-radius: 8px;
    background: #fafbfc; color: var(--muted, #64748b); font-size: 13px; height: auto;
}

/* ============================ loading spinner / overlay =============== */
.btn-spinner {
    display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px;
    border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
    animation: spin .6s linear infinite;
}
.btn-spinner.big { width: 26px; height: 26px; border-width: 3px; margin: 0 0 12px; color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }
.btn.is-loading { opacity: .9; cursor: progress; }
.load-overlay {
    position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
    background: rgba(2, 6, 23, .38); backdrop-filter: blur(1px);
}
.load-box {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    background: var(--surface, #fff); color: var(--ink); padding: 26px 34px; border-radius: 16px;
    box-shadow: 0 20px 50px rgba(2,6,23,.25); font-size: 14px; font-weight: 600;
}

/* sync status legend + price change */
.sync-legend { display: flex; gap: 18px; flex-wrap: wrap; margin: 0 0 12px; font-size: 12.5px; color: var(--muted, #64748b); }
.sync-legend span { display: inline-flex; align-items: center; gap: 6px; }
.price-was { display: block; font-size: 11px; color: var(--muted, #94a3b8); text-decoration: line-through; }

/* ---- Categories: quick price update tool -------------------------------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.price-tool { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.price-tool-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.pt-title { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; color: var(--ink); }
.pt-title svg { color: var(--accent); }
.pt-count { font-size: 13px; color: var(--muted); }
.pt-count strong { color: var(--accent); }

.price-builder { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* segmented control */
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg-btn { appearance: none; border: 0; background: transparent; cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted); padding: 7px 14px; border-radius: 7px; display: inline-flex; align-items: center; gap: 5px; transition: background .12s, color .12s, box-shadow .12s; }
.seg-btn:hover { color: var(--ink); }
.seg-btn.is-on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(15,27,45,.12); }
.seg-sign { font-weight: 800; font-size: 15px; line-height: 1; }
.seg-unit .seg-btn { min-width: 44px; justify-content: center; }
.seg-unit .seg-btn.is-on { background: var(--accent); color: var(--accent-ink); box-shadow: none; }

.price-amt { display: inline-flex; align-items: center; gap: 8px; }
.price-amt-input { width: 96px; text-align: center; font-size: 18px; font-weight: 700; color: var(--ink); padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; }
.price-amt-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.price-preview { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; padding: 8px 14px; background: var(--accent-soft); border-radius: 10px; font-size: 13.5px; }
.pp-eg { color: var(--muted); }
.pp-arrow { display: inline-flex; color: var(--accent-strong); }
.pp-result { font-weight: 800; color: var(--accent-strong); font-variant-numeric: tabular-nums; }

.price-tool-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.margin-pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.margin-pill.tone-ok { background: var(--accent-soft); color: var(--accent-strong); }
.margin-pill.tone-danger { background: #fdecec; color: #b42318; }
.margin-pill.tone-muted { background: var(--bg); color: var(--muted); }

@media (max-width: 780px) {
    .price-preview { margin-left: 0; flex: 1 1 100%; justify-content: center; }
    .price-tool-actions .btn { flex: 1 1 auto; justify-content: center; }
}
@media (max-width: 480px) {
    .seg { flex: 1 1 100%; }
    .seg:not(.seg-unit) .seg-btn { flex: 1 1 auto; justify-content: center; }
    .price-amt { flex: 1 1 100%; }
    .price-amt-input { flex: 1 1 auto; width: auto; }
}

/* ---- Dashboard price-update popup --------------------------------------- */
.price-pop { max-width: 460px; width: 100%; }
.price-pop-head { display: flex; align-items: flex-start; gap: 12px; }
.price-pop-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft, #e6f4f1); color: var(--accent, #0d9488); flex: 0 0 auto; }
.price-pop-head h3 { margin: 0; font-size: 17px; }
.price-pop-list { margin-top: 14px; border: 1px solid var(--border, #e5e7eb); border-radius: 10px; overflow: hidden; max-height: 320px; overflow-y: auto; }
.price-pop-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--border, #eef0f2); font-size: 13.5px; }
.price-pop-row:last-child { border-bottom: 0; }
.ppr-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ppr-move { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.ppr-old { color: var(--muted, #9aa4af); text-decoration: line-through; }
.ppr-new { font-weight: 700; }
.ppr-arrow { display: inline-flex; }
.price-pop-more { padding: 9px 12px; font-size: 12.5px; color: var(--muted, #9aa4af); background: var(--panel-2, #f9fafb); }

/* ---- System log --------------------------------------------------------- */
.log-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.log-search { flex: 1 1 260px; min-width: 0; margin: 0; }
.log-filters .fee-type { flex: 0 0 auto; min-width: 150px; }
.log-table th, .log-table td { vertical-align: top; }
.log-table .nowrap { white-space: nowrap; }
.log-table .cell-sub { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.log-table .cell-sub svg { vertical-align: -1px; }

.banlist { margin-bottom: 14px; }
.banlist-head { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink); margin-bottom: 10px; }
.banlist-head svg { color: #b42318; }
.banlist-items { display: flex; flex-wrap: wrap; gap: 8px; }
.ban-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 6px 5px 11px; background: #fdecec; color: #b42318; border-radius: 999px; font-size: 12.5px; }
.ban-chip .ban-reason { color: #8a3b32; opacity: .85; }
.ban-unban { border: 0; background: rgba(180,35,24,.14); color: #b42318; width: 20px; height: 20px; border-radius: 50%; cursor: pointer; font-size: 12px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.ban-unban:hover { background: rgba(180,35,24,.28); }
@media (max-width: 680px) {
    .log-filters .fee-type, .log-filters .btn { flex: 1 1 auto; }
}

/* ---- Per-profile recent activity --------------------------------------- */
.activity-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.activity-item { display: flex; align-items: flex-start; gap: 10px; }
.activity-item .pill { flex: 0 0 auto; margin-top: 1px; }
.activity-meta { min-width: 0; font-size: 12.5px; color: var(--ink); }
.activity-meta .cell-sub { display: block; margin-top: 1px; color: var(--muted); font-size: 11.5px; }

/* ---- Notification panel: clear + view all + full page ------------------- */
.notif-head-actions { display: inline-flex; align-items: center; gap: 12px; }
.notif-clear-danger { color: #b42318; }
.notif-foot { display: block; text-align: center; padding: 11px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; }
.notif-foot:hover { background: var(--bg); }
.notif-page-list .notif-item { padding: 14px 18px; }

/* ---- Categories: reorder column ---------------------------------------- */
.col-order { width: 118px; }
.cat-table td.col-order { white-space: nowrap; }
.drag-handle { display: inline-flex; align-items: center; color: var(--muted); cursor: grab; vertical-align: middle; margin-right: 4px; }
.drag-handle:active { cursor: grabbing; }
.sort-input { width: 52px; text-align: center; font-variant-numeric: tabular-nums; padding: 5px 6px; border: 1px solid var(--line-strong); border-radius: 7px; font-size: 13px; vertical-align: middle; background: #fff; }
.sort-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
tr[data-cat-row].is-dragging { opacity: .5; background: var(--accent-soft); }
tr[data-cat-row][draggable="true"] { cursor: default; }

/* Social media label (Settings → Storefront) */
.social-label { display: inline-flex; align-items: center; gap: 7px; }
.social-label-ico { display: inline-grid; place-items: center; width: 20px; height: 20px; color: var(--muted); }
.social-label-ico svg { display: block; }

/* Colour picker field (Settings → Storefront → Brand colours) */
.color-field { display: flex; align-items: center; gap: 12px; }
.color-field input[type="color"] {
    width: 52px; height: 40px; padding: 0; border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm); background: none; cursor: pointer;
}
.color-field input[type="color"]::-webkit-color-swatch-wrapper { padding: 4px; }
.color-field input[type="color"]::-webkit-color-swatch { border: none; border-radius: 5px; }
.color-hex { font-size: 13px; color: var(--muted); min-width: 68px; text-transform: uppercase; }

/* Locked "Powered by Zebroon" attribution (admin sidebar) */
.sidebar-foot .powered-by { margin-top: 10px; font-size: 11px; color: var(--faint); }
.powered-by a { color: var(--accent); font-weight: 600; }
.powered-by a:hover { text-decoration: underline; }

/* Storefront text editor (Content → Storefront text) */
.lang-enable { display: flex; flex-wrap: wrap; gap: 8px; }
.lang-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); cursor: pointer; font-size: 13px; user-select: none; }
.lang-chip.is-on { background: var(--accent-soft); border-color: transparent; color: var(--accent-strong); font-weight: 600; }
.lang-chip input { margin: 0; }
.lang-chip em { font-style: normal; color: var(--faint); font-size: 11px; }
.lang-switch { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 20px 0 14px; }
.lang-switch-label { font-size: 13px; color: var(--muted); margin-right: 4px; }
.lang-tab { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--ink); }
.lang-tab:hover { border-color: var(--line-strong); }
.lang-tab.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.text-group .section-title { margin: 20px 0 10px; }

/* Storefront text editor — collapsible groups + floating save */
.text-editor { padding-bottom: 90px; }
.text-actions-bar { display: flex; gap: 8px; margin-bottom: 12px; }
.tg { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.tg > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 15px 22px; user-select: none; }
.tg > summary::-webkit-details-marker { display: none; }
.tg > summary:hover { background: var(--bg); }
.tg-chev { color: var(--faint); display: inline-flex; transition: transform .18s ease; flex: none; }
.tg[open] > summary .tg-chev { transform: rotate(90deg); }
.tg-name { font-weight: 650; font-size: 14.5px; flex: 1; min-width: 0; }
.tg-meta { font-size: 12px; color: var(--faint); white-space: nowrap; }
.tg-meta.is-done { color: var(--ok); }
.tg-meta.is-part { color: var(--warn); }
.tg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 16px 20px; padding: 18px 22px 22px; border-top: 1px solid var(--line); }
.tg-grid .span-2 { grid-column: 1 / -1; }
.tfield label { display: block; font-size: 12.5px; font-weight: 550; margin-bottom: 6px; color: var(--ink); }
.tfield label .small { font-weight: 400; }
.tfield input, .tfield textarea {
    width: 100%; font: inherit; font-size: 14px; padding: 9px 12px; border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); outline: none;
}
.tfield textarea { resize: vertical; min-height: 62px; }
.tfield input:focus, .tfield textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.fab-save {
    position: fixed; right: 26px; bottom: 24px; z-index: 60;
    display: inline-flex; align-items: center; gap: 9px;
    padding: 14px 22px; border: none; border-radius: 999px; cursor: pointer;
    background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 650; font-size: 14.5px;
    box-shadow: 0 10px 26px -8px var(--accent), 0 4px 10px rgba(15,27,45,.18);
    transition: transform .12s, background .15s;
}
.fab-save:hover { background: var(--accent-strong); transform: translateY(-2px); }
.fab-save:active { transform: translateY(0); }

@media (max-width: 640px) {
    .tg-grid { grid-template-columns: 1fr; }
    .fab-save { right: 16px; bottom: 16px; left: 16px; justify-content: center; }
}

/* Languages dropdown (Settings → Storefront) */
.lang-picker { position: relative; max-width: 560px; }
.lang-picker > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); }
.lang-picker > summary::-webkit-details-marker { display: none; }
.lang-picker .lp-ico { color: var(--muted); display: inline-flex; flex: none; }
.lang-picker .lp-summary { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.lang-picker .lp-count { flex: none; font-size: 12px; font-weight: 700; background: var(--accent-soft); color: var(--accent-strong); border-radius: 999px; padding: 2px 9px; }
.lang-picker .lp-chev { color: var(--faint); display: inline-flex; flex: none; transition: transform .18s; }
.lang-picker[open] .lp-chev { transform: rotate(180deg); }
.lang-picker-menu { position: absolute; z-index: 40; left: 0; right: 0; margin-top: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px; max-height: 320px; overflow-y: auto; }
.lang-opt { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.lang-opt:hover { background: var(--bg); }
.lang-opt .lo-name { flex: 1; }
.lang-opt em { font-style: normal; font-size: 11px; color: var(--faint); }
.lang-opt.is-on { color: var(--accent-strong); font-weight: 600; }
.lang-opt input { margin: 0; }
@media (max-width: 640px) { .lang-picker-menu { grid-template-columns: 1fr; } }

/* Editor: manage-languages link + a touch more field room */
.lang-add { display: inline-flex; align-items: center; gap: 5px; padding: 7px 12px; border-radius: 999px; font-size: 12.5px; color: var(--accent-strong); font-weight: 600; }
.lang-add:hover { background: var(--accent-soft); }
.tfield input, .tfield textarea { padding: 11px 13px; }

/* Admin panel language switcher (top bar) */
.topbar-site {
    display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px;
    border-radius: 999px; border: 1px solid var(--accent-soft); background: var(--accent-soft);
    color: var(--accent-strong); font-weight: 600; font-size: 13px; white-space: nowrap;
}
.topbar-site:hover { border-color: var(--accent); color: var(--accent-strong); filter: brightness(.98); }
.topbar-site svg { flex: none; }
@media (max-width: 640px) { .topbar-site span { display: none; } .topbar-site { padding: 0 11px; } }

.adminlang { position: relative; }
.adminlang > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-weight: 600; font-size: 13px; }
.adminlang > summary::-webkit-details-marker { display: none; }
.adminlang > summary:hover { color: var(--ink); border-color: var(--line-strong); }
.adminlang-drop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(15,27,45,.16); padding: 6px; z-index: 50; max-height: 340px; overflow-y: auto; }
.adminlang-drop a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 8px; font-size: 14px; color: var(--ink); }
.adminlang-drop a:hover { background: var(--bg); }
.adminlang-drop a.is-active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.adminlang-drop a em { font-style: normal; font-size: 11px; color: var(--faint); }

/* Admin RTL (Arabic) basics */
[dir="rtl"] .nav-link span, [dir="rtl"] .subnav-link { text-align: right; }
[dir="rtl"] .adminlang-drop { right: auto; left: 0; }
[dir="rtl"] .table th, [dir="rtl"] .brand span { letter-spacing: normal; }

/* Storefront text editor — group cards live inside one main card */
.text-main { margin-bottom: 4px; }
.text-main .text-actions-bar { margin-bottom: 14px; }
.text-main .tg { background: var(--bg); }
.text-main .tg > summary:hover { background: var(--surface); }
.text-main .tg:last-child { margin-bottom: 0; }

/* Storefront text editor — responsive on small screens */
.page-header h1, .page-header p { overflow-wrap: anywhere; }
@media (max-width: 640px) {
    .text-main { padding: 16px 14px; }
    .text-main .tg > summary { padding: 14px 16px; }
    .text-main .tg-grid { padding: 14px 16px 18px; }
    .text-editor .lang-switch { row-gap: 8px; }
    .text-editor .form-actions .btn, .text-editor > .form-actions { width: 100%; }
    .fab-save { left: 14px; right: 14px; }
}

/* Storefront text editor — never overflow / clip, always reflow */
.text-editor { max-width: 100%; }
.text-main, .text-main .tg, .tg-grid { min-width: 0; max-width: 100%; }
.text-editor .form-hint, .text-editor .lang-switch { overflow-wrap: anywhere; }
.tfield { min-width: 0; }
.tfield input, .tfield textarea { min-width: 0; max-width: 100%; }

/* Editor: the .form is the single main card; groups sit inside it as grey cards */
.form.text-editor { padding: 10px 24px 90px; }
.text-main { padding: 0; margin-bottom: 0; }
.text-main .tg { background: var(--bg); }
.text-main .tg:last-child { margin-bottom: 0; }
@media (max-width: 640px) {
    .form.text-editor { padding: 8px 14px 84px; }
    .text-main { padding: 0; }
}

/* Payment option descriptions list + popup (Settings → Payment gateways) */
.pm-list { display: flex; flex-direction: column; gap: 8px; }
.pm-row { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line-2); border-radius: 12px; padding: 11px 14px; }
.pm-row-ico { display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center; flex: none; }
.pm-row-main { display: flex; flex-direction: column; gap: 1px; margin-right: auto; min-width: 0; }
.pm-row-status { font-size: 12px; color: var(--muted); }
.pm-row-status.is-set { color: var(--ok, #10794f); }

/* Payment details form builder (gateway setup popup) */
.pd-builder { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.pd-row { display: flex; gap: 8px; align-items: center; }
.pd-row .pd-label { flex: 0 0 38%; }
.pd-row .pd-value { flex: 1; }
.pd-row .pd-remove { flex: none; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; }
.pd-row .pd-remove:hover { border-color: var(--danger, #c0392b); color: var(--danger, #c0392b); }

/* Payment-proof compact row + inline toggle (transaction review) */
.proof-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--line-2); border-radius: 12px; }
.proof-file { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; margin-right: auto; }
.proof-preview img { max-width: 100%; }

/* ---------- Software update UI (dashboard banner + license section) ---------- */
.update-banner{ display:flex; align-items:center; gap:14px; margin:0 0 18px; padding:14px 18px; border-radius:var(--radius, 14px); text-decoration:none;
    background:var(--accent-soft); border:1px solid var(--accent); color:var(--ink); transition:border-color .15s, transform .15s; }
.update-banner:hover{ border-color:var(--accent-strong); transform:translateY(-1px); }
.update-banner-ico{ width:38px; height:38px; border-radius:11px; display:grid; place-items:center; background:var(--accent); color:#fff; flex:none; }
.update-banner-txt{ display:flex; flex-direction:column; gap:2px; flex:1; min-width:0; font-size:13.5px; }
.update-banner-txt b{ font-size:14.5px; color:var(--ink); }
.update-banner-txt span{ color:var(--muted); }
.update-banner-cta{ display:inline-flex; align-items:center; gap:6px; font-weight:700; color:var(--accent-strong); white-space:nowrap; }
.update-row{ display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.update-head{ display:flex; align-items:center; gap:8px; font-size:14.5px; }
.update-row.is-available .update-head{ color:var(--accent-strong); }
.update-row.is-locked .update-head{ color:var(--warn); }
.update-actions{ display:flex; align-items:center; gap:12px; margin-top:14px; padding-top:14px; border-top:1px solid var(--line); flex-wrap:wrap; }
.update-block{ display:flex; flex-direction:column; gap:14px; }
.update-notes{ background:var(--accent-soft); border:1px solid var(--line); border-radius:var(--radius-sm, 10px); padding:12px 14px; }
.update-notes-label{ display:flex; align-items:center; gap:6px; font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.03em; color:var(--accent-strong); margin-bottom:6px; }
.update-notes-body{ font-size:13.5px; color:var(--ink); line-height:1.55; }
