/* ============================================================
   localjobs — design system
   Direction-A tokens (light + dark), all components
   ============================================================ */

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-weight: 400 800;
  font-display: swap;
  src: url('/static/fonts/PlusJakartaSans.woff2') format('woff2');
}

/* ── Tokens ──────────────────────────────────────────────── */
:root {
  --bg:       #F8FAFC;
  --card:     #FFFFFF;
  --ink:      #0F172A;
  --mut:      #64748B;
  --bd:       #E4ECFC;
  --side:     #F8FAFC;

  --pri:      #2563EB;
  --pri-soft: #EFF4FF;

  --grn:      #059669;
  --grn-soft: #DCFCE7;
  --grn-ink:  #047857;

  --blu-soft: #DBEAFE;
  --blu-ink:  #1D4ED8;

  --amb-bg:   #FFF7ED;
  --amb-bd:   #FED7AA;
  --amb-ink:  #9A3412;
  --amb-pill: #FFEDD5;

  --red-bg:   #FEF2F2;
  --red-bd:   #FECACA;
  --red-ink:  #B91C1C;
  --red-pill: #FEE2E2;

  --chip:     #F1F5FD;

  --sidebar-w:   172px;
  --bottomtab-h: 60px;
}

[data-theme="dark"] {
  --bg:       #0A111E;
  --card:     #131C30;
  --ink:      #E6EDF7;
  --mut:      #93A2BC;
  --bd:       #25324B;
  --side:     #0C1424;

  --pri:      #4D8DF7;
  --pri-soft: #16233E;

  --grn:      #34D399;
  --grn-soft: #0F2A24;
  --grn-ink:  #6EE7B7;

  --blu-soft: #15294A;
  --blu-ink:  #9CC2FF;

  --amb-bg:   #2A1E0E;
  --amb-bd:   #5A3A12;
  --amb-ink:  #FCD9A8;
  --amb-pill: #3A2A12;

  --red-bg:   #2A0E0E;
  --red-bd:   #5A1212;
  --red-ink:  #FCA5A5;
  --red-pill: #3A1414;

  --chip:     #1B2740;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--pri); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Icons ───────────────────────────────────────────────── */
.ic {
  width: 16px; height: 16px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -3px; flex-shrink: 0;
}
.ic-sm { width: 13px; height: 13px; }

/* ── Shell / layout ──────────────────────────────────────── */
.shell {
  display: flex;
  min-height: 100vh;
}

.content {
  flex: 1;
  min-width: 0;
  padding: 20px 24px;
  /* leave room for the fixed mobile top bar + bottom tabs */
  padding-top: 64px;
  padding-bottom: calc(var(--bottomtab-h) + 16px);
}

@media (min-width: 640px) {
  .content {
    margin-left: var(--sidebar-w);
    padding-top: 20px;
    padding-bottom: 20px;
  }
}

/* ── Sidebar (desktop) ───────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--side);
  border-right: 1px solid var(--bd);
  padding: 15px 12px;
  display: none;
  flex-direction: column;
  gap: 3px;
  z-index: 100;
}

@media (min-width: 640px) {
  .sidebar { display: flex; }
}

.sidebar-logo {
  font-weight: 800;
  color: var(--pri);
  font-size: 16px;
  letter-spacing: -0.02em;
  padding: 4px 8px 13px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--mut);
  cursor: pointer;
  text-decoration: none;
}

.nav-item:hover { background: var(--chip); color: var(--ink); text-decoration: none; }
.nav-item.active { background: var(--pri-soft); color: var(--pri); }

.nav-add {
  display: flex;
  align-items: center;
  gap: 7px;
  justify-content: center;
  margin-top: 7px;
  padding: 9px;
  border-radius: 9px;
  background: var(--pri);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
}

.nav-add:hover { opacity: 0.9; text-decoration: none; color: #fff; }

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 10px;
}

/* ── Theme toggle pill ───────────────────────────────────── */
.theme-toggle {
  display: inline-flex;
  background: var(--chip);
  border: 1px solid var(--bd);
  border-radius: 999px;
  padding: 2px;
  width: max-content;
}

.theme-toggle button {
  width: 26px; height: 22px;
  border-radius: 999px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mut);
  cursor: pointer;
  padding: 0;
}

