/* ==========================================================================
   Greyhouse Ops: demo design system
   Grayscale-dominant palette. Primary actions invert black/white rather
   than use a hue. Small muted accents are reserved for status states only.
   ========================================================================== */

:root {
  --bg: #FAFAF9;
  --surface: #FFFFFF;
  --surface-2: #F2F1EE;
  --surface-3: #EAE8E3;
  --border: #E3E1DB;
  --border-strong: #D2CFC7;

  --text: #17171A;
  --text-muted: #6B6A65;
  --text-faint: #9C9A93;

  --primary: #17171A;
  --primary-foreground: #FDFDFC;
  --ring: rgba(23, 23, 26, 0.28);

  --success-bg: #E4F2E7;
  --success-text: #1E7A34;
  --warning-bg: #FBF0DA;
  --warning-text: #92660D;
  --danger-bg: #FBE8E7;
  --danger-text: #B3261E;
  --info-bg: #E7EDF3;
  --info-text: #3A5A78;
  --accent-bg: #EFE8F7;
  --accent-text: #5B4A82;

  --shadow-sm: 0 1px 2px rgba(23, 23, 26, 0.06);
  --shadow-md: 0 6px 20px -8px rgba(23, 23, 26, 0.16);
  --shadow-lg: 0 20px 50px -16px rgba(23, 23, 26, 0.28);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  --font-serif: "Mona Sans", -apple-system, "Segoe UI", sans-serif;
  --font-sans: "Mona Sans", -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Monaspace Neon", ui-monospace, Menlo, Consolas, monospace;

  --sidebar-w: 236px;
  --sidebar-w-collapsed: 64px;
  --header-h: 56px;
}

:root[data-theme="dark"] {
  --bg: #101012;
  --surface: #18181B;
  --surface-2: #1E1E22;
  --surface-3: #26262B;
  --border: #2B2B30;
  --border-strong: #38383E;

  --text: #F3F2EF;
  --text-muted: #A8A6A0;
  --text-faint: #706E68;

  --primary: #F3F2EF;
  --primary-foreground: #101012;
  --ring: rgba(243, 242, 239, 0.28);

  --success-bg: rgba(48, 168, 82, 0.16);
  --success-text: #5FD988;
  --warning-bg: rgba(217, 163, 45, 0.18);
  --warning-text: #F0C168;
  --danger-bg: rgba(216, 68, 58, 0.18);
  --danger-text: #F28B84;
  --info-bg: rgba(90, 130, 168, 0.18);
  --info-text: #9BC0DE;
  --accent-bg: rgba(139, 111, 194, 0.18);
  --accent-text: #C6AEEC;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 26px -10px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 24px 60px -18px rgba(0, 0, 0, 0.7);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.15s ease, color 0.15s ease;
}
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 600; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; }
button { font-family: inherit; color: inherit; }
[hidden] { display: none !important; }
::selection { background: var(--primary); color: var(--primary-foreground); }

.mono { font-family: var(--font-mono); letter-spacing: 0.02em; }
.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }

/* ---------- Demo chrome: badge + restart ---------- */
.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  flex-shrink: 0;
}
.demo-badge__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #5FD988;
  box-shadow: 0 0 0 2px rgba(95, 217, 136, 0.25);
}

.restart-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.12s ease;
}
.restart-btn:hover { color: var(--text); border-color: var(--text); background: var(--surface-2); }

