/* ============================================================
   SUMMIT PARKS CRM — styles
   Same palette as Summit CRM (navy / Summit red / cream / gold) and the same
   system-ui font (Summit CRM v654: hinted OS fonts stay crisp at small sizes —
   don't add a webfont). Hand-written instead of a purged Tailwind build, so
   every class here exists; no "class silently missing" surprises.
   ============================================================ */

:root {
  --navy: #0d1b2a; --navy2: #1a3a5c; --red: #c8102e; --red2: #a50d25;
  --cream: #f0ebe0; --gold: #c9a84c;
  --bg: #f3f4f6; --panel: #ffffff; --panel2: #f9fafb; --border: #e5e7eb; --border2: #d1d5db;
  --text: #111827; --muted: #6b7280; --faint: #9ca3af;
  --green: #059669; --amber: #d97706; --blue: #2563eb;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --radius: 12px;
}
html.dark {
  color-scheme: dark;
  --bg: #0a111c; --panel: #111b2b; --panel2: #0e1726; --border: #1e2a3c; --border2: #2a3a52;
  --text: #e5e7eb; --muted: #9ca3af; --faint: #6b7280;
  --shadow: 0 1px 2px rgba(0,0,0,.4);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-synthesis: none; font-size: 13px; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
a { color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.pad { padding: 16px 20px; }
.nowrap { white-space: nowrap; }
.red { color: var(--red); }
.green { color: var(--green); }
.amber { color: var(--amber); }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border2);
  background: var(--panel); color: var(--text); font: inherit; font-size: 12px; font-weight: 700;
  padding: 7px 12px; border-radius: 8px; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn:hover { filter: brightness(.97); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-red { background: var(--red); border-color: var(--red); color: #fff; }
.btn-red:hover { background: var(--red2); filter: none; }
.btn-navy { background: var(--navy); border-color: var(--navy); color: #fff; }
html.dark .btn-navy { background: #1d2b40; border-color: #1d2b40; }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--panel2); color: var(--text); }
.btn-ghost.danger:hover { color: var(--red); }
.btn-icon { padding: 7px 10px; }
.btn-block { width: 100%; justify-content: center; padding: 10px; font-size: 13px; }
.btn-sm { padding: 4px 9px; font-size: 11px; }
.icon-btn { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 6px; border-radius: 6px; font-size: 14px; opacity: .7; }
.icon-btn:hover { opacity: 1; background: rgba(127,127,127,.12); }

input, select, textarea {
  font: inherit; font-size: 13px; color: var(--text); background: var(--panel);
  border: 1px solid var(--border2); border-radius: 8px; padding: 7px 9px; width: 100%; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(200,16,46,.12); }
textarea { resize: vertical; min-height: 64px; }
.select { width: auto; padding: 6px 8px; font-size: 12px; }
.fld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fld > span { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.fld small { color: var(--faint); font-size: 11px; }
.fld .req { color: var(--red); }
.fld.span2 { grid-column: 1 / -1; }
.affix { position: relative; }
.affix > em { position: absolute; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--faint); font-size: 12px; pointer-events: none; }
.affix.pre > em { left: 9px; } .affix.pre > input { padding-left: 20px; }
.affix.post > em { right: 9px; } .affix.post > input { padding-right: 24px; }
.phone-row { display: flex; gap: 4px; }
.phone-row a { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 32px; border-radius: 8px; border: 1px solid var(--border2); color: var(--green); text-decoration: none; }

/* ---------- login ---------- */
.login { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: var(--navy); padding: 16px; }
.login-card { background: #fff; color: #111827; border-radius: 18px; padding: 32px; width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 25px 50px rgba(0,0,0,.35); }
.login-card input { background: #fff; color: #111827; border-color: #d1d5db; }
.login-logo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; margin: 0 auto; box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.login-title { text-align: center; font-size: 20px; font-weight: 900; }
.login-sub { text-align: center; color: #6b7280; margin-top: -8px; margin-bottom: 4px; }
.login-error { background: #fef2f2; color: #dc2626; border-radius: 8px; padding: 10px; font-weight: 600; }

/* ---------- layout ---------- */
.app { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }
.sidebar { width: 224px; flex-shrink: 0; background: var(--navy); color: #fff; display: flex; flex-direction: column; box-shadow: 4px 0 20px rgba(0,0,0,.12); }
.brand { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; box-shadow: 0 4px 10px rgba(0,0,0,.3); }
.brand-name { font-weight: 900; font-size: 14px; }
.brand-sub { font-size: 11px; color: #94a3b8; }
.nav { flex: 1; overflow-y: auto; padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: #64748b; font-weight: 800; padding: 12px 12px 4px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; cursor: pointer; color: #9ca3af; font-size: 12px; font-weight: 600; border-left: 3px solid transparent; transition: background .15s, color .15s; user-select: none; }
.nav-item i { width: 16px; text-align: center; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #e5e7eb; }
.nav-item.active { background: rgba(200,16,46,.18); border-left-color: var(--red); color: #fff; }
.badge { margin-left: auto; background: rgba(255,255,255,.12); color: #e5e7eb; font-size: 10px; font-weight: 800; border-radius: 999px; padding: 2px 7px; min-width: 20px; text-align: center; }
.badge:empty { display: none; }
.badge.hot { background: #f43f5e; color: #fff; }
.me { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid rgba(255,255,255,.08); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--red); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; flex-shrink: 0; }
.me-text { min-width: 0; flex: 1; }
.me-name { font-size: 12px; font-weight: 700; }
.me-name select { background: #1f2937; color: #fff; border-color: #374151; padding: 3px 6px; font-size: 12px; }
.me-role { font-size: 11px; color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.topbar { background: var(--panel); border-bottom: 1px solid var(--border); padding: 10px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; box-shadow: var(--shadow); flex-shrink: 0; }
.titles { min-width: 0; }
.titles h1 { margin: 0; font-size: 15px; font-weight: 900; }
.titles p { margin: 2px 0 0; font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.search-wrap { position: relative; }
.search-wrap > i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 11px; pointer-events: none; }
.search-wrap input { padding-left: 28px; width: 240px; font-size: 12px; transition: width .2s; }
.search-wrap input:focus { width: 300px; }
.search-wrap.small input, .search-wrap.small input:focus { width: 220px; }
.search-drop { position: absolute; right: 0; top: calc(100% + 6px); width: 340px; max-height: 380px; overflow-y: auto; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.18); z-index: 40; }
.search-hit { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--border); }
.search-hit:last-child { border-bottom: 0; }
.search-hit:hover { background: var(--panel2); }
.search-hit i { width: 16px; text-align: center; color: var(--muted); }
.search-hit .t { font-weight: 700; }
.search-hit .s { font-size: 11px; color: var(--muted); }
.search-hit .k { margin-left: auto; font-size: 10px; color: var(--faint); text-transform: uppercase; font-weight: 700; }

.banner { background: #fef3c7; color: #92400e; border-bottom: 1px solid #fcd34d; padding: 8px 20px; font-size: 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
html.dark .banner { background: #3a2a06; color: #fcd34d; border-color: #5c4310; }
.scroll { flex: 1; overflow: auto; position: relative; }
.tab { min-height: 100%; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 20px; flex-wrap: wrap; border-bottom: 1px solid var(--border); background: var(--panel); }
.toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border2); background: var(--panel); color: var(--muted); border-radius: 999px; padding: 4px 10px; font-size: 11px; font-weight: 700; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.chip b { font-weight: 800; color: var(--faint); }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip.on b { color: #cbd5e1; }
html.dark .chip.on { background: var(--red); border-color: var(--red); }

/* ---------- cards / tiles ---------- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 800; font-size: 13px; }
.card-head .sub { margin-left: auto; font-weight: 600; font-size: 11px; color: var(--faint); }
.card-body { padding: 12px 16px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tile { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); cursor: default; }
.tile.link { cursor: pointer; }
.tile.link:hover { border-color: var(--border2); }
.tile-label { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; display: flex; align-items: center; gap: 6px; }
.tile-value { font-size: 24px; font-weight: 900; margin-top: 6px; letter-spacing: -.02em; }
.tile-sub { font-size: 11px; color: var(--faint); margin-top: 2px; }
.tile.alert .tile-value { color: var(--red); }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; padding: 0 20px 20px; }
.dash-grid > .card { min-width: 0; }   /* a long row can't widen its column past a phone screen */
.row-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.row-item:last-child { border-bottom: 0; }
.row-item:hover .t { color: var(--red); }
.row-item .t { font-weight: 700; }
.row-item .s { font-size: 11px; color: var(--muted); }
.row-item .r { margin-left: auto; text-align: right; font-size: 11px; white-space: nowrap; }
.empty-sm { color: var(--faint); font-size: 12px; padding: 10px 0; }
.stage-bar { display: grid; grid-template-columns: 120px 1fr 70px; gap: 10px; align-items: center; padding: 6px 0; font-size: 12px; cursor: pointer; }
.stage-bar .bar { height: 10px; background: var(--panel2); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.stage-bar .bar > div { height: 100%; border-radius: 999px; }
.welcome { margin: 20px; padding: 28px; text-align: center; }
.welcome h2 { margin: 0 0 6px; font-size: 18px; }
.welcome p { margin: 0 auto 16px; max-width: 560px; color: var(--muted); line-height: 1.5; }
.welcome .actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ---------- lead table ---------- */
.table-card { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 12px; }
table.list th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-weight: 800; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--panel2); white-space: nowrap; }
table.list td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.list tbody tr { cursor: pointer; }
table.list tbody tr:hover { background: var(--panel2); }
table.list tr:last-child td { border-bottom: 0; }
table.list .t { font-weight: 700; }
table.list .s { font-size: 11px; color: var(--muted); }
table.list a.tel { color: var(--green); font-weight: 700; text-decoration: none; white-space: nowrap; }
table.list a.tel:hover { text-decoration: underline; }
.pill { display: inline-block; font-size: 10px; font-weight: 800; border-radius: 999px; padding: 3px 8px; white-space: nowrap; color: #fff; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- kanban ---------- */
.board-wrap { overflow-x: auto; padding: 16px 20px; }
.board { display: flex; gap: 10px; align-items: flex-start; }
.col { flex: 1 1 0; min-width: 180px; background: var(--panel2); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 190px); }
.col-head { padding: 10px 12px 4px; border-top: 4px solid var(--faint); border-radius: var(--radius) var(--radius) 0 0; display: flex; align-items: center; gap: 6px; font-weight: 800; }
.col-head .count { margin-left: auto; background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; font-size: 11px; }
.col-sub { padding: 0 12px 8px; font-size: 11px; color: var(--faint); }
.col-body { padding: 0 8px 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.col.drop-over { outline: 2px dashed var(--red); outline-offset: -2px; }
.col-empty { color: var(--faint); font-size: 11px; text-align: center; padding: 18px 0; border: 1px dashed var(--border2); border-radius: 8px; }
.end-zones { display: flex; gap: 8px; }
.end-zone { border: 2px dashed var(--border2); border-radius: 8px; padding: 5px 12px; color: var(--muted); font-weight: 700; font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.end-zone.closed { color: var(--green); border-color: rgba(5,150,105,.45); }
.end-zone.drop-over { background: var(--panel2); border-style: solid; transform: scale(1.04); }
.deal-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 10px; cursor: pointer; box-shadow: var(--shadow); }
.deal-card:hover { border-color: var(--border2); }
.deal-card.dragging { opacity: .5; }
.dc-title { font-weight: 800; font-size: 13px; }
.dc-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.dc-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; margin-top: 8px; font-size: 11px; }
.dc-nums span { color: var(--faint); display: block; font-size: 10px; text-transform: uppercase; font-weight: 700; }
.dc-nums b { font-variant-numeric: tabular-nums; }
.dc-foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 11px; color: var(--muted); }
.dc-foot .avatar { width: 20px; height: 20px; font-size: 9px; margin-left: auto; }
.date-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--panel2); border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px; font-size: 10px; font-weight: 700; color: var(--muted); }
.date-chip.soon { color: var(--amber); border-color: rgba(217,119,6,.4); }
.date-chip.late { color: var(--red); border-color: rgba(200,16,46,.4); }

/* ---------- active parks ---------- */
.park-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.park-card { padding: 14px 16px; cursor: pointer; }
.park-card:hover { border-color: var(--border2); }
.pc-top { display: flex; align-items: flex-start; gap: 8px; }
.pc-name { font-weight: 900; font-size: 14px; }
.pc-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.pc-top .pill { margin-left: auto; }
.occ { margin: 12px 0 4px; height: 8px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--border); overflow: hidden; }
.occ > div { height: 100%; background: var(--green); }
.pc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.pc-stats span { display: block; font-size: 10px; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.pc-stats b { font-size: 13px; font-variant-numeric: tabular-nums; }
.pc-foot { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 11px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.pc-foot a { color: var(--green); font-weight: 700; text-decoration: none; margin-left: auto; }

/* ---------- record modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(13,27,42,.55); display: flex; align-items: flex-start; justify-content: center; padding: 32px 16px; overflow-y: auto; }
.modal-card { background: var(--panel); border-radius: 16px; width: 100%; max-width: 1040px; box-shadow: 0 30px 60px rgba(0,0,0,.35); display: flex; flex-direction: column; }
.m-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.m-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.m-titles { min-width: 0; flex: 1; }
.m-kicker { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; color: var(--red); }
.m-title { font-size: 17px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-sub { font-size: 12px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.link-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: var(--blue); cursor: pointer; background: rgba(37,99,235,.08); border-radius: 6px; padding: 2px 7px; }
.m-head-actions { display: flex; gap: 6px; }
.m-body { display: grid; grid-template-columns: 1fr 320px; min-height: 0; }
.m-form { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.m-form fieldset { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px 14px; margin: 0; }
.m-form legend { font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; color: var(--navy2); padding: 0 6px; }
html.dark .m-form legend { color: #93c5fd; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 12px; }
.m-metrics { display: flex; gap: 8px; flex-wrap: wrap; }
.m-metrics:empty { display: none; }
.metric { background: var(--panel2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 11px; color: var(--muted); }
.metric b { color: var(--text); font-size: 13px; margin-left: 4px; }
.m-side { border-left: 1px solid var(--border); background: var(--panel2); padding: 16px; display: flex; flex-direction: column; gap: 10px; border-radius: 0 0 16px 0; }
.side-title { font-weight: 900; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.log-types { display: flex; flex-wrap: wrap; gap: 4px; }
.log-types label { cursor: pointer; }
.log-types input { display: none; }
.log-types span { display: inline-block; border: 1px solid var(--border2); border-radius: 999px; padding: 3px 9px; font-size: 11px; font-weight: 700; color: var(--muted); background: var(--panel); }
.log-types input:checked + span { background: var(--navy); color: #fff; border-color: var(--navy); }
.acts { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; max-height: 460px; }
.act { display: flex; gap: 8px; }
.act-ico { width: 24px; height: 24px; border-radius: 50%; background: var(--panel); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 10px; color: var(--muted); flex-shrink: 0; }
.act-meta { font-size: 11px; color: var(--faint); }
.act-meta b { color: var(--text); }
.act-body { font-size: 12px; white-space: pre-wrap; word-break: break-word; margin-top: 2px; }
.act.sys .act-body { color: var(--muted); }
.m-foot { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.m-foot .spacer { flex: 1; }
.modal-card.modal-sm { max-width: 400px; margin-top: 10vh; }

/* ---------- record tabs: Details · Tasks · Spaces · Documents ---------- */
.m-tabs { display: flex; gap: 2px; padding: 0 16px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.m-tab { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 700; font-size: 12px; padding: 10px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.m-tab:hover { color: var(--text); }
.m-tab.on { color: var(--text); border-bottom-color: var(--red); }
.m-tab b { font-size: 10px; background: var(--panel2); border: 1px solid var(--border); border-radius: 999px; padding: 1px 6px; color: var(--muted); }
.m-main { min-width: 0; }
.m-panel { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.panel-head .occ { margin: 6px 0 0; }
.panel-group { border: 1px solid var(--border); border-radius: 12px; padding: 4px 12px; }
.panel-group-title { font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; color: var(--navy2); padding: 8px 0 4px; cursor: default; }
.panel-group-title span { color: var(--faint); margin-left: 4px; }
details.panel-group > summary { cursor: pointer; }
html.dark .panel-group-title { color: #93c5fd; }
.task { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.task input[type=checkbox] { width: 16px; height: 16px; margin-top: 1px; flex-shrink: 0; accent-color: var(--green); cursor: pointer; }
.task-main { flex: 1; min-width: 0; cursor: pointer; }
.task-title { font-weight: 600; }
.task.done .task-title { text-decoration: line-through; color: var(--faint); }
.task-notes { font-size: 11px; color: var(--muted); white-space: pre-wrap; margin-top: 2px; }
.avatar.sm { width: 20px; height: 20px; font-size: 9px; }
.editor { border: 1px solid var(--border2); background: var(--panel2); border-radius: 12px; padding: 12px; margin: 6px 0; cursor: default; }
.editor-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.editor-foot .spacer { flex: 1; }
.table-wrap { border: 1px solid var(--border); border-radius: 12px; overflow-x: auto; }
table.list.spaces td { vertical-align: top; }
table.list.spaces .muted { font-size: 11px; }
table.list.spaces .notes-cell { color: var(--muted); font-size: 11px; max-width: 280px; }
.doc { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.doc > i { width: 16px; text-align: center; color: var(--muted); }
.doc-main { flex: 1; min-width: 0; }
.doc-main a { color: var(--blue); font-weight: 600; text-decoration: none; word-break: break-word; }
.doc-main a:hover { text-decoration: underline; }
.doc-meta { font-size: 11px; white-space: nowrap; }
.ck { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; cursor: pointer; padding: 3px 0; }
.ck input { width: 15px; height: 15px; margin-top: 1px; flex-shrink: 0; accent-color: var(--navy2); }
.ck-list { display: flex; flex-direction: column; gap: 2px; }
.pc-vac { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.conn-setup { margin-top: 4px; line-height: 1.7; }
.conn-setup code { font-size: 10px; background: var(--panel2); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; word-break: break-all; }
.conn .tag.on { background: rgba(5,150,105,.12); color: var(--green); }
pre.preview { max-height: 300px; overflow: auto; background: var(--panel2); border: 1px solid var(--border); border-radius: 8px; padding: 8px; font-size: 11px; white-space: pre-wrap; margin: 0; }
.pw-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }

/* ---------- tools ---------- */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; padding: 20px; }
.uw-out { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: 12px; margin-top: 12px; }
.uw-out .h { grid-column: 1 / -1; font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin-top: 8px; }
.uw-out b { text-align: right; font-variant-numeric: tabular-nums; }
.uw-out .big { font-size: 15px; color: var(--red); }
.conn { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.conn:last-child { border-bottom: 0; }
.conn > i { width: 32px; height: 32px; border-radius: 8px; background: var(--panel2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--muted); flex-shrink: 0; }
.conn .t { font-weight: 800; }
.conn .s { font-size: 12px; color: var(--muted); line-height: 1.4; }
.conn .tag { margin-left: auto; align-self: flex-start; font-size: 10px; font-weight: 800; color: var(--faint); border: 1px solid var(--border2); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.map-list { font-size: 12px; margin: 10px 0; display: flex; flex-wrap: wrap; gap: 4px; }
.map-list span { background: var(--panel2); border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px; }
.map-list span.off { color: var(--faint); text-decoration: line-through; }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 70; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { background: var(--navy); color: #fff; border-radius: 10px; padding: 10px 14px; font-size: 12px; font-weight: 600; box-shadow: 0 10px 24px rgba(0,0,0,.25); max-width: 420px; animation: toastIn .18s ease-out; }
.toast.warn { background: #b45309; }
.toast.err { background: var(--red); }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- phones ---------- */
.bottom-nav { display: none; }
@media (max-width: 767px) {
  .sidebar { display: none; }
  .app { flex-direction: column; }
  .main { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--navy); padding-bottom: env(safe-area-inset-bottom); }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 0 8px; color: #94a3b8; font-size: 10px; font-weight: 700; cursor: pointer; }
  .bottom-nav a i { font-size: 16px; }
  .bottom-nav a.active { color: #fff; box-shadow: inset 0 3px 0 var(--red); }
  .topbar { padding: 10px 12px; }
  .titles p { display: none; }
  .search-wrap input, .search-wrap input:focus { width: 150px; }
  .search-drop { width: calc(100vw - 24px); right: -90px; }
  .hide-sm { display: none; }
  .pad { padding: 12px; }
  .toolbar { padding: 10px 12px; }
  .search-wrap.small input, .search-wrap.small input:focus { width: 100%; }
  .toolbar-right { width: 100%; }
  .toolbar-right .search-wrap { flex: 1; }
  .board-wrap { padding: 12px; }
  .end-zones { display: none; }   /* drag-and-drop is mouse-only; phones move stages from the card's Stage field */
  .col { max-height: none; }
  .dash-grid { padding: 0 12px 12px; grid-template-columns: 1fr; }
  .tools-grid { padding: 12px; grid-template-columns: 1fr; }
  .modal { padding: 0; }
  .modal-card { border-radius: 0; min-height: 100%; }
  .m-body { grid-template-columns: 1fr; }
  .m-side { border-left: 0; border-top: 1px solid var(--border); border-radius: 0; }
  .m-form { padding: 12px; }
  .grid { grid-template-columns: 1fr 1fr; }
  table.list .hide-sm { display: none; }
}
