/* ─── RESET ──────────────────────────────────────────────────────────────────── */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html,body,#root{height:100%;overflow:hidden}

/* ─── LIGHT THEME VARIABLES ─────────────────────────────────────────────────── */
:root{
  /* Backgrounds */
  --bg:#f0f2f5;
  --surface:#ffffff;
  --surface2:#f7f8fa;
  --surface3:#eef0f4;
  --surface4:#e4e7ed;

  /* Borders */
  --border:#e2e5eb;
  --border2:#d0d4dc;
  --border3:#b8bec9;

  /* Text */
  --text:#1a1d24;
  --text2:#4a5568;
  --text3:#8a95a8;
  --text4:#b0bac8;

  /* Brand */
  --accent:#2563eb;
  --accent2:#3b82f6;
  --accent-dim:rgba(37,99,235,0.08);
  --accent-hover:#1d4ed8;

  /* Status colours */
  --green:#16a34a;
  --green-dim:rgba(22,163,74,0.1);
  --red:#dc2626;
  --red-dim:rgba(220,38,38,0.08);
  --yellow:#d97706;
  --yellow-dim:rgba(217,119,6,0.1);
  --blue:#2563eb;
  --blue-dim:rgba(37,99,235,0.08);
  --purple:#7c3aed;
  --purple-dim:rgba(124,58,237,0.1);
  --orange:#ea580c;
  --orange-dim:rgba(234,88,12,0.1);
  --cyan:#0891b2;
  --cyan-dim:rgba(8,145,178,0.1);

  /* Typography */
  --font:'Barlow',system-ui,sans-serif;
  --font-mono:'DM Mono',monospace;
  --font-cond:'Barlow Condensed',sans-serif;

  /* Radii & spacing */
  --radius:6px;
  --radius-lg:10px;
  --radius-xl:14px;
}

body{font-family:var(--font);font-size:14px;color:var(--text);background:var(--bg);line-height:1.5}

/* ─── LAYOUT ─────────────────────────────────────────────────────────────────── */
.shell{display:flex;height:100vh;height:100dvh;overflow:hidden}
.sidebar{width:224px;min-width:224px;background:var(--surface);border-right:1px solid var(--border);display:flex;flex-direction:column;overflow:hidden;z-index:10;box-shadow:1px 0 3px rgba(0,0,0,.04)}
.main{flex:1;display:flex;flex-direction:column;overflow:hidden;min-width:0;background:var(--bg)}
.topbar{height:52px;background:var(--surface);border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;padding:0 20px;flex-shrink:0;box-shadow:0 1px 3px rgba(0,0,0,.04)}
.topbar-title{font-family:var(--font-cond);font-weight:700;font-size:18px;color:var(--text);letter-spacing:.3px}
.topbar-right{display:flex;align-items:center;gap:8px}
.page{flex:1;overflow-y:auto;padding:24px}

/* ─── LOGO ───────────────────────────────────────────────────────────────────── */
.logo{padding:16px 18px 12px;border-bottom:1px solid var(--border)}
.logo-name{font-family:var(--font-cond);font-weight:900;font-size:22px;color:var(--accent);letter-spacing:.5px}
.logo-sub{font-family:var(--font-mono);font-size:9px;color:var(--text3);margin-top:1px;letter-spacing:1px;text-transform:uppercase}

/* ─── NAVIGATION ─────────────────────────────────────────────────────────────── */
.nav{flex:1;overflow-y:auto;padding:8px 0}
.nav-sec{font-family:var(--font-mono);font-size:9px;color:var(--text3);padding:12px 18px 4px;text-transform:uppercase;letter-spacing:1.5px}
.nav-item{display:flex;align-items:center;gap:9px;padding:7px 18px;cursor:pointer;color:var(--text2);font-size:13.5px;font-weight:500;border-radius:0;transition:all .12s;position:relative;margin:1px 8px;border-radius:6px}
.nav-item:hover{background:var(--surface3);color:var(--text)}
.nav-item.active{background:var(--accent-dim);color:var(--accent);font-weight:600}
.nav-item.active::before{content:'';position:absolute;left:0;top:4px;bottom:4px;width:3px;background:var(--accent);border-radius:0 2px 2px 0;left:-8px}
.nav-icon{font-size:14px;width:18px;text-align:center;opacity:.7}
.nav-badge{background:var(--red);color:#fff;font-size:9px;font-weight:700;padding:1px 5px;border-radius:10px;margin-left:auto;font-family:var(--font-mono)}
.sidebar-foot{padding:10px 16px;border-top:1px solid var(--border);font-family:var(--font-mono);font-size:10px;color:var(--text4)}

/* ─── PAGE HEADER ────────────────────────────────────────────────────────────── */
.page-hdr{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:20px;gap:12px;flex-wrap:wrap}
.page-hdr-left h1{font-family:var(--font-cond);font-weight:800;font-size:24px;color:var(--text);letter-spacing:.2px}
.page-hdr-left p{color:var(--text3);font-size:13px;margin-top:2px}
.page-hdr-right{display:flex;align-items:center;gap:8px;flex-wrap:wrap}

/* ─── CARDS ──────────────────────────────────────────────────────────────────── */
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);overflow:hidden;margin-bottom:0}
.card-hdr{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid var(--border);background:var(--surface2)}
.card-title{font-weight:700;font-size:13px;color:var(--text);text-transform:uppercase;letter-spacing:.4px}
.card-body{padding:14px 16px}
.g2{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.g3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:16px}
.g4{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}

/* ─── STAT CARDS ─────────────────────────────────────────────────────────────── */
.stat-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:14px 16px;transition:.15s}
.stat-card:hover{border-color:var(--accent);box-shadow:0 2px 8px rgba(37,99,235,.08)}
.stat-lbl{font-size:11px;font-weight:600;color:var(--text3);text-transform:uppercase;letter-spacing:.6px;margin-bottom:6px}
.stat-val{font-family:var(--font-cond);font-weight:800;font-size:26px;color:var(--text);line-height:1}
.stat-sub{font-size:11px;color:var(--text3);margin-top:3px}
.c-accent{color:var(--accent)!important}
.c-green{color:var(--green)!important}
.c-red{color:var(--red)!important}
.c-yellow{color:var(--yellow)!important}
.c-blue{color:var(--blue)!important}
.c-muted{color:var(--text3)!important}
.c-text2{color:var(--text2)!important}