.theme-toggle button.active {
  background: var(--card);
  color: var(--pri);
  box-shadow: 0 1px 3px rgba(2,6,23,.18);
}

/* ── User pill ───────────────────────────────────────────── */
.user-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.user-avatar {
  width: 27px; height: 27px;
  border-radius: 999px;
  background: var(--pri);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Bottom tab bar (mobile) ─────────────────────────────── */
.bottom-tabs {
  display: flex;
  justify-content: space-around;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottomtab-h);
  background: var(--card);
  border-top: 1px solid var(--bd);
  padding: 8px 6px 10px;
  z-index: 100;
}

@media (min-width: 640px) {
  .bottom-tabs { display: none; }
}

/* ── Mobile top bar (theme / users / sign out) ───────────── */
.mobile-top {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--bd);
  z-index: 100;
}
.mobile-top-logo {
  font-weight: 800;
  color: var(--pri);
  font-size: 16px;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.mobile-top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.mobile-top-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 9px;
  border: 1px solid var(--bd);
  background: var(--card);
  color: var(--mut);
  cursor: pointer;
  text-decoration: none;
}
.mobile-top-btn.active { color: var(--pri); border-color: var(--pri); background: var(--pri-soft); }
@media (min-width: 640px) {
  .mobile-top { display: none; }
}

/* ── Form error summary ──────────────────────────────────── */
.form-errors {
  border: 1px solid var(--red-bd);
  background: var(--red-bg);
  color: var(--red-ink);
  border-radius: 10px;
  padding: 11px 13px;
  margin-bottom: 14px;
  font-size: 13px;
}
.form-errors ul { margin: 6px 0 0; padding-left: 18px; }
.form-errors li { margin: 2px 0; }

/* ── To-do row: title + place ────────────────────────────── */
.todo-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.todo-place { font-size: 11px; color: var(--mut); text-decoration: none; }
.todo-place:hover { color: var(--pri); text-decoration: underline; }
.todo-end { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.todo-del { background: none; border: none; color: var(--mut); cursor: pointer; padding: 4px; display: flex; border-radius: 6px; }
.todo-del:hover { color: var(--red-ink); background: var(--red-bg); }
.todo-remind { background: none; border: none; color: var(--mut); cursor: pointer; padding: 4px; display: flex; border-radius: 6px; }
.todo-remind:hover { color: var(--pri); background: var(--pri-soft); }
.tl-edit { color: var(--mut); display: inline-flex; align-items: center; }
.tl-edit:hover { color: var(--pri); }

/* ── Assignment ──────────────────────────────────────────── */
.badge-for { color: var(--pri); background: var(--pri-soft); }
.badge-assignee { color: var(--blu-ink); background: var(--blu-soft); }
.tl-logged-by { font-size: 11px; color: var(--mut); font-style: italic; }
.assigned-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--pri-soft);
  color: var(--pri);
  border: 1px solid var(--bd);
  border-radius: 10px;
  padding: 10px 13px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--mut);
  text-decoration: none;
  flex: 1;
}

.tab-item.active { color: var(--pri); }
.tab-item:hover { text-decoration: none; }

.tab-fab {
  width: 21px; height: 21px;
  border-radius: 8px;
  background: var(--grn);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  border: 1px solid var(--bd);
  border-radius: 12px;
  padding: 13px 14px;
  background: var(--card);
}

/* ── Page headers ────────────────────────────────────────── */
.page-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.page-sub {
  font-size: 12px;
  color: var(--mut);
  margin-top: 3px;
}

