/* Woodland Wellness Ops - tokens, shell, views, chat. Paper/forest/rust palette. */

:root {
  --paper: #F5F1E8;
  --paper-2: #EDE7D8;
  --card: #FBF8F1;
  --card-2: #F7F2E5;
  --ink: #1F2420;
  --ink-2: #4A4E48;
  --ink-3: #7A7D74;
  --ink-4: #A8A79D;
  --line: #E2DBC6;
  --line-2: #D4CCB3;
  --forest: #2D4A3A;
  --forest-2: #1F3528;
  --forest-soft: #D9E2D4;
  --moss: #5C6F4C;
  --moss-soft: #E8EADC;
  --rust: #B8572C;
  --rust-soft: #F4DFD0;
  --ochre: #C89B3C;
  --ochre-soft: #F2E6C5;
  --sky: #6B8A9E;
  --sky-soft: #DCE5EA;
  --sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --serif: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --r-sm: 6px; --r: 10px; --r-lg: 14px; --r-xl: 20px;
  --sh-sm: 0 1px 2px rgba(40,38,30,0.04);
  --sh: 0 1px 3px rgba(40,38,30,0.06), 0 1px 2px rgba(40,38,30,0.04);
  --sh-lg: 0 8px 24px -8px rgba(40,38,30,0.12), 0 2px 6px rgba(40,38,30,0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
#root { height: 100%; }
body::before {
  content: ""; position: fixed; inset: 0;
  pointer-events: none; z-index: 0; opacity: 0.5;
  background-image:
    radial-gradient(circle at 15% 20%, rgba(139,119,78,0.025) 0%, transparent 35%),
    radial-gradient(circle at 85% 60%, rgba(90,70,40,0.02) 0%, transparent 40%);
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 2px solid var(--paper); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-4); }

.serif { font-family: var(--serif); }
.mono  { font-family: var(--mono); }
.num   { font-family: var(--serif); font-variant-numeric: tabular-nums lining-nums; }
.eyebrow { font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; border-radius: 4px; }

/* ==== buttons ==== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--r);
  font-size: 13.5px; font-weight: 500; line-height: 1;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
  border: 1px solid transparent; white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--forest); color: #F5F1E8; }
.btn-primary:hover:not(:disabled) { background: var(--forest-2); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover:not(:disabled) { background: var(--card-2); }
.btn-quiet { background: transparent; color: var(--ink-2); }
.btn-quiet:hover:not(:disabled) { background: var(--card-2); color: var(--ink); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }

/* ==== chips ==== */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 500; line-height: 1.4;
  background: var(--card-2); color: var(--ink-2); border: 1px solid var(--line);
}
.chip .dot { width: 6px; height: 6px; border-radius: 999px; background: var(--ink-3); }
.chip-lapsed { background: var(--rust-soft); color: #7A3614; border-color: transparent; }
.chip-lapsed .dot { background: var(--rust); }
.chip-atrisk { background: var(--ochre-soft); color: #7A5A14; border-color: transparent; }
.chip-atrisk .dot { background: var(--ochre); }
.chip-active { background: var(--forest-soft); color: var(--forest-2); border-color: transparent; }
.chip-active .dot { background: var(--forest); }
.chip-dormant { background: #E8DCD6; color: #5A2B1A; border-color: transparent; }
.chip-dormant .dot { background: #8B4A3A; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); }
.ico { width: 16px; height: 16px; flex: 0 0 16px; stroke-width: 1.6; }
.hr { height: 1px; background: var(--line); border: 0; margin: 0; }
.big-num {
  font-family: var(--serif); font-weight: 400;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -0.02em; color: var(--ink); line-height: 1;
}
.trend-up { color: var(--forest); }
.trend-down { color: var(--rust); }

/* ==== auth gate ==== */
.gate {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper); padding: 20px;
}
.gate-card {
  width: 100%; max-width: 380px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 28px 24px; box-shadow: var(--sh);
}
.gate-title { font-family: var(--serif); font-size: 22px; margin: 0 0 6px; color: var(--ink); }
.gate-sub { color: var(--ink-2); font-size: 14px; margin: 0 0 18px; }
.gate-input {
  width: 100%; padding: 10px 12px; font-size: 14px; line-height: 1.4;
  background: var(--paper); border: 1px solid var(--line-2); border-radius: 8px;
  outline: none; font-family: var(--mono); color: var(--ink);
}
.gate-input:focus { border-color: var(--moss); }
.gate-err { color: var(--rust); font-size: 12.5px; margin-top: 8px; min-height: 16px; }
.gate-actions { display: flex; justify-content: flex-end; margin-top: 14px; }

/* ==== shell ==== */
.app-shell {
  display: grid; height: 100vh; position: relative; z-index: 1;
  grid-template-columns: 220px minmax(0, 1fr) 360px;
  grid-template-rows: 100%;
}
.app-shell.side-collapsed { grid-template-columns: 64px minmax(0, 1fr) 360px; }
.app-shell.chat-closed { grid-template-columns: 220px minmax(0, 1fr) 0; }
.app-shell.chat-closed.side-collapsed { grid-template-columns: 64px minmax(0, 1fr) 0; }
@media (max-width: 1400px) {
  .app-shell { grid-template-columns: 220px minmax(0, 1fr) 340px; }
  .app-shell.side-collapsed { grid-template-columns: 64px minmax(0, 1fr) 340px; }
}
@media (max-width: 1280px) {
  .app-shell { grid-template-columns: 64px minmax(0, 1fr) 340px; }
  .app-shell.chat-closed { grid-template-columns: 64px minmax(0, 1fr) 0; }
}
@media (max-width: 1100px) {
  .app-shell, .app-shell.side-collapsed { grid-template-columns: 64px minmax(0, 1fr); }
  .app-shell .chat-panel {
    position: fixed; right: 0; top: 0; bottom: 0;
    width: 360px; max-width: 90vw; z-index: 31;
    box-shadow: -24px 0 60px -30px rgba(26, 30, 24, 0.25);
  }
  .app-shell.chat-closed .chat-panel { display: none; }
  .chat-backdrop {
    position: fixed; inset: 0; z-index: 30;
    background: rgba(26, 30, 24, 0.22);
    backdrop-filter: blur(1.5px);
    -webkit-backdrop-filter: blur(1.5px);
    cursor: pointer; animation: backdrop-in 160ms ease-out;
  }
}
@media (min-width: 1101px) { .chat-backdrop { display: none; } }
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; grid-template-rows: 56px 1fr; }
  .app-shell .sidebar { display: none; }
  .app-shell .chat-panel { width: 100%; max-width: 100%; }
}

/* ==== sidebar ==== */
.sidebar {
  background: var(--paper); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 10px; min-height: 0;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.sidebar.collapsed .brand { justify-content: center; padding: 4px 0 16px; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--forest); color: var(--paper);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 500; font-size: 14px;
}
.brand-name { font-family: var(--serif); font-size: 16px; color: var(--ink); font-weight: 500; }
.brand-tag { font-size: 11px; color: var(--ink-3); letter-spacing: 0.06em; text-transform: uppercase; margin-top: 1px; }
.sidebar.collapsed .brand-name, .sidebar.collapsed .brand-tag { display: none; }
.nav-items { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  font-size: 13.5px; color: var(--ink-2); position: relative;
  transition: background 100ms;
}
.nav-item:hover { background: var(--paper-2); color: var(--ink); }
.nav-item.active { background: var(--forest-soft); color: var(--forest-2); font-weight: 500; }
.nav-item.active .ico { color: var(--forest); }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px 8px; }
.sidebar.collapsed .nav-label { display: none; }
.nav-badge {
  margin-left: auto; font-size: 10.5px; font-weight: 600;
  background: var(--rust); color: #FBF8F1;
  padding: 1px 6px; border-radius: 999px;
  min-width: 18px; height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto; line-height: 1;
}
.nav-item.active .nav-badge { background: var(--forest); }
.sidebar.collapsed .nav-badge { display: none; }
.sidebar.collapsed .nav-dot {
  position: absolute; top: 4px; right: 6px;
  width: 6px; height: 6px; border-radius: 999px; background: var(--rust);
}
.nav-dot { display: none; }
.sidebar-foot { padding-top: 10px; border-top: 1px solid var(--line); margin-top: 10px; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px; }
.user-name-wrap { flex: 1; min-width: 0; }
.sidebar.collapsed .user-name-wrap { display: none; }
.user-name { font-size: 13px; color: var(--ink); font-weight: 500; line-height: 1.2; }
.user-role { font-size: 11px; color: var(--ink-3); }
.signout-btn {
  width: 28px; height: 28px; border-radius: 8px; flex: 0 0 auto;
  color: var(--ink-3); transition: background 100ms, color 100ms;
  display: inline-flex; align-items: center; justify-content: center;
}
.signout-btn:hover { background: var(--rust-soft); color: var(--rust); }
.sidebar.collapsed .signout-btn { display: none; }

