/* ── Utility ─────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Font stacks ─────────────────────────────────────────────────────────── */
/*
 * Inter — variable font carregada via Google Fonts no base.html.
 * Fallback robusto para uso offline: system-ui cobre macOS/iOS (SF Pro),
 * -apple-system garante Safari antigo, depois Segoe UI (Windows), sans-serif.
 *
 * Features OpenType activadas globalmente em Inter:
 *   cv05 — 'l' minúsculo com serifa inferior (distingue de '1' e 'I')
 *   cv08 — 'a' de dois andares (distingue de 'o' em CAS numbers, IDs)
 *   cv10 — '6' e '9' com haste
 *
 * Tabular nums (tnum) activados selectivamente abaixo onde há dados numéricos.
 */

:root {
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;

  --bg: #eef1f4;
  --surface: #ffffff;
  --surface-soft: #f7f9fb;
  --text: #17202a;
  --muted: #637083;
  --line: #d8dee7;
  --ink: #101820;
  --primary: #0b6f63;
  --primary-dark: #064d45;
  --accent: #b45309;
  --blue: #2457a6;
  --error-bg: #fee2e2;
  --error-text: #991b1b;
  --ok-bg: #dcfce7;
  --ok-text: #166534;
  --warn-bg: #fff7ed;
  --warn-text: #9a3412;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  /* cv05 = l com serifa, cv08 = a de dois andares — melhor legibilidade de IDs */
  font-feature-settings: "cv05" 1, "cv08" 1, "cv10" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--text);
  background:
    linear-gradient(180deg, #f8fafc 0, var(--bg) 310px),
    var(--bg);
}

/* ── Typography — refinamentos por contexto ──────────────────────────────── */

/*
 * HEADINGS: Inter 700-800, optical size grande → tracking ligeiramente negativo
 * para parecer mais compacto e moderno (padrão em interfaces SaaS).
 */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--ink);
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: .9rem;   font-weight: 700; }

/*
 * TABELAS — tabular nums para colunas de números alinharem na vertical.
 * lining-nums = números "de caixa alta" (sem ascendentes/descendentes).
 * Cabeçalhos em 600 para não competir com os dados.
 */
.data-table th {
  font-weight: 600;
  font-size: .78rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.data-table td {
  font-size: .875rem;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

/*
 * MÉTRICAS / NÚMEROS GRANDES — tabular + proporcional-lnum para os valores
 * do dashboard (30px+). Inter a este tamanho com 800 fica muito bom.
 */
.metric-card strong,
.qr-hero-value,
.qr-total-value,
.ws-stat-val {
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  letter-spacing: -0.02em;
}

/*
 * PREÇOS / VALORES FINANCEIROS — qualquer elemento com class price, amount,
 * ou os campos de resultado das cotações.
 */
.price, .amount, [class*="price"], [class*="amount"],
#rs_total, #rs_per_unit, #rs_margin, #rs_subtotal,
#rs_customs, #rs_transport {
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

/*
 * DATAS E HORAS — tabular nums para que "18:30" e "09:00" alinhem.
 */
.call-date, .call-duration,
[class*="date"], [class*="-dl"],
.ws-job-dl, .ws-todo-due, .ws-due-today, .ws-due-late,
time, .timestamp {
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

/*
 * BADGES / STATUS — Inter 600 uppercase fica mais limpo que 800 em tamanhos
 * muito pequenos (≤11px). Reduz o peso visual sem perder legibilidade.
 */
.badge, .status-badge, .nav-soon,
[class^="prio-"], [class^="status-"] {
  font-weight: 600;
  letter-spacing: .04em;
}

/*
 * LABELS / FORMULÁRIOS — Inter 500 para labels, 400 para inputs.
 * Inputs herdam font-family do body (Inter) mas o browser por defeito
 * não herda — forçar aqui.
 */
input, select, textarea, button {
  font-family: var(--font-sans);
  font-feature-settings: "cv05" 1, "cv08" 1;
}
label {
  font-weight: 500;
  font-size: .85rem;
}

/*
 * MONOSPACE — CAS numbers, IDs de produto, código, snippets.
 * IBM Plex Mono tem números de tabular width nativo.
 */
code, pre, kbd, samp,
.mono, .cas-cell,
[class*="cas"], [class*="-id"] {
  font-family: var(--font-mono);
  font-size: .875em;
}

/*
 * NAVEGAÇÃO LATERAL — Inter 500 para os links, 600 para labels de grupo.
 * Tracking ligeiramente positivo nos group labels (uppercase curto).
 */
.side-nav-link {
  font-weight: 500;
  font-size: .875rem;
}
.side-nav-label {
  font-weight: 600;
  font-size: .72rem;
  letter-spacing: .07em;
}

/*
 * HERO PANELS — headings em 800 com tracking negativo, eyebrow em 600.
 */
.hero-panel h1, .hero-panel h2 {
  font-weight: 800;
  letter-spacing: -0.025em;
}
.eyebrow {
  font-weight: 600;
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.container {
  width: min(1180px, 92%);
  margin: 0 auto;
}

/* ── Top bar ────────────────────────────────────────────────────────────── */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 300;
  display: flex;
  align-items: stretch;
  height: 54px;
  padding: 0;
  background: var(--surface, #fff);
  border-bottom: 1px solid rgba(216,222,231,0.85);
  box-shadow: 0 1px 8px rgba(16,24,32,0.06);
}

/* Cada bloco do header: flex, centrado verticalmente, separador à direita */
.top-bar > * {
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-right: 1px solid rgba(216,222,231,0.55);
  flex-shrink: 0;
}
.top-bar > *:last-child { border-right: none; }

/* ── Marca ── */
.top-bar-brand-group {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  border-right: 1px solid rgba(216,222,231,0.55);
  flex-shrink: 0;
}
.top-bar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  padding: 0;
  border: none !important;
}
.top-bar-brand img {
  width: 26px; height: 26px; border-radius: 6px; object-fit: contain;
}
.top-bar-brand strong {
  font-size: 14px; font-weight: 900;
  letter-spacing: -0.03em; color: var(--ink); white-space: nowrap;
}
.top-bar-version {
  font-size: 9px; font-weight: 600; letter-spacing: .03em;
  color: #64748b; background: rgba(100,116,139,0.1);
  border: 0.5px solid rgba(100,116,139,0.25); border-radius: 4px;
  padding: 2px 6px; white-space: nowrap;
  text-decoration: none; transition: background .12s, color .12s;
}
.top-bar-version:hover { background: rgba(11,111,99,0.1); color: #0b6f63; border-color: rgba(11,111,99,0.3); }

/* ── Centro: saudação + relógio ── */
.top-bar-center {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  gap: 16px;
  border-right: 1px solid rgba(216,222,231,0.55);
}
.top-bar-greeting {
  font-size: 13px; font-weight: 600; color: var(--ink);
  letter-spacing: -0.01em; white-space: nowrap;
}
.top-bar-center-right {
  display: flex; flex-direction: column; align-items: flex-end; gap: 1px;
}
.top-bar-clock-time {
  font-size: 16px; font-weight: 800;
  color: var(--ink); font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em; line-height: 1;
}
.top-bar-clock-date {
  font-size: 9px; font-weight: 600;
  color: var(--muted); white-space: nowrap; letter-spacing: .03em;
  text-transform: uppercase;
}

/* ── Fusos horários ── */
.top-bar-wc-list { gap: 4px; }
.top-bar-wc-pill {
  display: flex; align-items: center; gap: 4px;
  background: transparent;
  border: 0.5px solid rgba(216,222,231,0.7);
  border-radius: 6px; padding: 4px 8px;
  cursor: default; transition: background .12s, border-color .12s;
}
.top-bar-wc-pill:hover {
  background: var(--surface-soft, #f8fafc);
  border-color: rgba(216,222,231,1);
}
.top-bar-wc-pill > span:first-child { font-size: 13px; line-height: 1; }
.top-bar-wc-label {
  font-size: 9px; color: var(--muted); font-weight: 700;
  letter-spacing: .03em; text-transform: uppercase;
}
.top-bar-wc-t {
  font-size: 11.5px; font-weight: 800; color: var(--ink);
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}

/* ── Tema ── */
.top-bar .theme-switcher { gap: 2px; padding: 0 14px; }

/* ── Conta ── */
.top-bar-account { gap: 8px; padding: 0 16px; }
.top-bar-user {
  font-size: 12px; font-weight: 700;
  color: var(--ink); white-space: nowrap;
}

.top-bar-divider { display: none; }

/* ── App shell (abaixo do top-bar) ─────────────────────────────────────── */
.app-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 24px;
  width: min(1480px, 96%);
  margin: 0 auto;
  padding: 20px 0 44px;
  align-items: start;
}

.nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.12);
}

.nav-pill:hover .nav-dot,
.nav-pill.active .nav-dot {
  background: #fbbf24;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.22);
}

.admin-pill {
  border-color: rgba(36, 87, 166, 0.22);
}

.logout-pill {
  color: #7f1d1d;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 10px;
  background: #eef2f6;
  color: #475569;
  font-size: 12px;
  font-weight: 850;
  border: 1px solid var(--line);
}

.content-panel {
  min-width: 0;
}

.auth-content {
  grid-column: 1 / -1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
}

.side-nav {
  position: sticky;
  top: 74px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 94px);
  border: 1px solid rgba(216, 222, 231, 0.9);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 251, 0.94)),
    radial-gradient(circle at 0% 0%, rgba(36, 87, 166, 0.16), transparent 34%),
    radial-gradient(circle at 100% 16%, rgba(11, 111, 99, 0.14), transparent 30%);
  box-shadow: 0 24px 70px rgba(16, 24, 32, 0.12);
  overflow: hidden;
}

.side-nav-top {
  flex-shrink: 0;
  padding: 12px 14px 4px;
}

.side-nav-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(148,163,184,0.35) transparent;
  padding: 8px 18px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.side-nav-bottom {
  flex-shrink: 0;
  max-height: 52vh;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(148,163,184,0.35) transparent;
  padding: 12px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid rgba(216,222,231,0.7);
}

.side-brand,
.auth-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--ink);
  text-decoration: none;
}

.side-brand {
  padding: 8px 8px 18px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(216, 222, 231, 0.86);
}

.side-brand img,
.auth-brand img {
  width: 54px;
  height: 54px;
  border-radius: 0;
  object-fit: contain;
  box-shadow: 0 2px 8px rgba(116,149,178,0.10);
  filter: drop-shadow(0 2px 4px rgba(116,149,178,0.08));
}

.side-brand strong,
.auth-brand span {
  display: block;
  font-size: 27px;
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 950;
}

.side-brand small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.auth-brand {
  width: min(480px, 100%);
  margin: 0;
}

/* ── Sidebar clock (top) ─────────────────────────────────────────────────── */

.side-clock-top {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 4px 4px 0;
  border-top: 0.5px solid rgba(216, 222, 231, 0.7);
  padding-top: 10px;
  gap: 0;
}

.side-clock-main {
  display: flex;
  flex-direction: column;
  padding: 4px 6px 8px;
}

.side-clock-time {
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.04em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.side-clock-date {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 3px;
}

/* ── World clocks ────────────────────────────────────────────────────────── */
.side-world-clocks {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 0.5px solid rgba(216,222,231,0.7);
  margin-top: 8px;
  padding-top: 6px;
}
.side-wc-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background .12s;
}
.side-wc-row:hover { background: rgba(148,163,184,.1); }
.side-wc-flag { font-size: 13px; flex-shrink: 0; line-height: 1; }
.side-wc-label {
  flex: 1;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}
.side-wc-time {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ── Sidebar weekly calendar ─────────────────────────────────────────────── */

.side-week-cal {
  border: 1px solid rgba(216, 222, 231, 0.75);
  border-radius: 14px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(16,24,32,0.03), rgba(11,111,99,0.04));
}

.swc-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.swc-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 2px 5px;
  gap: 2px;
  border-right: 1px solid rgba(216,222,231,0.5);
}

.swc-day:last-child { border-right: none; }

.swc-today {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  border-radius: 0;
}

.swc-dow {
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.swc-today .swc-dow { color: rgba(255,255,255,0.7); }

.swc-num {
  font-size: 13px;
  font-weight: 900;
  color: var(--ink);
  line-height: 1;
}

.swc-today .swc-num { color: #fff; }

.swc-dots {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  justify-content: center;
  min-height: 7px;
}

.swc-dot {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  flex-shrink: 0;
  text-decoration: none;
  transition: transform .15s;
}

.swc-dot:hover { transform: scale(1.5); }

.swc-dot-more {
  font-size: 7px;
  font-weight: 900;
  color: var(--muted);
  line-height: 1;
}

.swc-today-list {
  border-top: 1px solid rgba(216,222,231,0.6);
  display: flex;
  flex-direction: column;
  max-height: 90px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(148,163,184,0.3) transparent;
}

.swc-event-row {
  display: flex;
  align-items: center;
  padding: 5px 10px;
  border-left: 3px solid transparent;
  border-bottom: 1px solid rgba(216,222,231,0.4);
  text-decoration: none;
  transition: background .12s;
}

.swc-event-row:last-child { border-bottom: none; }
.swc-event-row:hover { background: var(--surface-soft); }

.swc-event-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Remove old side-clock block styles (replaced by side-clock-top) */
.side-clock { display: none; }

/* ── Sidebar navigation groups ───────────────────────────────── */

.side-nav-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 18px 10px 5px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(216,222,231,0.5);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 9.5px;
  font-weight: 900;
}

.nav-group-icon {
  font-size: 12px;
  opacity: 0.55;
  line-height: 1;
}

.nav-soon {
  margin-left: auto;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(180,83,9,0.09);
  border-radius: 4px;
  padding: 2px 5px;
  white-space: nowrap;
}

.side-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  border: 1px solid transparent;
  background: transparent;
  transition:
    background .14s ease,
    color .14s ease,
    border-color .14s ease,
    box-shadow .14s ease,
    transform .14s ease;
}

.side-nav-link .nav-dot {
  transition: background .14s, box-shadow .14s;
}

.side-nav-link:hover {
  transform: translateX(2px);
  color: var(--primary-dark);
  background: rgba(11,111,99,0.07);
  border-color: rgba(11,111,99,0.15);
}

.side-nav-link:hover .nav-dot {
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(11,111,99,0.15);
}

.side-nav-link.active {
  color: #fff;
  background: linear-gradient(135deg, #0d1f14 0%, var(--primary-dark) 55%, var(--primary) 100%);
  border-color: rgba(11,111,99,0.3);
  box-shadow: 0 4px 12px rgba(11,111,99,0.10), 0 1px 0 rgba(255,255,255,0.06) inset;
}

.side-nav-link.active .nav-dot {
  background: rgba(255,255,255,0.9);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.10);
}

