/* =====================================================================
   Mushmasti — back office

   Structural class names match the member portal (sidebar / shell /
   topbar / content / nav-link / card / table), so the two apps feel the
   same to work in. The palette deliberately does not: the member portal
   is green, this is slate and amber. A member of staff with both open
   should never have to read the page to know which one they are in.
   ===================================================================== */

:root {
    --slate-900: #14202b;
    --slate-800: #1b2c3a;
    --slate-700: #24394a;
    --slate-600: #33506a;
    --slate-500: #4a6d8c;

    --amber-600: #b7791f;
    --amber-500: #d69e2e;
    --amber-100: #fdf3dd;

    --ink:    #1a2a35;
    --muted:  #6b7f8d;
    --line:   #e0e7ec;
    --bg:     #f3f6f8;
    --card:   #ffffff;

    --ok:      #1b8a4b;
    --ok-bg:   #e7f5ec;
    --warn:    #b7791f;
    --warn-bg: #fdf3dd;
    --danger:  #c62828;
    --danger-bg: #fdeaea;
    --info:    #2b6cb0;
    --info-bg: #e8f1fa;

    --sidebar-w: 256px;
    --topbar-h:  60px;
    --radius:    11px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14.5px;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--slate-600); }

h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -.01em; }

/* ══ Sign in ═══════════════════════════════════════════════════════ */

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px 16px;
    background: linear-gradient(160deg, var(--slate-800), var(--slate-900) 60%, #0d1720);
}

.login-wrap { width: 100%; max-width: 380px; }

.login-card {
    background: var(--card);
    border-radius: 16px;
    padding: 30px 26px 24px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
}

.login-head { text-align: center; margin-bottom: 22px; }

.login-mark {
    width: 54px; height: 54px;
    display: grid; place-items: center;
    margin: 0 auto 12px;
    border-radius: 15px;
    background: linear-gradient(145deg, var(--slate-700), var(--slate-900));
    color: var(--amber-500);
    font-size: 22px;
}

.login-head h1 { font-size: 20px; }
.login-head p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .09em;
}

.login-foot {
    margin: 18px 0 0;
    text-align: center;
    font-size: 12px;
    line-height: 1.55;
    color: var(--muted);
}

.login-note {
    margin: 16px 0 0;
    text-align: center;
    font-size: 13px;
}
.login-note a { color: rgba(255, 255, 255, .72); }

/* ══ Sidebar ═══════════════════════════════════════════════════════ */

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--slate-800), var(--slate-900));
    display: flex;
    flex-direction: column;
    z-index: 40;
}

.sidebar-brand {
    padding: 0 18px;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, .09);
    flex-shrink: 0;
}
.sidebar-brand a {
    display: flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
    color: #fff;
}

.brand-mark {
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border-radius: 9px;
    background: rgba(255, 255, 255, .1);
    color: var(--amber-500);
    font-size: 15px;
    flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong { font-size: 15px; }
.brand-text small {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .5);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 10px 0 18px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .22) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .2);
    border-radius: 3px;
}

.sidebar-nav ul { list-style: none; margin: 0; padding: 0; }

.nav-link {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    border: 0;
    background: none;
    font: inherit;
    font-size: 13.8px;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    color: rgba(255, 255, 255, .78);
    cursor: pointer;
    transition: background .15s, color .15s;
}
.nav-link > span:first-of-type { flex: 1; min-width: 0; }
.nav-link > i:first-child { width: 17px; text-align: center; font-size: 14px; opacity: .8; }

.nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }

.nav-link.is-active {
    background: rgba(255, 255, 255, .11);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--amber-500);
}
.nav-link.is-active > i:first-child { opacity: 1; color: var(--amber-500); }

.nav-signout:hover { background: rgba(198, 40, 40, .35); color: #fff; }

.nav-caret {
    font-size: 10px;
    opacity: .5;
    transition: transform .2s;
}
.nav-group.is-open .nav-caret { transform: rotate(90deg); }

.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
    background: rgba(0, 0, 0, .18);
}
.nav-group.is-open .submenu { max-height: 340px; }

