:root {
    --bg: #f6f5fa;
    --surface: #ffffff;
    --surface-soft: #fbfaff;
    --surface-muted: #f1eff7;
    --border: #e7e3ef;
    --border-strong: #d8d2e6;
    --text: #191524;
    --text-soft: #4e485e;
    --muted: #736c84;
    --faint: #9a93a9;
    --purple: #6d28d9;
    --purple-dark: #5518b8;
    --purple-soft: #f3eefe;
    --purple-line: #e2d6fb;
    --success: #067647;
    --success-bg: #dcfae6;
    --danger: #b42318;
    --danger-bg: #fee4e2;
    --warning: #93540a;
    --warning-bg: #fff2d6;
    --info: #175cd3;
    --info-bg: #e8f0fe;
    --neutral-bg: #f2f0f6;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(25, 21, 36, 0.04), 0 2px 6px rgba(25, 21, 36, 0.03);
    --shadow-modal: 0 24px 60px rgba(25, 21, 36, 0.18), 0 6px 18px rgba(25, 21, 36, 0.08);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 13.5px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--purple); text-decoration: none; }
a:hover { color: var(--purple-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; }
.icon { flex: 0 0 auto; display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.text-muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-purple { color: var(--purple); }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-variant-numeric: tabular-nums; }
.small { font-size: 12px; }
.strong { font-weight: 650; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

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

.sidebar {
    width: 238px;
    flex: 0 0 238px;
    height: 100vh;
    position: sticky;
    top: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 40;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 16px 16px;
}
.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--purple);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 17px;
    letter-spacing: -.02em;
    box-shadow: inset 0 -2px 0 rgba(0,0,0,.12);
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.2; }
.brand-copy strong { font-size: 14px; letter-spacing: -.01em; }
.brand-copy span { font-size: 11px; color: var(--muted); margin-top: 2px; }
.mobile-close { display: none; margin-left: auto; font-size: 20px; }
.nav { padding: 10px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--faint);
    font-weight: 700;
    padding: 6px 10px 8px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    color: var(--text-soft);
    font-weight: 550;
    font-size: 13px;
    line-height: 1.2;
    transition: background .12s ease, color .12s ease;
}
.nav-item .icon { color: var(--muted); }
.nav-item:hover { background: var(--surface-soft); color: var(--text); }
.nav-item.active { background: var(--purple-soft); color: var(--purple); font-weight: 650; }
.nav-item.active .icon { color: var(--purple); }
.nav-badge {
    margin-left: auto;
    background: var(--danger-bg);
    color: var(--danger);
    border-radius: 999px;
    min-width: 20px;
    height: 19px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10.5px;
    font-weight: 700;
}
.nav-badge-warn { background: var(--warning-bg); color: var(--warning); }
.sidebar-note {
    margin: auto 12px 12px;
    padding: 11px 12px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    border-radius: 9px;
}
.sidebar-note-head { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--text-soft); }
.sidebar-note-head .icon { color: var(--purple); }
.sidebar-note p { color: var(--muted); font-size: 11px; line-height: 1.45; margin-top: 4px; }
.sidebar-user {
    border-top: 1px solid var(--border);
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sidebar-user-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.sidebar-user-copy strong { font-size: 12px; }
.sidebar-user-copy span { color: var(--muted); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user form { display: flex; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    height: 62px;
    flex: 0 0 62px;
    background: rgba(255,255,255,.94);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(8px);
}
.topbar-left, .topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-date { font-size: 12px; color: var(--muted); }
.prototype-pill {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--purple-soft);
    color: var(--purple);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}
.content { padding: 24px 28px 36px; width: 100%; max-width: 1560px; margin: 0 auto; }
.app-footer {
    margin-top: 32px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--faint);
    font-size: 10.5px;
}
.menu-toggle { display: none; }

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}
.page-head-copy { max-width: 760px; }
.eyebrow {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--purple);
    font-weight: 750;
    margin-bottom: 5px;
}
.page-head h1 { font-size: 25px; line-height: 1.18; letter-spacing: -.025em; font-weight: 700; }
.page-head p { color: var(--muted); font-size: 13px; margin-top: 5px; max-width: 680px; }
.page-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; padding-top: 8px; }
.breadcrumb { font-size: 11.5px; color: var(--muted); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--purple); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 13px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    font-size: 12.5px;
    font-weight: 650;
    line-height: 1;
    white-space: nowrap;
    transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.btn .icon { margin-left: -1px; }
