/* SyncSols CRM v0.1.0 - SyncSols palette: #0E2841 dark, #156082 teal, #0F4761 heading, #215E99 header blue, #E8E8E8 light */
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 400; font-display: swap; src: url(fonts/plus-jakarta-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 500; font-display: swap; src: url(fonts/plus-jakarta-sans-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 600; font-display: swap; src: url(fonts/plus-jakarta-sans-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 700; font-display: swap; src: url(fonts/plus-jakarta-sans-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url(fonts/jetbrains-mono-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-display: swap; src: url(fonts/jetbrains-mono-latin-500-normal.woff2) format("woff2"); }

:root {
  --dark: #0E2841; --teal: #156082; --heading: #0F4761; --blue: #215E99; --light: #E8E8E8;
  --bg: #F4F6F8; --card: #FFFFFF; --line: #DCE2E8; --muted: #5E6B78; --ink: #1B2733;
  --tint: #E7F0F6; --tint2: #D4E4EF; --bad: #A12A2A; --bad-bg: #F8E9E9;
  --radius: 10px; --shadow: 0 1px 2px rgba(14,40,65,.06), 0 1px 8px rgba(14,40,65,.04);
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font: 14px/1.5 "Plus Jakarta Sans", system-ui, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); min-width: 0; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--heading); margin: 0 0 .5rem; line-height: 1.25; }
h1 { font-size: 1.45rem; font-weight: 700; }
h2 { font-size: 1.05rem; font-weight: 700; }
h3 { font-size: .95rem; font-weight: 600; }
p { margin: 0 0 .75rem; }
.mono, .num { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.bad { color: var(--bad); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* layout */
.shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(to right, var(--dark) 228px, var(--bg) 228px); }
.side { background: var(--dark); color: #fff; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 34px; height: 34px; border-radius: 8px; background: var(--teal); display: grid; place-items: center; font-weight: 700; font-size: 15px; letter-spacing: -.5px; }
.brand b { display: block; font-size: 15px; }
.brand small { display: block; color: #9FB6CB; font-size: 11px; }
.nav a { display: flex; align-items: center; gap: 10px; color: #D5E1EC; padding: 9px 10px; border-radius: 8px; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.07); text-decoration: none; color: #fff; }
.nav a.on { background: var(--teal); color: #fff; }
.nav svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav .badge { margin-left: auto; background: rgba(255,255,255,.18); color: #fff; }
.nav .sep { height: 1px; background: rgba(255,255,255,.1); margin: 10px 6px; }
.side .who { margin-top: 18px; padding: 10px; border-top: 1px solid rgba(255,255,255,.1); font-size: 12.5px; color: #B9CADA; }
.side .who b { color: #fff; display: block; font-size: 13px; }
.side .who button { margin-top: 8px; }
.main { min-width: 0; }
.top { position: sticky; top: 0; z-index: 5; background: rgba(244,246,248,.94); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); padding: 12px 24px; display: flex; align-items: center; gap: 12px; min-height: 56px; }
.top h1 { margin: 0; font-size: 1.2rem; }
.top .grow { flex: 1; }
.top .menu-btn { display: none; }
.content { padding: 20px 24px 48px; max-width: 1280px; min-width: 0; }
.foot { color: var(--muted); font-size: 12px; padding: 0 24px 24px; }

/* cards & grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 16px; min-width: 0; }
.card > h2:first-child { display: flex; align-items: center; gap: 8px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.card-head .grow { flex: 1; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid > * { min-width: 0; }
.grid { margin-bottom: 16px; }
.grid > .card { margin-bottom: 0; }
.cols-2 { display: grid; gap: 16px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat b { display: block; font-size: 1.5rem; color: var(--heading); font-weight: 700; line-height: 1.2; }
.stat span { color: var(--muted); font-size: 12.5px; }
.empty { color: var(--muted); padding: 10px 0; }

/* tables */
.tbl-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; background: #FAFBFC; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #FAFCFD; }
td.c, th.c { width: 28px; }

/* forms */
label { display: block; font-weight: 600; font-size: 12.5px; color: var(--heading); margin: 0 0 4px; }
.field { margin-bottom: 12px; min-width: 0; }
.hint { font-weight: 400; color: var(--muted); font-size: 12px; }
input[type=text], input[type=search], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=datetime-local], input[type=number], input[type=url], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid #C9D3DD; border-radius: 8px; padding: 8px 10px; min-width: 0; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--tint2); border-color: var(--teal); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); font-size: 14px; }
.check input { width: 16px; height: 16px; accent-color: var(--teal); }
.form-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 12px; }
.filters > * { flex: 1 1 150px; min-width: 0; }
.filters .grow2 { flex: 3 1 240px; }
.filters .btns { flex: 0 0 auto; display: flex; gap: 6px; }
.inline { display: inline; }
.inline-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-form select, .inline-form input { width: auto; min-width: 120px; padding: 5px 8px; }
.chips-pick { display: flex; flex-wrap: wrap; gap: 6px 14px; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 600; font-size: 13.5px; border-radius: 8px; padding: 8px 14px; border: 1px solid var(--teal); background: var(--teal); color: #fff; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--heading); border-color: var(--heading); text-decoration: none; color: #fff; }
.btn.ghost { background: #fff; color: var(--teal); border-color: #BFD3E1; }
.btn.ghost:hover { background: var(--tint); color: var(--heading); }
.btn.danger { background: #fff; color: var(--bad); border-color: #E3BDBD; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.sm { padding: 4px 10px; font-size: 12.5px; }
.btn.call { background: var(--blue); border-color: var(--blue); }
.btn svg { width: 16px; height: 16px; }
.btnbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* badges & chips */
.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--tint); color: var(--heading); white-space: nowrap; }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.dark { background: var(--dark); color: #fff; }
.badge.grey { background: #EEF0F2; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 9px 2px 7px; border-radius: 999px; background: #EEF3F7; color: var(--heading); margin: 1px 2px 1px 0; white-space: nowrap; }
.chip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dir { font-size: 12px; font-weight: 600; white-space: nowrap; }
.dir.missed, .dir.rejected { color: var(--bad); }

/* flash */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; background: var(--tint); border: 1px solid var(--tint2); color: var(--heading); }
.flash.error { background: var(--bad-bg); border-color: #EBC9C9; color: var(--bad); }

/* lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .grow b, .list .grow a { overflow-wrap: anywhere; }
.list .sub { color: var(--muted); font-size: 12.5px; }

/* timeline */
.tl { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--tint2); }
.tl li { position: relative; padding: 0 0 14px 16px; }
.tl li::before { content: ""; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--teal); }
.tl li.fu::before { border-color: var(--blue); background: var(--tint); }
.tl li.miss::before { border-color: var(--bad); }
.tl .meta { font-size: 12.5px; color: var(--muted); }
.tl .note { background: #FAFBFC; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }

dl.kv { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 6px 12px; margin: 0; }
dl.kv dt { color: var(--muted); font-size: 12.5px; }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 8px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--heading); border-bottom-color: var(--teal); }
.tabs a:hover { text-decoration: none; color: var(--heading); }

.bar { height: 8px; background: #EEF2F5; border-radius: 4px; overflow: hidden; min-width: 80px; }
.bar i { display: block; height: 100%; background: var(--teal); }

details.edit > summary { cursor: pointer; color: var(--blue); font-weight: 600; list-style: none; }
details.edit > summary::-webkit-details-marker { display: none; }
details.edit[open] { background: #FAFBFC; border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin: 6px 0; }

.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 10px; }
.code { font-family: var(--mono); font-size: 1.6rem; letter-spacing: .12em; color: var(--heading); }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, var(--dark), var(--heading) 60%, var(--teal)); }
.login { width: 100%; max-width: 380px; background: #fff; border-radius: 14px; padding: 28px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.login .brand { color: var(--dark); padding: 0 0 18px; }
.login .brand small { color: var(--muted); }
.login .ms { width: 100%; justify-content: center; padding: 11px; font-size: 14.5px; }
.login .or { text-align: center; color: var(--muted); font-size: 12px; margin: 16px 0; }
.login details summary { cursor: pointer; color: var(--muted); font-size: 13px; text-align: center; }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); background: var(--bg); }
  .side { position: fixed; z-index: 20; left: 0; top: 0; width: 248px; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .side { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  .top .menu-btn { display: inline-flex; }
  .top { flex-wrap: wrap; }
  .top h1 { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top .grow { display: none; }
  #bulk-form { display: none; }
  .cols-2 { grid-template-columns: minmax(0, 1fr); }
  .top { padding: 10px 14px; }
  .content { padding: 14px 14px 40px; }
  .card { padding: 14px; }
  .tbl-wrap { margin: 0 -14px; padding: 0 14px; }
  table.stack thead { display: none; }
  table.stack tr { display: block; border-bottom: 1px solid var(--line); padding: 6px 0; }
  table.stack td { display: block; border: 0; padding: 2px 0; }
  table.stack td.c { display: none; }
  dl.kv { grid-template-columns: 96px minmax(0, 1fr); }
}