/* ── Section labels ──────────────────────────────────────── */
.sec-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--mut);
}

.sec-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

/* ── KPI strip ───────────────────────────────────────────── */
.kpi-strip {
  display: flex;
  gap: 11px;
  flex-wrap: wrap;
  margin: 15px 0 6px;
}

.kpi-card {
  flex: 1;
  min-width: 108px;
  border: 1px solid var(--bd);
  border-radius: 12px;
  padding: 11px 13px;
  background: var(--card);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--kpi-color, var(--pri));
}

.kpi-num {
  font-size: 23px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.kpi-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--mut);
  margin-top: 1px;
}

/* ── Two-column layout ───────────────────────────────────── */
.cols { display: flex; gap: 15px; align-items: flex-start; margin-top: 10px; }
.col-l { flex: 1.35; min-width: 0; display: flex; flex-direction: column; gap: 13px; }
.col-r { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 13px; }

@media (max-width: 639px) {
  .cols { flex-direction: column; }
  .col-l, .col-r { flex: none; width: 100%; }
}

/* ── Follow-up groups ────────────────────────────────────── */
.group-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 11px 0 3px;
}

.followup-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 0;
  border-bottom: 1px solid var(--bd);
}

.followup-row:last-child { border-bottom: 0; }

.followup-text { flex: 1; min-width: 0; }
.followup-name { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.followup-task { font-size: 11px; color: var(--mut); margin-top: 1px; }

/* ── Circular checkbox / toggle ──────────────────────────── */
.round-check {
  width: 18px; height: 18px;
  border-radius: 999px;
  border: 2px solid var(--bd);
  flex-shrink: 0;
  background: transparent;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

form.toggle-form { display: inline; }

.round-check.done {
  background: var(--grn);
  border-color: var(--grn);
  color: #fff;
}

/* ── Badges / pills ──────────────────────────────────────── */
.badge {
  font-size: 10px;
  font-weight: 800;
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
}

.badge-overdue { color: var(--red-ink); background: var(--red-pill); }
.badge-today   { color: var(--amb-ink); background: var(--amb-pill); }
.badge-week    { color: var(--blu-ink); background: var(--blu-soft); }
.badge-inquiry { color: var(--mut);     background: var(--chip); }
.badge-applied { color: var(--blu-ink); background: var(--blu-soft); }
.badge-interview { color: var(--grn-ink); background: var(--grn-soft); }
.badge-offer   { color: var(--pri);     background: var(--pri-soft); }
.badge-closed  { color: var(--mut);     background: var(--chip); }

/* ── To-do row ───────────────────────────────────────────── */
.todo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.todo-text {
  font-size: 12.5px;
  color: var(--ink);
  font-weight: 600;
}

.todo-text.done {
  color: var(--mut);
  text-decoration: line-through;
}

/* ── Add-row dashed placeholder ──────────────────────────── */
.add-row {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1.5px dashed var(--bd);
  border-radius: 9px;
  padding: 8px 11px;
  color: var(--mut);
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
}

/* ── Recently added mini-rows ────────────────────────────── */
.mini-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  font-size: 12px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.mini-row:hover { color: var(--pri); text-decoration: none; }

.mini-pill {
  font-size: 9px;
  font-weight: 800;
  border-radius: 999px;
  padding: 2px 7px;
  margin-left: auto;
}

/* ── Status stepper ──────────────────────────────────────── */
.stepper {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 15px 0 3px;
  flex-wrap: wrap;
}

.step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--mut);
}

.step-circle {
  width: 19px; height: 19px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bd);
  color: var(--mut);
  background: var(--card);
  font-size: 10px;
  font-weight: 700;
}

