:root {
  --navy: #0b1229;
  --navy-2: #121a33;
  --navy-3: #1c2438;
  --blue: #408fca;
  --blue-soft: #e8f2fa;
  --bg: #f4f6fa;
  --card: #ffffff;
  --border: #e6eaf0;
  --text: #0f172a;
  --muted: #64748b;
  --green: #12a150;
  --green-soft: #e7f6ee;
  --red: #e5484d;
  --red-soft: #fdecec;
  --amber: #f5a524;
  --radius: 12px;
  --topbar-h: 64px;
  --sidebar-w: 248px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
button, select, input, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--topbar-h); z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; background: var(--navy); color: #fff;
  box-shadow: 0 2px 8px rgba(11, 18, 41, .25);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 16px; }
.logo img { height: 34px; display: block; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  background: var(--navy-3); border: 1px solid #2a3350; color: #fff; cursor: pointer;
}
.icon-btn.ghost { background: transparent; border-color: transparent; }
.icon-btn:hover { border-color: var(--blue); }
.brand-picker { display: flex; align-items: center; gap: 8px; }
.brand-picker select {
  background: var(--navy-3); color: #fff; border: 1px solid #2a3350; border-radius: 10px;
  height: 40px; padding: 0 12px; min-width: 200px; cursor: pointer;
}
.brand-industry {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--blue);
  background: rgba(64, 143, 202, .14); padding: 4px 8px; border-radius: 6px;
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--blue); color: #fff;
  display: grid; place-items: center; font-weight: 600; font-size: 13px;
  border: 0; padding: 0; cursor: pointer;
}
.avatar:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.user-menu { position: relative; flex-shrink: 0; }
.user-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: 240px; max-width: calc(100vw - 24px); padding: 6px;
  background: #fff; color: var(--text); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(11, 18, 41, .18);
}
.user-pop[hidden] { display: none; }
.user-pop-head { display: grid; gap: 2px; padding: 8px 10px 10px; margin-bottom: 6px; border-bottom: 1px solid var(--border); font-size: 12px; overflow-wrap: anywhere; }
.user-pop-head b { font-size: 14px; }
.user-pop-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none;
  color: var(--text); font-size: 14px; text-align: left; text-decoration: none; cursor: pointer;
}
.user-pop-item:hover, .user-pop-item:focus-visible { background: var(--blue-soft); }
.user-pop-item svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ---------- sidebar ---------- */
.layout { display: flex; padding-top: var(--topbar-h); min-height: 100vh; }
.sidebar {
  position: fixed; top: var(--topbar-h); bottom: 0; left: 0; width: var(--sidebar-w);
  background: var(--navy); color: #c3cad9; overflow-y: auto; padding: 12px 10px 24px;
  border-top: 1px solid #1a2240; transition: width .2s ease; z-index: 20;
}
.nav-group { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #6b7491; padding: 18px 12px 8px; white-space: nowrap; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 2px 0;
  border-radius: 10px; color: inherit; text-decoration: none; white-space: nowrap; position: relative;
}
.nav-item:hover { background: var(--navy-2); color: #fff; }
.nav-item.active { background: var(--navy-3); color: #fff; }
.nav-item.active::before {
  content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--blue);
}
.nav-item.active svg { color: var(--blue); }
.nav-item .soon { margin-left: auto; font-size: 10px; color: #6b7491; border: 1px solid #2a3350; border-radius: 6px; padding: 1px 6px; }
body.collapsed .sidebar { width: 72px; }
body.collapsed .nav-item span, body.collapsed .nav-item .soon { display: none; }
body.collapsed .nav-group { visibility: hidden; height: 12px; padding: 6px 0; }
body.collapsed .content { margin-left: 72px; }
.scrim { display: none; }

/* ---------- content ---------- */
.content { flex: 1; margin-left: var(--sidebar-w); padding: 24px 28px 48px; min-width: 0; transition: margin .2s ease; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 22px; margin: 0 0 4px; font-weight: 700; }
.page-head p { margin: 0; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; }
.outlet-filter-btn, .filters select, .toolbar select, .toolbar input {
  height: 38px; border: 1px solid var(--border); border-radius: 10px; background: #fff; padding: 0 12px;
}
.segmented { display: inline-flex; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.segmented button { border: 0; background: none; padding: 6px 12px; border-radius: 7px; cursor: pointer; color: var(--muted); font-weight: 500; }
.segmented button.active { background: var(--navy); color: #fff; }

.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); margin-bottom: 16px; }
.cols-2 { grid-template-columns: 2fr 1fr; }
.cols-2-even { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); min-width: 0;
}
.card h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 220px; }

