/* ===================================================================
   Liquor Square — Feedback CRM
   Merged stylesheet:
     §1  Design tokens
     §2  Reset & base
     §3  App shell (sidebar + main)
     §4  Components (cards, KPI, charts, tables, modals, etc.)
     §5  Public feedback form
     §6  Login screen (preserved from original design)
     §7  Responsive & print
=================================================================== */

/* §1 ── Design tokens ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Work+Sans:wght@500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --ink:          #1B2436;
  --ink-2:        #242F47;
  --ink-3:        #313E5C;
  --accent:       #2F6FED;
  --accent-dark:  #1F53BF;
  --accent-soft:  #E9F0FE;
  --teal:         #12967D;
  --teal-soft:    #E4F6F1;
  --amber:        #C9821A;
  --amber-soft:   #FBF0DD;
  --red:          #D14343;
  --red-soft:     #FBEAEA;
  --canvas:       #F3F5F9;
  --card:         #FFFFFF;
  --border:       #E4E8EF;
  --border-2:     #EDF0F5;
  --text:         #1B2436;
  --text-muted:   #6B7688;
  --text-faint:   #9AA3B4;
  --radius:       10px;
  --radius-lg:    14px;
  --shadow-sm:    0 1px 2px rgba(27,36,54,.06);
  --shadow-md:    0 6px 20px rgba(27,36,54,.08);
  --font-head:    'Work Sans', 'Inter', sans-serif;
  --font-body:    'Inter', 'Work Sans', sans-serif;
  /* Legacy tokens referenced by login screen */
  --lsq-ink:     #0E2338;
  --lsq-accent:  #F4901E;
}

/* §2 ── Reset & base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }
body {
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, .font-head { font-family: var(--font-head); letter-spacing: -0.01em; }
a { color: inherit; }
button { font-family: var(--font-body); cursor: pointer; }
::selection { background: var(--accent-soft); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* §3 ── App shell ─────────────────────────────────────────────── */

/* The admin app and login screen are both in index.html.
   JS controls which is visible. */
#loginScreen { display: none; }
#loginScreen.show { display: flex; }
#app { display: none; }

.app-shell { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: 240px; flex: 0 0 240px;
  background: var(--ink);
  color: #C9D1E3;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex: 0 0 auto;
}
.sidebar-brand .sidebar-logo-img {
  max-height: 42px; width: auto;
  background: #ffffff; border-radius: 8px; padding: 4px 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,.2); object-fit: contain;
  display: block; flex: none;
}
.sidebar-brand .mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(145deg, var(--accent), #5A8CFF);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 800; color: #fff; font-size: 14px;
  flex: 0 0 auto;
}
.sidebar-brand .brand-text { line-height: 1.25; min-width: 0; }
.sidebar-brand .brand-text strong { display: block; font-family: var(--font-head); font-size: 13.5px; color: #fff; font-weight: 700; }
.sidebar-brand .brand-text span  { font-size: 10.5px; color: #8592AD; letter-spacing: .06em; text-transform: uppercase; }

/* Auth badge inside sidebar */
.sidebar-auth {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: rgba(255,255,255,.05);
  border-radius: 20px;
  margin: 12px 14px 4px;
  border: 1px solid rgba(255,255,255,.08);
  flex: 0 0 auto;
}
.sidebar-auth .dot  { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); flex: none; box-shadow: 0 0 6px rgba(18,150,125,.6); }
.sidebar-auth .email{ font-size: 10px; color: #8592AD; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-auth .logout-btn {
  background: transparent; border: none; color: rgba(255,255,255,.3);
  font-size: 10px; padding: 0; cursor: pointer; font-family: var(--font-body);
  transition: color .2s;
}
.sidebar-auth .logout-btn:hover { color: var(--red); }

.sidebar-nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-section-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #5D6A8A; padding: 12px 10px 5px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  color: #B7C0D8; font-size: 13.5px; font-weight: 500;
  cursor: pointer; border: none; background: none; width: 100%; text-align: left;
}
.nav-item svg { flex: 0 0 auto; opacity: .85; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--accent); color: #fff; }
.nav-item.active svg { opacity: 1; }
.nav-item .pill {
  margin-left: auto; font-size: 10.5px; font-weight: 700; padding: 1px 6px;
  border-radius: 99px; background: rgba(255,255,255,.12); color: #fff;
}