/* ==== main / topbar ==== */
.main { display: flex; flex-direction: column; min-width: 0; background: var(--paper); }
.topbar {
  height: 56px; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line); background: var(--paper); flex: 0 0 56px;
}
.search-wrap {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 8px;
  background: var(--card); border: 1px solid var(--line);
  min-width: 320px;
}
.search-wrap .ico { color: var(--ink-3); }
.search-input { border: 0; background: none; outline: none; font-size: 13.5px; flex: 1; }
.search-input::placeholder { color: var(--ink-3); }
.content { flex: 1; overflow: auto; padding: 28px 32px 40px; }
@media (max-width: 700px) { .content { padding: 16px; } }

/* ==== view shared ==== */
.view-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 24px; }
.view-title { font-family: var(--serif); font-size: 30px; font-weight: 500; letter-spacing: -0.01em; margin: 4px 0 8px; line-height: 1.15; color: var(--ink); }
.view-sub { color: var(--ink-2); font-size: 14.5px; margin: 0; max-width: 560px; line-height: 1.5; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar-right { display: flex; gap: 8px; align-items: center; }
.select {
  background: var(--card); border: 1px solid var(--line-2);
  border-radius: 8px; padding: 6px 28px 6px 10px;
  font-size: 13px; color: var(--ink);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%237A7D74' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}

/* ==== avatar ==== */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; color: var(--paper);
  font-family: var(--serif); font-weight: 500; flex: 0 0 auto;
}

/* ==== segmented control ==== */
.segmented {
  display: inline-flex; padding: 3px; border-radius: 8px;
  background: var(--paper-2); gap: 2px;
}
.segmented-btn {
  padding: 5px 12px; border-radius: 6px;
  font-size: 12.5px; color: var(--ink-2);
  transition: background 120ms, color 120ms;
}
.segmented-btn.active { background: var(--card); color: var(--ink); box-shadow: var(--sh-sm); font-weight: 500; }

/* ==== home ==== */
.home { max-width: 1100px; }
.home-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 36px; flex-wrap: wrap; }
.home-greeting {
  font-family: var(--serif); font-size: 36px; font-weight: 400;
  letter-spacing: -0.015em; line-height: 1.1; margin: 6px 0 10px; color: var(--ink);
}
.home-summary { font-size: 17px; color: var(--ink-2); max-width: 640px; line-height: 1.55; margin: 0; }
.home-summary strong { color: var(--ink); font-weight: 600; }
.home-stamp { text-align: right; flex-shrink: 0; color: var(--ink-3); font-size: 12px; }
.home-stamp-date { font-family: var(--serif); font-size: 20px; color: var(--ink); }

