:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --text: #17191d;
  --muted: #69707a;
  --line: #e2e5e9;
  --soft: #f8f9fa;
  --brand: #17211b;
  --accent: #2e6b4b;
  --accent-soft: #eaf4ee;
  --danger: #b42318;
  --danger-soft: #fff1f0;
  --warning: #9a6700;
  --warning-soft: #fff8dd;
  --success: #067647;
  --success-soft: #ecfdf3;
  --shadow: 0 16px 45px rgba(27, 33, 29, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

.topbar {
  height: 76px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 0 32px;
  background: rgba(255,255,255,0.94);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
}
.brand-wrap { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 40px; height: 40px; display: grid; place-items: center;
  background: var(--brand); color: #fff; border-radius: 12px;
  font-weight: 800; font-size: 18px;
}
.brand { font-weight: 800; font-size: 18px; }
.brand-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.main-nav { display: flex; gap: 4px; background: var(--soft); padding: 4px; border-radius: 12px; }
.nav-btn {
  border: 0; background: transparent; color: var(--muted); font-weight: 700;
  padding: 10px 18px; border-radius: 9px;
}
.nav-btn:hover { color: var(--text); }
.nav-btn.active { background: #fff; color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.today-label { justify-self: end; color: var(--muted); font-size: 14px; font-weight: 650; }

.shell { max-width: 1460px; margin: 0 auto; padding: 34px 28px 60px; }
.view { display: none; }
.view.active { display: block; }
.page-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 24px; margin-bottom: 24px;
}
h1 { margin: 0 0 8px; font-size: clamp(30px, 4vw, 44px); letter-spacing: -.04em; }
h2 { margin: 0; font-size: 19px; letter-spacing: -.015em; }
p { margin-top: 0; }
.eyebrow {
  margin: 0 0 7px; color: var(--accent); text-transform: uppercase;
  letter-spacing: .11em; font-size: 11px; font-weight: 850;
}
.muted { color: var(--muted); line-height: 1.55; }
.danger-text { color: var(--danger); }

.btn {
  border: 1px solid var(--line); background: #fff; color: var(--text);
  border-radius: 10px; padding: 10px 14px; font-weight: 750;
}
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.primary:hover { background: #27352d; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.small { padding: 7px 10px; border-radius: 8px; font-size: 12px; }
.btn.large { min-width: 130px; padding: 13px 18px; }
.icon-btn { border: 0; background: transparent; font-size: 28px; line-height: 1; color: var(--muted); }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 1px 1px rgba(0,0,0,.02);
}
.card-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 19px 21px; border-bottom: 1px solid var(--line);
}
.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.metric {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 17px 18px;
}
.metric-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.metric-value { font-size: 28px; font-weight: 850; margin-top: 6px; letter-spacing: -.03em; }
.metric-note { color: var(--muted); font-size: 12px; margin-top: 4px; }
.metric.alert .metric-value { color: var(--danger); }
.section-grid { display: grid; gap: 16px; margin-bottom: 16px; }
.section-grid.two-col { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.count-pill {
  min-width: 30px; height: 30px; display: inline-grid; place-items: center;
  border-radius: 999px; background: var(--soft); font-weight: 800;
}
.count-pill.danger { background: var(--danger-soft); color: var(--danger); }

.task-list, .waiting-list, .session-list, .people-list { padding: 8px 14px 14px; }
.task-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px;
  align-items: center; padding: 13px 8px; border-bottom: 1px solid var(--line);
}
.task-item:last-child { border-bottom: 0; }
.task-main { min-width: 0; }
.task-title { font-weight: 780; line-height: 1.35; }
.task-meta { color: var(--muted); font-size: 12px; margin-top: 5px; display: flex; gap: 8px; flex-wrap: wrap; }
.task-note { color: #50565f; font-size: 13px; margin-top: 6px; line-height: 1.4; }
.task-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.badge {
  display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 800; background: var(--soft); color: var(--muted);
}
.badge.high { background: var(--danger-soft); color: var(--danger); }
.badge.overdue { background: var(--danger-soft); color: var(--danger); }
.badge.today { background: var(--warning-soft); color: var(--warning); }
.badge.good { background: var(--success-soft); color: var(--success); }
.empty-state { color: var(--muted); text-align: center; padding: 34px 15px; font-size: 14px; }
.waiting-item {
  padding: 13px 8px; border-bottom: 1px solid var(--line); display: flex;
  justify-content: space-between; gap: 12px; align-items: center;
}
.waiting-item:last-child { border-bottom: 0; }
.daily-prospect-card { margin-bottom: 16px; }
.prospect-activity-list { padding: 8px 14px 14px; }
.prospect-activity-item {
  display: grid; grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.2fr) auto;
  gap: 16px; align-items: center; padding: 13px 8px; border-bottom: 1px solid var(--line);
}
.prospect-activity-item:last-child { border-bottom: 0; }
.prospect-activity-detail { min-width: 0; }
.activity-title { font-size: 13px; font-weight: 760; }
.activity-count {
  background: var(--accent-soft); color: var(--accent); border-radius: 999px;
  padding: 6px 10px; font-size: 11px; font-weight: 800; white-space: nowrap;
}
.prospect-review-card { margin-bottom: 16px; }
.link-button { border: 0; padding: 0; background: none; color: var(--accent); font-weight: 750; text-align: left; }