/* ── Sidebar account / bottom ────────────────────────────────── */

.side-account {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.side-account-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid transparent;
  transition: background .12s, color .12s, border-color .12s;
}

.side-account-link:hover {
  color: var(--primary-dark);
  background: rgba(11,111,99,0.07);
  border-color: rgba(11,111,99,0.14);
}

.side-account-link.active {
  color: var(--primary-dark);
  background: rgba(11,111,99,0.08);
}

.logout-pill {
  color: #9f1239;
}
.logout-pill:hover {
  background: rgba(159,18,57,0.07);
  border-color: rgba(159,18,57,0.14);
  color: #be123c;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  background:
    linear-gradient(135deg, rgba(16, 24, 32, 0.96), rgba(13, 81, 74, 0.92)),
    radial-gradient(circle at 80% 20%, rgba(245, 158, 11, 0.22), transparent 34%);
  color: #fff;
  border: 1px solid #22313d;
  border-radius: 8px;
  padding: 30px;
  margin-bottom: 18px;
  min-height: 220px;
}

.sds-manager-hero {
  grid-template-columns: minmax(680px, 1fr);
  padding: 34px;
}

.hero-main {
  max-width: 100%;
}

.hero-panel.slim {
  min-height: 170px;
}

.tool-hero {
  position: relative;
  overflow: hidden;
}

.tool-hero::after {
  content: "";
  position: absolute;
  inset: auto -70px -110px auto;
  width: 280px;
  height: 280px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.substances-hero {
  background:
    linear-gradient(135deg, rgba(12, 28, 42, 0.97), rgba(8, 83, 89, 0.92)),
    radial-gradient(circle at 78% 22%, rgba(56, 189, 248, 0.24), transparent 34%);
}

.cosmetics-hero {
  background:
    linear-gradient(135deg, rgba(35, 28, 44, 0.97), rgba(122, 63, 86, 0.92)),
    radial-gradient(circle at 78% 22%, rgba(251, 191, 36, 0.2), transparent 34%);
}

.pif-hero {
  background:
    linear-gradient(135deg, rgba(18, 32, 47, 0.97), rgba(45, 77, 116, 0.92)),
    radial-gradient(circle at 78% 22%, rgba(147, 197, 253, 0.24), transparent 34%);
}

.cpsr-hero {
  background:
    linear-gradient(135deg, rgba(26, 39, 35, 0.97), rgba(63, 98, 69, 0.92)),
    radial-gradient(circle at 78% 22%, rgba(134, 239, 172, 0.22), transparent 34%);
}

.gap-hero {
  background:
    linear-gradient(135deg, rgba(41, 29, 16, 0.97), rgba(146, 64, 14, 0.92)),
    radial-gradient(circle at 78% 22%, rgba(253, 186, 116, 0.24), transparent 34%);
}

.nexus-hero {
  background:
    linear-gradient(135deg, rgba(16, 24, 32, 0.98), rgba(36, 87, 166, 0.9)),
    radial-gradient(circle at 78% 22%, rgba(105, 153, 185, 0.28), transparent 34%);
}

.sds-validation-hero {
  background:
    linear-gradient(135deg, rgba(18, 27, 40, 0.97), rgba(13, 81, 74, 0.94)),
    radial-gradient(circle at 78% 22%, rgba(245, 158, 11, 0.24), transparent 34%);
}

/* ── PIF Manager UI components ──────────────────────────────── */

.card-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}

.card-legal-ref {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  background: var(--surface-soft);
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: auto;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.required-star {
  color: var(--danger, #ef4444);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 0;
}

/* PIF progress bar */
.pif-progress-bar-wrap {
  height: 12px;
  background: var(--surface-soft);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 6px;
  border: 1px solid var(--line);
}
.pif-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, #22c55e 100%);
  border-radius: 6px;
  transition: width 0.5s ease;
  min-width: 4px;
}

/* PIF sections grid */
.pif-sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.pif-section-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s;
}