/* ─── BUTTONS ────────────────────────────────────────────────────────────────── */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:7px 14px;border-radius:var(--radius);font-family:var(--font);font-size:13px;font-weight:600;cursor:pointer;border:1px solid transparent;transition:all .12s;line-height:1;white-space:nowrap}
.btn:disabled{opacity:.45;cursor:not-allowed}
.btn-primary{background:var(--accent);color:#fff;border-color:var(--accent)}
.btn-primary:hover:not(:disabled){background:var(--accent-hover)}
.btn-ghost{background:transparent;color:var(--text2);border-color:var(--border2)}
.btn-ghost:hover:not(:disabled){background:var(--surface3);color:var(--text);border-color:var(--border3)}
.btn-danger{background:var(--red);color:#fff;border-color:var(--red)}
.btn-danger:hover:not(:disabled){background:#b91c1c}
.btn-success{background:var(--green);color:#fff;border-color:var(--green)}
.btn-success:hover:not(:disabled){background:#15803d}
.btn-warning{background:var(--yellow);color:#fff;border-color:var(--yellow)}
.btn-outline{background:transparent;color:var(--accent);border-color:var(--accent)}
.btn-outline:hover:not(:disabled){background:var(--accent-dim)}
.btn-sm{padding:5px 10px;font-size:12px}
.btn-xs{padding:3px 8px;font-size:11px}
.btn-lg{padding:10px 20px;font-size:14px}
.btn-icon{padding:6px 8px}
.w100{width:100%}

/* ─── BADGES ─────────────────────────────────────────────────────────────────── */
.badge{display:inline-flex;align-items:center;font-size:11px;font-weight:600;padding:2px 8px;border-radius:20px;letter-spacing:.2px;white-space:nowrap}
.badge-xs{font-size:10px;padding:1px 6px}
.bdg-gray{background:#f1f5f9;color:#64748b;border:1px solid #e2e8f0}
.bdg-green{background:var(--green-dim);color:var(--green);border:1px solid rgba(22,163,74,.2)}
.bdg-red{background:var(--red-dim);color:var(--red);border:1px solid rgba(220,38,38,.2)}
.bdg-yellow{background:var(--yellow-dim);color:var(--yellow);border:1px solid rgba(217,119,6,.2)}
.bdg-blue{background:var(--blue-dim);color:var(--blue);border:1px solid rgba(37,99,235,.2)}
.bdg-purple{background:var(--purple-dim);color:var(--purple);border:1px solid rgba(124,58,237,.2)}
.bdg-orange{background:var(--orange-dim);color:var(--orange);border:1px solid rgba(234,88,12,.2)}
.bdg-cyan{background:var(--cyan-dim);color:var(--cyan);border:1px solid rgba(8,145,178,.2)}

/* ─── TABLES ─────────────────────────────────────────────────────────────────── */
table{width:100%;border-collapse:collapse;font-size:13px}
thead th{font-size:10.5px;font-weight:700;text-transform:uppercase;letter-spacing:.6px;color:var(--text3);padding:9px 12px;background:var(--surface2);border-bottom:1px solid var(--border);text-align:left;white-space:nowrap}
tbody td{padding:10px 12px;border-bottom:1px solid var(--border);color:var(--text2);vertical-align:middle}
tbody tr:last-child td{border-bottom:none}
tbody tr:hover{background:var(--surface2)}
tbody tr:hover td{color:var(--text)}
.sm{font-size:12px}
.xs{font-size:11px}
.fw7{font-weight:700}
.fw6{font-weight:600}
.mono{font-family:var(--font-mono)}

/* ─── TABS ───────────────────────────────────────────────────────────────────── */
.tabs{display:flex;border-bottom:2px solid var(--border);margin-bottom:18px;overflow-x:auto;flex-shrink:0;gap:2px}
.tab{padding:8px 16px;font-size:13px;font-weight:600;color:var(--text3);cursor:pointer;border-bottom:2px solid transparent;margin-bottom:-2px;white-space:nowrap;transition:.12s}
.tab:hover{color:var(--text2)}
.tab.active{color:var(--accent);border-bottom-color:var(--accent)}
.tab-count{display:inline-flex;align-items:center;justify-content:center;background:var(--surface3);color:var(--text3);font-size:10px;font-family:var(--font-mono);padding:1px 5px;border-radius:10px;margin-left:5px;min-width:18px}
.tab.active .tab-count{background:var(--accent-dim);color:var(--accent)}

/* ─── FORMS ──────────────────────────────────────────────────────────────────── */
.f-grid{display:flex;flex-direction:column;gap:14px}
.f-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px}
.f-group{display:flex;flex-direction:column;gap:4px}
.f-label{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.6px;color:var(--text3)}
.f-input{background:var(--surface);border:1.5px solid var(--border2);border-radius:var(--radius);padding:8px 11px;color:var(--text);font-family:var(--font);font-size:13.5px;outline:none;transition:border .12s;width:100%}
.f-input:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-dim)}
.f-input:disabled{background:var(--surface3);color:var(--text3);cursor:not-allowed}
select.f-input{cursor:pointer}
textarea.f-input{resize:vertical;min-height:80px}
/* 12-column form grid — used by layout-managed sections (js/layouts.js).
   Each field carries an inline `grid-column: span N`. Below 900px every field
   goes full width, so a customised layout can't make a narrow window unusable.
   `.f-row` above is untouched and still serves every unconverted screen. */
.f-grid-12{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:14px 12px;align-items:start}
@media(max-width:900px){.f-grid-12>*{grid-column:span 12!important}}
.f-section{padding:14px;background:var(--surface2);border-radius:var(--radius);border:1px solid var(--border)}
.f-section-title{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.7px;color:var(--text3);margin-bottom:10px}
.cb{accent-color:var(--accent);width:14px;height:14px;cursor:pointer}

/* ─── LAYOUT EDITOR (arrange mode) ──────────────────────────────────────────
   Chrome shown only while an admin is rearranging a screen — see useLayoutEditor
   in js/ui.js. All token-driven, so it follows whichever theme is active. */
.lay-bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:6px 10px;border:1px solid var(--accent);background:var(--accent-dim);border-radius:var(--radius)}
.lay-bar-tag{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.6px;color:var(--accent)}
.lay-sec{outline:1.5px dashed var(--border3);outline-offset:2px}
.lay-sec-hdr{display:flex;align-items:center;gap:8px}
.lay-sec-title{flex:1;min-width:80px;background:var(--surface);border:1px solid var(--border2);border-radius:var(--radius);padding:4px 8px;font-family:var(--font);font-size:12px;font-weight:700;color:var(--text);outline:none}
.lay-sec-title:focus{border-color:var(--accent)}
.lay-sel{background:var(--surface);border:1px solid var(--border2);border-radius:var(--radius);padding:4px 6px;font-family:var(--font);font-size:11px;color:var(--text);cursor:pointer}
.lay-tag{font-size:9px;font-weight:700;text-transform:uppercase;letter-spacing:.5px;color:var(--accent);background:var(--accent-dim);border-radius:3px;padding:2px 5px;white-space:nowrap}
.lay-tabedit{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:-8px 0 14px}

.lay-cell{position:relative;border:1px dashed var(--border3);border-radius:var(--radius);padding:0 0 8px;background:var(--surface2)}
.lay-cell.lay-hidden{opacity:.45}
/* the cell being dragged fades, so the drop line is what draws the eye */
.lay-cell.lay-dragging{opacity:.4}
/* insertion line — sits in the gutter between fields, on the edge the field
   will land against. ::before rather than a border so it doesn't shift layout. */
.lay-cell.lay-drop-before::before,
.lay-cell.lay-drop-after::before{
  content:'';position:absolute;top:-2px;bottom:-2px;width:3px;border-radius:2px;
  background:var(--accent);box-shadow:0 0 0 1px var(--surface);z-index:2;
}
.lay-cell.lay-drop-before::before{left:-7px}
.lay-cell.lay-drop-after::before{right:-7px}
.lay-cell-bar{display:flex;align-items:center;gap:6px;padding:5px 6px;border-bottom:1px dashed var(--border2);background:var(--surface3);border-radius:var(--radius) var(--radius) 0 0;cursor:grab;user-select:none}
.lay-cell-bar:active{cursor:grabbing}
.lay-cell-bar:hover{background:var(--surface4)}
.lay-cell-name{flex:1;min-width:0;font-size:10.5px;font-weight:700;color:var(--text2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lay-span{font-family:var(--font-mono);font-size:9.5px;color:var(--text3);flex-shrink:0}
.lay-cell-body{padding:8px 8px 0}
.lay-grip{color:var(--text3);font-size:12px;line-height:1;flex-shrink:0;user-select:none}
/* section grips stay the drag handle (their header holds a text input), so give
   them a real hit area rather than a 9px glyph */
.lay-grip-lg{cursor:grab;padding:5px 7px;margin:-3px 0;border-radius:4px;font-size:13px}
.lay-grip-lg:hover{background:var(--surface4);color:var(--text)}
.lay-grip-lg:active{cursor:grabbing}
.lay-grip:active{cursor:grabbing}
.lay-btn{border:none;background:transparent;color:var(--text3);font-size:11px;line-height:1;padding:2px 3px;cursor:pointer;border-radius:3px;flex-shrink:0}
.lay-btn:hover{background:var(--surface4);color:var(--text)}
.lay-btn-danger:hover{background:var(--red);color:#fff}
/* the resize gripper straddles the cell's right edge */
.lay-resize{position:absolute;top:0;right:-3px;width:7px;height:100%;cursor:col-resize;border-radius:3px}
.lay-resize:hover{background:var(--accent)}
.lay-empty{padding:14px;text-align:center;font-size:12px;color:var(--text3);border:1px dashed var(--border3);border-radius:var(--radius)}

/* ─── TOGGLE ─────────────────────────────────────────────────────────────────── */
.tog-wrap{display:flex;align-items:center;gap:8px;cursor:pointer}
.tog{position:relative;display:inline-block;width:34px;height:18px;flex-shrink:0}
.tog input{display:none}
.tog-sl{position:absolute;inset:0;background:var(--border3);border-radius:9px;transition:.2s}
.tog-sl::after{content:'';position:absolute;width:14px;height:14px;left:2px;top:2px;background:#fff;border-radius:50%;transition:.2s;box-shadow:0 1px 3px rgba(0,0,0,.2)}
.tog input:checked~.tog-sl{background:var(--accent)}
.tog input:checked~.tog-sl::after{transform:translateX(16px)}
.tog-lbl{font-size:13px;color:var(--text2)}

/* ─── MODAL ──────────────────────────────────────────────────────────────────── */
.overlay{position:fixed;inset:0;background:rgba(15,20,30,.35);z-index:200;display:flex;align-items:center;justify-content:center;backdrop-filter:blur(2px)}
.modal{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-xl);width:92%;max-width:720px;max-height:93vh;max-height:93dvh;overflow-y:auto;display:flex;flex-direction:column;box-shadow:0 20px 60px rgba(0,0,0,.15)}
.modal-lg{max-width:900px}
.modal-xl{max-width:1180px;max-height:96vh;max-height:96dvh;width:96%}
.modal-hdr{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid var(--border);flex-shrink:0;background:var(--surface2)}
.modal-ttl{font-family:var(--font-cond);font-weight:800;font-size:17px;color:var(--text)}
.modal-body{padding:20px;flex:1;overflow-y:auto}
.modal-foot{padding:14px 20px;border-top:1px solid var(--border);display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px;background:var(--surface2);flex-shrink:0}

/* ─── ALERTS ─────────────────────────────────────────────────────────────────── */
.alert{display:flex;align-items:flex-start;gap:8px;padding:10px 14px;border-radius:var(--radius);font-size:13px;font-weight:500;line-height:1.5}
.alert-info{background:#eff6ff;color:#1d4ed8;border:1px solid #bfdbfe}
.alert-warn{background:#fffbeb;color:#92400e;border:1px solid #fcd34d}
.alert-danger{background:#fef2f2;color:#991b1b;border:1px solid #fecaca}
.alert-success{background:#f0fdf4;color:#14532d;border:1px solid #bbf7d0}
.mb8{margin-bottom:8px}
.mb12{margin-bottom:12px}
.mb16{margin-bottom:16px}
.mb20{margin-bottom:20px}
.mt8{margin-top:8px}
.mt10{margin-top:10px}
.mt12{margin-top:12px}
.flex{display:flex}
.aic{align-items:center}
.jcsb{justify-content:space-between}
.wrap{flex-wrap:wrap}
.gap4{gap:4px}
.gap6{gap:6px}
.gap8{gap:8px}
.gap10{gap:10px}
.gap12{gap:12px}

/* ─── DROPDOWN ───────────────────────────────────────────────────────────────── */
.dd-wrap{position:relative}
.dd-menu{position:absolute;top:calc(100% + 3px);left:0;right:0;background:var(--surface);border:1.5px solid var(--border2);border-radius:var(--radius);z-index:100;max-height:240px;overflow-y:auto;box-shadow:0 6px 20px rgba(0,0,0,.1)}
.dd-item{padding:8px 12px;cursor:pointer;font-size:13px;color:var(--text2);transition:.1s}
.dd-item:hover{background:var(--surface3);color:var(--text)}
.dd-item.selected{background:var(--accent-dim);color:var(--accent);font-weight:600}
.dd-empty{padding:10px 12px;font-size:12px;color:var(--text3);font-style:italic}

/* ─── CHIPS ──────────────────────────────────────────────────────────────────── */
.chip-wrap{display:flex;flex-wrap:wrap;gap:4px;background:var(--surface);border:1.5px solid var(--border2);border-radius:var(--radius);padding:5px 8px;min-height:38px;cursor:text}
.chip-wrap:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-dim)}
.chip{display:inline-flex;align-items:center;gap:4px;background:var(--accent-dim);color:var(--accent);border-radius:4px;padding:2px 7px;font-size:12px;font-weight:600}
.chip-x{cursor:pointer;font-size:13px;line-height:1;opacity:.7}
.chip-x:hover{opacity:1}
.chip-input{border:none;outline:none;font-family:var(--font);font-size:13px;background:transparent;color:var(--text);flex:1;min-width:80px}
.tag{display:inline-flex;align-items:center;background:var(--surface3);border:1px solid var(--border2);border-radius:4px;padding:2px 8px;font-size:11px;color:var(--text2);gap:4px}

/* ─── SEARCH BOX ─────────────────────────────────────────────────────────────── */
.search-box{position:relative;display:flex;align-items:center}
.search-icon{position:absolute;left:10px;color:var(--text3);font-size:15px;pointer-events:none}
.search-box .f-input{padding-left:32px}

/* ─── LINE ITEMS ─────────────────────────────────────────────────────────────── */
.line-item{border:1px solid var(--border);border-radius:var(--radius);overflow:visible;margin-bottom:6px;background:var(--surface)}
.line-item:hover{border-color:var(--border3)}
.line-item-body{background:var(--surface2);border-top:1px solid var(--border);padding:14px 16px}
.li-cell{padding:9px 10px;border-right:1px solid var(--border);display:flex;align-items:center}
.li-cell:last-child{border-right:none}
.li-input{background:transparent;border:none;color:var(--text);font-family:var(--font);font-size:12.5px;width:100%;outline:none;padding:2px 0}
.li-input:focus{background:var(--surface3);border-radius:3px;padding:2px 5px}
.line-divider{background:var(--accent-dim);border:1px solid rgba(37,99,235,.2);border-radius:var(--radius);padding:8px 14px;margin-bottom:6px;display:flex;align-items:center;gap:8px;cursor:grab}
.line-divider:active{cursor:grabbing}
.drag-handle{color:var(--text3);cursor:grab;font-size:16px;padding:2px 4px;line-height:1}
.drag-handle:active{cursor:grabbing}
.drag-over{border:2px dashed var(--accent)!important;background:var(--accent-dim)!important}

/* ─── SIZES ──────────────────────────────────────────────────────────────────── */
.size-row{display:grid;gap:4px;align-items:center;padding:4px 6px;background:var(--surface3);border-radius:4px;margin-bottom:3px}
.size-label{font-size:12px;font-weight:700;color:var(--text)}
.size-input{background:var(--surface);border:1.5px solid var(--border2);border-radius:4px;padding:4px 7px;color:var(--text);font-size:12px;font-family:var(--font-mono);text-align:right;width:100%;outline:none}
.size-input:focus{border-color:var(--accent);box-shadow:0 0 0 2px var(--accent-dim)}

/* ─── DECORATIONS ────────────────────────────────────────────────────────────── */
.dec-item{display:flex;align-items:flex-start;gap:10px;padding:10px 12px;background:var(--surface2);border:1px solid var(--border);border-radius:var(--radius);margin-bottom:6px}
.dec-item-name{flex:1;font-size:13px;font-weight:600}
.dec-price-wrap{display:flex;gap:6px;align-items:center}

/* ─── ADDRESSES ──────────────────────────────────────────────────────────────── */
.addr-card{background:var(--surface2);border:1px solid var(--border);border-radius:var(--radius);padding:10px 12px;display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
.addr-default-badge{background:var(--accent-dim);color:var(--accent);font-family:var(--font-mono);font-size:9px;padding:2px 6px;border-radius:3px;text-transform:uppercase;letter-spacing:.5px;font-weight:700}

/* ─── MODALS / POPUPS ────────────────────────────────────────────────────────── */
.popup-panel{position:fixed;top:5vh;right:2vw;width:min(90vw,860px);height:90vh;background:var(--surface);border:1px solid var(--border2);border-radius:var(--radius-xl);box-shadow:0 20px 60px rgba(0,0,0,.15);display:flex;flex-direction:column;z-index:300;overflow:hidden}
.popup-hdr{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;border-bottom:1px solid var(--border);background:var(--surface2);flex-shrink:0}
.popup-body{flex:1;overflow-y:auto;padding:20px 24px}

/* ─── ARTWORK STAGES ─────────────────────────────────────────────────────────── */
.artwork-stage-bar{display:flex;gap:0;overflow-x:auto;padding-bottom:4px}
.artwork-stage-step{display:flex;flex-direction:column;align-items:center;gap:4px;min-width:80px}
.artwork-stage-dot{width:10px;height:10px;border-radius:50%;background:var(--surface3);border:2px solid var(--border2)}
.artwork-stage-dot.active{background:var(--accent);border-color:var(--accent)}
.artwork-stage-dot.has-items{background:var(--blue);border-color:var(--blue)}
.artwork-stage-label{font-size:9px;color:var(--text3);text-align:center;white-space:nowrap}
.artwork-progress{display:flex;align-items:flex-start;gap:0;overflow-x:auto;padding:12px 0}
.artwork-progress-step{display:flex;flex-direction:column;align-items:center;flex:1;min-width:80px;position:relative}
.artwork-progress-dot{width:28px;height:28px;border-radius:50%;background:var(--surface3);border:2px solid var(--border2);display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:700;color:var(--text3);flex-shrink:0;position:relative;z-index:1}
.artwork-progress-dot.done{background:var(--green);border-color:var(--green);color:#fff}
.artwork-progress-dot.current{background:var(--accent);border-color:var(--accent);color:#fff;box-shadow:0 0 0 4px var(--accent-dim)}
.artwork-progress-label{font-size:10px;color:var(--text3);text-align:center;margin-top:4px;white-space:nowrap}
.artwork-progress-line{position:absolute;top:14px;left:calc(50% + 14px);right:calc(-50% + 14px);height:2px;background:var(--border2);z-index:0}
.artwork-progress-line.done{background:var(--green)}

/* ─── VERSIONS / MESSAGES ────────────────────────────────────────────────────── */
.version-card{background:var(--surface2);border:1px solid var(--border);border-radius:var(--radius);padding:12px 14px;margin-bottom:8px}
.version-add-form{background:var(--surface3);border:1.5px dashed var(--border3);border-radius:var(--radius);padding:14px;margin-top:10px}
.message-bubble{padding:10px 14px;border-radius:var(--radius);margin-bottom:10px;max-width:90%}
.message-bubble.designer{background:var(--surface2);border:1px solid var(--border);margin-left:0}
.message-bubble.client{background:var(--accent-dim);border:1px solid rgba(37,99,235,.2);margin-left:auto}
.message-meta{display:flex;justify-content:space-between;align-items:center;margin-bottom:4px}
.file-chip{display:inline-flex;align-items:center;gap:4px;background:var(--surface3);border:1px solid var(--border2);border-radius:4px;padding:3px 9px;font-size:11px;font-family:var(--font-mono);color:var(--text2)}

/* ─── ORDER TASK CHECKLIST ───────────────────────────────────────────────────── */
.task-list{display:flex;flex-direction:column;gap:6px}
.task-item{display:flex;align-items:center;gap:10px;padding:10px 14px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);transition:.12s}
.task-item.done{background:var(--green-dim);border-color:rgba(22,163,74,.25)}
.task-item.done .task-label{text-decoration:line-through;color:var(--text3)}
.task-item.blocked{background:var(--red-dim);border-color:rgba(220,38,38,.2)}
.task-check{width:18px;height:18px;border-radius:50%;border:2px solid var(--border3);display:flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0;transition:.12s}
.task-check.done{background:var(--green);border-color:var(--green);color:#fff}
.task-label{font-size:13.5px;font-weight:500;flex:1}
.task-meta{font-size:11px;color:var(--text3);font-family:var(--font-mono)}

/* ─── COMMUNICATION HISTORY ──────────────────────────────────────────────────── */
.comm-item{display:flex;gap:12px;padding:12px 0;border-bottom:1px solid var(--border)}
.comm-item:last-child{border-bottom:none}
.comm-icon{width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:14px;flex-shrink:0}
.comm-icon.note{background:#eff6ff;color:var(--blue)}
.comm-icon.email{background:#f0fdf4;color:var(--green)}
.comm-icon.call{background:#fffbeb;color:var(--yellow)}
.comm-icon.system{background:var(--surface3);color:var(--text3)}
.comm-body{flex:1}
.comm-title{font-weight:600;font-size:13px;margin-bottom:2px}
.comm-text{font-size:12.5px;color:var(--text2);line-height:1.5}
.comm-meta{font-size:11px;color:var(--text3);font-family:var(--font-mono);margin-top:4px}

/* ─── DIVIDER ────────────────────────────────────────────────────────────────── */
.divider{border:none;border-top:1px solid var(--border);margin:14px 0}

/* ─── MISC ───────────────────────────────────────────────────────────────────── */
.img-upload{border:2px dashed var(--border2);border-radius:var(--radius);padding:24px;text-align:center;cursor:pointer;transition:.12s}
.img-upload:hover{border-color:var(--accent);background:var(--accent-dim)}
.img-upload-icon{font-size:24px;margin-bottom:6px}
.img-upload-text{font-size:13px;color:var(--text2);font-weight:500}
.tbl-wrap{overflow-x:auto}
.accordion{border:1px solid var(--border);border-radius:var(--radius);overflow:hidden}
.kanban{display:flex;gap:12px;overflow-x:auto;padding-bottom:10px;align-items:flex-start}
.k-col{min-width:220px;width:220px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);display:flex;flex-direction:column;max-height:560px}
.k-col-hdr{padding:10px 12px;font-weight:700;font-size:12px;text-transform:uppercase;letter-spacing:.5px;border-bottom:1px solid var(--border);background:var(--surface2)}
.k-cards{flex:1;padding:8px;display:flex;flex-direction:column;gap:7px;overflow-y:auto}
.product-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);overflow:hidden;cursor:pointer;transition:all .15s}
.product-card:hover{border-color:var(--accent);box-shadow:0 2px 8px var(--accent-dim)}

/* ─── V8 ADDITIONS ─────────────────────────────────────────────────────────── */

/* Drag and drop */
.line-item.dragging { opacity: 0.4; border: 2px dashed var(--accent); }
.line-item.drag-over { border-top: 3px solid var(--accent); }
.line-divider.dragging { opacity: 0.4; }
.line-divider.drag-over { border-top: 3px solid var(--accent); }

/* Task status pills on line items */
.task-pill { display:inline-flex; align-items:center; gap:3px; font-size:10px; font-weight:700; padding:2px 7px; border-radius:10px; letter-spacing:.2px; }
.task-pill.done { background:var(--green-dim); color:var(--green); }
.task-pill.pending { background:var(--yellow-dim); color:var(--yellow); }
.task-pill.waiting { background:var(--surface3); color:var(--text3); }

/* Inline label edit */
.inline-edit { background:transparent; border:none; border-bottom:1.5px solid var(--accent); outline:none; font-family:var(--font); font-size:inherit; font-weight:inherit; color:inherit; padding:0 2px; width:auto; min-width:80px; }

/* Unsaved nav prompt */
.nav-item.has-changes { position:relative; }

/* Packing confirm button */
.btn-packing { background:var(--orange-dim); color:var(--orange); border-color:var(--orange); }
.btn-packing:hover { background:var(--orange); color:#fff; }

/* Communication files */
.comm-files { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }

/* Link badge on comm entry */
.comm-link { font-size:10px; font-family:var(--font-mono); background:var(--surface3); color:var(--text3); padding:1px 6px; border-radius:3px; }

/* Horizontal scrollbar that sticks to viewport bottom */
.sticky-hscroll { overflow-x: auto; overflow-y: visible; }
.sticky-hscroll::-webkit-scrollbar { height: 10px; }
.sticky-hscroll::-webkit-scrollbar-track { background: var(--surface2); }
.sticky-hscroll::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 10px; border: 2px solid var(--surface2); }
.sticky-hscroll::-webkit-scrollbar-thumb:hover { background: var(--text3); }
/* Sticky scrollbar wrapper */
.sticky-hscroll-wrap { display: flex; flex-direction: column; }
.sticky-hscroll-bar { overflow-x: auto; overflow-y: hidden; position: sticky; bottom: 0; z-index: 10; background: var(--surface); border-top: 1px solid var(--border); }
.sticky-hscroll-bar::-webkit-scrollbar { height: 10px; }
.sticky-hscroll-bar::-webkit-scrollbar-track { background: var(--surface2); }
.sticky-hscroll-bar::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 10px; border: 2px solid var(--surface2); }
.sticky-hscroll-bar::-webkit-scrollbar-thumb:hover { background: var(--text3); }
.sticky-hscroll-bar div { height: 1px; }
/* Sticky horizontal scrollbar bar */
[style*="overflow-x: scroll"][style*="position: sticky"],
[style*="overflowX: scroll"][style*="position: sticky"] {
  scrollbar-width: auto;
}


/* Sticky line item header */
.line-item-hdr-sticky {
  position: sticky;
  top: var(--sticky-line-top, 50px);
  z-index: 8;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.line-item-hdr-sticky:hover { background: var(--surface); }

/* Quote/order detail - flush sticky bar to top of page */
.quote-detail-wrap { margin: -24px -24px 0 -24px; padding: 0 24px; }
.page:has(.quote-detail-wrap) { padding-top: 0; }
.quote-detail-wrap > .flex.aic { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.quote-detail-body { padding-top: 24px; }

/* ─── FEATURE REQUESTS / BUG REGISTER ────────────────────────────────────────── */
.fr-toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:14px}
.fr-board{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;align-items:start}
@media(max-width:900px){.fr-board{grid-template-columns:1fr}}
.fr-col{background:var(--surface2);border:1px solid var(--border);border-radius:var(--radius-lg);display:flex;flex-direction:column;min-height:200px;max-height:calc(100vh - 260px);overflow:hidden;transition:border-color .12s,background .12s}
.fr-board-modal .fr-col{max-height:60vh}
.fr-col.fr-drop{border:2px dashed var(--accent);background:var(--accent-dim)}
.fr-col-hdr{display:flex;align-items:center;gap:8px;padding:10px 12px;border-bottom:1px solid var(--border);background:var(--surface);flex-shrink:0}
.fr-col-title{font-weight:700;font-size:12px;text-transform:uppercase;letter-spacing:.5px;color:var(--text);line-height:1.2}
.fr-col-sub{font-size:10.5px;color:var(--text3);line-height:1.3}
.fr-col-add{margin:0 10px 10px;flex-shrink:0}
.fr-cards{flex:1;overflow-y:auto;padding:10px;display:flex;flex-direction:column;gap:8px}
.fr-empty{padding:16px 10px;text-align:center;font-size:12px;color:var(--text3);font-style:italic}

.fr-card{background:var(--surface);border:1px solid var(--border);border-left:3px solid var(--border2);border-radius:var(--radius);padding:10px 11px;cursor:pointer;transition:border-color .12s,box-shadow .12s}
.fr-card:hover{border-color:var(--accent);box-shadow:0 3px 10px rgba(0,0,0,.07)}
.fr-card-archived{opacity:.55}
.fr-card-picked{background:var(--accent-dim);border-color:var(--accent)}
/* insertion indicator while dragging a card into a position in the pipeline */
.fr-card-drop-before{box-shadow:0 -3px 0 0 var(--accent)}
.fr-card-drop-after{box-shadow:0 3px 0 0 var(--accent)}
.fr-card-top{display:flex;align-items:flex-start;gap:6px;margin-bottom:6px}
.fr-card-ttl{flex:1;min-width:0;font-size:13px;font-weight:700;color:var(--text);line-height:1.35;word-break:break-word}
.fr-card-top .cb{margin-top:2px;flex-shrink:0}
.fr-rank{flex-shrink:0;font-family:var(--font-mono);font-size:10px;font-weight:700;color:var(--accent);background:var(--accent-dim);border-radius:4px;padding:2px 5px;line-height:1.3;margin-top:1px}
.fr-nudge{display:flex;flex-direction:column;gap:1px;flex-shrink:0}
.fr-nudge-btn{border:1px solid var(--border2);background:var(--surface2);color:var(--text3);border-radius:3px;width:18px;height:14px;font-size:8px;line-height:1;padding:0;cursor:pointer}
.fr-nudge-btn:hover:not(:disabled){background:var(--accent);border-color:var(--accent);color:#fff}
.fr-nudge-btn:disabled{opacity:.3;cursor:default}
.fr-col-foot{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:8px 10px;border-top:1px solid var(--border);background:var(--surface);flex-shrink:0}
.fr-card-meta{display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-size:11px;color:var(--text3)}
.fr-card-by{font-size:11px;color:var(--text3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.fr-card-foot{display:flex;align-items:center;gap:9px;margin-top:8px;padding-top:7px;border-top:1px solid var(--border);font-size:10px;color:var(--text3)}

.fr-avs{display:inline-flex;align-items:center;flex-shrink:0}
.fr-av{display:inline-flex;align-items:center;justify-content:center;border-radius:50%;color:#fff;font-weight:700;font-family:var(--font);border:2px solid var(--surface);margin-left:-6px;flex-shrink:0;line-height:1;width:22px;height:22px;font-size:9px}
.fr-avs .fr-av:first-child{margin-left:0}

.fr-thumbs{display:flex;flex-wrap:wrap;gap:6px}
.fr-thumb{position:relative;width:76px;height:76px;border:1px solid var(--border2);border-radius:6px;overflow:hidden;background:var(--surface2);cursor:zoom-in}
.fr-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.fr-thumb-x{position:absolute;top:2px;right:2px;background:rgba(0,0,0,.6);color:#fff;border:0;border-radius:4px;width:18px;height:18px;font-size:11px;line-height:1;cursor:pointer;padding:0}

.fr-composer{border:1.5px solid var(--border2);border-radius:var(--radius);padding:8px;background:var(--surface);transition:border-color .12s,background .12s}
.fr-composer-drag{border:1.5px dashed var(--accent);background:var(--accent-dim)}
.fr-composer .f-input{border:none;padding:2px 2px 6px;resize:vertical}
.fr-composer .f-input:focus{border:none;box-shadow:none}
.fr-composer-bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:6px;border-top:1px solid var(--border);padding-top:7px}

.fr-detail{display:grid;grid-template-columns:1.2fr .8fr;gap:16px;align-items:start}
@media(max-width:1000px){.fr-detail{grid-template-columns:1fr}}
.fr-detail-controls{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:14px}
.fr-detail-by{display:flex;align-items:center;gap:10px;padding:10px 12px;background:var(--surface2);border:1px solid var(--border);border-radius:var(--radius);margin-bottom:14px;flex-wrap:wrap}
.fr-body-text{font-size:13.5px;line-height:1.55;color:var(--text);white-space:pre-wrap;word-break:break-word}
.fr-entry{border:1px solid var(--border);border-radius:var(--radius);padding:10px 12px;background:var(--surface2)}
.fr-entry-hdr{display:flex;align-items:center;gap:8px;flex-wrap:wrap}

.fr-chat-card{display:flex;flex-direction:column;max-height:70vh}
.fr-chat{flex:1;display:flex;flex-direction:column;gap:10px;overflow-y:auto;padding:12px;min-height:180px}
.fr-msg{display:flex;gap:8px;align-items:flex-start}
.fr-msg.me{flex-direction:row-reverse}
.fr-msg-body{background:var(--surface2);border:1px solid var(--border);border-radius:10px;padding:7px 11px;max-width:82%;min-width:0}
.fr-msg.me .fr-msg-body{background:var(--accent-dim);border-color:rgba(37,99,235,.2)}
.fr-msg-who{display:flex;align-items:center;gap:4px;font-size:10px;font-weight:700;color:var(--text3);margin-bottom:3px;text-transform:uppercase;letter-spacing:.4px}
.fr-msg-x{margin-left:6px;cursor:pointer;opacity:.5;font-weight:400}
.fr-msg-x:hover{opacity:1;color:var(--red)}
.fr-msg-txt{font-size:13px;color:var(--text);white-space:pre-wrap;word-break:break-word;line-height:1.45}
.fr-chat-composer{padding:10px 12px;border-top:1px solid var(--border);background:var(--surface2);flex-shrink:0}

/* ─── BRANDED THEME ──────────────────────────────────────────────────────────
   Second theme, selected in Settings ▸ General ▸ Theme. Applied as
   data-theme="branded" on <html> (see window.applyTheme in js/globals.js).
   Palette + typography come from the Branded client-portal prototype:
   near-black "ink" chrome, magenta accent, warm paper greys, Space Grotesk
   headings over Inter body copy. Everything below is an override of the
   :root tokens at the top of this file plus the handful of places where a
   colour was hardcoded rather than tokenised. The default ("standard")
   theme sets no data-theme attribute, so it is untouched by all of this. */
[data-theme="branded"]{
  /* Backgrounds — warm paper rather than cool blue-grey */
  --bg:#f5f4f2;
  --surface:#ffffff;
  --surface2:#faf9f7;
  --surface3:#f0efec;
  --surface4:#ececea;

  /* Borders */
  --border:#e6e4e0;
  --border2:#dedcd8;
  --border3:#c2bfba;

  /* Text — ink through to soft grey */
  --text:#0a0a0a;
  --text2:#706d68;
  --text3:#a7a49f;
  --text4:#c2bfba;

  /* Brand — Branded magenta */
  --accent:#e6007e;
  --accent2:#ff3fa4;
  --accent-dim:rgba(230,0,126,0.07);
  --accent-hover:#c40069;

  /* Status colours — muted to sit with the warm palette */
  --green:#1e8e5a;
  --green-dim:#e8f5ef;
  --red:#c9302c;
  --red-dim:#fbe9e8;
  --yellow:#c9762a;
  --yellow-dim:#fbf0e3;
  --blue:#2f6fd0;
  --blue-dim:rgba(47,111,208,0.08);
  --purple:#7c4a8a;
  --purple-dim:rgba(124,74,138,0.1);
  --orange:#c9762a;
  --orange-dim:rgba(201,118,42,0.1);
  --cyan:#2a8f97;
  --cyan-dim:rgba(42,143,151,0.1);

  /* Typography — Inter body, Space Grotesk for display/headings.
     The prototype has no monospace: doc IDs, codes and metadata are set in the
     body face, so --font-mono maps to Inter too. DM Mono's slashed zeros and
     wide tracking read as a foreign element against this palette. Tabular
     figures (below) keep numbers column-aligned the way the mono face did.
     Every mono usage in the app resolves through this token — including the
     inline styles in jobs/purchasing/settings/main — so this covers the lot. */
  --font:'Inter',system-ui,sans-serif;
  --font-cond:'Space Grotesk','Inter',sans-serif;
  --font-mono:'Inter',system-ui,sans-serif;
  font-variant-numeric:tabular-nums;

  /* Radii — softer than the standard theme */
  --radius:7px;
  --radius-lg:11px;
  --radius-xl:14px;
}

/* Space Grotesk tops out at 700 and isn't condensed, so the places that lean
   on Barlow Condensed's 800/900 weights + tight tracking need dialling back. */
[data-theme="branded"] .logo-name,
[data-theme="branded"] .topbar-title,
[data-theme="branded"] .page-hdr-left h1,
[data-theme="branded"] .modal-ttl,
[data-theme="branded"] .stat-val{font-weight:600;letter-spacing:-0.01em}
[data-theme="branded"] .page-hdr-left h1{font-size:25px}
[data-theme="branded"] .stat-val{font-size:27px}
[data-theme="branded"] .logo-sub{letter-spacing:.08em}

/* ── Dark "ink" sidebar ──
   The variable overrides are scoped to .sidebar so that inline styles inside
   it (main.js uses var(--border)/var(--text3) inline in a few spots) inherit
   the dark values automatically instead of punching light lines through. */
[data-theme="branded"] .sidebar{
  --surface:#0a0a0a;
  --surface2:#141414;
  --surface3:#181818;
  --surface4:#242424;
  --border:#262626;
  --border2:#2e2e2e;
  --border3:#3a3a3a;
  --text:#ffffff;
  --text2:#c9c7c3;
  --text3:#8a8783;
  --text4:#6e6b67;
  --accent-dim:rgba(230,0,126,0.16);
  background:#0a0a0a;
  border-right:1px solid #1c1c1c;
  box-shadow:none;
}
/* The logo block stays white against the ink nav — an uploaded company logo is
   usually dark artwork on transparency and would otherwise disappear. Mirrors
   the prototype's white logo chip. Text colours flip back to ink/grey here,
   overriding the dark .sidebar token scope above. */
[data-theme="branded"] .logo{background:#fff;border-bottom:none}
/* Magenta bookmark, mirroring the prototype's brand mark. Sits against the
   text wordmark only — an uploaded company logo replaces the lot. */
[data-theme="branded"] .logo-name{display:flex;align-items:center;gap:9px;color:#0a0a0a;font-size:19px}
[data-theme="branded"] .logo-name::before{
  content:'';width:24px;height:24px;border-radius:7px;flex-shrink:0;
  background:radial-gradient(circle at 50% 50%,#fff 0 3px,transparent 3.5px) var(--accent);
}
[data-theme="branded"] .logo-sub{padding-left:33px;color:#706d68}
[data-theme="branded"] .nav-sec{letter-spacing:.14em;color:#7a7873}
[data-theme="branded"] .nav-item{color:#c9c7c3;border-radius:7px}
[data-theme="branded"] .nav-item:hover{background:#151515;color:#fff}
[data-theme="branded"] .nav-item.active{background:#1c1c1c;color:#fff}
[data-theme="branded"] .nav-item.active::before{background:var(--accent)}
[data-theme="branded"] .nav-item.active .nav-icon{opacity:1}
[data-theme="branded"] .sidebar-foot{color:#6e6b67}

/* ── Chrome ── */
[data-theme="branded"] .topbar{box-shadow:none}
[data-theme="branded"] .card{border-radius:var(--radius-lg)}
[data-theme="branded"] .card-hdr{background:var(--surface2)}
[data-theme="branded"] .card-title{letter-spacing:.05em}
[data-theme="branded"] .stat-card:hover{box-shadow:0 4px 14px rgba(10,10,10,.07)}
[data-theme="branded"] .product-card:hover,
[data-theme="branded"] .fr-card:hover{box-shadow:0 6px 18px rgba(10,10,10,.08)}
[data-theme="branded"] .modal{box-shadow:0 20px 60px rgba(10,10,10,.28)}
[data-theme="branded"] .overlay{background:rgba(10,10,10,.5)}

/* ── Buttons ── */
[data-theme="branded"] .btn{font-weight:600}
[data-theme="branded"] .btn-danger:hover:not(:disabled){background:#a82724}
[data-theme="branded"] .btn-success:hover:not(:disabled){background:#177247}

/* ── Badges / pills — the prototype's rounded status pills ── */
[data-theme="branded"] .bdg-gray{background:var(--surface3);color:var(--text2);border-color:var(--border2)}
[data-theme="branded"] .bdg-green{border-color:rgba(30,142,90,.2)}
[data-theme="branded"] .bdg-red{border-color:rgba(201,48,44,.2)}
[data-theme="branded"] .bdg-yellow{border-color:rgba(201,118,42,.22)}
[data-theme="branded"] .bdg-blue{border-color:rgba(47,111,208,.2)}
[data-theme="branded"] .bdg-purple{border-color:rgba(124,74,138,.2)}
[data-theme="branded"] .bdg-orange{border-color:rgba(201,118,42,.22)}
[data-theme="branded"] .bdg-cyan{border-color:rgba(42,143,151,.2)}

/* ── Alerts — hardcoded blues/greens in the base sheet ── */
[data-theme="branded"] .alert-info{background:#fff2f8;color:#a3005a;border-color:#f6c7e0}
[data-theme="branded"] .alert-warn{background:var(--yellow-dim);color:#9a5719;border-color:#eecfa5}
[data-theme="branded"] .alert-danger{background:var(--red-dim);color:#96211e;border-color:#f0c4c2}
[data-theme="branded"] .alert-success{background:var(--green-dim);color:#166b44;border-color:#bfe3d2}

/* ── Communication icons — also hardcoded in the base sheet ── */
[data-theme="branded"] .comm-icon.note{background:var(--blue-dim);color:var(--blue)}
[data-theme="branded"] .comm-icon.email{background:var(--green-dim);color:var(--green)}
[data-theme="branded"] .comm-icon.call{background:var(--yellow-dim);color:var(--yellow)}

/* ── Remaining literal accent-blue rgba() borders ── */
[data-theme="branded"] .message-bubble.client,
[data-theme="branded"] .fr-msg.me .fr-msg-body,
[data-theme="branded"] .line-divider{border-color:rgba(230,0,126,.2)}
[data-theme="branded"] .task-item.done{border-color:rgba(30,142,90,.25)}
[data-theme="branded"] .task-item.blocked{border-color:rgba(201,48,44,.2)}
