:root {
  --navy: #0b1b2b; --navy2: #17375e; --lime: #9be22e; --lime-d: #6fae0c;
  --bg: #f2f5f9; --card: #fff; --line: #dde4ee; --soft: #e8eef6; --ink: #142233; --muted: #5d6b7c;
  --red: #c62828; --amber: #b26a00; --amber-bg: #fff6e5; --radius: 12px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 15px; line-height: 1.45; }
a { color: var(--navy2); }
h1 { font-size: 1.45rem; margin: 0 0 .35rem; }
h2 { font-size: 1.15rem; margin: 0 0 .5rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 18px 20px 60px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.err { color: var(--red); min-height: 1.2em; margin: .2rem 0; }
.red-text { color: var(--red); font-weight: 600; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* header */
.top { display: flex; align-items: center; gap: 22px; padding: 10px 20px; background: var(--navy); color: #fff; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; }
.logo { background: var(--lime); color: var(--navy); font-weight: 800; font-size: 1.35rem; padding: 2px 12px 4px; border-radius: 9px; letter-spacing: -.5px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text small { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; opacity: .75; font-weight: 600; }
.top nav { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.top nav a { color: #dfe8f2; text-decoration: none; padding: 8px 14px; border-radius: 8px; font-weight: 600; }
.top nav a:hover { background: rgba(255, 255, 255, .08); }
.top nav a.on { background: var(--lime); color: var(--navy); }
.who { display: flex; align-items: center; gap: 12px; }
.me { color: #fff; text-decoration: none; display: flex; flex-direction: column; line-height: 1.15; font-weight: 600; }
.me small { opacity: .7; font-weight: 400; font-size: .78rem; }
.lang { display: inline-flex; border: 1px solid rgba(255, 255, 255, .35); border-radius: 8px; overflow: hidden; }
.lang button { background: transparent; color: inherit; border: 0; border-radius: 0; padding: 5px 9px; font-weight: 700; }
.lang button.on { background: var(--lime); color: var(--navy); }
.top .ghost { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .35); }
.concept { background: var(--amber-bg); border-bottom: 1px solid #f1dfb8; color: #6b4b00; padding: 7px 20px; font-size: .85rem; text-align: center; }

/* cards + layout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin: 16px 0; }
.card.narrow { max-width: 520px; }
.grid2, .grid3 { display: grid; gap: 12px 18px; margin: 10px 0; }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 820px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; margin-top: 14px; }
.wrap-row { flex-wrap: wrap; }
label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: .88rem; color: #2a3f57; }
label.inline { flex-direction: row; align-items: center; gap: 8px; }
label.check { flex-direction: row; align-items: center; gap: 6px; font-weight: 600; }
input, select, textarea { font: inherit; padding: 9px 11px; border: 1px solid #c7d2df; border-radius: 9px; background: #fff; color: var(--ink); min-width: 0; }
input:focus, select:focus, textarea:focus, button:focus-visible, .btn:focus-visible { outline: 3px solid rgba(155, 226, 46, .6); outline-offset: 1px; border-color: var(--navy2); }
input[readonly] { background: var(--soft); }

/* buttons */
button, .btn { font: inherit; font-weight: 700; padding: 9px 16px; border-radius: 9px; border: 1px solid transparent; background: var(--soft); color: var(--navy2); cursor: pointer; text-decoration: none; display: inline-block; white-space: nowrap; }
button:hover, .btn:hover { filter: brightness(.97); }
button:disabled { opacity: .5; cursor: not-allowed; }
.primary { background: var(--navy2); color: #fff; }
.danger { background: #fdecec; color: var(--red); }
button.danger:not(:disabled):hover { background: var(--red); color: #fff; }
.small { font-size: .85rem; }
button.small, .btn.small { padding: 5px 11px; }
.wide { width: 100%; }

/* notices + badges */
.notice { background: var(--amber-bg); border-left: 4px solid #e0a43a; padding: 10px 14px; border-radius: 6px; margin: 12px 0; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--soft); font-size: .78rem; font-weight: 700; color: var(--navy2); white-space: nowrap; }
.badge.red { background: #fdecec; color: var(--red); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.stage { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; background: var(--soft); color: var(--navy2); }
.s-disco { background: #e3f0ff; } .s-proposal { background: #ede4ff; color: #4b2a91; } .s-verbal { background: #fff1d6; color: #8a5300; }
.s-won { background: var(--lime); color: var(--navy); } .s-lost { background: #eceff3; color: #6b7785; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
@media (max-width: 1000px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; border-top: 4px solid var(--lime); }
.kpi b { display: block; font-size: 1.7rem; color: var(--navy2); line-height: 1.2; }
.kpi span { color: var(--muted); font-size: .85rem; }
.kpi.red { border-top-color: var(--red); } .kpi.red b { color: var(--red); }

/* tables */
.scroll { overflow: visible; }
/* Tables always fit the card: fixed layout + % colgroups; content wraps inside its cell, never past it. */
.tbl { width: 100%; border-collapse: collapse; table-layout: fixed; }
.tbl td, .tbl th { overflow-wrap: anywhere; word-break: normal; }
.tbl .badge, .tbl .stage { white-space: normal; max-width: 100%; }
.tbl th { background: var(--soft); text-align: left; font-size: .82rem; color: #2a3f57; padding: 9px 10px; vertical-align: bottom; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.total td { font-weight: 800; background: var(--soft); }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: #f7fbef; }
.tbl.dense td, .tbl.dense th { padding: 7px 6px; font-size: .82rem; }
.actions { display: flex; flex-direction: column; gap: 4px; } .actions > * { text-align: center; white-space: normal; }
.barcol { width: 140px; }
.bar { height: 10px; background: var(--soft); border-radius: 99px; overflow: hidden; margin-top: 5px; }
.bar i { display: block; height: 100%; background: var(--lime-d); }

/* find prospects */
.cand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 12px; }
.cand { text-align: left; background: #e6edf6; color: var(--navy2); padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; white-space: normal; }
.cand small { font-weight: 500; color: var(--muted); }
.cand.open:hover { background: #d6e3f2; }
.cand.picked { background: var(--navy2); color: #fff; } .cand.picked small { color: #cfe0f3; }
.cand:disabled { background: #f3f6fa; color: #9aa7b6; opacity: 1; }
.cand.mine:disabled { background: #eef8de; color: #4d7a0a; }
.roles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 8px 0 4px; }
@media (max-width: 820px) { .roles { grid-template-columns: 1fr; } }
.role { background: #e6edf6; white-space: normal; } .role.on { background: var(--navy2); color: #fff; }

/* sequence */
.seq { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.touch { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: #f3f6fa; border-left: 5px solid var(--navy2); border-radius: 6px; padding: 12px 16px; }
.touch.done { border-left-color: var(--lime-d); background: #f4faea; }
.touch.late { border-left-color: var(--red); background: #fff5f5; }
.touch.stopped { opacity: .6; border-left-color: #a8b3c0; }
pre.draft { white-space: pre-wrap; font-family: inherit; background: #f6f8fb; border: 1px solid var(--line); border-radius: 8px; padding: 14px; max-height: 50vh; overflow: auto; }
.hist { margin: 0; padding-left: 18px; } .hist li { margin: 4px 0; }

/* modal + toast */
.modal-wrap { position: fixed; inset: 0; background: rgba(11, 27, 43, .5); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: var(--radius); padding: 22px; width: min(640px, 100%); max-height: 90vh; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 10px; z-index: 60; box-shadow: 0 6px 24px rgba(0, 0, 0, .2); }
.toast.bad { background: var(--red); }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(1200px 600px at 80% 20%, rgba(155, 226, 46, .18), transparent 60%), linear-gradient(135deg, #07121d, #17375e); }
.login-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 12px; padding: 30px; }
.brand.big .logo { font-size: 1.8rem; }
.brand.big .brand-text { color: var(--navy); }
.tag { font-size: 1.5rem; font-weight: 900; text-transform: uppercase; font-style: italic; letter-spacing: -.5px; margin: 6px 0; color: var(--navy); }
.tag em { color: var(--lime-d); }
.login .lang { border-color: var(--line); align-self: center; }
.login .lang button { color: var(--navy2); padding: 5px 12px; }

.card .row + h2 { margin-top: 18px; }
.badge.green { background: #eef8de; color: #4d7a0a; }
.tbl tr.inactive td { color: #9aa7b6; }
pre.temp { font-family: Consolas, "Courier New", monospace; font-size: 1.25rem; text-align: center; letter-spacing: .5px; }
.actions.h { flex-direction: row; flex-wrap: wrap; }

/* admin + prospecting */
.subtabs { display: flex; gap: 6px; margin: 4px 0 0; flex-wrap: wrap; }
.subtabs a { padding: 7px 14px; border-radius: 8px; background: var(--soft); color: var(--navy2); text-decoration: none; font-weight: 700; }
.subtabs a.on { background: var(--navy2); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.chip { padding: 3px 10px; font-size: .82rem; border-radius: 999px; background: #eef8de; color: #4d7a0a; }
.chip-check { background: var(--soft); padding: 5px 11px; border-radius: 999px; font-weight: 600; }
fieldset.radio { border: 1px solid var(--line); border-radius: 9px; padding: 8px 14px 12px; margin: 10px 0; }
fieldset.radio legend { font-weight: 700; font-size: .88rem; color: #2a3f57; padding: 0 4px; }
textarea.mono, .mono, code { font-family: Consolas, "Courier New", monospace; font-size: .82rem; }
code { background: var(--soft); padding: 1px 6px; border-radius: 5px; }
details { margin: 10px 0; } summary { cursor: pointer; font-weight: 700; color: var(--navy2); }
.badge.src { background: #e3f0ff; color: #1d4f91; }
.badge.av-open { background: #eef8de; color: #4d7a0a; } .badge.av-added { background: var(--navy2); color: #fff; }
.badge.av-advertising, .badge.av-assigned { background: #f3f6fa; color: #7b8794; } .badge.av-mine { background: #fff6e5; color: var(--amber); }
.bar.wide { height: 8px; margin: 6px 0 14px; }
.funnel { display: flex; align-items: stretch; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.fstep { flex: 1; min-width: 110px; background: var(--soft); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; border-top: 4px solid var(--navy2); }
.fstep b { font-size: 1.45rem; color: var(--navy2); } .fstep span { font-size: .82rem; color: var(--muted); } .fstep small { font-weight: 700; color: var(--lime-d); }
.fstep.sold { border-top-color: var(--lime); }
.farrow { align-self: center; font-style: normal; font-size: 1.4rem; color: #9aa7b6; }
.modal textarea { resize: vertical; }