.pif-section-not_started { border-left: 3px solid var(--line); }
.pif-section-missing      { border-left: 3px solid #ef4444; }
.pif-section-in_progress  { border-left: 3px solid #f59e0b; }
.pif-section-complete     { border-left: 3px solid #22c55e; }
.pif-section-not_applicable { border-left: 3px solid var(--muted); opacity: 0.7; }

.pif-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.pif-section-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pif-section-number {
  font-size: 11px;
  color: var(--muted);
  min-width: 18px;
}

.pif-section-legal {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
}

.pif-section-expected {
  margin: 0;
  padding-left: 16px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
}

.pif-section-controls {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.pif-section-controls label {
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pif-notes-label {
  flex: 2;
  min-width: 140px;
}

/* Complete section: subtle wash */
.pif-section-complete {
  background: color-mix(in srgb, #22c55e 6%, var(--surface));
}

/* Collapsible panel toggle */
.collapsible-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  font-weight: 700;
  font-size: 1rem;
}
.collapsible-toggle .toggle-arrow {
  font-size: 12px;
  transition: transform 0.2s;
  display: inline-block;
}
.collapsible-toggle.open .toggle-arrow {
  transform: rotate(90deg);
}
.collapsible-body {
  display: none;
  margin-top: 14px;
}
.collapsible-body.open {
  display: block;
}

/* ── End PIF UI ──────────────────────────────────────────────── */

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  color: #86c7bd;
  font-weight: 800;
}

.hero-panel h2,
.workspace-section h2 {
  margin: 0;
}

.hero-panel h2 {
  max-width: 1120px;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.02;
  font-weight: 800;
}

.hero-copy {
  max-width: 920px;
  color: #d7e4e1;
  font-size: 16px;
  margin: 14px 0 0;
}

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

.sds-manager-hero .hero-actions {
  width: 100%;
  padding-top: 4px;
  flex-wrap: nowrap;
  align-items: stretch;
}

.sds-manager-hero .primary-action,
.sds-manager-hero .secondary-action {
  min-height: 44px;
  justify-content: center;
  white-space: nowrap;
}

.primary-action,
.secondary-action,
button {
  width: fit-content;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  font: inherit;
}

.primary-action,
button {
  background: var(--primary);
  color: #fff;
}

.primary-action:hover,
button:hover {
  background: var(--primary-dark);
}

.secondary-action {
  background: #eef2f6;
  color: var(--ink);
  border: 1px solid var(--line);
}

.hero-panel .secondary-action {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

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

.metric-card,
.product-card,
.workspace-section,
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric-card {
  padding: 16px;
  display: grid;
  gap: 8px;
}

.metric-card span,
.product-facts dt,
.help-text {
  color: var(--muted);
}

.metric-card strong {
  font-size: 30px;
  line-height: 1;
}

.workspace-section,
.card {
  padding: 20px;
  margin-bottom: 18px;
}

/* ── Login split layout ──────────────────────────────────────────────────── */

.login-split {
  display: grid;
  grid-template-columns: 2fr 3fr;
  min-height: 100vh;
  width: 100%;
}

/* Left: dark brand panel */
.login-brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 52px 48px 36px;
  background:
    linear-gradient(160deg, #2a4a62 0%, #3d6b8a 50%, #4d80a0 100%),
    radial-gradient(circle at 20% 80%, rgba(255,255,255,0.06), transparent 52%),
    radial-gradient(circle at 80% 10%, rgba(255,255,255,0.04), transparent 44%);
  color: #e8f1f7;
  position: relative;
  overflow: hidden;
}

.login-brand-panel::after {
  content: "";
  position: absolute;
  inset: auto -80px -120px auto;
  width: 320px;
  height: 320px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  pointer-events: none;
}

.login-brand-inner {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 16px 40px rgba(0,0,0,0.4);
}

.login-product-name {
  margin: 0;
  font-size: clamp(36px, 4vw, 54px);
  font-weight: 950;
  letter-spacing: -0.04em;
  line-height: 1;
  color: #fff;
}

.login-tagline {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: rgba(226,232,240,0.6);
  letter-spacing: 0.02em;
}

.login-domains {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.login-domain-pill {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(226,232,240,0.75);
  white-space: nowrap;
}

.login-brand-footer {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  color: rgba(226,232,240,0.3);
  letter-spacing: 0.04em;
}

/* Right: form panel */
.login-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 52px 48px;
  background: var(--surface);
}

.login-form-inner {
  width: min(380px, 100%);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.login-form-title {
  margin: 4px 0 8px;
  font-size: 32px;
  font-weight: 950;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
}

.login-form-sub {
  margin: 0 0 28px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.login-btn {
  margin-top: 4px;
  background: linear-gradient(135deg, #101820, var(--primary-dark) 60%, var(--primary));
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.02em;
  border: none;
  border-radius: 12px;
  padding: 14px 24px;
  cursor: pointer;
  transition: opacity 0.18s, box-shadow 0.18s;
  box-shadow: 0 8px 24px rgba(11,111,99,0.22);
}

.login-btn:hover {
  opacity: 0.88;
  box-shadow: 0 12px 32px rgba(11,111,99,0.32);
}

@media (max-width: 700px) {
  .login-split {
    grid-template-columns: 1fr;
  }

  .login-brand-panel {
    padding: 36px 28px 28px;
    min-height: auto;
  }

  .login-form-panel {
    padding: 36px 24px;
  }
}

.release-decision {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin: 18px 0;
  padding: 18px;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.release-decision h3 {
  margin: 0 0 6px;
  font-size: 24px;
}

.release-decision p {
  margin: 0;
  color: var(--muted);
}

.release-decision.blocked {
  background:
    linear-gradient(135deg, rgba(255, 247, 237, 0.96), rgba(255, 255, 255, 0.92)),
    radial-gradient(circle at 90% 12%, rgba(180, 83, 9, 0.12), transparent 34%);
  border-color: #fdba74;
}

.release-decision.ready {
  background:
    linear-gradient(135deg, rgba(236, 253, 245, 0.96), rgba(255, 255, 255, 0.92)),
    radial-gradient(circle at 90% 12%, rgba(11, 111, 99, 0.14), transparent 34%);
  border-color: #86efac;
}

.release-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.section-heading,
.header-row,
.product-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.section-heading {
  margin-bottom: 16px;
}

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

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.module-card {
  min-height: 210px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(247, 249, 251, 0.92)),
    radial-gradient(circle at 100% 0%, rgba(36, 87, 166, 0.1), transparent 36%);
  display: grid;
  align-content: start;
  gap: 10px;
  box-shadow: 0 16px 40px rgba(16, 24, 32, 0.07);
}

.module-card h3 {
  margin: 4px 0 0;
  font-size: 22px;
}

.module-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.product-card {
  padding: 18px;
  display: grid;
  gap: 16px;
}

.product-card h3 {
  margin: 8px 0 0;
  font-size: 22px;
}

.status-badge,
.language-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  color: #334155;
  background: #eef2f6;
}

.status-market_issue_candidate,
.status-reviewed,
.status-passed,
.status-ok,
.status-calculated,
.status-pass,
.status-automatic,
.status-selected {
  color: #166534;
  background: #dcfce7;
}

.status-review_required,
.status-draft,
.status-needs_review,
.status-review,
.status-requires_review,
.status-automatic_with_review_note,
.status-automatic_if_mixture_data_present,
.status-partial,
.status-review_controlled,
.status-not_selected_capacity {
  color: #92400e;
  background: #fef3c7;
}

.status-blocked,
.status-blocked_or_review,
.status-fail {
  color: #991b1b;
  background: #fee2e2;
}

.status-screened_out,
.status-not_defined,
.status-excluded_by_policy {
  color: #475569;
  background: #e2e8f0;
}

.status-approved {
  color: #166534;
  background: #dcfce7;
}

.status-issued {
  color: #166534;
  background: #dcfce7;
}

.status-superseded,
.status-not_issued {
  color: #475569;
  background: #e2e8f0;
}

.status-admin {
  color: #1e3a8a;
  background: #dbeafe;
}

.status-user {
  color: #334155;
  background: #e2e8f0;
}

.status-in_review,
.status-not_started {
  color: #92400e;
  background: #fef3c7;
}

.status-needs_enrichment {
  color: #1e3a8a;
  background: #dbeafe;
}

.priority-high {
  color: #991b1b;
  background: #fee2e2;
}

.priority-medium {
  color: #92400e;
  background: #fef3c7;
}

.priority-low {
  color: #1e3a8a;
  background: #dbeafe;
}

.priority-complete {
  color: #166534;
  background: #dcfce7;
}

.language-chip {
  background: #e8f3f1;
  color: var(--primary-dark);
}

.review-gate {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  margin: 18px 0;
  background:
    linear-gradient(135deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.94)),
    radial-gradient(circle at 100% 0%, rgba(105, 153, 185, 0.14), transparent 36%);
}

.review-form {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

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

.check-card,
.approval-switch {
  display: flex;
  grid-template-columns: none;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.78);
  font-weight: 700;
}

.check-card input,
.approval-switch input {
  width: auto;
  margin-top: 3px;
}

.product-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.product-facts div {
  padding: 10px;
  background: var(--surface-soft);
  border: 1px solid #e7ecf2;
  border-radius: 8px;
}

.product-facts dt {
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 4px;
}

.product-facts dd {
  margin: 0;
  font-weight: 800;
}

.ingredient-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ingredient-preview span {
  padding: 5px 8px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.card-actions {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.card-actions form,
.table-actions form {
  margin: 0;
}

.card-actions a,
.btn-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 800;
}

.danger-link {
  background: transparent;
  color: #b91c1c;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.danger-link:hover {
  background: transparent;
  color: #7f1d1d;
}

.management-panel {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.compact-heading {
  margin-bottom: 8px;
}

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

.empty-state {
  border: 1px dashed #b8c2cf;
  border-radius: 8px;
  padding: 22px;
  background: #f8fafc;
}

.empty-state.quiet {
  background: #fbfcfd;
}

.empty-state h3 {
  margin: 0 0 8px;
}

.empty-state p {
  margin: 0 0 12px;
  color: var(--muted);
}

.search-panel,
.form-grid {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font: inherit;
  background: #fff;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #9dd6ce;
  border-color: var(--primary);
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
}

.data-table {
  margin-top: 16px;
}

.cas-cell {
  white-space: nowrap;
  width: 1%;
  min-width: 96px;
}

.flash-list {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.flash {
  padding: 10px;
  border-radius: 8px;
}

.flash.error {
  background: var(--error-bg);
  color: var(--error-text);
}

.flash.success {
  background: var(--ok-bg);
  color: var(--ok-text);
}

.flash.warning {
  background: var(--warn-bg);
  color: var(--warn-text);
}

.suggestions {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  max-height: 220px;
  overflow-y: auto;
}

.suggestion-item {
  padding: 9px;
  border-bottom: 1px solid #eef2f7;
  cursor: pointer;
}

.suggestion-item:hover {
  background: #eef8f6;
}

.selected-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.selected-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}

.selected-main {
  font-weight: 800;
}

.selected-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.selected-controls input {
  width: 95px;
  padding: 6px 8px;
}

.secondary-btn {
  background: #e5e7eb;
  color: #111827;
  padding: 7px 10px;
}

.secondary-btn:hover {
  background: #d1d5db;
}

.section-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdff;
}

.section-block h3 {
  margin-top: 0;
}

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

.span-2 {
  grid-column: span 2;
}

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

.stat-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
  display: grid;
  gap: 4px;
}

.notice {
  border-radius: 8px;
  padding: 12px;
  margin: 12px 0;
  border: 1px solid var(--line);
}

.notice.warning {
  background: var(--warn-bg);
  border-color: #fed7aa;
}

.notice.success {
  background: var(--ok-bg);
  border-color: #86efac;
  color: var(--ok-text);
}

.gap-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.gap-list span {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(180, 83, 9, 0.18);
  font-weight: 800;
  font-size: 12px;
}

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

.gap-summary-card,
.data-chip {
  text-decoration: none;
  color: var(--text);
}

.gap-summary-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #fff;
  display: grid;
  gap: 6px;
}

.gap-summary-card strong {
  font-size: 26px;
  line-height: 1;
}

.gap-summary-card span {
  color: var(--muted);
  font-weight: 800;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.data-chip {
  display: inline-flex;
  border-radius: 999px;
  padding: 7px 10px;
  background: #eef2f6;
  border: 1px solid var(--line);
  font-weight: 800;
  font-size: 12px;
}

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

.user-access-grid {
  display: grid;
  gap: 16px;
}

.user-access-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94)),
    radial-gradient(circle at 100% 0%, rgba(11, 111, 99, 0.08), transparent 34%);
}

.admin-table-wrap {
  overflow-x: auto;
}

.user-access-table {
  min-width: 1120px;
}

.user-access-table input,
.user-access-table select {
  min-width: 120px;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 6px;
  min-width: 340px;
}

.compact-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  color: #334155;
}

.compact-check input {
  width: auto;
  min-width: auto;
}

pre {
  overflow-x: auto;
}

.mono {
  font-family: var(--font-mono);
}

@media (max-width: 820px) {
  .hero-panel,
  .section-heading,
  .header-row {
    display: grid;
  }

  .app-shell {
    grid-template-columns: 1fr;
    width: min(1180px, 92%);
    gap: 18px;
  }

  .side-nav {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: auto;
  }

  .side-brand,
  .side-nav-label,
  .side-account {
    grid-column: 1 / -1;
  }

  .sds-manager-hero {
    grid-template-columns: 1fr;
    padding: 26px;
  }

  .sds-manager-hero .hero-actions {
    flex-wrap: wrap;
  }

  .hero-panel h2 {
    font-size: 34px;
  }

  .metric-grid,
  .module-grid,
  .gap-summary-grid,
  .product-grid,
  .stat-grid,
  .substance-detail-grid,
  .review-checklist,
  .form-columns,
  .product-facts {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ── Utilitários gerais ──────────────────────────────────────────────────── */

.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ── Page header (título + acções no topo) ───────────────────────────────── */

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.page-header h1 { margin: 0; }

/* ── Botões ──────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 14px;
  font: inherit;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  background: var(--surface);
  color: var(--text);
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.btn:hover { background: var(--surface-soft); border-color: #b0bac8; }

.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.btn-danger { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.btn-danger:hover { background: #fecaca; }

.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }

/* ── Form card & grid ────────────────────────────────────────────────────── */

.form-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 18px;
}

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

.form-group {
  display: grid;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 800;
  color: #334155;
}

.input-prefix,
.input-suffix {
  font-weight: 700;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

/* ── Badges de estado (propostas) ────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 800;
  background: #eef2f6;
  color: #334155;
}

.badge-draft       { background: #fef3c7; color: #92400e; }
.badge-sent        { background: #dbeafe; color: #1e3a8a; }
.badge-accepted    { background: #dcfce7; color: #166534; }
.badge-rejected    { background: #fee2e2; color: #991b1b; }
/* work / mdr / cpsr / pif status badges */
.badge-backlog     { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.badge-in-progress { background: #dbeafe; color: #1e3a8a; }
.badge-review      { background: #fef3c7; color: #92400e; }
.badge-in-review   { background: #fef3c7; color: #92400e; }
.badge-done        { background: #dcfce7; color: #166534; }
.badge-complete    { background: #dcfce7; color: #166534; }
.badge-approved    { background: #dcfce7; color: #166534; }
.badge-signed      { background: #ccfbf1; color: #0f766e; }
.badge-cancelled   { background: #f1f5f9; color: #94a3b8; }
.badge-not-started { background: #f1f5f9; color: #94a3b8; }
.badge-missing     { background: #fee2e2; color: #991b1b; }
.badge-ok          { background: #dcfce7; color: #166534; }
.badge-blocked     { background: #fee2e2; color: #991b1b; }

/* ── Quote calculator results ────────────────────────────────────────────── */

.result-item { display: grid; gap: 4px; }

.result-label {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.result-value {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.result-highlight .result-value { color: var(--primary-dark); }

/* ── Hero: Clientes ──────────────────────────────────────────────────────── */

.clients-hero {
  background:
    linear-gradient(135deg, rgba(14, 24, 44, 0.97), rgba(30, 64, 105, 0.92)),
    radial-gradient(circle at 78% 22%, rgba(99, 179, 237, 0.24), transparent 34%);
}

/* ── Dashboard layout ────────────────────────────────────────────────────── */

.dashboard-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 960px) {
  .dashboard-body {
    grid-template-columns: 1fr;
  }

  .metric-grid[style*="repeat(5"] {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* ══════════════════════════════════════════════════════════════
   DASHBOARD — hero, alertas, domain cards, actividade
   ══════════════════════════════════════════════════════════════ */

/* ── Hero ─────────────────────────────────────────────────────── */

/* db-hero removido — substituído por db-metrics-bar */
.db-hero { display: none; }

/* ── Faixa de métricas ───────────────────────────────────────── */
.db-metrics-bar {
  display: flex;
  align-items: stretch;
  margin-bottom: 22px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.06);
  overflow: hidden;
  background: linear-gradient(135deg, #0a1628 0%, #0f2d44 60%, #0d2b1c 100%);
  box-shadow: 0 4px 24px rgba(10,22,40,0.22);
}

.db-metric {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 12px;
  border-right: 1px solid rgba(255,255,255,0.07);
  gap: 5px;
  transition: background .12s;
}
.db-metric:last-child { border-right: none; }
.db-metric:hover { background: rgba(255,255,255,0.05); }

.db-metric-val {
  font-size: 28px;
  font-weight: 800;
  color: #f1f5f9;
  letter-spacing: -0.04em;
  line-height: 1;
}

.db-metric-label {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.4);
  text-align: center;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.db-metric-warn .db-metric-val { color: #fca5a5; }
.db-metric-warn { background: rgba(220,38,38,0.1); }
.db-metric-warn:hover { background: rgba(220,38,38,0.16); }

.db-metric-fact .db-metric-val { font-size: 20px; }
.db-metric-fact { background: rgba(11,111,99,0.12); }

/* ── Alertas ──────────────────────────────────────────────────── */

.db-alerts {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 22px;
}

.db-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: 12px;
  border-width: 1px;
  border-style: solid;
}

.db-alert-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.db-alert-critical {
  background: #fef2f2;
  border-color: #fecaca;
}
.db-alert-critical .db-alert-dot { background: #dc2626; box-shadow: 0 0 0 3px rgba(220,38,38,.15); }
.db-alert-critical .db-alert-msg { color: #991b1b; }
.db-alert-critical .db-alert-link { color: #dc2626; border-color: #fecaca; }

.db-alert-warning {
  background: #fffbeb;
  border-color: #fde68a;
}
.db-alert-warning .db-alert-dot { background: #d97706; box-shadow: 0 0 0 3px rgba(217,119,6,.15); }
.db-alert-warning .db-alert-msg { color: #92400e; }
.db-alert-warning .db-alert-link { color: #b45309; border-color: #fde68a; }

.db-alert-info {
  background: var(--surface-soft);
  border-color: var(--line);
}
.db-alert-info .db-alert-dot { background: var(--primary); box-shadow: 0 0 0 3px rgba(11,111,99,.15); }
.db-alert-info .db-alert-msg { color: var(--text); }
.db-alert-info .db-alert-link { color: var(--primary-dark); border-color: var(--line); }

.db-alert-msg {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
}

.db-alert-link {
  font-size: 12px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid;
  background: #fff;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity .12s;
}
.db-alert-link:hover { opacity: .75; }

/* ── Domain grid ─────────────────────────────────────────────── */

.db-domains {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

/* Domain card — uses CSS vars --dc-grad, --dc-accent, --dc-glow */
.dc {
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow:
    0 2px 0 rgba(255,255,255,0.05) inset,
    0 20px 50px rgba(10,16,24,0.18);
  transition: transform .18s ease, box-shadow .18s ease;
}

.dc:hover {
  transform: translateY(-3px);
  box-shadow:
    0 2px 0 rgba(255,255,255,0.07) inset,
    0 28px 64px rgba(10,16,24,0.26),
    0 0 0 1px rgba(255,255,255,0.09);
}

/* Header */
.dc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 16px;
  background: var(--dc-grad);
  position: relative;
  overflow: hidden;
}

/* texture on header */
.dc-head::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 50%, rgba(255,255,255,0.06), transparent 60%);
  pointer-events: none;
}

.dc-head-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dc-icon {
  font-size: 24px;
  opacity: 0.7;
  line-height: 1;
  flex-shrink: 0;
}

.dc-reg {
  margin: 0 0 2px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
}

.dc-title {
  margin: 0 0 1px;
  font-size: 17px;
  font-weight: 950;
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1.1;
}

.dc-sub {
  margin: 0;
  font-size: 10px;
  color: rgba(255,255,255,0.45);
  font-weight: 700;
}

.dc-count {
  font-size: 11px;
  font-weight: 900;
  color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 20px;
  padding: 3px 9px;
  flex-shrink: 0;
}

/* Module list */
.dc-list {
  list-style: none;
  margin: 0;
  padding: 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: #0f172a;
}

.dc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.04);
  transition: background .13s, border-color .13s, box-shadow .13s;
}

.dc-item:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--dc-accent);
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.dc-item-soon { opacity: 0.5; }

.dc-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dc-item-name {
  font-size: 13px;
  font-weight: 700;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dc-item-desc {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  line-height: 1.4;
}

.dc-btn {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 7px;
  background: var(--dc-glow);
  color: var(--dc-accent);
  border: 1px solid var(--dc-accent);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.01em;
  transition: background .13s, color .13s;
}
.dc-btn:hover {
  background: var(--dc-accent);
  color: #fff;
}

.dc-badge {
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 7px;
}

/* ── Actividade recente ───────────────────────────────────────── */

.db-section-label {
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--muted);
  margin: 0 0 10px;
}

.db-activity {
  margin-top: 8px;
}

.db-activity-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.db-act-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  transition: background .1s;
}
.db-act-row:last-child { border-bottom: none; }
.db-act-row:hover { background: var(--surface-soft); }

.db-act-main { flex: 1; min-width: 0; }

.db-act-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.db-act-type {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}

.db-act-label {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.db-act-user {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}

.db-act-time {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  padding-top: 2px;
  flex-shrink: 0;
}

@media (max-width: 720px) {
  .db-domains { grid-template-columns: 1fr; }
  .db-hero { padding: 20px; }
  .db-stats { gap: 4px; }
  .db-stat { padding: 10px 12px; min-width: 60px; }
  .db-stat-val { font-size: 20px; }
}

/* Legacy aliases — kept for any template still using the old class names */
.domain-grid { display: none; }
.domain-card, .domain-card-header, .domain-card-body,
.domain-mod-row, .domain-mod-btn, .domain-mod-tag { all: unset; }

/* ══════════════════════════════════════════════════════════════
   WORKSPACE PESSOAL
   ══════════════════════════════════════════════════════════════ */

/* ── Hero ─────────────────────────────────────────────────────── */

.ws-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 26px 32px;
  margin-bottom: 20px;
  border-radius: 20px;
  background: linear-gradient(135deg, #1a1f2e 0%, #2c3e55 55%, #3a5068 100%);
  box-shadow: 0 20px 60px rgba(26,31,46,0.24);
}

.ws-hero-eyebrow {
  margin: 0 0 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
}

.ws-hero-name {
  margin: 0 0 5px;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 950;
  letter-spacing: -0.04em;
  color: #fff;
  line-height: 1;
}

.ws-hero-sub {
  margin: 0;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}

.ws-hero-link {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-weight: 800;
  transition: color .12s;
}
.ws-hero-link:hover { color: #fff; }

.ws-hero-actions { display: flex; gap: 8px; }

.ws-hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.32);
  border-radius: 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transition: background .12s;
}
.ws-hero-btn:hover { background: rgba(255,255,255,0.18); }

/* ── Big Calendar ─────────────────────────────────────────────── */

.wsc-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 18px;
}

.wsc-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  flex-wrap: wrap;
}

.wsc-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  transition: background .12s, color .12s;
  flex-shrink: 0;
}
.wsc-nav-btn:hover { background: var(--line); color: var(--ink); }

.wsc-month-label {
  font-size: 16px;
  font-weight: 950;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0;
  text-transform: capitalize;
  min-width: 160px;
}

.wsc-today-btn {
  font-size: 11px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: background .12s;
}
.wsc-today-btn:hover { background: var(--line); color: var(--ink); }

.wsc-quick-form {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 240px;
}

.wsc-quick-input {
  flex: 1;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color .12s;
}
.wsc-quick-input:focus { border-color: var(--primary); }

.wsc-quick-date {
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  outline: none;
  width: 140px;
  flex-shrink: 0;
}

.wsc-quick-btn {
  padding: 7px 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: opacity .12s;
  flex-shrink: 0;
}
.wsc-quick-btn:hover { opacity: .85; }

/* Day-of-week header row */
.wsc-grid-head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--line);
}

.wsc-dow {
  padding: 8px 0;
  text-align: center;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-right: 1px solid var(--line);
}
.wsc-dow:last-child { border-right: none; }

/* Day cells grid */
.wsc-grid-body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.wsc-cell {
  min-height: 100px;
  padding: 8px 8px 6px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  transition: background .10s;
}
.wsc-cell:nth-child(7n) { border-right: none; }
.wsc-cell:hover { background: var(--surface-soft); }

.wsc-cell-empty {
  background: rgba(0,0,0,0.012);
  cursor: default;
}
.wsc-cell-empty:hover { background: rgba(0,0,0,0.012); }

.wsc-cell-past .wsc-day-num { color: var(--muted); }

.wsc-cell-today {
  background: rgba(11,111,99,0.05);
}
.wsc-cell-today:hover { background: rgba(11,111,99,0.09); }

.wsc-cell-top {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 2px;
}

.wsc-day-num {
  font-size: 13px;
  font-weight: 900;
  color: var(--ink);
  line-height: 1;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

.wsc-cell-today .wsc-day-num {
  background: var(--primary);
  color: #fff;
}

.wsc-today-pill {
  font-size: 8.5px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary-dark);
  background: rgba(11,111,99,0.12);
  border-radius: 4px;
  padding: 1px 5px;
}

.wsc-cell-events {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.wsc-chip {
  display: block;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  line-height: 1.5;
  transition: opacity .10s;
}
.wsc-chip:hover { opacity: .8; }

.wsc-chip-more {
  font-size: 9.5px;
  font-weight: 900;
  color: var(--muted);
  padding-left: 6px;
  line-height: 1.5;
}

/* ── Non-working days (weekends + holidays) ─────────────────── */
.wsc-cell-weekend {
  background: rgba(0,0,0,0.025);
}
.wsc-cell-weekend:hover { background: rgba(0,0,0,0.04); }

.wsc-cell-holiday {
  background: rgba(220,38,38,0.04);
}
.wsc-cell-holiday:hover { background: rgba(220,38,38,0.08); }

.wsc-cell-weekend .wsc-day-num,
.wsc-cell-holiday .wsc-day-num {
  color: var(--muted);
}

.wsc-weekend-badge {
  display: inline-block;
  font-size: 8.5px;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-soft, rgba(0,0,0,0.06));
  border-radius: 4px;
  padding: 0 4px;
  margin-left: 4px;
  line-height: 1.6;
  vertical-align: middle;
  letter-spacing: .02em;
}

.wsc-hol-badge {
  display: block;
  font-size: 8px;
  font-weight: 600;
  color: #b91c1c;
  background: rgba(220,38,38,0.08);
  border-radius: 4px;
  padding: 1px 4px;
  margin-top: 2px;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ── Bottom grid: Notes + Todos ──────────────────────────────── */

.ws-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.ws-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ws-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--line);
}

.ws-panel-title {
  font-size: 14px;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.01em;
}

/* Keep legacy alias */
.ws-col-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.ws-col-title  { font-size: 13px; font-weight: 900; color: var(--ink); }

.ws-add-btn {
  font-size: 12px;
  font-weight: 800;
  color: var(--primary);
  background: rgba(11,111,99,0.08);
  border: 1px solid rgba(11,111,99,0.18);
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.ws-add-btn:hover { background: rgba(11,111,99,0.15); }

.ws-inline-form {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface-soft);
}
.ws-inline-form.hidden { display: none; }

.ws-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}
.ws-input:focus { outline: 2px solid rgba(11,111,99,0.35); border-color: var(--primary); }

.ws-date-input { font-size: 12px; }

.ws-textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  resize: vertical;
}
.ws-textarea:focus { outline: 2px solid rgba(11,111,99,0.35); border-color: var(--primary); }

.ws-btn-primary {
  background: linear-gradient(135deg, #101820, var(--primary-dark) 60%, var(--primary));
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.ws-btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}
.ws-btn-ghost:hover { background: var(--surface-soft); }
.ws-btn-danger {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.ws-btn-sm { padding: 4px 10px; font-size: 11px; }

.ws-notes-list {
  flex: 1;
  overflow-y: auto;
  max-height: 600px;
}

.ws-note-card {
  border-bottom: 1px solid var(--line);
}
.ws-note-card:last-child { border-bottom: none; }

.ws-note-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  cursor: pointer;
  list-style: none;
  gap: 8px;
}
.ws-note-summary::-webkit-details-marker { display: none; }
.ws-note-summary:hover { background: var(--surface-soft); }

.ws-note-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.ws-note-date {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.ws-note-body {
  padding: 0 16px 10px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
}
.ws-note-actions {
  padding: 0 16px 12px;
  display: flex;
  gap: 6px;
}

.ws-empty {
  padding: 20px 16px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* To-do */
.ws-todo-form {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.ws-todo-section {
  display: flex;
  flex-direction: column;
}

.ws-todo-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
}
.ws-todo-row:last-child { border-bottom: none; }
.ws-overdue { background: #fff8f8; }

.ws-check-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--muted);
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
}
.ws-check-done { color: var(--primary); }

.ws-todo-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ws-todo-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.ws-todo-striked { text-decoration: line-through; color: var(--muted); font-weight: 600; }
.ws-todo-due {
  font-size: 11px;
  color: var(--muted);
}
.ws-due-late { color: #dc2626; font-weight: 800; }
.ws-due-today { color: #d97706; font-weight: 800; }

.ws-del-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: #cbd5e1;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.15s;
}
.ws-del-btn:hover { color: #dc2626; }

.ws-done-details {
  border-top: 1px solid var(--line);
}
.ws-done-details summary {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}
.ws-done-details summary::-webkit-details-marker { display: none; }
.ws-done-details summary:hover { background: var(--surface-soft); }
.ws-done-row { opacity: 0.65; }

/* ── Workspace responsive ─────────────────────────────────────── */

.ws-todo-add-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.ws-todo-add-row .ws-input { flex: 1; }
.ws-todo-add-row .ws-date-input { width: 140px; flex-shrink: 0; }
.ws-todo-add-row .ws-btn-primary { flex-shrink: 0; padding: 8px 14px; font-size: 16px; }

.ws-form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

@media (max-width: 900px) {
  .ws-bottom-grid { grid-template-columns: 1fr; }
  .wsc-cell { min-height: 72px; }
}
@media (max-width: 640px) {
  .wsc-toolbar { gap: 6px; }
  .wsc-quick-form { min-width: 100%; }
  .wsc-cell { min-height: 54px; padding: 5px 4px 4px; }
  .wsc-chip { font-size: 9px; }
}

/* ── Módulo de Chamadas ───────────────────────────────────────────────────── */

.calls-new-btn {
  display: inline-flex;
  align-items: center;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  padding: 9px 18px;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.15s;
}
.calls-new-btn:hover { background: rgba(255,255,255,0.25); }

.calls-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.calls-filter-input {
  flex: 1;
  min-width: 140px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}
.calls-filter-select {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}
.calls-filter-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.calls-filter-clear {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 8px;
}
.calls-filter-clear:hover { color: var(--danger); }

/* ══ CALLS LIST ══════════════════════════════════════════════════════════════
 * Layout: 3 zonas numa grelha
 *   LEFT  (260px) — quem + direcção
 *   MID   (1fr)   — resultado, tipo, notas
 *   RIGHT (120px) — data/hora, duração, follow-up
 *
 * Borda esquerda colorida por resultado: verde=positivo, vermelho=negativo,
 * laranja=aguarda, cinza=neutro/sem_resposta.
 * ══════════════════════════════════════════════════════════════════════════ */
.calls-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.call-card {
  display: grid;
  grid-template-columns: 260px 1fr 120px;
  align-items: center;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3.5px solid var(--line);  /* overridden per-outcome below */
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: box-shadow .15s, border-color .15s;
}
.call-card:hover {
  box-shadow: 0 3px 14px rgba(16,24,32,.08);
  border-color: var(--primary);
  border-left-color: var(--primary);
}

/* outcome-driven left border */
.call-card[data-outcome="positivo"]    { border-left-color: #16a34a; }
.call-card[data-outcome="negativo"]    { border-left-color: #dc2626; }
.call-card[data-outcome="aguarda"]     { border-left-color: #d97706; }
.call-card[data-outcome="sem_resposta"]{ border-left-color: #94a3b8; }
.call-card[data-outcome="neutro"]      { border-left-color: #94a3b8; }

/* ── LEFT: quem ─────────────────────────────────────────────────────────── */
.call-card-left {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px 13px 16px;
  min-width: 0;
  border-right: 1px solid var(--line);
  height: 100%;
}

/* direction pill */
.call-dir-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 900;
}
.call-dir-entrada {
  background: rgba(22,163,74,.12);
  color: #166534;
}
.call-dir-saida {
  background: rgba(36,87,166,.10);
  color: #1e3a8a;
}

.call-card-left-text { min-width: 0; }

.call-client {
  font-size: .9rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.call-contact {
  font-size: .75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* ── MID: resultado + notas ─────────────────────────────────────────────── */
.call-card-mid {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 11px 16px;
  min-width: 0;
}
.call-card-mid-top {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.call-type-tag {
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1px 8px;
  white-space: nowrap;
}
.call-notes-preview {
  font-size: .8rem;
  color: var(--muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
}

/* ── RIGHT: datas + duração ─────────────────────────────────────────────── */
.call-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  padding: 11px 16px 11px 10px;
  flex-shrink: 0;
  border-left: 1px solid var(--line);
  height: 100%;
  font-variant-numeric: tabular-nums lining-nums;
}
.call-date {
  font-size: .8rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  line-height: 1.2;
}
.call-duration {
  font-size: .75rem;
  color: var(--muted);
  white-space: nowrap;
}
.call-followup {
  font-size: .72rem;
  font-weight: 700;
  color: #d97706;
  white-space: nowrap;
  background: rgba(217,119,6,.08);
  border-radius: 4px;
  padding: 1px 5px;
}
.call-followup-late {
  color: #dc2626;
  background: rgba(220,38,38,.08);
}

/* ══ Generic Record Card (work, mdr, cpsr, pif) ══════════════════════════════
   Mirrors the .call-card pattern: 3-zone grid with status-driven left border.
   ─────────────────────────────────────────────────────────────────────────── */
.rc-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.rc-card {
  display: grid;
  grid-template-columns: 240px 1fr 152px;
  align-items: center;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3.5px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: box-shadow .15s, border-color .15s;
}
.rc-card:hover {
  box-shadow: 0 3px 14px rgba(16,24,32,.08);
  border-color: var(--primary);
  border-left-color: var(--primary);
}

/* status-driven left border */
.rc-card[data-status="backlog"]     { border-left-color: #64748b; }
.rc-card[data-status="in_progress"] { border-left-color: #3b82f6; }
.rc-card[data-status="review"]      { border-left-color: #d97706; }
.rc-card[data-status="in_review"]   { border-left-color: #d97706; }
.rc-card[data-status="done"]        { border-left-color: #16a34a; }
.rc-card[data-status="complete"]    { border-left-color: #16a34a; }
.rc-card[data-status="approved"]    { border-left-color: #16a34a; }
.rc-card[data-status="signed"]      { border-left-color: #0b6f63; }
.rc-card[data-status="cancelled"]   { border-left-color: #94a3b8; }
.rc-card[data-status="draft"]       { border-left-color: #94a3b8; }
.rc-card[data-status="not_started"] { border-left-color: #cbd5e1; }
.rc-card[data-status="missing"]     { border-left-color: #ef4444; }

/* ── LEFT zone ────────────────────────────────────────────────────────────── */
.rc-card-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 13px 14px 13px 16px;
  min-width: 0;
  border-right: 1px solid var(--line);
  height: 100%;
}
.rc-card-id {
  font-size: .68rem;
  font-family: var(--font-mono);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: .01em;
}
.rc-card-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.rc-card-sub {
  font-size: .75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* ── MID zone ─────────────────────────────────────────────────────────────── */
.rc-card-mid {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 11px 16px;
  min-width: 0;
}
.rc-card-mid-top {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.rc-card-desc {
  font-size: .8rem;
  color: var(--muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
}
.rc-card-meta {
  font-size: .75rem;
  color: var(--muted);
}

/* ── RIGHT zone ───────────────────────────────────────────────────────────── */
.rc-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  padding: 11px 16px 11px 10px;
  flex-shrink: 0;
  border-left: 1px solid var(--line);
  height: 100%;
  font-variant-numeric: tabular-nums lining-nums;
}
.rc-card-date {
  font-size: .8rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  line-height: 1.2;
}
.rc-card-date-lbl {
  font-size: .7rem;
  color: var(--muted);
  white-space: nowrap;
}
.rc-card-date--overdue {
  color: #dc2626;
}
.rc-card-prog {
  display: flex;
  align-items: center;
  gap: 6px;
}
.rc-card-prog-bar {
  width: 64px;
  height: 5px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
}
.rc-card-prog-fill {
  height: 100%;
  background: var(--accent, #3b82f6);
  border-radius: 3px;
}
.rc-card-prog-fill--done {
  background: #16a34a;
}
.rc-card-prog-lbl {
  font-size: .72rem;
  color: var(--muted);
  white-space: nowrap;
}
.rc-card-pct {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
}

/* priority tags */
.rc-prio-tag {
  font-size: .7rem;
  font-weight: 700;
  border-radius: 20px;
  padding: 2px 8px;
  white-space: nowrap;
}
.rc-prio-urgent  { background: rgba(220,38,38,.10); color: #b91c1c; border: 1px solid rgba(220,38,38,.25); }
.rc-prio-high    { background: rgba(217,119,6,.10);  color: #b45309; border: 1px solid rgba(217,119,6,.25); }
.rc-prio-medium  { background: rgba(59,130,246,.10); color: #1d4ed8; border: 1px solid rgba(59,130,246,.25); }
.rc-prio-low     { background: rgba(100,116,139,.10);color: #475569; border: 1px solid rgba(100,116,139,.25); }

/* class tag (MDR device class) */
.rc-class-tag {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .04em;
  border-radius: 5px;
  padding: 2px 7px;
  white-space: nowrap;
  background: #1e3a5f;
  color: #e2e8f0;
}

@media (max-width: 700px) {
  .rc-card { grid-template-columns: 1fr auto; }
  .rc-card-mid { display: none; }
}

/* New / Detail layout */
.call-new-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.5rem;
  align-items: start;
}
.call-script-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  position: sticky;
  top: 18px;
}
.call-script-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}
.call-script-body {
  margin: 0;
  padding: 14px;
  font-size: 12px;
  font-family: inherit;
  color: var(--text);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 420px;
  overflow-y: auto;
}
.call-script-body.hidden { display: none; }

.call-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 24px;
}

.form-section-label {
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 10px;
}

.call-info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text);
}

@media (max-width: 800px) {
  .call-new-grid { grid-template-columns: 1fr; }
  .call-script-panel { position: static; }
  .call-card { grid-template-columns: 1fr auto; }
  .call-card-mid { display: none; }
}

/* ══════════════════════════════════════════════════════════════
   DIÁRIO DIÁRIO  /workspace/journal/
   ══════════════════════════════════════════════════════════════ */

.jrnl-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 28px 32px 20px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.jrnl-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.jrnl-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 18px;
  text-decoration: none;
  transition: background .12s, transform .12s;
}
.jrnl-nav-btn:hover { background: var(--surface); transform: scale(1.08); }

.jrnl-today-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  background: var(--primary);
  color: #fff;
  border-radius: 20px;
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: opacity .12s;
}
.jrnl-today-pill:hover { opacity: .85; }

.jrnl-title-block {
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.jrnl-dow {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.jrnl-date {
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 950;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 0;
  line-height: 1;
}

.jrnl-today-badge {
  font-size: 10px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(11,111,99,0.12);
  color: var(--primary-dark);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.jrnl-future-badge {
  font-size: 10px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(36,87,166,0.10);
  color: #2457a6;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.jrnl-back-link {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.jrnl-back-link:hover { color: var(--ink); }

/* ── Notas incoming ──────────────────────────────────────────── */

.jrnl-incoming {
  margin: 20px 32px 0;
  border: 1.5px solid rgba(251,191,36,0.4);
  border-radius: 14px;
  background: rgba(251,191,36,0.06);
  overflow: hidden;
}

.jrnl-incoming-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #92400e;
  border-bottom: 1px solid rgba(251,191,36,0.25);
  background: rgba(251,191,36,0.08);
}

.jrnl-incoming-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(251,191,36,0.15);
}
.jrnl-incoming-item:last-child { border-bottom: none; }

.jrnl-incoming-meta {
  font-size: 10px;
  font-weight: 800;
  color: #b45309;
  white-space: nowrap;
  padding-top: 2px;
}

.jrnl-incoming-text {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.5;
  white-space: pre-wrap;
}

.jrnl-incoming-del-form { display: flex; align-items: start; }
.jrnl-incoming-del {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--muted);
  padding: 0 2px;
  line-height: 1;
  transition: color .12s;
}
.jrnl-incoming-del:hover { color: #dc2626; }

/* ── Área de escrita ─────────────────────────────────────────── */

.jrnl-body-wrap {
  padding: 20px 32px 0;
}

.jrnl-textarea {
  width: 100%;
  min-height: 320px;
  max-height: 60vh;
  resize: vertical;
  padding: 20px 22px;
  font-size: 15px;
  line-height: 1.7;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}
.jrnl-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11,111,99,0.10);
}

.jrnl-save-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.jrnl-save-status {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.jrnl-save-status.ok  { color: var(--primary-dark); }
.jrnl-save-status.err { color: #dc2626; }

.jrnl-save-btn {
  padding: 8px 18px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: opacity .12s;
}
.jrnl-save-btn:hover { opacity: .85; }

/* ── Deixar nota noutro dia ──────────────────────────────────── */

.jrnl-defer-panel {
  margin: 16px 32px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  overflow: hidden;
}

.jrnl-defer-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.jrnl-defer-summary::-webkit-details-marker { display: none; }
.jrnl-defer-summary:hover { color: var(--ink); }

.jrnl-defer-form {
  padding: 0 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.jrnl-defer-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.jrnl-defer-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.jrnl-defer-date,
.jrnl-defer-textarea {
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  outline: none;
  transition: border-color .12s;
}
.jrnl-defer-date:focus,
.jrnl-defer-textarea:focus { border-color: var(--primary); }
.jrnl-defer-textarea { resize: vertical; }

.jrnl-defer-btn {
  align-self: flex-start;
  padding: 8px 18px;
  background: rgba(11,111,99,0.10);
  color: var(--primary-dark);
  border: 1px solid rgba(11,111,99,0.2);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background .12s;
}
.jrnl-defer-btn:hover { background: rgba(11,111,99,0.18); }

/* ── Mini calendário do mês ──────────────────────────────────── */

.jrnl-month-cal {
  margin: 20px 32px 32px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  max-width: 360px;
}

.jmc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.jmc-title {
  font-size: 13px;
  font-weight: 900;
  color: var(--ink);
}

.jmc-nav {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--muted);
  padding: 2px 6px;
  border-radius: 6px;
  transition: background .1s;
}
.jmc-nav:hover { background: var(--line); color: var(--ink); }

.jmc-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 8px;
  gap: 2px;
}

.jmc-dow {
  text-align: center;
  font-size: 9px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-bottom: 4px;
}

.jmc-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  border-radius: 6px;
  line-height: 1.2;
  min-height: 32px;
  transition: background .1s;
  gap: 1px;
}
.jmc-day:hover { background: var(--line); }

.jmc-today {
  background: rgba(11,111,99,0.10);
  color: var(--primary-dark);
  font-weight: 900;
}
.jmc-current {
  background: var(--primary);
  color: #fff;
  font-weight: 900;
}
.jmc-current:hover { background: var(--primary-dark); }

.jmc-dot {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--primary);
}
.jmc-current .jmc-dot { background: rgba(255,255,255,0.7); }
.jmc-fact-dot {
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: #f59e0b;
  opacity: .7;
}
.jmc-current .jmc-fact-dot { background: rgba(255,220,100,0.8); }

@media (max-width: 700px) {
  .jrnl-header    { padding: 18px 16px 14px; }
  .jrnl-body-wrap { padding: 14px 16px 0; }
  .jrnl-incoming  { margin: 14px 16px 0; }
  .jrnl-defer-panel { margin: 12px 16px 0; }
  .jrnl-month-cal { margin: 14px 16px 24px; max-width: 100%; }
}

/* ══════════════════════════════════════════════════════════════
   JOURNAL — NEW WIDGETS
   ══════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════
   WORKSPACE — ENHANCED
   ══════════════════════════════════════════════════════════════ */

/* ── Stats bar ────────────────────────────────────────────── */
.ws-stats-bar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 14px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  gap: 4px;
}
.ws-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 18px;
}
.ws-stat-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.ws-stat-fire { color: #f97316; }
.ws-stat-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 3px;
}
.ws-stat-trend { font-size: 12px; font-weight: 700; }
.ws-stat-trend.up   { color: #22c55e; }
.ws-stat-trend.down { color: #ef4444; }
.ws-stat-sep {
  width: 1px;
  height: 32px;
  background: var(--line);
  margin: 0 4px;
  flex-shrink: 0;
}
.ws-rate-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.ws-rate-bar {
  width: 80px;
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.ws-rate-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-dark), var(--primary));
  border-radius: 2px;
  transition: width .4s ease;
}
.ws-stats-right {
  margin-left: auto;
}

/* ── Hoje panel ───────────────────────────────────────────── */
.ws-today-panel {
  margin: 16px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.ws-today-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}
.ws-today-icon { font-size: 18px; }
.ws-today-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.ws-today-date {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.ws-today-journal {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: #6d28d9;
  text-decoration: none;
  padding: 4px 12px;
  border: 1.5px solid rgba(109,40,217,0.25);
  border-radius: 20px;
  transition: background .12s;
}
.ws-today-journal:hover { background: rgba(109,40,217,0.08); }
.ws-today-journal-done { color: #16a34a; border-color: rgba(22,163,74,0.25); }
.ws-today-journal-done:hover { background: rgba(22,163,74,0.08); }
.ws-today-empty {
  padding: 18px 20px;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
  margin: 0;
}
.ws-today-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0;
}
.ws-today-col {
  padding: 12px 18px;
  border-right: 1px solid var(--line);
}
.ws-today-col:last-child { border-right: none; }
.ws-today-col-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 8px;
}
.ws-today-overdue-label { color: #dc2626; }
.ws-today-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 0;
  font-size: 12.5px;
  color: var(--text);
  border-bottom: 1px solid var(--line);
}
.ws-today-item:last-child { border-bottom: none; }
.ws-today-item-overdue { color: #dc2626; }
.ws-today-check {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 15px;
  color: var(--primary);
  padding: 0;
  flex-shrink: 0;
  transition: transform .1s;
}
.ws-today-check:hover { transform: scale(1.2); }
.ws-today-check-static {
  font-size: 13px;
  color: var(--muted);
  flex-shrink: 0;
}
.ws-today-item-text { flex: 1; }
.ws-today-item-due {
  font-size: 10px;
  color: #dc2626;
  font-weight: 600;
  flex-shrink: 0;
}
.ws-today-item-link {
  flex: 1;
  color: var(--primary);
  text-decoration: none;
}
.ws-today-item-link:hover { text-decoration: underline; }

/* ── Priority system ──────────────────────────────────────── */
.ws-prio-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ws-prio-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.prio-urgente { background: rgba(220,38,38,0.12);  color: #991b1b; border: 1px solid rgba(220,38,38,0.25); }
.prio-alta    { background: rgba(234,88,12,0.12);  color: #92400e; border: 1px solid rgba(234,88,12,0.25); }
.prio-normal  { background: rgba(100,116,139,0.10); color: var(--muted); border: 1px solid var(--line); }
.prio-baixa   { background: rgba(100,116,139,0.06); color: var(--muted); border: 1px solid var(--line); }

.ws-todo-row { display: flex; align-items: center; gap: 8px; }

.ws-prio-select {
  padding: 6px 8px;
  font-size: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  outline: none;
  cursor: pointer;
}
.ws-prio-select:focus { border-color: var(--primary); }

/* ── Todo filter tabs ─────────────────────────────────────── */
.ws-todo-filter-btns {
  display: flex;
  gap: 2px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px;
}
.ws-tf-btn {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background .1s, color .1s;
}
.ws-tf-btn:hover { color: var(--ink); }
.ws-tf-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* ── Notes controls ───────────────────────────────────────── */
.ws-notes-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ws-note-search {
  padding: 5px 10px;
  font-size: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  outline: none;
  width: 140px;
  transition: border-color .14s, width .2s;
}
.ws-note-search:focus { border-color: var(--primary); width: 180px; }

/* ── Note tag filter ──────────────────────────────────────── */
.ws-note-tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 0 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
.ws-ntf-btn {
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-soft);
  border: 1.5px solid var(--line);
  border-radius: 20px;
  color: var(--muted);
  cursor: pointer;
  transition: background .1s, color .1s, border-color .1s;
}
.ws-ntf-btn:hover { color: var(--ink); background: var(--line); }
.ws-ntf-active {
  background: rgba(11,111,99,0.10);
  border-color: var(--primary);
  color: var(--primary);
}

/* ── Note card enhancements ───────────────────────────────── */
.ws-note-pinned {
  border-left: 3px solid var(--primary) !important;
}
.ws-pin-icon { font-size: 12px; margin-right: 2px; }
.ws-note-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 12px 0;
}
.ws-note-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  background: rgba(11,111,99,0.08);
  border: 1px solid rgba(11,111,99,0.18);
  border-radius: 10px;
  color: var(--primary);
}
.ws-note-form-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 0 2px;
}
.ws-note-tag-check {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text);
  cursor: pointer;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  transition: background .1s, border-color .1s;
}
.ws-note-tag-check:has(input:checked) {
  background: rgba(11,111,99,0.10);
  border-color: var(--primary);
  color: var(--primary);
}
.ws-note-tag-check input { display: none; }

/* ── Note markdown body ───────────────────────────────────── */
.ws-note-body {
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}
.ws-note-body h1 { font-size: 15px; font-weight: 700; margin: 4px 0; color: var(--ink); }
.ws-note-body h2 { font-size: 13px; font-weight: 700; margin: 4px 0; color: var(--ink); }
.ws-note-body p  { margin: 2px 0; }
.ws-note-body ul,.ws-note-body ol { margin: 2px 0 4px 16px; padding: 0; }
.ws-note-body code { font-size: 11.5px; background: var(--line); border-radius: 3px; padding: 1px 4px; color: var(--primary); }
.ws-note-body strong { font-weight: 700; }
.ws-note-body em { font-style: italic; }
.ws-note-body hr { border: none; border-top: 1px solid var(--line); margin: 6px 0; }

/* ══════════════════════════════════════════════════════════════
   QUICK CAPTURE
   ══════════════════════════════════════════════════════════════ */

.qc-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  font-size: 28px;
  font-weight: 300;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(11,111,99,0.35);
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s, box-shadow .15s;
  line-height: 1;
}
.qc-fab:hover {
  transform: scale(1.10) rotate(45deg);
  box-shadow: 0 10px 28px rgba(11,111,99,0.45);
}

.qc-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.30);
  backdrop-filter: blur(2px);
  z-index: 810;
}
.qc-modal {
  position: fixed;
  bottom: 94px;
  right: 28px;
  width: 340px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  z-index: 820;
  overflow: hidden;
  animation: qc-pop .15s ease;
}
@keyframes qc-pop {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}
.qc-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}
.qc-tab {
  flex: 1;
  padding: 10px;
  font-size: 12.5px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color .1s, background .1s;
}
.qc-tab:hover { color: var(--ink); }
.qc-tab-active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: inset 0 -2px 0 var(--primary);
}
.qc-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.qc-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  outline: none;
  transition: border-color .14s;
}
.qc-input:focus { border-color: var(--primary); }
.qc-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  outline: none;
  resize: vertical;
  transition: border-color .14s;
}
.qc-textarea:focus { border-color: var(--primary); }
.qc-row {
  display: flex;
  gap: 8px;
}
.qc-date {
  flex: 1;
  padding: 6px 10px;
  font-size: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  outline: none;
}
.qc-select {
  flex: 1;
  padding: 6px 8px;
  font-size: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  outline: none;
  cursor: pointer;
}
.qc-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 2px;
}
.qc-cancel {
  padding: 6px 14px;
  font-size: 12.5px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  cursor: pointer;
  transition: background .1s;
}
.qc-cancel:hover { background: var(--line); color: var(--ink); }
.qc-save {
  padding: 6px 18px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  transition: opacity .12s;
}
.qc-save:hover { opacity: .85; }

/* ── Row 1: Editor + Context side-by-side ─────────────────── */
.jrnl-row1 {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 16px;
  padding: 0 28px 16px;
}
@media (max-width: 900px) {
  .jrnl-row1 { grid-template-columns: 1fr; padding: 0 16px 12px; }
}

/* ── Toolbar ──────────────────────────────────────────────── */
.jrnl-editor-wrap { display: flex; flex-direction: column; }

.jrnl-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  flex-wrap: wrap;
}

.jrnl-tb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  font-size: 12px;
  font-family: var(--font-mono, monospace);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--text);
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
  white-space: nowrap;
}
.jrnl-tb-btn:hover {
  background: var(--line);
  color: var(--ink);
  border-color: var(--line);
}
.jrnl-tb-btn:active {
  background: var(--primary);
  color: #fff;
}
.jrnl-tb-sep {
  width: 1px;
  height: 18px;
  background: var(--line);
  margin: 0 4px;
  flex-shrink: 0;
}
.jrnl-tb-sep-grow {
  width: auto;
  flex: 1;
  background: transparent;
}

/* Preview toggle button */
.jrnl-tb-preview-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-soft);
  border: 1.5px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
  white-space: nowrap;
  flex-shrink: 0;
}
.jrnl-tb-preview-btn:hover {
  background: var(--line);
  color: var(--ink);
}
.jrnl-tb-preview-active {
  background: rgba(109,40,217,0.10) !important;
  border-color: #6d28d9 !important;
  color: #6d28d9 !important;
}

/* Preview rendered area */
.jrnl-preview {
  flex: 1;
  min-height: 260px;
  padding: 14px 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 0 0 10px 10px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
  overflow-y: auto;
}
.jrnl-preview h1 {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--line);
}
.jrnl-preview h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin: 14px 0 4px;
}
.jrnl-preview p { margin: 0 0 4px; }
.jrnl-preview ul,
.jrnl-preview ol {
  margin: 4px 0 8px 20px;
  padding: 0;
}
.jrnl-preview li { margin-bottom: 2px; }
.jrnl-preview hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 12px 0;
}
.jrnl-preview strong { font-weight: 700; color: var(--ink); }
.jrnl-preview em     { font-style: italic; }
.jrnl-preview del    { color: var(--muted); text-decoration: line-through; }
.jrnl-preview code {
  font-family: var(--font-mono, monospace);
  font-size: 12.5px;
  background: var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--primary);
}
.jrnl-preview a {
  color: var(--primary);
  text-decoration: underline;
}
.jrnl-preview .jrnl-preview-empty {
  color: var(--muted);
  font-style: italic;
}

/* Override .jrnl-body-wrap top radius when toolbar present */
.jrnl-editor-wrap .jrnl-textarea {
  border-radius: 0 0 10px 10px;
  min-height: 260px;
}
.jrnl-editor-wrap .jrnl-body-wrap { padding: 0; }
.jrnl-editor-wrap form { display: flex; flex-direction: column; }

/* ── Context panel ────────────────────────────────────────── */
.jrnl-ctx-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-self: start;
}

.jrnl-ctx-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.jrnl-ctx-icon { font-size: 16px; }
.jrnl-ctx-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: .02em;
}
.jrnl-ctx-empty {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  margin: 0;
}

.jrnl-ctx-section { display: flex; flex-direction: column; gap: 5px; }
.jrnl-ctx-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #2d9e8e;
}
.jrnl-ctx-item {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 12.5px;
  color: #a7f3d0;
  line-height: 1.4;
}
.jrnl-ctx-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}
.jrnl-ctx-link {
  color: #34d399;
  text-decoration: none;
}
.jrnl-ctx-link:hover { text-decoration: underline; }

/* ── Row 2: Widget row ────────────────────────────────────── */
.jrnl-widgets-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 0 28px 16px;
}
@media (max-width: 900px) {
  .jrnl-widgets-row { grid-template-columns: 1fr; padding: 0 16px 12px; }
}

.jrnl-widget {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.jrnl-widget-head {
  display: flex;
  align-items: center;
  gap: 7px;
}
.jrnl-widget-icon { font-size: 16px; }
.jrnl-widget-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  flex: 1;
}
.jrnl-widget-sub {
  font-size: 11px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 2px 8px;
}
.jrnl-widget-limit {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
  margin: 0;
}

/* ── Top 3 list ───────────────────────────────────────────── */
.jrnl-top3-list { display: flex; flex-direction: column; gap: 4px; }
.jrnl-top3-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 7px;
  background: var(--surface-soft);
  font-size: 13px;
  color: var(--text);
  transition: background .1s;
}
.jrnl-top3-item:hover { background: var(--line); }
.jrnl-top3-done .jrnl-top3-text {
  text-decoration: line-through;
  color: var(--muted);
}

.jrnl-check-btn {
  font-size: 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--primary);
  padding: 0;
  flex-shrink: 0;
  line-height: 1;
  transition: transform .1s;
}
.jrnl-check-btn:hover { transform: scale(1.15); }
.jrnl-top3-text { flex: 1; line-height: 1.3; }

.jrnl-del-btn {
  font-size: 16px;
  line-height: 1;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 0;
  flex-shrink: 0;
  transition: color .1s, transform .1s;
}
.jrnl-del-btn:hover { color: var(--danger); transform: scale(1.15); }

/* ── Add row (shared) ─────────────────────────────────────── */
.jrnl-add-form,
.jrnl-tlog-form {
  display: flex;
  gap: 6px;
  align-items: center;
}
.jrnl-add-input {
  flex: 1;
  padding: 6px 10px;
  font-size: 12.5px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  outline: none;
  transition: border-color .14s;
}
.jrnl-add-input:focus { border-color: var(--primary); }
.jrnl-add-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity .12s, transform .12s;
}
.jrnl-add-btn:hover { opacity: .85; transform: scale(1.07); }

/* ── Time log ─────────────────────────────────────────────── */
.jrnl-tlog-list { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.jrnl-tlog-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 7px;
  background: var(--surface-soft);
  font-size: 12.5px;
  color: var(--text);
}
.jrnl-tlog-time {
  font-weight: 700;
  color: var(--primary);
  font-size: 12px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.jrnl-tlog-text { flex: 1; line-height: 1.3; }
.jrnl-tlog-time-input {
  padding: 5px 8px;
  font-size: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  outline: none;
  width: 84px;
  flex-shrink: 0;
  transition: border-color .14s;
}
.jrnl-tlog-time-input:focus { border-color: var(--primary); }

/* ── Energy ───────────────────────────────────────────────── */
.jrnl-energy-section,
.jrnl-tags-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.jrnl-energy-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}
.jrnl-energy-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.jrnl-energy-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  background: var(--surface-soft);
  border: 1.5px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  transition: background .12s, border-color .12s, transform .1s;
  flex: 1;
}
.jrnl-energy-btn:hover {
  background: var(--line);
  transform: translateY(-1px);
}
.jrnl-energy-active {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  border-color: var(--primary);
  box-shadow: 0 3px 10px rgba(11,111,99,0.20);
}
.jrnl-energy-active .jrnl-energy-name { color: #fff; }
.jrnl-energy-emoji { font-size: 18px; line-height: 1; }
.jrnl-energy-name {
  font-size: 9px;
  color: var(--muted);
  font-weight: 600;
  text-transform: lowercase;
  letter-spacing: .02em;
}

/* ── Tags ─────────────────────────────────────────────────── */
.jrnl-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.jrnl-tag-btn {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-soft);
  border: 1.5px solid var(--line);
  border-radius: 20px;
  color: var(--muted);
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s, transform .1s;
}
.jrnl-tag-btn:hover {
  background: var(--line);
  color: var(--ink);
  transform: translateY(-1px);
}
.jrnl-tag-active {
  background: rgba(11,111,99,0.12);
  border-color: var(--primary);
  color: var(--primary);
}

/* ── Reflection ───────────────────────────────────────────── */
.jrnl-reflection {
  margin: 0 28px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.jrnl-reflection-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  user-select: none;
  transition: background .12s;
}
.jrnl-reflection-summary::-webkit-details-marker { display: none; }
.jrnl-reflection-summary:hover { background: var(--surface-soft); }
.jrnl-refl-icon { font-size: 16px; }
.jrnl-refl-chevron {
  margin-left: auto;
  font-size: 18px;
  color: var(--muted);
  transition: transform .2s;
}
.jrnl-reflection[open] .jrnl-refl-chevron { transform: rotate(90deg); }

.jrnl-refl-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 4px 18px 18px;
  border-top: 1px solid var(--line);
}
@media (max-width: 900px) {
  .jrnl-refl-grid { grid-template-columns: 1fr; }
}
.jrnl-refl-field { display: flex; flex-direction: column; gap: 6px; }
.jrnl-refl-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.jrnl-refl-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  resize: vertical;
  outline: none;
  line-height: 1.5;
  transition: border-color .14s;
}
.jrnl-refl-textarea:focus { border-color: var(--primary); }

