/* Staff area — reuses the site tokens from /styles.css */
.btn-sm { padding: .5rem .9rem; font-size: .85rem; }

/* Login */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.auth-card { width: min(420px, 100%); }
.auth-card form { padding: 1.75rem; }
.auth-foot { text-align: center; color: var(--fg-dim); font-size: .85rem; margin-top: 1.25rem; }
.form-error { color: var(--danger); font-size: .9rem; min-height: 1.2em; margin: 0 0 .75rem; }

/* Dashboard shell */
.admin-body { display: flex; flex-direction: column; min-height: 100vh; }
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1.5rem; border-bottom: 1px solid var(--border); background: var(--bg-deep); }
.admin-top-right { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.who { color: var(--fg-muted); font-size: .9rem; padding: 0 .5rem; }
.admin-main { flex: 1; padding: 1.5rem; display: flex; flex-direction: column; gap: 1.25rem; max-width: 1400px; width: 100%; margin-inline: auto; }

.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: .9rem; }
.stats .stat { padding: 1rem 1.25rem; }
.stats .stat strong { font-size: 1.8rem; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.filters { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip { background: var(--card); border: 1px solid var(--border); color: var(--fg-muted); border-radius: 999px; padding: .4rem .9rem; font: inherit; font-size: .85rem; font-weight: 500; cursor: pointer; text-transform: capitalize; }
.chip.active { background: var(--gradient); color: var(--primary-fg); border-color: transparent; font-weight: 600; }
#search { max-width: 320px; }

.lead-layout { display: grid; grid-template-columns: minmax(300px, 1.1fr) 1.4fr; gap: 1.25rem; align-items: start; }
.lead-list { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.lead-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--border); padding: .9rem 1.1rem; color: var(--fg); font: inherit; cursor: pointer; }
.lead-row:last-child { border-bottom: 0; }
.lead-row:hover { background: var(--card-hover); }
.lead-row.active { background: var(--muted); box-shadow: inset 3px 0 0 var(--primary); }
.lr-main { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.lr-company { font-family: var(--font-head); font-weight: 600; }
.lr-name { font-size: .85rem; color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lr-meta { display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; font-size: .78rem; color: var(--fg-dim); white-space: nowrap; }
.status-pill { font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: .2rem .55rem; border-radius: 999px; background: var(--muted); color: var(--fg-muted); }
.status-pill[data-status="new"] { background: var(--accent-soft); color: var(--accent); }
.status-pill[data-status="contacted"] { background: oklch(72% .09 205 / .18); color: var(--primary); }
.status-pill[data-status="quoted"] { background: oklch(80% .12 85 / .18); color: oklch(85% .12 85); }
.status-pill[data-status="won"] { background: oklch(75% .15 150 / .18); color: oklch(80% .15 150); }
.status-pill[data-status="lost"] { background: oklch(63% .2 25 / .18); color: oklch(75% .15 25); }

.lead-detail { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; position: sticky; top: 1rem; }
.ld-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.ld-head h2 { font-size: 1.5rem; margin-bottom: .2rem; }
.ld-sub { color: var(--fg-muted); margin: 0; font-size: .95rem; }
#statusSel { width: auto; text-transform: capitalize; }
.ld-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem 1.5rem; margin: 0 0 1.25rem; padding: 1rem 0; border-block: 1px solid var(--border); }
.ld-facts dt, .ld-msg dt { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-dim); font-weight: 600; }
.ld-facts dd { margin: .15rem 0 0; }
.ld-msg { margin-bottom: 1.5rem; }
.ld-msg p { white-space: pre-wrap; color: var(--fg-muted); margin: .4rem 0 0; }
.note-form { display: grid; gap: .6rem; margin-bottom: 1rem; }
.note-form textarea { min-height: 72px; }
.note-form .btn { justify-self: start; }
.notes { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.notes li { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem .9rem; font-size: .95rem; white-space: pre-wrap; }
.note-meta { font-size: .75rem; color: var(--fg-dim); margin-bottom: .3rem; }
.ld-danger { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.ld-danger .btn:hover { border-color: var(--danger); color: var(--danger); }
.empty { color: var(--fg-dim); padding: 1.5rem; text-align: center; margin: 0; }

@media (max-width: 960px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .lead-layout { grid-template-columns: 1fr; }
  .lead-detail { position: static; }
}

/* Tabs + clients view */
.tabs { display: flex; gap: .25rem; background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: .25rem; }
.tab { background: none; border: 0; color: var(--fg-muted); font-family: var(--font-head); font-weight: 600; font-size: .9rem; padding: .5rem 1rem; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: .4rem; }
.tab.active { background: var(--gradient); color: var(--primary-fg); }
.tab .count { background: oklch(66% .19 25); color: #fff; font-size: .7rem; padding: .1rem .45rem; border-radius: 999px; }
.tab.active .count { background: var(--primary-fg); color: var(--fg); }
.stats { grid-template-columns: repeat(6, 1fr); }
.status-pill[data-status="pending"] { background: oklch(82% .13 85 / .18); color: oklch(85% .12 85); }
.status-pill[data-status="active"] { background: oklch(78% .14 160 / .18); color: oklch(80% .15 160); }
.status-pill[data-status="suspended"] { background: oklch(63% .2 25 / .18); color: oklch(75% .15 25); }
.notice { background: oklch(82% .13 85 / .12); border: 1px solid oklch(82% .13 85 / .4); border-radius: var(--radius-sm); padding: .8rem 1rem; font-size: .92rem; color: var(--fg-muted); margin-bottom: 1rem; }
.linkish { background: none; border: 0; color: var(--fg-dim); font: inherit; font-size: .75rem; cursor: pointer; text-decoration: underline; padding: 0; }
.linkish:hover { color: var(--danger); }
.saved { color: var(--accent); font-size: .85rem; }
.ld-facts dd input { padding: .5rem .7rem; font-size: .9rem; }
@media (max-width: 960px) { .stats { grid-template-columns: repeat(3, 1fr); } .admin-top { flex-wrap: wrap; } }