.step.done .step-circle { background: var(--grn); border-color: var(--grn); color: #fff; }
.step.done { color: var(--grn-ink); }
.step.current .step-circle { background: var(--pri); border-color: var(--pri); color: #fff; }
.step.current { color: var(--pri); }

.step-line { width: 18px; height: 2px; background: var(--bd); }

/* ── Chips strip ─────────────────────────────────────────── */
.chips {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 13px 0 16px;
}

.chip {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  background: var(--chip);
  border: 1px solid var(--bd);
  border-radius: 999px;
  padding: 4px 10px;
}

.chip b { color: var(--grn-ink); }

/* ── Next-step callout ───────────────────────────────────── */
.next-step-card {
  border-color: var(--amb-bd);
  background: var(--amb-bg);
}

.next-step-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--amb-ink);
  margin-bottom: 8px;
}

.next-step-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.next-step-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  flex: 1;
}

.due-pill {
  font-size: 11px;
  font-weight: 800;
  color: var(--amb-ink);
  background: var(--amb-pill);
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
}

/* ── Contact-log timeline ────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 18px;
  margin-top: 4px;
}

.tl-event {
  position: relative;
  padding-bottom: 14px;
}

.tl-event::before {
  content: '';
  position: absolute;
  left: -13px; top: 3px;
  width: 9px; height: 9px;
  border-radius: 999px;
  background: var(--pri);
  box-shadow: 0 0 0 3px var(--pri-soft);
}

.tl-event::after {
  content: '';
  position: absolute;
  left: -9px; top: 13px; bottom: -1px;
  width: 2px;
  background: var(--bd);
}

.tl-event:last-child { padding-bottom: 0; }
.tl-event:last-child::after { display: none; }

.tl-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.tl-date { color: var(--mut); font-weight: 600; }

.tl-method {
  font-size: 10px;
  font-weight: 700;
  color: var(--blu-ink);
  background: var(--blu-soft);
  border-radius: 999px;
  padding: 1px 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tl-note {
  font-size: 11px;
  color: var(--mut);
  margin-top: 3px;
  line-height: 1.5;
}

/* ── Detail key-value rows ───────────────────────────────── */
.kv-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--ink);
  padding: 5px 0;
  font-weight: 600;
}

.kv-row .ic { color: var(--mut); }

.notes-text {
  font-size: 12px;
  color: var(--mut);
  line-height: 1.6;
}

/* ── Attachment rows ─────────────────────────────────────── */
.att-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--bd);
  border-radius: 9px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--ink);
  font-weight: 600;
}

.att-row .ic { color: var(--mut); }

.att-dl { margin-left: auto; color: var(--pri); }

/* ── Dropzone upload ─────────────────────────────────────── */
.dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1.5px dashed var(--pri);
  border-radius: 9px;
  padding: 11px;
  color: var(--pri);
  font-size: 12px;
  font-weight: 700;
  background: var(--pri-soft);
  cursor: pointer;
}

/* ── Breadcrumb ──────────────────────────────────────────── */
.breadcrumb {
  font-size: 12px;
  color: var(--mut);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 11px;
}

.breadcrumb a { color: var(--mut); }
.breadcrumb a:hover { color: var(--pri); }

/* ── Page top row (title + actions) ──────────────────────── */
.page-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.page-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 9px;
  border: 1px solid var(--bd);
  color: var(--ink);
  background: var(--card);
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  line-height: 1;
}