/* ── Tools row: Pomodoro + Checklist ─────────────────────── */
.jrnl-tools-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 0 28px 16px;
}
@media (max-width: 900px) {
  .jrnl-tools-row { grid-template-columns: 1fr; padding: 0 16px 12px; }
}

/* ── Pomodoro ─────────────────────────────────────────────── */
.jrnl-pomodoro { align-items: center; }

.pomo-presets {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  width: 100%;
  justify-content: center;
}
.pomo-preset {
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--surface-soft);
  border: 1.5px solid var(--line);
  border-radius: 20px;
  color: var(--muted);
  cursor: pointer;
  transition: background .1s, border-color .1s, color .1s;
}
.pomo-preset:hover { background: var(--line); color: var(--ink); }
.pomo-preset-active {
  background: rgba(239,68,68,0.10);
  border-color: #ef4444;
  color: #ef4444;
}
.pomo-custom {
  width: 52px;
  padding: 4px 8px;
  font-size: 11.5px;
  background: var(--surface-soft);
  border: 1.5px solid var(--line);
  border-radius: 20px;
  color: var(--text);
  text-align: center;
  outline: none;
}
.pomo-custom:focus { border-color: var(--primary); }

/* Ring timer */
.pomo-display {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 6px auto;
  flex-shrink: 0;
}
.pomo-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.pomo-ring-bg {
  fill: none;
  stroke: var(--line);
  stroke-width: 8;
}
.pomo-ring-fill {
  fill: none;
  stroke: #ef4444;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset .5s linear;
}
.pomo-time-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.pomo-time {
  font-size: 28px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.pomo-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: lowercase;
}

