/* =========================================================
   BRADATA NÚCLEO — Design System
   ========================================================= */

:root {
  /* Surfaces */
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #fbfbfc;
  --surface-hover: #f6f7f9;
  --surface-active: #eef0f3;

  /* Text */
  --text: #0a0e1a;
  --text-2: #4a5568;
  --text-3: #8b94a3;
  --text-4: #b0b7c1;

  /* Borders */
  --border: #e4e7ec;
  --border-strong: #d4d8df;
  --border-subtle: #eef0f3;

  /* Brand */
  --brand: #2563eb;
  --brand-hover: #1d4ed8;
  --brand-soft: #eff4ff;
  --brand-soft-2: #dbe7ff;
  --brand-ink: #0f172a;

  /* Semantic */
  --success: #059669;
  --success-soft: #ecfdf5;
  --warning: #b45309;
  --warning-soft: #fef3c7;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --info: #0369a1;
  --info-soft: #e0f2fe;
  --violet: #6d28d9;
  --violet-soft: #f3eeff;

  /* Shadow */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 8px -2px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 24px -6px rgba(15, 23, 42, 0.10), 0 4px 8px -2px rgba(15, 23, 42, 0.06);
  --shadow-xl: 0 24px 48px -12px rgba(15, 23, 42, 0.18);

  /* Radius */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 10px;
  --r-xl: 14px;
  --r-2xl: 18px;

  /* Type */
  --font-sans: "Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "Geist Mono", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

/* =========================================================
   DARK THEME
   ========================================================= */
:root[data-theme="dark"] {
  --bg: #0a0c12;
  --surface: #14171f;
  --surface-2: #1a1e28;
  --surface-hover: #1f232e;
  --surface-active: #262b37;

  --text: #f1f3f7;
  --text-2: #b0b7c1;
  --text-3: #7a838f;
  --text-4: #565d68;

  --border: #242a36;
  --border-strong: #2f3543;
  --border-subtle: #1c212b;

  --brand: #4d8eff;
  --brand-hover: #6ba0ff;
  --brand-soft: rgba(77, 142, 255, 0.14);
  --brand-soft-2: rgba(77, 142, 255, 0.24);
  --brand-ink: #4d8eff;

  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.14);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.14);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.14);
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, 0.14);
  --violet: #a78bfa;
  --violet-soft: rgba(167, 139, 250, 0.14);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.30);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.30), 0 1px 3px rgba(0, 0, 0, 0.20);
  --shadow-md: 0 4px 8px -2px rgba(0, 0, 0, 0.40), 0 2px 4px -2px rgba(0, 0, 0, 0.30);
  --shadow-lg: 0 12px 24px -6px rgba(0, 0, 0, 0.45), 0 4px 8px -2px rgba(0, 0, 0, 0.30);
  --shadow-xl: 0 24px 48px -12px rgba(0, 0, 0, 0.60);
}

/* In dark, phase-bg-* tones need to be more subtle */
:root[data-theme="dark"] .phase-bg-lead       { background: rgba(148,163,184,0.12); }
:root[data-theme="dark"] .phase-bg-proposta   { background: rgba(77,142,255,0.14); }
:root[data-theme="dark"] .phase-bg-validacao  { background: rgba(167,139,250,0.14); }
:root[data-theme="dark"] .phase-bg-aguardando { background: rgba(251,191,36,0.14); }
:root[data-theme="dark"] .phase-bg-juridico   { background: rgba(244,114,182,0.14); }
:root[data-theme="dark"] .phase-bg-assinado   { background: rgba(52,211,153,0.14); }
:root[data-theme="dark"] .phase-bg-execucao   { background: rgba(34,211,238,0.14); }
:root[data-theme="dark"] .phase-bg-suporte    { background: rgba(148,163,184,0.12); }
:root[data-theme="dark"] .phase-bg-aditivo    { background: rgba(251,191,36,0.14); }
:root[data-theme="dark"] .phase-bg-perdido    { background: rgba(248,113,113,0.14); }

