:root {
  --bg: #07050d;
  --surface: #12101b;
  --surface-2: #191525;
  --surface-3: #231c33;
  --ink: #f8f5ff;
  --muted: #aaa2bf;
  --soft: #746a8d;
  --line: rgb(172 124 255 / .18);
  --brand: #9d6cff;
  --brand-2: #c7a7ff;
  --green: #42e6a4;
  --amber: #ffb86b;
  --red: #ff6b8a;
  --violet: #8b5cf6;
  --shadow: 0 28px 80px rgb(0 0 0 / .42);
  --radius: 8px;
  --sidebar: 276px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 20% -10%, rgb(157 108 255 / .24), transparent 34%),
    radial-gradient(circle at 85% 8%, rgb(75 36 148 / .32), transparent 32%),
    linear-gradient(180deg, #090611 0%, #050409 100%);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgb(255 255 255 / .025) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / .025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
  z-index: -1;
}

button, input, select, textarea {
  font: inherit;
}

button { cursor: pointer; }

.is-hidden { display: none !important; }

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 8%, rgb(157 108 255 / .30), transparent 34%),
    radial-gradient(circle at 84% 12%, rgb(124 58 237 / .24), transparent 36%),
    var(--bg);
}

.auth-panel {
  width: min(520px, 100%);
  background:
    linear-gradient(180deg, rgb(255 255 255 / .09), rgb(255 255 255 / .04)),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 34px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #7c3aed, #c084fc);
  color: #fff;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auth-panel h1 {
  margin: 14px 0 10px;
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.05;
  letter-spacing: 0;
}

.auth-copy {
  margin: 0 0 24px;
  color: var(--muted);
  max-width: 46ch;
}

.auth-form, .form-grid {
  display: grid;
  gap: 14px;
}

.auth-form label, .form-grid label, .compact-form label, .task-form label, .project-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgb(255 255 255 / .045);
  color: var(--ink);
  border-radius: 7px;
  padding: 10px 12px;
  outline: none;
  min-height: 42px;
}

textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgb(157 108 255 / .18);
}

.auth-actions, .topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  min-height: 40px;
  padding: 9px 14px;
  font-weight: 800;
  white-space: nowrap;
}