.btn:hover { background: var(--chip); text-decoration: none; }
.btn.pri { background: var(--pri); color: #fff; border-color: var(--pri); }
.btn.pri:hover { opacity: 0.9; }
.btn.icon { width: 33px; padding: 7px 0; justify-content: center; }
.btn.danger { color: var(--red-ink); border-color: var(--red-bd); background: var(--red-bg); }

/* ── Search bar ──────────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--bd);
  border-radius: 10px;
  padding: 9px 11px;
  color: var(--mut);
  font-size: 12px;
  margin-bottom: 10px;
}

.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  color: var(--ink);
  outline: none;
}

.search-bar input::placeholder { color: var(--mut); }

/* ── Filter chips ────────────────────────────────────────── */
.filter-chips {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.filter-chip {
  font-size: 11px;
  font-weight: 700;
  color: var(--mut);
  background: var(--card);
  border: 1px solid var(--bd);
  border-radius: 999px;
  padding: 5px 11px;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}

.filter-chip:hover { background: var(--chip); text-decoration: none; }
.filter-chip.active { background: var(--pri); color: #fff; border-color: var(--pri); }

/* ── Place card (list) ───────────────────────────────────── */
.place-card {
  background: var(--card);
  border: 1px solid var(--bd);
  border-radius: 13px;
  padding: 11px 12px;
  margin-bottom: 9px;
  text-decoration: none;
  display: block;
  color: var(--ink);
}

.place-card:hover { border-color: var(--pri); text-decoration: none; }

.place-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.place-name { font-size: 13px; font-weight: 700; color: var(--ink); }
.place-meta { font-size: 11px; color: var(--mut); margin-top: 5px; display: flex; align-items: center; gap: 6px; }

/* ── Form sections ───────────────────────────────────────── */
.form-section {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--mut);
  margin: 17px 0 11px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--bd);
}

.field { margin-bottom: 13px; }

.label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}

.label .req { color: #DC2626; }

.input {
  width: 100%;
  border: 1px solid var(--bd);
  border-radius: 9px;
  padding: 10px 11px;
  font-size: 13px;
  color: var(--ink);
  background: var(--card);
  font-family: inherit;
  outline: none;
}

.input:focus { border-color: var(--pri); box-shadow: 0 0 0 3px var(--pri-soft); }
.input::placeholder { color: #94A3B8; }

textarea.input { resize: vertical; min-height: 80px; }

.field-help {
  font-size: 10.5px;
  color: var(--mut);
  margin-top: 5px;
}

/* ── Segmented control ───────────────────────────────────── */
.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.seg-opt {
  font-size: 12px;
  font-weight: 600;
  color: var(--mut);
  background: var(--card);
  border: 1px solid var(--bd);
  border-radius: 8px;
  padding: 8px 13px;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.seg-opt:hover { background: var(--chip); }
.seg-opt.selected { background: var(--pri-soft); color: var(--pri); border-color: var(--pri); }
.seg-opt.selected.green { background: var(--grn-soft); color: var(--grn-ink); border-color: var(--grn); }

/* Hidden radios behind seg-opts */
.seg input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }

.form-grid {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.form-grid > .field { flex: 1; min-width: 170px; margin-bottom: 0; }

.form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--bd);
}

/* ── Inline log form ─────────────────────────────────────── */
.log-form { margin-top: 10px; }
.log-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.log-grid > .field { flex: 1; min-width: 130px; margin-bottom: 0; }

/* ── Todos page ──────────────────────────────────────────── */
.todo-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  align-items: flex-end;
}

.todo-add-row .input { flex: 1 1 160px; min-width: 0; }

/* Icon-only "due date & reminders" toggle next to the Add button */
.todo-add-when { flex: 0 0 auto; padding: 10px 12px; }

/* Collapsed-by-default scheduling panel under the add row */
.todo-add-details { margin-bottom: 16px; }
.todo-add-details .field { margin-bottom: 0; }
.todo-when-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.todo-when-row .input--date { flex: 0 0 150px; width: auto; }

/* ── Flash messages ──────────────────────────────────────── */
.flash-list { list-style: none; margin-bottom: 12px; }