.needs-stack { display: flex; flex-direction: column; gap: 10px; margin-bottom: 36px; }
.needs-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1.5fr) minmax(0, 1fr) auto;
  align-items: center; gap: 16px;
  padding: 20px 22px; background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--rust);
  border-radius: var(--r-lg); text-align: left;
  transition: background 120ms, box-shadow 120ms;
  cursor: pointer; width: 100%;
}
.needs-card:hover { background: var(--card-2); box-shadow: var(--sh); }
.needs-card.accent-ochre { border-left-color: var(--ochre); }
.needs-card.accent-forest { border-left-color: var(--forest); }
.needs-card.accent-sky { border-left-color: var(--sky); }
.needs-card.quiet { border-left-color: var(--line-2); background: transparent; }
.needs-card.quiet:hover { background: var(--card); }
.needs-count {
  font-size: 44px; font-weight: 400; line-height: 1; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums lining-nums;
  text-align: center; color: var(--rust);
  font-family: var(--serif);
}
.needs-card.accent-ochre .needs-count { color: var(--ochre); }
.needs-card.accent-forest .needs-count { color: var(--forest); }
.needs-card.accent-sky .needs-count { color: var(--sky); }
.needs-card.quiet .needs-count { color: var(--ink-3); font-size: 40px; }
.needs-body { min-width: 0; }
.needs-title { font-size: 16px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.needs-sub { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.needs-action { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-3); font-weight: 500; }
.needs-card:hover .needs-action { color: var(--forest); }
@media (max-width: 800px) {
  .needs-card { grid-template-columns: 56px 1fr; grid-template-rows: auto auto; gap: 12px 16px; }
  .needs-action { grid-column: 2; justify-self: start; }
}

.home-metrics { margin-bottom: 32px; }
.metrics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 900px) { .metrics-grid { grid-template-columns: 1fr; } }
.metric-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; }
.metric-card .lbl { font-size: 12.5px; color: var(--ink-3); margin-bottom: 8px; }
.metric-card .big { font-size: 32px; line-height: 1; }
.metric-card .delta { font-size: 12.5px; font-weight: 500; margin-left: 6px; }
.metric-card .foot { margin-top: 10px; font-size: 11.5px; color: var(--ink-3); }