.login-reset-wrap {
  text-align: center; margin-top: 14px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
  white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { opacity: 0.88; }
.btn-outline { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger-text); color: #fff; }
.btn-danger:hover { opacity: 0.88; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-icon { padding: 8px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-block { width: 100%; }

/* ---------- Inputs ---------- */
label.field-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.input, .textarea, select.input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.input:focus, .textarea:focus, select.input:focus {
  outline: none; border-color: var(--text); box-shadow: 0 0 0 3px var(--ring);
}
.textarea { resize: vertical; min-height: 88px; }
.field { margin-bottom: 16px; }
.field-row { display: flex; gap: 14px; }
.field-row .field { flex: 1; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--waiting_onboarding { background: var(--warning-bg); color: var(--warning-text); }
.badge--onboarded { background: var(--info-bg); color: var(--info-text); }
.badge--in_progress { background: var(--accent-bg); color: var(--accent-text); }
.badge--delivered { background: var(--success-bg); color: var(--success-text); }
.badge--updates { background: var(--danger-bg); color: var(--danger-text); }
.badge--pending { background: var(--surface-3); color: var(--text-muted); }
.badge--submitted { background: var(--warning-bg); color: var(--warning-text); }
.badge--approved { background: var(--success-bg); color: var(--success-text); }
.badge--revision_requested { background: var(--danger-bg); color: var(--danger-text); }
.badge--neutral { background: var(--surface-3); color: var(--text-muted); }
.badge--owner { background: var(--primary); color: var(--primary-foreground); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-header { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-header h3 { font-size: 15px; line-height: 1.4; }
.card-header p { font-size: 12.5px; color: var(--text-muted); margin-top: 5px; line-height: 1.5; }
.card-body { padding: 20px; }
.card-body--tight { padding: 12px; }

/* ---------- Progress ---------- */
.progress-track {
  width: 100%; height: 8px; border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.progress-fill { height: 100%; background: var(--primary); border-radius: 999px; transition: width 0.25s ease; }
.progress-fill--accent { background: var(--accent-text); }

/* ==========================================================================
   Login screen
   ========================================================================== */
.login-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 10%, var(--surface-2), transparent 45%),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px 32px 32px;
}
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--primary); color: var(--primary-foreground);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-weight: 700; font-size: 16px;
  flex-shrink: 0;
}
.brand-name { font-family: var(--font-serif); font-weight: 700; font-size: 17px; }
.login-card h1 { font-size: 21px; margin-bottom: 8px; }
.login-sub { color: var(--text-muted); font-size: 13px; margin-bottom: 20px; line-height: 1.5; }
.login-note {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; margin-bottom: 22px;
  font-size: 12.5px; color: var(--text-muted); line-height: 1.55;
}
.login-note svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; color: var(--text-faint); }
.login-accounts-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint);
  margin-bottom: 10px;
}
.demo-account-list { display: flex; flex-direction: column; gap: 8px; }
.demo-account-btn {
  display: flex; align-items: center; gap: 12px; text-align: left;
  width: 100%; padding: 13px 14px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; transition: all 0.12s ease;
}
.demo-account-btn:hover { border-color: var(--text); background: var(--surface-3); }
.demo-account-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary); color: var(--primary-foreground);
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700;
}
.demo-account-info { flex: 1; min-width: 0; }
.demo-account-name { font-size: 13px; font-weight: 600; display: block; }
.demo-account-role { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; display: block; }
.login-footnote { margin-top: 24px; font-size: 11.5px; color: var(--text-faint); text-align: center; line-height: 1.6; }

/* ==========================================================================
   App shell
   ========================================================================== */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  flex-shrink: 0;
  transition: width 0.18s ease;
}
.sidebar.is-collapsed { width: var(--sidebar-w-collapsed); }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 16px; height: var(--header-h); border-bottom: 1px solid var(--border); }
.sidebar-brand .brand-name { font-size: 15px; white-space: nowrap; overflow: hidden; }
.sidebar.is-collapsed .brand-name, .sidebar.is-collapsed .nav-label, .sidebar.is-collapsed .sidebar-foot-text { display: none; }

.sidebar-nav { flex: 1; padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-section-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); padding: 12px 10px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 13.5px; font-weight: 500;
  cursor: pointer; border: none; background: none; width: 100%; text-align: left;
  transition: all 0.1s ease;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.is-active { background: var(--primary); color: var(--primary-foreground); font-weight: 600; }
.nav-icon { width: 16px; height: 16px; flex-shrink: 0; display: inline-flex; }
.nav-icon svg { width: 100%; height: 100%; }

.sidebar-foot { padding: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.sidebar-foot-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: transparent; color: var(--text-faint); cursor: pointer; font-size: 12px;
  white-space: nowrap; overflow: hidden;
}
.sidebar-foot-btn:hover { background: var(--surface-2); color: var(--text); }
.sidebar.is-collapsed .sidebar-foot-btn { padding: 9px 0; }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-header {
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  position: sticky; top: 0; z-index: 20;
}
.header-title-group { display: flex; align-items: center; gap: 12px; min-width: 0; }
.header-title { font-family: var(--font-serif); font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
@media (max-width: 560px) { .app-header .demo-badge { display: none; } }

.theme-toggle {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: transparent;
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-muted);
}
.theme-toggle:hover { background: var(--surface-2); color: var(--text); }
.theme-toggle svg { width: 16px; height: 16px; }