.flash-msg {
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.flash-error { background: var(--red-bg); color: var(--red-ink); border: 1px solid var(--red-bd); }
.flash-ok    { background: var(--grn-soft); color: var(--grn-ink); }

/* ── Login page ──────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-box {
  width: 100%;
  max-width: 360px;
}

.login-brand {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo {
  font-size: 28px;
  font-weight: 800;
  color: var(--pri);
  letter-spacing: -0.03em;
}

.login-tag {
  font-size: 12px;
  color: var(--mut);
  margin-top: 4px;
}

.login-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.signin-btn {
  width: 100%;
  justify-content: center;
  padding: 12px;
  font-size: 14px;
  margin-top: 4px;
}

.login-note {
  font-size: 11px;
  color: var(--mut);
  text-align: center;
  line-height: 1.5;
}

.error-msg {
  color: var(--red-ink);
  font-size: 13px;
  font-weight: 600;
  background: var(--red-bg);
  border: 1px solid var(--red-bd);
  border-radius: 9px;
  padding: 9px 12px;
}

/* ── Admin pages ─────────────────────────────────────────── */
.user-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.user-table th { font-size: 10px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--mut); padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--bd); }
.user-table td { padding: 10px; border-bottom: 1px solid var(--bd); color: var(--ink); }
.user-table tr:last-child td { border-bottom: 0; }

/* ── Empty states ────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--mut);
}

.empty-state p { font-size: 13px; margin-top: 8px; }

/* ── KPI color variants ──────────────────────────────────── */
.kpi--overdue    { --kpi-color: #DC2626; }
.kpi--today      { --kpi-color: #EA580C; }
.kpi--interviews { --kpi-color: #059669; }
.kpi--places     { --kpi-color: #2563EB; }

/* ── Utility spacing / display classes ──────────────────── */
.mb-0  { margin-bottom: 0; }
.mb-4  { margin-bottom: 4px; }
.mb-6  { margin-bottom: 6px; }
.mb-7  { margin-bottom: 7px; }
.mb-9  { margin-bottom: 9px; }
.mb-10 { margin-bottom: 10px; }
.mb-14 { margin-bottom: 14px; }
.mb-16 { margin-bottom: 16px; }

.mt-8  { margin-top: 8px; }
.mt-10 { margin-top: 10px; }
.mt-16 { margin-top: 16px; }

.ml-auto { margin-left: auto; }

/* ── Label display:contents (for seg-opt radio wrappers) ── */
.label-contents { display: contents; }

/* ── Segmented-control label reset ─────────────────────── */
label.label-contents { display: contents; }

/* ── Stepper button (native reset) ──────────────────────── */
.step-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

/* ── Inline-form display:inline helper ──────────────────── */
.form-inline { display: inline; }

/* ── Transparent icon button variant ────────────────────── */
.btn.icon--pending {
  background: transparent;
  border-color: var(--amb-bd);
}

/* ── Small button variant ────────────────────────────────── */
.btn-sm {
  font-size: 11px;
  padding: 4px 9px;
}

/* ── Error text helper ───────────────────────────────────── */
.text-error { color: var(--red-ink); }
.text-mut   { color: var(--mut); }
.text-grn   { color: var(--grn-ink); }
.text-blu   { color: var(--blu-ink); }
.text-amb   { color: var(--amb-ink); }

/* ── Breadcrumb separator ────────────────────────────────── */
.bc-sep { opacity: .6; }

/* ── Log form border-bottom divider ─────────────────────── */
.log-form--divider {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--bd);
}

/* ── Card narrow (max-width) ─────────────────────────────── */
.card--narrow { max-width: 480px; }

/* ── Muted small paragraph ───────────────────────────────── */
.p-muted {
  font-size: 12px;
  color: var(--mut);
  padding: 8px 0;
}

.p-muted-sm {
  font-size: 12px;
  color: var(--mut);
}

/* ── Hidden utility ──────────────────────────────────────── */
.hidden { display: none; }

/* ── Date input constrained width ───────────────────────── */
.input--date { max-width: 160px; }
.input--time { max-width: 120px; }
.time-group { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; }
/* Keep each time select a fixed, compact width (overriding .input's
   width:100%) so the hour / minute / AM-PM group stays tidy and never
   stretches full-width or stacks — in both the add-to-do row and the task
   edit form. The group as a whole wraps to the next line as one unit. */
.time-group .input { flex: 0 0 auto; width: 4.5rem; min-width: 0; }
.input--hr { padding-left: 6px; padding-right: 6px; }
.time-colon { color: var(--mut); }

/* ── Page title with bottom margin variants ──────────────── */
.page-title--mb4 { margin-bottom: 4px; }

/* ── Form top margin ─────────────────────────────────────── */
.form--mt { margin-top: 16px; }

/* ── sidebar logout form reset ───────────────────────────── */
.form--no-margin { margin: 0; }

/* ── Page top with bottom margin ─────────────────────────── */
.page-top--mb14 { margin-bottom: 14px; }
.page-top--mb16 { margin-bottom: 16px; }

/* ── Sec-label with bottom margin ────────────────────────── */
.sec-label--mb6  { margin-bottom: 6px; }
.sec-label--mb7  { margin-bottom: 7px; }
.sec-label--mb9  { margin-bottom: 9px; }
.sec-label--mb10 { margin-bottom: 10px; }

/* ── Field flex helpers (for form-grid children) ─────────── */
.field--flex2 { flex: 2; margin-bottom: 0; }
.field--mb0   { margin-bottom: 0; }

/* ── tl-who: muted small text in timeline header ──────────── */
.tl-who { color: var(--mut); font-size: 11px; }

/* ── tl-outcome: highlighted outcome text ─────────────────── */
.tl-outcome { color: var(--grn-ink); }

/* ── Table empty cell ────────────────────────────────────── */
.td-empty {
  color: var(--mut);
  text-align: center;
  padding: 20px;
}

/* ── Sidebar sign-out button full-width ──────────────────── */
.btn--full-center {
  width: 100%;
  justify-content: center;
  font-size: 11px;
}

/* ── Attachment list ─────────────────────────────────────── */
.att-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}

.att-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--bd);
}

