/* ============================================================
   MerchantHub — Design System (ported into the framework theme)
   Source: claude.ai/design "platform" handoff → project/styles.css
   Token-based. Drives the portal shell + shared components.
   Loaded AFTER the inline $gdata.Theme.css_root block and after
   Bootstrap, so these declarations win on overlapping selectors.
   ============================================================ */

@import url('https://api.fontshare.com/v2/css?f[]=general-sans@400,500,600,700&display=swap');

/* ---------- Accent palettes (swappable via [data-accent]) ---------- */
:root {
    --accent-h: 256; --accent-s: 88%; --accent-l: 60%;          /* indigo default */
}
:root[data-accent="violet"]  { --accent-h: 272; --accent-s: 80%; --accent-l: 60%; }
:root[data-accent="blue"]    { --accent-h: 221; --accent-s: 83%; --accent-l: 56%; }
:root[data-accent="emerald"] { --accent-h: 160; --accent-s: 70%; --accent-l: 42%; }
:root[data-accent="rose"]    { --accent-h: 346; --accent-s: 84%; --accent-l: 58%; }
:root[data-accent="amber"]   { --accent-h: 32;  --accent-s: 95%; --accent-l: 50%; }

/* ---------- Light theme (default) ---------- */
:root {
    --accent:        hsl(var(--accent-h) var(--accent-s) var(--accent-l));
    --accent-hover:  hsl(var(--accent-h) var(--accent-s) calc(var(--accent-l) - 6%));
    --accent-fg:     #fff;
    --accent-soft:   hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.10);
    --accent-soft-2: hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.16);
    --accent-ring:   hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.30);
    --accent-text:   hsl(var(--accent-h) calc(var(--accent-s) - 8%) calc(var(--accent-l) - 8%));

    --bg:            #f6f6f7;
    --bg-grad:       radial-gradient(120% 100% at 50% 0%, #fbfbfc 0%, #f4f4f6 60%);
    --surface:       #ffffff;
    --surface-2:     #fafafa;
    --surface-3:     #f1f1f3;
    --surface-hover: #f6f6f8;

    --border:        #e8e8ec;
    --border-2:      #ededf1;
    --border-strong: #d8d8de;

    --text:          #18181b;
    --text-2:        #52525b;
    --text-3:        #8a8a93;
    --text-4:        #b4b4bb;

    --success:       hsl(150 70% 38%);
    --success-soft:  hsl(150 70% 40% / 0.12);
    --warning:       hsl(36 92% 46%);
    --warning-soft:  hsl(36 92% 50% / 0.14);
    --danger:        hsl(354 74% 53%);
    --danger-soft:   hsl(354 74% 55% / 0.12);
    --info:          hsl(214 84% 56%);
    --info-soft:     hsl(214 84% 56% / 0.12);

    --shadow-xs: 0 1px 2px rgb(16 16 20 / 0.04);
    --shadow-sm: 0 1px 2px rgb(16 16 20 / 0.05), 0 1px 3px rgb(16 16 20 / 0.06);
    --shadow-md: 0 2px 4px rgb(16 16 20 / 0.04), 0 4px 12px rgb(16 16 20 / 0.08);
    --shadow-lg: 0 8px 24px rgb(16 16 20 / 0.10), 0 2px 6px rgb(16 16 20 / 0.06);

    --r-xs: 5px; --r-sm: 7px; --r-md: 9px; --r-lg: 12px; --r-xl: 16px; --r-2xl: 22px;

    --sb-w: 248px;
    --topbar-h: 60px;

    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

    --font: 'General Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* ---- Bridge the framework's --color-* aliases to the MH palette so the
            shipped components (topbar uses var(--color-body), etc.) stay coherent. ---- */
    --color-body:    var(--text);
    --color-text:    var(--text);
    --color-ink:     var(--text);
    --color-muted:   var(--text-3);
    --color-border:  var(--border);
    --color-line:    var(--border);
    --color-surface: var(--surface);
    --color-bg:      var(--bg);
    --color-primary: var(--accent);
}

