/* Expert Rolodex and the CHR tools page. Same look as the calendar and records tracker. */
:root {
  --bg: #f5f7fa; --surface: #fff; --surface-2: #f8fafc;
  --border: #e4e8ee; --border-soft: #eef1f5;
  --text: #0f172a; --muted: #64748b; --dim: #94a3b8;
  --accent: #1d4ed8; --accent-soft: #eff5ff; --ring: rgba(29, 78, 216, .18);
  --past-bg: #fef2f2; --past-bd: #fecaca; --past-fg: #991b1b;
  --urgent-bg: #fff7ed; --urgent-bd: #fed7aa; --urgent-fg: #9a3412;
  --behind-bg: #fffbeb; --behind-bd: #fde68a; --behind-fg: #854d0e;
  --ontrack-bg: #ecfdf5; --ontrack-bd: #a7f3d0; --ontrack-fg: #065f46;
  --complete-bg: #eff5ff; --complete-bd: #d6e3ff; --complete-fg: #1d4ed8;
  --closed-bg: #f1f5f9; --closed-bd: #e2e8f0; --closed-fg: #475569;
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px;
  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; margin: 0; }
mark { background: #fef08a; color: inherit; border-radius: 2px; padding: 0 1px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.proto-note {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 14px;
  padding: 7px 16px; background: #fff7ed; border-bottom: 1px solid #fed7aa;
  color: #7c2d12; font-size: 13px; text-align: center;
}
.link-btn { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }

.topbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px;
  padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand h1 { font-size: 18px; letter-spacing: -.01em; }
.brand .subtitle { color: var(--muted); font-size: 12.5px; }
.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { height: 34px; width: auto; flex: none; }
.brand-text { display: flex; flex-direction: column; gap: 2px; }
#topnav { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
#topnav a {
  padding: 7px 12px; border-radius: var(--r-sm); color: var(--muted);
  text-decoration: none; font-weight: 500; font-size: 14px;
}
#topnav a:hover { background: var(--surface-2); color: var(--text); }
#topnav a.active { background: var(--accent-soft); color: var(--accent); }

.page { max-width: 1180px; margin: 0 auto; padding: 22px 24px 64px; }
.page-narrow { max-width: 860px; }
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px;
}
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 10px; }
.panel h2 { font-size: 16px; }
.sub { color: var(--muted); font-size: 13.5px; margin: 2px 0 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 6px 13px; border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); font: 500 14px var(--font); text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #1e40af; }
.btn-sm { min-height: 30px; padding: 3px 10px; font-size: 13px; }