.att-item:last-child { border-bottom: none; }

.att-link {
  font-size: 13px;
  color: var(--pri);
  text-decoration: none;
  word-break: break-all;
}

.att-link:hover { text-decoration: underline; }

.att-kind {
  color: var(--mut);
  font-size: 11px;
  font-weight: 400;
}

/* ── Attachment upload form ───────────────────────────────── */
.att-upload-form { margin-top: 12px; }

.att-upload-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.att-kind-select { max-width: 140px; }

.att-file-label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  min-width: 130px;
}

.att-file-text {
  flex: 1;
  font-size: 13px;
  color: var(--mut);
  border: 1px solid var(--bd);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--bg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.att-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

/* ── Google Places lookup widget ────────────────────────── */
.lookup-box {
  margin-bottom: 4px;
}

.lookup-results {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--bd);
  border-radius: 9px;
  background: var(--card);
  overflow: hidden;
  margin-top: 4px;
}

.lookup-results:empty {
  display: none;
}

.lookup-result {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--bd);
  font-size: 13px;
  color: var(--ink);
}

.lookup-result:last-child {
  border-bottom: none;
}

.lookup-result:hover {
  background: var(--pri-soft);
  color: var(--pri);
}

.lookup-result-name {
  font-weight: 700;
}

.lookup-result-addr {
  font-size: 11px;
  color: var(--mut);
  margin-top: 2px;
}

.lookup-result--error {
  color: var(--red-ink);
  cursor: default;
  font-size: 12px;
  padding: 10px 12px;
}

/* ── Small danger button for remove ──────────────────────── */
.btn-danger-sm {
  font-size: 11px;
  padding: 4px 8px;
  color: var(--red-ink);
  border: 1px solid var(--red-bd);
  background: var(--red-pill);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-danger-sm:hover { background: var(--red-bg); }

/* ── Attachment list (preview + download + remove actions) ── */
.att-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--bd);
  flex-wrap: wrap;
}

.att-item:last-child { border-bottom: none; }

.att-name {
  font-size: 13px;
  color: var(--ink);
  flex: 1;
  min-width: 0;
  word-break: break-all;
}

