/* Agbu Mail admin console — shared controls, and the dark theme. */
:root{
  --panel:#fff;--header:#fff;--soft:#fafbfd;--hairline:#f0f2f5;--heading:#324058;--tint:#fff0e4;--tint-ink:#a84a0d;
  --prefs-bg:#fff;--prefs-line:var(--line);--prefs-ink:var(--ink);--prefs-muted:#6b778a;
  --prefs-active-bg:var(--navy);--prefs-active-ink:#fff;--prefs-hover:var(--orange);
}
.side-link>span[data-i18n]{margin-left:0}
.org-icon-light{background:var(--tint);color:#b65318}
.login-top{display:flex;align-items:center;justify-content:space-between;gap:12px}
#login-modal h2{font-size:24px}
.search-trigger>span[data-i18n]{font-size:inherit}

:root[data-theme="dark"]{
  --ink:#e6ecf5;--muted:#8fa0b8;--line:#22344d;--surface:#0a1220;--orange:#f07a2c;
  --panel:#0f1b2d;--header:#0d1829;--soft:#0c1727;--hairline:#1a2a40;--heading:#e6ecf5;--tint:#3a2414;--tint-ink:#ffb27a;
  --prefs-bg:#0f1b2d;--prefs-muted:#8fa0b8;--prefs-active-bg:#FD8127;--prefs-active-ink:#031530;--prefs-hover:#ffb27a;
}
[data-theme="dark"] body{background:var(--surface)}
[data-theme="dark"] .sidebar{background:#050d19;border-right:1px solid #16263b}
[data-theme="dark"] header{background:var(--header)}
[data-theme="dark"] .breadcrumb strong,[data-theme="dark"] .empty h2,[data-theme="dark"] .summary-counts b{color:var(--heading)}
[data-theme="dark"] .search-trigger{background:var(--panel);color:#8fa0b8}
[data-theme="dark"] .search-trigger kbd{background:#16243a;color:#9fb0c6}
[data-theme="dark"] .profile,[data-theme="dark"] .org-icon-light{background:var(--tint);color:var(--tint-ink)}
[data-theme="dark"] .panel,[data-theme="dark"] .button,[data-theme="dark"] .filter,[data-theme="dark"] .select{background:var(--panel);color:var(--ink);border-color:var(--line)}
[data-theme="dark"] .button:hover{background:#16243a}
[data-theme="dark"] .button.primary{background:var(--orange);border-color:var(--orange);color:#031530}
[data-theme="dark"] .button.primary:hover{background:#ff8a3d}
[data-theme="dark"] .organization .monogram,[data-theme="dark"] .stat-icon.orange{background:var(--tint);color:var(--tint-ink)}
[data-theme="dark"] .stat-icon.blue{background:#132a4a;color:#8ab4ff}
[data-theme="dark"] .stat-icon.green{background:#143326;color:#6fd3a4}
[data-theme="dark"] .stat-icon.purple{background:#231f45;color:#b4a8ff}
[data-theme="dark"] .pill{background:#143326;color:#6fd3a4}
[data-theme="dark"] .pill.preview{background:var(--tint);color:var(--tint-ink)}
[data-theme="dark"] .text-link,[data-theme="dark"] .summary-foot a{color:#ff9a4d}
[data-theme="dark"] .chart{border-bottom-color:var(--line);background:repeating-linear-gradient(to top,transparent 0,transparent 44px,#16243a 45px,#16243a 46px)}
[data-theme="dark"] .chart-empty svg{color:#6f8199}
[data-theme="dark"] .chart-footer b{color:#c7d2e1}
[data-theme="dark"] .donut{border-color:var(--orange)}
[data-theme="dark"] .summary-counts>div:last-child i{background:#2c4260}
[data-theme="dark"] th{background:var(--soft);color:#8193ab}
[data-theme="dark"] td{border-bottom-color:var(--hairline)}
[data-theme="dark"] .user-avatar{background:#16243a;color:#9fb0c6}
[data-theme="dark"] .quota{color:#9fb0c6}
[data-theme="dark"] .progress{background:#1f2f45}
[data-theme="dark"] .setup-row .check{background:#143326;color:#6fd3a4}
[data-theme="dark"] .setup-row .pending{background:var(--tint);color:var(--tint-ink)}
[data-theme="dark"] .notice{background:#1c150f;border-color:#3d2a1a;color:#e8b98c}
[data-theme="dark"] .notice a{color:#ffb27a}
[data-theme="dark"] .notice.live{background:#0e2219;border-color:#1c4232;color:#8fd9b5}
[data-theme="dark"] .input{background:#0b1728;border-color:#2c4260;color:var(--ink)}
[data-theme="dark"] .input:read-only{background:#0d1a2b;color:#9fb0c6}
[data-theme="dark"] .input::placeholder{color:#6f8199}
[data-theme="dark"] .filter.active{background:var(--tint);color:var(--tint-ink);border-color:#5a3317}
[data-theme="dark"] dialog{background:var(--panel);color:var(--ink);border-color:var(--line);box-shadow:0 30px 90px #000a}
[data-theme="dark"] dialog::backdrop{background:#020812bb}
[data-theme="dark"] #login-modal::backdrop{background:#020812ee}
[data-theme="dark"] .login-mark{color:var(--ink)}
[data-theme="dark"] #login-modal>p{color:var(--muted)}
[data-theme="dark"] .modal-head{border-bottom-color:var(--line)}
[data-theme="dark"] .modal-note{background:#1c150f;border-color:#3d2a1a;color:#e8b98c}
[data-theme="dark"] .quick-links a{background:#13223a}
[data-theme="dark"] .form-error,[data-theme="dark"] #login-error{color:#ff8a73}
[data-theme="dark"] .connection{color:#8fa0b8}
[data-theme="dark"] .connection.online{color:#6fd3a4}
[data-theme="dark"] #toast{background:#eef2f8;color:#031530}
@media(max-width:950px){[data-theme="dark"] .chart-empty{background:#0f1b2dcc}}

/* ---------- Orders, subscriptions and payments ---------- */
[hidden]{display:none!important}
.pill.info{background:#edf3ff;color:#2f64b5}
.pill.muted{background:#eef1f5;color:#6b7a8f}
.pill.danger{background:#fdecea;color:#b3261e}
.badge-count.new{background:var(--orange)!important;color:#fff!important}
.cell-sub{display:block;font-size:12px;color:var(--muted);margin-top:3px}
td.num,th.num,.num{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.filters .filter{display:inline-flex;align-items:center;gap:6px}
.filter b{font-weight:600;font-size:11px;opacity:.7}
.detail-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:14px}
.detail-head code,td code{font-size:13px;font-weight:600}
.detail-list{display:grid;grid-template-columns:130px 1fr;gap:10px 16px;margin:0 0 18px;font-size:14px}
.detail-list dt{color:var(--muted)}
.detail-list dd{margin:0;line-height:1.5}
.detail-list small{color:var(--muted)}
.detail-list a{color:var(--orange)}
.mini-table{width:100%;border-collapse:collapse;margin:6px 0 4px;font-size:14px}
.mini-table td{padding:8px 0;border-bottom:1px solid var(--hairline)}
.mini-table td small{color:var(--muted);margin-left:6px}
.mini-table tfoot td{border:0;padding:5px 0;color:var(--muted)}
.mini-table tfoot tr:first-child td{padding-top:12px}
.mini-table .grand td{color:var(--ink);font-weight:700;font-size:15px;border-top:1px solid var(--line);padding-top:10px}
.modal-sub{font-size:14px;margin:22px 0 10px}
.history{list-style:none;margin:0;padding:0;display:grid;gap:8px;font-size:13px}
.history li{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.history li>span:first-child{color:var(--muted);min-width:96px}
select.input{appearance:auto}
#modal{width:620px}

.sub-card{padding:22px 24px;margin-bottom:18px}
.sub-head{display:flex;align-items:center;gap:16px}
.sub-head .monogram{background:var(--tint);color:#b65318;width:48px;height:48px;border-radius:11px;display:grid;place-items:center;font-weight:650;flex-shrink:0}
.sub-title{flex:1;min-width:0}
.sub-title h2{margin:0 0 4px;font-size:19px}
.sub-title .domain{font-size:13px;color:var(--muted)}
.sub-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:18px;margin:20px 0;padding:16px 0;border-block:1px solid var(--line)}
.sub-grid .meta-value{font-size:16px;font-weight:600}
.onboarding-head{display:flex;justify-content:space-between;align-items:center;gap:10px}
.onboarding h3{margin:0;font-size:14px}
.progress.wide{width:100%;height:6px;margin:10px 0 14px;border-radius:6px;overflow:hidden}
.progress.wide i{height:6px;border-radius:6px;transition:width .3s}
.checklist{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.check-item{display:flex;align-items:center;gap:9px;padding:9px 11px;border:1px solid var(--line);border-radius:8px;font-size:13px;cursor:pointer}
.check-item input{accent-color:var(--orange);width:16px;height:16px}
.check-item:has(input:checked){background:#f3fbf7;border-color:#cfe8de;color:#26775b}
.sub-actions{display:flex;flex-wrap:wrap;gap:9px;margin-top:18px}
.price-preview{margin:4px 0 6px;padding:12px 14px;border-radius:8px;background:var(--soft);border:1px solid var(--line)}
.price-preview:empty{display:none}
.price-preview>div{display:flex;justify-content:space-between;align-items:baseline;gap:10px}
.price-preview strong{font-size:20px}
.price-preview small{color:var(--muted);font-size:12px}
.ledger{margin-top:4px}
.ledger .panel-heading{flex-wrap:wrap}
tr.voided td{color:var(--muted);text-decoration:line-through}
tr.voided td:nth-last-child(-n+2){text-decoration:none}
.row-actions{display:flex;gap:14px;justify-content:flex-end}
.danger-link{color:#b3261e!important}
.button.primary.danger-button{background:#b3261e;border-color:#b3261e}
.print-doc header{display:flex;justify-content:space-between;align-items:center;gap:12px;padding-bottom:14px;margin-bottom:16px;border-bottom:3px solid #FD8127}
.doc-number{text-align:right}
.doc-number small{display:block;color:var(--muted);font-size:12px}
.doc-number strong{display:block;font-size:17px}
@media(max-width:950px){.sub-grid{grid-template-columns:1fr 1fr}.checklist{grid-template-columns:1fr 1fr}}
@media(max-width:650px){.sub-grid,.checklist{grid-template-columns:1fr}.detail-list{grid-template-columns:1fr;gap:2px}.detail-list dd{margin-bottom:10px}.sub-head{flex-wrap:wrap}}

[data-theme="dark"] .pill.info{background:#132a4a;color:#8ab4ff}
[data-theme="dark"] .pill.muted{background:#1a2a40;color:#9fb0c6}
[data-theme="dark"] .pill.danger{background:#3a1512;color:#ff8a73}
[data-theme="dark"] .sub-head .monogram{color:var(--tint-ink)}
[data-theme="dark"] .check-item:has(input:checked){background:#0e2219;border-color:#1c4232;color:#8fd9b5}
[data-theme="dark"] .danger-link{color:#ff8a73!important}
[data-theme="dark"] .detail-list a{color:#ff9a4d}

@media print{
  body>*:not(#modal){display:none!important}
  #modal{position:static;inset:auto;margin:0;border:0;box-shadow:none;max-height:none;width:auto;max-width:none;background:#fff;color:#031530}
  #modal::backdrop{display:none}
  #modal .modal-head,#modal .modal-actions{display:none}
  .print-doc .help,.print-doc small{color:#5b6678}
}