/* ---------- Dark theme ---------- */
:root[data-theme="dark"] {
    --accent-fg:     #fff;
    --accent-soft:   hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.16);
    --accent-soft-2: hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.24);
    --accent-ring:   hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.40);
    --accent-text:   hsl(var(--accent-h) calc(var(--accent-s) - 6%) calc(var(--accent-l) + 14%));
    --accent-hover:  hsl(var(--accent-h) var(--accent-s) calc(var(--accent-l) + 5%));

    --bg:            #0a0a0c;
    --bg-grad:       radial-gradient(120% 100% at 50% 0%, #141418 0%, #0b0b0d 55%);
    --surface:       #141417;
    --surface-2:     #18181c;
    --surface-3:     #1f1f24;
    --surface-hover: #1d1d22;

    --border:        #26262c;
    --border-2:      #222228;
    --border-strong: #34343c;

    --text:          #f4f4f6;
    --text-2:        #a8a8b2;
    --text-3:        #6e6e78;
    --text-4:        #4a4a52;

    --success:       hsl(150 60% 50%);
    --success-soft:  hsl(150 60% 50% / 0.16);
    --warning:       hsl(36 92% 56%);
    --warning-soft:  hsl(36 92% 56% / 0.16);
    --danger:        hsl(354 80% 62%);
    --danger-soft:   hsl(354 80% 62% / 0.16);
    --info:          hsl(214 90% 62%);
    --info-soft:     hsl(214 90% 62% / 0.16);

    --shadow-xs: 0 1px 2px rgb(0 0 0 / 0.30);
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.35), 0 1px 3px rgb(0 0 0 / 0.40);
    --shadow-md: 0 2px 4px rgb(0 0 0 / 0.35), 0 4px 14px rgb(0 0 0 / 0.45);
    --shadow-lg: 0 10px 30px rgb(0 0 0 / 0.55), 0 2px 8px rgb(0 0 0 / 0.45);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
    font-family: var(--font);
    background: var(--bg);
    background-image: var(--bg-grad);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
/* prototype reset — without this, bare <button> (tabs, toggles, chips) show the UA border/background */
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
ul { list-style: none; }
.tnum, .mono { font-variant-numeric: tabular-nums; }

::selection { background: var(--accent-soft-2); }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }

/* ---------- Animations ---------- */
@keyframes moduleIn { from { transform: translateY(7px); } to { transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
.anim-up { animation: moduleIn 0.35s var(--ease-out); }
.spinner { width: 18px; height: 18px; border: 2px solid var(--accent-soft-2); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }

/* ============================================================
   Portal shell
   ============================================================ */
.app-shell {
    display: grid;
    grid-template-columns: var(--sb-w) 1fr;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 14px 12px;
    overflow-y: auto;
}
.app-sidebar .brand-block {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; padding: 6px 8px 14px;
    border-bottom: 1px solid var(--border-2);
    margin-bottom: 10px;
}
.app-sidebar .role-tag {
    font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
    color: var(--accent-text); background: var(--accent-soft); padding: 3px 8px; border-radius: 999px;
}
.app-sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.app-sidebar nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: var(--r-md);
    color: var(--text-2); font-weight: 500; font-size: 13.5px;
    transition: background .15s var(--ease), color .15s var(--ease);
}
.app-sidebar nav a:hover { background: var(--surface-hover); color: var(--text); }
.app-sidebar nav a.is-active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.app-sidebar nav a.is-active .nav-icon { color: var(--accent); }
.app-sidebar .nav-icon { display: inline-flex; width: 18px; color: var(--text-3); }
.app-sidebar .nav-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-sidebar .nav-badge {
    font-size: 11px; font-weight: 600; min-width: 19px; text-align: center;
    padding: 1px 6px; border-radius: 999px; background: var(--surface-3); color: var(--text-2);
}
.app-sidebar nav a.is-active .nav-badge { background: var(--accent); color: var(--accent-fg); }
.app-sidebar .divider {
    font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
    color: var(--text-4); padding: 14px 10px 5px; background: none; height: auto;
}
.app-sidebar .user-block {
    display: flex; align-items: center; gap: 10px;
    margin-top: 8px; padding: 10px; border-top: 1px solid var(--border-2);
}
.app-sidebar .user-avatar {
    width: 34px; height: 34px; border-radius: 9px; flex: none;
    display: grid; place-items: center; font-weight: 600; font-size: 13px;
    background: var(--accent-soft); color: var(--accent-text);
}
.app-sidebar .user-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-sidebar .user-org { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Main column ---- */
.app-main { display: flex; flex-direction: column; min-width: 0; }
.app-topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 14px;
    min-height: var(--topbar-h);
    padding: 10px 26px;
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    backdrop-filter: saturate(1.2) blur(8px);
    border-bottom: 1px solid var(--border);
}
.app-topbar .topbar-main { flex: 1; min-width: 0; }
.app-topbar .breadcrumb {
    display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
    font-size: 12px; color: var(--text-3); margin: 0 0 1px; padding: 0; background: none;
}
.app-topbar .breadcrumb a:hover { color: var(--accent-text); }
.app-topbar .breadcrumb .sep { color: var(--text-4); }
.app-topbar .topbar-title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.app-topbar .topbar-subtitle { font-size: 12.5px; color: var(--text-3); }
.app-topbar .topbar-actions { display: flex; align-items: center; gap: 8px; }

.app-content { padding: 24px 26px 60px; max-width: 1380px; width: 100%; }

/* sidebar toggle (mobile) — hidden on desktop */
.sidebar-toggle-btn { display: none; }
.wk-sidebar-toggle, .wk-sidebar-backdrop { display: none; }

/* ============================================================
   Components
   ============================================================ */

/* ---- Buttons (override Bootstrap .btn) ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    font-family: inherit; font-weight: 600; font-size: 13px; line-height: 1;
    padding: 9px 14px; border-radius: var(--r-md); border: 1px solid transparent;
    cursor: pointer; transition: filter .15s, background .15s, border-color .15s, transform .05s;
    white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-fg); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-hover); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-text { background: transparent; color: var(--accent-text); padding-left: 6px; padding-right: 6px; }
.btn-text:hover { background: var(--accent-soft); }
.btn-gold { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { filter: brightness(0.95); color: #fff; }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-icon { padding: 8px; width: 34px; height: 34px; }

/* ---- KPI tiles ---- */
.kpi {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
    padding: 16px 18px; box-shadow: var(--shadow-xs);
    transition: box-shadow .18s, border-color .18s, transform .18s;
}
.kpi:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); transform: translateY(-2px); }
.kpi-label { font-size: 12.5px; color: var(--text-3); font-weight: 500; margin-bottom: 8px; }
.kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi-unit { font-size: 13px; color: var(--text-3); font-weight: 500; }
.kpi-trail { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--text-3); }
.kpi-delta-up { color: var(--success); font-weight: 600; }
.kpi-delta-down { color: var(--danger); font-weight: 600; }
.kpi-color-primary { border-top: 2px solid var(--accent); }
.kpi-color-gold { border-top: 2px solid var(--warning); }
.kpi-color-info { border-top: 2px solid var(--info); }

/* ---- Pills / badges ---- */
.pill {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11.5px; font-weight: 600; line-height: 1;
    padding: 4px 9px; border-radius: 999px;
    background: var(--surface-3); color: var(--text-2);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.pill-primary { background: var(--accent-soft); color: var(--accent-text); }
.pill-success { background: var(--success-soft); color: var(--success); }
.pill-warning { background: var(--warning-soft); color: var(--warning); }
.pill-danger  { background: var(--danger-soft); color: var(--danger); }
.pill-info    { background: var(--info-soft); color: var(--info); }
.pill-muted   { background: var(--surface-3); color: var(--text-3); }

/* ---- Cards ---- */
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
    box-shadow: var(--shadow-xs); overflow: hidden;
}
.card-header {
    padding: 14px 18px; border-bottom: 1px solid var(--border-2);
    font-weight: 600; font-size: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-body { padding: 18px; }
.card-footer { padding: 14px 18px; border-top: 1px solid var(--border-2); background: var(--surface-2); }

/* ---- Tables (override Bootstrap) ---- */
.table-responsive {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
    overflow: auto; box-shadow: var(--shadow-xs);
}
.table { width: 100%; border-collapse: collapse; color: var(--text); margin: 0; }
.table thead th {
    text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase;
    color: var(--text-3); padding: 11px 16px; background: var(--surface-2);
    border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border-2); font-size: 13.5px; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface-hover); }