.submenu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px 9px 47px;
    font-size: 13.2px;
    font-weight: 600;
    text-decoration: none;
    color: rgba(255, 255, 255, .62);
}
.submenu a > span:first-child { flex: 1; min-width: 0; }
.submenu a:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.submenu a.is-active { color: var(--amber-500); }

.nav-badge {
    flex-shrink: 0;
    min-width: 20px;
    padding: 1px 6px;
    border-radius: 9px;
    background: var(--amber-500);
    color: var(--slate-900);
    font-size: 11px;
    font-weight: 800;
    text-align: center;
}

.nav-sep {
    height: 1px;
    margin: 10px 18px;
    background: rgba(255, 255, 255, .1);
}

.sidebar-foot {
    padding: 12px 18px;
    border-top: 1px solid rgba(255, 255, 255, .09);
    font-size: 11.5px;
    color: rgba(255, 255, 255, .42);
    flex-shrink: 0;
}

.scrim {
    position: fixed;
    inset: 0;
    background: rgba(12, 22, 30, .5);
    z-index: 39;
}

/* ══ Shell ═════════════════════════════════════════════════════════ */

.shell {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 20px;
    background: var(--card);
    border-bottom: 1px solid var(--line);
}

.topbar-title {
    font-size: 16.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-search {
    position: relative;
    margin-left: auto;
    max-width: 280px;
    flex: 1;
}
.topbar-search i {
    position: absolute;
    left: 11px; top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 12.5px;
    pointer-events: none;
}
.topbar-search input {
    width: 100%;
    padding: 8px 12px 8px 32px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg);
    font: inherit;
    font-size: 13.5px;
}
.topbar-search input:focus {
    outline: none;
    border-color: var(--slate-500);
    background: #fff;
}

.topbar-user { display: flex; align-items: center; gap: 10px; }
.topbar-meta { display: flex; flex-direction: column; line-height: 1.2; text-align: right; }
.topbar-name { font-weight: 700; font-size: 13.5px; }
.topbar-id { font-size: 11.5px; color: var(--muted); font-weight: 700; }

.topbar-avatar {
    width: 36px; height: 36px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--slate-700);
    color: #fff;
    font-size: 12.5px;
    font-weight: 800;
    flex-shrink: 0;
}

.icon-btn {
    display: none;
    width: 36px; height: 36px;
    border: 0;
    border-radius: 8px;
    background: var(--bg);
    color: var(--ink);
    font-size: 15px;
    cursor: pointer;
}

.progress {
    position: fixed;
    top: var(--topbar-h);
    left: var(--sidebar-w);
    height: 2px;
    background: var(--amber-500);
    z-index: 35;
    transition: width .25s ease, opacity .3s ease;
}

.content {
    flex: 1;
    padding: 20px;
    max-width: 1320px;
    width: 100%;
    transition: opacity .12s;
}
.content.is-loading { opacity: .55; }

.footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 20px;
    border-top: 1px solid var(--line);
    font-size: 12px;
    color: var(--muted);
}

/* ══ Alerts ════════════════════════════════════════════════════════ */

.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 13.5px;
    font-weight: 600;
}
.alert-success { background: var(--ok-bg);     color: var(--ok);     }
.alert-error   { background: var(--danger-bg); color: var(--danger); }
.alert-info    { background: var(--info-bg);   color: var(--info);   }

/* ══ Cards ═════════════════════════════════════════════════════════ */

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 18px;
}

.card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
}
.card-head h2 { font-size: 14.5px; }
.card-head .spacer { margin-left: auto; }
.card-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); font-weight: 600; }

.card-body { padding: 16px; }
.card-foot {
    padding: 12px 16px;
    border-top: 1px solid var(--line);
    background: var(--bg);
    border-radius: 0 0 var(--radius) var(--radius);
}

/* ══ Stat tiles ════════════════════════════════════════════════════ */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 15px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: border-color .15s, transform .15s;
}
a.stat:hover { border-color: var(--slate-500); transform: translateY(-1px); }