.sidebar-foot {
  padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.08);
  font-size: 11px; color: rgba(90,100,140,.6); flex: 0 0 auto;
}

/* ── Main column ── */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 28px;
  background: rgba(243,245,249,.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
.topbar h1 { font-size: 18px; margin: 0; font-weight: 700; }
.topbar .subtitle { font-size: 12.5px; color: var(--text-muted); margin-top: 1px; }
.topbar-spacer { flex: 1; }

.content { padding: 24px 28px 60px; max-width: 1360px; width: 100%; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; animation: fadeIn .18s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 28px 0 14px; }
.section-head:first-child { margin-top: 0; }
.section-head h2 { font-size: 15px; margin: 0 0 3px; font-weight: 700; }
.section-head p  { margin: 0; font-size: 12.5px; color: var(--text-muted); }

/* §4 ── Components ─────────────────────────────────────────────── */

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: .12s ease; white-space: nowrap;
}
.btn:hover { border-color: #C7D0E0; background: #FAFBFD; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(27,36,54,.05); }
.btn-sm { padding: 6px 10px; font-size: 12.5px; }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: var(--red-soft); border-color: var(--red-soft); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Form controls ── */
.select {
  appearance: none; -webkit-appearance: none;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236B7688'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 30px 8px 12px; font-size: 13px; color: var(--text); cursor: pointer;
}
.select:focus, input:focus, textarea:focus, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}

/* ── Cards ── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 18px 20px; }

/* ── KPI grid ── */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi-card { padding: 16px 18px; position: relative; overflow: hidden; }
.kpi-label { font-size: 11.5px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi-value { font-family: var(--font-head); font-size: 26px; font-weight: 700; margin-top: 6px; line-height: 1; }
.kpi-delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; margin-top: 8px; }
.kpi-delta .up   { color: var(--teal); }
.kpi-delta .down { color: var(--red); }
.kpi-delta .flat { color: var(--text-muted); }

/* ── Grid layouts ── */
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

/* ── Chart cards ── */
.chart-card h3    { font-size: 13.5px; margin: 0 0 2px; font-weight: 700; }
.chart-card .chart-sub { font-size: 11.5px; color: var(--text-muted); margin-bottom: 12px; }
.chart-wrap { position: relative; height: 230px; }
.chart-wrap.short { height: 170px; }