.pomo-controls {
  display: flex;
  gap: 8px;
  justify-content: center;
  width: 100%;
}
.pomo-btn {
  padding: 7px 20px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: opacity .12s, transform .1s;
}
.pomo-btn:hover { opacity: .85; transform: translateY(-1px); }
.pomo-start {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: #fff;
  flex: 1;
}
.pomo-reset {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 16px;
  padding: 7px 14px;
}

/* ── Closing checklist ────────────────────────────────────── */
.closing-progress-bar {
  width: 100%;
  height: 5px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}
.closing-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-dark), var(--primary));
  border-radius: 3px;
  transition: width .3s ease;
}
.closing-complete {
  font-size: 12px;
  font-weight: 600;
  color: #16a34a;
  text-align: center;
  padding: 4px 0 2px;
}
.closing-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
}
.closing-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 7px;
  background: var(--surface-soft);
  transition: background .1s;
}
.closing-item:hover { background: var(--line); }
.closing-item-done .closing-text {
  text-decoration: line-through;
  color: var(--muted);
}
.closing-check {
  font-size: 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--primary);
  padding: 0;
  flex-shrink: 0;
  line-height: 1;
  transition: transform .1s;
}
.closing-check:hover { transform: scale(1.15); }
.closing-text {
  font-size: 12.5px;
  color: var(--text);
  flex: 1;
}