.stat-icon {
    width: 42px; height: 42px;
    display: grid; place-items: center;
    border-radius: 11px;
    font-size: 16px;
    flex-shrink: 0;
    background: var(--bg);
    color: var(--slate-600);
}
.stat-icon.is-warn   { background: var(--warn-bg);   color: var(--warn);   }
.stat-icon.is-ok     { background: var(--ok-bg);     color: var(--ok);     }
.stat-icon.is-danger { background: var(--danger-bg); color: var(--danger); }
.stat-icon.is-info   { background: var(--info-bg);   color: var(--info);   }

.stat-body { display: flex; flex-direction: column; min-width: 0; }
.stat-value { font-size: 21px; font-weight: 800; line-height: 1.15; }
.stat-label {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* ══ Tables ════════════════════════════════════════════════════════ */

.table-wrap { overflow-x: auto; }

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

table.data th {
    padding: 10px 14px;
    text-align: left;
    white-space: nowrap;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    font-size: 11.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
}

table.data td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #fafcfd; }

.num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }

/* Member chip: initials + name + ID, used in every list. */
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who-avatar {
    width: 32px; height: 32px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--slate-700);
    color: #fff;
    font-size: 11.5px;
    font-weight: 800;
    flex-shrink: 0;
}
.who-body { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.who-name { font-weight: 700; }
.who-id { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.who a { text-decoration: none; color: inherit; }
.who a:hover .who-name { color: var(--slate-600); text-decoration: underline; }

/* ══ Pills ═════════════════════════════════════════════════════════ */

.pill {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 800;
    white-space: nowrap;
}
.pill-ok     { background: var(--ok-bg);     color: var(--ok);     }
.pill-warn   { background: var(--warn-bg);   color: var(--warn);   }
.pill-danger { background: var(--danger-bg); color: var(--danger); }
.pill-info   { background: var(--info-bg);   color: var(--info);   }
.pill-mute   { background: var(--bg);        color: var(--muted);  }

/* ══ Buttons ═══════════════════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 15px;
    border: 1px solid transparent;
    border-radius: 8px;
    font: inherit;
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: filter .15s, background .15s;
}
.btn:hover { filter: brightness(.94); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }

.btn-primary { background: var(--slate-700); color: #fff; }
.btn-ok      { background: var(--ok);        color: #fff; }
.btn-danger  { background: var(--danger);    color: #fff; }
.btn-ghost   { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg); filter: none; }

.btn-sm { padding: 5px 11px; font-size: 12.5px; }
.btn-block { width: 100%; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ══ Forms ═════════════════════════════════════════════════════════ */

.field { display: block; margin-bottom: 14px; }
.field > span {
    display: block;
    margin-bottom: 5px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--muted);
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    font: inherit;
    font-size: 14px;
    color: var(--ink);
}
.field textarea { min-height: 96px; resize: vertical; }

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--slate-500);
    box-shadow: 0 0 0 3px rgba(74, 109, 140, .13);
}

.field-hint { margin: 5px 0 0; font-size: 12px; color: var(--muted); }

.field-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0 14px;
}

.check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 13.5px;
    font-weight: 600;
}
.check input { width: 16px; height: 16px; accent-color: var(--slate-600); }

/* Filter bar above a list. */
.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
}
.filters .field { margin-bottom: 0; flex: 1 1 160px; min-width: 140px; }
.filters .btn { flex-shrink: 0; }

/* ══ Definition list ═══════════════════════════════════════════════ */

.facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px 20px;
    margin: 0;
}
.facts > div { min-width: 0; }
.facts dt {
    font-size: 11.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
    margin-bottom: 3px;
}
.facts dd {
    margin: 0;
    font-weight: 700;
    word-break: break-word;
}

/* ══ Conversation ══════════════════════════════════════════════════ */

.thread { display: flex; flex-direction: column; gap: 12px; }

.msg {
    max-width: 78%;
    padding: 11px 14px;
    border-radius: 12px;
    font-size: 13.8px;
    line-height: 1.55;
}
.msg p { margin: 0; white-space: pre-wrap; }