.home-footer {
  display: flex; align-items: center; gap: 20px;
  padding: 16px 0; border-top: 1px solid var(--line);
  margin-top: 12px; flex-wrap: wrap;
}
.clinic-hours { display: flex; gap: 14px; color: var(--ink-2); font-size: 12.5px; flex-wrap: wrap; }
.clinic-hours .day-pill { display: inline-flex; gap: 4px; }
.clinic-hours .day { color: var(--ink-3); }
.clinic-hours .today { color: var(--forest); font-weight: 600; }
.clinic-hours .closed { color: var(--ink-4); }

/* ==== retention ==== */
.retention-list { overflow: hidden; }
.retention-head, .retention-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1.2fr 0.8fr 1.4fr 32px;
  gap: 14px; padding: 12px 18px; align-items: center;
}
.retention-head {
  background: var(--card-2); border-bottom: 1px solid var(--line);
  font-size: 11px; color: var(--ink-3); font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.retention-row {
  border-bottom: 1px solid var(--line);
  cursor: pointer; transition: background 100ms; font-size: 13.5px;
}
.retention-row:last-child { border-bottom: 0; }
.retention-row:hover, .retention-row.open { background: var(--card-2); }
.pt-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.retention-expand {
  display: grid; grid-template-columns: 2fr 1fr; gap: 20px;
  padding: 18px 18px 22px; background: var(--paper-2); border-bottom: 1px solid var(--line);
}
.retention-draft { background: var(--card); padding: 14px; border-radius: var(--r); border: 1px solid var(--line); }
.draft-textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; font-size: 13.5px; background: var(--paper); color: var(--ink);
  resize: vertical; line-height: 1.5; outline: none; font-family: inherit;
}
.draft-textarea:focus { border-color: var(--moss); }
.retention-history { padding: 14px; }
.attempt-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.attempt-list li { display: flex; gap: 10px; color: var(--ink-2); }
.attempt-list .chan { color: var(--moss); text-transform: capitalize; }
.attempt-list .res { color: var(--ink-3); }
@media (max-width: 900px) {
  .retention-head, .retention-row { grid-template-columns: 1.5fr 0.8fr 0.8fr 32px; }
  .retention-head > *:nth-child(3), .retention-row > *:nth-child(3),
  .retention-head > *:nth-child(5), .retention-row > *:nth-child(5) { display: none; }
  .retention-expand { grid-template-columns: 1fr; }
}