/* Summary */
.closing-summary-btn {
  width: 100%;
  margin-top: 6px;
  padding: 8px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--surface-soft);
  border: 1.5px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.closing-summary-btn:hover {
  background: rgba(11,111,99,0.06);
  border-color: var(--primary);
  color: var(--primary);
}
.closing-summary-output {
  width: 100%;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.closing-summary-text {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text);
  white-space: pre-wrap;
  line-height: 1.6;
  max-height: 220px;
  overflow-y: auto;
  font-family: var(--font-mono, monospace);
}
.closing-copy-btn {
  align-self: flex-end;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  transition: opacity .12s;
}
.closing-copy-btn:hover { opacity: .85; }

/* ── Bottom row: defer + mini cal ────────────────────────── */
.jrnl-bottom-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 0 28px 32px;
  align-items: start;
}
@media (max-width: 900px) {
  .jrnl-bottom-row { grid-template-columns: 1fr; padding: 0 16px 24px; }
}

@media (max-width: 700px) {
  .jrnl-row1,
  .jrnl-widgets-row,
  .jrnl-reflection,
  .jrnl-bottom-row  { padding-left: 16px; padding-right: 16px; }
  .jrnl-reflection  { margin-left: 16px; margin-right: 16px; }
}

/* ══════════════════════════════════════════════════════════════
   TEMAS: dim + noite
   Aplicados via data-theme="dim" ou data-theme="night" no <html>
   ══════════════════════════════════════════════════════════════ */

/* ── Dim (acinzentado / slate) ────────────────────────────────── */
[data-theme="dim"] {
  --bg:           #1e2430;
  --surface:      #252d3a;
  --surface-soft: #1a2030;
  --text:         #c8d0dc;
  --muted:        #6b7a92;
  --line:         #2e3848;
  --ink:          #e8edf4;
  --primary:      #10a090;
  --primary-dark: #0b7a6e;
  --accent:       #e09a4a;
  --blue:         #4a7fd4;
  --error-bg:     #3a1c1c;
  --error-text:   #f87171;
  --ok-bg:        #1a3028;
  --ok-text:      #4ade80;
  --warn-bg:      #2e2010;
  --warn-text:    #fbbf24;
  --danger:       #f87171;
  --success:      #4ade80;
  --warning:      #fbbf24;
}