.avatar-menu { position: relative; }
.avatar-btn {
  display: flex; align-items: center; gap: 8px; background: none; border: none; color: var(--text); cursor: pointer; padding: 4px 6px 4px 4px; border-radius: 999px;
}
.avatar-btn:hover { background: var(--surface-2); }
.avatar-circle {
  width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: var(--primary-foreground);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.avatar-name { font-size: 12.5px; font-weight: 600; }
.avatar-role { font-size: 10.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.04em; }

.dropdown-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  min-width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); padding: 6px; display: none;
}
.dropdown-menu.is-open { display: block; }
.dropdown-item {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 7px;
  background: none; border: none; cursor: pointer; font-size: 13px; color: var(--text);
}
.dropdown-item:hover { background: var(--surface-2); }
.dropdown-sep { height: 1px; background: var(--border); margin: 5px 2px; }

.page-container { max-width: 1240px; margin: 0 auto; padding: 28px 24px 56px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 23px; }
.page-head p { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
#btn-mobile-nav { display: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 720px) {
  .grid-4 { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 80; height: 100vh; left: -100%; top: 0; }
  .sidebar.is-mobile-open { left: 0; box-shadow: var(--shadow-lg); }
  #btn-mobile-nav { display: inline-flex; }
  .sidebar-backdrop.is-visible { display: block; position: fixed; inset: 0; background: rgba(15, 15, 17, 0.45); z-index: 70; }
}

/* ---------- Stat tile ---------- */
.stat-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.stat-tile__label { font-size: 11.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.stat-tile__value { font-family: var(--font-serif); font-size: 26px; font-weight: 700; }
.stat-tile__meta { font-size: 12px; color: var(--text-faint); margin-top: 6px; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left; padding: 10px 14px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-faint); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr.is-clickable { cursor: pointer; }
.data-table tr.is-clickable:hover td { background: var(--surface-2); }
.cell-primary { font-weight: 600; }
.cell-sub { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; }

.client-row-cards { display: none; }
@media (max-width: 860px) {
  .table-wrap table.data-table { display: none; }
  .client-row-cards { display: flex; flex-direction: column; gap: 10px; }
  .client-row-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; cursor: pointer; }
  .client-row-card:hover { border-color: var(--border-strong); }
}

/* ---------- Accordion ---------- */
.accordion-item { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; overflow: hidden; background: var(--surface); }
.accordion-trigger {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: none; border: none; color: var(--text); cursor: pointer; text-align: left;
}
.accordion-trigger:hover { background: var(--surface-2); }
.accordion-status-icon { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.accordion-status-icon svg { width: 12px; height: 12px; }
.accordion-title { flex: 1; min-width: 0; }
.accordion-title .item-label { font-weight: 600; font-size: 13.5px; }
.accordion-title .item-category { font-size: 11px; color: var(--text-faint); }
.accordion-chevron { transition: transform 0.15s ease; color: var(--text-faint); flex-shrink: 0; }
.accordion-chevron svg { width: 16px; height: 16px; }
.accordion-item.is-open .accordion-chevron { transform: rotate(180deg); }
.accordion-panel { max-height: 0; overflow: hidden; transition: max-height 0.2s ease; }
.accordion-item.is-open .accordion-panel { max-height: 800px; }
.accordion-panel-inner { padding: 16px; border-top: 1px solid var(--border); }
.revision-note { background: var(--danger-bg); color: var(--danger-text); border-radius: var(--radius-sm); padding: 11px 13px; font-size: 12.5px; line-height: 1.5; margin-bottom: 14px; }
.file-drop {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 18px; text-align: center; color: var(--text-muted); font-size: 12.5px; cursor: pointer;
}
.file-drop:hover { background: var(--surface-2); border-color: var(--text); }
.file-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 13px; font-size: 12.5px; }

