:root {
  /* motion tokens */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --enter-y: 6px;
  --enter-scale: .97;

  --navy: #0f3a64;
  --navy-700: #0b2d4e;
  --navy-50: #eaf1f8;
  --red: #d93636;
  --red-50: #fdecec;
  --green: #16a34a;
  --green-50: #e8f6ee;
  --amber: #d97706;
  --amber-50: #fdf3e2;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-2: #eef2f6;
  --bg: #f4f6f9;
  --card: #ffffff;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 1px rgba(15, 23, 42, .03);
  --shadow-lg: 0 12px 32px -8px rgba(15, 23, 42, .22), 0 2px 6px rgba(15, 23, 42, .08);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

.icon {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
}
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh;
  width: 84px; flex: none;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 8px;
  background: var(--card);
  border-right: 1px solid var(--line);
  z-index: 20;
}
.rail-logo { margin-bottom: 14px; display: block; }
.rail-logo img { display: block; border-radius: 10px; }
.rail-link {
  width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 4px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px; font-weight: 600;
  transition: background-color .15s, color .15s;
}
.rail-link .icon { width: 22px; height: 22px; }
.rail-link:hover { background: var(--line-2); color: var(--ink-2); }
.rail-link.active { background: var(--navy-50); color: var(--navy); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 15;
  height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-title { display: flex; align-items: baseline; gap: 10px; }
.topbar-title strong { color: var(--navy); font-size: 16px; letter-spacing: .01em; }
.topbar-title span { color: var(--muted); font-weight: 500; }
.topbar-title span:not(:empty)::before { content: "/"; margin-right: 10px; color: var(--line); }

.view { padding: 22px 24px 48px; outline: none; max-width: 1440px; width: 100%; margin: 0 auto; }

/* ---------- profile menu ---------- */
.menu-wrap { position: relative; }
.avatar-btn {
  display: flex; align-items: center; gap: 9px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); cursor: pointer;
}
.avatar-btn:hover { border-color: #cbd5e1; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--navy); color: #fff; font-weight: 700; font-size: 13px;
}
.avatar-name { font-weight: 600; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 230px; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-lg);
}
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; display: grid; }
.menu-head span { color: var(--muted); font-size: 12px; }
.menu button {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border: 0; border-radius: 8px;
  background: none; text-align: left; cursor: pointer;
}
.menu button:hover { background: var(--line-2); }
.menu form { margin: 0; }

/* ---------- buttons & fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 0 15px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); color: var(--ink);
  font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 120ms var(--ease-out);
}
.btn:hover { background: var(--line-2); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-700); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #bb2a2a; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { min-height: 31px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-icon { width: 34px; min-height: 34px; padding: 0; }

:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

.field { display: grid; gap: 5px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field small { color: var(--muted); font-size: 12px; }
.input, .field input, .field select, .field textarea {
  width: 100%; min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 84px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(15, 58, 100, .12);
}
.check { display: flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 500; }
.check input { width: 17px; height: 17px; accent-color: var(--navy); }

.search-input { position: relative; }
.search-input .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-input input { padding-left: 35px; }

/* ---------- cards & layout ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; }
.card-head h2, .card-title { font-size: 15px; font-weight: 700; }
.card-sub { color: var(--muted); font-size: 12.5px; }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

.grid { display: grid; gap: 16px; }
.home-top { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.home-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.home-mid { grid-template-columns: minmax(280px, 1fr) minmax(0, 1fr) minmax(0, 1.25fr); align-items: stretch; }
.stack { display: grid; gap: 16px; align-content: start; }
/* Home columns line up: each column fills the row, and its last card stretches. */
.home-mid > .card, .home-mid > .stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.home-mid > .stack > .card:last-child { flex: 1 1 auto; display: flex; flex-direction: column; }
.home-mid > .card .wc-list { flex: 1 1 0; min-height: 300px; max-height: none; }
#callbacks .mini-list { flex: 1 1 auto; max-height: 340px; overflow: auto; }
#callbacks .empty, #hours .empty { flex: 1; display: grid; place-items: center; text-align: center; }
#callbacks .empty::before { content: "✓"; display: block; font-size: 22px; color: var(--green); font-weight: 800; }