/* ==== metrics ==== */
.metrics-deep { display: flex; flex-direction: column; gap: 16px; }
.metric-deep { padding: 24px 28px; }
.metric-deep-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.metric-breakdown { display: flex; gap: 32px; margin-top: 20px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.breakdown-item { display: flex; flex-direction: column; gap: 4px; }
.referral-list { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.referral-row { display: grid; grid-template-columns: 160px 1fr 32px; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-2); }
.referral-bar { height: 6px; border-radius: 3px; background: var(--paper-2); overflow: hidden; }
.referral-bar > div { height: 100%; background: var(--moss); }
.provider-breakdown { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.provider-row {
  display: grid; grid-template-columns: 1.5fr 100px 1fr;
  gap: 20px; align-items: center; padding: 8px 0;
  border-bottom: 1px solid var(--line); cursor: pointer;
  transition: background 100ms;
}
.provider-row:last-child { border-bottom: 0; }
.provider-row:hover { background: var(--card-2); }

/* ==== pre-auth ==== */
.auth-list { overflow: hidden; }
.auth-head, .auth-row {
  display: grid;
  grid-template-columns: 1.5fr 1.2fr 1fr 1.4fr 1.2fr 1fr 32px;
  gap: 14px; padding: 12px 18px; align-items: center;
}
.auth-head { background: var(--card-2); border-bottom: 1px solid var(--line); font-size: 11px; color: var(--ink-3); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; }
.auth-row { border-bottom: 1px solid var(--line); cursor: pointer; transition: background 100ms; font-size: 13px; }
.auth-row:last-child { border-bottom: 0; }
.auth-row:hover { background: var(--card-2); }
.auth-row.danger { background: rgba(184,87,44,0.04); }
.auth-row.warn { background: rgba(200,155,60,0.04); }
.auth-row.open { background: var(--card-2); }
.usage-bar { height: 4px; border-radius: 2px; background: var(--paper-2); overflow: hidden; }
.usage-bar > div { height: 100%; transition: width 240ms; background: var(--forest); }
.usage-bar.warn > div { background: var(--ochre); }
.usage-bar.danger > div { background: var(--rust); }
.auth-expand { display: grid; grid-template-columns: 1fr 2fr auto; gap: 24px; padding: 16px 18px 20px; background: var(--paper-2); border-bottom: 1px solid var(--line); align-items: start; }
.auth-actions { display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 900px) {
  .auth-head, .auth-row { grid-template-columns: 1.5fr 1fr 1fr 32px; }
  .auth-head > *:nth-child(3), .auth-row > *:nth-child(3),
  .auth-head > *:nth-child(6), .auth-row > *:nth-child(6) { display: none; }
  .auth-expand { grid-template-columns: 1fr; }
}

/* ==== drafts ==== */
.drafts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; }
.draft-card { padding: 18px; transition: opacity 240ms, transform 240ms; }
.draft-card.approved { opacity: 0.5; transform: scale(0.98); }
.draft-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; gap: 10px; }
.draft-card-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }

/* ==== team ==== */
.team-list, .timeoff-list { overflow: hidden; }
.team-head, .team-row {
  display: grid; grid-template-columns: 2fr 0.9fr 1fr 1fr 1.2fr 1.5fr;
  gap: 14px; padding: 14px 18px; align-items: center;
}
.team-head { background: var(--card-2); border-bottom: 1px solid var(--line); font-size: 11px; color: var(--ink-3); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; }
.team-row { border-bottom: 1px solid var(--line); font-size: 13px; }
.team-row:last-child { border-bottom: 0; }
.timeoff-row {
  display: grid; grid-template-columns: 1.5fr 1.2fr 1fr auto;
  gap: 14px; padding: 14px 18px; align-items: center;
  border-bottom: 1px solid var(--line);
}
.timeoff-row:last-child { border-bottom: 0; }
@media (max-width: 900px) {
  .team-head, .team-row { grid-template-columns: 1.5fr 1fr 1.2fr; }
  .team-head > *:nth-child(3), .team-row > *:nth-child(3),
  .team-head > *:nth-child(4), .team-row > *:nth-child(4),
  .team-head > *:nth-child(5), .team-row > *:nth-child(5) { display: none; }
}