.table .table-empty { text-align: center; color: var(--text-3); padding: 40px 16px; }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tabs .tab {
    padding: 9px 14px; font-size: 13.5px; font-weight: 500; color: var(--text-3);
    border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs .tab:hover { color: var(--text); }
.tabs .tab.is-active { color: var(--accent-text); border-bottom-color: var(--accent); font-weight: 600; }

/* ---- Forms ---- */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
    width: 100%; font-family: inherit; font-size: 13.5px; color: var(--text);
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-md);
    padding: 9px 11px; transition: border-color .15s, box-shadow .15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-help { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 5px; }
.form-error { display: block; font-size: 11.5px; color: var(--danger); margin-top: 5px; }
.text-danger { color: var(--danger); }

/* ---- Modal ---- */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 90;
    background: rgb(8 8 12 / 0.45); backdrop-filter: blur(3px);
    display: grid; place-items: center; padding: 20px;
}
.modal-backdrop[hidden] { display: none; }
.modal {
    width: min(560px, 100%); background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); overflow: hidden;
}
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border-2); font-weight: 600; font-size: 15px; }
.modal-body { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border-2); display: flex; justify-content: flex-end; gap: 8px; }

/* ---- Pagination (Bootstrap .pagination polish) ---- */
.pagination { gap: 4px; }
.pagination .page-link {
    border: 1px solid var(--border); border-radius: var(--r-sm) !important;
    color: var(--text-2); font-size: 13px; padding: 6px 11px; background: var(--surface);
}
.pagination .page-link:hover { background: var(--surface-hover); color: var(--text); }
.pagination .page-item.active .page-link { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.pagination .page-item.disabled .page-link { color: var(--text-4); background: var(--surface-2); }

/* ---- Wordmark ---- */
.wordmark { display: inline-flex; align-items: center; gap: 9px; color: var(--text); }
.wordmark .wordmark-mark { color: var(--accent); width: 30px; height: 30px; }
.wordmark .wordmark-text { display: flex; flex-direction: column; line-height: 1.05; }
.wordmark .wordmark-ar { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.wordmark .wordmark-en { font-size: 9.5px; font-weight: 600; letter-spacing: .14em; color: var(--text-3); }
.wordmark-sm .wordmark-ar { font-size: 14px; }

/* ============================================================
   MerchantHub view helpers (used by per-page templates)
   ============================================================ */
.mh-stack { display: flex; flex-direction: column; gap: 22px; }
.mh-grid { display: grid; gap: 16px; }
.mh-grid-2 { grid-template-columns: repeat(2, 1fr); }
.mh-grid-3 { grid-template-columns: repeat(3, 1fr); }
.mh-grid-4 { grid-template-columns: repeat(4, 1fr); }
.mh-grid-stat { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.mh-section-title { font-size: 14px; font-weight: 600; }
.mh-muted { color: var(--text-3); }
.mh-fs-sm { font-size: 12.5px; }

/* toolbar above data tables */
.mh-toolbar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-bottom: 14px;
}
.mh-search {
    display: flex; align-items: center; gap: 8px; flex: 1; min-width: 200px;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: 8px 11px;
    color: var(--text-3);
}
.mh-search input { border: none; outline: none; background: none; flex: 1; font-size: 13.5px; color: var(--text); }
.mh-chip {
    font-size: 12.5px; font-weight: 500; color: var(--text-2);
    border: 1px solid var(--border-strong); background: var(--surface);
    padding: 7px 12px; border-radius: 999px; cursor: pointer;
}
.mh-chip.is-active { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent-ring); }

/* avatar + cell helpers */
.mh-avatar {
    width: 32px; height: 32px; border-radius: 8px; flex: none;
    display: grid; place-items: center; font-weight: 600; font-size: 12px;
    background: var(--accent-soft); color: var(--accent-text);
}
.mh-thumb {
    width: 40px; height: 40px; border-radius: 9px; flex: none; object-fit: cover;
    background: var(--surface-3); display: grid; place-items: center; color: var(--text-4); overflow: hidden;
}
.mh-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mh-cell-title { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mh-cell-sub { font-size: 11.5px; color: var(--text-3); }
.mh-rowact { display: inline-flex; gap: 6px; }
.mh-rowact a { color: var(--text-3); padding: 4px; border-radius: 6px; display: inline-flex; }
.mh-rowact a:hover { background: var(--surface-3); color: var(--accent-text); }

/* ---- prototype interaction states (mhkit components) ---- */
.mh-btn:hover { filter: brightness(0.97); }
.mh-btn:active { transform: scale(0.985); }
.mh-iconbtn:hover { background: var(--surface-3) !important; color: var(--text-2); }
.mh-iconbtn:active { transform: scale(0.92); }
.mh-row:hover { background: var(--surface-hover); }
.mh-card { transition: box-shadow .2s, border-color .2s, transform .2s; }
.mh-menuitem:hover { background: var(--surface-hover); }
.mh-crumb:hover { color: var(--accent-text); }
.anim-scale { animation: mhScaleIn 0.16s var(--ease-out); }
@keyframes mhScaleIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }

/* simple progress bar (top products / fulfilment) */
.mh-bar { height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.mh-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }

/* mini chart bars */
.mh-chart { display: flex; align-items: flex-end; gap: 8px; height: 140px; padding-top: 8px; }
.mh-chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; justify-content: flex-end; }
.mh-chart .col i { display: block; width: 100%; max-width: 30px; border-radius: 6px 6px 0 0; background: var(--accent); opacity: .85; }
.mh-chart .col span { font-size: 11px; color: var(--text-3); }

