/* ============================================================
   Wewo REDESIGN prototype — cabinets layer (Prom-style seller/buyer).
   STAGING ONLY: ~/workspace/wewo-redesign/stage/assets/redesign-cab.css
   Loaded AFTER assets/style.css + assets/redesign.css, so these
   rules win. Uses tokens + .rd-* components from redesign.css.
   Palette: page #F5F7FA, cards #FFFFFF, borders #E2E8F0,
   ink #0F172A / muted #475569, primary coral #D92B4E,
   deep indigo #3730A3 minor only. NO pink, NO legacy purple.
   SCOPING: seller rules live under .seller-wrap/.seller-content
   (seller shell only); buyer rules under .cab-page (the container
   class added to orders.php + account/*.php). Nothing here targets
   storefront pages — redesign-cab.css is linked site-wide via
   inc/header.php, so every rule below is cabinet-scoped.
   ============================================================ */

/* ---------- seller shell: sidebar LEFT (was row-reverse) ---------- */
.seller-wrap{max-width:1240px;margin:0 auto;padding:16px}
.seller-head{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin:8px 0 16px}
.seller-head h1{font-size:24px;line-height:1.25;overflow-wrap:anywhere}
.seller-menu-btn{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:8px 16px;
  border:1px solid rgba(255,255,255,.45);border-radius:12px;cursor:pointer;color:#fff;font-weight:700;font-size:15px;
  background:linear-gradient(180deg,#4338CA 0%,#3730A3 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.25),inset 0 -2px 4px rgba(0,0,0,.2),0 3px 10px rgba(0,0,0,.25)}
.seller-layout{display:flex;flex-direction:row;gap:20px;align-items:flex-start}
.seller-side{flex:0 0 248px;position:sticky;top:16px;background:#fff;border:1px solid var(--line);
  border-radius:16px;padding:10px;box-shadow:0 4px 16px rgba(15,23,42,.08)}
html.seller-menu-hidden .seller-side{display:none}
.seller-content{flex:1;min-width:0}
.seller-nav{display:block}
.seller-nav a{display:flex;align-items:center;gap:10px;min-height:44px;padding:8px 12px;margin:2px 0;
  border-radius:10px;background:#fff;color:var(--ink);
  font-weight:600;font-size:14px;line-height:1.35;text-decoration:none;overflow-wrap:anywhere}
.seller-ic{width:30px;height:30px;border-radius:9px;flex:none;
  display:inline-flex;align-items:center;justify-content:center;
  color:var(--indigo-text);
  background:linear-gradient(180deg,#F1F5F9,#E2E8F0);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.8),0 1px 3px rgba(55,48,163,.2)}
.seller-ic svg{display:block}
.seller-nav a.active .seller-ic{background:rgba(255,255,255,.9);color:#D92B4E}
.seller-lock{margin-left:auto;display:inline-flex;color:var(--ink-2)}
.seller-lock .seller-ic{width:22px;height:22px;border-radius:7px;background:#F1F5F9;box-shadow:none}
.seller-lock .seller-ic svg{width:14px;height:14px}
.seller-nav a:hover{background:var(--tint-1)}
.seller-nav a.active{background:linear-gradient(135deg,#D92B4E,#B81F3E);color:#fff}
.seller-nav a.locked{opacity:.65}
.seller-group{margin:2px 0}
.seller-group summary{list-style:none;display:flex;align-items:center;gap:10px;min-height:44px;padding:8px 12px;
  border-radius:10px;cursor:pointer;color:var(--ink);font-weight:700;font-size:14px;line-height:1.35;overflow-wrap:anywhere}
.seller-group summary::-webkit-details-marker{display:none}
.seller-group summary:hover{background:var(--tint-1)}
.seller-group[open] summary .seller-group-arrow{transform:rotate(90deg)}
.seller-group-arrow{display:inline-block;margin-left:auto;transition:transform .15s;flex:none}
.seller-sub{padding-left:14px;margin-left:10px;border-left:2px solid var(--tint-2)}
.seller-menu-backdrop{display:none}
/* Drawer mode (html.seller-drawer, set by the head script for narrow
   viewports AND any touch device). Right overlay drawer,
   min(320px,85vw), dim backdrop; the ☰ button stays above it. */
html.seller-drawer .seller-side{flex:none;width:min(320px,85vw);position:fixed;top:0;right:0;bottom:0;z-index:60;
  border-radius:0;overflow-y:auto;padding:72px 10px 10px;box-shadow:-8px 0 24px rgba(0,0,0,.25)}
html.seller-drawer:not(.seller-menu-hidden) .seller-menu-btn{position:relative;z-index:61}
html.seller-drawer:not(.seller-menu-hidden) .seller-menu-backdrop{display:block;position:fixed;inset:0;
  background:rgba(15,23,42,.45);z-index:55}
@media(max-width:760px){.seller-layout{flex-direction:column}.seller-side{flex:none;width:100%;position:static}.seller-content{width:100%}}

/* ---------- seller shell: banners, legacy card/table helpers ----------
   .seller-banner / .form-card / .kv-table / .stat-* / .toolbar /
   .err / .okmsg / .thumb are used by seller pages outside this
   workstream too — keep them working, in the new palette. */
.seller-banner{border-radius:12px;padding:14px 16px;margin-bottom:16px}
.seller-banner.warn{background:var(--warn-bg);border:1px solid #FDE68A;color:#78350F}
.seller-banner.info{background:var(--info-bg);border:1px solid #C7D2FE;color:#1E1B4B}
.seller-content .kv-table{width:100%;border-collapse:collapse;background:#fff;border:1px solid var(--line);border-radius:12px;overflow:hidden}
.seller-content .kv-table th,.seller-content .kv-table td{padding:10px 12px;border-bottom:1px solid var(--line);text-align:left;font-size:14px;vertical-align:top}
.seller-content .kv-table th{background:var(--tint-1);color:var(--indigo-text);font-size:13px}
.seller-content .kv-table tr:last-child td{border-bottom:0}
.seller-content .kv-table{display:block;overflow-x:auto}
.seller-content .kv-table input.input{min-width:44px}
.seller-content .stat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin-bottom:16px}
.seller-content .stat-card{background:#fff;border:1px solid var(--line);border-radius:12px;padding:14px;min-width:0;overflow-wrap:anywhere}
.seller-content .stat-card b{font-size:24px;display:block;color:var(--ink)}
.seller-content .stat-card span{font-size:13px;color:var(--ink-2)}
.seller-content .form-card{background:#fff;border:1px solid var(--line);border-radius:12px;padding:18px;margin-bottom:16px;box-shadow:var(--shadow-sm)}
.seller-content .form-card label{display:block;margin:12px 0 4px;font-weight:600;font-size:14px}
.seller-content .form-card .hint{font-size:13px;color:var(--ink-2);font-weight:400}
.seller-content .toolbar{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-bottom:14px}
.seller-content .badge.ok,.cab-page .badge.ok{background:var(--ok-bg);color:var(--ok)}
.seller-content .badge.warn,.cab-page .badge.warn{background:var(--warn-bg);color:var(--warn)}
.seller-content .badge.bad,.cab-page .badge.bad{background:var(--bad-bg);color:var(--bad)}
.seller-content .err,.cab-page .err{background:var(--bad-bg);border:1px solid #FECACA;color:#7F1D1D;border-radius:10px;padding:12px;margin-bottom:14px}
.seller-content .okmsg,.cab-page .okmsg{background:var(--ok-bg);border:1px solid #BBF7D0;color:#14532D;border-radius:10px;padding:12px;margin-bottom:14px}
.seller-content .muted,.cab-page .muted{color:var(--ink-2)}
.seller-content .small,.cab-page .small{font-size:13px}
.seller-content .thumb,.cab-page .thumb{width:64px;min-width:64px;height:64px;object-fit:cover;border-radius:8px;border:1px solid var(--line)}
/* Bottom bar (drawer mode only): active item coral, like .rd-tab. */
html.seller-drawer .seller-bottombar a.active,html.seller-drawer .seller-bottombar button.active,
html.seller-drawer .seller-bottombar [aria-current="page"]{color:var(--coral);background:#FDE8EC;border-color:#FECDD3}

/* ---------- seller tables: no empty label row on stacked cards ---------- */
.seller-content .rd-table td:not([data-label])::before,
.cab-page .rd-table td:not([data-label])::before{display:none}
.seller-content .rd-table .inline-edit{margin:2px 0}
.seller-content .rd-table td .rd-badge{margin-top:2px}

/* ---------- seller settings: profile 2-col grid collapses on mobile ---------- */
.cab-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media(max-width:640px){.cab-form-grid{grid-template-columns:1fr}}

/* ---------- seller storefront: theme swatches (moved from inline <style>) ---------- */
.seller-content .theme-swatches{display:flex;gap:12px;flex-wrap:wrap;margin:8px 0}
.seller-content .theme-swatch{display:inline-flex;flex-direction:column;align-items:center;gap:6px;cursor:pointer;font-size:13px;font-weight:600}
.seller-content .theme-swatch input{position:absolute;opacity:0}
.seller-content .theme-swatch .sw{width:72px;height:48px;border-radius:12px;border:1px solid rgba(17,24,39,.16);box-shadow:inset 0 1px 0 rgba(255,255,255,.5),0 3px 8px rgba(0,0,0,.18)}
.seller-content .theme-swatch input:checked + .sw{outline:3px solid var(--coral);outline-offset:2px}

/* ---------- cabinet form cards: labels + hints inside .rd-card ---------- */
.seller-content .rd-card label,.cab-page .rd-card label{display:block;margin:12px 0 4px;font-weight:600;font-size:14px}
.seller-content .rd-card label:has(input[type=checkbox]),.seller-content .rd-card label:has(input[type=radio]),
.cab-page .rd-card label:has(input[type=checkbox]),.cab-page .rd-card label:has(input[type=radio]){display:flex;align-items:center;gap:8px}
.seller-content .rd-card .hint,.cab-page .rd-card .hint{font-size:13px;color:var(--ink-2);font-weight:400}
.seller-content .rd-card h2,.cab-page .rd-card h2{margin-top:0}
.seller-content .rd-card,.cab-page .rd-card{margin-bottom:16px}
.seller-content .rd-card > p:last-child,.cab-page .rd-card > p:last-child{margin-bottom:0}

/* ---------- buyer cabinet: account hub ---------- */
.cab-page .account-hub a:hover{border-color:var(--coral)}
.cab-page .account-hub a svg{color:var(--indigo-text)}

/* ---------- buyer orders: LARGE pickup PIN + tracking + escrow ---------- */
.cab-pin{display:block;margin-top:10px;border:2px solid var(--indigo);border-radius:12px;padding:10px 12px;background:var(--info-bg)}
.cab-pin__label{display:block;font-weight:700;font-size:13px;color:var(--indigo-text)}
.cab-pin__code{display:block;font-size:28px;font-weight:800;letter-spacing:4px;color:var(--ink);line-height:1.3;overflow-wrap:anywhere}
.cab-pin__hint{display:block;font-size:12px;color:var(--ink-2);margin-top:2px}
.cab-order-extra{display:block;margin-top:6px;font-size:13px;color:var(--ink-2);overflow-wrap:anywhere}
.cab-order-extra a{font-weight:600}
@media(max-width:640px){
  /* Stacked rd-table card: the PIN block spans the full card width. */
  .cab-page .rd-table td .cab-pin{margin:8px 0 2px}
  .seller-head h1{font-size:20px}
  .seller-head .seller-menu-btn{flex:1 1 auto;justify-content:center}
}

/* ---------- v2.6.321: seller notifications bell + panel ---------- */
.seller-bell-wrap{position:relative;display:flex;align-items:center}
.seller-bell-btn{position:relative;display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;border:1px solid var(--border,#d8d8e0);border-radius:10px;background:#fff;color:var(--indigo-text,#2b2b6b);cursor:pointer}
.seller-bell-btn:hover{border-color:var(--indigo,#4f46e5)}
.seller-bell-badge{position:absolute;top:-6px;right:-6px;min-width:20px;height:20px;padding:0 5px;border-radius:10px;background:#D92B4E;color:#fff;font-size:11px;font-weight:800;line-height:20px;text-align:center}
.seller-bell-panel{position:absolute;top:calc(100% + 8px);right:0;width:min(340px,90vw);max-height:70vh;overflow:auto;z-index:60;background:#fff;border:1px solid var(--border,#d8d8e0);border-radius:12px;box-shadow:0 10px 30px rgba(20,20,60,.18);padding:12px}
.seller-bell-head{display:flex;justify-content:space-between;align-items:baseline;gap:8px;margin-bottom:8px}
.seller-bell-item{padding:8px;border-radius:8px;margin-bottom:8px;background:#f7f7fb}
.seller-bell-item strong{display:block}
.seller-bell-item p{font-size:13px}
.notif-unread{border-left:3px solid #D92B4E}