.msg-from-member {
    align-self: flex-start;
    background: var(--bg);
    border: 1px solid var(--line);
    border-bottom-left-radius: 3px;
}
.msg-from-staff {
    align-self: flex-end;
    background: var(--slate-700);
    color: #fff;
    border-bottom-right-radius: 3px;
}

.msg-meta {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    font-weight: 700;
    opacity: .7;
}
.msg-from-staff a { color: #fff; }

/* ══ Audit trail ═══════════════════════════════════════════════════ */

.trail { list-style: none; margin: 0; padding: 0; }
.trail li {
    position: relative;
    padding: 0 0 16px 22px;
    border-left: 2px solid var(--line);
}
.trail li:last-child { border-left-color: transparent; padding-bottom: 0; }
.trail li::before {
    content: '';
    position: absolute;
    left: -6px; top: 4px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--slate-500);
}
.trail li.is-ok::before     { background: var(--ok); }
.trail li.is-danger::before { background: var(--danger); }

.trail-title { font-weight: 700; font-size: 13.8px; }
.trail-meta  { font-size: 12px; color: var(--muted); font-weight: 600; }

/* ══ Pagination ════════════════════════════════════════════════════ */

.pager {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.pager a, .pager span {
    min-width: 32px;
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--card);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    color: var(--ink);
}
.pager a:hover { background: var(--bg); }
.pager .is-current { background: var(--slate-700); border-color: var(--slate-700); color: #fff; }
.pager .is-disabled { opacity: .45; }
.pager-info { margin-right: auto; font-size: 12.5px; color: var(--muted); font-weight: 600; }

/* ══ Empty state ═══════════════════════════════════════════════════ */

.empty {
    padding: 44px 20px;
    text-align: center;
    color: var(--muted);
}
.empty i { font-size: 30px; opacity: .35; margin-bottom: 10px; display: block; }
.empty h2 { font-size: 15.5px; color: var(--ink); margin-bottom: 5px; }
.empty p { margin: 0; font-size: 13.5px; }

/* ══ Document preview ══════════════════════════════════════════════ */

.docs { display: flex; gap: 12px; flex-wrap: wrap; }
.doc {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--card);
    text-decoration: none;
    color: inherit;
    font-size: 13px;
    font-weight: 700;
}
.doc:hover { border-color: var(--slate-500); }
.doc i { color: var(--slate-500); }

/* ══ Responsive ════════════════════════════════════════════════════ */

@media (max-width: 960px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .22s ease;
    }
    .sidebar.is-open { transform: none; }

    .shell { margin-left: 0; }
    .progress { left: 0; }
    .icon-btn { display: grid; place-items: center; }

    .topbar-search { display: none; }
}

@media (max-width: 620px) {
    .content { padding: 14px; }
    .topbar { padding: 0 14px; gap: 10px; }
    .topbar-meta { display: none; }
    .msg { max-width: 92%; }

    /* A wide table on a phone scrolls inside its own box rather than
       pushing the whole page sideways. */
    .table-wrap { margin: 0 -16px; padding: 0 16px; }
}

@media print {
    .sidebar, .topbar, .footer, .btn, .pager { display: none !important; }
    .shell { margin-left: 0; }
    .card { border-color: #ccc; break-inside: avoid; }
}

/* ══ Dashboard ═════════════════════════════════════════════════════ */

.dash-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}
@media (max-width: 960px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } }

.stock-list { list-style: none; margin: 0; padding: 0; }
.stock-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--line);
}
.stock-list li:last-child { border-bottom: 0; }
.stock-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* ══ Catalogue ═════════════════════════════════════════════════════ */

.thumb {
    width: 56px; height: 40px;
    object-fit: cover;
    display: block;
    border-radius: 7px;
    border: 1px solid var(--line);
    background: var(--bg);
}
.thumb-none { display: grid; place-items: center; color: var(--muted); opacity: .6; }
.muted-line { margin-top: 2px; font-size: 12.5px; color: var(--muted); }

