/* MASTER Control - Platform Control Center. Same design language as MASTER Business Suite (the
   owner's dashboard): Cairo, a quiet grey canvas, a white rail and top bar, white cards with an 8px
   radius, a light border and a soft shadow, KPI cards with a tinted icon tile and a strong number.
   MASTER Control keeps its own logo and its teal accent so it reads as the control side of the
   same product. Logical properties everywhere so Arabic (RTL) and English (LTR) mirror exactly. */
@font-face { font-family: 'Cairo'; font-style: normal; font-display: swap; font-weight: 400; src: url(/assets/fonts/cairo-arabic-400-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: 'Cairo'; font-style: normal; font-display: swap; font-weight: 600; src: url(/assets/fonts/cairo-arabic-600-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: 'Cairo'; font-style: normal; font-display: swap; font-weight: 700; src: url(/assets/fonts/cairo-arabic-700-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: 'Cairo'; font-style: normal; font-display: swap; font-weight: 400; src: url(/assets/fonts/cairo-latin-400-normal.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+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Cairo'; font-style: normal; font-display: swap; font-weight: 600; src: url(/assets/fonts/cairo-latin-600-normal.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+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Cairo'; font-style: normal; font-display: swap; font-weight: 700; src: url(/assets/fonts/cairo-latin-700-normal.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+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  --sidebar-w: 176px;
  --bg: #e4e7eb; --surface: #ffffff; --surface-2: #f8fafc; --border: #d1d5db; --border-soft: #e5e7eb; --border-strong: #c3c9d2;
  --text: #111827; --text-2: #4b5563; --text-3: #6b7280;
  --rail: #ffffff; --rail-line: #d6dbe1; --rail-text: #111827; --rail-icon: #334155;
  --accent: #0d9488; --accent-2: #0f766e; --accent-soft: rgba(13, 148, 136, .10); --accent-line: rgba(13, 148, 136, .32); --focus: #14b8a6;
  --nav-hover-bg: rgba(13, 148, 136, .06); --nav-hover-line: rgba(13, 148, 136, .16);
  --ok: #16a34a; --ok-bg: rgba(22, 163, 74, .12); --warn: #d97706; --warn-bg: rgba(217, 119, 6, .12); --bad: #dc2626; --bad-bg: rgba(220, 38, 38, .10); --info: #2563eb; --info-bg: rgba(37, 99, 235, .10); --muted: #64748b; --muted-bg: #eef1f5;
  --radius: 8px; --radius-sm: 7px; --shadow: 0 4px 12px rgba(0, 0, 0, .03); --shadow-bar: 0 4px 18px rgba(30, 41, 59, .07);
  --font: "Cairo", -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1522; --surface: #161f2e; --surface-2: #121a28; --border: #263246; --border-soft: #1f2a3c; --border-strong: #334159;
    --text: #e6edf7; --text-2: #a9b7cc; --text-3: #8392a8; --rail: #121a28; --rail-line: #263246; --rail-text: #e6edf7; --rail-icon: #a9b7cc;
    --accent-soft: rgba(45, 212, 191, .14); --accent-line: rgba(45, 212, 191, .35); --nav-hover-bg: rgba(45, 212, 191, .07); --nav-hover-line: rgba(45, 212, 191, .18);
    --ok-bg: rgba(34, 197, 94, .14); --warn-bg: rgba(245, 158, 11, .14); --bad-bg: rgba(248, 113, 113, .14); --info-bg: rgba(96, 165, 250, .14); --muted-bg: #1d2737;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-bar: 0 2px 10px rgba(0, 0, 0, .35);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; line-height: 1.55; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2 { margin: 0; font-weight: 700; }
h1 { font-size: 20px; } h2 { font-size: 15px; }
.muted { color: var(--text-3); }
.mono { font-family: var(--mono); font-size: 12.5px; unicode-bidi: isolate; }
.small { font-size: 12px; }
.code { font-family: var(--mono); font-size: 12px; background: var(--muted-bg); padding: 1px 6px; border-radius: 5px; }
.center { text-align: center; padding-block: 8px; }

/* ---------- shell: white rail and top bar, as in MASTER Business Suite ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  flex: 0 0 var(--sidebar-w); width: var(--sidebar-w); max-width: var(--sidebar-w); min-width: 0;
  background: var(--rail); color: var(--rail-text); border-inline-end: 1px solid var(--rail-line);
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden;
}
.brand { display: flex; align-items: center; gap: 8px; padding: 14px 12px 12px; color: var(--text); text-decoration: none !important; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px; background: linear-gradient(135deg, #14b8a6, #0e7490); color: #fff; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.brand-text strong { font-size: 16px; font-weight: 700; letter-spacing: .04em; color: var(--text); }
.brand-text small { font-size: 10px; color: var(--accent); letter-spacing: .22em; text-transform: uppercase; font-weight: 700; }
.nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 6px 10px 12px; scrollbar-width: thin; }
.nav-group { margin-block-start: 8px; }
.nav-group-label { display: block; padding: 4px 6px 4px; font-size: 11px; font-weight: 700; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-link { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 8px 10px; margin-block-end: 3px; border-radius: var(--radius-sm); border: 1px solid transparent; color: var(--rail-text); font-size: 14px; font-weight: 600; text-decoration: none !important; position: relative; white-space: nowrap; }
.nav-link svg { flex: 0 0 auto; color: var(--rail-icon); }
.nav-text { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.nav-link:hover { background: var(--nav-hover-bg); border-color: var(--nav-hover-line); }
.nav-link.active { background: var(--accent-soft); border-color: var(--accent-line); font-weight: 700; }
.nav-link.active svg { color: var(--accent); }
.sidebar-foot { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-block-start: 1px solid var(--rail-line); min-width: 0; }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-2); font-weight: 700; font-size: 12px; }
.who { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.who strong, .who small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who strong { color: var(--text); font-size: 12.5px; } .who small { color: var(--text-3); font-size: 11px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: 52px; padding-inline: 16px; background: var(--surface); box-shadow: var(--shadow-bar); }
.top-title { min-width: 0; }
.top-kicker { font-size: 12px; color: var(--text-3); font-weight: 600; white-space: nowrap; }
.top-search { position: relative; flex: 1 1 auto; min-width: 0; max-width: 420px; display: flex; align-items: center; gap: 8px; height: 34px; padding-inline: 11px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text-3); }
.top-search input { flex: 1; min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; }
.search-results { position: absolute; top: 42px; inset-inline: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 30px rgba(15, 27, 45, .14); max-height: 360px; overflow: auto; padding: 6px; }
.sr-item { display: grid; grid-template-columns: 90px auto 1fr; gap: 10px; align-items: center; padding: 7px 9px; border-radius: 7px; color: var(--text); text-decoration: none !important; }
.sr-item:hover { background: var(--surface-2); }
.sr-type { font-size: 11px; color: var(--text-3); text-transform: uppercase; }
.sr-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-empty { padding: 10px; color: var(--text-3); }
.top-actions { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.bell { position: relative; }
.bell-count { position: absolute; top: 2px; inset-inline-end: 1px; min-width: 17px; height: 17px; padding-inline: 4px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }
.content { padding: 20px 16px 40px; outline: 0; }
.readonly-note { margin-block-end: 14px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--info-bg); color: var(--info); font-size: 13px; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding-inline: 14px; border-radius: var(--radius); border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn-sm { height: 30px; padding-inline: 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: #fff; } .btn-primary:hover { background: var(--accent-2); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); } .btn-ghost:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn-danger-ghost { background: var(--surface); border-color: color-mix(in srgb, var(--bad) 30%, transparent); color: var(--bad); } .btn-danger-ghost:hover { background: var(--bad-bg); }
.btn:disabled { opacity: .55; cursor: default; }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--border); }
input, select, textarea { font: inherit; color: var(--text); }
.field { display: flex; flex-direction: column; gap: 5px; margin-block-end: 12px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field input, .field select, .field textarea { height: 38px; padding-inline: 11px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); }
.field textarea { height: auto; padding-block: 8px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--focus); outline: 3px solid color-mix(in srgb, var(--focus) 20%, transparent); }
.field.inline { flex-direction: row; align-items: center; margin: 0; }
.req { color: var(--bad); }
.form-error { min-height: 18px; color: var(--bad); font-size: 13px; }
.form-note { margin: 0 0 14px; padding: 9px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; color: var(--text-2); font-size: 13px; }

/* ---------- page structure ---------- */
.page { display: flex; flex-direction: column; gap: 16px; max-width: 1480px; margin-inline: auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 4px 2px; }
.page-sub { margin: 2px 0 0; color: var(--text-3); font-size: 13px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back { font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.back::before { content: "\2190  "; }
[dir="rtl"] .back::before { content: "\2192  "; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 6px; }
.card-body { padding: 10px 16px 16px; min-width: 0; }
.card > .card-body:only-child { padding: 0; }
.card > .card-body:only-child > .empty, .card > .card-body:only-child > div > .empty { margin: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.callout { display: flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-2); font-size: 13px; font-weight: 500; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.kpi { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label icon" "value icon" "hint hint"; align-items: start; gap: 2px 10px; min-height: 92px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); text-align: start; font: inherit; color: inherit; overflow: hidden; }
.kpi-link { cursor: pointer; transition: border-color .15s, box-shadow .15s; } .kpi-link:hover { border-color: var(--accent-line); box-shadow: 0 6px 16px rgba(15, 23, 42, .06); }
.kpi-label { grid-area: label; font-size: 13.5px; color: var(--text-2); font-weight: 600; }
.kpi-value { grid-area: value; align-self: end; margin-block-start: 10px; font-size: 24px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--text); }
.kpi-icon { grid-area: icon; display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius); background: var(--muted-bg); color: var(--muted); }
.kpi-ok .kpi-icon { background: var(--ok-bg); color: var(--ok); } .kpi-warn .kpi-icon { background: var(--warn-bg); color: var(--warn); } .kpi-bad .kpi-icon { background: var(--bad-bg); color: var(--bad); } .kpi-info .kpi-icon { background: var(--info-bg); color: var(--info); }
.kpi:not(.kpi-ok):not(.kpi-warn):not(.kpi-bad):not(.kpi-info):not(.kpi-muted) .kpi-icon { background: var(--accent-soft); color: var(--accent); }
.kpi-bad .kpi-value { color: var(--bad); } .kpi-warn .kpi-value { color: var(--warn); }
.kpi-hint { grid-area: hint; font-size: 12px; color: var(--text-3); }

/* ---------- filters ---------- */
.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-search { display: flex; align-items: center; gap: 7px; height: 36px; padding-inline: 11px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text-3); min-width: 240px; }
.filter-search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--muted-bg); border-radius: 9px; }
.segmented button { height: 28px; padding-inline: 11px; border: 0; border-radius: 7px; background: transparent; color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.segmented button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(15, 27, 45, .12); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { position: sticky; top: 0; padding: 10px 14px; text-align: start; font-size: 12px; font-weight: 700; color: var(--text-2); background: var(--surface-2); border-block-end: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 10px 14px; border-block-end: 1px solid var(--border-soft); vertical-align: middle; }
.table tr:last-child td { border-block-end: 0; }
.table .num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-link { cursor: pointer; } .row-link:hover td { background: var(--surface-2); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.cell-main { display: flex; flex-direction: column; gap: 2px; }
.empty { padding: 26px; text-align: center; color: var(--text-3); }
.empty.error { color: var(--bad); }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 30px; color: var(--text-3); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- badges / states ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 23px; padding-inline: 9px; border-radius: 12px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tone-ok { background: var(--ok-bg); color: var(--ok); }
.tone-warn { background: var(--warn-bg); color: var(--warn); }
.tone-bad { background: var(--bad-bg); color: var(--bad); }
.tone-info { background: var(--info-bg); color: var(--info); }
.tone-muted { background: var(--muted-bg); color: var(--muted); }
.chip { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--muted-bg); color: var(--text-2); font-size: 12px; font-weight: 600; }
.chip-admin { background: var(--accent-soft); color: var(--accent-2); }

.dl { display: grid; grid-template-columns: minmax(110px, 40%) 1fr; gap: 8px 14px; margin: 0; font-size: 13px; }
.dl dt { color: var(--text-3); font-weight: 500; }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- plans ---------- */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.plan { display: flex; flex-direction: column; gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.plan-off { opacity: .7; }
.plan-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.plan-price strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.plan-price span { color: var(--text-3); }
.plan-actions { display: flex; gap: 6px; margin-block-start: auto; }

/* ---------- revenue bars / meters ---------- */
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 30%) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.bar-track, .meter-track { height: 8px; border-radius: 5px; background: var(--muted-bg); overflow: hidden; }
.bar-fill, .meter-fill { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #14b8a6, #0e7490); }
[dir="rtl"] .bar-fill, [dir="rtl"] .meter-fill { background: linear-gradient(270deg, #14b8a6, #0e7490); }
.bar-value { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.meter { display: inline-flex; align-items: center; gap: 8px; min-width: 150px; }
.meter-track { width: 70px; }
.meter-fill.full { background: var(--bad); }
.range { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.range .field input { height: 34px; }
.check-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 9px; font-size: 13px; }
.check-list li { display: flex; align-items: center; gap: 6px; }
.alert-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.alert-item a { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 12px; border-radius: 8px; color: inherit; text-decoration: none !important; }
.alert-item a strong { grid-column: 1 / -1; }

/* ---------- modal / toasts ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(8, 15, 28, .45); opacity: 0; transition: opacity .18s; }
.modal-overlay.show { opacity: 1; }
.modal { width: min(480px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--surface); border-radius: 12px; box-shadow: 0 24px 60px rgba(8, 15, 28, .3); transform: translateY(8px); transition: transform .18s; }
.modal-wide { width: min(760px, 100%); }
.modal-overlay.show .modal { transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-block-end: 1px solid var(--border); }
.modal-body { padding: 16px 18px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-block-start: 1px solid var(--border); }
.toasts { position: fixed; z-index: 60; bottom: 18px; inset-inline-end: 18px; display: flex; flex-direction: column; gap: 8px; }
.toast { min-width: 220px; max-width: 360px; padding: 11px 14px; border-radius: 9px; background: #0f1b2d; color: #fff; font-size: 13px; box-shadow: 0 10px 26px rgba(8, 15, 28, .3); opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; border-inline-start: 4px solid #2dd4bf; }
.toast.show { opacity: 1; transform: none; }
.toast-err { border-inline-start-color: #f87171; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 440px); }
.login-side { display: flex; flex-direction: column; justify-content: center; gap: 16px; padding: 48px; background: linear-gradient(160deg, #0f766e, #0e7490); color: #e6fffb; }
.brand-lg .brand-mark { width: 44px; height: 44px; flex-basis: 44px; border-radius: 12px; }
.brand-lg .brand-text strong { font-size: 22px; } .brand-lg { border: 0; padding: 0; }
.login-tag { margin: 0; font-size: 18px; color: #fff; font-weight: 600; }
.login-points { margin: 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 8px; color: #ccfbf1; }
.login-card { display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 40px 36px; background: var(--surface); }
.login-card h1 { font-size: 20px; margin-block-end: 2px; }
.login-card .muted { margin: 0 0 18px; font-size: 13px; }
.login-lang { display: flex; justify-content: flex-end; margin-block-end: 18px; }
.plain-page { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.plain-card { width: min(520px, 100%); padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.plain-brand { font-weight: 800; letter-spacing: .1em; color: var(--accent); }
.plain-amount { font-size: 24px; font-weight: 700; }
.plain-code code { display: block; padding: 10px; background: var(--surface-2); border-radius: 8px; font-size: 18px; }
.sandbox-flag { padding: 6px 10px; background: var(--warn-bg); color: var(--warn); border-radius: 6px; font-weight: 600; }

/* ---------- responsive (desktop-first) ---------- */
/* Administrative Customer user provisioning */
.prov-form { max-width: 460px; }
.prov-page .badge { height: auto; min-height: 23px; padding-block: 3px; white-space: normal; line-height: 1.4; }
.prov-page .grid-2 > * { min-width: 0; }
.prov-page [data-testid=prov-result] .dl { margin-block-end: 18px; padding-block-end: 14px; border-block-end: 1px solid var(--border); }
.prov-side { display: flex; flex-direction: column; gap: 16px; }
.field-hint { font-size: 12px; color: var(--text-2); min-height: 16px; }
.field-hint.ok { color: var(--ok); } .field-hint.bad { color: var(--bad); } .field-hint.warn { color: var(--warn); }
.rules { margin: 0 0 14px; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.rules li { display: flex; align-items: center; gap: 7px; }
.rules li::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); flex: none; }
.rules li.met { color: var(--ok); } .rules li.met::before { background: var(--ok); }
.prov-success { padding: 12px 14px; margin-block-end: 14px; border-radius: 10px; background: var(--ok-bg); color: var(--ok); font-weight: 700; }
.prov-notes { margin: 0; padding-inline-start: 18px; display: grid; gap: 7px; font-size: 13px; color: var(--text-2); }
@media (max-width: 1200px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 960px) {
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .top-kicker { display: none; }
  .content { padding: 16px; }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-side { display: none; }
}
@media (max-width: 720px) {
  :root { --sidebar-w: 64px; }
  .brand-text, .nav-group-label, .nav-text, .who { display: none; }
  .nav-link { justify-content: center; padding: 0; }
  .brand, .sidebar-foot { justify-content: center; padding-inline: 0; }
  .hide-sm, .lang-btn span { display: none; }
  .top-actions { gap: 2px; }
  .top-actions .btn-sm { padding-inline: 8px; }
  .kpi-value { font-size: 19px; }
  .topbar { padding-inline: 12px; gap: 8px; }
  .filter-search { min-width: 0; flex: 1; }
}

/* MASTER Control logo (navy tile, yellow m, control dial - scripts/brand/buildBrandAssets.js). */
.brand-mark:has(img) { background: none; overflow: hidden; }
.brand-mark img { display: block; width: 100%; height: 100%; }
/* Password fields: the eye shows / hides what was typed. */
.pw-field { position: relative; display: block; }
.pw-field input { width: 100%; padding-inline-end: 40px; box-sizing: border-box; }
.pw-eye { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--muted, #64748B); cursor: pointer; padding: 0; }
.pw-eye:hover { color: var(--text, #0F172A); background: color-mix(in srgb, currentColor 8%, transparent); }
.pw-eye:focus-visible { outline: 2px solid var(--focus, #2563EB); }
.pw-eye svg { width: 18px; height: 18px; }
.login-side .brand-text strong { color: #fff; } .login-side .brand-text small { color: #99f6e4; }
/* Cloud / Sync Health */
.page-stack { display: flex; flex-direction: column; gap: 16px; }
.health-status { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.health-status .kpi-icon { grid-area: auto; width: 40px; height: 40px; }
.health-status strong { font-size: 17px; }
.health-status p { margin: 2px 0 0; color: var(--text-2); font-size: 13px; }
.health-ok .kpi-icon { background: var(--ok-bg); color: var(--ok); } .health-ok strong { color: var(--ok); }
.health-warn .kpi-icon { background: var(--warn-bg); color: var(--warn); } .health-warn strong { color: var(--warn); }
.health-bad .kpi-icon { background: var(--bad-bg); color: var(--bad); } .health-bad strong { color: var(--bad); }
.hbars-wrap { display: flex; flex-direction: column; gap: 6px; }
.hbars { width: 100%; height: 120px; display: block; }
.hbars rect { fill: var(--accent); opacity: .85; } .hbars rect:hover { opacity: 1; }
[dir="rtl"] .hbars { transform: scaleX(-1); }
.hbars-axis { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--text-3); }
@media (max-width: 720px) { .health-status { grid-template-columns: auto minmax(0, 1fr); } .health-status > .small { grid-column: 1 / -1; } }
.kpi-value .muted { font-size: 16px; font-weight: 600; }

/* Sign-in status of a customer account (allowed / not allowed, with its reason). */
.signin-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; max-width: 320px; }
.signin-why { font-size: 12px; color: var(--muted, #64748b); line-height: 1.5; white-space: normal; }
.signin-why b { color: inherit; font-weight: 700; }
.signin-when { font-size: 11.5px; color: var(--muted, #64748b); }
