:root {
  --teal: #0F9D8C; --deep: #1D5C63; --navy: #14213D; --coral: #E85D75; --amber: #D98A1F;
  --bg: #F3F6F7; --card: #FFFFFF; --text: #14213D; --muted: #5B6679; --line: #E1E7EA;
  --primary: #1D5C63; --on-primary: #FFFFFF; --accent: #0F9D8C;
  --chip: #E8F1F2; --danger: #C2415A;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0C1424; --card: #16213A; --text: #EAF0F4; --muted: #9BA8BB; --line: #26334F;
    --primary: #0F9D8C; --on-primary: #08201E; --accent: #3CC3B2;
    --chip: #1F2D49; --danger: #F0788E;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); min-height: 100vh; }
h1 { font-size: 22px; margin: 0; } h2 { font-size: 15px; margin: 0 0 8px; color: var(--muted); font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
main { max-width: 640px; margin: 0 auto; padding: 16px 16px 24px; }
header.top { background: var(--deep); color: #fff; padding: calc(14px + env(safe-area-inset-top)) 16px 14px; position: sticky; top: 0; z-index: 5; }
header.top .in { max-width: 640px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
header.top button { color: #fff; }
@media (prefers-color-scheme: dark) { header.top { background: var(--navy); border-bottom: 1px solid var(--line); } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 14px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); } .small { font-size: 13px; } .right { text-align: right; }
.stack > * + * { margin-top: 10px; }

button, .btn { font: inherit; border: 0; border-radius: 12px; padding: 12px 16px; min-height: 44px; background: var(--chip); color: var(--text); font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
button.primary, .btn.primary { background: var(--primary); color: var(--on-primary); }
button.coral { background: var(--coral); color: #fff; }
button.ghost { background: transparent; color: var(--accent); padding: 8px 10px; }
button.danger { background: transparent; color: var(--danger); }
button:disabled { opacity: .5; }
.btn.call { background: var(--primary); color: var(--on-primary); } .btn.text { background: var(--accent); color: #08201E; }

input, select, textarea { font: inherit; width: 100%; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); min-height: 44px; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
label { display: block; font-size: 13px; color: var(--muted); font-weight: 600; margin: 12px 0 4px; }

.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--chip); color: var(--text); text-transform: capitalize; }
.pill.s-new { background: var(--chip); } .pill.s-qualified { background: #CDEFEA; color: #0B4F48; } .pill.s-booked { background: #F6E3C2; color: #6A430A; }
.pill.s-met { background: #BFD9DC; color: #123F45; } .pill.s-sold { background: #0F9D8C; color: #fff; } .pill.s-lost { background: #F8D3DA; color: #8A1F36; }
@media (prefers-color-scheme: dark) {
  .pill.s-qualified { background: #12474A; color: #BDEFE8; } .pill.s-booked { background: #5A3E10; color: #FBE2B8; }
  .pill.s-met { background: #1F4A52; color: #CDE9EC; } .pill.s-sold { background: #0F9D8C; color: #04201C; } .pill.s-lost { background: #5C2230; color: #FAD3DB; }
}
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin: 0 -16px 12px; padding-inline: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 14px; min-height: 40px; border-radius: 999px; background: var(--chip); }
.chip.on { background: var(--primary); color: var(--on-primary); }

.lead { display: block; color: inherit; text-decoration: none; }
.lead + .lead { margin-top: 0; }
.lead .name { font-weight: 700; }
.due { color: var(--coral); font-weight: 700; } @media (prefers-color-scheme: light) { .due { color: #C2415A; } }
.empty { text-align: center; color: var(--muted); padding: 28px 8px; }

.bars .bar { display: grid; grid-template-columns: 96px 1fr 32px; align-items: center; gap: 8px; margin: 6px 0; font-size: 14px; }
.bars .track { height: 10px; background: var(--chip); border-radius: 6px; overflow: hidden; }
.bars .fill { height: 100%; background: var(--accent); border-radius: 6px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px 4px; text-align: right; border-bottom: 1px solid var(--line); } th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-size: 12px; font-weight: 600; }
.scroll-x { overflow-x: auto; }

nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line); display: flex; padding-bottom: env(safe-area-inset-bottom); z-index: 6; }
nav.tabs a { flex: 1; text-align: center; padding: 10px 4px; min-height: 56px; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
nav.tabs a svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
nav.tabs a.on { color: var(--accent); }
.fab { position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); width: 56px; height: 56px; border-radius: 50%; background: var(--coral); color: #fff; font-size: 30px; padding: 0; box-shadow: 0 4px 14px rgba(0,0,0,.25); z-index: 7; }

#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(90px + env(safe-area-inset-bottom)); background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 12px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 20; max-width: 90vw; }
#toast.show { opacity: 1; } #toast.bad { background: var(--danger); color: #fff; }

.login { max-width: 360px; margin: 0 auto; padding: 18vh 20px 20px; text-align: center; }
.login img { width: 72px; height: 72px; border-radius: 18px; }
.login h1 { margin: 14px 0 4px; } .login form { margin-top: 22px; text-align: left; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { margin: 0; display: inline-flex; align-items: center; gap: 6px; background: var(--chip); border-radius: 999px; padding: 8px 12px; color: var(--text); font-size: 14px; }
.checks input { width: auto; min-height: 0; }
.seg { display: flex; gap: 8px; } .seg label { flex: 1; margin: 0; }
.wide { width: 100%; } hr { border: 0; border-top: 1px solid var(--line); margin: 10px 0; }
a.chip { text-decoration: none; color: inherit; display: inline-flex; align-items: center; }
.check { border-radius: 12px; padding: 12px; margin: 14px 0; border: 2px solid var(--line); }
.check.ok { border-color: var(--teal); } .check.warn { border-color: var(--amber); } .check.bad { border-color: var(--coral); }
.check ul { padding-left: 18px; margin: 8px 0; } .check li { margin-bottom: 8px; }
.pill.lvl-high { background: var(--coral); color: #fff; } .pill.lvl-medium { background: var(--amber); color: #fff; } .pill.lvl-low { background: var(--chip); }
.slide-edit { margin-bottom: 10px; } .slide-edit textarea { min-height: 64px; margin-top: 6px; }
.slide-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.slide-grid img { width: 100%; border-radius: 10px; border: 1px solid var(--line); display: block; margin-bottom: 6px; }
.slide-grid .btn { width: 100%; padding: 8px; min-height: 40px; }
