:root {
  /* Chocolate-gold palette (design-handoff-2026-06-24) */
  --sb-rail-top: #34251b;
  --sb-rail-bottom: #2b1e15;
  --sb-gold: #c2a36b;
  --sb-gold-deep: #9c7b45;
  --sb-cream: #f4ecdc;
  --sb-parchment: #efe8db;
  --sb-ink: #34251b;
  --sb-session-top: #3e2d21;
  --sb-hairline: rgba(194,163,107,.18);
  --sb-rail-width: 158px;
  --sb-app-bg: #f6f2ea;
  --sb-font-serif: "Cormorant Garamond", Georgia, serif;
  --sb-font-sans: "Jost", system-ui, sans-serif;
  /* additional tokens used by feature stylesheets (academy, ...) */
  --sb-serif: "Cormorant Garamond", Georgia, serif;
  --sb-sans: "Jost", system-ui, sans-serif;
  --sb-body: #34251b;
  --sb-cocoa: #6b5435;
  --sb-taupe: #8a7864;
  --sb-espresso: #34251b;
  --sb-surface: #fcfaf4;
  --sb-surface-2: #fffdf8;
  --sb-border: rgba(52,37,27,.12);
  --sb-gold-2: #d9c29a;
  --sb-radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: var(--sb-font-sans); color: var(--sb-ink); }