.btn-primary { background: var(--purple); border-color: var(--purple); color: #fff; }
.btn-primary:hover { background: var(--purple-dark); border-color: var(--purple-dark); color: #fff; }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text-soft); }
.btn-secondary:hover { border-color: #b9b1cc; color: var(--text); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-soft); color: var(--text); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #971b12; border-color: #971b12; color: #fff; }
.btn-danger-ghost { background: transparent; border-color: var(--border); color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-bg); border-color: #f6c6c2; }
.btn-whatsapp { background: #087443; border-color: #087443; color: #fff; }
.btn-whatsapp:hover { background: #056036; border-color: #056036; color: #fff; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 11.5px; border-radius: 7px; }
.btn-xs { height: 26px; padding: 0 8px; font-size: 10.5px; border-radius: 6px; gap: 4px; }
.btn-block { width: 100%; }
.icon-btn {
    width: 30px;
    height: 30px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
}
.icon-btn:hover { background: var(--surface-muted); color: var(--text); }
.wa-icon { display: inline-flex; color: #0c8a50; }
.btn-whatsapp .wa-icon { color: #fff; }

.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--purple-soft);
    color: var(--purple);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10.5px;
    font-weight: 750;
    flex: 0 0 auto;
    border: 1px solid var(--purple-line);
}
.avatar-sm { width: 28px; height: 28px; font-size: 10px; }
.avatar-lg { width: 46px; height: 46px; font-size: 14px; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 10.5px;
    line-height: 1.5;
    font-weight: 650;
    white-space: nowrap;
    background: var(--neutral-bg);
    color: var(--text-soft);
}
.badge-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-purple { background: var(--purple-soft); color: var(--purple); }
.badge-neutral { background: var(--neutral-bg); color: var(--text-soft); }

.score-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 650; padding: 2px 7px; border-radius: 999px; }
.score-pill strong { font-size: 11.5px; }
.score-hot { background: var(--danger-bg); color: var(--danger); }
.score-warm { background: var(--warning-bg); color: var(--warning); }
.score-cold { background: var(--neutral-bg); color: var(--muted); }

.alert {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 13px;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: var(--surface);
    margin-bottom: 12px;
    font-size: 12.5px;
}
.alert-icon { display: inline-flex; margin-top: 1px; }
.alert-error { border-color: #f4c4c0; background: #fff7f6; color: #7a1a12; }
.alert-success { border-color: #bfe9d2; background: #f4fdf8; color: #065f38; }
.alert-info { border-color: #cddcfb; background: #f6f9ff; color: #124aaf; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-width: 0;
}
.card-head {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.card-head h2, .card-head h3 { font-size: 13.5px; font-weight: 700; letter-spacing: -.005em; }
.card-head p { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.card-head-actions { display: flex; align-items: center; gap: 6px; }
.card-body { padding: 16px; }
.card-body.flush { padding: 0; }
.card-foot { padding: 10px 16px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 10px; }

.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 11px; margin-bottom: 16px; }
.kpi {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 13px 14px 12px;
    box-shadow: var(--shadow);
    color: inherit;
    min-width: 0;
}
.kpi-link:hover { border-color: var(--border-strong); color: inherit; }
.kpi-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.kpi-label { font-size: 11px; color: var(--muted); font-weight: 600; line-height: 1.3; }
.kpi-icon { width: 28px; height: 28px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.kpi-icon-purple { background: var(--purple-soft); color: var(--purple); }
.kpi-icon-success { background: var(--success-bg); color: var(--success); }
.kpi-icon-danger { background: var(--danger-bg); color: var(--danger); }
.kpi-icon-warning { background: var(--warning-bg); color: var(--warning); }
.kpi-icon-info { background: var(--info-bg); color: var(--info); }
.kpi-value { font-size: 23px; font-weight: 700; letter-spacing: -.025em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 10.5px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.kpi-tag { font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 700; margin-top: 5px; }

.focus-panel {
    background: #fbf8ff;
    border: 1px solid var(--purple-line);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 16px;
}
.focus-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.focus-head h2 { font-size: 14px; font-weight: 700; }
.focus-head p { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.focus-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.focus-item {
    display: flex;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 10px 11px;
    min-width: 0;
}
.focus-num { width: 22px; height: 22px; flex: 0 0 auto; border-radius: 50%; background: var(--purple); color: #fff; display: grid; place-items: center; font-size: 10.5px; font-weight: 750; }
.focus-item.tone-danger .focus-num { background: var(--danger); }
.focus-item.tone-warning .focus-num { background: var(--warning); }
.focus-content { min-width: 0; flex: 1; }
.focus-kind { font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 750; }
.focus-title { font-size: 12.5px; font-weight: 650; margin-top: 1px; line-height: 1.3; }
.focus-why { font-size: 10.5px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.focus-actions { display: flex; align-items: center; gap: 3px; margin-top: 7px; }
.focus-actions .btn { color: var(--purple); }
.focus-actions .btn-whatsapp { color: #fff; }
.focus-link { font-size: 10.5px; font-weight: 650; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.58fr) minmax(300px, .82fr); gap: 14px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.split-main { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .8fr); gap: 14px; align-items: start; }
.split-even { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }

.pipeline-list { display: flex; flex-direction: column; gap: 9px; }
.pipeline-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) 58px; gap: 10px; align-items: center; }
.pipeline-name { font-size: 11px; color: var(--text-soft); display: flex; align-items: center; gap: 5px; }
.stage-dot { width: 6px; height: 6px; border-radius: 50%; flex: 0 0 auto; }
.dot-new { background: #6b7cff; }
.dot-contacted { background: #8a94a6; }
.dot-qualified { background: #9b6cf2; }
.dot-proposal { background: #d89216; }
.dot-negotiation { background: #c06a12; }
.dot-won { background: #1b9d63; }
.dot-lost { background: #c9473c; }
.bar-track { height: 8px; border-radius: 999px; background: var(--surface-muted); overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; background: var(--purple); }
.bar-fill.new { background: #6b7cff; }
.bar-fill.contacted { background: #a1a8b7; }
.bar-fill.qualified { background: #9b6cf2; }
.bar-fill.proposal { background: #d89216; }
.bar-fill.negotiation { background: #b86512; }
.bar-fill.won { background: #1b9d63; }
.bar-fill.lost { background: #c9473c; }
.pipeline-value { font-size: 11px; color: var(--text-soft); text-align: right; font-variant-numeric: tabular-nums; }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.list-item:first-child { padding-top: 0; }
.list-item:last-child { border-bottom: 0; padding-bottom: 0; }
.list-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: 0 0 auto; background: var(--surface-muted); color: var(--muted); }
.list-icon-purple { background: var(--purple-soft); color: var(--purple); }
.list-icon-danger { background: var(--danger-bg); color: var(--danger); }
.list-icon-warning { background: var(--warning-bg); color: var(--warning); }
.list-icon-success { background: var(--success-bg); color: var(--success); }
.list-body { min-width: 0; flex: 1; }
.list-title { font-size: 12px; font-weight: 650; line-height: 1.35; }
.list-sub { font-size: 10.8px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.list-meta { font-size: 10px; color: var(--faint); white-space: nowrap; }
.list-actions { display: flex; align-items: center; gap: 4px; margin-top: 5px; flex-wrap: wrap; }

.table-wrap { width: 100%; overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
table.table th {
    text-align: left;
    font-size: 9.8px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--faint);
    font-weight: 750;
    padding: 9px 12px;
    background: var(--surface-soft);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
table.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 12px; vertical-align: middle; }
table.table tr:last-child td { border-bottom: 0; }
table.table tbody tr:hover { background: #fcfbfe; }
table.table th.num, table.table td.num { text-align: right; }
.table-compact td { padding: 8px 10px !important; }
.table-compact th { padding: 7px 10px !important; }
.cell-title { font-weight: 650; font-size: 12px; line-height: 1.3; display: flex; align-items: center; gap: 7px; }
.cell-sub { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.cell-stack { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cell-stack .cell-body { min-width: 0; }
.row-actions { display: flex; align-items: center; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.row-alert { background: #fffaf3; }
.row-overdue { background: #fff8f7; }
.table-empty { padding: 26px 16px; text-align: center; color: var(--muted); font-size: 12px; }
.table-note { padding: 9px 16px; border-top: 1px solid var(--border); font-size: 10.5px; color: var(--muted); background: var(--surface-soft); }

.filters {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.filters .search { position: relative; flex: 1; min-width: 190px; max-width: 340px; }
.filters .search .icon { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.filters .search input { padding-left: 31px; height: 32px; }
.filters select, .filters input[type="month"] { height: 32px; padding: 0 9px; border: 1px solid var(--border-strong); border-radius: 7px; background: var(--surface); font-size: 11.5px; }
.filter-spacer { flex: 1; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 10.8px; font-weight: 650; color: var(--text-soft); }
.field input, .field select, .field textarea {
    width: 100%;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    border-radius: 7px;
    min-height: 36px;
    padding: 7px 9px;
    font-size: 12.5px;
    outline: none;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.field textarea { min-height: 70px; resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(109, 40, 217, .1); }
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.field .hint { font-size: 10px; color: var(--muted); line-height: 1.4; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.field-span-2 { grid-column: span 2; }
.field-span-3 { grid-column: span 3; }
.checkbox { display: flex; align-items: flex-start; gap: 8px; font-size: 11.5px; color: var(--text-soft); line-height: 1.4; }
.checkbox input { width: 15px; height: 15px; margin: 1px 0 0; accent-color: var(--purple); }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.inline-note { display: flex; align-items: flex-start; gap: 6px; font-size: 10.5px; line-height: 1.5; color: var(--muted); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px; }
.inline-note .icon { color: var(--purple); margin-top: 1px; }
.callout {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    border: 1px solid var(--purple-line);
    background: #fbf8ff;
    border-radius: 9px;
    padding: 10px 12px;
    font-size: 11.5px;
    color: var(--text-soft);
    line-height: 1.5;
}
.callout .icon { color: var(--purple); margin-top: 1px; }
.callout-warning { border-color: #f3d49b; background: #fff9ed; color: #6c4308; }
.callout-warning .icon { color: var(--warning); }
.callout-danger { border-color: #f4c4c0; background: #fff7f6; color: #7a1a12; }
.callout-danger .icon { color: var(--danger); }

.modal {
    border: 0;
    padding: 0;
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    width: min(590px, calc(100vw - 28px));
    max-height: min(88vh, 860px);
    box-shadow: var(--shadow-modal);
    overflow: hidden;
}
.modal[open] { display: flex; flex-direction: column; }
.modal::backdrop { background: rgba(20, 15, 32, .42); backdrop-filter: blur(2px); }
.modal form { display: flex; flex-direction: column; min-height: 0; max-height: inherit; }
.modal-head { padding: 17px 18px 13px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 12px; }
.modal-head h2 { font-size: 17px; letter-spacing: -.015em; }
.modal-head p { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.modal-body { padding: 16px 18px; overflow: auto; min-height: 0; }
.modal-actions { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-soft); flex-wrap: wrap; }
.wa-modal { width: min(620px, calc(100vw - 28px)); }

.empty-state { display: flex; align-items: center; gap: 12px; padding: 22px; border: 1px dashed var(--border-strong); border-radius: 10px; color: var(--muted); background: var(--surface-soft); }
.empty-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; color: var(--purple); flex: 0 0 auto; }
.empty-state strong { display: block; font-size: 12.5px; color: var(--text-soft); }
.empty-state p { font-size: 11.5px; margin-top: 2px; max-width: 480px; }
.empty-state .btn { margin-left: auto; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab { padding: 9px 12px; font-size: 11.5px; font-weight: 650; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--purple); border-bottom-color: var(--purple); }
.tab .count { background: var(--surface-muted); color: var(--muted); border-radius: 999px; padding: 0 6px; height: 17px; display: inline-flex; align-items: center; font-size: 9.5px; }
.tab.active .count { background: var(--purple-soft); color: var(--purple); }

.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 22px 0 10px; }
.section-title h2 { font-size: 14px; font-weight: 700; }
.section-title p { color: var(--muted); font-size: 11px; }
.section-title .actions { display: flex; gap: 6px; align-items: center; }

.detail-hero { display: flex; align-items: center; gap: 12px; }
.detail-hero h1 { font-size: 21px; letter-spacing: -.02em; }
.detail-hero .detail-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; }
.meta-row { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.meta-row > span { font-size: 9.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-weight: 700; }
.meta-row > strong, .meta-row > a { font-size: 12px; font-weight: 600; word-break: break-word; }
.meta-row > .muted { color: var(--muted); font-weight: 500; }
.meta-list { display: flex; flex-direction: column; gap: 9px; }
.meta-list .meta-row { flex-direction: row; justify-content: space-between; gap: 10px; align-items: baseline; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.meta-list .meta-row:last-child { border-bottom: 0; padding-bottom: 0; }
.meta-list .meta-row > span { text-transform: none; letter-spacing: 0; font-size: 11px; color: var(--muted); font-weight: 550; }
.meta-list .meta-row > strong { font-size: 12px; text-align: right; }

.timeline { position: relative; display: flex; flex-direction: column; gap: 0; }
.timeline-item { position: relative; padding: 0 0 14px 18px; border-left: 1px solid var(--border); margin-left: 5px; }
.timeline-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; left: -4px; top: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--purple); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--purple-line); }
.timeline-item strong { display: block; font-size: 11.5px; font-weight: 650; }
.timeline-item p { font-size: 10.8px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.timeline-time { font-size: 9.5px; color: var(--faint); margin-top: 3px; }

.bar-chart { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) 74px; align-items: center; gap: 9px; }
.bar-label { font-size: 11px; color: var(--text-soft); }
.bar-value { font-size: 11px; color: var(--text-soft); text-align: right; font-variant-numeric: tabular-nums; }
.month-bars { display: flex; align-items: flex-end; gap: 8px; height: 130px; padding-top: 8px; }
.month-bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px; height: 100%; }
.month-bar-fill { width: 100%; max-width: 38px; background: var(--purple); border-radius: 5px 5px 2px 2px; min-height: 2px; }
.month-bar-fill.muted { background: #cabbe8; }
.month-bar-label { font-size: 9.5px; color: var(--faint); }
.month-bar-value { font-size: 9px; color: var(--muted); white-space: nowrap; }

.score-card { text-align: center; padding: 6px 0 2px; }
.score-big { font-size: 38px; font-weight: 750; letter-spacing: -.04em; line-height: 1; }
.score-big span { font-size: 15px; color: var(--faint); font-weight: 600; letter-spacing: 0; }
.score-tier { margin-top: 6px; display: inline-flex; }
.score-breakdown { display: flex; flex-direction: column; gap: 9px; margin-top: 14px; text-align: left; }
.score-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) 38px; align-items: center; gap: 8px; }
.score-row-label { font-size: 10.5px; color: var(--muted); }
.score-row-points { font-size: 10.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.score-why { font-size: 9.8px; color: var(--faint); grid-column: 2 / 4; margin-top: -4px; }
.score-meter { height: 6px; border-radius: 99px; background: var(--surface-muted); overflow: hidden; }

.template-card { border: 1px solid var(--border); border-radius: 10px; padding: 13px; background: var(--surface); }
.template-card + .template-card { margin-top: 10px; }
.template-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.template-head strong { font-size: 12px; }
.template-head code { font-size: 10px; color: var(--purple); background: var(--purple-soft); padding: 2px 5px; border-radius: 4px; }
.template-card textarea { width: 100%; border: 1px solid var(--border-strong); border-radius: 7px; padding: 8px 9px; font-size: 12px; min-height: 92px; resize: vertical; line-height: 1.5; }
.placeholder-list { display: flex; flex-wrap: wrap; gap: 5px; }
.placeholder-list code { font-size: 10px; background: var(--surface-muted); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; color: var(--text-soft); }

.data-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.data-step { border: 1px solid var(--border); border-radius: 9px; padding: 10px; background: var(--surface-soft); }
.data-step span { display: inline-flex; width: 19px; height: 19px; border-radius: 50%; background: var(--purple-soft); color: var(--purple); align-items: center; justify-content: center; font-size: 10px; font-weight: 750; }
.data-step strong { display: block; font-size: 11.5px; margin-top: 6px; }
.data-step p { font-size: 10.5px; color: var(--muted); margin-top: 2px; }

.import-box { border: 1px dashed var(--border-strong); border-radius: 10px; padding: 14px; background: var(--surface-soft); }
.import-box input[type=file] { width: 100%; font-size: 11.5px; padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 7px; }
.preview-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.preview-pill { border: 1px solid var(--border); border-radius: 7px; padding: 5px 9px; font-size: 10.5px; background: var(--surface-soft); }
.preview-pill strong { font-size: 12px; }
.issue-list { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow: auto; }
.issue { display: flex; gap: 8px; align-items: flex-start; padding: 8px 9px; border: 1px solid var(--border); border-radius: 7px; font-size: 10.8px; background: var(--surface); }
.issue-row { font-size: 9.5px; color: var(--faint); white-space: nowrap; font-weight: 650; }
.issue-high { border-left: 3px solid var(--danger); }
.issue-medium { border-left: 3px solid var(--warning); }
.issue-info { border-left: 3px solid var(--info); }

.flag-item { display: flex; gap: 9px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.flag-item:last-child { border-bottom: 0; padding-bottom: 0; }
.flag-icon { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; flex: 0 0 auto; }
.flag-icon-high { background: var(--danger-bg); color: var(--danger); }
.flag-icon-medium { background: var(--warning-bg); color: var(--warning); }
.flag-body { min-width: 0; flex: 1; }
.flag-body strong { font-size: 11.5px; }
.flag-body p { font-size: 10.5px; color: var(--muted); margin-top: 1px; line-height: 1.45; }
.flag-actions { display: flex; gap: 5px; align-items: center; margin-top: 5px; }
.flag-link { font-size: 10.5px; font-weight: 650; }

.danger-zone { border-color: #f4c4c0; background: #fffafa; }
.danger-zone .card-head { border-bottom-color: #f4d5d2; }

.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.toggle-row:last-child { border-bottom: 0; padding-bottom: 0; }

.mini-stat { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.mini-stat:last-child { border-bottom: 0; }
.mini-stat span { font-size: 11px; color: var(--muted); }
.mini-stat strong { font-size: 12px; }

.chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border); background: var(--surface-soft); border-radius: 6px; padding: 2px 7px; font-size: 10px; color: var(--text-soft); }
.chip-purple { border-color: var(--purple-line); background: var(--purple-soft); color: var(--purple); }
.chip-danger { border-color: #f4c4c0; background: var(--danger-bg); color: var(--danger); }
.chip-warning { border-color: #f3d49b; background: var(--warning-bg); color: var(--warning); }

.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 10px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend i { width: 7px; height: 7px; border-radius: 2px; display: inline-block; }

@media (max-width: 1320px) {
    .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .content { padding: 22px 22px 32px; }
}
@media (max-width: 1120px) {
    .dash-grid, .split-main { grid-template-columns: 1fr; }
    .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        transition: transform .18s ease;
        box-shadow: var(--shadow-modal);
        width: 250px;
        flex-basis: 250px;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(20,15,32,.36); z-index: 35; }
    .sidebar-overlay.open { display: block; }
    .mobile-close { display: inline-flex; }
    .menu-toggle { display: inline-flex; }
    .topbar { padding: 0 16px; }
    .content { padding: 18px 16px 28px; }
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .data-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .focus-grid { grid-template-columns: 1fr; }
    .grid-2, .grid-3, .split-even { grid-template-columns: 1fr; }
    .page-head { flex-direction: column; gap: 10px; }
    .page-head-actions { justify-content: flex-start; padding-top: 0; }
    .page-head h1 { font-size: 22px; }
    .app-footer { flex-direction: column; gap: 3px; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid-3 { grid-template-columns: 1fr; }
    .field-span-2, .field-span-3 { grid-column: auto; }
    .meta-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    body { font-size: 13px; }
    .topbar-date { display: none; }
    .topbar { height: 56px; flex-basis: 56px; }
    .content { padding: 15px 12px 24px; }
    .kpi-grid { gap: 8px; }
    .kpi { padding: 11px; }
    .kpi-value { font-size: 20px; }
    .kpi-label { font-size: 10px; }
    .kpi-icon { width: 24px; height: 24px; }
    .kpi-icon .icon { width: 15px; height: 15px; }
    .kpi-sub { font-size: 9.7px; }
    .focus-panel { padding: 12px; }
    .focus-head { flex-direction: column; gap: 4px; }
    .card-head { padding: 12px; }
    .card-body { padding: 12px; }
    .table-wrap { margin: 0 -12px; width: calc(100% + 24px); }
    table.table th, table.table td { padding: 8px 10px; }
    .page-head h1 { font-size: 21px; }
    .page-head p { font-size: 12px; }
    .modal-head, .modal-body, .modal-actions { padding-left: 14px; padding-right: 14px; }
    .btn .btn-label-hide { display: none; }
    .topbar-actions .btn-primary { padding: 0 9px; }
    .login-shell { display: block; }
    .login-brand { display: none; }
    .login-main { min-height: 100vh; padding: 24px 16px; }
    .login-form-wrap { max-width: 420px; }
    .grid-4 { grid-template-columns: 1fr; }
    .data-steps { grid-template-columns: 1fr; }
    .filters { padding: 9px; }
    .filters .search { max-width: none; }
}

.login-body { background: var(--surface); min-height: 100vh; }
.login-shell { display: grid; grid-template-columns: minmax(420px, 44%) minmax(0, 1fr); min-height: 100vh; }
.login-brand {
    background: #201631;
    color: #fff;
    padding: 26px 34px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}
.login-brand::after {
    content: "";
    position: absolute;
    width: 420px;
    height: 420px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 50%;
    right: -180px;
    bottom: -170px;
    pointer-events: none;
}
.login-brand-top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.brand-on-dark .brand-mark { background: #fff; color: #201631; }
.brand-on-dark .brand-copy strong { color: #fff; }
.brand-on-dark .brand-copy span { color: rgba(255,255,255,.55); }
.login-phase { font-size: 10px; border: 1px solid rgba(255,255,255,.18); padding: 3px 8px; border-radius: 999px; color: rgba(255,255,255,.7); letter-spacing: .04em; }
.login-copy { position: relative; z-index: 1; max-width: 460px; margin: 36px 0; }
.eyebrow-on-dark { color: #c4a8f7; }
.login-copy h1 { font-size: clamp(30px, 3.5vw, 46px); line-height: 1.08; letter-spacing: -.035em; font-weight: 700; margin-top: 8px; }
.login-copy > p { color: rgba(255,255,255,.67); font-size: 13.5px; line-height: 1.6; margin-top: 14px; max-width: 400px; }
.login-points { list-style: none; margin-top: 26px; display: flex; flex-direction: column; gap: 11px; }
.login-points li { display: flex; align-items: flex-start; gap: 9px; color: rgba(255,255,255,.78); font-size: 12px; line-height: 1.45; }
.login-points .icon { color: #a98af0; margin-top: 1px; }
.login-brand-foot { display: flex; justify-content: space-between; gap: 10px; color: rgba(255,255,255,.42); font-size: 10px; border-top: 1px solid rgba(255,255,255,.1); padding-top: 14px; position: relative; z-index: 1; }
.login-main { display: flex; align-items: center; justify-content: center; padding: 30px; }
.login-form-wrap { width: 100%; max-width: 400px; }
.login-mobile-brand { display: none; align-items: center; gap: 9px; margin-bottom: 28px; }
.login-mobile-brand span { display: block; font-size: 11px; color: var(--muted); }
.login-form-wrap h2 { font-size: 24px; letter-spacing: -.025em; margin-top: 6px; }
.login-sub { font-size: 12px; color: var(--muted); line-height: 1.55; margin-top: 6px; }
.login-form { margin-top: 20px; display: flex; flex-direction: column; gap: 12px; }
.login-form .field input { height: 41px; font-size: 13px; }
.login-form .btn { height: 41px; margin-top: 3px; }
.demo-access { border: 1px solid var(--border); background: var(--surface-soft); border-radius: 10px; padding: 12px; margin-top: 18px; }
.demo-access-head { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--text-soft); margin-bottom: 8px; }
.demo-access-head .icon { color: var(--purple); }
.demo-access > div:not(.demo-access-head) { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 11px; }
.demo-access > div span { color: var(--muted); }
.demo-access code { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; font-size: 10.5px; }
.demo-access p { font-size: 10.5px; color: var(--muted); line-height: 1.45; margin-top: 7px; border-top: 1px solid var(--border); padding-top: 7px; }
.login-foot { display: flex; justify-content: space-between; gap: 10px; color: var(--faint); font-size: 9.8px; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--border); }
.login-foot span { display: flex; align-items: center; gap: 4px; }
@media (max-width: 860px) {
    .login-shell { display: block; }
    .login-brand { display: none; }
    .login-main { min-height: 100vh; padding: 28px 18px; }
    .login-mobile-brand { display: flex; }
    .login-form-wrap { max-width: 420px; }
    .login-foot { flex-direction: column; gap: 6px; }
}

.stage-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.stage-stat { display: block; border: 1px solid var(--border); border-radius: 9px; padding: 10px; background: var(--surface-soft); color: inherit; min-width: 0; }
.stage-stat:hover { border-color: var(--border-strong); color: inherit; }
.stage-stat.active { border-color: var(--purple-line); background: var(--purple-soft); }
.stage-stat-head { font-size: 10px; font-weight: 650; color: var(--text-soft); display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-stat strong { display: block; font-size: 15px; margin-top: 5px; letter-spacing: -.015em; font-variant-numeric: tabular-nums; }
.stage-stat > span { display: block; font-size: 9.5px; color: var(--muted); margin: 1px 0 6px; }
.stage-stat .bar-track { height: 4px; }
.stage-form { display: flex; align-items: center; gap: 3px; }
.stage-form select { height: 30px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); font-size: 11px; padding: 0 5px; max-width: 118px; }
.stage-save { width: 25px; height: 25px; color: var(--purple); }
.stage-save:hover { background: var(--purple-soft); }
.hidden { display: none !important; }
@media (max-width: 1120px) {
    .stage-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .stage-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.whatsapp-preview { background: #f2fbf5; border: 1px solid #cdebd7; border-radius: 9px; padding: 11px 12px; font-size: 12px; line-height: 1.55; color: #204d32; white-space: normal; }

.row-muted td { opacity: .68; }


/* --- Sales Hub: reports, settings, follow-ups --- */
.split-wide { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, .85fr); gap: 14px; align-items: start; }
.report-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 14px; align-items: start; }
.field small, .field .hint { font-size: 10px; color: var(--muted); line-height: 1.4; }
.field-inline { flex-direction: row; align-items: center; gap: 8px; }
.field-inline > span { white-space: nowrap; }
.field-inline input { width: auto; min-width: 150px; }
.demo-pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--purple-line); background: var(--purple-soft); color: var(--purple); border-radius: 999px; padding: 5px 10px; font-size: 10.5px; font-weight: 650; white-space: nowrap; }
.tabs { margin-bottom: 14px; }
.tab.active { color: var(--purple); border-bottom-color: var(--purple); }
.tab .count { background: var(--surface-muted); color: var(--muted); border-radius: 999px; padding: 0 6px; height: 17px; display: inline-flex; align-items: center; font-size: 9.5px; }
.tab.active .count { background: var(--purple-soft); color: var(--purple); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; background: var(--surface-muted); border-radius: 4px; padding: 1px 5px; }
.template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 16px; }
.template-card { border: 1px solid var(--border); border-radius: 10px; padding: 13px; background: var(--surface-soft); display: flex; flex-direction: column; gap: 8px; }
.template-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.template-head h3 { font-size: 14px; margin-top: 2px; }
.template-card textarea { width: 100%; border: 1px solid var(--border-strong); border-radius: 7px; padding: 8px 9px; font-size: 11.5px; line-height: 1.55; resize: vertical; background: var(--surface); outline: none; }
.template-card textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(109, 40, 217, .1); }
.template-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 10px; color: var(--faint); }
.score-preview-list { display: flex; flex-direction: column; }
.score-preview-item { padding: 11px 0; border-bottom: 1px solid var(--border); }
.score-preview-item:last-child { border-bottom: 0; padding-bottom: 0; }
.score-preview-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.score-breakdown { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 7px; font-size: 9.8px; color: var(--muted); }
.score-breakdown strong { color: var(--text-soft); }
.import-hints { display: flex; flex-direction: column; gap: 5px; margin-top: 12px; border: 1px solid var(--border); background: var(--surface-soft); border-radius: 8px; padding: 10px 12px; font-size: 10.5px; color: var(--muted); line-height: 1.5; }
.import-hints strong { color: var(--text-soft); }
.flag-list { display: flex; flex-direction: column; }
.flag-item { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.flag-item:first-child { padding-top: 0; }
.flag-item:last-child { border-bottom: 0; padding-bottom: 0; }
.flag-item.is-resolved { opacity: .55; }
.flag-main { display: flex; gap: 8px; align-items: flex-start; min-width: 0; }
.preview-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-soft); }
.preview-meta div { min-width: 0; }
.preview-meta span { display: block; font-size: 9.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-weight: 700; }
.preview-meta strong { display: block; font-size: 11px; margin-top: 3px; word-break: break-word; }
.export-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; padding: 16px; }
.export-link { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-radius: 9px; padding: 11px 12px; color: var(--text-soft); background: var(--surface-soft); transition: border-color .12s ease, background .12s ease; }
.export-link:hover { border-color: var(--purple-line); background: var(--purple-soft); color: var(--purple); }
.export-link strong { display: block; font-size: 12px; color: var(--text); }
.export-link span { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.export-link .icon { color: var(--purple); margin-top: 1px; }
.account-box { margin-top: 14px; border: 1px solid var(--border); border-radius: 9px; padding: 11px 12px; background: var(--surface-soft); }
.account-box strong { display: block; font-size: 13px; margin-top: 2px; }
.account-box span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.clean-list { list-style: none; display: flex; flex-direction: column; gap: 7px; font-size: 11.5px; color: var(--text-soft); line-height: 1.5; }
.clean-list li { position: relative; padding-left: 14px; }
.clean-list li::before { content: ""; position: absolute; left: 1px; top: 6px; width: 5px; height: 5px; border-radius: 50%; background: var(--purple); opacity: .6; }
.limitation-list li::before { background: var(--warning); }
.limitation-list strong { color: var(--text); }
.link-arrow { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 650; white-space: nowrap; }
.empty-hero { max-width: 620px; margin: 7vh auto; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 40px 26px; }
.empty-hero-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 14px; background: var(--purple-soft); color: var(--purple); display: grid; place-items: center; }
.empty-hero h1 { font-size: 23px; letter-spacing: -.02em; margin: 4px 0 7px; }
.empty-hero p { font-size: 12.5px; color: var(--muted); margin-bottom: 18px; }
.empty-hero .page-head-actions { justify-content: center; }
.report-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 16px; flex-wrap: wrap; }
.report-stamp { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.report-stamp .icon { color: var(--purple); }
.mini-chart { display: flex; align-items: flex-end; gap: 10px; padding: 20px 16px 14px; height: 200px; }
.mini-bar { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; }
.mini-bar-value { font-size: 9.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mini-bar-track { flex: 1; width: 100%; max-width: 52px; display: flex; align-items: flex-end; background: var(--surface-muted); border-radius: 6px; overflow: hidden; }
.mini-bar-fill { width: 100%; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, #8b5cf6, var(--purple)); min-height: 3px; }
.mini-bar-label { font-size: 10px; color: var(--muted); font-weight: 600; }
.bar-list { display: flex; flex-direction: column; gap: 11px; padding: 14px 16px 16px; }
.bar-row-head { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; margin-bottom: 4px; }
.bar-row-head span { color: var(--text-soft); }
.bar-row-head strong { font-variant-numeric: tabular-nums; }
.metric-stack { display: flex; flex-direction: column; }
.metric-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 11.5px; }
.metric-line:last-child { border-bottom: 0; }
.metric-line span { color: var(--muted); }
.metric-line strong { font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; }
.winloss { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 14px 16px; }
.winloss-side { border-radius: 10px; padding: 12px; text-align: center; }
.winloss-win { background: var(--success-bg); color: var(--success); }
.winloss-loss { background: var(--danger-bg); color: var(--danger); }
.winloss-value { font-size: 27px; font-weight: 750; letter-spacing: -.03em; line-height: 1.1; margin: 2px 0; }
.winloss-side .cell-sub { color: inherit; opacity: .8; }
.winloss-divider { text-align: center; min-width: 66px; }
.winloss-divider span { display: block; font-size: 17px; font-weight: 750; color: var(--purple); }
.winloss-divider small { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.report-questions { border-top: 1px solid var(--border); padding: 12px 16px 14px; }
.report-questions .eyebrow { margin-bottom: 6px; }
.definition-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.definition-grid > div { background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 11px 12px; }
.definition-grid strong { display: block; font-size: 12px; margin: 3px 0 3px; }
.definition-grid span { display: block; font-size: 10.5px; color: var(--muted); line-height: 1.45; }
@media (max-width: 1120px) {
    .definition-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
    .split-wide, .report-grid { grid-template-columns: 1fr; }
    .export-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
    .template-grid { grid-template-columns: 1fr; }
    .preview-meta { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .export-grid { grid-template-columns: 1fr; }
    .definition-grid { grid-template-columns: 1fr; }
    .mini-chart { height: 170px; gap: 5px; padding-left: 12px; padding-right: 12px; }
    .mini-bar-value { font-size: 8.5px; }
    .report-toolbar { padding: 10px 12px; }
    .field-inline { flex-direction: column; align-items: stretch; }
    .field-inline input { width: 100%; }
}
@media print {
    .sidebar, .topbar, .app-footer, .no-print, .page-head-actions, .tabs { display: none !important; }
    .app-shell, .main { display: block !important; }
    .content { padding: 0 !important; max-width: none !important; }
    body { background: #fff; }
    .card { box-shadow: none; break-inside: avoid; }
}

.amc-actions { flex-wrap: nowrap; }
.project-actions { flex-wrap: nowrap; }
.row-actions form { display: inline-flex; }


@media (max-width: 700px) {
    [data-page="followups"] .table-wrap { overflow: visible; margin: 0; width: 100%; }
    [data-page="followups"] table.table,
    [data-page="followups"] table.table tbody { display: block; width: 100%; }
    [data-page="followups"] table.table thead { display: none; }
    [data-page="followups"] table.table tbody tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px 10px;
        padding: 12px;
        border-bottom: 1px solid var(--border);
        background: var(--surface);
    }
    [data-page="followups"] table.table tbody tr:last-child { border-bottom: 0; }
    [data-page="followups"] table.table tbody tr.row-overdue { background: #fff8f7; }
    [data-page="followups"] table.table tbody tr.row-muted { opacity: 1; }
    [data-page="followups"] table.table tbody tr.row-muted td { opacity: .65; }
    [data-page="followups"] table.table td {
        display: block;
        padding: 0 !important;
        border: 0;
        min-width: 0;
        vertical-align: top;
    }
    [data-page="followups"] table.table td:nth-child(1) { grid-column: 1 / -1; }
    [data-page="followups"] table.table td:nth-child(2) { grid-column: 1 / -1; padding-bottom: 2px !important; }
    [data-page="followups"] table.table td:nth-child(3) { grid-column: 1; }
    [data-page="followups"] table.table td:nth-child(4) { grid-column: 2; justify-self: end; }
    [data-page="followups"] table.table td:nth-child(5) { grid-column: 1; }
    [data-page="followups"] table.table td:nth-child(6) { grid-column: 1 / -1; padding-top: 5px !important; }
    [data-page="followups"] table.table td:nth-child(6) .row-actions { justify-content: flex-start; flex-wrap: wrap; }
    [data-page="followups"] table.table td:nth-child(6) .row-actions form { display: inline-flex; }
}