/* ---------- Dialog / modal ---------- */
.dialog-backdrop {
  position: fixed; inset: 0; background: rgba(15, 15, 17, 0.5); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; z-index: 200; padding: 20px;
}
.dialog {
  width: 100%; max-width: 460px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  border: 1px solid var(--border); max-height: 88vh; display: flex; flex-direction: column;
}
.dialog--sm { max-width: 380px; }
.dialog--lg { max-width: 620px; }
.dialog-header { padding: 18px 20px 12px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.dialog-header h3 { font-size: 16px; }
.dialog-header p { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
.dialog-close { background: none; border: none; color: var(--text-faint); cursor: pointer; padding: 4px; }
.dialog-close:hover { color: var(--text); }
.dialog-body { padding: 18px 20px; overflow-y: auto; }
.dialog-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Toast ---------- */
.toast-stack { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--primary); color: var(--primary-foreground); padding: 10px 16px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  box-shadow: var(--shadow-lg); animation: toast-in 0.18s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Calendar ---------- */
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-month-label { font-family: var(--font-serif); font-size: 14.5px; font-weight: 600; }
.cal-nav-btn { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--border-strong); background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); }
.cal-nav-btn:hover { background: var(--surface-2); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-faint); text-align: center; padding-bottom: 4px; }
.cal-cell { min-height: 64px; border: 1px solid var(--border); border-radius: 8px; padding: 5px; background: var(--surface-2); }
.cal-cell--empty { background: transparent; border-color: transparent; }
.cal-cell--today { border-color: var(--text); background: var(--surface); }
.cal-daynum { font-size: 11px; color: var(--text-faint); margin-bottom: 3px; }
.cal-cell--today .cal-daynum { color: var(--text); font-weight: 700; }
.cal-chips { display: flex; flex-direction: column; gap: 2px; }
.cal-chip { font-size: 9.5px; padding: 2px 5px; border-radius: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.cal-chip--start { background: var(--info-bg); color: var(--info-text); }
.cal-chip--delivery { background: var(--warning-bg); color: var(--warning-text); }
.cal-legend { display: flex; gap: 16px; margin-top: 12px; font-size: 11.5px; color: var(--text-muted); }
.cal-legend-item { display: flex; align-items: center; gap: 6px; }
.cal-legend-dot { width: 8px; height: 8px; border-radius: 2px; }

/* ---------- Charts ---------- */
.chart-svg { width: 100%; height: auto; overflow: visible; }
.chart-bar { fill: var(--text); }
.chart-bar--secondary { fill: var(--border-strong); }
.chart-bar--h { fill: var(--text); }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-axis-label, .chart-row-label, .chart-value-label { fill: var(--text-faint); font-size: 9.5px; font-family: var(--font-sans); }
.chart-value-label { fill: var(--text-muted); font-weight: 600; }
.chart-donut-seg.d-waiting { stroke: var(--warning-text); }
.chart-donut-seg.d-onboarded { stroke: var(--info-text); }
.chart-donut-seg.d-progress { stroke: var(--accent-text); }
.chart-donut-seg.d-delivered { stroke: var(--success-text); }
.chart-donut-seg.d-updates { stroke: var(--danger-text); }
.chart-legend { display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; }
.chart-legend-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.chart-legend-key { display: flex; align-items: center; gap: 8px; color: var(--text-muted); }
.chart-legend-swatch { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }

.donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }

/* ---------- Integration chips ---------- */
.integration-list { display: flex; flex-direction: column; gap: 10px; }
.integration-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 13px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.integration-name { font-size: 13px; font-weight: 500; }
.integration-status { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; }
.integration-status--on { color: var(--success-text); }
.integration-status--off { color: var(--text-faint); }

/* ---------- Misc ---------- */
.divider { height: 1px; background: var(--border); border: none; margin: 4px 0; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state svg { width: 34px; height: 34px; color: var(--text-faint); margin-bottom: 10px; }
.icon-btn { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; border: 1px solid transparent; background: none; cursor: pointer; color: var(--text-faint); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 15px; height: 15px; }
.timeline-bar { position: relative; height: 6px; background: var(--surface-3); border-radius: 999px; margin: 20px 0 8px; }
.timeline-fill { position: absolute; left: 0; top: 0; height: 100%; background: var(--primary); border-radius: 999px; }
.timeline-marker { position: absolute; top: -5px; width: 2px; height: 16px; background: var(--text); }
.timeline-marker::after { content: 'Today'; position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--text-faint); white-space: nowrap; }
.timeline-labels { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-muted); }
.pace-note { font-size: 12px; color: var(--text-muted); margin-top: 8px; }
.link-btn { background: none; border: none; padding: 0; color: var(--text); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; font-size: inherit; }
.kv-row { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.kv-row:last-child { border-bottom: none; }
.kv-row dt { color: var(--text-muted); }
.kv-row dd { margin: 0; font-weight: 600; text-align: right; }
