/* Customer Profiling — shared styles */
:root {
  --ink: #0f1a2a;
  --ink-2: #18263b;
  --ink-line: #26364d;
  --ink-text: #c9d3e0;
  --bg: #f3f5f8;
  --surface: #ffffff;
  --line: #e1e5eb;
  --line-strong: #cdd3dc;
  --text: #142030;
  --muted: #5b6676;
  --accent: #0e7c66;
  --accent-hover: #0a6654;
  --accent-soft: #e2f3ee;
  --warn: #a65a06;
  --warn-soft: #fcf0df;
  --danger: #b42318;
  --danger-soft: #fdeceb;
  --neutral-soft: #eef1f5;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(15, 26, 42, .06), 0 4px 16px rgba(15, 26, 42, .05);
  --font: ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -0.01em; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-name { font-size: 15px; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-size: 14px; font-weight: 600;
  height: 38px; padding: 0 16px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:focus-visible, .input:focus-visible, .tab:focus-visible, .nav-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: .6; cursor: wait; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--neutral-soft); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #9a1d14; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; height: 44px; font-size: 15px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.input {
  font: inherit; font-size: 15px; color: var(--text);
  height: 42px; padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.input:hover { border-color: #b4bcc8; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.input.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.password-wrap { position: relative; }
.password-wrap .input { width: 100%; padding-right: 64px; }
.toggle-pw {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  font: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted);
  background: none; border: 0; padding: 6px 8px; cursor: pointer; border-radius: 5px;
}
.toggle-pw:hover { color: var(--text); background: var(--neutral-soft); }

.alert {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--radius-sm);
  font-size: 14px; margin-bottom: 18px; border: 1px solid;
}
.alert-error { background: var(--danger-soft); border-color: #f5c9c5; color: #7a1a12; }
.alert-warn { background: var(--warn-soft); border-color: #f2d7b0; color: #6b3a03; }
.alert-success { background: var(--accent-soft); border-color: #b9e0d5; color: #064a3c; }
.alert svg { flex: none; margin-top: 2px; }

/* ---------- auth pages ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 44%) 1fr; }
.auth-aside {
  position: relative; overflow: hidden;
  background: var(--ink); color: #fff;
  padding: 40px 48px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-aside::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--ink-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--ink-line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 70% at 70% 60%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 70% 60%, #000 20%, transparent 75%);
  opacity: .55;
}
.auth-aside > * { position: relative; }
.auth-aside .brand { color: #fff; }
.auth-pitch h2 { font-size: 30px; font-weight: 650; max-width: 15ch; letter-spacing: -0.02em; }
.auth-pitch p { color: var(--ink-text); max-width: 40ch; margin: 14px 0 0; font-size: 15.5px; }
.auth-points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.auth-points li { display: flex; gap: 10px; align-items: center; color: #e3e9f1; font-size: 14.5px; }
.auth-points .dot { width: 22px; height: 22px; border-radius: 6px; background: rgba(14, 124, 102, .25); display: grid; place-items: center; flex: none; }
.auth-foot { color: #8695aa; font-size: 12.5px; }

.auth-main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; }
.auth-card .sub { color: var(--muted); margin: 6px 0 28px; }
.auth-switch { text-align: center; color: var(--muted); font-size: 14px; margin-top: 22px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

.done-state { text-align: center; padding: 8px 0; }
.done-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--accent-soft); display: grid; place-items: center; margin: 0 auto 18px; }
.done-state h1 { margin-bottom: 8px; }
.done-state p { color: var(--muted); margin: 0 0 24px; }

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-aside { padding: 20px 24px; }
  .auth-pitch, .auth-foot { display: none; }
  .auth-main { align-items: flex-start; padding: 32px 16px 48px; }
}
@media (max-width: 420px) { .form-row { grid-template-columns: 1fr; } }

/* ---------- app shell ---------- */
.app { min-height: 100vh; display: grid; grid-template-columns: 240px 1fr; }
.sidebar {
  background: var(--ink); color: var(--ink-text);
  display: flex; flex-direction: column;
  padding: 18px 12px; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { color: #fff; padding: 4px 10px 20px; }
.nav-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #6f7f95; padding: 14px 10px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--ink-text); font-size: 14px; font-weight: 500;
}
.nav-link:hover { background: var(--ink-2); color: #fff; text-decoration: none; }
.nav-link.active { background: var(--ink-2); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav-link.soon { opacity: .5; pointer-events: none; }
.nav-link svg { flex: none; opacity: .85; }
.nav-tag { margin-left: auto; font-size: 10.5px; font-weight: 600; color: #8695aa; border: 1px solid var(--ink-line); border-radius: 999px; padding: 0 7px; }
.nav-badge { margin-left: auto; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 700; border-radius: 999px; min-width: 20px; height: 20px; padding: 0 6px; display: grid; place-items: center; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--ink-line); padding: 14px 10px 0; display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center; flex: none; }
.who { min-width: 0; flex: 1; }
.who-name { color: #fff; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-role { font-size: 12px; color: #8695aa; text-transform: capitalize; }
.icon-btn { background: none; border: 0; color: #8695aa; padding: 6px; border-radius: 6px; cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { color: #fff; background: var(--ink-2); }

.main { min-width: 0; }
.topbar { display: none; }
.content { padding: 32px 36px 56px; max-width: 1200px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; }
.page-head p { color: var(--muted); margin: 4px 0 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { padding: 18px 20px; }
.kpi-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi-value { font-size: 28px; font-weight: 650; margin-top: 6px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: #a3acb9; }
.kpi-note { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.empty { padding: 56px 24px; text-align: center; }
.empty-art { margin: 0 auto 18px; width: 64px; height: 64px; border-radius: 16px; background: var(--accent-soft); display: grid; place-items: center; }
.empty h2 { font-size: 18px; font-weight: 650; }
.empty p { color: var(--muted); max-width: 52ch; margin: 8px auto 0; }
.plan { list-style: none; padding: 0; margin: 26px auto 0; max-width: 560px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; text-align: left; }
.plan li { border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13.5px; }
.plan strong { display: block; font-size: 13.5px; margin-bottom: 2px; }
.plan span { color: var(--muted); font-size: 12.5px; }

/* admin */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab {
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted);
  background: none; border: 0; border-radius: var(--radius-sm);
  padding: 7px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
}
.tab:hover { background: var(--neutral-soft); color: var(--text); }
.tab[aria-selected="true"] { background: var(--ink); color: #fff; }
.tab .count { font-size: 12px; font-variant-numeric: tabular-nums; background: var(--neutral-soft); color: var(--muted); border-radius: 999px; padding: 0 7px; }
.tab[aria-selected="true"] .count { background: var(--ink-line); color: #fff; }
.tab.has-pending .count { background: var(--accent); color: #fff; }
.search { height: 36px; width: 240px; font-size: 14px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 10px 16px; background: #fafbfc; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfc; }
.person { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.person .avatar { width: 30px; height: 30px; font-size: 12px; background: #dfe4ea; color: var(--ink); }
.person-name { font-weight: 600; }
.person-email { color: var(--muted); font-size: 13px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.actions { display: flex; gap: 6px; justify-content: flex-end; }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-pending { background: var(--warn-soft); color: var(--warn); }
.pill-approved { background: var(--accent-soft); color: var(--accent); }
.pill-rejected, .pill-disabled { background: var(--neutral-soft); color: var(--muted); }
.tag { font-size: 11.5px; font-weight: 600; border: 1px solid var(--line-strong); border-radius: 5px; padding: 1px 6px; color: var(--muted); margin-left: 6px; }
.tag-admin { border-color: #b9e0d5; color: var(--accent); background: var(--accent-soft); }
.table-empty { padding: 48px 16px; text-align: center; color: var(--muted); }

/* dialog & toast */
dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(420px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(15, 26, 42, .25); color: var(--text); }
dialog::backdrop { background: rgba(15, 26, 42, .45); }
.dialog-body { padding: 22px 22px 8px; }
.dialog-body h2 { font-size: 17px; font-weight: 650; }
.dialog-body p { color: var(--muted); margin: 8px 0 0; font-size: 14.5px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 18px 22px 20px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 500;
  padding: 10px 16px; border-radius: 8px; box-shadow: 0 10px 30px rgba(15, 26, 42, .3);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); }

@media (max-width: 1000px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .app.nav-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(15, 26, 42, .45); }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--ink); position: sticky; top: 0; z-index: 30; }
  .topbar .brand { color: #fff; }
  .topbar .icon-btn { color: #fff; }
  .content { padding: 24px 16px 48px; }
  .plan { grid-template-columns: 1fr; }
  .search { width: 100%; }
  .toolbar { flex-direction: column; align-items: stretch; }
}
@media (max-width: 480px) { .kpis { grid-template-columns: 1fr; } }

.form-hint { margin: -6px 0 18px; font-size: 12.5px; color: var(--muted); }
.auth-points .dot { font-size: 12px; font-weight: 700; color: #5fd3b5; }

/* Microsoft sign-in */
.btn-ms { background: #ffffff; color: #1f1f1f; border-color: #8c8c8c; gap: 12px; text-decoration: none; }
.btn-ms:hover { background: #f3f3f3; text-decoration: none; }
.btn-ms.loading { opacity: .7; pointer-events: none; }
.auth-card .btn-ms { margin-top: 4px; }
.linkbtn { font: inherit; font-weight: 600; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }
#dept-form { margin-top: 8px; }

/* =================================================================
   Customer profiling pages
   ================================================================= */
.main { min-width: 0; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.page-head.row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; letter-spacing: .01em; }
.eyebrow { font: 600 11.5px/1 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.small { font-size: 13px; color: var(--muted); }
.muted { color: #a3acb9; }
.btn svg { flex: none; }
.btn-xs { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 6px; }
.select { font: inherit; font-size: 14px; color: var(--text); height: 36px; padding: 0 30px 0 10px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); max-width: 100%; }
.select:focus, textarea.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
textarea.input { height: auto; min-height: 70px; padding: 10px 12px; resize: vertical; line-height: 1.45; }

/* summary strip */
.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.summary > div { padding: 16px 20px; border-left: 1px solid var(--line); min-width: 0; }
.summary > div:first-child { border-left: 0; }
.summary .lbl { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.summary .val { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.summary .val small { font-size: 14px; color: var(--muted); font-weight: 500; }
@media (max-width: 760px) { .summary { grid-template-columns: 1fr 1fr; } .summary > div:nth-child(3) { border-left: 0; } .summary > div:nth-child(n+3) { border-top: 1px solid var(--line); } }

/* customer table */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar .search { flex: 1 1 260px; width: auto; max-width: 360px; }
.cust-table { min-width: 1180px; }
.cust-table td { vertical-align: top; }
.cust-table tbody tr { cursor: pointer; }
.cust-name { font-weight: 700; color: var(--text); font-size: 14.5px; }
a.cust-name:hover { color: var(--accent); }
.th-sort { cursor: pointer; user-select: none; }
.th-sort:hover { color: var(--text); }
.chip { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; border-radius: 6px; padding: 2px 8px; background: var(--neutral-soft); color: var(--text); white-space: nowrap; }
.chip.seg { background: var(--accent-soft); color: var(--accent); border: 1px solid #b9e0d5; }
.chips-inline { display: flex; flex-wrap: wrap; gap: 4px; max-width: 220px; }
.chips-inline .chip { font-weight: 500; }
.more { font-size: 12px; color: var(--muted); align-self: center; }
.meter { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.bar-track { height: 6px; border-radius: 99px; background: var(--neutral-soft); overflow: hidden; flex: 1; }
.bar-fill { height: 100%; border-radius: 99px; background: var(--accent); }
.bar-fill.low { background: var(--warn); }
.meter span { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); width: 3.2em; text-align: right; }
.count-line { padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

/* form dialog */
dialog.form-dialog { width: min(480px, calc(100vw - 32px)); }
.form-dialog .dialog-body { display: flex; flex-direction: column; gap: 14px; padding-bottom: 4px; }
.form-dialog .field { margin: 0; }
.form-error { color: var(--danger); font-size: 13px; margin: 0; }

/* ---------- profile page ---------- */
.back { font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.p-head { display: flex; flex-direction: column; gap: 8px; }
.p-head h1 { font-size: clamp(26px, 3.6vw, 36px); font-weight: 800; letter-spacing: -0.025em; text-transform: uppercase; line-height: 1.1; overflow-wrap: anywhere; }
.p-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; color: var(--muted); font-size: 14px; }
.p-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.p-chips .chip { font-size: 12.5px; padding: 4px 10px; border-radius: 99px; }
.p-chips .chip.ok { background: var(--accent-soft); color: var(--accent); }
.p-chips .chip.warn { background: var(--warn-soft); color: var(--warn); }
.save-state { font-size: 12.5px; color: var(--muted); }
.save-state.saving { color: var(--warn); }

.p-grid { display: grid; gap: 16px; }
.p-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.p-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 980px) { .p-grid.cols-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 680px) { .p-grid.cols-3, .p-grid.cols-2 { grid-template-columns: 1fr; } }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pcard-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pcard-head h2 { font-size: 16px; font-weight: 700; }
.pcard-head .n { font: 600 12px ui-monospace, Consolas, monospace; color: var(--muted); }
.pcard-hint { margin: -8px 0 0; font-size: 13px; color: var(--muted); }

.kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 20px; }
.kv dt { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.kv dd { margin: 4px 0 0; font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 600px) { .kv { grid-template-columns: 1fr; } }

.flabel { font-size: 13px; font-weight: 600; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 8px; }
.flabel .note { font-weight: 500; color: var(--warn); font-size: 12px; }
.flabel .aux { font-weight: 500; color: var(--muted); font-size: 12px; }
.class-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
.class-grid .wide { grid-column: 1 / -1; }
@media (max-width: 680px) { .class-grid { grid-template-columns: 1fr; } }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt span { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 99px; font-size: 13.5px; font-weight: 600; background: var(--surface); cursor: pointer; user-select: none; transition: background .12s, border-color .12s; }
.opt span:hover { background: var(--neutral-soft); }
.opt input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.opt input[type="checkbox"]:checked + span::before { content: "✓"; font-size: 12px; }
.inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline .input { width: 130px; }
.calc { font-size: 13.5px; color: var(--muted); }
.calc strong { color: var(--text); }

/* removable tag chips */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags:empty::before { content: attr(data-empty); font-size: 13px; color: var(--muted); }
.tagx { display: inline-flex; align-items: center; gap: 2px; min-height: 30px; padding: 3px 4px 3px 12px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; }
.tagx.grey { background: var(--neutral-soft); color: var(--text); }
.tagx.amber { background: var(--warn-soft); color: var(--warn); }
.tagx button { font: inherit; width: 22px; height: 22px; border-radius: 50%; border: 0; background: none; color: inherit; cursor: pointer; display: grid; place-items: center; font-size: 15px; line-height: 1; opacity: .7; }
.tagx button:hover { background: rgba(255,255,255,.7); opacity: 1; }
.adder { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.adder .select { width: 100%; height: 40px; }

/* decision makers */
.people { display: flex; flex-direction: column; }
.person-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.person-row:first-child { border-top: 0; padding-top: 2px; }
.person-row .nm { font-weight: 700; font-size: 15px; }
.person-row .rl { font-size: 13px; color: var(--muted); }
.person-row .ln { font: 13.5px ui-monospace, Consolas, monospace; display: flex; gap: 4px 16px; flex-wrap: wrap; margin-top: 4px; }
.person-row .ln span { user-select: all; }
.person-row .bd { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.person-row .bd .soon { color: #b8326e; font-weight: 600; }
.person-row .acts { grid-column: 2; grid-row: 1 / span 4; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: flex-start; }
.btn-wa { border-color: var(--accent); color: var(--accent); background: var(--surface); text-decoration: none; }
.btn-wa:hover { background: var(--accent-soft); text-decoration: none; }
.cform { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 14px; border: 1px dashed var(--line-strong); border-radius: 10px; background: var(--bg); }
.cform .field { margin: 0; gap: 4px; }
.cform .field label { font-size: 12px; }
.cform .input { height: 38px; font-size: 14px; }
.cform .r { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
@media (max-width: 560px) { .cform { grid-template-columns: 1fr; } .person-row { grid-template-columns: 1fr; } .person-row .acts { grid-column: 1; grid-row: auto; justify-content: flex-start; margin-top: 8px; } }

/* meetings list (profile + calendar) */
.evlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.evlist li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); align-items: start; }
.evlist li:first-child { border-top: 0; padding-top: 0; }
.evdate { text-align: center; border-radius: 8px; background: var(--neutral-soft); padding: 4px 0; line-height: 1.15; }
.evdate b { display: block; font-size: 18px; }
.evdate span { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.evdate.bday { background: #fbe3ee; color: #b8326e; }
.evdate.bday span { color: #b8326e; }
.evlist .t { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.evlist .s { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.evlist .past { opacity: .55; }
.empty-mini { color: var(--muted); font-size: 13.5px; margin: 0; }

/* ---------- calendar ---------- */
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .cal-layout { grid-template-columns: 1fr; } }
.calbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.calbar .m { font-size: 17px; font-weight: 700; min-width: 150px; }
.navbtn { height: 32px; min-width: 32px; padding: 0 10px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 7px; cursor: pointer; font: 600 14px var(--font); color: var(--text); }
.navbtn:hover { background: var(--neutral-soft); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-left: auto; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--c); }
.grid7 { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.dow { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.day { min-height: 104px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 3px; text-align: left; font: inherit; color: inherit; cursor: pointer; border-top: 0; border-left: 0; min-width: 0; }
.day:nth-child(7n) { border-right: 0; }
.day:hover { background: #f6faf8; }
.day:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.day.out { background: #fafbfc; color: #a3acb9; }
.day.sel { box-shadow: inset 0 0 0 2px var(--accent); }
.day .n { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; align-self: flex-start; padding: 0 6px; border-radius: 99px; line-height: 20px; }
.day.today .n { background: var(--accent); color: #fff; }
.ev { font-size: 11.5px; line-height: 1.35; padding: 2px 6px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.ev.b { background: #fbe3ee; color: #b8326e; }
.ev.more { background: none; color: var(--muted); padding-left: 2px; font-weight: 500; }
.dots { display: none; gap: 3px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.dots i.b { background: #b8326e; }
@media (max-width: 640px) { .day { min-height: 56px; } .day .ev { display: none; } .dots { display: flex; } .legend { margin-left: 0; } }
.side { display: flex; flex-direction: column; gap: 16px; }
.dayp h2 { font-size: 16px; font-weight: 700; }
.evform { display: flex; flex-direction: column; gap: 10px; }
.evform .r2 { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 8px; }
.evform .field { margin: 0; gap: 4px; }
.evform .field label { font-size: 12px; }
.evform .input { height: 38px; font-size: 14px; }
.evform textarea.input { height: auto; }
.evform .r { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.linkbtn.danger { color: var(--danger); }

/* drop lists page */
.lists-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 860px) { .lists-grid { grid-template-columns: 1fr; } }
.addrow { display: flex; gap: 8px; }
.addrow .input { height: 38px; font-size: 14px; }

/* layout fixes */
.content { display: flex; flex-direction: column; gap: 18px; }
.content > .page-head { margin-bottom: 4px; }
.content > .back { align-self: flex-start; }
.cust-table td:first-child { min-width: 230px; }
.p-head { margin-bottom: 2px; }

/* summary, sales */
.summary-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; max-width: 80ch; }
.warn-text { color: var(--warn); font-weight: 600; }
.chips-inline.wide { max-width: 360px; }
.chip.link a { color: var(--text); text-decoration: none; }
.chip.link a:hover { color: var(--accent); }
.sales-table { min-width: 900px; }
dialog.form-dialog.wide { width: min(680px, calc(100vw - 32px)); }
dialog.form-dialog { max-height: calc(100vh - 32px); }
.cform.plain { border: 0; padding: 0; background: none; }
.role-select { margin-right: 4px; }