.focus-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(330px, .8fr); gap: 18px; align-items: start; }
.stack { display: grid; gap: 16px; }
.timer-panel { overflow: hidden; }
.timer-link-block { padding: 21px; border-bottom: 1px solid var(--line); display: grid; gap: 13px; }
.timer-wrap { min-height: 400px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 35px; }
.timer-task { color: var(--muted); font-weight: 700; }
.timer { font-size: clamp(76px, 10vw, 128px); line-height: 1; font-weight: 850; letter-spacing: -.08em; margin: 20px 0 10px; font-variant-numeric: tabular-nums; }
.timer-state { color: var(--muted); font-weight: 700; }
.duration-switch { display: flex; gap: 8px; margin-top: 24px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 13px; font-weight: 750; }
.chip.active { background: var(--accent-soft); color: var(--accent); border-color: #cfe3d7; }
.timer-actions { display: flex; gap: 9px; margin-top: 18px; flex-wrap: wrap; justify-content: center; }
.card-form, .modal-form { padding: 20px; display: grid; gap: 14px; }
label { display: grid; gap: 6px; color: #454b53; font-size: 12px; font-weight: 780; }
input, select, textarea {
  width: 100%; border: 1px solid #d6dade; border-radius: 9px; padding: 10px 11px;
  background: #fff; color: var(--text); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: #8fa99a; box-shadow: 0 0 0 3px rgba(46,107,75,.09); }
textarea { min-height: 88px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.session-item { padding: 12px 7px; border-bottom: 1px solid var(--line); }
.session-item:last-child { border-bottom: 0; }
.session-title { font-weight: 760; }
.session-meta { color: var(--muted); font-size: 12px; margin-top: 4px; }

.people-toolbar {
  display: grid; grid-template-columns: minmax(280px, 1fr) 220px 210px; gap: 10px;
  padding: 15px; border-bottom: 1px solid var(--line);
}
.people-row {
  display: grid; grid-template-columns: minmax(230px, 1.2fr) minmax(150px, .8fr) minmax(180px, .9fr) auto;
  gap: 16px; align-items: center; padding: 15px 8px; border-bottom: 1px solid var(--line);
}
.people-row:last-child { border-bottom: 0; }
.person-name { font-weight: 820; }
.person-company, .person-sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.next-action-title { font-weight: 720; font-size: 13px; }
.next-action-date { color: var(--muted); font-size: 12px; margin-top: 4px; }
.status-badge {
  display: inline-flex; width: fit-content; padding: 5px 9px; border-radius: 999px;
  background: var(--soft); color: #545b64; font-size: 11px; font-weight: 800;
}
.status-badge.active-outreach, .status-badge.waiting-for-response { background: var(--warning-soft); color: var(--warning); }
.status-badge.replied, .status-badge.meeting-scheduled, .status-badge.opportunity { background: var(--success-soft); color: var(--success); }
.status-badge.no-response, .status-badge.closed { background: var(--danger-soft); color: var(--danger); }

.summary-label { color: var(--muted); font-size: 12px; font-weight: 750; }
.bar-chart { display: flex; align-items: end; gap: 11px; min-height: 250px; padding: 24px 20px 16px; }
.bar-col { flex: 1; min-width: 0; text-align: center; }
.bar-track { height: 180px; border-radius: 10px; background: var(--soft); display: flex; align-items: end; overflow: hidden; }
.bar-fill { width: 100%; min-height: 2px; background: var(--accent); border-radius: 10px 10px 0 0; position: relative; }
.bar-growth { width: 100%; background: #8eb49d; position: absolute; bottom: 0; left: 0; }
.bar-value { font-size: 11px; font-weight: 760; margin-bottom: 7px; }
.bar-label { color: var(--muted); font-size: 11px; margin-top: 7px; }
.status-chart { padding: 16px 20px 22px; }
.status-line { display: grid; grid-template-columns: 150px 1fr 35px; gap: 10px; align-items: center; padding: 8px 0; }
.status-name { font-size: 12px; color: var(--muted); }
.status-track { height: 8px; background: var(--soft); border-radius: 999px; overflow: hidden; }
.status-fill { height: 100%; background: var(--accent); border-radius: 999px; }
.status-count { text-align: right; font-size: 12px; font-weight: 800; }
.allocation { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 20px; }
.alloc-item { background: var(--soft); border-radius: 12px; padding: 16px; }
.alloc-name { color: var(--muted); font-size: 12px; }
.alloc-value { font-size: 24px; font-weight: 850; margin-top: 7px; }
.alloc-pct { color: var(--accent); font-size: 12px; font-weight: 800; margin-top: 3px; }

.modal-backdrop, .drawer-backdrop {
  position: fixed; inset: 0; background: rgba(20,24,21,.45); z-index: 100;
  display: grid; place-items: center; padding: 20px;
}
.modal { width: min(620px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: #fff; border-radius: 18px; box-shadow: var(--shadow); }
.modal.wide { width: min(780px, 100%); }
.modal-head, .drawer-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.form-help { color: var(--muted); font-size: 12px; line-height: 1.5; margin: -2px 0 0; }
.sequence-box { background: var(--soft); border-radius: 12px; padding: 14px; display: grid; grid-template-columns: 1fr 190px; gap: 10px 14px; align-items: center; }
.sequence-box p { grid-column: 1 / -1; color: var(--muted); font-size: 12px; margin: 0; }
.check-label { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 8px; }
.check-label input { width: auto; }
.drawer-backdrop { place-items: stretch end; padding: 0; }
.drawer { width: min(680px, 100%); height: 100%; background: #fff; box-shadow: -20px 0 50px rgba(0,0,0,.14); overflow: auto; }
.drawer-body { padding: 20px 22px 40px; display: grid; gap: 16px; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.profile-fact { background: var(--soft); border-radius: 10px; padding: 12px; }
.profile-fact .label { color: var(--muted); font-size: 11px; font-weight: 760; }
.profile-fact .value { margin-top: 5px; font-size: 13px; overflow-wrap: anywhere; }
.next-action-box { border: 1px solid #cfe3d7; background: var(--accent-soft); border-radius: 14px; padding: 16px; }
.next-action-box h3 { margin: 0 0 8px; }
.drawer-section { border-top: 1px solid var(--line); padding-top: 17px; }
.drawer-section h3 { margin: 0 0 12px; font-size: 16px; }
.timeline-item { border-left: 2px solid #dce7e0; margin-left: 6px; padding: 0 0 18px 16px; position: relative; }
.timeline-item::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); position: absolute; left: -5px; top: 3px; }
.timeline-title { font-weight: 760; font-size: 13px; }
.timeline-meta { color: var(--muted); font-size: 11px; margin-top: 3px; }
.timeline-note { font-size: 13px; line-height: 1.5; margin-top: 7px; white-space: pre-wrap; }
.drawer-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.toast {
  position: fixed; right: 22px; bottom: 22px; z-index: 200;
  background: var(--brand); color: #fff; padding: 12px 15px; border-radius: 10px;
  box-shadow: var(--shadow); font-weight: 700; font-size: 13px;
}
.toast.error { background: var(--danger); }

@media (max-width: 1050px) {
  .topbar { grid-template-columns: 1fr auto; height: auto; padding: 14px 20px; }
  .main-nav { grid-row: 2; grid-column: 1 / -1; justify-content: center; }
  .today-label { display: none; }
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .focus-layout, .section-grid.two-col { grid-template-columns: 1fr; }
  .people-row { grid-template-columns: 1fr 1fr; }
  .prospect-activity-item { grid-template-columns: 1fr 1fr auto; }
}

@media (max-width: 700px) {
  .shell { padding: 24px 14px 50px; }
  .topbar { padding: 12px 14px; }
  .brand-sub { display: none; }
  .main-nav { overflow-x: auto; justify-content: flex-start; }
  .nav-btn { padding: 9px 13px; }
  .page-head { flex-direction: column; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .field-row, .profile-grid, .people-toolbar { grid-template-columns: 1fr; }
  .people-row { grid-template-columns: 1fr; }
  .task-item { grid-template-columns: 1fr; }
  .prospect-activity-item { grid-template-columns: 1fr; }
  .activity-count { width: fit-content; }
  .task-actions { justify-content: flex-start; }
  .allocation { grid-template-columns: 1fr 1fr; }
  .sequence-box { grid-template-columns: 1fr; }
  .sequence-box p { grid-column: 1; }
  .timer { font-size: 76px; }
  .bar-chart { gap: 5px; padding-left: 12px; padding-right: 12px; }
}

/* Shared shell: keep navigation within the original three header columns. */
.topbar { grid-template-columns: minmax(220px, 1fr) auto minmax(120px, 1fr); }
.brand-link, .main-nav a { text-decoration: none; }
.brand-link { min-width: 0; }
.brand-link .brand, .brand-link .brand-sub { display: block; }
.brand-mark { flex-shrink: 0; }
.main-nav { min-width: 0; }
.main-nav a { white-space: nowrap; }
.header-tools { display: flex; justify-content: flex-end; align-items: center; gap: 16px; min-width: 0; }
.header-tools .today-label { font-size: 12px; white-space: nowrap; }
.tools-menu { position: relative; flex-shrink: 0; }
.tools-menu summary { list-style: none; cursor: pointer; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-size: 13px; font-weight: 700; }
.tools-menu summary::-webkit-details-marker { display: none; }
.tools-menu summary span { margin-left: 10px; }
.tools-menu[open] summary { background: var(--accent-soft); }
.tools-menu nav { position: absolute; top: calc(100% + 10px); right: 0; width: 220px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); }
.tools-menu nav a { display: block; padding: 12px; border-radius: 8px; text-decoration: none; font-size: 13px; font-weight: 600; }
.tools-menu nav a:hover { background: var(--soft); }
.workspace-strip { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; color: var(--muted); font-size: 12px; margin: -12px 0 26px; }
.workspace-strip strong { color: var(--text); margin-left: 5px; }
.utility-panel { background: var(--panel); padding: 28px; border: 1px solid var(--line); border-radius: 16px; min-width: 0; }
.utility-panel h1 { font-size: 32px; }
.utility-panel h2 { margin-top: 28px; }
.utility-panel p { color: var(--muted); line-height: 1.6; max-width: 85ch; }
.utility-panel form { display: flex; gap: 14px; flex-wrap: wrap; align-items: end; margin: 22px 0; }
.utility-panel label { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 600; min-width: 0; }
.utility-panel input, .utility-panel select { max-width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--text); }
.utility-panel input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--accent); }
.utility-panel button { padding: 11px 16px; border: 0; border-radius: 8px; background: var(--brand); color: white; font-weight: 650; }
.utility-panel button:disabled { opacity: .45; cursor: not-allowed; }
.utility-panel fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 18px; min-width: 0; }
.utility-panel legend { font-size: 13px; font-weight: 700; padding: 0 6px; }
.utility-panel .scroll { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; margin-top: 20px; }
.utility-panel table { border-collapse: collapse; width: 100%; font-size: 13px; }
.utility-panel td, .utility-panel th { padding: 13px 16px; border-bottom: 1px solid var(--line); text-align: left; min-width: 100px; }
.utility-panel th { background: var(--soft); color: var(--muted); font-size: 12px; white-space: nowrap; }
.utility-panel td { overflow-wrap: anywhere; }
.utility-panel .error { color: var(--danger); background: var(--danger-soft); padding: 12px; border-radius: 8px; }
.auth-page .topbar { display: flex; position: static; }
.auth-page .shell { max-width: 500px; padding-top: 60px; }
.auth-page .utility-panel { padding: 32px; }
.auth-page form { flex-direction: column; align-items: stretch; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (max-width: 1250px) { .header-tools .today-label { display: none; } }
@media (max-width: 1050px) {
  .topbar { grid-template-columns: minmax(0, 1fr) auto; gap: 14px; }
  .header-tools { grid-column: 2; grid-row: 1; }
  .main-nav { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 700px) {
  .workspace-strip { margin: 0 0 20px; font-size: 11px; }
  .utility-panel { padding: 18px; }
  .utility-panel h1 { font-size: 28px; }
  .utility-panel form { flex-direction: column; align-items: stretch; }
  .utility-panel label { width: 100%; }
  .utility-panel fieldset > div { flex-direction: column; }
  .auth-page .shell { padding-top: 28px; }
}
@media print {
  .topbar, .utility-panel form, .no-print { display: none; }
  .utility-panel { border: 0; padding: 0; }
  .utility-panel .scroll { overflow: visible; }
}