:root[data-theme="dark"] .phase-lead       { color: #94a3b8; }
:root[data-theme="dark"] .phase-proposta   { color: #4d8eff; }
:root[data-theme="dark"] .phase-validacao  { color: #a78bfa; }
:root[data-theme="dark"] .phase-aguardando { color: #fbbf24; }
:root[data-theme="dark"] .phase-juridico   { color: #f472b6; }
:root[data-theme="dark"] .phase-assinado   { color: #34d399; }
:root[data-theme="dark"] .phase-execucao   { color: #22d3ee; }
:root[data-theme="dark"] .phase-suporte    { color: #94a3b8; }
:root[data-theme="dark"] .phase-aditivo    { color: #fbbf24; }
:root[data-theme="dark"] .phase-perdido    { color: #f87171; }

/* Brand-mark stays vivid in dark */
:root[data-theme="dark"] .brand-mark {
  background: linear-gradient(135deg, #1a1f2c 0%, #2a3142 60%, #4d8eff 130%);
}

/* Buttons */
:root[data-theme="dark"] .btn.primary {
  background: #f1f3f7;
  border-color: #f1f3f7;
  color: #0a0c12;
}
:root[data-theme="dark"] .btn.primary:hover { background: #ffffff; }
:root[data-theme="dark"] .btn.brand { color: #ffffff; }

/* Calendar event tones — slight darken */
:root[data-theme="dark"] .cal-event           { background: rgba(77,142,255,0.18); color: #93b6ff; }
:root[data-theme="dark"] .cal-event.kickoff   { background: rgba(56,189,248,0.18); color: #7dd3fc; border-color: #38bdf8; }
:root[data-theme="dark"] .cal-event.reuniao   { background: rgba(167,139,250,0.18); color: #c4b5fd; border-color: #a78bfa; }
:root[data-theme="dark"] .cal-event.marco     { background: rgba(52,211,153,0.18); color: #6ee7b7; border-color: #34d399; }
:root[data-theme="dark"] .cal-event.financeiro{ background: rgba(251,191,36,0.18); color: #fcd34d; border-color: #fbbf24; }
:root[data-theme="dark"] .cal-event.contrato  { background: rgba(248,113,113,0.18); color: #fca5a5; border-color: #f87171; }
:root[data-theme="dark"] .cal-event.aprovacao { background: rgba(244,114,182,0.18); color: #f9a8d4; border-color: #f472b6; }
:root[data-theme="dark"] .cal-event.interno   { background: rgba(148,163,184,0.18); color: #cbd5e1; border-color: #94a3b8; }
:root[data-theme="dark"] .cal-event.assinatura{ background: rgba(251,146,60,0.18); color: #fdba74; border-color: #fb923c; }

/* PDF page always stays light (it's a document) */
.pdf-page { color-scheme: light; }

/* In dark, scrim adapts */
:root[data-theme="dark"] .drawer-shade { background: rgba(0, 0, 0, 0.65); }
:root[data-theme="dark"] .sidebar-scrim { background: rgba(0, 0, 0, 0.65); }
:root[data-theme="dark"] .cmdk-overlay { background: rgba(0, 0, 0, 0.65); }

/* Theme transition niceties */
html, body, .sidebar, .topbar, .card, .stat, .btn, .input, .select,
.table, .kanban-card, .badge, .pdf-page {
  transition: background-color .15s, border-color .15s, color .15s;
}

* { box-sizing: border-box; }

html, body, #app {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

/* =========================================================
   APP SHELL
   ========================================================= */
.app-shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  height: 100vh;
  background: var(--bg);
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-brand {
  padding: 20px 18px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #2563eb 130%);
  display: grid; place-items: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.02em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.10), 0 1px 2px rgba(0,0,0,0.18);
}
.brand-name {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand-name .light { color: var(--text-3); font-weight: 400; }

.sidebar-search {
  padding: 4px 12px 8px;
}
.sidebar-search input {
  width: 100%;
  height: 32px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: 0 10px 0 30px;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color .15s, background .15s;
}
.sidebar-search { position: relative; }
.sidebar-search .kbd {
  position: absolute; right: 18px; top: 9px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 4px;
  pointer-events: none;
}
.sidebar-search .ic {
  position: absolute; left: 22px; top: 8px; color: var(--text-3);
}
.sidebar-search input:focus { border-color: var(--brand); background: white; }

.sidebar-modules {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 4px 6px 8px;
  overflow-y: auto;
}
.sidebar-module {
  margin-bottom: 2px;
}
.module-header {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 30px;
  padding: 0 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  border-radius: var(--r-sm);
  text-align: left;
}
.module-header:hover { background: var(--surface-hover); }
.module-header > span { flex: 1; }
.module-header svg { flex-shrink: 0; }
.module-header svg:first-child { color: var(--text-3); }
.module-header svg:last-child { color: var(--text-4); }
.sidebar-module.has-current .module-header svg:first-child { color: var(--brand); }
.module-items {
  display: flex;
  flex-direction: column;
  padding: 2px 0 4px 12px;
  gap: 1px;
}
.nav-item.nav-sub {
  height: 28px;
  padding: 0 10px 0 12px;
  font-size: 12.5px;
  font-weight: 500;
}
.nav-item.nav-sub > span:not(.count) { flex: 1; }

.sidebar-section {
  padding: 14px 12px 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}

.sidebar-nav {
  display: flex; flex-direction: column;
  padding: 0 8px;
  gap: 1px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  border: none;
  background: transparent;
  text-align: left;
  width: 100%;
  transition: background .12s;
}
.nav-item:hover { background: var(--surface-hover); color: var(--text); }
.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand);
}
.nav-item.active svg { color: var(--brand); }
.nav-item svg { color: var(--text-3); flex-shrink: 0; }
.nav-item .count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-3);
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 500;
}
.nav-item.active .count { background: white; color: var(--brand); }

.sidebar-footer {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 28px; height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: white;
  display: grid; place-items: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}
.avatar.sm { width: 22px; height: 22px; font-size: 9px; }
.avatar.lg { width: 36px; height: 36px; font-size: 13px; }
.avatar.xl { width: 44px; height: 44px; font-size: 15px; }
.user-meta { line-height: 1.2; min-width: 0; flex: 1; }
.user-meta .name { font-size: 12.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta .role { font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =========================================================
   MAIN COLUMN
   ========================================================= */
.main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }

.topbar {
  height: 52px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
}
.crumbs {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px;
  color: var(--text-3);
}
.crumbs .now { color: var(--text); font-weight: 500; }
.crumbs .sep { color: var(--text-4); }

.topbar-actions {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
}

.content {
  flex: 1;
  overflow-y: auto;
  background: var(--bg);
}

.page {
  padding: 24px 28px 80px;
  max-width: 1480px;
  margin: 0 auto;
}
.page.wide { max-width: none; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}
.page-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 4px;
}
.page-subtitle {
  font-size: 13.5px;
  color: var(--text-3);
  margin: 0;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: background .12s, border-color .12s, box-shadow .12s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-hover); }
.btn.primary {
  background: var(--brand-ink);
  border-color: var(--brand-ink);
  color: white;
}
.btn.primary:hover { background: #1c2333; }
.btn.brand {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
}
.btn.brand:hover { background: var(--brand-hover); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-hover); color: var(--text); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.sm { height: 28px; padding: 0 9px; font-size: 12.5px; }
.btn.xs { height: 24px; padding: 0 7px; font-size: 12px; border-radius: var(--r-sm); }
.btn.lg { height: 38px; padding: 0 16px; font-size: 14px; }
.btn.icon { padding: 0; width: 32px; }
.btn.icon.sm { width: 28px; }

.icon-btn {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: var(--r-md);
  color: var(--text-3);
  background: transparent;
  border: none;
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }

/* =========================================================
   CARD
   ========================================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xs);
}
.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
}
.card-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.card-subtitle {
  font-size: 12.5px;
  color: var(--text-3);
  font-weight: 400;
}
.card-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-body { padding: 18px; }
.card-body.tight { padding: 12px 18px; }
.card-body.flush { padding: 0; }

/* =========================================================
   BADGE / PILL / TAG
   ========================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  background: var(--surface-active);
  color: var(--text-2);
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge.dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 999px;
  background: currentColor;
  display: inline-block;
}
.badge.blue { background: var(--brand-soft); color: var(--brand); }
.badge.green { background: var(--success-soft); color: var(--success); }
.badge.amber { background: var(--warning-soft); color: var(--warning); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.violet { background: var(--violet-soft); color: var(--violet); }
.badge.slate { background: #f1f5f9; color: #475569; }
.badge.outline { background: white; border-color: var(--border); color: var(--text-2); }

/* =========================================================
   TABLE
   ========================================================= */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th {
  text-align: left;
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr.row-clickable { cursor: pointer; }
.table tr.row-clickable:hover td { background: var(--surface-2); }
.table td .muted { color: var(--text-3); font-size: 12.5px; }

/* =========================================================
   INPUT
   ========================================================= */
.input, .select, .textarea {
  width: 100%;
  height: 34px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 0 11px;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.input.sm { height: 28px; padding: 0 8px; font-size: 12.5px; }
.input.lg { height: 40px; padding: 0 14px; font-size: 14px; }
.input.mono { font-family: var(--font-mono); }
.textarea { height: auto; padding: 9px 11px; resize: vertical; min-height: 70px; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field label, .label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
}
.field .hint {
  font-size: 11.5px;
  color: var(--text-3);
}

.input-group {
  display: flex; align-items: stretch;
}
.input-group .input { border-radius: 0; border-right: none; }
.input-group .input:first-child { border-top-left-radius: var(--r-md); border-bottom-left-radius: var(--r-md); }
.input-group .input:last-child { border-radius: 0 var(--r-md) var(--r-md) 0; border-right: 1px solid var(--border); }
.input-group .addon {
  display: grid; place-items: center;
  padding: 0 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-3);
}
.input-group .addon:first-child { border-radius: var(--r-md) 0 0 var(--r-md); border-right: none; }
.input-group .addon:last-child { border-radius: 0 var(--r-md) var(--r-md) 0; border-left: none; }

/* Toggle */
.toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: 2px;
  gap: 0;
}
.toggle button {
  height: 26px;
  padding: 0 10px;
  border: none;
  background: transparent;
  font-size: 12.5px;
  color: var(--text-2);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.toggle button.active {
  background: white;
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

/* Switch */
.switch {
  width: 32px; height: 18px;
  border-radius: 999px;
  background: var(--border-strong);
  position: relative;
  cursor: pointer;
  transition: background .15s;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
.switch.on { background: var(--brand); }
.switch::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  border-radius: 999px;
  background: white;
  transition: transform .15s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.18);
}
.switch.on::after { transform: translateX(14px); }

/* Slider */
.slider {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 999px;
  outline: none;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  background: white;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .1s;
}
.slider::-webkit-slider-thumb:hover { transform: scale(1.1); }
.slider::-moz-range-thumb {
  width: 16px; height: 16px;
  background: white;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

/* =========================================================
   STAT / KPI
   ========================================================= */
.stat {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat-label {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
  letter-spacing: 0.01em;
}
.stat-value {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text);
  font-feature-settings: "tnum";
}
.stat-value .currency { font-size: 14px; color: var(--text-3); margin-right: 2px; font-weight: 500; }
.stat-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-3);
}
.delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 11.5px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 999px;
}
.delta.up { color: var(--success); background: var(--success-soft); }
.delta.down { color: var(--danger); background: var(--danger-soft); }
.delta.flat { color: var(--text-3); background: var(--surface-active); }

/* =========================================================
   KANBAN
   ========================================================= */
.kanban {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x proximity;
  /* Preenche o restante da viewport abaixo do header da página
     (~ topbar 48 + page-header 80 + padding) */
  min-height: calc(100vh - 220px);
  align-items: stretch;
}
.kanban-col {
  flex: 0 0 320px;
  background: transparent;
  display: flex; flex-direction: column;
  scroll-snap-align: start;
  min-height: 0;   /* permite o body crescer dentro do flex */
}
.kanban-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 10px;
  flex-shrink: 0;
}
.kanban-col-header .label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
}
.kanban-col-header .count {
  font-size: 11.5px;
  color: var(--text-3);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 999px;
}
.kanban-col-header .dot {
  width: 7px; height: 7px; border-radius: 999px;
  background: var(--text-3);
}
.kanban-col-body {
  display: flex; flex-direction: column; gap: 8px;
  flex: 1 1 auto;
  min-height: 220px;
  padding: 4px 2px;
  overflow-y: auto;            /* scroll vertical dentro da coluna */
}
.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
  cursor: grab;
  transition: box-shadow .15s, transform .15s, border-color .15s;
  box-shadow: var(--shadow-xs);
}
.kanban-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.kanban-card.dragging { opacity: 0.4; }
.kanban-card .kc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kanban-card .kc-id { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }
.kanban-card .kc-title { font-size: 13px; font-weight: 600; color: var(--text); letter-spacing: -0.005em; line-height: 1.35; }
.kanban-card .kc-client { font-size: 12px; color: var(--text-3); }
.kanban-card .kc-value { font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; color: var(--text); }
.kanban-card .kc-meta { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 11.5px; flex-wrap: wrap; }
.kanban-card .kc-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 6px; border-top: 1px dashed var(--border-subtle); }

/* =========================================================
   STATUS DOTS / PHASES
   ========================================================= */
.phase-lead { color: #64748b; }
.phase-proposta { color: #2563eb; }
.phase-validacao { color: #7c3aed; }
.phase-aguardando { color: #d97706; }
.phase-juridico { color: #be185d; }
.phase-assinado { color: #059669; }
.phase-execucao { color: #0891b2; }
.phase-suporte { color: #475569; }
.phase-aditivo { color: #b45309; }
.phase-perdido { color: #b91c1c; }

.phase-bg-lead { background: #f1f5f9; }
.phase-bg-proposta { background: #eff4ff; }
.phase-bg-validacao { background: #f5f1ff; }
.phase-bg-aguardando { background: #fff7ed; }
.phase-bg-juridico { background: #fdf2f8; }
.phase-bg-assinado { background: #ecfdf5; }
.phase-bg-execucao { background: #ecfeff; }
.phase-bg-suporte { background: #f1f5f9; }
.phase-bg-aditivo { background: #fef3c7; }
.phase-bg-perdido { background: #fee2e2; }

/* =========================================================
   MISC
   ========================================================= */
.divider { height: 1px; background: var(--border-subtle); margin: 12px 0; }
.vdivider { width: 1px; background: var(--border-subtle); align-self: stretch; }

.flex { display: flex; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 8px; }
.spacer { flex: 1; }
.tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-3); }
.muted-2 { color: var(--text-4); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.bold { font-weight: 600; }
.semibold { font-weight: 500; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.scrollbox { overflow-y: auto; }
.scrollbox::-webkit-scrollbar { width: 8px; height: 8px; }
.scrollbox::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }

/* Stepper (workflow) */
.workflow-stepper {
  display: flex;
  align-items: flex-start;
  gap: 0;
  overflow-x: auto;
  padding: 4px 0;
}
.workflow-step {
  flex: 1;
  min-width: 110px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
  padding-right: 8px;
}
.workflow-step .ws-dot {
  width: 22px; height: 22px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--surface);
  display: grid; place-items: center;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-mono);
  position: relative;
  z-index: 1;
}
.workflow-step.done .ws-dot { border-color: var(--success); background: var(--success); color: white; }
.workflow-step.current .ws-dot { border-color: var(--brand); background: white; color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.workflow-step .ws-line {
  position: absolute;
  top: 11px; left: 22px; right: 0;
  height: 2px;
  background: var(--border);
}
.workflow-step.done .ws-line { background: var(--success); }
.workflow-step:last-child .ws-line { display: none; }
.workflow-step .ws-label { font-size: 12px; font-weight: 500; margin-top: 8px; color: var(--text); }
.workflow-step .ws-sub { font-size: 11px; color: var(--text-3); }
.workflow-step:not(.done):not(.current) .ws-label { color: var(--text-3); }

/* PDF preview */
.pdf-page {
  background: white;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 44px 48px;
  font-family: "Times New Roman", "Georgia", serif;
  color: #1a1a1a;
  font-size: 11.5px;
  line-height: 1.55;
  position: relative;
  min-height: 700px;
}
.pdf-page h1 { font-size: 18px; margin: 0 0 4px; font-weight: 700; letter-spacing: -0.005em; color: #0a0a0a; font-family: "Times New Roman", serif; }
.pdf-page h2 { font-size: 13px; margin: 24px 0 10px; font-weight: 700; letter-spacing: -0.005em; color: #0a0a0a; padding-bottom: 4px; border-bottom: 1px solid #d4d4d4; }
.pdf-page h3 { font-size: 12px; margin: 16px 0 6px; font-weight: 700; }
.pdf-page p { margin: 0 0 8px; }
.pdf-page .pdf-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 18px;
  border-bottom: 2px solid #0a0e1a;
  margin-bottom: 20px;
}
.pdf-page .pdf-meta { font-size: 10.5px; color: #555; text-align: right; }
.pdf-page table { width: 100%; border-collapse: collapse; margin: 10px 0 14px; font-size: 11px; }
.pdf-page table th { background: #0a0e1a; color: white; padding: 7px 10px; text-align: left; font-weight: 600; font-size: 10.5px; font-family: var(--font-sans); letter-spacing: 0.01em; }
.pdf-page table td { padding: 7px 10px; border-bottom: 1px solid #e4e4e4; font-family: var(--font-sans); font-size: 11px; }
.pdf-page table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.pdf-page .total-box {
  background: #f4f4f5;
  border-left: 3px solid #0a0e1a;
  padding: 14px 18px;
  margin: 16px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-sans);
}
.pdf-page .total-box .lbl { font-size: 11px; color: #555; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.pdf-page .total-box .val { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; color: #0a0a0a; }
.pdf-page .pdf-footer {
  position: absolute;
  bottom: 24px; left: 48px; right: 48px;
  border-top: 1px solid #e4e4e4;
  padding-top: 10px;
  font-size: 9.5px;
  color: #888;
  text-align: center;
  font-family: var(--font-sans);
}
.pdf-page ul { margin: 4px 0 10px 0; padding-left: 18px; }
.pdf-page ul li { margin-bottom: 3px; }

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  gap: 4px;
}
.tab {
  height: 38px;
  padding: 0 14px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--brand-ink); }
.tab .count { font-size: 11px; background: var(--surface-active); color: var(--text-3); padding: 1px 6px; border-radius: 999px; }
.tab.active .count { background: var(--brand-soft); color: var(--brand); }

/* Inline drawer / panel */
.drawer-shade {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 30;
  backdrop-filter: blur(2px);
}
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 580px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 31;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  animation: drawerIn .2s ease;
}
@keyframes drawerIn { from { transform: translateX(20px); opacity: 0;} to { transform: none; opacity: 1; }}
.drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }
.drawer-footer { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* Bars / spark */
.bar-track {
  height: 6px;
  background: var(--surface-active);
  border-radius: 999px;
  overflow: hidden;
  width: 100%;
}
.bar-fill { height: 100%; background: var(--brand); border-radius: inherit; transition: width .3s; }
.bar-fill.green { background: var(--success); }
.bar-fill.amber { background: var(--warning); }
.bar-fill.red { background: var(--danger); }

/* Empty state */
.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  border: 1px dashed var(--border);
  border-radius: var(--r-lg);
  background: var(--surface-2);
}

/* Sticky proposal sidebar */
.sticky-summary {
  position: sticky;
  top: 16px;
}

/* Highlight effect for recalculated values */
@keyframes valueFlash {
  0% { background: var(--brand-soft); }
  100% { background: transparent; }
}
.flash { animation: valueFlash .8s ease; }

/* =========================================================
   FLOW CALLOUT — Next-step navigation between modules
   ========================================================= */
.flow-callout {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--brand-soft) 0%, #f6f9ff 100%);
  border: 1px solid var(--brand-soft-2);
  border-radius: var(--r-lg);
  margin-bottom: 16px;
}
.flow-callout .ic {
  width: 32px; height: 32px;
  border-radius: 999px;
  background: white;
  border: 1px solid var(--brand-soft-2);
  display: grid; place-items: center;
  color: var(--brand);
  flex-shrink: 0;
}
.flow-callout .copy { flex: 1; min-width: 0; }
.flow-callout .copy .lbl { font-size: 11px; font-weight: 600; color: var(--brand); letter-spacing: 0.04em; text-transform: uppercase; }
.flow-callout .copy .txt { font-size: 13px; color: var(--text); font-weight: 500; }

/* =========================================================
   MOBILE BURGER + OVERLAY
   ========================================================= */
.mobile-burger {
  display: none;
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r-md);
  align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text);
}
.sidebar-scrim {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.45);
  z-index: 99;
  backdrop-filter: blur(2px);
}

/* =========================================================
   RESPONSIVE — Tablet (≤ 1024px) and Mobile (≤ 700px)
   ========================================================= */

/* TABLET */
@media (max-width: 1024px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    top: 0; bottom: 0;
    left: -280px;
    width: 264px;
    z-index: 100;
    box-shadow: var(--shadow-xl);
  }
  body.app-ready .sidebar {
    transition: left .22s cubic-bezier(.4, 0, .2, 1);
  }
  .sidebar.open {
    left: 0;
  }
  .sidebar-scrim.show { display: block; }
  .mobile-burger { display: inline-flex; }

  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }

  .page { padding: 18px 18px 80px; }
  .topbar { padding: 0 14px; gap: 10px; }
  .crumbs { font-size: 12.5px; }
}

/* MOBILE */
@media (max-width: 700px) {
  html, body { font-size: 13.5px; }

  /* App shell */
  .topbar { height: 48px; padding: 0 12px; gap: 8px; }
  .crumbs { font-size: 12px; max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .crumbs .now { display: inline-block; max-width: 50vw; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
  .topbar-actions > .btn:not(.primary):not(.brand) { display: none; }
  .topbar-actions { gap: 4px; }

  .page { padding: 14px 12px 80px; }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
  }
  .page-header > .row { width: 100%; flex-wrap: wrap; }
  .page-title { font-size: 19px; }
  .page-subtitle { font-size: 12.5px; }

  /* Grids collapse to single column */
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; gap: 12px; }

  /* Force any two-col custom grid */
  [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  /* Card paddings */
  .card-header { padding: 12px 14px; flex-wrap: wrap; gap: 8px; }
  .card-header .card-actions { margin-left: 0; flex-wrap: wrap; }
  .card-body { padding: 14px; }
  .card-body.tight { padding: 10px 14px; }
  .card-title { font-size: 13.5px; }
  .card-subtitle { font-size: 12px; }

  /* Stats — compact */
  .stat { padding: 14px 16px; gap: 4px; }
  .stat-value { font-size: 22px; }
  .stat-label { font-size: 11.5px; }
  .stat-meta { font-size: 11px; }

  /* Tables — horizontal scroll wrapper inside cards */
  .card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .card > .table, .card-body > .table { min-width: 640px; }
  .table th { padding: 8px 10px; font-size: 10.5px; }
  .table td { padding: 10px; font-size: 12.5px; }

  /* Toggle / pill controls scroll horizontally */
  .toggle {
    overflow-x: auto;
    flex-wrap: nowrap;
    max-width: 100%;
    scrollbar-width: none;
  }
  .toggle::-webkit-scrollbar { display: none; }
  .toggle button { flex-shrink: 0; }

  .tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex-shrink: 0; }

  /* Buttons hug content */
  .btn { white-space: nowrap; }

  /* Kanban — scroll snaps */
  .kanban-col { flex: 0 0 78vw; }

  /* Workflow stepper turns vertical */
  .workflow-stepper {
    flex-direction: column;
    gap: 0;
    align-items: stretch;
  }
  .workflow-step {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    min-width: 0;
    width: 100%;
    padding: 8px 0;
    min-height: 40px;
  }
  .workflow-step .ws-line {
    top: 32px;
    left: 11px;
    right: auto;
    bottom: -2px;
    width: 2px;
    height: auto;
  }
  .workflow-step:last-child .ws-line { display: none; }
  .workflow-step .ws-label { margin-top: 0; }
  .workflow-step .ws-sub { display: none; }

  /* PDF preview shrinks */
  .pdf-page {
    padding: 24px 22px;
    font-size: 10.5px;
    min-height: 480px;
  }
  .pdf-page h1 { font-size: 15px; }
  .pdf-page h2 { font-size: 11.5px; }
  .pdf-page .pdf-header { padding-bottom: 12px; margin-bottom: 14px; }
  .pdf-page table th, .pdf-page table td { padding: 5px 6px; font-size: 10px; }
  .pdf-page .total-box { padding: 10px 12px; }
  .pdf-page .total-box .val { font-size: 17px; }
  .pdf-page .pdf-footer { position: static; padding-top: 14px; margin-top: 18px; }

  /* Drawer becomes a sheet */
  .drawer { width: 100%; max-width: 100%; }
  .drawer-footer { flex-wrap: wrap; }
  .drawer-footer .spacer { display: none; }
  .drawer-footer .btn { flex: 1 1 auto; min-width: 0; justify-content: center; }

  /* Input-group stacks on mobile so button doesn't overflow */
  .input-group { flex-direction: column; }
  .input-group .input,
  .input-group .input:first-child,
  .input-group .input:last-child {
    border-radius: var(--r-md) !important;
    border-right: 1px solid var(--border) !important;
    width: 100%;
  }
  .input-group .btn { width: 100%; border-radius: var(--r-md) !important; }

  /* Sticky panels release */
  .sticky-summary { position: static; }

  /* Sidebar footer */
  .sidebar-footer { padding: 10px 12px; }

  /* Search wider but no kbd */
  .sidebar-search .kbd { display: none; }

  /* Table: hide less-important columns on small screens */
  .table .col-hide-mobile { display: none; }
}

/* SMALL MOBILE */
@media (max-width: 420px) {
  .page-title { font-size: 17px; }
  .stat-value { font-size: 19px; }
  .stat-value .currency { font-size: 12px; }
  .btn { font-size: 12.5px; height: 30px; padding: 0 10px; }
  .topbar { gap: 6px; padding: 0 10px; }
  .topbar .avatar { display: none; }
}

/* Touch device niceties */
@media (hover: none) {
  .kanban-card { cursor: pointer; }
}

/* Print styles for PDF export of proposal */
@media print {
  .sidebar, .topbar, .tabs, .card-header, .page-header { display: none !important; }
  .page { padding: 0 !important; }
  .pdf-page { box-shadow: none !important; border: none !important; }
}

/* Builder split — form + PDF preview */
.builder-split {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 16px;
  align-items: flex-start;
}
@media (max-width: 1180px) {
  .builder-split { grid-template-columns: 1fr; }
}

/* Scope tile group — wrap responsively */
.scope-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.scope-tile {
  flex: 1 1 110px;
  min-width: 110px;
  padding: 10px 8px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
}
.scope-tile.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

/* =========================================================
   COMMAND PALETTE
   ========================================================= */
.cmdk-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 200;
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 14vh;
}
.cmdk {
  width: 580px;
  max-width: 92vw;
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 60vh;
}
.cmdk-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
}
.cmdk-input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  color: var(--text);
  background: transparent;
}
.cmdk-list {
  overflow-y: auto;
  padding: 6px;
}
.cmdk-section {
  padding: 8px 12px 4px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}
.cmdk-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  border: none;
  background: transparent;
  text-align: left;
  width: 100%;
}
.cmdk-item:hover, .cmdk-item.active { background: var(--brand-soft); color: var(--brand); }
.cmdk-item .meta { margin-left: auto; font-size: 11px; color: var(--text-3); font-family: var(--font-mono); }

/* =========================================================
   NOTIFICATIONS DROPDOWN
   ========================================================= */
.notif-pop {
  position: fixed;
  top: 50px;
  right: 18px;
  width: 380px;
  max-width: calc(100vw - 24px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  z-index: 150;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}
.notif-head {
  display: flex; align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.notif-list { overflow-y: auto; flex: 1; }
.notif-item {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
  align-items: flex-start;
}
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: linear-gradient(90deg, var(--brand-soft) 0%, transparent 16px); }
.notif-item .ic-wrap {
  width: 30px; height: 30px;
  border-radius: 999px;
  background: var(--surface-2);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.notif-item .body { flex: 1; min-width: 0; }
.notif-item .title { font-size: 13px; font-weight: 500; line-height: 1.35; }
.notif-item .desc { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.notif-item .when { font-size: 11px; color: var(--text-4); margin-top: 3px; }

/* =========================================================
   CALENDAR
   ========================================================= */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface);
}
.cal-head {
  background: var(--surface-2);
  padding: 8px 10px;
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cal-day {
  min-height: 110px;
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 6px 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: var(--surface);
  position: relative;
}
.cal-day.other { background: var(--surface-2); color: var(--text-4); }
.cal-day.today { background: var(--brand-soft); }
.cal-day .num {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
}
.cal-day.today .num {
  color: var(--brand);
  font-weight: 700;
}
.cal-event {
  font-size: 10.5px;
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--brand-soft-2);
  color: var(--brand);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  border-left: 2px solid var(--brand);
  line-height: 1.3;
}
.cal-event.kickoff   { background: #e0f2fe; color: #0369a1; border-color: #0369a1; }
.cal-event.reuniao   { background: #f3eeff; color: #6d28d9; border-color: #6d28d9; }
.cal-event.marco     { background: #ecfdf5; color: #059669; border-color: #059669; }
.cal-event.financeiro{ background: #fef3c7; color: #b45309; border-color: #b45309; }
.cal-event.contrato  { background: #fee2e2; color: #b91c1c; border-color: #b91c1c; }
.cal-event.aprovacao { background: #fdf2f8; color: #be185d; border-color: #be185d; }
.cal-event.interno   { background: #f1f5f9; color: #475569; border-color: #475569; }
.cal-event.assinatura{ background: #fff7ed; color: #c2410c; border-color: #c2410c; }

/* =========================================================
   CAPACITY HEATMAP
   ========================================================= */
.cap-row {
  display: grid;
  grid-template-columns: 200px 80px 1fr;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  align-items: center;
}
.cap-bar {
  height: 22px;
  background: var(--surface-active);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
.cap-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: var(--brand);
  border-radius: 4px;
}
.cap-fill.green { background: var(--success); }
.cap-fill.amber { background: var(--warning); }
.cap-fill.red   { background: var(--danger); }

/* Skill rating dots */
.skill-dots {
  display: inline-flex;
  gap: 3px;
}
.skill-dots .d {
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--border);
}
.skill-dots .d.on {
  background: var(--brand);
}

/* Notification dot */
[data-mobile-only] { display: none !important; }
@media (max-width: 1024px) {
  [data-mobile-only] { display: inline-flex !important; }
}
.has-dot { position: relative; }
.has-dot::after {
  content: '';
  position: absolute;
  top: 5px; right: 5px;
  width: 7px; height: 7px;
  background: var(--danger);
  border-radius: 999px;
  border: 1.5px solid var(--surface);
}