[data-theme="dim"] body {
  background: linear-gradient(180deg, #1a2030 0, #1e2430 300px), #1e2430;
}

[data-theme="dim"] .side-nav {
  background:
    linear-gradient(180deg, rgba(37,45,58,0.98), rgba(30,36,48,0.95)),
    radial-gradient(circle at 0% 0%, rgba(16,160,144,0.10), transparent 34%),
    radial-gradient(circle at 100% 16%, rgba(16,160,144,0.08), transparent 30%);
  border-color: rgba(46,56,72,0.9);
  box-shadow: 0 24px 70px rgba(0,0,0,0.35);
}

[data-theme="dim"] .side-nav-link {
  color: #b0baca;
}
[data-theme="dim"] .side-nav-link:hover {
  background: rgba(16,160,144,0.08);
  color: #10a090;
}
[data-theme="dim"] .side-nav-link.active {
  background: linear-gradient(135deg, #0d1e1c, #0b7a6e 55%, #10a090);
}

/* ── Night (preto / escuro total) ────────────────────────────── */
[data-theme="night"] {
  --bg:           #0a0c10;
  --surface:      #111318;
  --surface-soft: #0d0f14;
  --text:         #b8c0cc;
  --muted:        #52606e;
  --line:         #1c2028;
  --ink:          #e2e8f0;
  --primary:      #14b8a6;
  --primary-dark: #0d9488;
  --accent:       #f59e0b;
  --blue:         #60a5fa;
  --error-bg:     #2d0e0e;
  --error-text:   #fc8181;
  --ok-bg:        #0d2218;
  --ok-text:      #68d391;
  --warn-bg:      #221508;
  --warn-text:    #fcd34d;
  --danger:       #fc8181;
  --success:      #68d391;
  --warning:      #fcd34d;
}

[data-theme="night"] body {
  background: #0a0c10;
}

[data-theme="night"] .side-nav {
  background:
    linear-gradient(180deg, rgba(17,19,24,0.99), rgba(11,13,18,0.98)),
    radial-gradient(circle at 0% 0%, rgba(20,184,166,0.08), transparent 34%),
    radial-gradient(circle at 100% 16%, rgba(20,184,166,0.06), transparent 30%);
  border-color: rgba(28,32,40,0.9);
  box-shadow: 0 24px 70px rgba(0,0,0,0.50);
}

[data-theme="night"] .side-nav-link {
  color: #a0aab8;
}
[data-theme="night"] .side-nav-link:hover {
  background: rgba(20,184,166,0.08);
  color: #14b8a6;
}
[data-theme="night"] .side-nav-link.active {
  background: linear-gradient(135deg, #060e0d, #0d9488 55%, #14b8a6);
  box-shadow: 0 12px 30px rgba(20,184,166,0.20);
}

/* ── Dim/Night: hero e dashboard ─────────────────────────────── */
[data-theme="dim"] .db-hero,
[data-theme="night"] .db-hero {
  background: linear-gradient(135deg, #060c14 0%, #0e1e30 45%, #0a1e16 100%);
}

/* ── Dim/Night: domain cards ─────────────────────────────────── */
[data-theme="dim"] .dc,
[data-theme="night"] .dc {
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);
}

/* ══════════════════════════════════════════════════════════════
   SPOTLIGHT — busca global
   ══════════════════════════════════════════════════════════════ */

/* Sidebar trigger button */
.side-spotlight-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 8px 0 0;
  padding: 7px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  text-align: left;
  transition: background .12s, border-color .12s, color .12s;
  box-sizing: border-box;
}
.side-spotlight-btn:hover {
  background: var(--line);
  border-color: var(--primary);
  color: var(--ink);
}
.sp-trigger-icon { font-size: 13px; flex-shrink: 0; }
.sp-trigger-label { flex: 1; }
.sp-trigger-kbd {
  font-size: 10px;
  font-family: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--muted);
  flex-shrink: 0;
}

/* Backdrop */
.sp-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(3px);
  z-index: 900;
  animation: sp-fade-in .12s ease;
}

/* Modal */
.sp-modal {
  position: fixed;
  top: 14vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(640px, 92vw);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.04) inset;
  z-index: 901;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: sp-slide-in .14s ease;
}

@keyframes sp-fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes sp-slide-in { from { opacity: 0; transform: translateX(-50%) translateY(-8px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* Input row */
.sp-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.sp-search-icon { font-size: 17px; flex-shrink: 0; }
.sp-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 16px;
  color: var(--ink);
  font-family: inherit;
}
.sp-input::placeholder { color: var(--muted); }
.sp-esc-hint {
  font-size: 10px;
  font-family: inherit;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 7px;
  color: var(--muted);
  flex-shrink: 0;
}

/* Results list */
.sp-results {
  max-height: 360px;
  overflow-y: auto;
  padding: 6px;
}
.sp-empty {
  padding: 20px 16px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
.sp-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  transition: background .08s;
  cursor: pointer;
}
.sp-item:hover,
.sp-item-active {
  background: rgba(11,111,99,0.10);
}
.sp-item-icon {
  font-size: 17px;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}
.sp-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.sp-item-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sp-item-sub {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sp-item-type {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 2px 8px;
  flex-shrink: 0;
}

/* Footer */
.sp-footer {
  display: flex;
  gap: 16px;
  padding: 8px 16px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  background: var(--surface-soft);
}
.sp-footer kbd {
  display: inline-block;
  font-family: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 10px;
  color: var(--text);
}

/* ── Theme switcher button ───────────────────────────────────── */
.theme-switcher {
  display: flex;
  align-items: center;
  gap: 3px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 3px;
}

.theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  transition: background .12s, transform .12s;
  color: var(--muted);
}
.theme-btn:hover { background: var(--line); transform: scale(1.10); }
.theme-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.20);
}

/* ══════════════════════════════════════════════════════════════════════════
   SDS Module — filtros, badges, clone, categorias, notas internas
   ════════════════════════════════════════════════════════════════════════ */

/* ── Metric card warn ──────────────────────────────────────────────────── */
.metric-card-warn {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #78350f;
}
.metric-card-warn strong { color: #92400e; }

/* ── Filter bar ────────────────────────────────────────────────────────── */
.sds-filter-bar {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  margin-bottom: 1.5rem;
  padding: .9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: .6rem;
}
.sds-search-input {
  width: 100%;
  padding: .5rem .75rem;
  border: 1px solid var(--line);
  border-radius: .4rem;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 14px;
}
.sds-search-input:focus { outline: none; border-color: var(--primary); }
.sds-filter-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem;
}
.sds-filter-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  margin-right: .2rem;
}
.sds-fpill {
  display: inline-block;
  padding: .25rem .65rem;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  text-decoration: none;
  transition: background .12s, color .12s, border-color .12s;
  white-space: nowrap;
}
.sds-fpill:hover { background: var(--line); color: var(--text); }
.sds-fpill-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ── Issue badge (in card) ─────────────────────────────────────────────── */
.sds-issue-badge {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: 12.5px;
  color: var(--muted);
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: .35rem;
  padding: .3rem .65rem;
  margin-bottom: .55rem;
}
.sds-issue-icon { font-size: 13px; }
.sds-issue-by {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted);
}

/* ── Category badge ────────────────────────────────────────────────────── */
.sds-category-badge {
  display: inline-block;
  padding: .15rem .55rem;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: #ede9fe;
  color: #5b21b6;
  border: 1px solid #ddd6fe;
}