/* ==== empty / loading states ==== */
.empty-state {
  padding: 48px 24px; text-align: center;
  color: var(--ink-3); font-size: 14px; line-height: 1.5;
}
.empty-state .title { font-family: var(--serif); font-size: 18px; color: var(--ink-2); margin-bottom: 6px; }
.empty-state .hint { font-size: 12.5px; color: var(--ink-4); margin-top: 8px; }
.loading-state {
  padding: 40px; text-align: center; color: var(--ink-3); font-size: 13px;
}
.banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--r);
  background: var(--ochre-soft); color: #7A5A14;
  border: 1px solid rgba(200,155,60,0.3);
  margin-bottom: 16px; font-size: 13px;
}
.banner.info { background: var(--sky-soft); color: #2F4757; border-color: rgba(107,138,158,0.3); }

/* ==== chat panel ==== */
.chat-panel {
  border-left: 1px solid var(--line);
  background: var(--paper);
  display: flex; flex-direction: column;
  overflow: hidden; min-height: 0;
}
.app-shell.chat-closed .chat-panel { display: none; }
.chat-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; border-bottom: 1px solid var(--line); flex: 0 0 auto;
}
.agent-dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--forest);
  box-shadow: 0 0 0 3px rgba(45,74,58,0.15);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(45,74,58,0.15); }
  50% { box-shadow: 0 0 0 5px rgba(45,74,58,0.08); }
}
.chat-body { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.chat-row { display: flex; flex-direction: column; gap: 3px; }
.chat-row.user { align-items: flex-end; }
.chat-row .ts { font-size: 10.5px; color: var(--ink-4); padding: 0 6px; }
.bubble {
  padding: 10px 13px; border-radius: 12px;
  font-size: 13.5px; line-height: 1.5; max-width: 90%;
  white-space: pre-wrap; word-wrap: break-word;
}
.bubble.user { background: var(--forest); color: #F5F1E8; border-bottom-right-radius: 4px; }
.bubble.agent { background: var(--card); border: 1px solid var(--line); color: var(--ink); border-bottom-left-radius: 4px; }
.bubble.agent.wide { max-width: 100%; }
.bubble.thinking { padding: 14px 16px; }
.bubble.error { background: var(--rust-soft); color: #7A3614; border-color: transparent; }
.typing { display: inline-flex; gap: 3px; }
.typing i { width: 5px; height: 5px; border-radius: 999px; background: var(--ink-3); animation: typing 1.2s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 0%, 100% { opacity: 0.3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-2px); } }
.mini-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.mini-item { display: flex; gap: 8px; font-size: 13px; color: var(--ink-2); align-items: baseline; }
.mini-item > :first-child { font-family: var(--serif); font-size: 15px; min-width: 20px; }
.inline-table { display: flex; flex-direction: column; background: var(--paper-2); border-radius: 8px; overflow: hidden; }
.inline-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; font-size: 12.5px; border-bottom: 1px solid var(--line); gap: 10px; }
.inline-row:last-child { border-bottom: 0; }
.draft-editable { background: var(--paper-2); padding: 10px 12px; border-radius: 8px; font-size: 13px; color: var(--ink); line-height: 1.5; border: 1px dashed var(--line-2); }
.chat-suggestions { padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 6px; border-top: 1px solid var(--line); flex: 0 0 auto; }
.suggestion-chip {
  padding: 5px 10px; border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--card); color: var(--ink-2); font-size: 11.5px;
  transition: background 100ms, color 100ms, border-color 100ms;
  text-align: left;
}
.suggestion-chip:hover { background: var(--moss-soft); color: var(--forest-2); border-color: var(--moss); }
.chat-input {
  display: flex; gap: 8px; padding: 12px 14px;
  border-top: 1px solid var(--line); align-items: flex-end;
  background: var(--card); flex: 0 0 auto;
}
.chat-input textarea {
  flex: 1; resize: none; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 13.5px; background: var(--paper); color: var(--ink);
  line-height: 1.4; outline: none; max-height: 120px; min-height: 38px;
}
.chat-input textarea:focus { border-color: var(--moss); }
.chat-send {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--forest); color: #F5F1E8;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 120ms;
}
.chat-send:hover:not(:disabled) { background: var(--forest-2); }
.chat-send:disabled { opacity: 0.5; cursor: not-allowed; }
.ask-ops {
  position: fixed; right: 20px; bottom: 20px; z-index: 20;
  display: none; align-items: center; gap: 6px;
  padding: 10px 14px; border-radius: 999px;
  background: var(--forest); color: var(--paper);
  box-shadow: var(--sh-lg); font-weight: 500; font-size: 13.5px;
}
.app-shell.chat-closed .ask-ops { display: inline-flex; }