.edit-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
.edit-layout:has(.edit-preview) { grid-template-columns: 240px minmax(0, 1fr); }
.edit-preview img { width: 100%; border-radius: 8px; display: block; }
@media (max-width: 760px) { .edit-layout:has(.edit-preview) { grid-template-columns: minmax(0, 1fr); } }

/* ══ Vendors ═══════════════════════════════════════════════════════ */

.grid-decide { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; align-items: start; }
.muted-count { opacity: .7; font-weight: 700; margin-left: 3px; }
.card-head .filters { margin: 0; }

/* ══ Product review ════════════════════════════════════════════════ */

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.gallery a { position: relative; display: block; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg); }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-main { position: absolute; left: 6px; top: 6px; }

/* ══ Product edit ══════════════════════════════════════════════════ */

.edit-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; align-items: start; }
.gallery-item { position: relative; display: block; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-del { position: absolute; right: 6px; top: 6px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; }
.gallery-del:hover { background: var(--danger); }

/* Description editor (Quill) */
.editor-wrap { background: #fff; }
.editor-wrap .ql-toolbar.ql-snow { border: 1px solid var(--line); border-radius: 8px 8px 0 0; background: var(--bg); }
.editor-wrap .ql-container.ql-snow { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 8px 8px; font: inherit; font-size: 14px; }
.editor-wrap .ql-editor { min-height: 150px; max-height: 340px; overflow-y: auto; }

/* ══ Orders ════════════════════════════════════════════════════════ */

.inline-reason { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-reason input[type=text] { border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font: inherit; font-size: 13px; min-width: 170px; }
.card-foot .btn-row { margin-bottom: 8px; }
.card-foot .inline-reason { margin-top: 4px; }
.ship-form { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 4px 12px 12px; }
.ship-form summary { cursor: pointer; font-weight: 800; font-size: 13px; padding: 8px 0; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; flex-direction: column; gap: 1px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.timeline li:last-child { border-bottom: 0; }
.tl-when { font-size: 11.5px; color: var(--muted); font-weight: 700; }

/* ══ Website CMS ═══════════════════════════════════════════════════ */

.cms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.cms-grid.cms-maker { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.cms-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.cms-card.is-off .cms-thumb img { opacity: .45; filter: grayscale(.6); }
.cms-thumb { position: relative; background: var(--bg); }
.cms-thumb img { width: 100%; display: block; object-fit: cover; }
.cms-banner .cms-thumb img { aspect-ratio: 21 / 8; }
.cms-offer .cms-thumb img  { aspect-ratio: 16 / 5; }
.cms-maker .cms-thumb img  { aspect-ratio: 9 / 16; }
.cms-num { position: absolute; left: 8px; top: 8px; min-width: 24px; height: 24px; padding: 0 7px; display: grid; place-items: center; border-radius: 12px; background: rgba(0,0,0,.62); color: #fff; font-size: 12px; font-weight: 800; }
.cms-body { padding: 10px 12px; flex: 1; }
.cms-actions { display: flex; gap: 4px; flex-wrap: wrap; padding: 8px 10px; border-top: 1px solid var(--line); }
.cms-actions form { display: contents; }
.cms-imgfield { display: grid; grid-template-columns: minmax(180px, 320px) 1fr; gap: 16px; align-items: start; }
.cms-preview { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); object-fit: cover; }
.cms-preview.cms-banner { aspect-ratio: 21 / 8; }
.cms-preview.cms-offer  { aspect-ratio: 16 / 5; }
.cms-preview.cms-maker  { aspect-ratio: 9 / 16; max-width: 190px; }
@media (max-width: 700px) { .cms-imgfield { grid-template-columns: 1fr; } }
.source-box { display: block; width: 100%; font: 13px/1.5 Consolas, Menlo, monospace; border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.editor-wrap .ql-editor { font-size: 14.5px; }
.legal-preview { line-height: 1.6; }
.legal-preview h2 { font-size: 17px; margin: 16px 0 6px; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 18px; }
.settings-grid .field.wide { grid-column: 1 / -1; }
