/* public/css/brand.css */
:root {
  --orange: #E8732E;
  --orange-soft: rgba(232,115,46,0.08);
  --orange-border: rgba(232,115,46,0.25);
  --bg: #FAFAF8;
  --bg-card: #FFFFFF;
  --bg-muted: #F5F3EF;
  --bg-deep: #EEEAE4;
  --text: #1A1A18;
  --text-2: #4A4740;
  --text-muted: #7A756D;
  --text-ghost: #B0AAA0;
  --border: #E8E5DF;
  --border-faint: #F0EDE7;
  --green: #2D7A5F;
  --green-bg: rgba(45,122,95,0.08);
  --amber: #C4922A;
  --amber-bg: rgba(196,146,42,0.08);
  --red: #B5424A;
  --red-bg: rgba(181,66,74,0.07);
  --blue: #3D7AA5;
  --blue-bg: rgba(61,122,165,0.08);
  --r: 10px; --r-sm: 6px; --r-lg: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: var(--bg); color: var(--text); font-family: 'Inter', -apple-system, sans-serif; font-size: 14px; line-height: 1.5; }

/* Nav */
.brand-nav { display: flex; align-items: center; justify-content: space-between; padding: 0 48px; height: 56px; background: var(--bg-card); border-bottom: 1px solid var(--border-faint); position: sticky; top: 0; z-index: 50; }
.brand-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-logo-mark { width: 32px; height: 32px; background: var(--orange); border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: #fff; }
.brand-logo-name { font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.1; }
.brand-logo-sub { font-size: 9px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-ghost); }
.brand-nav-right { display: flex; gap: 8px; align-items: center; }

/* Buttons */
.btn-orange { background: var(--orange); color: #fff; border: none; border-radius: var(--r); padding: 8px 18px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; text-decoration: none; display: inline-block; }
.btn-ghost { background: transparent; color: var(--text-2); border: 1px solid var(--border); border-radius: var(--r); padding: 7px 16px; font-size: 12px; font-weight: 500; cursor: pointer; font-family: inherit; text-decoration: none; display: inline-block; }
.btn-orange-lg { background: var(--orange); color: #fff; border: none; border-radius: var(--r); padding: 12px 28px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; }
.btn-ghost-lg { background: transparent; color: var(--text-2); border: 1px solid var(--border); border-radius: var(--r); padding: 12px 24px; font-size: 13px; cursor: pointer; font-family: inherit; }
.btn-orange:hover, .btn-orange-lg:hover { opacity: 0.88; }
.btn-ghost:hover, .btn-ghost-lg:hover { background: var(--bg-hover, #F0EDE7); }

/* Tags / chips */
.brand-tag { display: inline-flex; align-items: center; gap: 6px; background: var(--orange-soft); border: 1px solid var(--orange-border); border-radius: 20px; padding: 5px 14px; font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--orange); font-weight: 500; }
.brand-tag-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--orange); }
.sample-chip { background: var(--orange-soft); border: 1px solid var(--orange-border); border-radius: var(--r-sm); padding: 3px 8px; font-size: 9px; color: var(--orange); letter-spacing: 1.5px; text-transform: uppercase; font-weight: 500; }
.filter-chip { background: var(--bg-deep); border: 1px solid var(--border); border-radius: 6px; padding: 3px 10px; font-size: 11px; color: var(--text-2); cursor: pointer; }
.filter-chip.active { background: var(--orange-soft); border-color: var(--orange-border); color: var(--orange); font-weight: 500; }

/* Section structure */
.brand-section { padding: 52px 48px; max-width: 1100px; margin: 0 auto; }
.brand-section-label { font-size: 9px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--text-ghost); margin-bottom: 24px; font-weight: 500; }
hr.brand-divider { border: none; border-top: 1px solid var(--border-faint); margin: 0 48px; }

/* Cards */
.brand-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 24px; }

/* Data grid (10 items) */
.data-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--border); border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--border); }
.data-card { background: var(--bg-card); padding: 20px 18px; }
.data-card.highlight { background: var(--orange-soft); }
.data-card-num { font-size: 10px; letter-spacing: 1px; color: var(--orange); margin-bottom: 8px; font-weight: 600; }
.data-card-title { font-size: 12px; color: var(--text); font-weight: 500; margin-bottom: 4px; }
.data-card-desc { font-size: 11px; color: var(--text-ghost); line-height: 1.55; }