body { background: radial-gradient(circle at 50% 0, #ebe5d9, #ddd6c8); }

.app-shell { display: flex; height: 100vh; overflow: hidden; background: var(--sb-app-bg); }

/* Left rail — light cream chrome (matches legacy stylebar-redesign.css) */
.rail {
  width: var(--sb-rail-width); flex: 0 0 var(--sb-rail-width);
  background: linear-gradient(180deg, #faf7f1, #f1ebe0);
  border-right: 1px solid rgba(52,37,27,.1);
  display: flex; flex-direction: column;
}
.rail-brand { padding: 18px 12px 16px; text-align: center; border-bottom: 1px solid rgba(52,37,27,.1); }
.rail-brand .lockup { font-family: var(--sb-font-serif); font-weight: 600; font-size: 25px;
  letter-spacing: .08em; line-height: .9; color: #3a2b1e; white-space: nowrap; }
.rail-brand .brand-logo { display: block; width: 122px; max-width: 84%; height: auto; margin: 0 auto 2px; }
.rail-brand .sub { font-family: var(--sb-font-serif); font-style: italic; font-size: 21px; color: #9c7b45; margin-top: 0; line-height: 1; }
.rail-nav { flex: 1; padding: 0; }
.rail-nav a { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 0 16px;
  font-family: var(--sb-font-sans); font-size: 15px; line-height: 1.2; color: #8a7a66; text-decoration: none;
  border-left: 3px solid transparent; border-bottom: 1px solid rgba(52,37,27,.09); }
.rail-nav a .ic { color: rgba(156,123,69,.4); width: 22px; font-size: 17px; text-align: center; flex-shrink: 0; }
.rail-nav a:hover { background: rgba(194,163,107,.09); color: #3a2b1e; }
.rail-nav a:hover .ic { color: #9c7b45; text-shadow: 0 0 8px rgba(194,163,107,.6); }
.rail-nav a.active { background: rgba(194,163,107,.2); color: #3a2b1e; border-left-color: #9c7b45; }
.rail-nav a.active .ic { color: #9c7b45; text-shadow: 0 0 8px rgba(194,163,107,.6); }
/* Always-visible unread-message pill on the Services rail item. */
.rail-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
  font-family: var(--sb-font-sans); font-size: 11px; font-weight: 700; line-height: 1; color: var(--sb-cream);
  background: linear-gradient(135deg, var(--sb-gold), var(--sb-gold-deep));
  border-radius: 999px; box-shadow: 0 1px 3px rgba(52,37,27,.25); }
.rail-footer { margin-top: auto; padding: 14px 16px; text-align: center;
  border-top: 1px solid rgba(52,37,27,.1); color: #a8967d; font-size: 12px; }
.rail-footer > div { color: #9c7b45; font-weight: 500; line-height: 1.3; }
.return-to-classic { margin-top: 10px; }
.return-to-classic button { width: 100%; background: none; border: 1px solid rgba(52,37,27,.18);
  color: #a8967d; font-size: 11px; font-weight: 500; padding: 6px 8px; border-radius: 6px;
  cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.return-to-classic button:hover { background: rgba(194,163,107,.12); color: #3a2b1e; border-color: rgba(156,123,69,.4); }

/* Main column */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--sb-app-bg); }
.session-bar { display: flex; align-items: center; gap: 16px; padding: 12px 22px;
  background: #fffdf9; border-bottom: 1px solid rgba(52,37,27,.1); color: var(--sb-ink); }
.session-bar .avatar { width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--sb-gold), var(--sb-gold-deep));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--sb-font-serif); font-weight: 600; font-size: 18px; color: #fffdf9; }
.session-icon { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--sb-gold), var(--sb-gold-deep));
  display: flex; align-items: center; justify-content: center; color: #fffdf9; font-size: 18px; }
.session-show-title { font-family: var(--sb-font-serif); font-size: 20px; color: var(--sb-ink);
  display: flex; align-items: center; gap: 10px; }
.session-badge { font-family: var(--sb-font-sans); font-size: 10px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--sb-gold-deep); background: rgba(194,163,107,.18);
  border: 1px solid var(--sb-gold-2); border-radius: 999px; padding: 3px 9px; }
.session-show-sub { font-size: 13px; color: var(--sb-taupe); }
.session-dot { margin: 0 6px; }

/* Prominent trunk-show event banner (shown only when there's an upcoming show) */
.session-bar--event { background: linear-gradient(90deg, rgba(194,163,107,.22), rgba(194,163,107,.05));
  border-bottom: 2px solid var(--sb-gold); padding-top: 14px; padding-bottom: 14px; }
.session-bar--event .session-icon { width: 52px; height: 52px; font-size: 22px;
  box-shadow: 0 3px 12px rgba(194,163,107,.45); }
.session-bar--event .session-show-title { font-size: 25px; font-weight: 600; }
.session-show-date { font-size: 13px; font-weight: 600; color: var(--sb-ink); margin-top: 2px; }
.session-show-date i { color: var(--sb-gold-deep); margin-right: 5px; }
.session-reps { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 7px; }
.session-rep { display: inline-flex; align-items: baseline; gap: 8px; font-size: 14px; }
.session-rep-name { font-weight: 700; color: var(--sb-ink); }
.session-rep-phone { display: inline-flex; align-items: center; gap: 5px; color: var(--sb-gold-deep);
  text-decoration: none; font-weight: 600; }
.session-rep-phone i { font-size: 12px; }
.session-rep-phone:hover { text-decoration: underline; }
.content { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 24px 26px; }

/* Auth cards */
.auth-card { max-width: 360px; margin: 8vh auto; background: #fcfaf4; padding: 28px;
  border-radius: 16px; box-shadow: 0 8px 24px rgba(52,37,27,.1); }
.auth-title { font-family: var(--sb-font-serif); font-size: 32px; margin: 0; color: var(--sb-ink); }
.auth-brand { text-align: center; margin: 0 0 14px; }
.auth-brand .brand-logo { display: block; width: 200px; max-width: 74%; height: auto; margin: 0 auto; }
.auth-brand .auth-sb { font-family: var(--sb-font-serif); font-style: italic; font-weight: 500; font-size: 30px; line-height: 1; color: #9c7b45; margin-top: 2px; }
.auth-sub { color: #8a7864; margin: 4px 0 18px; }
.auth-error { color: #a8324b; font-size: 13px; }
.auth-card label { display: block; font-size: 12px; margin-bottom: 12px; color: #6b5435; }
.auth-card input { display: block; width: 100%; height: 44px; margin-top: 4px; padding: 0 12px;
  border: 1px solid rgba(52,37,27,.14); border-radius: 10px; background: #fffdf8; }
.auth-card select { display: block; width: 100%; height: 44px; margin-top: 4px; padding: 0 12px;
  border: 1px solid rgba(52,37,27,.14); border-radius: 10px; background: #fffdf8; }
.auth-alt { margin-top: 16px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.btn-gold { height: 44px; width: 100%; border: 0; border-radius: 10px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
  background: #9c7b45;
  color: #fff; font-weight: 500; box-shadow: 0 6px 18px rgba(156,123,69,.3); }

/* Reports */
.report-filters { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.report-filters select { height: 40px; border: 1px solid var(--sb-border); border-radius: 8px; padding: 0 10px; background: #fffdf8; }
/* Tom Select (searchable store filter) — match the other filter controls */
.report-filters .ts-wrapper { min-width: 240px; max-width: 360px; }
.report-filters .ts-wrapper .ts-control { min-height: 40px; border: 1px solid var(--sb-border); border-radius: 8px; padding: 2px 10px; background: #fffdf8; box-shadow: none; }
.report-filters .ts-wrapper.focus .ts-control { border-color: var(--sb-gold, #b78a3d); box-shadow: none; }
.report-filters .ts-dropdown { border: 1px solid var(--sb-border); border-radius: 8px; margin-top: 4px; }
.report-filters .ts-dropdown .active { background: var(--sb-gold, #b78a3d); color: #fff; }
.report-range { color: var(--sb-taupe); font-size: 13px; }
.report-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-bottom: 22px; }
.report-card { background: var(--sb-surface); border: 1px solid var(--sb-border); border-radius: var(--sb-radius); padding: 14px 16px; display: flex; flex-direction: column; }
.report-card .n { font-family: var(--sb-serif); font-size: 28px; color: var(--sb-cocoa); }
.report-card .l { font-size: 12px; color: var(--sb-taupe); text-transform: uppercase; letter-spacing: .06em; }
.report-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-bottom: 24px; }
.report-h2 { font-family: var(--sb-serif); font-size: 20px; color: var(--sb-ink); margin: 18px 0 8px; }
.report-table { width: 100%; border-collapse: collapse; background: var(--sb-surface); border: 1px solid var(--sb-border); border-radius: 10px; overflow: hidden; }
.report-table th, .report-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--sb-border); }
.report-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--sb-taupe); }
.report-table .muted { color: var(--sb-taupe); }
.report-two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.report-thumb { width: 34px; height: 34px; object-fit: cover; border-radius: 4px; vertical-align: middle; margin-right: 8px; background: #f3f0ea; }

/* Le Vian 2026 Trend — FlippingBook embed page */
.trend-embed { max-width: 1100px; margin: 0 auto; }
.trend-embed .fbo-embed { display: block; width: 100%; }

/* Services hub — app-launcher grid */
.svc-hub { max-width: 1100px; margin: 0 auto; }
.svc-hub__title { font-family: var(--sb-font-serif); font-size: 26px; margin: 4px 0 20px; }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.svc-tile { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 24px; min-height: 140px;
    text-decoration: none; color: inherit; background: var(--sb-surface); border: 1px solid var(--sb-border);
    border-radius: 14px; transition: border-color .15s ease; }
.svc-tile:hover { border-color: var(--sb-gold); }
/* Unread-reply count badge, sits in the tile's top-right corner */
.tile-badge { position: absolute; top: 12px; right: 12px; min-width: 22px; height: 22px; padding: 0 6px;
    display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
    font-family: var(--sb-font-sans); font-size: 12px; font-weight: 600; line-height: 1; color: var(--sb-cream);
    background: linear-gradient(135deg, var(--sb-gold), var(--sb-gold-deep));
    border-radius: 999px; box-shadow: 0 1px 3px rgba(52,37,27,.25); }
.svc-tile__ic { font-size: 28px; color: var(--sb-gold); }
.svc-tile__label { font-family: var(--sb-font-serif); font-size: 18px; }
.svc-tile__blurb { font-size: 13px; color: var(--sb-taupe); }

/* Back-to-Services link (shown on service feature pages) */
.svc-back { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 16px;
    font-family: var(--sb-font-sans); font-size: 14px; color: var(--sb-taupe);
    text-decoration: none; transition: color .15s ease; }
.svc-back:hover { color: var(--sb-gold); }
.svc-back i { font-size: 12px; }

/* Messages placeholder */
.svc-placeholder { max-width: 560px; margin: 60px auto; text-align: center; color: var(--sb-taupe); }
.svc-placeholder__icon { font-size: 40px; color: var(--sb-gold); margin-bottom: 12px; }
.svc-placeholder h1 { font-family: var(--sb-font-serif); color: var(--sb-ink, inherit); margin: 0 0 8px; }

.report-tabs { display:flex; gap:4px; border-bottom:1px solid var(--sb-line,#e6ddce); margin:8px 0 16px; }
.report-tab { padding:8px 18px; text-decoration:none; color:var(--sb-ink,#3a2f26); border-bottom:2px solid transparent; font-weight:600; }
.report-tab.is-active { border-bottom-color:var(--sb-gold,#b78a3d); color:var(--sb-gold,#b78a3d); }
.report-table-scroll { overflow-x:auto; }
.report-dark-stores { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:16px; }
.report-dark-chip { background:#f6ecec; color:#9a3b3b; border:1px solid #e6c9c9; border-radius:12px; padding:3px 12px; font-size:13px; }

/* Admin — user management */
.admin-users, .admin-form { max-width: 900px; margin: 0 auto; }
.admin-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; }
.admin-title { font-family:var(--sb-serif); font-size:28px; color:var(--sb-ink); margin:0 0 12px; }
.admin-search { display:flex; gap:8px; margin-bottom:14px; }
.admin-table-scroll { overflow-x:auto; }
.admin-table { width:100%; border-collapse:collapse; }
.admin-table th, .admin-table td { text-align:left; padding:8px 10px; border-bottom:1px solid var(--sb-line,#e6ddce); }
.admin-form label { display:block; margin:10px 0; font-weight:600; }
.admin-form input:not([type=checkbox]), .admin-form select { display:block; width:100%; max-width:420px; height:40px; border:1px solid var(--sb-border); border-radius:8px; padding:0 10px; background:#fffdf8; margin-top:4px; }
.admin-allstores { display:flex; align-items:center; gap:8px; }
.admin-allstores input { width:auto; height:auto; }
.admin-actions { display:flex; gap:10px; margin-top:16px; align-items:center; }
/* Admin primary button: auto width (not the global 100%); color/background inherit .btn-gold.
   inline-flex so <a> buttons (New user) size to content and center their label vertically. */
.admin-head .btn-gold, .admin-form .btn-gold, .admin-danger .btn-gold {
  display:inline-flex; align-items:center; justify-content:center;
  width:auto; min-width:120px; padding:0 26px; height:40px; border-radius:8px;
}
/* Neutral/secondary button (Cancel, Search, resend/disable) — was undefined, rendered as a raw link */
.btn-plain {
  display:inline-flex; align-items:center; height:40px; padding:0 18px; box-sizing:border-box;
  border:1px solid var(--sb-border); border-radius:8px; background:#fffdf8;
  color:var(--sb-ink); text-decoration:none; font-size:14px; cursor:pointer;
}
.btn-plain:hover { background:rgba(194,163,107,.12); border-color:rgba(156,123,69,.4); }
.admin-danger { margin-top:24px; padding-top:16px; border-top:1px solid var(--sb-line,#e6ddce); display:flex; gap:10px; flex-wrap:wrap; }
.admin-meta { color:#7a6a58; font-size:13px; }
.btn-danger { background:#9a3b3b; color:#fff; border:none; border-radius:8px; padding:0 16px; height:40px; cursor:pointer; }
.auth-notice { color:#2e6b3e; }
.status { padding:2px 10px; border-radius:12px; font-size:12px; }
.status-active { background:#e7f2e9; color:#2e6b3e; }
.status-disabled { background:#f6ecec; color:#9a3b3b; }
.status-invitepending { background:#fbf3e2; color:#8a6d1f; }
.admin-form .ts-control { min-height:40px; max-width:420px; border:1px solid var(--sb-border); border-radius:8px; background:#fffdf8; }

/* Back-to-top button — fixed bottom-right, revealed by _Layout's script once the .content pane is
   scrolled. Sits above the compare tray (z-index 60) and lifts when the tray is open. */
.scroll-top-btn { position: fixed; right: 22px; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 61;
    width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--sb-border);
    background: var(--sb-surface); color: var(--sb-ink); box-shadow: 0 8px 22px rgba(52,37,27,.22);
    cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 17px;
    opacity: 0; visibility: hidden; transform: translateY(10px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s; }
.scroll-top-btn.show { opacity: 1; visibility: visible; transform: none; }
.scroll-top-btn:hover { border-color: var(--sb-gold); color: var(--sb-gold-deep); }
body.compare-open .scroll-top-btn { bottom: calc(106px + env(safe-area-inset-bottom)); }

/* Create New Certificate: standalone at the bottom of the menu, set apart by space, with gold rules above and
   below. No tint or left edge: that look is reserved for the current page. */
.rail-nav a.rail-new-cert { margin-top: 28px; border-top: 2px solid #9c7b45; border-bottom: 2px solid #9c7b45;
  background: #fffdf9; color: #6b4f24; font-weight: 600; }
.rail-nav a.rail-new-cert .ic { color: #9c7b45; font-size: 20px; }
.rail-nav a.rail-new-cert:hover, .rail-nav a.rail-new-cert.active { background: #f6ecd6; }