/* ── Tags / badges ── */
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 99px; text-transform: uppercase; letter-spacing: .03em; }
.tag-customer { background: var(--teal-soft); color: var(--teal); }
.tag-staff    { background: var(--amber-soft); color: var(--amber); }
.tag-live     { background: var(--accent-soft); color: var(--accent-dark); }
.tag-muted    { background: #EEF1F6; color: var(--text-muted); }
.dot { width: 6px; height: 6px; border-radius: 99px; background: currentColor; }

/* Rating colour chips */
.rating-chip { font-weight: 700; font-family: var(--font-head); }
.r-high { color: var(--teal); }
.r-mid  { color: var(--amber); }
.r-low  { color: var(--red); }

/* ── Live question panels ── */
.live-panel { display: flex; gap: 14px; }
.live-set-card { flex: 1; padding: 16px 18px; }
.live-set-card .q-list { margin: 10px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; }
.live-set-card .q-list li { font-size: 13px; padding-left: 16px; position: relative; color: var(--text); }
.live-set-card .q-list li::before { content: '—'; position: absolute; left: 0; color: var(--text-faint); }
.cycle-note { font-size: 11.5px; color: var(--text-muted); margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }

/* ── Store / QR ticket cards ── */
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.ticket { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); position: relative; }
.ticket-top { padding: 16px 18px 12px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.ticket-top h4 { margin: 0; font-size: 14.5px; font-weight: 700; }
.ticket-top .store-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }
.ticket-perf {
  height: 0; border-top: 1.5px dashed var(--border); position: relative; margin: 0;
}
.ticket-perf::before, .ticket-perf::after {
  content: ''; position: absolute; top: -9px; width: 18px; height: 18px;
  border-radius: 99px; background: var(--canvas);
}
.ticket-perf::before { left: -9px; }
.ticket-perf::after  { right: -9px; }
.ticket-qr { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.ticket-qr canvas { border-radius: 8px; border: 1px solid var(--border-2); }
.ticket-qr .qr-meta { min-width: 0; }
.ticket-qr .qr-meta .link { font-size: 11px; color: var(--text-muted); word-break: break-all; }
.ticket-actions { display: flex; gap: 8px; padding: 0 18px 16px; }

/* ── Question sets ── */
.audience-tabs { display: inline-flex; padding: 3px; background: #EEF1F6; border-radius: 9px; gap: 2px; }
.audience-tab  { border: none; background: none; padding: 7px 16px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--text-muted); cursor: pointer; }
.audience-tab.active { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }

.set-list { display: flex; flex-direction: column; gap: 10px; }
.set-row  { display: flex; align-items: center; gap: 14px; padding: 14px 18px; }
.set-row .set-idx { width: 30px; height: 30px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-dark); display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-weight: 700; font-size: 12.5px; flex: 0 0 auto; }
.set-row .set-name { font-weight: 700; font-size: 13.5px; }
.set-row .set-qcount { font-size: 12px; color: var(--text-muted); }
.set-row-main { flex: 1; min-width: 0; }
.set-row .questions-preview { font-size: 12px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Data table ── */
.table-scroll { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--border);
  white-space: nowrap; position: sticky; top: 0; background: var(--card);
}
.data-table tbody td  { padding: 11px 14px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
.data-table tbody tr  { cursor: pointer; }
.data-table tbody tr:hover { background: #FAFBFE; }
.data-table tbody tr:last-child td { border-bottom: none; }
.cell-comment { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); }
.empty-row td { text-align: center; padding: 40px 20px; color: var(--text-faint); }

/* ── Filters bar ── */
.filters-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-input {
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px 8px 34px; font-size: 13px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%236B7688' stroke-width='1.6'%3E%3Ccircle cx='6' cy='6' r='5'/%3E%3Cpath d='M13 13l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center;
  min-width: 220px;
}

/* ── Modal ── */
.overlay { position: fixed; inset: 0; background: rgba(20,26,40,.45); display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.overlay.open { display: flex; }
.modal { background: #fff; border-radius: var(--radius-lg); width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-md); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: #fff; z-index: 2; }
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--border); }

/* ── Side drawer ── */
.drawer-overlay { position: fixed; inset: 0; background: rgba(20,26,40,.4); display: none; z-index: 100; }
.drawer-overlay.open { display: block; }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: 420px; max-width: 92vw; background: #fff; box-shadow: -8px 0 30px rgba(20,26,40,.15); z-index: 101; transform: translateX(100%); transition: transform .22s ease; overflow-y: auto; }
.drawer-overlay.open .drawer { transform: translateX(0); }
.drawer-head { padding: 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: flex-start; }
.drawer-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.drawer-qa { display: flex; flex-direction: column; gap: 4px; }
.drawer-qa .q { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.drawer-qa .a { font-size: 13.5px; }

/* ── Form fields (in modals) ── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text); }
.field .hint { font-size: 11.5px; color: var(--text-muted); font-weight: 400; }
.field input[type=text], .field input[type=number], .field textarea, .field select {
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; font-size: 13.5px; font-family: var(--font-body); width: 100%;
}
.field textarea { resize: vertical; min-height: 70px; }
.q-edit-row { display: flex; gap: 8px; align-items: center; }
.q-edit-row input { flex: 1; }
.icon-btn { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--border); background: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-muted); flex: 0 0 auto; }
.icon-btn:hover { background: var(--red-soft); color: var(--red); border-color: var(--red-soft); }

/* ── Insights ── */
.insight-hero { display: flex; gap: 16px; align-items: flex-start; padding: 20px; }
.insight-hero .badge-ai { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; background: linear-gradient(145deg, var(--accent), #7AA2FF); color: #fff; flex: 0 0 auto; }
.insight-hero p  { margin: 6px 0 0; font-size: 13.5px; color: var(--text); line-height: 1.6; }
.insight-hero h3 { margin: 0; font-size: 14px; }
.insight-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }

.theme-list { display: flex; flex-direction: column; gap: 10px; }
.theme-row  { display: flex; align-items: center; gap: 10px; }
.theme-row .theme-name { width: 150px; flex: 0 0 auto; font-size: 12.5px; font-weight: 600; }
.theme-bar-track { flex: 1; height: 8px; background: #EEF1F6; border-radius: 99px; overflow: hidden; }
.theme-bar-fill  { height: 100%; border-radius: 99px; background: var(--accent); }
.theme-count { font-size: 12px; color: var(--text-muted); width: 50px; text-align: right; flex: 0 0 auto; }

.flagged-list { display: flex; flex-direction: column; gap: 10px; }
.flagged-item { padding: 12px 14px; border: 1px solid var(--red-soft); background: var(--red-soft); border-radius: 9px; }
.flagged-item .meta { font-size: 11.5px; color: #9A4444; font-weight: 600; margin-bottom: 4px; }
.flagged-item .txt  { font-size: 13px; color: #5C2B2B; }

.store-insight-card { padding: 16px 18px; }
.store-insight-card h4    { margin: 0 0 4px; font-size: 13.5px; }
.store-insight-card .score{ font-family: var(--font-head); font-size: 22px; font-weight: 700; }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(10px);
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 9px;
  font-size: 13px; font-weight: 600; opacity: 0; pointer-events: none;
  transition: .2s ease; z-index: 200; box-shadow: var(--shadow-md);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }


/* §5 ── Public feedback form ──────────────────────────────────── */
.fb-body {
  background: var(--canvas); min-height: 100vh;
  display: flex; flex-direction: column; align-items: center;
  padding: 32px 16px 60px;
}
.fb-wrap   { width: 100%; max-width: 560px; }
.fb-header { text-align: center; margin-bottom: 22px; }
.fb-mark   { margin: 0 auto 14px; }
.fb-mark img {
  max-height: 80px; width: auto;
  background: #ffffff; border-radius: 12px; padding: 10px 22px;
  box-shadow: 0 4px 16px rgba(0,0,0,.08); border: 1.5px solid var(--border);
  display: block; margin: 0 auto; object-fit: contain;
}
.fb-mark-fallback {
  width: 52px; height: 52px; border-radius: 14px; margin: 0 auto;
  background: linear-gradient(145deg, var(--lsq-ink), #1a3a55);
  display: flex; align-items: center; justify-content: center;
  color: var(--lsq-accent); font-family: var(--font-head); font-weight: 800; font-size: 20px;
}
.fb-header h1 { font-size: 19px; margin: 0 0 4px; }
.fb-header p  { margin: 0; font-size: 13px; color: var(--text-muted); }

.fb-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 26px; }

.audience-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.audience-btn {
  border: 1.5px solid var(--border); background: #fff; border-radius: var(--radius-lg);
  padding: 22px 16px; cursor: pointer; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  transition: .15s ease;
}
.audience-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.audience-btn .ic   { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.audience-btn.customer .ic { background: var(--teal-soft); color: var(--teal); }
.audience-btn.staff .ic    { background: var(--amber-soft); color: var(--amber); }
.audience-btn strong { font-family: var(--font-head); font-size: 14.5px; }
.audience-btn span   { font-size: 11.5px; color: var(--text-muted); }

.fb-progress { display: flex; gap: 5px; margin-bottom: 18px; }
.fb-progress i { flex: 1; height: 4px; border-radius: 99px; background: var(--border); }
.fb-progress i.done { background: var(--accent); }

.fb-question { margin-bottom: 22px; }
.fb-question:last-of-type { margin-bottom: 0; }
.fb-question .qtext { font-size: 14.5px; font-weight: 600; margin-bottom: 10px; }
.fb-question .qtext .opt { font-weight: 400; color: var(--text-muted); font-size: 12px; }

.scale-row { display: flex; gap: 6px; }
.scale-btn {
  flex: 1; padding: 12px 4px; border-radius: 9px; border: 1.5px solid var(--border); background: #fff;
  cursor: pointer; font-family: var(--font-head); font-weight: 700; font-size: 14px; color: var(--text-muted);
  transition: .12s ease;
}
.scale-btn:hover { border-color: var(--accent); }
.scale-btn.selected { background: var(--accent); border-color: var(--accent); color: #fff; }
.scale-labels { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: var(--text-faint); }

.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-pill { padding: 9px 14px; border-radius: 99px; border: 1.5px solid var(--border); background: #fff; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text); }
.choice-pill.selected { background: var(--ink); border-color: var(--ink); color: #fff; }

.fb-textarea { width: 100%; border: 1.5px solid var(--border); border-radius: 9px; padding: 11px 13px; font-family: var(--font-body); font-size: 13.5px; resize: vertical; min-height: 80px; }

.optional-box { border: 1.5px dashed var(--border); border-radius: 12px; padding: 16px; background: #FBFCFE; }
.optional-box .ob-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.optional-box .ob-head strong { font-size: 13.5px; }
.optional-box p { margin: 2px 0 12px; font-size: 12px; color: var(--text-muted); }
.optional-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.optional-grid input { border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; font-size: 13px; font-family: var(--font-body); }
.optional-grid input:first-child { grid-column: 1 / -1; }

.fb-submit-row { display: flex; gap: 10px; margin-top: 22px; }
.fb-submit-row .btn { flex: 1; justify-content: center; padding: 12px; font-size: 13.5px; }

.fb-thanks { text-align: center; padding: 20px 6px; }
.fb-thanks .check { width: 56px; height: 56px; border-radius: 99px; background: var(--teal-soft); color: var(--teal); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.fb-thanks h2 { font-size: 18px; margin: 0 0 6px; }
.fb-thanks p  { font-size: 13px; color: var(--text-muted); margin: 0 0 20px; }

.fb-footer { text-align: center; margin-top: 20px; font-size: 11.5px; color: var(--text-faint); }


/* §6 ── Login screen — redesigned clean card ──────────────────── */

/*
  The login screen now uses the same fb-body / fb-wrap / fb-card
  pattern as the public feedback form. The dark overlay is removed
  in favour of a light-on-canvas design that matches the dashboard.
*/
#loginScreen {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--canvas);
  display: none;      /* shown by JS via .show */
  align-items: center; justify-content: center;
  padding: 24px 16px;
  animation: fadeIn .22s ease;
}
#loginScreen.show { display: flex; }

/* The login wrapper reuses .fb-wrap width + centres the brand header */
.login-wrap { }   /* no overrides needed beyond fb-wrap */

/* The logo block inside .fb-header for login */
.fb-header .login-logo-img {
  max-height: 85px; width: auto;
  background: #ffffff; border-radius: 12px; padding: 10px 24px;
  box-shadow: 0 4px 18px rgba(0,0,0,.08); border: 1.5px solid var(--border);
  display: block; margin: 0 auto 16px; object-fit: contain;
}
.fb-header .login-logo-fallback {
  width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 14px;
  background: var(--ink);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--font-head); font-weight: 800; font-size: 20px;
}

/* ── Alert banner (replaces old .login-error) ── */
.alert-banner {
  border-radius: 8px; font-size: 13px; padding: 11px 14px;
  margin-bottom: 16px; line-height: 1.4;
}
.alert-banner.error {
  background: var(--red-soft); border: 1px solid #F5C6C6; color: var(--red);
}
.alert-banner.info {
  background: var(--accent-soft); border: 1px solid #C6D9FB; color: var(--accent-dark);
}

/* ── Login card (extends .fb-card) ── */
.login-card { }   /* .fb-card already provides the shadow + radius */

/* ── Form fields inside login card ── */
.login-card .field label {
  font-size: 12.5px; font-weight: 600; color: var(--text); display: block;
  margin-bottom: 6px;
}
.login-card .field input {
  width: 100%; border: 1.5px solid var(--border); border-radius: 8px;
  padding: 10px 13px; font-size: 14px; font-family: var(--font-body); color: var(--text);
  background: #fff; outline: none; transition: border-color .2s, box-shadow .2s;
}
.login-card .field input:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.login-card .field input::placeholder { color: var(--text-faint); }

/* ── Login row (remember me + forgot password) ── */
.login-row {
  display: flex; align-items: center; justify-content: space-between;
  margin: 10px 0 16px; gap: 8px;
}
.checkbox-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-muted); cursor: pointer;
}
.checkbox-row input[type=checkbox] {
  width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer;
}
.link-btn {
  background: none; border: none; padding: 0;
  color: var(--accent); font-size: 13px; font-weight: 600; cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
  transition: color .15s;
}
.link-btn:hover { color: var(--accent-dark); }

/* ── Login submit button ── */
.login-submit {
  width: 100%; justify-content: center; padding: 12px;
  font-size: 14px; font-weight: 700; letter-spacing: .02em;
  position: relative;
}
.login-submit:disabled { opacity: .5; cursor: not-allowed; }

/* ── Divider ── */
.divider {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0; color: var(--text-faint); font-size: 12px;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── Google button (new multi-colour SVG style) ── */
.google-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: #fff; color: var(--text);
  border: 1.5px solid var(--border); border-radius: 8px;
  padding: 11px 16px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s;
  box-shadow: var(--shadow-sm);
}
.google-btn:hover { background: #F8FAFF; border-color: #C7D0E0; box-shadow: var(--shadow-md); }
.google-btn:active { transform: scale(.98); }
.google-btn:disabled { opacity: .5; cursor: not-allowed; }
.google-btn svg { flex: none; }

/* Loading spinner on Google button */
.google-btn .g-spinner {
  display: none; width: 18px; height: 18px;
  border: 2.5px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .7s linear infinite;
}
.google-btn.loading .btn-text  { display: none; }
.google-btn.loading .g-spinner { display: inline-block; }

/* ── Access note below buttons ── */
.login-note {
  margin: 16px 0 0; font-size: 12px; color: var(--text-faint);
  text-align: center; line-height: 1.5;
}

/* ── Keep spinner animation ── */
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Legacy selectors kept so auth.js still compiles without changes ── */
.login-error { display: none; }
.login-error.show { display: block; }
/* (auth.js sets textContent + .show on #loginError — we map it to alert style) */
#loginError {
  border-radius: 8px; font-size: 13px; padding: 11px 14px; margin-top: 16px;
  background: var(--red-soft); border: 1px solid #F5C6C6; color: var(--red);
  text-align: center;
}

/* §7 ── Responsive & print ─────────────────────────────────────── */

@media (max-width: 1080px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .content { padding: 18px; }
  .topbar  { padding: 12px 16px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  #menuToggle { display: inline-flex !important; }
  .live-panel { flex-direction: column; }
}

@media (max-width: 480px) {
  .audience-choice { grid-template-columns: 1fr; }
  .optional-grid { grid-template-columns: 1fr; }
  .optional-grid input:first-child { grid-column: auto; }
}

@media print {
  .sidebar, .topbar, .section-head button, #printAllBtn, .ticket-actions { display: none !important; }
  .content { padding: 0; max-width: none; }
  .store-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .ticket { break-inside: avoid; box-shadow: none; }
  body { background: #fff; }
}