/* Preview shell */
.preview-shell { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.preview-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-bottom: 1px solid var(--border-faint); background: var(--bg-muted); }
.preview-head-left { display: flex; align-items: center; gap: 10px; }
.ph-live { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--green); font-weight: 500; }
.ph-live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.ph-sep { width: 1px; height: 12px; background: var(--border); }
.ph-brand { font-size: 12px; color: var(--text); font-weight: 600; }
.ph-context { font-size: 11px; color: var(--text-muted); }

/* KPI strip */
.kpi-strip { display: grid; gap: 1px; background: var(--border-faint); border-bottom: 1px solid var(--border-faint); }
.kpi-strip-5 { grid-template-columns: repeat(5, 1fr); }
.kpi-strip-4 { grid-template-columns: repeat(4, 1fr); }
.kpi-cell { background: var(--bg-card); padding: 14px 18px; }
.kpi-label { font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-ghost); margin-bottom: 5px; font-weight: 500; }
.kpi-value { font-family: 'Cormorant Garamond', serif; font-size: 24px; font-weight: 300; color: var(--text); line-height: 1; margin-bottom: 3px; }
.kpi-delta { font-size: 10px; font-weight: 500; }
.delta-up { color: var(--green); }
.delta-down { color: var(--red); }
.delta-warn { color: var(--amber); }
.delta-blue { color: var(--blue); }

/* Tabs */
.preview-tabs { display: flex; border-bottom: 1px solid var(--border-faint); padding: 0 20px; background: var(--bg-card); }
.brand-tab { padding: 10px 16px; font-size: 12px; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.brand-tab.active { color: var(--orange); border-bottom-color: var(--orange); }

/* SKU table */
.sku-table-wrap { overflow-x: auto; }
table.sku-table { width: 100%; border-collapse: collapse; font-size: 12px; }
table.sku-table thead th { padding: 10px 14px; font-size: 9px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-ghost); font-weight: 500; text-align: left; background: var(--bg-card); border-bottom: 1px solid var(--border-faint); white-space: nowrap; }
table.sku-table thead th.num { text-align: right; }
table.sku-table tbody tr { border-bottom: 1px solid var(--border-faint); }
table.sku-table tbody tr:last-child { border: none; }
table.sku-table tbody tr:hover { background: var(--bg-muted); cursor: pointer; }
table.sku-table td { padding: 10px 14px; color: var(--text-2); white-space: nowrap; }
table.sku-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.sku-ref { font-size: 10px; letter-spacing: 1px; color: var(--text-ghost); font-weight: 500; }
.sku-name { font-size: 12px; color: var(--text); font-weight: 500; }
.sku-variant { font-size: 11px; color: var(--text-ghost); }
.mkd-depth { color: var(--red); font-weight: 500; font-size: 11px; }

/* Pills */
.pct-pill { display: inline-block; border-radius: 4px; padding: 2px 7px; font-size: 10px; font-weight: 600; }
.pct-hi { background: var(--green-bg); color: var(--green); }
.pct-mid { background: var(--amber-bg); color: var(--amber); }
.pct-lo { background: var(--red-bg); color: var(--red); }
.signal-chip { display: inline-flex; align-items: center; gap: 4px; border-radius: 4px; padding: 2px 7px; font-size: 10px; font-weight: 600; }
.signal-reorder { background: var(--green-bg); color: var(--green); }
.signal-clear { background: var(--amber-bg); color: var(--amber); }
.signal-watch { background: var(--red-bg); color: var(--red); }

/* Table footer */
.table-footer { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; background: var(--bg-muted); border-top: 1px solid var(--border-faint); font-size: 11px; }
.table-footer-note { color: var(--text-ghost); }
.table-footer-totals { display: flex; gap: 20px; color: var(--text-muted); }
.table-footer-totals strong { color: var(--text); font-weight: 600; }

/* Bar charts */
.bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.bar-row:last-child { margin: 0; }
.bar-label { font-size: 11px; color: var(--text-2); width: 90px; flex-shrink: 0; }
.bar-track { flex: 1; height: 5px; background: var(--bg-deep); border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; background: var(--orange); opacity: 0.65; }
.bar-fill-green { background: var(--green); opacity: 0.75; }
.bar-fill-red { background: var(--red); opacity: 0.6; }
.bar-fill-amber { background: var(--amber); opacity: 0.65; }
.bar-pct { font-size: 11px; color: var(--text-muted); width: 36px; text-align: right; font-weight: 500; }