/* activity feed */
.mh-feed { display: flex; flex-direction: column; gap: 2px; }
.mh-feed-item { display: flex; gap: 11px; padding: 9px 4px; }
.mh-feed-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); margin-top: 5px; flex: none; }
.mh-feed-body { font-size: 13px; }
.mh-feed-time { font-size: 11.5px; color: var(--text-4); }

/* page header (used inside content when no topbar action room) */
.mh-pagehead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 4px; }

/* definition / detail rows */
.mh-deflist { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; font-size: 13.5px; }
.mh-deflist dt { color: var(--text-3); }
.mh-deflist dd { margin: 0; font-weight: 500; }

/* timeline */
.mh-timeline { display: flex; flex-direction: column; }
.mh-tl-item { display: flex; gap: 12px; padding-bottom: 16px; position: relative; }
.mh-tl-item:not(:last-child)::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 2px; background: var(--border); }
.mh-tl-dot { width: 16px; height: 16px; border-radius: 50%; flex: none; background: var(--surface); border: 3px solid var(--accent); z-index: 1; }
.mh-tl-dot.is-muted { border-color: var(--border-strong); }
.mh-tl-title { font-weight: 600; font-size: 13px; }
.mh-tl-time { font-size: 11.5px; color: var(--text-4); }

/* empty state */
.mh-empty { text-align: center; color: var(--text-3); padding: 50px 20px; }

/* stub / coming-soon */
.mh-stub { display: grid; place-items: center; text-align: center; padding: 60px 24px; }
.mh-stub-icon { width: 56px; height: 56px; border-radius: 15px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 16px; }
.mh-stub h2 { font-size: 19px; font-weight: 700; margin-bottom: 8px; }
.mh-stub p { color: var(--text-3); max-width: 460px; margin: 0 auto 6px; }
.mh-feature-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; max-width: 560px; }
.mh-feature-list span { font-size: 12.5px; color: var(--text-2); background: var(--surface-3); padding: 6px 11px; border-radius: 999px; }