.kpi { display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--blue); opacity: .9; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-label { color: var(--muted); font-size: 13px; font-weight: 500; }
.kpi-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); }
.kpi-icon svg { width: 18px; height: 18px; }
.kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.kpi-foot { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 2px; padding: 2px 8px; border-radius: 999px; font-weight: 600; font-size: 12px; }
.chip.up { background: var(--green-soft); color: var(--green); }
.chip.down { background: var(--red-soft); color: var(--red); }
.chip.flat { background: #eef1f5; color: var(--muted); }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: 13px; color: var(--muted); }
.tab.active { background: var(--blue); border-color: var(--blue); color: #fff; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); font-size: 13px; }
th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
.rank { width: 24px; height: 24px; border-radius: 7px; display: inline-grid; place-items: center; background: #eef1f5; font-size: 12px; font-weight: 600; }
.rank.top { background: var(--blue); color: #fff; }
.bar-cell { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.bar { height: 6px; border-radius: 3px; background: var(--blue); opacity: .75; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 6px; background: #eef1f5; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* reviews */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.toolbar input { min-width: 220px; flex: 1; }
.review { border-bottom: 1px solid var(--border); padding: 16px 0; display: grid; gap: 8px; }
.review:last-child { border-bottom: 0; }
.review-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.review-author { font-weight: 600; }
.stars { color: var(--amber); letter-spacing: 1px; }
.stars .off { color: #d7dce4; }
.review-meta { margin-left: auto; color: var(--muted); font-size: 12px; }
.review-body { line-height: 1.5; }
.review-body.empty { color: var(--muted); font-style: italic; }
.status { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 6px; }
.status.pending { background: #fff4e0; color: #b26a00; }
.status.drafted { background: var(--blue-soft); color: var(--blue); }
.status.replied { background: var(--green-soft); color: var(--green); }
.reply-box { display: flex; gap: 8px; }
.reply-box textarea { flex: 1; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; resize: vertical; min-height: 38px; }
.btn { border: 0; border-radius: 10px; padding: 0 14px; height: 38px; font-weight: 600; cursor: pointer; background: var(--navy); color: #fff; }
.btn.blue { background: var(--blue); }
.btn.light { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn.danger { background: var(--red); }
.btn:disabled { opacity: .6; cursor: default; }
.latest-reply { background: #f7f9fc; border-left: 3px solid var(--blue); padding: 8px 12px; border-radius: 0 8px 8px 0; color: #334155; }

.stat-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; margin-bottom: 16px; }
.empty-state { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty-state svg { width: 40px; height: 40px; color: var(--blue); margin-bottom: 12px; }
.empty-state h3 { color: var(--text); margin: 0 0 6px; }
.loading { padding: 40px; text-align: center; color: var(--muted); }
.funnel-row { display: grid; grid-template-columns: 140px 1fr 90px; align-items: center; gap: 12px; padding: 10px 0; }
.funnel-bar { height: 34px; border-radius: 8px; background: linear-gradient(90deg, var(--blue), #6fb0e0); display: flex; align-items: center; padding: 0 12px; color: #fff; font-weight: 600; min-width: 96px; white-space: nowrap; }
.funnel-conv { text-align: right; color: var(--muted); font-size: 12px; }
/* setup: brands & outlets */
.btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn svg { width: 16px; height: 16px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-row input[type="search"] { height: 38px; border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; min-width: 200px; }
.form-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.form-row label { display: grid; gap: 6px; font-size: 12px; font-weight: 500; color: var(--muted); flex: 1 1 220px; }
.form-row input, .form-row select { height: 40px; border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; font-size: 14px; color: var(--text); background: #fff; }
.form-row input:focus, .setup-table input:focus, .picker input:focus { outline: 2px solid var(--blue-soft); border-color: var(--blue); }
.bulk-panel { background: #f7f9fc; border: 1px dashed var(--border); border-radius: 10px; padding: 12px; margin-bottom: 14px; display: grid; gap: 10px; }
.bulk-panel input[type="search"] { flex: 1; }
.bulk-results { max-height: 280px; overflow: auto; background: #fff; border: 1px solid var(--border); border-radius: 8px; }
.bulk-results > p { padding: 10px 12px; margin: 0; }
.bulk-item { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 13px; }
.bulk-item:hover { background: var(--blue-soft); }
.bulk-item code, .picker-item code { font-size: 12px; color: var(--muted); }
.pick-btn { border: 1px dashed #c8d1de; background: #fff; color: var(--blue); border-radius: 8px; height: 32px; padding: 0 10px; cursor: pointer; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pick-btn:hover { border-color: var(--blue); background: var(--blue-soft); }
.id-chip { display: inline-flex; align-items: center; background: var(--blue-soft); border-radius: 8px; overflow: hidden; max-width: 190px; }
.chip-pick { border: 0; background: none; padding: 6px 4px 6px 10px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--text); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-x { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 6px 8px; font-size: 14px; line-height: 1; }
.chip-x:hover { color: var(--red); }
.picker { position: absolute; z-index: 60; width: 390px; max-width: calc(100vw - 16px); background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(11, 18, 41, .18); padding: 10px; display: grid; gap: 8px; }
.picker input[type="search"] { height: 36px; border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; }
.picker-opt { display: flex; gap: 6px; align-items: center; font-size: 12px; }
.picker-results { max-height: 260px; overflow: auto; display: grid; gap: 2px; }
.picker-results > p { margin: 6px; }
.picker-item { display: flex; justify-content: space-between; gap: 10px; text-align: left; border: 0; background: none; padding: 8px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.picker-item:hover:not(:disabled) { background: var(--blue-soft); }
.picker-item:disabled { opacity: .5; cursor: not-allowed; }
small.warn { color: #b26a00; }
.table-wrap { overflow: auto; max-height: 65vh; border: 1px solid var(--border); border-radius: 10px; }
.setup-table th { position: sticky; top: 0; background: #f7f9fc; z-index: 1; white-space: nowrap; text-transform: none; letter-spacing: 0; font-size: 12px; }
.setup-table td { padding: 6px; }
.setup-table input { width: 100%; min-width: 120px; height: 34px; border: 1px solid transparent; border-radius: 8px; padding: 0 8px; background: transparent; }
.setup-table input:hover { border-color: var(--border); background: #fff; }
.setup-table input.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; min-width: 150px; }
.setup-table tr:hover td { background: #fbfcfe; }
.icon-del { border: 0; background: none; color: #94a3b8; cursor: pointer; padding: 6px; border-radius: 8px; display: grid; place-items: center; }
.icon-del:hover { color: var(--red); background: var(--red-soft); }
.icon-del svg { width: 16px; height: 16px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 50; font-weight: 500; }

@media (max-width: 1100px) {
  .cols-2, .cols-2-even, .cols-3 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: var(--topbar-h) 0 0 0; background: rgba(11,18,41,.4); z-index: 15; }
  .content, body.collapsed .content { margin-left: 0; padding: 16px; }
  body.collapsed .sidebar { width: var(--sidebar-w); }
  body.collapsed .nav-item span { display: inline; }
  .topbar-left, .topbar-right { gap: 8px; }
  .brand-picker select { min-width: 0; max-width: 150px; }
  .brand-industry, #fullscreenBtn { display: none; }
  .logo img { height: 28px; }
  .filters { width: 100%; }
  .filters select { flex: 1 1 40%; min-width: 0; }
  .segmented { flex: 1 1 100%; }
  .segmented button { flex: 1; }
  .funnel-row { grid-template-columns: 90px 1fr 60px; }
}

/* login */
.login-screen { position: fixed; inset: 0; z-index: 100; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--bg); overflow: auto; }
.login-brand { position: relative; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; gap: 32px; padding: clamp(28px, 5vh, 48px) clamp(28px, 4vw, 56px); color: #fff;
  background: radial-gradient(900px 500px at 110% -10%, rgba(64,143,202,.45), transparent 60%), radial-gradient(700px 500px at -20% 120%, rgba(64,143,202,.25), transparent 60%), var(--navy); }
.login-brand::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 40px 40px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 85%); mask-image: linear-gradient(180deg, #000, transparent 85%); }
.login-brand > * { position: relative; z-index: 1; }
.login-pitch { max-width: 480px; }
.login-pitch h1 { margin: 0 0 16px; font-size: clamp(26px, 2.8vw, 38px); line-height: 1.15; letter-spacing: -.02em; font-weight: 700; }
.login-pitch h1 span { color: #7fbbe6; }
.login-pitch p { margin: 0 0 28px; font-size: 16px; line-height: 1.6; color: rgba(255,255,255,.72); }
.login-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.login-points li { position: relative; padding-left: 32px; font-size: 14.5px; line-height: 1.5; color: rgba(255,255,255,.88); }
.login-points li::before { content: ""; position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%; background: rgba(64,143,202,.25) no-repeat center / 12px
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237fbbe6' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E"); }
.login-platforms { display: flex; align-items: center; gap: 10px; }
.login-platforms img { width: 36px; height: 36px; object-fit: contain; border-radius: 10px; background: #fff; padding: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.login-main { display: grid; place-items: center; padding: 32px 16px; }
.login-card { width: 100%; max-width: 380px; display: grid; gap: 16px; }
.login-head { display: grid; gap: 6px; margin-bottom: 4px; }
.login-logo-sm { display: none; }
.login-card .login-submit { height: 46px; font-size: 15px; justify-content: center; border-radius: 10px; margin-top: 4px; transition: background .15s, transform .05s; }
.login-card .login-submit:hover { background: #2f7db8; }
.login-card .login-submit:active { transform: translateY(1px); }
@media (max-width: 860px) {
  .login-screen { grid-template-columns: 1fr; background: var(--navy); }
  .login-brand { display: none; }
  .login-main { align-content: center; }
  .login-card { background: #fff; border-radius: 16px; padding: 28px 24px; box-shadow: 0 20px 50px rgba(0,0,0,.35); }
  .login-logo-sm { display: block; }
}
.team-form { display: grid; gap: 12px; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.team-form[hidden] { display: none; }
.team-form > .btn { justify-self: start; }
.team-hint { margin: 0 0 8px; font-size: 12px; font-weight: 500; color: var(--muted); }
.team-table { max-height: none; }
.team-table td { vertical-align: middle; }
.team-table select { height: 34px; border: 1px solid var(--border); border-radius: 8px; padding: 0 8px; background: #fff; }
.team-edit td { background: #f7f9fc; }
.outlet-picker { display: grid; gap: 8px; margin-bottom: 12px; }
.outlet-picker input[type="search"] { height: 36px; border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; background: #fff; }
.outlet-picker .id-list { max-height: 260px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.outlet-picker .id-row { grid-template-columns: auto 1fr; }
.outlet-picker .id-row[hidden] { display: none; }
.picker-all { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #f7f9fc; font-size: 13px; }
.profile-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.profile-detail { display: grid; gap: 4px; font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.profile-detail .muted { font-size: 12px; }
.profile-password { margin-top: 16px; }
.login-card h2 { margin: 0; font-size: 26px; letter-spacing: -.01em; }
.login-note { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.login-link { justify-self: center; border: 0; background: none; padding: 4px; color: var(--blue); font-size: 13px; font-weight: 500; cursor: pointer; }
.login-link:hover { text-decoration: underline; }
.login-card label { display: grid; gap: 6px; font-size: 12px; font-weight: 500; color: var(--muted); }
.login-card label { color: var(--text); font-size: 13px; }
.login-card input { height: 46px; border: 1px solid var(--border); border-radius: 10px; padding: 0 14px; font-size: 15px; color: var(--text); background: #fff; transition: border-color .15s, box-shadow .15s; }
.login-card input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.login-logo { height: 34px; width: auto; max-width: 100%; object-fit: contain; justify-self: start; background: var(--navy); border-radius: 8px; padding: 6px 10px; }
.login-error { color: var(--red); margin: 0; font-size: 13px; min-height: 1em; }
.row-error td { background: var(--red-soft); }
b.warn { color: var(--red); }

/* client management */
.click-row { cursor: pointer; }
.click-row:hover td { background: var(--blue-soft); }
.add-client { margin-bottom: 14px; background: #f7f9fc; border: 1px dashed var(--border); border-radius: 10px; padding: 12px; }
.form-row label.check, label.check { display: flex; flex-direction: row; align-items: center; gap: 6px; flex: 0 0 auto; color: var(--text); font-size: 13px; }
.ids-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ids-box { border: 1px solid var(--border); border-radius: 10px; padding: 12px; display: grid; gap: 8px; min-width: 0; }
.ids-head { display: flex; gap: 4px; align-items: baseline; }
.ids-box input[type=search] { flex: 1; height: 36px; border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; }
.ids-actions { justify-content: space-between; }
.id-list { max-height: 420px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.id-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 13px; }
.id-row:last-child { border-bottom: 0; }
.id-row:hover { background: var(--blue-soft); }
.id-row.inactive { opacity: .55; }
.id-row code { font-size: 12px; color: var(--muted); }
.ids-pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.ids-pager .btn { height: 30px; padding: 0 10px; }
.user-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; background: #f7f9fc; border: 1px dashed var(--border); border-radius: 10px; padding: 12px; }
.user-form label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.user-form input, .user-form select { height: 36px; border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; }
.user-form button { grid-column: 1 / -1; justify-self: start; }
td.btn-row { flex-wrap: nowrap; }
td .btn { height: 30px; padding: 0 10px; font-size: 12px; }
td select { height: 30px; border: 1px solid var(--border); border-radius: 8px; padding: 0 6px; }
a.btn { text-decoration: none; }
@media (max-width: 1100px) { .ids-cols, .user-form { grid-template-columns: 1fr; } }

/* stock-outs */
.so-hero { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; background: linear-gradient(135deg, var(--navy), #1c2f55); color: #fff; border-radius: var(--radius); padding: 22px 26px; margin-bottom: 20px; }
.so-hero p { margin: 4px 0 0; color: #b4c0d8; }
.so-big { font-size: 44px; font-weight: 700; line-height: 1.1; margin-top: 8px; }
.so-big small { font-size: 15px; font-weight: 500; color: #b4c0d8; margin-left: 10px; }
.so-live { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #ff8a8e; }
.so-live i { width: 8px; height: 8px; border-radius: 50%; background: #ff5a5f; animation: so-pulse 1.4s infinite; }
@keyframes so-pulse { 0% { box-shadow: 0 0 0 0 rgba(255,90,95,.6); } 100% { box-shadow: 0 0 0 10px rgba(255,90,95,0); } }
.so-now { background: rgba(255,255,255,.1); border-radius: 10px; padding: 10px 16px; font-size: 12px; color: #b4c0d8; }
.so-now b { display: block; font-size: 16px; color: #fff; margin-top: 2px; }
.so-section { margin-bottom: 20px; }
.so-section h3 { margin: 0 0 10px; font-size: 14px; }
.so-section h3 small { font-weight: 400; color: var(--muted); margin-left: 8px; }
.so-meals { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 12px; }
.so-meal, .so-outlet { position: relative; text-align: left; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; font: inherit; color: inherit; display: flex; flex-direction: column; gap: 4px; }
.so-meal { border-top: 4px solid var(--tone); }
.so-meal:hover, .so-outlet:hover { border-color: var(--blue); }
.so-meal.on, .so-outlet.on { outline: 2px solid var(--blue); border-color: var(--blue); background: var(--blue-soft); }
.so-meal.now::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); box-shadow: 0 0 0 2px var(--tone) inset; opacity: .35; pointer-events: none; }
.so-meal em { position: absolute; top: 10px; right: 12px; font-style: normal; font-size: 10px; font-weight: 700; color: var(--tone); letter-spacing: .06em; }
.so-meal-name { font-weight: 600; }
.so-meal-hours { font-size: 12px; color: var(--muted); }
.so-meal b { font-size: 26px; margin-top: 6px; }
.so-bar { display: block; height: 5px; border-radius: 3px; background: #eef1f6; overflow: hidden; margin-top: 4px; }
.so-bar i { display: block; height: 100%; background: var(--tone, var(--blue)); border-radius: 3px; }
.so-outlets { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.so-outlet { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 10px 14px; }
.so-outlet .so-bar { flex-basis: 100%; }
.offline-stack { position: fixed; top: calc(var(--topbar-h) + 12px); right: 16px; z-index: 65; display: grid; gap: 10px; width: 320px; max-width: calc(100vw - 32px); }
.offline-stack:empty { display: none; }
.offline-notice { display: flex; align-items: flex-start; gap: 10px; padding: 12px; background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--red); border-radius: 12px; box-shadow: 0 12px 32px rgba(11, 18, 41, .18); animation: offline-in .2s ease-out; }
@keyframes offline-in { from { opacity: 0; transform: translateX(16px); } }
@media (prefers-reduced-motion: reduce) { .offline-notice { animation: none; } }
.offline-notice.online { border-left-color: var(--green); }
.offline-notice.online .offline-dot { background: var(--green); }
.offline-dot { width: 10px; height: 10px; margin-top: 4px; border-radius: 50%; background: var(--red); flex-shrink: 0; }
.offline-text { display: grid; gap: 2px; flex: 1; min-width: 0; font-size: 13px; overflow-wrap: anywhere; }
.offline-text b { font-size: 14px; }
.offline-text small { font-size: 12px; }
.offline-view { justify-self: start; margin-top: 4px; padding: 0; border: 0; background: none; color: var(--blue); font-weight: 600; font-size: 13px; cursor: pointer; }
.offline-view:hover { text-decoration: underline; }
.offline-close { flex-shrink: 0; width: 24px; height: 24px; border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; }
.offline-close:hover { background: #eef1f5; }
.outlet-filter { position: relative; }
.outlet-filter-btn { display: block; width: 220px; max-width: 100%; cursor: pointer; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.outlet-filter-pop { position: absolute; left: 0; top: calc(100% + 8px); z-index: 30; width: 340px; max-width: calc(100vw - 32px); display: grid; gap: 8px; padding: 10px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(11, 18, 41, .18); }
.outlet-filter-pop[hidden] { display: none; }
.outlet-filter-pop input { height: 38px; border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; background: #fff; color: var(--text); }
.outlet-filter-list { max-height: 320px; overflow: auto; display: grid; gap: 2px; }
.outlet-filter-item { display: grid; gap: 2px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); text-align: left; font-size: 14px; cursor: pointer; }
.outlet-filter-item b { font-weight: 500; }
.outlet-filter-item small { font-size: 12px; color: var(--muted); }
.outlet-filter-item:hover, .outlet-filter-item:focus-visible { background: var(--blue-soft); outline: none; }
.outlet-filter-item.on b { color: var(--blue); font-weight: 600; }
.outlet-filter-empty { margin: 0; padding: 12px 10px; font-size: 13px; }
@media (max-width: 860px) { .outlet-filter, .outlet-filter-btn { width: 100%; } .outlet-filter-pop { left: 0; right: auto; } }
.locked-badge { display: inline-flex; align-items: center; gap: 3px; }
.locked-badge svg { width: 11px; height: 11px; }
.billing-note { margin: 12px 0; padding: 10px 12px; background: var(--blue-soft); border-radius: 8px; font-size: 13px; color: var(--text); }
.billing-plans-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 24px 0 12px; flex-wrap: wrap; }
.billing-plans-head h3 { margin: 0; font-size: 15px; }
.billing-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.billing-plan { display: flex; flex-direction: column; gap: 8px; }
.billing-plan.current { outline: 2px solid var(--blue); }
.billing-plan p { margin: 0; font-size: 13px; }
.billing-plan ul { margin: 4px 0 8px; padding-left: 18px; font-size: 13px; display: grid; gap: 4px; flex: 1; }
.billing-plan .btn { justify-content: center; }
.billing-price { display: grid; gap: 2px; }
.billing-price b { font-size: 24px; }
.billing-price small { font-size: 12px; color: var(--muted); }
.billing-checkout { margin-top: 20px; display: grid; gap: 12px; }
.billing-checkout > .btn { justify-self: start; }
.billing-quote { max-width: 520px; }
.billing-check { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 12px 0; }
.payout-date { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.payout-date input { height: 38px; border: 1px solid var(--border); border-radius: 10px; padding: 0 10px; background: #fff; color: var(--text); min-width: 0; flex: 0 0 auto; }
.payout-table { max-height: 70vh; }
.payout-table tr.open > td { background: var(--blue-soft); }
.payout-utr { border: 0; background: none; padding: 0; color: var(--blue); font: inherit; font-weight: 500; cursor: pointer; text-align: left; overflow-wrap: anywhere; max-width: 200px; }
.payout-utr:hover { text-decoration: underline; }
.payout-ok { color: var(--green); font-weight: 600; white-space: nowrap; }
.payout-bad { color: var(--red); font-weight: 600; white-space: nowrap; }
.payout-issues { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 14px; }
.payout-issues.warn { margin-bottom: 14px; padding: 10px 12px; background: var(--red-soft); border-radius: 8px; color: var(--red); font-weight: 500; }
.payout-detail > td { background: #f7f9fc; padding: 16px; }
.payout-detail h4 { margin: 0 0 8px; font-size: 13px; }
.payout-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 16px; }
@media (max-width: 860px) { .payout-columns { grid-template-columns: 1fr; } }
.payout-statement { width: 100%; background: #fff; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.payout-statement td { padding: 6px 10px; border: 0; }
.payout-statement td:last-child { text-align: right; white-space: nowrap; }
.payout-statement .section td { font-weight: 600; }
.payout-statement .total td { border-top: 1px solid var(--border); }
.payout-orders { max-height: 380px; background: #fff; }
.payout-orders tr.flagged td { background: var(--red-soft); }
.uptime-sub { flex-basis: 100%; font-size: 11px; }
.uptime-off { font-style: normal; font-size: 11px; font-weight: 600; color: var(--red); margin-left: 4px; }
.so-outlet b.bad { color: var(--red); } .so-outlet b.ok { color: var(--green); }
.so-count { font-size: 12px; margin-bottom: 6px; }
.so-item { display: grid; grid-template-columns: minmax(180px, 1.2fr) 2fr 110px; gap: 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); }
.so-item-main { display: flex; flex-direction: column; gap: 4px; }
.so-cat { font-size: 11px; color: var(--muted); }
.so-item-outlets { display: flex; flex-wrap: wrap; gap: 6px; }
.so-chip { display: inline-flex; flex-direction: column; font-size: 12px; padding: 4px 9px; border-radius: 8px; line-height: 1.25; }
.so-chip small { font-size: 10px; opacity: .75; }
.so-chip.out { background: var(--red-soft); color: #b42318; }
.so-chip.back { background: var(--green-soft); color: var(--green); }
.so-chip.more { background: #eef1f6; color: var(--muted); justify-content: center; }
.so-item-state { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
@media (max-width: 900px) { .so-meals { grid-template-columns: repeat(2, 1fr); } .so-item { grid-template-columns: 1fr; gap: 8px; } }

/* overview */
.ov-top { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.4fr); gap: 16px; margin-bottom: 16px; }
.ov-health { background: linear-gradient(160deg, var(--navy), #1c2f55); color: #fff; border: 0; display: flex; flex-direction: column; gap: 8px; }
.ov-eyebrow { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: #9fb0cf; }
.ov-score { font-size: 56px; font-weight: 700; line-height: 1; display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.ov-score small { font-size: 16px; font-weight: 500; color: #9fb0cf; }
.ov-score .chip { margin-left: 6px; font-size: 12px; align-self: center; }
.ov-health .stars { font-size: 22px; }
.ov-health .stars .off { color: #3b4a6b; }
.ov-meta { display: flex; gap: 28px; margin-top: 8px; }
.ov-meta b { display: block; font-size: 20px; }
.ov-meta span { font-size: 12px; color: #9fb0cf; }
.ov-progress { height: 6px; border-radius: 3px; background: rgba(255,255,255,.15); overflow: hidden; margin-top: 6px; }
.ov-progress i { display: block; height: 100%; background: #4cc38a; border-radius: 3px; }
.ov-attn { display: flex; flex-direction: column; }
.attn { display: grid; grid-template-columns: 72px 1fr auto; align-items: center; gap: 12px; padding: 11px 12px; margin-bottom: 8px; border-radius: 10px; text-decoration: none; color: inherit; border: 1px solid var(--border); border-left-width: 4px; transition: transform .12s, box-shadow .12s; }
a.attn:hover { transform: translateX(2px); box-shadow: 0 2px 8px rgba(15,23,42,.08); }
.attn b { font-size: 22px; text-align: left; }
.attn span { display: flex; flex-direction: column; min-width: 0; }
.attn small { color: var(--muted); font-size: 12px; }
.attn i { font-style: normal; color: var(--muted); }
.attn.red { border-left-color: var(--red); } .attn.red b { color: var(--red); }
.attn.amber { border-left-color: var(--amber); } .attn.amber b { color: #b26a00; }
.attn.blue { border-left-color: var(--blue); } .attn.blue b { color: var(--blue); }
.attn.ok { border-left-color: var(--green); } .attn.ok b { color: var(--green); }
.spark { width: 100%; height: 28px; display: block; }
.card { transition: box-shadow .15s; }
.kpi:hover { box-shadow: 0 4px 14px rgba(15,23,42,.08); }
@media (max-width: 900px) { .ov-top { grid-template-columns: 1fr; } }

.pill-icon { width: 18px; height: 18px; border-radius: 4px; object-fit: cover; display: block; }

/* listings health */
.lp-card { margin-bottom: 16px; }
.lp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.lp { display: flex; gap: 14px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; }
.lp-ring { --c: var(--green); flex: none; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), #e9edf3 0); position: relative; }
.lp-ring::before { content: ""; position: absolute; inset: 7px; background: #fff; border-radius: 50%; }
.lp-ring b { position: relative; font-size: 18px; }
.lp-ring.mid { --c: var(--amber); } .lp-ring.bad { --c: var(--red); }
.lp-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.lp-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lp-facts { font-size: 12px; }
.lp-issues { margin: 4px 0 0; padding-left: 18px; font-size: 13px; color: #b42318; }
.lp-good { color: var(--green); font-size: 13px; font-weight: 600; }
.bad-text { color: var(--red); } .amber-text { color: #b26a00; }
/* alerts */
.alert-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 14px; align-items: center; padding: 12px 8px; border-top: 1px solid var(--border); }
.alert-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: var(--muted); }
.alert-row.critical .alert-dot { background: var(--red); } .alert-row.warning .alert-dot { background: var(--amber); }
.alert-row.info .alert-dot { background: var(--blue); } .alert-row.done .alert-dot { background: var(--green); }
.alert-row.done { opacity: .65; }
.alert-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; } .alert-main small { color: var(--muted); }
.alert-when { font-size: 12px; white-space: nowrap; }

.kpi-logos { display: inline-flex; flex: none; }
.kpi-logos img { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; background: #fff; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(15,23,42,.18); }
.kpi-logos img + img { margin-left: -12px; }

.so-item { cursor: pointer; } .so-item:hover { background: #fafbfd; }
.so-item-more { grid-column: 1 / -1; cursor: default; padding: 4px 0 6px; }
.so-item.open { background: #f7f9fc; }
.so-detail { font-size: 12.5px; background: #fff; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.so-detail th, .so-detail td { padding: 7px 10px; }

.filters { position: relative; }
.range-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 14px; box-shadow: 0 8px 24px rgba(15,23,42,.14); display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.range-pop label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.range-pop input { border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font: inherit; color: var(--text); accent-color: var(--blue); }
.range-pop[hidden] { display: none; }

.google-btn { display: inline-flex; align-items: center; gap: 10px; background: #fff; color: #1f1f1f; border: 1px solid #dadce0; border-radius: 999px;
  height: 40px; padding: 0 18px 0 12px; font: 500 14px/1 Inter, Arial, sans-serif; cursor: pointer; }
.google-btn img { width: 20px; height: 20px; object-fit: contain; }
.google-btn:hover { background: #f8f9fa; box-shadow: 0 1px 3px rgba(60,64,67,.3); } .google-btn:disabled { opacity: .55; cursor: default; }
.g-conn { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; }
.g-email { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.google-card h3 { display: flex; align-items: center; gap: 8px; }

/* assistant */
.ask-fab { position: fixed; right: 22px; bottom: 22px; z-index: 60; display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 18px;
  border: 0; border-radius: 999px; background: var(--navy); color: #fff; font: 600 14px Inter, sans-serif; cursor: pointer; box-shadow: 0 6px 20px rgba(11,18,41,.35); }
.ask-fab svg { width: 20px; height: 20px; } .ask-fab:hover { background: #1c2f55; } .ask-fab[hidden], .ask-panel[hidden] { display: none; }
.ask-panel { position: fixed; right: 22px; bottom: 22px; z-index: 70; width: 420px; max-width: calc(100vw - 24px); height: min(640px, calc(100vh - 44px)); background: #fff;
  border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 16px 48px rgba(15,23,42,.28); display: flex; flex-direction: column; overflow: hidden; }
.ask-panel header { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; background: var(--navy); color: #fff; }
.ask-panel header b { display: flex; align-items: center; gap: 8px; } .ask-panel header svg { width: 18px; height: 18px; }
.ask-panel header button { background: none; border: 0; color: #b4c0d8; cursor: pointer; font-size: 13px; } .ask-panel header #askClose { font-size: 22px; line-height: 1; margin-left: 8px; }
.ask-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #f7f9fc; }
.ask-msg { max-width: 92%; padding: 9px 12px; border-radius: 12px; line-height: 1.5; font-size: 13.5px; overflow-wrap: anywhere; }
.ask-msg.me { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.ask-msg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.ask-msg.bot p { margin: 0 0 8px; } .ask-msg.bot p:last-child { margin-bottom: 0; } .ask-msg.bot ul, .ask-msg.bot ol { margin: 4px 0 8px; padding-left: 20px; }
.ask-msg.bot h4 { margin: 8px 0 4px; font-size: 13.5px; } .ask-msg.bot code { background: #eef1f6; padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.ask-msg.err { color: #b42318; background: var(--red-soft); border-color: #f4c7c3; } .ask-msg.thinking { color: var(--muted); }
.dots { display: inline-flex; gap: 3px; margin-right: 6px; } .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: ask-blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; } @keyframes ask-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.ask-welcome { display: flex; flex-direction: column; gap: 8px; } .ask-welcome p { margin: 0 0 4px; color: #334155; line-height: 1.5; }
.ask-chip { text-align: left; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; cursor: pointer; font: inherit; color: var(--text); }
.ask-chip:hover { border-color: var(--blue); background: var(--blue-soft); }
.ask-form { display: flex; gap: 8px; padding: 10px 12px 4px; border-top: 1px solid var(--border); }
.ask-form textarea { flex: 1; resize: none; border: 1px solid var(--border); border-radius: 10px; padding: 9px 10px; font: inherit; max-height: 110px; }
.ask-note { padding: 0 14px 10px; color: var(--muted); font-size: 11px; }
.ask-table { overflow-x: auto; margin: 6px 0; } .ask-table table { font-size: 12px; } .ask-table th, .ask-table td { padding: 5px 7px; white-space: nowrap; }
.ask-how { margin-top: 8px; font-size: 12px; color: var(--muted); } .ask-how summary { cursor: pointer; }
.ask-q pre { background: #0f172a; color: #e2e8f0; padding: 8px 10px; border-radius: 8px; overflow-x: auto; font-size: 11.5px; white-space: pre-wrap; margin: 6px 0; }
.ask-err { color: #b42318; font-size: 12px; }

/* complaints: dense layout */
.cp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); padding: 0; margin-bottom: 12px; overflow: hidden; }
.cp-stat { padding: 10px 14px; border-right: 1px solid var(--border); display: grid; gap: 2px; }
.cp-stat:last-child { border-right: 0; }
.cp-stat span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cp-stat b { font-size: 20px; font-variant-numeric: tabular-nums; }
.cp-stat.warn b { color: #b26a00; } .cp-stat.bad b { color: #c62828; } .cp-stat.ok b { color: var(--green); }
.cp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px; margin-bottom: 12px; }
.cp-card { padding: 12px 14px; }
.cp-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.cp-head h3 { font-size: 14px; margin: 0; }
.cp-head .muted, .cp-toolbar .muted { font-size: 12px; }
.cp-scroll { max-height: 236px; overflow: auto; }
.cp-table th, .cp-table td { padding: 5px 6px; font-size: 12.5px; }
.cp-table th { font-size: 10.5px; position: sticky; top: 0; background: var(--card, #fff); z-index: 1; }
.cp-click { cursor: pointer; }
.cp-click:hover, .cp-click.on, .cp-row:hover { background: var(--blue-soft); }
.cp-mcell { width: 30%; }
.cp-meter { display: block; height: 6px; border-radius: 3px; background: #eef1f6; overflow: hidden; }
.cp-meter i { display: block; height: 100%; background: var(--blue); }
.cp-warn { color: #b26a00; } .cp-bad { color: #c62828; font-weight: 600; }
.cp-toolbar { margin-bottom: 8px; }
.cp-toolbar input, .cp-toolbar select { height: 32px; }
.cp-list .cp-row { cursor: pointer; }
.cp-list .pill-icon { width: 16px; height: 16px; vertical-align: middle; }
.cp-ellip { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.cp-status { height: 26px !important; font-size: 12px; font-weight: 600; border-radius: 6px; }
.cp-status.cp-open, .status.cp-open { background: #fff4e0; color: #b26a00; }
.cp-status.cp-in_progress, .status.cp-in_progress { background: var(--blue-soft); color: var(--blue); }
.cp-status.cp-resolved, .status.cp-resolved { background: var(--green-soft); color: var(--green); }
.cp-detail td { background: #f7f9fc; padding: 10px 12px; }
.cp-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 4px 16px; margin-bottom: 8px; font-size: 12.5px; }
.cp-kv span { color: var(--muted); margin-right: 6px; }

/* reviews: dense layout (shares the cp- classes) */
.rv-grid { grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr) minmax(420px, 2fr); }
@media (max-width: 1100px) { .rv-grid { grid-template-columns: 1fr; } }
.rv-grid .cp-scroll { max-height: 200px; }
.rv-text { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-chip { display: inline-block; min-width: 44px; text-align: center; font-weight: 600; font-size: 12px; padding: 1px 6px; border-radius: 6px; }
.rv-chip.neg { background: #fde8e8; color: #c62828; } .rv-chip.mid { background: #fff4e0; color: #b26a00; } .rv-chip.pos { background: var(--green-soft); color: var(--green); }
.status.ignored { background: #eef1f6; color: var(--muted); }

/* ---------- density: more information per screen (applies to every page) ---------- */
body { font-size: 13px; }
.content { padding: 14px 18px 32px; }
.page-head { margin-bottom: 12px; gap: 10px; }
.page-head h1 { font-size: 18px; margin-bottom: 2px; }
.page-head p { font-size: 12px; }
.nav-group { padding: 12px 12px 4px; font-size: 10px; }
.nav-item { padding: 7px 12px; margin: 1px 0; gap: 10px; border-radius: 8px; }
.nav-item svg { width: 17px; height: 17px; }

.outlet-filter-btn, .filters select, .toolbar select, .toolbar input { height: 32px; border-radius: 8px; padding: 0 10px; }
.segmented { border-radius: 8px; padding: 2px; }
.segmented button { padding: 4px 10px; border-radius: 6px; }
.filters, .toolbar { gap: 8px; }
.toolbar { margin-bottom: 10px; }
.btn { height: 32px; padding: 0 12px; border-radius: 8px; font-size: 12.5px; }

.grid { gap: 12px; }
.kpis { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin-bottom: 12px; }
.card { padding: 12px 14px; border-radius: 10px; }
.cp-stats { padding: 0; }
.card h3 { font-size: 14px; }
.card-head { margin-bottom: 8px; gap: 8px; }
.chart-box { height: 220px; }
.chart-box.sm { height: 170px; }

.kpi { gap: 4px; }
.kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.kpi-icon { width: 26px; height: 26px; border-radius: 7px; }
.kpi-icon svg { width: 14px; height: 14px; }
.kpi-value { font-size: 20px; font-variant-numeric: tabular-nums; }
.kpi-foot { font-size: 11px; gap: 6px; }
.stat-strip { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-bottom: 12px; }

th, td { padding: 6px 8px; font-size: 12.5px; }
th { font-size: 10.5px; }
td .btn, td select { height: 26px; font-size: 12px; }
.table-wrap { border-radius: 8px; }

.review { padding: 10px 0; gap: 4px; }
.latest-reply { padding: 6px 10px; }
.empty-state { padding: 28px 16px; }
.empty-state svg { width: 30px; height: 30px; margin-bottom: 6px; }

.so-hero { padding: 12px 16px; margin-bottom: 12px; }
.so-big { font-size: 30px; margin-top: 4px; }
.so-section { margin-bottom: 12px; }
.so-section h3 { margin-bottom: 6px; font-size: 13px; }
.so-meals { gap: 8px; }
.so-meal { padding: 8px 12px; gap: 2px; }
.so-meal b { font-size: 20px; margin-top: 2px; }
.so-outlets { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; }
.so-outlet { padding: 6px 10px; }
.so-item { padding: 7px 0; gap: 10px; }

/* money leaked (overview) */
.leak { margin-bottom: 12px; }
.leak-hero { display: flex; gap: 20px; flex-wrap: wrap; align-items: stretch; margin-bottom: 8px; }
.leak-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.leak-big { font-size: 30px; font-weight: 700; color: #c62828; font-variant-numeric: tabular-nums; line-height: 1.15; }
.leak-causes { flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px 14px; }
.leak-cause { display: grid; gap: 1px; padding-left: 10px; border-left: 1px solid var(--border); }
.leak-cause span:first-child, .leak-cause small { font-size: 11px; color: var(--muted); }
.leak-cause b { font-size: 16px; font-variant-numeric: tabular-nums; }
.leak .cp-scroll { max-height: 220px; }

.leak-est { font-style: normal; font-size: 9.5px; font-weight: 700; color: #b26a00; background: #fff4e0; border-radius: 4px; padding: 0 4px; text-transform: uppercase; }
.leak-conf { font-size: 11.5px; color: var(--muted); background: #fffaf0; border: 1px solid #fde7c2; border-radius: 6px; padding: 5px 8px; margin-bottom: 8px; }

/* item scorecard */
.it-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.it-sort:hover { color: var(--text); }
.it-name { max-width: 260px; }
.it-name b, .it-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.it-name b { font-weight: 600; }
.it-name small { color: var(--muted); font-size: 11px; }
.it-flag td:first-child { box-shadow: inset 3px 0 0 #e5484d; }
.it-flags { margin: 0 0 8px; padding-left: 18px; color: #c62828; font-size: 12.5px; }