/* Behaviour cards */
.beh-grid { padding: 20px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.beh-card { background: var(--bg-muted); border: 1px solid var(--border-faint); border-radius: var(--r); padding: 16px; }
.beh-label { font-size: 9px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-ghost); margin-bottom: 12px; font-weight: 500; }
.stat-row { display: flex; align-items: flex-start; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border-faint); }
.stat-row:last-child { border: none; }
.stat-name { font-size: 12px; color: var(--text-2); }
.stat-sub { font-size: 10px; color: var(--text-ghost); margin-top: 1px; }
.stat-val { font-size: 13px; font-weight: 600; color: var(--text); text-align: right; }
.journey-row { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 12px; }
.journey-row:last-child { margin: 0; }
.j-from { background: var(--blue-bg); color: var(--blue); border-radius: 4px; padding: 3px 8px; font-size: 11px; font-weight: 500; }
.j-to { background: var(--green-bg); color: var(--green); border-radius: 4px; padding: 3px 8px; font-size: 11px; font-weight: 500; }
.j-arrow { color: var(--text-ghost); }
.j-pct { margin-left: auto; font-size: 11px; color: var(--text-muted); font-weight: 500; }

/* Login form */
.brand-login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.brand-login-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 40px; width: 360px; }
.brand-login-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 32px; }
.brand-form-group { margin-bottom: 16px; }
.brand-form-label { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; display: block; font-weight: 500; }
.brand-form-input { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--r); font-size: 14px; font-family: inherit; background: var(--bg); color: var(--text); outline: none; }
.brand-form-input:focus { border-color: var(--orange); }
.brand-form-error { font-size: 12px; color: var(--red); margin-top: 12px; display: none; }
.brand-form-error.visible { display: block; }

/* Dashboard layout */
.brand-dash-layout { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 56px); }
.brand-sidebar { background: var(--bg-muted); border-right: 1px solid var(--border-faint); padding: 24px 0; }
.brand-sidebar-section { padding: 0 16px; margin-bottom: 24px; }
.brand-sidebar-label { font-size: 9px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-ghost); margin-bottom: 8px; font-weight: 500; padding: 0 8px; }
.brand-nav-item { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: var(--r-sm); font-size: 13px; color: var(--text-2); cursor: pointer; text-decoration: none; }
.brand-nav-item:hover, .brand-nav-item.active { background: var(--border-faint); color: var(--text); }
.brand-nav-item.active { color: var(--orange); }
.brand-main { padding: 32px 40px; overflow-y: auto; }
.brand-page-title { font-family: 'Cormorant Garamond', serif; font-size: 32px; font-weight: 300; color: var(--text); margin-bottom: 4px; }
.brand-page-sub { font-size: 12px; color: var(--text-ghost); margin-bottom: 28px; }

/* Lower 3-col */
.lower-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1px; background: var(--border-faint); border-top: 1px solid var(--border-faint); }
.lower-col { background: var(--bg-card); padding: 18px 20px; }

/* CTA footer */
.brand-cta-foot { text-align: center; padding: 72px 48px; background: var(--bg-muted); border-top: 1px solid var(--border-faint); }
.brand-cta-foot h2 { font-family: 'Cormorant Garamond', serif; font-size: 42px; font-weight: 300; margin-bottom: 10px; }
.brand-cta-foot p { font-size: 14px; color: var(--text-muted); margin-bottom: 28px; }

/* Admin table */
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table thead th { padding: 10px 16px; font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-ghost); font-weight: 500; text-align: left; border-bottom: 1px solid var(--border-faint); }
.admin-table tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border-faint); color: var(--text-2); }
.admin-table tbody tr:last-child td { border: none; }
.admin-table tbody tr:hover { background: var(--bg-muted); }

/* Consent toggle */
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border-faint); }
.toggle-row:last-child { border: none; }
.toggle-label { font-size: 13px; color: var(--text-2); }
.toggle-switch { position: relative; width: 36px; height: 20px; cursor: pointer; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-track { position: absolute; inset: 0; background: var(--border); border-radius: 20px; transition: 0.2s; }
.toggle-thumb { position: absolute; width: 14px; height: 14px; background: #fff; border-radius: 50%; top: 3px; left: 3px; transition: 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.toggle-switch input:checked + .toggle-track { background: var(--orange); }
.toggle-switch input:checked ~ .toggle-thumb { left: 19px; }
.toggle-switch input:focus-visible + .toggle-track { outline: 2px solid var(--orange); outline-offset: 2px; }

/* Utility */
.text-muted { color: var(--text-muted); }
.text-ghost { color: var(--text-ghost); }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