/* invoice sheet */
.print-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.print-sheet {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm); padding: 40px; max-width: 820px; margin: 0 auto; color: var(--text);
}
.print-sheet h1 { font-size: 22px; }
@media print {
    .app-sidebar, .app-topbar, .print-bar { display: none !important; }
    .app-content { padding: 0 !important; }
    .print-sheet { box-shadow: none; border: none; max-width: none; padding: 0; }
    body { background: #fff; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .mh-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .mh-grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
    .app-shell { grid-template-columns: 1fr; }
    .app-sidebar {
        position: fixed; left: 0; top: 0; z-index: 60; width: var(--sb-w);
        transform: translateX(-105%); transition: transform .25s var(--ease-out);
    }
    .wk-sidebar-toggle:checked ~ .app-shell .app-sidebar { transform: translateX(0); }
    .wk-sidebar-toggle:checked ~ .wk-sidebar-backdrop {
        display: block; position: fixed; inset: 0; z-index: 55; background: rgb(8 8 12 / 0.4);
    }
    .sidebar-toggle-btn {
        display: inline-flex; align-items: center; justify-content: center;
        width: 36px; height: 36px; border: 1px solid var(--border-strong);
        border-radius: var(--r-md); background: var(--surface);
    }
    .sidebar-toggle-btn span, .sidebar-toggle-btn span::before, .sidebar-toggle-btn span::after {
        content: ""; display: block; width: 16px; height: 2px; background: var(--text-2); border-radius: 2px; position: relative;
    }
    .sidebar-toggle-btn span::before { position: absolute; top: -5px; }
    .sidebar-toggle-btn span::after { position: absolute; top: 5px; }
    .app-content { padding: 18px 16px 50px; }
    .app-topbar { padding: 10px 16px; }
}
@media (max-width: 620px) {
    .mh-grid-4, .mh-grid-3, .mh-grid-2 { grid-template-columns: 1fr; }
    .mh-deflist { grid-template-columns: 1fr; gap: 3px 0; }
    .mh-deflist dt { margin-top: 8px; }
}

/* ---- Item form (stage 1): language toggle, mini rich-text, checkbox rows ---- */
.it-chk { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; cursor: pointer; }
.lang-2 { display: none; }
.it-rt-toolbar { display: flex; gap: 4px; margin-bottom: 6px; }
.it-rt-toolbar button { width: 30px; height: 28px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-sm); font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.it-rt { min-height: 96px; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); font-size: 13.5px; line-height: 1.6; color: var(--text); outline: none; }
.it-rt:focus { border-color: var(--accent); }
.it-rt:empty:before { content: attr(data-ph); color: var(--text-4); pointer-events: none; }

/* ---- MerchantHub form controls (token-styled; used by the item form) ---- */
.mhf-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); margin-bottom: 16px; overflow: hidden; }
.mhf-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); font-size: 14.5px; font-weight: 600; }
.mhf-body { padding: 18px; }
.mhf-group { margin-bottom: 14px; }
.mhf-group:last-child { margin-bottom: 0; }
.mhf-label { display: block; font-size: 12.5px; font-weight: 540; color: var(--text-2); margin-bottom: 6px; }
.mhf-input, .mhf-select { width: 100%; height: 40px; padding: 0 12px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface-2); font-size: 13.5px; color: var(--text); outline: none; transition: border-color .15s var(--ease); }
.mhf-input.mono { font-family: var(--mono); font-size: 12.5px; }
.mhf-select[multiple] { height: auto; min-height: 96px; padding: 6px; }
.mhf-input:focus, .mhf-select:focus { border-color: var(--accent); }
.mhf-req { color: var(--danger); }
.mhf-pick { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; height: 40px; padding: 0 10px 0 12px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface-2); font-size: 13.5px; color: var(--text); cursor: pointer; text-align: left; }
.mhf-pick .mhf-pick-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mhf-pick .mhf-pick-ph { color: var(--text-4); }