/* my hours */
.hours-bars { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; padding: 10px 20px 16px; min-height: 150px; }
.hb { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 0; }
.hb-val { font-size: 11px; font-weight: 700; color: var(--ink-2); height: 15px; }
.hb-track { flex: 1; width: 100%; max-width: 34px; background: var(--line-2); border-radius: 7px; display: flex; align-items: flex-end; overflow: hidden; min-height: 70px; }
.hb-fill { display: block; width: 100%; background: #9db4cc; border-radius: 7px; }
.hb.today .hb-fill { background: var(--navy); }
.hb-label { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.hb.today .hb-label { color: var(--navy); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.section-gap { margin-top: 16px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { font-size: 24px; font-weight: 750; }
.page-head p { margin: 3px 0 0; color: var(--muted); }

/* ---------- home: greeting & shift ---------- */
.greet { padding: 22px 24px; display: flex; justify-content: space-between; gap: 20px; background: linear-gradient(135deg, #fff 55%, var(--navy-50)); }
.greet-hello { color: var(--muted); font-weight: 500; }
.greet-hello b { color: var(--navy); }
.greet h1 { font-size: 30px; font-weight: 800; color: var(--navy); margin: 6px 0 8px; }
.greet p { margin: 0; color: var(--ink-2); }
.greet-time { text-align: right; flex: none; }
.greet-time .date { color: var(--muted); font-size: 13px; }
.greet-time .clock { font-size: 28px; font-weight: 700; letter-spacing: .01em; color: var(--ink); }
.greet-time .tz { color: var(--muted); font-size: 12px; }

.shift { padding: 20px 22px; display: flex; flex-direction: column; justify-content: center; gap: 12px; text-align: center; border-left: 4px solid var(--navy); }
.shift h2 { font-size: 16px; }
.shift p { margin: 0; color: var(--muted); }
.shift.on { border-left-color: var(--green); }
.shift-timer { font-size: 30px; font-weight: 750; color: var(--green); line-height: 1.1; }
.shift-meta { font-size: 12.5px; color: var(--muted); }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 650; white-space: nowrap;
  background: var(--line-2); color: var(--ink-2);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.pill.no-dot::before { display: none; }
.pill-green { background: var(--green-50); color: var(--green); }
.pill-red { background: var(--red-50); color: var(--red); }
.pill-amber { background: var(--amber-50); color: var(--amber); }
.pill-navy { background: var(--navy-50); color: var(--navy); }

.stat { padding: 16px 18px; display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
a.stat { transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  a.stat:hover { border-color: #cbd5e1; transform: translateY(-1px); box-shadow: 0 4px 12px -6px rgba(15, 23, 42, .18); }
}
.stat-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--navy-50); color: var(--navy); flex: none; }
.stat-icon.red { background: var(--red-50); color: var(--red); }
.stat-icon.green { background: var(--green-50); color: var(--green); }
.stat-icon.amber { background: var(--amber-50); color: var(--amber); }
.stat-value { font-size: 22px; font-weight: 750; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: 12.5px; }

/* ---------- world clock ---------- */
.wc-search { padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.wc-legend { display: flex; gap: 12px; flex-wrap: wrap; padding: 0 20px 4px; font-size: 11.5px; color: var(--muted); }
.wc-legend span { display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot-green { background: var(--green); }
.dot-amber { background: #f59e0b; }
.dot-red { background: var(--red); }
.wc-list { list-style: none; margin: 0; padding: 0; max-height: 520px; overflow: auto; }
.wc-item { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 8px; padding: 10px 18px; border-bottom: 1px solid var(--line-2); }
.wc-item:last-child { border-bottom: 0; }
.wc-cc { font-size: 11px; font-weight: 700; color: var(--muted); }
.wc-city { font-weight: 600; }
.wc-zone { color: var(--muted); font-size: 12px; }
.wc-time { display: flex; align-items: center; gap: 8px; font-weight: 650; }
.wc-empty { padding: 18px; color: var(--muted); text-align: center; }

/* ---------- weather ---------- */
.weather-now { display: flex; align-items: center; gap: 14px; padding: 6px 20px 14px; }
.weather-temp { font-size: 38px; font-weight: 750; color: var(--navy); line-height: 1; }
.weather-icon { width: 46px; height: 46px; color: #f59e0b; }
.weather-desc { font-weight: 600; }
.weather-meta { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line-2); }
.weather-meta div { padding: 10px 14px; border-right: 1px solid var(--line-2); }
.weather-meta div:last-child { border-right: 0; }
.weather-meta b { display: block; font-size: 15px; }
.weather-meta span { font-size: 12px; color: var(--muted); }
.weather-days { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line-2); text-align: center; }
.weather-days div { padding: 10px 4px; font-size: 12px; color: var(--muted); }
.weather-days b { display: block; color: var(--ink); font-size: 13px; }
.weather-days .icon { margin: 3px auto; color: var(--navy); }

/* ---------- revenue chart ---------- */
.rev-total { font-size: 26px; font-weight: 750; color: var(--navy); }
.chart { padding: 6px 16px 14px; }
.chart svg { width: 100%; height: 170px; display: block; overflow: visible; }
.chart .grid-line { stroke: var(--line-2); }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .line { fill: none; stroke: var(--navy); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: url(#revFill); }
.chart .pt { fill: #fff; stroke: var(--navy); stroke-width: 2; }
.chart .pt-hit { fill: transparent; cursor: default; }
.chart-tip { position: absolute; transform: translate(-50%, -120%); background: var(--ink); color: #fff; padding: 4px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; pointer-events: none; white-space: nowrap; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--line-2); border-radius: 9px; }
.seg button { border: 0; background: none; padding: 4px 10px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }

.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; align-items: center; gap: 10px; padding: 10px 20px; border-top: 1px solid var(--line-2); }
.mini-list a { color: inherit; text-decoration: none; font-weight: 600; }
.mini-list a:hover { color: var(--navy); }
.mini-list .sub { color: var(--muted); font-size: 12px; }
.empty { padding: 18px 20px; color: var(--muted); }

/* ---------- resources ---------- */
.res { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 560px; }
.res-nav {
  border-right: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 60px; align-self: start; max-height: calc(100vh - 60px); overflow-y: auto;
}
a.res-tab { text-decoration: none; }
.res-section { scroll-margin-top: 76px; padding-bottom: 22px; margin-bottom: 22px; border-bottom: 2px solid var(--line); }
.res-section:last-child { border-bottom: 0; margin-bottom: 0; }
.res-section > h2 { display: flex; align-items: center; gap: 9px; }
.res-section > h2 .icon { color: var(--navy); width: 21px; height: 21px; }

.glance { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.glance-card { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; display: grid; gap: 2px; }
.glance-card b { font-size: 20px; font-weight: 750; color: var(--navy); line-height: 1.2; }
.glance-card small { color: var(--muted); font-size: 12px; }
.glance-rules { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.glance-do, .glance-dont { padding: 12px 14px; border-radius: 12px; }
.glance-do { background: var(--green-50); }
.glance-dont { background: var(--red-50); }
.glance-rules .eyebrow { margin-bottom: 6px; }
.glance-rules p { margin: 3px 0; }
.glance-rules .ok { color: var(--green); font-weight: 800; }
.glance-rules .no { color: var(--red); font-weight: 800; }
@media (max-width: 700px) { .glance-rules { grid-template-columns: 1fr; } }
.res-nav .search-input { margin-bottom: 8px; }
.res-tab {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 9px 10px;
  border: 0; border-radius: 10px; background: none;
  text-align: left; cursor: pointer; color: var(--ink-2);
}
.res-tab:hover { background: var(--line-2); }
.res-tab.on { background: var(--navy-50); color: var(--navy); }
.res-tab b { display: block; font-weight: 650; font-size: 13.5px; }
.res-tab small { display: block; color: var(--muted); font-size: 12px; }
.res-body { padding: 22px 26px 26px; min-width: 0; }
.res-body h2 { font-size: 21px; font-weight: 750; }
.res-intro { color: var(--muted); margin: 4px 0 6px; }
.res-group { padding: 16px 0; border-bottom: 1px solid var(--line-2); }
.res-group:last-child { border-bottom: 0; }
.res-group .eyebrow { margin-bottom: 8px; }
.res-item { padding: 6px 0 8px; }
.res-item h3 { font-size: 15px; font-weight: 650; margin-bottom: 3px; }
.res-item .body { color: var(--ink-2); }
.res-item .body p { margin: 0 0 4px; }
.res-item .body ul, .res-item .body ol { margin: 2px 0 6px; padding-left: 20px; }
.res-item .body li { margin: 1px 0; }
.res-item .body .ok { color: var(--green); }
.res-item .body .no { color: var(--red); }
.res-item.warn { background: var(--amber-50); border-radius: 10px; padding: 12px 14px; margin: 4px 0; }
.res-item.warn h3 { color: #92400e; }
.res-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 0 -12px; border-radius: 10px; color: inherit; text-decoration: none; }
.res-link:hover { background: var(--line-2); }
.res-link .icon:last-child { margin-left: auto; color: var(--muted); }
.res-link h3 { margin: 0; }
.res-link span { color: var(--muted); font-size: 12.5px; }
.res-sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; }
.res-sites .res-link { margin: 0; border: 1px solid var(--line-2); min-width: 0; }
.res-sites .res-link > span { min-width: 0; }
.res-sites .res-link > span > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
mark { background: #fef08a; color: inherit; border-radius: 3px; padding: 0 1px; }

.quick-links { display: flex; gap: 8px; flex-wrap: wrap; }
.quick-links .btn { min-height: 46px; padding: 0 12px; text-align: left; }
.quick-links .btn span { display: grid; line-height: 1.2; }
.quick-links .btn small { font-weight: 500; color: var(--muted); font-size: 11.5px; }
.quick-links .btn .icon:first-child { color: var(--navy); }
.quick-links .btn .icon:last-child { color: var(--muted); }
@media (max-width: 700px) {
  .card-head:has(.quick-links) { flex-wrap: wrap; }
  .quick-links { width: 100%; }
  .quick-links .btn { flex: 1 1 160px; }
}

.dial-tool { margin-top: 14px; padding: 14px 16px; border: 1px dashed #b6c6d8; border-radius: 12px; background: #f8fbfe; }
.dial-tool .row { align-items: flex-end; }
.dial-out { font-size: 20px; font-weight: 750; letter-spacing: .03em; color: var(--navy); min-height: 30px; }

/* ---------- leads ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.toolbar .search-input { flex: 1 1 240px; }
.toolbar select { width: auto; min-width: 150px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 16px 0; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 11px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.chip:hover { border-color: #cbd5e1; }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip .n { opacity: .7; font-variant-numeric: tabular-nums; }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fafbfc; }
.table td { padding: 11px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr { cursor: pointer; transition: background-color .1s; }
.table tbody tr:hover { background: #f8fafc; }
.table tr.static { cursor: default; }
.table .strong { font-weight: 650; }
.table .sub { color: var(--muted); font-size: 12px; }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; color: var(--muted); }

.status { font-size: 12px; }
.s-New { background: var(--navy-50); color: var(--navy); }
.s-Contacted { background: #eef2ff; color: #4338ca; }
.s-Callback { background: var(--amber-50); color: var(--amber); }
.s-Qualified { background: #ecfeff; color: #0e7490; }
.s-Application-Submitted { background: #f5f3ff; color: #6d28d9; }
.s-Funded { background: var(--green-50); color: var(--green); }
.s-Declined, .s-Do-Not-Call { background: var(--red-50); color: var(--red); }
.s-Not-Interested { background: var(--line-2); color: var(--muted); }

/* lead detail */
.lead-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.lead-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.lead-head h1 { font-size: 24px; font-weight: 750; }
.lead-head .sub { color: var(--muted); margin-top: 2px; }
.form-section { padding: 18px 20px; border-bottom: 1px solid var(--line-2); }
.form-section:last-child { border-bottom: 0; }
.form-section > .eyebrow { margin-bottom: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { position: sticky; bottom: 0; display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; background: rgba(255,255,255,.95); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
.dirty-note { color: var(--amber); font-weight: 600; font-size: 13px; margin-right: auto; align-self: center; }

.qual-list { list-style: none; margin: 0; padding: 6px 20px 16px; }
.qual-list li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.qual-list li:last-child { border-bottom: 0; }
.qual-list .mark { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 13px; font-weight: 800; }
.qual-list .pass .mark { background: var(--green-50); color: var(--green); }
.qual-list .fail .mark { background: var(--red-50); color: var(--red); }
.qual-list .unknown .mark { background: var(--line-2); color: var(--muted); }
.qual-list b { display: block; font-weight: 650; }
.qual-list span { color: var(--muted); font-size: 12.5px; }
.qual-verdict { margin: 0 20px; padding: 10px 12px; border-radius: 10px; font-weight: 650; }
.qual-verdict.pass { background: var(--green-50); color: var(--green); }
.qual-verdict.fail { background: var(--red-50); color: var(--red); }
.qual-verdict.unknown { background: var(--line-2); color: var(--ink-2); }

.dial-box { display: flex; align-items: center; gap: 10px; padding: 0 20px 16px; flex-wrap: wrap; }
.dial-box code { font-size: 17px; font-weight: 750; color: var(--navy); letter-spacing: .03em; font-family: inherit; }

.timeline { list-style: none; margin: 0; padding: 0 20px 16px; }
.timeline li { position: relative; padding: 8px 0 8px 20px; border-left: 2px solid var(--line-2); margin-left: 5px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: #cbd5e1; border: 2px solid #fff; }
.timeline li.note::before { background: var(--navy); }
.timeline .meta { color: var(--muted); font-size: 12px; }
.timeline .text { white-space: pre-wrap; word-break: break-word; }
.note-form { padding: 14px 20px; display: grid; gap: 8px; border-top: 1px solid var(--line-2); }
.note-form textarea { min-height: 70px; }

/* ---------- team ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 16px; }
.tabs button { border: 0; background: none; padding: 12px 12px; font-weight: 650; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--navy); border-bottom-color: var(--navy); }

/* ---------- admin panel ---------- */
.admin-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.admin-mid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; }
.is-admin .topbar-title .pill { align-self: center; }
.bulk-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px; background: var(--navy-50); border-bottom: 1px solid var(--line); }
.bulk-bar select { width: auto; min-width: 220px; }
.table input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--navy); cursor: pointer; }
.kv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; padding: 0 20px 14px; }
.kv { display: grid; gap: 1px; padding: 9px 0; border-bottom: 1px solid var(--line-2); min-width: 0; }
.kv span { font-size: 12px; color: var(--muted); }
.kv b { font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 1180px) { .admin-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .admin-mid { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .admin-stats { grid-template-columns: 1fr 1fr; } .kv-grid { grid-template-columns: 1fr; } }

/* ---------- modal & toast ---------- */
.modal {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0; border: 0; border-radius: 16px;
  box-shadow: var(--shadow-lg);
}
.modal::backdrop { background: rgba(15, 23, 42, .45); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 6px; }
.modal-head h2 { font-size: 18px; }
.modal-body { padding: 12px 20px; display: grid; gap: 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 20px 18px; }
.modal-wide { width: min(760px, calc(100vw - 32px)); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: #fff;
  padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow-lg);
  font-weight: 600; z-index: 100;
}
.toast.error { background: var(--red); }

.alert { padding: 10px 12px; border-radius: 10px; font-weight: 500; }
.alert-error { background: var(--red-50); color: #991b1b; }
.alert-info { background: var(--navy-50); color: var(--navy); }

.loading { padding: 40px; text-align: center; color: var(--muted); }
.skeleton { background: linear-gradient(90deg, var(--line-2), #f8fafc, var(--line-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- login ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 10% -10%, #dbe7f3, transparent), var(--bg); }
.login-card { width: min(400px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 28px; box-shadow: var(--shadow-lg); display: grid; gap: 16px; }
.login-card form { display: grid; gap: 14px; }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand img { border-radius: 11px; }
.login-brand h1 { font-size: 22px; color: var(--navy); font-weight: 800; }
.login-brand p { margin: 0; color: var(--muted); }
.login-help { margin: 0; color: var(--muted); font-size: 12.5px; text-align: center; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .home-mid { grid-template-columns: 1fr 1fr; }
  .home-mid > :last-child { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
  .lead-layout { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .home-top { grid-template-columns: 1fr; }
  .home-stats { grid-template-columns: 1fr 1fr; }
  .res { grid-template-columns: 1fr; }
  .res-nav { border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; overflow-x: auto; max-height: none; background: #fff; z-index: 5; }
  .res-nav .search-input { display: none; }
  .res-tab { flex: none; width: auto; }
  .res-tab small { display: none; }
}
@media (max-width: 700px) {
  .shell { flex-direction: column; }
  .rail { position: fixed; bottom: 0; top: auto; left: 0; right: 0; width: 100%; height: 64px; flex-direction: row; justify-content: space-around; padding: 6px; border-right: 0; border-top: 1px solid var(--line); }
  .rail-logo { display: none; }
  .rail-link { width: auto; flex: 1; }
  .main { padding-bottom: 64px; }
  .topbar { padding: 0 16px; }
  .avatar-name { display: none; }
  .view { padding: 16px 16px 40px; }
  .home-mid { grid-template-columns: 1fr; }
  .home-mid > :last-child { grid-template-columns: 1fr; }
  .home-mid > .card .wc-list { flex: none; max-height: 360px; }
  .greet { flex-direction: column; }
  .greet-time { text-align: left; }
  .greet h1 { font-size: 24px; }
  .form-grid { grid-template-columns: 1fr; }
  .res-body { padding: 18px 16px; }
  .table .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  /* Fewer, gentler: see the motion section; movement is removed, fades stay. */
  .chart .line, .chart .area, .chart .pt, .hours-bars.grow .hb-fill { animation: none !important; }
}

/* ======================================================================
   Motion
   Fast and subtle: agents use this all day. Only transform and opacity move.
   ====================================================================== */
@media (prefers-reduced-motion: reduce) {
  :root { --enter-y: 0px; --enter-scale: 1; } /* keep the fades, drop the movement */
}

@keyframes afn-enter { from { opacity: 0; transform: translateY(var(--enter-y)); } }

/* Page change: sections fade up in order (only right after navigating). */
.view.entering > * { animation: afn-enter 240ms var(--ease-out) both; }
.view.entering > :nth-child(2) { animation-delay: 40ms; }
.view.entering > :nth-child(3) { animation-delay: 80ms; }
.view.entering > :nth-child(4) { animation-delay: 120ms; }
.view.entering > :nth-child(n+5) { animation-delay: 160ms; }
.view.entering .home-stats > .stat, .view.entering .admin-stats > .stat { animation: afn-enter 240ms var(--ease-out) both; }
.view.entering :is(.home-stats, .admin-stats) > :nth-child(2) { animation-delay: 30ms; }
.view.entering :is(.home-stats, .admin-stats) > :nth-child(3) { animation-delay: 60ms; }
.view.entering :is(.home-stats, .admin-stats) > :nth-child(4) { animation-delay: 90ms; }
.view.entering :is(.home-stats, .admin-stats) > :nth-child(5) { animation-delay: 120ms; }
.view.entering :is(.home-stats, .admin-stats) > :nth-child(6) { animation-delay: 150ms; }

/* Modal: rises in, leaves faster. Centered (not anchored to a trigger). */
.modal {
  opacity: 0;
  transform: translateY(var(--enter-y)) scale(var(--enter-scale));
  transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out), overlay 150ms allow-discrete, display 150ms allow-discrete;
}
.modal[open] {
  opacity: 1;
  transform: none;
  transition-duration: 220ms;
}
@starting-style { .modal[open] { opacity: 0; transform: translateY(var(--enter-y)) scale(var(--enter-scale)); } }
.modal::backdrop { transition: background-color 220ms var(--ease-out), overlay 150ms allow-discrete, display 150ms allow-discrete; }
@starting-style { .modal[open]::backdrop { background-color: rgba(15, 23, 42, 0); } }

/* Profile menu: grows from the button it hangs off (top right). */
.menu { transform-origin: top right; transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out); }
@starting-style { .menu { opacity: 0; transform: scale(var(--enter-scale)); } }

/* Toast: slides up from the bottom and leaves the same way. Transitions, so rapid toasts retarget. */
.toast { transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out); }
@starting-style { .toast { opacity: 0; transform: translate(-50%, 8px); } }
.toast.leaving { opacity: 0; transform: translate(-50%, 8px); transition-duration: 160ms; }

/* Bulk-assign bar appears when leads are selected. */
.bulk-bar { transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out); }
@starting-style { .bulk-bar { opacity: 0; transform: translateY(-4px); } }

/* Shift card: the timer settles in when you clock in. */
.shift-timer, .shift .pill { transition: opacity 240ms var(--ease-out), transform 240ms var(--ease-out); }
@starting-style { .shift-timer, .shift .pill { opacity: 0; transform: scale(var(--enter-scale)); } }

/* State changes read as changes, not jumps. */
.qual-list .mark, .qual-verdict { transition: background-color 150ms ease, color 150ms ease; }
.res-tab, .chip, .rail-link, .seg button, .tabs button { transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease; }
.dirty-note:not([hidden]) { animation: afn-enter 160ms var(--ease-out) both; }
.alert:not([hidden]) { animation: afn-enter 180ms var(--ease-out) both; }

/* Revenue chart: the line draws once, then the fill and points fade in. */
.chart .line { stroke-dasharray: 1; animation: afn-draw 600ms var(--ease-out) both; }
.chart .area { animation: afn-fade 300ms ease 300ms both; }
.chart .pt { animation: afn-fade 200ms ease 450ms both; }
@keyframes afn-draw { from { stroke-dashoffset: 1; } }
@keyframes afn-fade { from { opacity: 0; } }

/* Hours bars grow from the baseline on first show only. */
.hb-fill { transform-origin: bottom; }
.hours-bars.grow .hb-fill { animation: afn-grow 420ms var(--ease-out) both; }
.hours-bars.grow .hb:nth-child(2) .hb-fill { animation-delay: 30ms; }
.hours-bars.grow .hb:nth-child(3) .hb-fill { animation-delay: 60ms; }
.hours-bars.grow .hb:nth-child(4) .hb-fill { animation-delay: 90ms; }
.hours-bars.grow .hb:nth-child(5) .hb-fill { animation-delay: 120ms; }
.hours-bars.grow .hb:nth-child(6) .hb-fill { animation-delay: 150ms; }
.hours-bars.grow .hb:nth-child(7) .hb-fill { animation-delay: 180ms; }
@keyframes afn-grow { from { transform: scaleY(0); } }