/* ── Stale badge ───────────────────────────────────────────────────────── */
.sds-stale-badge {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* ── Stale table row ───────────────────────────────────────────────────── */
.sds-row-stale { background: #fffbeb !important; }

/* ── Internal notes (view_product) ────────────────────────────────────── */
.int-notes-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.int-note-item {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: .4rem;
  padding: .55rem .85rem;
}
.int-note-body {
  font-size: 14px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.int-note-meta {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-top: .3rem;
  font-size: 11.5px;
  color: var(--muted);
}
.int-note-del-btn {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  padding: 1px 4px;
  border-radius: 3px;
  transition: background .12s, color .12s;
}
.int-note-del-btn:hover { background: #fee2e2; color: #dc2626; }
.int-note-add-form {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-top: .5rem;
}
.int-note-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: .5rem .75rem;
  border: 1px solid var(--line);
  border-radius: .4rem;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  resize: vertical;
}
.int-note-textarea:focus { outline: none; border-color: var(--primary); }
.int-note-actions { display: flex; justify-content: flex-end; }
.int-note-save {
  padding: .4rem .95rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: .35rem;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s;
}
.int-note-save:hover { background: var(--primary-dark); }

/* ── Bulk Import ──────────────────────────────────────────────────────────── */
.bulk-upload-form { display: flex; flex-direction: column; gap: 2rem; }

.bulk-drop-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  position: relative;
  background: var(--surface-2, #f7f9fb);
}
.bulk-drop-zone:hover,
.bulk-drop-zone.bulk-drop-hover  { border-color: var(--primary); background: var(--primary-tint, #eaf5f3); }
.bulk-drop-zone.bulk-drop-active { border-color: var(--primary); border-style: solid; }

.bulk-drop-icon  { font-size: 2.5rem; margin-bottom: .5rem; }
.bulk-drop-label { font-size: 1.1rem; font-weight: 600; color: var(--text); margin: 0; }
.bulk-drop-sub   { font-size: .9rem; color: var(--muted); margin: .25rem 0 .75rem; }
.bulk-file-input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer;
}
.bulk-filename { font-size: .85rem; color: var(--primary); font-weight: 500; }

.bulk-format-hint { background: var(--surface-2, #f7f9fb); border-radius: 8px; padding: 1.25rem 1.5rem; }
.bulk-format-hint .eyebrow { margin-bottom: .5rem; }
.bulk-cols-table { font-size: .8rem; margin-bottom: .75rem; }
.bulk-cols-table th, .bulk-cols-table td { padding: .3rem .5rem; white-space: nowrap; }

.bulk-submit-row {
  display: flex; align-items: center; gap: 1rem;
  padding-top: .5rem;
}
.bulk-confirm-form { margin-top: 1.5rem; }

/* ── Compliance Calendar ──────────────────────────────────────────────────── */
.cal-table th, .cal-table td { vertical-align: middle; }

.cal-row-overdue  { background: rgba(220,38,38,.05); }
.cal-row-critical { background: rgba(180,83,9,.05);  }
.cal-row-warning  { background: rgba(202,138,4,.04); }

.cal-badge {
  display: inline-block;
  font-size: .78rem; font-weight: 600;
  padding: .18rem .55rem; border-radius: 999px;
  white-space: nowrap;
}
.cal-badge-overdue  { background: #fee2e2; color: #991b1b; }
.cal-badge-critical { background: #ffedd5; color: #92400e; }
.cal-badge-warning  { background: #fef9c3; color: #854d0e; }
.cal-badge-ok       { background: #dcfce7; color: #14532d; }

.cal-module-chip {
  display: inline-block;
  font-size: .75rem; font-weight: 600;
  padding: .15rem .5rem; border-radius: 4px;
  background: var(--surface-2, #f1f5f9);
  color: var(--muted);
}
.cal-module-sds        { background: #e0f2fe; color: #0369a1; }
.cal-module-cpsr       { background: #f0fdf4; color: #15803d; }
.cal-module-pif        { background: #fdf4ff; color: #7e22ce; }
.cal-module-mdr        { background: #fdf2f8; color: #9d174d; }
.cal-module-substances { background: #fff7ed; color: #c2410c; }
.cal-module-compliance { background: #f0f9ff; color: #0369a1; }

.cal-rule { max-width: 220px; font-size: .82rem; }

.cal-days { font-size: .85rem; font-weight: 600; color: var(--text); }
.cal-days-overdue { color: #dc2626; }

.cal-pill-overdue  { border-color: #dc2626 !important; color: #dc2626 !important; }
.cal-pill-critical { border-color: #b45309 !important; color: #b45309 !important; }
.cal-pill-warning  { border-color: #ca8a04 !important; color: #854d0e !important; }

.metric-card-danger {
  border-top: 3px solid #dc2626;
}
.metric-card-danger strong { color: #dc2626; }

/* ── Journal Timestamped Entries ─────────────────────────────────────────── */
.jrnl-entries { display: flex; flex-direction: column; gap: .75rem; }

.jrnl-entry {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  transition: box-shadow .15s;
}
.jrnl-entry:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-tint, rgba(11,111,99,.12));
}

.jrnl-entry-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .65rem;
  background: var(--surface-2, #f7f9fb);
  border-bottom: 1px solid var(--border);
  min-height: 2rem;
}

.jrnl-entry-ts {
  font-size: .78rem;
  font-weight: 600;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  flex: 1;
}

.jrnl-entry-status {
  font-size: .75rem;
  font-weight: 600;
  min-width: 1.5rem;
  text-align: right;
  color: var(--muted);
}
.jrnl-entry-status.ok  { color: #059669; }
.jrnl-entry-status.err { color: #dc2626; }

.jrnl-entry-del {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 1rem; line-height: 1;
  padding: .1rem .3rem; border-radius: 4px;
  transition: color .12s, background .12s;
}
.jrnl-entry-del:hover { color: #dc2626; background: #fee2e2; }

.jrnl-entry .jrnl-textarea {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  min-height: 80px;
  resize: vertical;
}

.jrnl-entry-legacy { opacity: .7; }
.jrnl-entry-legacy .jrnl-entry-ts { color: var(--muted); }
.jrnl-entry-legacy-body {
  padding: .75rem 1rem;
  font-size: .93rem;
  white-space: pre-wrap;
  color: var(--text);
}

.jrnl-entries-bar {
  justify-content: space-between;
  margin-top: .25rem;
}

.jrnl-add-entry-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: .45rem 1rem;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s;
}
.jrnl-add-entry-btn:hover { background: var(--primary-dark, #064d45); }

/* ── Journal structured notes panel ─────────────────────────────────────── */
.jrnl-entries-panel {
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 14px;
  margin: 0 0 1.25rem;
  overflow: hidden;
}

.jrnl-entries-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1.1rem .7rem;
  border-bottom: 1px solid var(--line, #e2e8f0);
  flex-wrap: wrap;
}

.jrnl-entries-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--ink, #1e293b);
  flex: none;
}

.jrnl-entries-meta {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex: 1;
  flex-wrap: wrap;
}

.jrnl-entries-done-label {
  font-size: .8rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  background: rgba(22,163,74,.1);
}

.jrnl-entries-type-pill {
  font-size: .75rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 20px;
}

.jrnl-entries-add-btn {
  margin-left: auto;
  flex: none;
  background: var(--accent, #3b82f6);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: .35rem .85rem;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s;
}
.jrnl-entries-add-btn:hover { background: #2563eb; }

/* Segmented bar */
.jrnl-entries-bar-wrap {
  height: 5px;
  background: var(--surface-2, #f1f5f9);
  display: flex;
  overflow: hidden;
}
.jrnl-bar-seg {
  height: 100%;
  transition: width .3s;
}

/* Table */
.jrnl-entries-table {
  display: flex;
  flex-direction: column;
}

.jrnl-entries-thead {
  display: grid;
  grid-template-columns: 40px 1fr 56px 32px;
  padding: .35rem 1rem .3rem;
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted, #94a3b8);
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1px solid var(--line, #e2e8f0);
  background: var(--surface-2, #f8fafc);
}

.jrnl-entry-row {
  display: grid;
  grid-template-columns: 40px 1fr 56px 32px;
  align-items: center;
  padding: .45rem 1rem;
  border-bottom: 1px solid var(--line, #e2e8f0);
  border-left: 3px solid transparent;
  transition: background .12s, border-left-color .2s, opacity .25s, transform .25s;
  gap: .4rem;
}
.jrnl-entry-row:last-child { border-bottom: none; }
.jrnl-entry-row:hover { background: var(--surface-soft, rgba(0,0,0,.02)); }

.jrnl-entry-new {
  animation: entrySlideIn .25s ease;
}
@keyframes entrySlideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.jrnl-entry-removing {
  opacity: 0; transform: translateX(8px);
}

/* Type badge button */
.jrnl-et-type-btn {
  width: 28px; height: 28px;
  border-radius: 7px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: transform .1s, box-shadow .1s;
  padding: 0;
}
.jrnl-et-type-btn:hover { transform: scale(1.12); box-shadow: 0 2px 6px rgba(0,0,0,.12); }

/* Text cell */
.jrnl-et-text {
  font-size: .9rem;
  color: var(--ink, #1e293b);
  outline: none;
  border-radius: 4px;
  padding: 2px 4px;
  min-height: 1.4em;
  word-break: break-word;
  transition: background .1s;
  cursor: text;
}
.jrnl-et-text:focus {
  background: var(--surface-2, #f1f5f9);
  box-shadow: 0 0 0 2px rgba(59,130,246,.25);
}
.jrnl-et-text:empty::before {
  content: attr(data-placeholder, 'Escrever nota…');
  color: var(--muted, #94a3b8);
  pointer-events: none;
}

/* Time cell */
.jrnl-et-time {
  font-size: .75rem;
  color: var(--muted, #94a3b8);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

/* Delete button */
.jrnl-et-del {
  background: none; border: none; cursor: pointer;
  font-size: 1rem; color: var(--muted, #94a3b8);
  border-radius: 5px; padding: 2px 5px;
  transition: color .1s, background .1s;
  line-height: 1;
}
.jrnl-et-del:hover { color: #dc2626; background: #fee2e2; }

/* Empty state */
.jrnl-entries-empty {
  padding: 1.8rem 1.25rem;
  text-align: center;
  color: var(--muted, #94a3b8);
  font-size: .87rem;
}

/* Type picker popup */
.jrnl-type-picker {
  position: absolute;
  z-index: 9000;
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.14);
  padding: .5rem;
  display: flex;
  gap: .3rem;
  flex-direction: column;
  min-width: 130px;
}
.jrnl-type-picker.hidden { display: none; }

.jrnl-type-opt {
  display: flex; align-items: center; gap: .5rem;
  border: none; border-radius: 7px;
  padding: .35rem .6rem;
  cursor: pointer;
  font-size: .85rem; font-weight: 600;
  text-align: left;
  transition: filter .1s, transform .08s;
}
.jrnl-type-opt:hover { filter: brightness(.93); transform: translateX(2px); }

.jrnl-type-opt-label {
  font-size: .8rem;
}

/* ── Progress strip (above CE) ──────────────────────────────────────────── */
.jrnl-progress-strip {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .4rem .9rem;
  border-bottom: 1px solid var(--line, #e2e8f0);
  background: var(--surface-2, #f8fafc);
}

.jrnl-progress-segs {
  display: flex;
  flex: 1;
  height: 7px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--line, #e2e8f0);
  gap: 1px;
}

.jrnl-progress-segs > div {
  transition: flex .3s ease;
}

.jrnl-progress-label {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.jrnl-prog-done {
  font-variant-numeric: tabular-nums;
}

.jrnl-prog-pill {
  font-size: .72rem;
  padding: 1px 5px;
  border-radius: 10px;
  font-weight: 700;
}

/* ── Journal contenteditable + inline timestamps ─────────────────────────── */
.jrnl-ce {
  min-height: 200px;
  outline: none;
  white-space: pre-wrap;
  word-break: break-word;
}
/* Each paragraph is a table row */
.jrnl-ce p {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0;
  padding: .32rem .75rem;
  border-bottom: 1px solid var(--line, #e2e8f0);
  min-height: 38px;
  line-height: 1.5;
  transition: background .1s;
}
.jrnl-ce p:last-child { border-bottom: none; }
.jrnl-ce p:hover { background: var(--surface-soft, rgba(0,0,0,.02)); }

.jrnl-ce:empty::before,
.jrnl-ce.jrnl-ce-empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
  pointer-events: none;
  position: absolute;
  padding: .75rem;
}
.jrnl-ce-empty { position: relative; }

/* Timestamp — pushed to the right */
.jrnl-ts {
  order: 3;
  margin-left: auto;
  flex: none;
  font-size: .7rem;
  font-weight: 600;
  color: var(--muted, #94a3b8);
  background: var(--surface-2, rgba(0,0,0,.04));
  padding: .05rem .4rem;
  border-radius: 4px;
  user-select: none;
  cursor: default;
  letter-spacing: .02em;
  white-space: nowrap;
}

/* ── Journal ticket/status badge ─────────────────────────────────────────── */
.jrnl-status {
  order: -1;        /* always first in the flex row */
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 700;
  min-width: 82px;
  padding: .18rem .5rem;
  border-radius: 5px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: filter .12s, transform .08s;
  border: none;
}
.jrnl-status:hover { filter: brightness(.9); transform: scale(1.03); }

/* Status colour overrides (inline style takes priority for individual colour;
   these are fallbacks for older saved content without inline style) */
.st-none { color: #94a3b8; background: rgba(148,163,184,.15); }
.st-ok   { color: #16a34a; background: rgba(22,163,74,.12);   }
.st-q    { color: #b58a00; background: rgba(181,138,0,.12);   }
.st-warn { color: #c95c00; background: rgba(201,92,0,.12);    }
.st-idea { color: #1a6fb3; background: rgba(26,111,179,.12);  }
.st-no   { color: #c0392b; background: rgba(192,57,43,.12);   }

/* ── Ticket type picker (dropdown) ─────────────────────────────────────── */
.jrnl-st-picker {
  position: absolute;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding: .4rem;
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.14);
  min-width: 130px;
}
.jrnl-st-picker.hidden { display: none; }

.jrnl-st-opt {
  display: block;
  width: 100%;
  text-align: left;
  font-size: .8rem;
  font-weight: 700;
  padding: .32rem .65rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: filter .1s, transform .08s;
  white-space: nowrap;
}
.jrnl-st-opt:hover { filter: brightness(.88); transform: translateX(2px); }

/* ── Calls: inbound / received ─────────────────────────────────────────── */
.calls-new-btn-inbound {
  background: rgba(34,167,101,.18) !important;
  border: 1px solid rgba(34,167,101,.35);
  color: #b4f0d8;
}
.calls-new-btn-inbound:hover { background: rgba(34,167,101,.28) !important; }

.call-dir-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: .03em;
  vertical-align: middle;
}
.call-dir-entrada {
  background: rgba(34,167,101,.12);
  color: #166534;
  border: 1px solid rgba(34,167,101,.25);
}
.call-dir-saida {
  background: rgba(99,132,255,.10);
  color: #1e3a8a;
  border: 1px solid rgba(99,132,255,.22);
}

/* ── Received call page layout ── */
.call-received-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 720px) {
  .call-received-grid { grid-template-columns: 1fr; }
}
.call-received-aside {
  position: sticky;
  top: 80px;
}
.call-received-aside-inner {
  background: linear-gradient(160deg, #1c2b1a 0%, #2d4a28 60%, #3a6032 100%);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  padding: 18px 16px;
  color: rgba(255,255,255,.88);
}
.call-received-aside-inner .eyebrow {
  color: #86c7bd;
}
.call-received-aside-inner p {
  color: rgba(255,255,255,.7) !important;
}
.call-checklist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.call-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255,255,255,.82);
  cursor: pointer;
}
.call-check-item:hover { color: #fff; }
.call-check-item input[type=checkbox] {
  accent-color: #86c7bd;
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  opacity: .85;
}
.call-checklist p {
  color: rgba(255,255,255,.95) !important;
}

/* ── Kanban board ─────────────────────────────────────────────────────────── */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  align-items: start;
}
@media (max-width: 900px) {
  .kanban-board { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .kanban-board { grid-template-columns: 1fr; }
}

.kanban-col {
  background: var(--surface-soft, #f7f9fb);
  border: 1px solid var(--line, #d8dee7);
  border-radius: 10px;
  overflow: hidden;
  min-height: 120px;
  transition: background .15s;
}
.kanban-col.kanban-drag-over {
  background: rgba(59,130,246,.07);
  border-color: #3b82f6;
}

.kanban-col-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .6rem .9rem;
  background: var(--surface, #fff);
  border-bottom: 1px solid var(--line, #d8dee7);
  border-top: 3px solid #94a3b8;
}

.kanban-col-title {
  font-size: .8rem;
  font-weight: 800;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.kanban-col-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  background: var(--line, #e2e8f0);
  border-radius: 10px;
  font-size: .72rem;
  font-weight: 800;
  color: var(--muted);
  padding: 0 6px;
}

.kanban-col-body {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  padding: .6rem;
  min-height: 80px;
}

.kanban-card {
  background: var(--surface, #fff);
  border: 1px solid var(--line, #d8dee7);
  border-radius: 8px;
  padding: .6rem .75rem;
  cursor: grab;
  transition: box-shadow .15s, transform .1s, opacity .15s;
  user-select: none;
}
.kanban-card:hover {
  box-shadow: 0 3px 12px rgba(0,0,0,.1);
  transform: translateY(-1px);
}
.kanban-card.kanban-card-dragging {
  opacity: .45;
  transform: scale(.97);
  cursor: grabbing;
}
.kanban-card.kanban-card-overdue {
  border-left: 3px solid var(--danger, #dc2626);
}

.kanban-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .3rem;
}

.kanban-card-title {
  display: block;
  font-size: .85rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  line-height: 1.35;
  margin-bottom: .25rem;
}
.kanban-card-title:hover { color: var(--primary); }

.kanban-card-client {
  font-size: .72rem;
  color: var(--muted);
  margin: 0 0 .25rem;
}

.kanban-card-dl {
  font-size: .72rem;
  color: var(--muted);
  margin: 0 0 .3rem;
}
.kanban-card-dl.kanban-card-dl-late {
  color: var(--danger, #dc2626);
  font-weight: 700;
}

.kanban-card-prog {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-top: .3rem;
}

.kanban-empty-col {
  text-align: center;
  color: var(--muted);
  font-size: .78rem;
  padding: 1rem 0;
  font-style: italic;
}

/* ── Dashboard — weekly digest ─────────────────────────────────────────────── */
.db-weekly {
  margin: 0 0 2rem;
}

.db-weekly-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.db-weekly-col {
  background: var(--surface, #fff);
  border: 1px solid var(--line, #d8dee7);
  border-radius: 10px;
  overflow: hidden;
}

.db-weekly-col-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .55rem .85rem;
  background: color-mix(in srgb, var(--wc, #3b82f6) 8%, var(--surface, #fff));
  border-bottom: 2px solid var(--wc, #3b82f6);
  font-size: .78rem;
  font-weight: 800;
  color: var(--wc, #3b82f6);
  text-transform: uppercase;
  letter-spacing: .03em;
}

.db-weekly-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  background: var(--wc, #3b82f6);
  color: #fff;
  border-radius: 10px;
  font-size: .7rem;
  font-weight: 800;
  padding: 0 5px;
}

.db-weekly-item {
  display: flex;
  flex-direction: column;
  padding: .45rem .85rem;
  border-bottom: 1px solid var(--line, #e8ecf0);
  text-decoration: none;
  transition: background .1s;
  gap: .1rem;
}
.db-weekly-item:last-of-type { border-bottom: none; }
.db-weekly-item:hover { background: var(--surface-soft, #f7f9fb); }
.db-weekly-item.db-weekly-item-late { background: rgba(220,38,38,.03); }
.db-weekly-item.db-weekly-item-late:hover { background: rgba(220,38,38,.07); }

.db-wi-title {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.db-wi-sub {
  font-size: .7rem;
  color: var(--muted);
}

.db-wi-dl {
  font-size: .7rem;
  font-weight: 700;
  color: var(--muted);
  align-self: flex-end;
  margin-top: .1rem;
}
.db-wi-dl.db-wi-dl-late { color: var(--danger, #dc2626); }

.db-weekly-more {
  display: block;
  text-align: center;
  font-size: .75rem;
  color: var(--primary);
  padding: .4rem;
  text-decoration: none;
  font-weight: 700;
}
.db-weekly-more:hover { text-decoration: underline; }

/* ── Quote product-type selector buttons ─────────────────────────────────── */
.qp-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .45rem 1rem;
  font-size: .82rem;
  font-weight: 800;
  border-radius: 20px;
  border: 1.5px solid var(--line, #d8dee7);
  background: var(--surface, #fff);
  color: var(--text, #17202a);
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
  text-decoration: none;
  white-space: nowrap;
}
.qp-btn:hover {
  background: var(--surface-soft, #f2f5f8);
  border-color: #aab4c0;
}
.qp-btn.qp-active {
  background: var(--primary, #0b6f63);
  border-color: var(--primary, #0b6f63);
  color: #fff;
  box-shadow: 0 2px 8px rgba(11,111,99,.25);
}
.qp-btn.qp-active:hover {
  background: var(--primary-dark, #064d45);
  border-color: var(--primary-dark, #064d45);
}

/* ── Workspace: Active Jobs panel ─────────────────────────────────────────── */
.ws-jobs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: .85rem;
}
.ws-job-card {
  display: block;
  background: var(--surface, #fff);
  border: 1.5px solid var(--line, #e2e8f0);
  border-radius: 12px;
  padding: .9rem 1rem;
  transition: box-shadow .15s, border-color .15s, transform .12s;
  color: var(--ink, #17202a);
}
.ws-job-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.09);
  border-color: var(--primary, #0b6f63);
  transform: translateY(-1px);
}
.ws-job-card-overdue {
  border-color: rgba(220,38,38,.35);
  background: rgba(220,38,38,.03);
}
.ws-job-card-overdue:hover {
  border-color: #dc2626;
}
.ws-job-card-top {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin-bottom: .55rem;
}
.ws-job-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ws-job-status-lbl {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.ws-job-prio {
  margin-left: auto;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .06em;
  opacity: .75;
}
.ws-job-title {
  font-size: .9rem;
  font-weight: 700;
  margin: 0 0 .2rem;
  line-height: 1.3;
  color: var(--ink, #17202a);
}
.ws-job-client {
  font-size: .78rem;
  color: var(--muted, #64748b);
  margin: 0 0 .5rem;
}
.ws-job-prog-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .4rem;
}
.ws-job-prog-bar {
  flex: 1;
  height: 4px;
  background: var(--line, #e2e8f0);
  border-radius: 2px;
  overflow: hidden;
}
.ws-job-prog-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .3s;
}
.ws-job-prog-lbl {
  font-size: .68rem;
  color: var(--muted, #64748b);
  white-space: nowrap;
}
.ws-job-dl {
  font-size: .77rem;
  color: var(--muted, #64748b);
  margin: 0;
}
.ws-job-dl-late {
  color: #dc2626;
  font-weight: 600;
}