.att-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.att-hint {
  font-size: 11px;
  color: var(--mut);
  margin-top: 6px;
  margin-bottom: 0;
}

/* ── Attachment preview page ─────────────────────────────── */
.preview-card {
  padding: 20px;
}

.att-kind-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mut);
  margin-bottom: 12px;
}

.preview-pdf-msg {
  font-size: 13px;
  color: var(--mut);
  margin-bottom: 14px;
}

.preview-text {
  font-family: ui-monospace, "Cascadia Code", "Fira Code", monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--bg);
  border: 1px solid var(--bd);
  border-radius: 8px;
  padding: 16px;
  color: var(--ink);
  margin: 0;
  max-height: 80vh;
  overflow-y: auto;
}

.preview-doc {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
  max-width: 72ch;
}

.preview-doc h1,
.preview-doc h2,
.preview-doc h3,
.preview-doc h4,
.preview-doc h5,
.preview-doc h6 {
  margin: 1.2em 0 0.4em;
  line-height: 1.3;
}

.preview-doc p { margin: 0.7em 0; }

.preview-doc ul,
.preview-doc ol {
  padding-left: 1.6em;
  margin: 0.6em 0;
}

.preview-doc code {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  background: var(--bg);
  border: 1px solid var(--bd);
  border-radius: 4px;
  padding: 1px 5px;
}

.preview-doc pre {
  background: var(--bg);
  border: 1px solid var(--bd);
  border-radius: 8px;
  padding: 14px;
  overflow-x: auto;
  font-size: 12px;
}

.preview-doc pre code {
  background: none;
  border: none;
  padding: 0;
}

.preview-doc blockquote {
  border-left: 3px solid var(--bd);
  margin: 0.8em 0;
  padding: 4px 0 4px 14px;
  color: var(--mut);
}

.preview-doc table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}

.preview-doc th,
.preview-doc td {
  border: 1px solid var(--bd);
  padding: 6px 10px;
  text-align: left;
}

.preview-doc th {
  background: var(--bg);
  font-weight: 700;
}

.preview-doc a {
  color: var(--pri);
  text-decoration: underline;
}

/* ── Reminder checkboxes ─────────────────────────────────── */
.reminder-checks ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.reminder-checks li { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--fg); }
.reminder-checks input[type="checkbox"] { accent-color: var(--pri); width: 14px; height: 14px; cursor: pointer; }

/* ── Task detail page ────────────────────────────────────── */
.reminder-list { list-style: none; margin: 0 0 10px; padding: 0; }
.reminder-item { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--bd); }
.reminder-item:last-child { border-bottom: none; }
.reminder-label { display: flex; align-items: center; gap: 6px; font-size: 13px; }


/* ── Detail card: multi-line hours ───────────────────────── */
.kv-row--top { align-items: flex-start; }
.kv-hours { white-space: pre-line; }
.lbl-hint { color: var(--mut); font-weight: 500; text-transform: none; letter-spacing: 0; }

/* ── Admin users table actions ───────────────────────────── */
.user-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ── Places list: second meta row ────────────────────────── */
.place-meta--row2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.place-contact { font-size: 11px; color: var(--mut); }

/* ── Clickable KPI cards & dashboard task links ──────────── */
a.kpi-card { text-decoration: none; color: inherit; display: block; }
a.kpi-card:hover { border-color: var(--pri); text-decoration: none; }
a.followup-task { display: block; color: var(--mut); text-decoration: none; }
a.followup-task:hover { text-decoration: underline; }
a.todo-text { text-decoration: none; }
a.todo-text:hover { text-decoration: underline; }

/* ── Password show/hide toggle ───────────────────────────── */
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 40px; }
.pw-toggle {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; color: var(--mut); cursor: pointer;
}
.pw-toggle svg:last-child { display: none; }
.pw-toggle.show svg:first-child { display: none; }
.pw-toggle.show svg:last-child { display: inline; }
