:root {
  --bg: #f3f5f4;
  --surface: #ffffff;
  --ink: #141718;
  --muted: #697582;
  --line: #dde3e6;
  --green: #167a59;
  --teal: #0f8b8d;
  --blue: #2563eb;
  --red: #bc4b51;
  --amber: #d88c28;
  --charcoal: #191d1f;
  --lime: #c8f135;
  --shadow: 0 20px 60px rgba(20, 28, 35, 0.09);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background:
    radial-gradient(circle at top right, rgba(22, 122, 89, 0.09), transparent 26rem),
    linear-gradient(180deg, #f8faf8 0%, var(--bg) 48%, #eef3f0 100%);
  color: var(--ink);
  font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; flex: 0 0 auto; }

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 256px;
  background: var(--charcoal);
  color: #f0f3f1;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  z-index: 10;
}
.brand { display: flex; gap: 12px; align-items: center; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: 8px;
  background: var(--lime);
  color: #111;
  font-weight: 800;
  font-size: 13px;
}
.brand > span:last-child { min-width: 0; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; }
.brand small { color: #a0aba7; font-size: 12px; margin-top: 2px; }
.nav { display: grid; gap: 5px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  color: #c5cec9;
  border-radius: 8px;
  font-weight: 600;
  transition: background 180ms, color 180ms;
}
.nav a.active, .nav a:hover { background: #282e30; color: #fff; }
.nav-emoji { margin-left: auto; font-size: 14px; }
.sidebar-note {
  margin-top: auto;
  padding: 14px;
  border: 1px solid #353b3e;
  border-radius: 8px;
  color: #c5cec9;
}
.sidebar-note span, .sidebar-note strong { display: block; }
.sidebar-note span { font-size: 12px; color: #94a09c; }

/* ── Shell ── */
.shell { margin-left: 256px; padding: 30px; max-width: 1320px; }

/* ── Page Head ── */
.page-head {
  min-height: 72px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 20px;
}
.eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
}
h1, h2 { margin: 0; letter-spacing: -0.03em; }
h1 { font-size: clamp(28px, 4vw, 42px); line-height: 1.08; }
h2 { font-size: 18px; }

/* ── Hero Panel ── */
.hero-panel {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 140px;
  padding: 24px;
  margin-bottom: 18px;
  color: #f3f6f4;
  background:
    linear-gradient(135deg, rgba(20, 23, 24, 0.97), rgba(22, 62, 56, 0.94)),
    radial-gradient(circle at 85% 20%, rgba(200, 241, 53, 0.30), transparent 19rem);
  border: 1px solid #2a3632;
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.hero-panel::after {
  content: "📋";
  position: absolute;
  right: 24px; bottom: -14px;
  font-size: 80px; opacity: 0.10;
  pointer-events: none;
}
.hero-panel h2 { font-size: 26px; max-width: 700px; }
.hero-panel p:not(.eyebrow) { margin: 6px 0 0; color: #cddbd4; max-width: 700px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero-panel .button.primary { background: var(--lime); color: #131313; border-color: var(--lime); }
.hero-panel .button:not(.primary) { background: rgba(255,255,255,0.08); color: #fff; border-color: rgba(255,255,255,0.18); }

/* ── Metrics Grid ── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}
.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
  display: grid;
  gap: 6px;
  position: relative;
  overflow: hidden;
}
.metric span {
  color: var(--muted);
  font-size: 12px; font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.metric strong { font-size: 28px; letter-spacing: -0.04em; }
.metric small { color: var(--muted); }
.metric.accent-green { border-top: 4px solid var(--green); }
.metric.accent-blue { border-top: 4px solid var(--blue); }
.metric.accent-amber { border-top: 4px solid var(--amber); }
.metric.accent-red { border-top: 4px solid var(--red); }

/* ── Cards / Panels ── */
.panel, .snapshot-card, .empty-state {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.panel { padding: 20px; }
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.panel-head span {
  color: var(--muted);
  font-size: 12px; font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.panel-head a { color: var(--blue); font-weight: 700; }

/* ── Layout Grids ── */
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.85fr);
  gap: 18px;
  margin-bottom: 18px;
}
.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}
.snapshot-card {
  padding: 17px;
  display: grid;
  gap: 5px;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(14px);
}
.snapshot-card span {
  color: var(--muted);
  font-size: 12px; font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.snapshot-card strong { font-size: 16px; }
.snapshot-card small { color: var(--muted); }

/* ── Empty State ── */
.empty-state {
  padding: 24px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  border-left: 5px solid var(--green);
}
.empty-state p:last-child { color: var(--muted); max-width: 600px; }
.hidden { display: none !important; }

/* ── Status Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  text-transform: capitalize;
}
.badge.open { background: #fee2e2; color: #ef4444; }
.badge.in_progress { background: #fef3c7; color: #b8860b; }
.badge.done { background: #d1fae5; color: var(--green); }

/* ── Lists ── */
.activity-list { display: grid; gap: 10px; }
.activity-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfc;
}
.activity-item strong { display: block; }
.activity-item small { color: var(--muted); }
.activity-emoji {
  display: inline-grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 8px;
  background: #eef5f1;
}

.list-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.list-item:last-child { border-bottom: none; }
.list-item-content h4 {
  font-size: 15px; font-weight: 600;
  margin-bottom: 3px;
}
.list-item-content h4 a { color: var(--ink); text-decoration: none; }
.list-item-content h4 a:hover { color: var(--blue); }
.list-item-meta {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* ── Task Rows ── */
.task-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 8px;
  background: #fbfcfc;
}
.task-row select {
  padding: 5px 8px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 600;
  font-size: 12px;
  min-width: 100px;
}
.task-info { flex: 1; }
.task-desc { font-weight: 600; font-size: 14px; }
.task-assignee { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── Buttons ── */
.button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms, box-shadow 160ms;
  text-decoration: none;
}
.button.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.button.secondary { background: #f1f5f3; color: var(--ink); }
.button.small { min-height: 34px; padding: 6px 10px; font-size: 12px; }
.button:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(20,28,35,0.10); }

/* ── Forms ── */
form { display: grid; gap: 14px; }
label {
  color: var(--muted);
  font-size: 12px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: grid; gap: 6px;
}
input, select, textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  color: var(--ink);
  background: #fbfcfd;
  font: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(37,99,235,0.18);
  border-color: var(--blue);
}
textarea { resize: vertical; }
.search-bar { display: flex; gap: 12px; margin-bottom: 20px; }
.inline-empty { padding: 20px; color: var(--muted); text-align: center; }

/* ── Detail View ── */
.detail-header { margin-bottom: 28px; }
.detail-header h2 { font-size: 24px; margin-bottom: 6px; }
.detail-meta { color: var(--muted); font-size: 14px; }
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.section {
  background: var(--surface);
  padding: 22px;
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.section-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-content { font-size: 15px; line-height: 1.65; color: #334155; }

.bullet-list { list-style: none; padding: 0; }
.bullet-list li {
  padding-left: 18px;
  position: relative;
  margin-bottom: 7px;
}
.bullet-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 8px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.transcript-box {
  background: #f1f5f3;
  padding: 14px;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  font-size: 13px;
  max-height: 280px;
  overflow-y: auto;
  line-height: 1.6;
}

/* ── Modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 50;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.visible { display: flex; }
.modal {
  background: var(--surface);
  border-radius: 10px;
  padding: 28px;
  width: 100%;
  max-width: 580px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.25);
}
.modal h3 { margin-bottom: 14px; }
.modal textarea {
  height: 260px;
  font-family: inherit;
  margin-bottom: 14px;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ── Toast ── */
.toast {
  position: fixed;
  right: 24px; bottom: 24px;
  z-index: 60;
  max-width: min(360px, calc(100vw - 32px));
  padding: 13px 16px;
  border-radius: 8px;
  color: #fff;
  background: var(--charcoal);
  box-shadow: 0 18px 50px rgba(0,0,0,0.20);
  font-weight: 800;
  transition: opacity 300ms, transform 300ms;
}
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }

/* ── Animations ── */
.view { animation: fadeIn 220ms ease-out; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .sidebar {
    position: static;
    width: auto;
    flex-direction: row;
    align-items: center;
    padding: 12px 18px;
    gap: 16px;
  }
  .sidebar-note { display: none; }
  .nav { display: flex; gap: 4px; }
  .nav a { min-height: 36px; padding: 8px 12px; font-size: 13px; }
  .nav a svg { display: none; }
  .nav-emoji { display: none; }
  .shell { margin-left: 0; padding: 22px; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-grid,
  .detail-grid,
  .snapshot-grid { grid-template-columns: 1fr; }
  .hero-panel { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 640px) {
  .sidebar { padding: 10px 14px; gap: 10px; }
  .brand strong { font-size: 14px; }
  .brand small { display: none; }
  .brand-mark { width: 34px; height: 34px; font-size: 11px; }
  .nav a { padding: 7px 10px; font-size: 12px; }
  .shell { padding: 16px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .metrics-grid { grid-template-columns: 1fr; }
  .metric strong { font-size: 22px; }
  .hero-panel { padding: 18px; min-height: auto; }
  .hero-panel h2 { font-size: 20px; }
  .task-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .search-bar { flex-direction: column; }
  .search-bar form { flex-direction: column !important; }
  .button { min-height: 38px; padding: 8px 12px; font-size: 13px; }
  .detail-header h2 { font-size: 20px; }
  .modal { margin: 16px; padding: 20px; }
}
