/* Employee Voice — Impact brand scheme */
:root {
  --wine: #86163A;
  --wine-2: #9E2A4E;
  --crimson: #C02049;
  --peach: #E8A87C;
  --blush: #F1D0D9;
  --pale: #FBF5F7;
  --cream: #F7EFE2;
  --brown: #8A6034;
  --text: #1A1A1A;
  --muted: #5C5C5C;
  --line: #E6DCDF;
  --bg: #F6F2F3;
  --card: #FFFFFF;
  --ok: #1F7A4D;
  --ok-bg: #E7F4EC;
  --err: #B3261E;
  --err-bg: #FCE8E6;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(26, 26, 26, .05), 0 4px 16px rgba(134, 22, 58, .06);
  --font: "Avenir Next", "Avenir Next LT Pro", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.55; font-size: 16px; }
a { color: var(--wine); }
a:hover { color: var(--crimson); }
h1, h2, h3 { color: var(--wine); line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; margin-top: 1.4em; }
p { margin: 0 0 1em; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 24px; padding-bottom: 48px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.eyebrow { color: var(--crimson); font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin: 0 0 .3em; }

/* Top bar */
.topbar { background: var(--wine); color: #fff; }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand-mark { width: 38px; height: 38px; border-radius: 9px; background: var(--peach); color: var(--wine); display: grid; place-items: center; font-weight: 800; letter-spacing: .02em; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text small { color: var(--blush); font-size: .78rem; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: var(--blush); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: .92rem; }
.nav a:hover, .nav a.active { background: var(--wine-2); color: #fff; }

/* Cards & layout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 20px; }
.card.narrow { max-width: 560px; margin-left: auto; margin-right: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid2 > .card { margin-bottom: 0; }
.grid2 + .card, .grid2 + section { margin-top: 20px; }
.row-between { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.side .card { padding: 18px; }
.side h3 { margin-top: 0; }

/* Hero */
.hero { background: linear-gradient(135deg, var(--wine), var(--wine-2)); color: #fff; border-radius: var(--radius); padding: 32px; margin-bottom: 20px; }
.hero h1 { color: #fff; font-size: 2rem; }
.hero p { color: var(--blush); font-size: 1.05rem; max-width: 640px; }
.assure { list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.assure li { background: rgba(255, 255, 255, .08); border: 1px solid rgba(241, 208, 217, .25); border-radius: 10px; padding: 12px 14px; font-size: .9rem; color: var(--blush); }
.assure strong { color: #fff; display: block; }

/* Forms */
.form label, .form fieldset { display: block; margin-bottom: 18px; font-weight: 600; font-size: .95rem; }
.form.tight label { margin-bottom: 12px; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { padding: 0; margin-bottom: 8px; font-weight: 600; }
input[type=text], input[type=password], input[type=search], input[type=date], select, textarea {
  display: block; width: 100%; margin-top: 6px; font: inherit; font-weight: 400; color: var(--text);
  background: #fff; border: 1px solid #D5C8CC; border-radius: 8px; padding: 10px 12px;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--crimson); outline-offset: 1px; border-color: var(--crimson); }
.req { color: var(--crimson); }
.opt { color: var(--muted); font-weight: 400; font-size: .8rem; margin-left: 4px; }
.hint { font-size: .85rem; color: var(--muted); margin: -8px 0 18px; }
.hint.warn { background: var(--cream); color: var(--brown); padding: 10px 12px; border-radius: 8px; margin-top: -6px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.chip { margin: 0 !important; position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span { display: inline-block; padding: 9px 16px; border-radius: 999px; border: 1px solid #D5C8CC; background: #fff; font-weight: 500; cursor: pointer; }
.chip input:checked + span { background: var(--wine); border-color: var(--wine); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--crimson); outline-offset: 2px; }
.actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.inline-form { display: flex; gap: 8px; }
.inline-form input { margin-top: 0; }
.small-form input { padding: 6px 8px; font-size: .85rem; min-width: 170px; }
.char-count { display: block; text-align: right; font-size: .78rem; color: var(--muted); font-weight: 400; margin-top: 4px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; font-size: .92rem; padding: 10px 16px; border-radius: 8px; cursor: pointer; text-decoration: none; border: 1px solid var(--wine); background: #fff; color: var(--wine); white-space: nowrap; }
.btn:hover { background: var(--pale); color: var(--wine); }
.btn.primary { background: var(--wine); color: #fff; }
.btn.primary:hover { background: var(--crimson); border-color: var(--crimson); color: #fff; }
.btn.ghost { border-color: var(--line); color: var(--text); }
.btn.danger { border-color: var(--err); color: var(--err); }
.btn.danger:hover { background: var(--err-bg); }
.small-btn { padding: 6px 10px; font-size: .82rem; }

/* Alerts */
.alert { border-radius: 10px; padding: 12px 16px; margin: 0 0 18px; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }
.alert.error { background: var(--err-bg); color: var(--err); }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.card .alert { margin-top: 16px; margin-bottom: 0; }

/* Success */
.success { text-align: center; max-width: 620px; margin: 20px auto; }
.tick { width: 56px; height: 56px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: grid; place-items: center; font-size: 1.8rem; margin: 0 auto 12px; }
.refbox { display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--pale); border: 2px dashed var(--blush); border-radius: 12px; padding: 18px; margin: 18px 0; }
.refbox code { font-size: 1.7rem; font-weight: 700; letter-spacing: .08em; color: var(--wine); font-family: ui-monospace, "SF Mono", Consolas, monospace; }

/* Status stepper */
.steps { list-style: none; padding: 0; margin: 18px 0; display: grid; grid-template-columns: repeat(4, 1fr); counter-reset: s; }
.steps li { position: relative; text-align: center; font-size: .82rem; color: var(--muted); padding-top: 30px; }
.steps li::before { counter-increment: s; content: counter(s); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 24px; height: 24px; border-radius: 50%; background: #EEE6E8; color: var(--muted); display: grid; place-items: center; font-size: .75rem; font-weight: 700; z-index: 1; }
.steps li::after { content: ""; position: absolute; top: 11px; left: -50%; width: 100%; height: 2px; background: #EEE6E8; }
.steps li:first-child::after { display: none; }
.steps li.done::before { background: var(--wine); color: #fff; content: "✓"; }
.steps li.done::after, .steps li.current::after { background: var(--wine); }
.steps li.current::before { background: var(--crimson); color: #fff; }
.steps li.done, .steps li.current { color: var(--text); font-weight: 600; }

/* Meta list */
.meta { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 14px 0 6px; }
.meta dt { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.meta dd { margin: 0; font-weight: 600; }

/* Conversation */
.bubble { border-radius: 12px; padding: 12px 16px; margin-bottom: 10px; max-width: 88%; }
.bubble p:last-child { margin-bottom: 0; }
.bubble.theirs { background: var(--pale); border: 1px solid var(--blush); }
.bubble.mine { background: #fff; border: 1px solid var(--line); margin-left: auto; }
.who { font-size: .78rem; color: var(--muted); margin-bottom: 4px !important; font-weight: 600; }
.note { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; font-size: .9rem; }
.note p { margin-bottom: 4px; }
.log { list-style: none; padding: 0; margin: 0; font-size: .88rem; }
.log li { border-left: 2px solid var(--blush); padding: 2px 0 10px 12px; }
.danger-zone { border-color: #F2C6C3; }

/* Badges */
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; background: #EEE6E8; color: var(--text); }
.status-new { background: var(--crimson); color: #fff; }
.status-under-review { background: var(--cream); color: var(--brown); }
.status-in-progress { background: var(--blush); color: var(--wine); }
.status-resolved { background: var(--ok-bg); color: var(--ok); }
.status-closed { background: #ECECEC; color: var(--muted); }
.urg-high { background: var(--err-bg); color: var(--err); }
.urg-medium { background: var(--cream); color: var(--brown); }
.urg-low { background: #EFF1F3; color: #4A5560; }
.type-suggestion { background: #EEF0FA; color: #3A4380; }
.type-complaint { background: var(--pale); color: var(--wine); border: 1px solid var(--blush); }
.type-concern { background: var(--cream); color: var(--brown); }
.type-compliment { background: var(--ok-bg); color: var(--ok); }
.role-admin { background: var(--wine); color: #fff; }
.role-reviewer { background: var(--blush); color: var(--wine); }
.badges { display: flex; gap: 6px; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin: 14px 0 16px; }
.filters input, .filters select { margin-top: 0; width: auto; min-width: 140px; padding: 8px 10px; font-size: .9rem; }
.filters input[type=search] { flex: 1 1 220px; }
.filters .date { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); }
.filters .check { display: flex; align-items: center; gap: 6px; font-size: .88rem; }
.filters .btn { padding: 8px 14px; }

/* Tables */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.card .table-wrap { border: 0; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data th { text-align: left; background: var(--wine); color: #fff; font-weight: 600; padding: 10px 12px; font-size: .8rem; letter-spacing: .02em; white-space: nowrap; }
.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data tbody tr:hover { background: var(--pale); }
.data tr.unread .title-cell a { font-weight: 700; }
.data .num { text-align: center; font-variant-numeric: tabular-nums; }
.data .empty { text-align: center; color: var(--muted); padding: 32px; }
.title-cell { min-width: 220px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--crimson); margin-right: 6px; vertical-align: middle; }
.matrix td:first-child { min-width: 220px; }
.pager { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.pager a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; text-decoration: none; }
.pager a.active { background: var(--wine); color: #fff; border-color: var(--wine); }
.back { text-decoration: none; font-size: .9rem; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 20px; }
.kpis.compact { grid-template-columns: repeat(4, 1fr); }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; text-decoration: none; color: var(--text); border-top: 3px solid var(--wine); }
a.kpi:hover { background: var(--pale); color: var(--text); }
.kpi-n { font-size: 1.9rem; font-weight: 700; color: var(--wine); line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-l { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.alert-kpi { border-top-color: var(--crimson); }
.alert-kpi .kpi-n { color: var(--crimson); }

/* Horizontal bars */
.hbars { list-style: none; padding: 0; margin: 0; }
.hbars li { display: grid; grid-template-columns: minmax(120px, 42%) 1fr 70px; align-items: center; gap: 10px; padding: 5px 0; font-size: .88rem; }
.hb-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { background: #F1EAEC; border-radius: 4px; height: 12px; overflow: hidden; }
.hb-bar { display: block; height: 100%; background: var(--wine); border-radius: 4px; }
.tone-crimson .hb-bar { background: var(--crimson); }
.hb-val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.hb-val small { color: var(--muted); font-weight: 400; }

/* Trend chart */
svg.trend { width: 100%; height: auto; display: block; }
svg.trend .grid { stroke: #EEE6E8; stroke-width: 1; }
svg.trend .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
svg.trend .bar-a { fill: var(--wine); }
svg.trend .bar-b { fill: var(--peach); }
.legend { font-size: .82rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-left: 8px; }
.sw-a { background: var(--wine); }
.sw-b { background: var(--peach); }

/* Report */
.report { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; margin-top: 16px; }
.report-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 3px solid var(--wine); padding-bottom: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.report-head h1 { margin-bottom: .2em; }
.report section { margin-bottom: 24px; }
.report .kpi { border-top-width: 3px; }
.lede { background: var(--cream); color: var(--brown); padding: 12px 16px; border-radius: 8px; }
.detail-text { font-size: .82rem; color: var(--muted); margin-top: 6px; }
.report-table { font-size: .82rem; }

/* Footer */
.foot { border-top: 1px solid var(--line); padding: 18px 0; font-size: .82rem; color: var(--muted); background: #fff; }

/* Responsive */
@media (max-width: 960px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .detail { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .grid2, .assure { grid-template-columns: 1fr; }
  .kpis, .kpis.compact { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 24px 20px; }
  .hero h1 { font-size: 1.55rem; }
  .card { padding: 18px; }
  .report { padding: 18px; }
  .filters input, .filters select { flex: 1 1 100%; }
  .inline-form { flex-direction: column; }
  .bubble { max-width: 100%; }
  .hbars li { grid-template-columns: 1fr 70px; }
  .hb-track { grid-column: 1 / -1; order: 3; }
  .steps li { font-size: .72rem; }
}

/* Print */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; font-size: 11pt; }
  .topbar, .foot, .no-print, .nav { display: none !important; }
  main.wrap { padding: 0; max-width: none; }
  .report { border: 0; padding: 0; margin: 0; }
  .kpis { grid-template-columns: repeat(6, 1fr); }
  .grid2 { grid-template-columns: 1fr 1fr; }
  .avoid-break, .kpi, tr { break-inside: avoid; }
  .data th { background: var(--wine) !important; color: #fff !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; text-decoration: none; }
}