input, select, textarea {
  width: 100%; min-height: 36px; padding: 6px 10px; border: 1px solid #cbd5e1; border-radius: var(--r-sm);
  background: #fff; color: var(--text); font: 14px var(--font);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.field { display: block; margin-bottom: 11px; }
.field-label { display: block; margin-bottom: 3px; font-size: 13px; font-weight: 600; }
.field-hint { display: block; margin-top: 3px; color: var(--muted); font-size: 12.5px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

.pill {
  display: inline-block; padding: 2px 9px; border: 1px solid; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.pill-past { background: var(--past-bg); border-color: var(--past-bd); color: var(--past-fg); }
.pill-urgent { background: var(--urgent-bg); border-color: var(--urgent-bd); color: var(--urgent-fg); }
.pill-behind { background: var(--behind-bg); border-color: var(--behind-bd); color: var(--behind-fg); }
.pill-ontrack { background: var(--ontrack-bg); border-color: var(--ontrack-bd); color: var(--ontrack-fg); }
.pill-complete { background: var(--complete-bg); border-color: var(--complete-bd); color: var(--complete-fg); }
.pill-closed { background: var(--closed-bg); border-color: var(--closed-bd); color: var(--closed-fg); }

/* Landing page */
.home-intro { margin: 8px 0 22px; }
.home-intro h2 { font-size: 26px; letter-spacing: -.02em; }
.tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tool {
  display: flex; flex-direction: column; gap: 6px; min-height: 160px; padding: 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow); color: inherit; text-decoration: none;
}
.tool:hover { border-color: var(--accent); }
.tool h3 { font-size: 18px; color: var(--accent); }
.tool-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.tool-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--accent); }
.tool-icon svg { width: 22px; height: 22px; }
.tool p { margin: 0; color: var(--muted); }
.tool-foot { margin-top: auto; padding-top: 10px; font-size: 13.5px; font-weight: 600; }
.tool-alert { color: var(--past-fg); }
.badge-new { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: #ffedd5; color: #9a3412; font-size: 11.5px; font-weight: 700; vertical-align: middle; }
.home-foot { margin-top: 20px; color: var(--muted); font-size: 13.5px; }

/* Presuit list */
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.tile {
  padding: 11px 14px; text-align: left; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); font: inherit; color: inherit; cursor: pointer;
}
.tile:hover { background: var(--surface-2); }
.tile[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--ring); }
.tile b { display: block; font-size: 24px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tile span { color: var(--muted); font-size: 13px; }
.tile-past b { color: var(--past-fg); }
.tile-urgent b { color: var(--urgent-fg); }
.tile-behind b { color: var(--behind-fg); }
.tile-ontrack b { color: var(--ontrack-fg); }
.tile-complete b { color: var(--complete-fg); }
.filters { display: grid; grid-template-columns: minmax(0, 1fr) 150px 150px auto; gap: 10px; margin-bottom: 12px; align-items: center; }
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th {
  padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--border);
  color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
table.list td { padding: 11px 10px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
table.list tbody tr { cursor: pointer; }
table.list tbody tr:hover { background: var(--surface-2); }
.file-link { font-weight: 600; white-space: nowrap; }
.days { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.days-past { color: var(--past-fg); }
.days-urgent { color: var(--urgent-fg); }
.empty { padding: 22px 8px; text-align: center; color: var(--muted); }

/* Case page */
.back { display: inline-block; margin-bottom: 10px; font-size: 14px; text-decoration: none; }
.case-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.case-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.case-title h2 { font-size: 22px; letter-spacing: -.01em; }
.case-clock { text-align: right; }
.case-clock b { display: block; font-size: 30px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 10px 0 0; padding: 0; color: var(--muted); font-size: 13.5px; list-style: none; }
.meta b { color: var(--text); font-weight: 600; }
.next-step { margin: 12px 0 0; padding: 9px 12px; border-radius: var(--r-sm); background: var(--accent-soft); font-size: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.track { position: relative; height: 84px; margin: 18px 10px 6px; }
.track-line { position: absolute; left: 0; right: 0; top: 11px; height: 4px; border-radius: 2px; background: var(--border); }
.track-fill { position: absolute; left: 0; top: 11px; height: 4px; border-radius: 2px; background: var(--accent); }
.track-dot {
  position: absolute; top: 5px; width: 16px; height: 16px; margin-left: -8px;
  border: 2px solid #94a3b8; border-radius: 50%; background: #fff;
}
.track-dot.done { background: var(--ontrack-fg); border-color: var(--ontrack-fg); }
.track-dot.late { background: #fff; border-color: var(--past-fg); }
.track-label { position: absolute; top: 24px; transform: translateX(-50%); font-size: 11.5px; line-height: 1.2; color: var(--muted); text-align: center; white-space: nowrap; }
.track-label.low { top: 54px; }
.track-label.edge-start { transform: none; text-align: left; }
.track-label.edge-end { transform: translateX(-100%); text-align: right; }
.track-today { position: absolute; top: 1px; width: 2px; height: 24px; margin-left: -1px; background: var(--text); }

.need { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.need:first-of-type { margin-top: 4px; padding-top: 4px; border-top: 0; }
.need-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 8px; }
.need-head h3 { font-size: 15px; }
.cand { margin-bottom: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.cand-out { background: var(--surface-2); }
.cand-out .stages { opacity: .65; }
.cand-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-bottom: 10px; }
.cand-name { font-weight: 600; }
.cand-status { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cand-status select { width: 190px; min-height: 30px; padding: 3px 8px; font-size: 13px; }
.cand-reason { margin-top: 8px; }
.stages { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.stage-label { display: block; margin-bottom: 3px; font-size: 12.5px; font-weight: 600; }
.stage-by { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.stage-late .stage-by { color: var(--past-fg); font-weight: 600; }
.stage input { padding: 4px 6px; min-height: 32px; font-size: 13px; }
.followups { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.add-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
.add-need { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.log { margin: 0; padding: 0; list-style: none; font-size: 13.5px; }
.log li { padding: 5px 0; border-bottom: 1px solid var(--border-soft); }
.log li:last-child { border-bottom: 0; }

/* Rolodex */
.rolo-search { display: grid; grid-template-columns: minmax(0, 1fr) 240px auto; gap: 10px; margin-bottom: 14px; }
.rolo-search input[type=search] { min-height: 42px; font-size: 15px; }
.rolo-search select, .rolo-search .btn { min-height: 42px; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.card {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  color: inherit; text-decoration: none;
}
.card:hover { border-color: var(--accent); }
.card h3 { font-size: 15.5px; color: var(--accent); }
.card-spec { font-weight: 600; font-size: 13.5px; }
.card-sub { color: var(--muted); font-size: 13.5px; }
.card-snippet { margin-top: 4px; padding: 7px 9px; border-radius: var(--r-sm); background: var(--surface-2); color: #334155; font-size: 13px; }
.card-foot { margin-top: auto; padding-top: 6px; color: var(--muted); font-size: 12.5px; }
.chip { display: inline-block; margin: 2px 4px 0 0; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: #1e3a8a; font-size: 12.5px; }
.detail-list { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 6px 12px; margin: 0; font-size: 14px; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; }
.cv-text { margin: 0 0 10px; white-space: pre-wrap; }

/* Morning email */
.email { max-width: 640px; margin: 0 auto; background: #fff; border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow); overflow: hidden; }
.email-head { padding: 12px 18px; border-bottom: 1px solid var(--border); background: var(--surface-2); font-size: 13.5px; }
.email-head b { display: inline-block; width: 62px; color: var(--muted); font-weight: 500; }
.email-body { padding: 18px; }
.email-body h3 { margin: 18px 0 6px; font-size: 14.5px; }
.email-body h3:first-child { margin-top: 0; }
.email-body ul { margin: 0; padding-left: 18px; }
.email-body li { margin-bottom: 6px; }
.email-note { max-width: 640px; margin: 0 auto 14px; color: var(--muted); font-size: 14px; }

/* Dialogs */
.dlg { width: min(620px, calc(100vw - 24px)); padding: 0; border: 0; border-radius: var(--r-lg); box-shadow: 0 16px 40px rgba(15, 23, 42, .25); }
.dlg::backdrop { background: rgba(15, 23, 42, .45); }
.dlg form { padding: 20px 22px; }
.dlg h2 { margin-bottom: 14px; font-size: 18px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.form-error { margin: 0 0 10px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--past-bg); color: var(--past-fg); font-size: 13.5px; }

@media (max-width: 860px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters, .rolo-search { grid-template-columns: 1fr 1fr; }
  .filters .wide, .rolo-search .wide { grid-column: 1 / -1; }
  .hide-sm { display: none; }
}
@media (max-width: 620px) {
  .page { padding: 16px 14px 48px; }
  .topbar { padding: 10px 14px; }
  #topnav { margin-left: 0; width: 100%; }
  #topnav a { padding: 6px 9px; font-size: 13.5px; }
  .tools, .cards, .grid-2 { grid-template-columns: 1fr; }
  .panel { padding: 14px; }
  .hide-xs { display: none; }
  .case-clock { text-align: left; }
  .add-row { grid-template-columns: 1fr; }
  .detail-list { grid-template-columns: 1fr; gap: 0; }
  .detail-list dd { margin-bottom: 8px; }
  .track-label { font-size: 10.5px; }
  .track-label.mid { display: none; }
  .track { height: 54px; }
}