.btn svg, .icon-btn svg, .nav-item svg { width: 17px; height: 17px; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary {
  background: linear-gradient(135deg, #7c3aed, #b983ff);
  color: #fff;
  box-shadow: 0 14px 34px rgb(124 58 237 / .28);
}
.btn-primary:hover { background: linear-gradient(135deg, #8b5cf6, #d6bcff); }
.btn-secondary { background: rgb(255 255 255 / .055); border-color: var(--line); color: var(--ink); }
.btn-secondary:hover { background: rgb(157 108 255 / .12); }
.btn-danger { background: rgb(255 107 138 / .12); color: #ff9aae; border-color: rgb(255 107 138 / .28); }
.btn-success { background: rgb(66 230 164 / .12); color: var(--green); border-color: rgb(66 230 164 / .28); }
.text-btn {
  border: 0;
  background: transparent;
  color: var(--brand);
  font-weight: 800;
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgb(255 255 255 / .05);
  color: var(--ink);
}

.auth-message { min-height: 20px; color: var(--red); font-weight: 700; }
.config-warning {
  margin-top: 18px;
  border: 1px solid #fde68a;
  background: rgb(255 184 107 / .12);
  color: #ffd3a3;
  border-radius: 7px;
  padding: 12px;
  font-size: 12px;
  font-weight: 700;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgb(28 22 45 / .95), rgb(10 8 17 / .98)),
    #090611;
  color: #e5e7eb;
  border-right: 1px solid var(--line);
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand span {
  display: block;
  color: #94a3b8;
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 0;
  border-radius: 7px;
  color: #cbd5e1;
  background: transparent;
  font-weight: 800;
  text-align: left;
}

.nav-item:hover, .nav-item.active {
  color: #fff;
  background: linear-gradient(135deg, rgb(157 108 255 / .20), rgb(255 255 255 / .065));
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .06);
}


.mobile-menu { display: none; }

.main {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.topbar h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 36px);
  letter-spacing: 0;
}

.avatar-btn {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #111827, #7c3aed);
  color: #fff;
  font-weight: 900;
}

.view { display: none; }
.view.active { display: block; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric-card, .panel {
  background:
    linear-gradient(180deg, rgb(255 255 255 / .075), rgb(255 255 255 / .035)),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgb(255 255 255 / .04), var(--shadow);
  backdrop-filter: blur(18px);
}

.metric-card {
  padding: 18px;
}

.metric-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 32px;
  line-height: 1;
  letter-spacing: 0;
}

.metric-card p {
  margin: 8px 0 0;
  color: var(--muted);
}

.split-grid, .pipeline-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, .8fr);
  gap: 16px;
}

.panel {
  padding: 18px;
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-head h3 {
  margin: 0;
  font-size: 18px;
}

.panel-head p {
  margin: 3px 0 0;
  color: var(--muted);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.search-box {
  flex: 1 1 360px;
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: rgb(255 255 255 / .045);
  border-radius: 7px;
  padding: 0 12px;
}

.search-box svg { width: 17px; height: 17px; color: var(--muted); }
.search-box input {
  border: 0;
  box-shadow: none;
  padding-left: 0;
}

.table-shell {
  overflow: auto;
  background: rgb(18 16 27 / .9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

th, td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0;
  background: rgb(255 255 255 / .045);
}

tr:last-child td { border-bottom: 0; }
.clickable-row { cursor: pointer; }
.clickable-row:hover td { background: rgb(157 108 255 / .08); }
.clickable-row.lead-tone-orange td { background: rgb(255 184 107 / .10); }
.clickable-row.lead-tone-green td { background: rgb(66 230 164 / .10); }
.clickable-row.lead-tone-red td { background: rgb(255 107 138 / .10); }
.clickable-row.lead-tone-orange:hover td { background: rgb(255 184 107 / .16); }
.clickable-row.lead-tone-green:hover td { background: rgb(66 230 164 / .16); }
.clickable-row.lead-tone-red:hover td { background: rgb(255 107 138 / .16); }
.cell-title { font-weight: 900; }
.cell-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.badge-new, .badge-queued { background: rgb(157 108 255 / .14); color: #d8c6ff; }
.badge-contacted { background: rgb(98 126 234 / .16); color: #b8c4ff; }
.badge-offer_sent { background: rgb(255 184 107 / .14); color: #ffd3a3; }
.badge-client { background: rgb(66 230 164 / .14); color: var(--green); }
.badge-lost { background: rgb(255 255 255 / .08); color: var(--muted); }
.badge-hot { background: rgb(255 107 138 / .14); color: #ff9aae; }
.badge-warm { background: rgb(255 184 107 / .14); color: #ffd3a3; }
.badge-cold { background: rgb(255 255 255 / .08); color: var(--muted); }

.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.stack-list {
  display: grid;
  gap: 10px;
}

.list-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  background: rgb(255 255 255 / .045);
  border-radius: 7px;
  padding: 12px;
}

.list-item.lead-tone-orange { background: rgb(255 184 107 / .10); border-color: rgb(255 184 107 / .26); }
.list-item.lead-tone-green { background: rgb(66 230 164 / .10); border-color: rgb(66 230 164 / .26); }
.list-item.lead-tone-red { background: rgb(255 107 138 / .10); border-color: rgb(255 107 138 / .26); }
.list-item.is-archived { opacity: .76; }

.section-subtitle {
  margin: 18px 0 10px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--muted);
}

button.list-item {
  width: 100%;
  text-align: left;
  color: inherit;
  cursor: pointer;
}

button.list-item:hover,
.project-card:hover {
  border-color: var(--brand);
  box-shadow: 0 8px 24px rgb(15 23 42 / .08);
}

.list-item strong { display: block; }
.list-item p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }

.bars {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 140px 1fr 42px;
  align-items: center;
  gap: 10px;
}

.bar-track {
  height: 12px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--brand);
}

.compact-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 130px auto;
  gap: 10px;
  margin-bottom: 14px;
}

.task-form,
.project-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.task-form textarea,
.project-form textarea {
  grid-column: 1 / -1;
}

.task-form button,
.project-form button {
  grid-column: 1 / -1;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid .full { grid-column: 1 / -1; }

.followup-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
}

.followup-rules strong {
  width: 100%;
  color: var(--ink);
}

.followup-rules span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  background: rgb(255 255 255 / .045);
  font-size: 12px;
  font-weight: 800;
}

.calendar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.calendar-header h3 {
  margin: 0;
  min-width: 180px;
  text-align: center;
  font-size: 20px;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  margin-bottom: 2px;
}

.calendar-weekdays span {
  text-align: center;
  padding: 8px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}

.cal-day {
  min-height: 100px;
  background: rgb(255 255 255 / .035);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px;
  overflow: hidden;
}

.cal-day.cal-other {
  opacity: .35;
}

.cal-day.cal-today {
  border-color: var(--brand);
  background: rgb(157 108 255 / .10);
}

.cal-day-num {
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 4px;
  color: var(--ink);
}

.cal-today .cal-day-num {
  color: var(--brand);
}

.cal-event {
  display: block;
  width: 100%;
  padding: 3px 6px;
  margin-bottom: 2px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 0;
  text-align: left;
  cursor: default;
}

.cal-ev-followup {
  background: rgb(157 108 255 / .18);
  color: #d8c6ff;
}

.cal-ev-task {
  background: rgb(66 230 164 / .14);
  color: var(--green);
  cursor: pointer;
}

.cal-ev-task:hover {
  background: rgb(66 230 164 / .24);
}

.cal-ev-custom { cursor: default; }
.cal-color-brand { background: rgb(157 108 255 / .22); color: #d8c6ff; }
.cal-color-green { background: rgb(66 230 164 / .18); color: var(--green); }
.cal-color-amber { background: rgb(255 184 107 / .18); color: #ffd3a3; }
.cal-color-red { background: rgb(255 107 138 / .18); color: #ff9aae; }

.cal-day { cursor: pointer; }
.cal-day:hover { background: rgb(255 255 255 / .065); }
.cal-day.cal-today:hover { background: rgb(157 108 255 / .16); }

.cal-ev-followup-item { border-left: 3px solid var(--brand); }
.cal-ev-task-item { border-left: 3px solid var(--green); }

.plan-board, .project-grid, .team-grid, .generator-grid, .scraper-grid {
  display: grid;
  gap: 12px;
}

.project-grid, .team-grid, .generator-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.scraper-grid {
  grid-template-columns: minmax(320px, .85fr) minmax(360px, 1.15fr);
}

.project-card, .team-card, .scraper-card {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgb(255 255 255 / .045);
  padding: 14px;
}

.project-card {
  cursor: pointer;
}

.mini-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.mini-metric {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgb(255 255 255 / .045);
  padding: 12px;
}

.mini-metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.mini-metric strong {
  display: block;
  margin-top: 5px;
  font-size: 24px;
}

.project-card h4, .team-card h4, .generator-panel h4 {
  margin: 0 0 8px;
}

.scraper-card {
  display: grid;
  gap: 12px;
  align-content: start;
}

.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.check-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 9px;
  color: var(--ink) !important;
}

.check-row input {
  width: 16px;
  min-height: 16px;
  height: 16px;
  padding: 0;
}

.scraper-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.panel-head.tight {
  margin-bottom: 0;
}

.progress {
  height: 10px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--brand);
  border-radius: 999px;
  transition: width .2s ease;
}

.scrape-log {
  min-height: 260px;
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgb(5 4 9 / .9);
  padding: 10px;
}

.scrape-line {
  color: #cbd5e1;
  font-family: Consolas, "JetBrains Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
  padding: 5px 0;
  border-bottom: 1px solid rgb(255 255 255 / .06);
}

.scrape-line.error {
  color: #fecdd3;
}

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

.compact-mode .panel,
.compact-mode .metric-card,
.compact-mode th,
.compact-mode td {
  padding: 10px;
}

.feature-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.feature-list li { margin: 8px 0; }

.modal {
  border: 0;
  padding: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: min(680px, calc(100vw - 32px));
  max-height: min(88vh, 820px);
  overflow: hidden;
}

.modal::backdrop {
  background: rgb(3 2 7 / .72);
}

.modal-inner {
  padding: 20px;
  background:
    linear-gradient(180deg, rgb(255 255 255 / .09), rgb(255 255 255 / .04)),
    var(--surface);
  max-height: min(88vh, 820px);
  overflow-y: auto;
  overflow-x: hidden;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-head h3 {
  margin: 0;
  font-size: 22px;
}

.detail-body {
  display: grid;
  gap: 12px;
}

.lead-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.lead-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.lead-action-row .btn {
  flex: 1 1 190px;
  min-width: 0;
  white-space: normal;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 7px;
  min-width: 0;
}

.detail-row span,
.detail-section p {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.detail-section {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.detail-section p {
  margin: 0;
  white-space: pre-wrap;
}

.note-preview {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  background: rgb(255 255 255 / .045);
}

.note-preview strong {
  display: block;
  margin-bottom: 3px;
}

.note-preview p,
.note-preview span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.detail-image {
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
}

.attachment-section {
  max-width: 100%;
}

.attachment-link {
  color: var(--brand-2);
  font-weight: 800;
  overflow-wrap: anywhere;
}

select option {
  background: #151020;
  color: var(--ink);
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 7px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1120px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-grid, .pipeline-layout { grid-template-columns: 1fr; }
  .scraper-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: auto;
    max-height: 100vh;
    overflow-y: auto;
    z-index: 100;
    border-radius: 0 0 12px 12px;
    border-right: 0;
    box-shadow: 0 12px 40px rgb(0 0 0 / .6);
  }
  .nav { display: none; }
  .nav.open { display: grid; }
  .mobile-menu { display: grid; }
  .main { padding: 14px 10px; }
  .topbar { align-items: flex-start; flex-direction: column; gap: 10px; }
  .topbar h2 { font-size: 22px; }
  .topbar-actions { width: 100%; }
  .topbar-actions .btn { flex: 1; min-width: 0; font-size: 13px; padding: 8px 10px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric-card { padding: 12px; }
  .metric-card strong { font-size: 24px; }
  .compact-form { grid-template-columns: 1fr; }
  .task-form, .project-form { grid-template-columns: 1fr; }
  .task-form textarea, .project-form textarea { grid-column: auto; }
  .task-form button, .project-form button { grid-column: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .lead-detail-grid { grid-template-columns: 1fr; }
  .mini-metric-grid { grid-template-columns: 1fr 1fr; }
  .two-cols { grid-template-columns: 1fr; }
  .auth-panel { padding: 20px; }
  .auth-panel h1 { font-size: 24px; }

  .calendar-header h3 { font-size: 16px; min-width: 140px; }
  .cal-day { min-height: 70px; padding: 4px; }
  .cal-day-num { font-size: 12px; }
  .cal-event { font-size: 10px; padding: 2px 4px; }

  .table-shell { margin: 0 -10px; border-radius: 0; border-left: 0; border-right: 0; }
  table { min-width: 600px; }

  .modal { width: calc(100vw - 16px); max-height: 92vh; }
  .modal-inner { padding: 14px; max-height: 92vh; }
  .modal-head h3 { font-size: 18px; }
  .lead-action-row .btn { flex: 1 1 100%; }

  .bar-row { grid-template-columns: 90px 1fr 32px; }

  .scraper-card { padding: 10px; }
  .scrape-log { min-height: 180px; max-height: 260px; }

  .project-grid, .team-grid, .generator-grid { grid-template-columns: 1fr; }

  .panel { padding: 12px; }
  .panel-head { flex-direction: column; gap: 8px; }
  .panel-head h3 { font-size: 16px; }

  .toolbar { flex-direction: column; }
  .search-box { flex: 1 1 auto; width: 100%; }
  .toolbar select { width: 100%; }

  .row-actions { flex-direction: column; }
  .row-actions .btn { width: 100%; }

  .detail-row { flex-direction: column; gap: 2px; }
  .note-preview { font-size: 13px; }
  .followup-rules span { font-size: 11px; }
}

@media (max-width: 480px) {
  .metric-grid { grid-template-columns: 1fr; gap: 6px; }
  .metric-card strong { font-size: 20px; }
  .mini-metric-grid { grid-template-columns: 1fr; }
  .calendar-weekdays span { font-size: 10px; padding: 4px 0; }
  .cal-day { min-height: 56px; }
  .cal-event { display: none; }
  .cal-day.cal-today .cal-event,
  .cal-day:not(.cal-other) .cal-event { display: block; }
  .sidebar { padding: 12px; }
  .brand strong { font-size: 14px; }
  .nav-item { min-height: 38px; padding: 8px 10px; font-size: 13px; }
  .btn { min-height: 38px; padding: 8px 12px; font-size: 13px; }
  .topbar-actions .btn { font-size: 12px; padding: 7px 8px; }
}
