:root {
  color-scheme: light;

  --bg: #f4f4f5;
  --surface: #ffffff;
  --surface-2: #f8f8f8;
  --surface-raised: #f0f0f1;
  --border: #e4e4e7;
  --border-strong: #d1d1d6;

  --text: #18181b;
  --text-2: #3f3f46;
  --muted: #71717a;
  --faint: #a1a1aa;

  --accent: #0d9488;
  --accent-hover: #0b7c72;
  --accent-light: rgba(13, 148, 136, 0.09);

  --green: #16a34a;
  --green-bg: #f0fdf4;
  --green-border: #bbf7d0;
  --red: #dc2626;
  --red-bg: #fef2f2;
  --red-border: #fecaca;
  --amber: #b45309;
  --amber-bg: #fffbeb;
  --amber-border: #fde68a;
  --blue: #2563eb;
  --blue-bg: #eff6ff;
  --blue-border: #bfdbfe;
  --orange: #ea580c;
  --orange-bg: #fff7ed;
  --orange-border: #fed7aa;

  --sidebar-bg: #18181b;
  --sidebar-w: 224px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.14), 0 4px 20px rgba(0,0,0,0.07);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.07), 0 2px 8px rgba(0,0,0,0.04);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 0.9375rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 { font-weight: 700; line-height: 1.25; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* ── Login ────────────────────────────────────────── */

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.login-card {
  width: min(400px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-md);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 32px;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  background: var(--accent);
  color: white;
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  flex: 0 0 auto;
}

.brand-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--muted);
}

/* ── Forms ────────────────────────────────────────── */

.form-stack { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }

.field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-2);
}

.input, .select, .textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: var(--radius);
  color: var(--text);
  outline: none;
  padding: 0 11px;
  font-size: 0.9rem;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.textarea {
  min-height: 88px;
  resize: vertical;
  padding: 10px 11px;
  line-height: 1.5;
}

.input:focus, .select:focus, .textarea:focus, .rich-editor:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.input::placeholder { color: var(--faint); }

/* ── Buttons ────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.84rem;
  font-weight: 500;
  background: var(--surface);
  color: var(--text-2);
  transition: background 0.1s, border-color 0.1s, box-shadow 0.1s;
  white-space: nowrap;
}

.btn:hover { background: var(--surface-raised); border-color: var(--border-strong); }

.btn svg, .nav-link svg, .icon-btn svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.005em;
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 2px 8px rgba(13,148,136,0.28);
}

.btn-orange { background: var(--orange); color: white; border-color: var(--orange); }
.btn-orange:hover { background: #c2410c; border-color: #c2410c; }

.btn-soft { border-color: var(--border); }
.btn-danger { background: var(--red-bg); border-color: var(--red-border); color: var(--red); }
.btn-danger:hover { background: #fee2e2; }
.btn:disabled { opacity: 0.38; cursor: not-allowed; }

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  display: grid;
  place-items: center;
  color: var(--muted);
  transition: background 0.1s, color 0.1s, border-color 0.1s;
  flex: 0 0 auto;
}
.icon-btn:hover { background: var(--surface-raised); border-color: var(--border-strong); color: var(--text); }

/* ── Login help ─────────────────────────────────────── */

.login-help {
  margin-top: 18px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: grid;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--muted);
}

.login-help strong {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 4px;
}

/* ── App shell ──────────────────────────────────────── */

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  z-index: 30;
}

.sidebar .brand-mark {
  margin-bottom: 24px;
  padding: 0 18px;
}

.sidebar .brand-logo { background: var(--accent); }

.sidebar .brand-title {
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.sidebar .brand-subtitle {
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.72rem;
}

/* ── Nav ────────────────────────────────────────────── */

.nav { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 10px;
  border: none;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.5);
  background: transparent;
  font-size: 0.84rem;
  font-weight: 400;
  text-align: left;
  transition: color 0.12s, background 0.12s;
  position: relative;
}

.nav-link:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
  color: rgba(255, 255, 255, 0.97);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

/* ── Sidebar footer ─────────────────────────────────── */

.sidebar-footer {
  margin-top: auto;
  padding: 16px 18px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: grid;
  gap: 12px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.65rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  letter-spacing: 0.03em;
  overflow: hidden;
}
.avatar-img { background: transparent; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }

.sidebar .user-chip strong {
  display: block;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.8rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar .user-chip span {
  display: block;
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.72rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar .btn {
  border-color: rgba(255, 255, 255, 0.07);
  background: transparent;
  color: rgba(255, 255, 255, 0.32);
  font-size: 0.8rem;
}
.sidebar .btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.7);
}

/* Panel user chip */
.panel .avatar { background: var(--bg); color: var(--text-2); border-radius: 50%; }
.panel .user-chip strong { display: block; font-size: 0.92rem; }
.panel .user-chip span { display: block; color: var(--muted); font-size: 0.82rem; margin-top: 1px; }

/* ── Content ────────────────────────────────────────── */

.content {
  margin-left: var(--sidebar-w);
  padding: 36px 40px;
  min-height: 100vh;
}

/* ── Page header ────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.kicker {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
  opacity: 0.8;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.page-subtitle {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.section { margin-top: 20px; }

/* ── Dashboard (db-*) ───────────────────────────────── */

.db-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
  padding: 0 2px;
}
.db-greet-text { font-size: 1.45rem; font-weight: 300; color: var(--text); letter-spacing: -0.02em; }
.db-greet-text b { font-weight: 700; }
.db-greet-date { font-size: 0.82rem; color: var(--muted); margin-top: 5px; text-transform: capitalize; }
.db-role-tag {
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--accent); background: var(--accent-light);
  padding: 5px 13px; border-radius: 99px; flex-shrink: 0; white-space: nowrap; margin-top: 6px;
  border: 1px solid rgba(13,148,136,0.18);
}

/* Stats row */
.db-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.db-stat {
  background: var(--surface);
  border: none;
  border-radius: var(--radius-lg);
  padding: 22px 22px 18px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-card);
  border-bottom: 3px solid transparent;
  transition: transform 0.14s, box-shadow 0.14s;
}
.db-stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.db-stat-accent { border-bottom-color: var(--accent); }
.db-stat-red    { border-bottom-color: var(--red); }
.db-stat-amber  { border-bottom-color: var(--amber); }
.db-stat-green  { border-bottom-color: var(--green); }
.db-stat-n {
  font-size: 2.1rem; font-weight: 700; letter-spacing: -0.04em; line-height: 1; color: var(--text);
}
.db-stat-red .db-stat-n   { color: var(--red); }
.db-stat-amber .db-stat-n { color: var(--amber); }
.db-stat-green .db-stat-n { color: var(--green); }
.db-stat-accent .db-stat-n { color: var(--accent); }
.db-stat-lbl {
  font-size: 0.72rem; font-weight: 600; color: var(--muted);
}

/* 2-col grid */
.db-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

/* Content cards */
.db-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
}
.db-card-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.db-card-title {
  font-size: 0.78rem; font-weight: 700;
  color: var(--text-2); flex: 1;
  letter-spacing: -0.005em;
}
.db-card-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: 99px; font-size: 0.65rem; font-weight: 700;
  background: var(--surface-raised); color: var(--muted);
}
.db-badge-red { background: var(--red-bg); color: var(--red); }

/* Task items */
.db-items { display: flex; flex-direction: column; gap: 2px; }

.db-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 10px;
  border: none;
  border-radius: var(--radius); background: none; text-align: left;
  cursor: pointer; transition: background 0.1s; font-size: 0.84rem;
}
.db-item:hover { background: var(--bg); }

.db-item-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--border-strong); flex-shrink: 0;
}
.db-item-dot-red   { background: var(--red); }
.db-item-dot-amber { background: var(--amber); }

.db-item-body { flex: 1; min-width: 0; }
.db-item-body b { display: block; font-weight: 600; font-size: 0.84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-item-body small { font-size: 0.74rem; color: var(--muted); }

.db-item-date { font-size: 0.74rem; white-space: nowrap; color: var(--muted); }
.db-item-late { color: var(--red); font-weight: 700; }
.db-item-who  { font-size: 0.74rem; white-space: nowrap; color: var(--muted); }
.db-item svg  { width: 13px; height: 13px; color: var(--faint); flex-shrink: 0; }

/* Stage list */
.db-stages { display: flex; flex-direction: column; gap: 10px; }

.db-stage { display: grid; grid-template-columns: 1fr 110px 28px; align-items: center; gap: 10px; }
.db-stage-name { font-size: 0.82rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.db-stage-track { height: 5px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.db-stage-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.4s; min-width: 2px; }
.db-stage-n { font-size: 0.75rem; color: var(--muted); text-align: right; font-weight: 600; }

/* Financial mini strip */
.db-fin-strip {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 12px;
}
.db-fin-tile {
  background: var(--surface);
  border-radius: var(--radius-lg); padding: 18px 20px;
  display: flex; flex-direction: column; gap: 4px;
  box-shadow: var(--shadow-card);
}
.db-fin-tile-alert { background: var(--red-bg); }
.db-fin-tile-lbl { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.db-fin-tile-val { font-size: 1.45rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1.2; color: var(--text); }
.db-fin-tile-green { color: var(--green); }
.db-fin-tile-red   { color: var(--red); }
.db-fin-tile-prog { height: 3px; background: var(--bg); border-radius: 2px; overflow: hidden; margin: 5px 0 2px; }
.db-fin-tile-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.4s; }
.db-fin-tile-sub { font-size: 0.74rem; color: var(--muted); }

.db-fin-go {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 7px; background: var(--surface); border: none; border-radius: var(--radius-lg); padding: 18px 22px;
  cursor: pointer; color: var(--muted); font-size: 0.75rem; font-weight: 500;
  transition: background 0.12s, color 0.12s; min-width: 116px;
  box-shadow: var(--shadow-card);
}
.db-fin-go:hover { background: var(--accent-light); color: var(--accent); }
.db-fin-go svg { width: 20px; height: 20px; }
.db-fin-go span { white-space: nowrap; }

/* Metric strip (legacy) */
.metric-grid {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.metric-card {
  flex: 1;
  padding: 20px 24px;
  border-right: 1px solid var(--border);
  background: none;
  border-radius: 0;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}
.metric-card:first-child { border-radius: var(--radius-lg) 0 0 var(--radius-lg); }
.metric-card:last-child  { border-right: none; border-radius: 0 var(--radius-lg) var(--radius-lg) 0; }
.metric-card:hover { background: var(--surface-2); }
.metric-icon { display: none; }
.metric-card strong { display: block; font-size: 1.75rem; font-weight: 600; color: var(--text); line-height: 1; margin-bottom: 5px; letter-spacing: -0.025em; }
.metric-card span   { font-size: 0.7rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* ── Panel ──────────────────────────────────────────── */

.panels-stack { display: grid; gap: 16px; }

.panel {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  box-shadow: var(--shadow-card);
}

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

.panel-heading h2, .panel-heading h3 {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: -0.005em;
}

/* ── Alert list ─────────────────────────────────────── */

.alert-list { display: grid; }

.alert-row {
  width: 100%;
  border: none;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  padding: 12px 6px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(80px, auto) minmax(100px, auto) 16px;
  gap: 14px;
  align-items: center;
  text-align: left;
  transition: background 0.1s;
  cursor: pointer;
}
.alert-row:first-child { border-top: none; }
.alert-row:hover { background: var(--bg); border-radius: var(--radius); }

.alert-row strong { font-size: 0.84rem; font-weight: 600; }
.alert-row .muted { font-size: 0.74rem; margin-top: 1px; }
.alert-row svg { width: 13px; height: 13px; color: var(--faint); }

/* ── Badges ─────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 0.65rem;
  font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge.active, .badge.Publicado, .badge.Concluído, .badge.Baixa {
  background: var(--green-bg);
  color: var(--green);
  border-color: var(--green-border);
}

.badge.inactive, .badge.Atrasado, .badge.Urgente {
  background: var(--red-bg);
  color: var(--red);
  border-color: var(--red-border);
}

.badge.Planejamento, .badge.Média {
  background: var(--blue-bg);
  color: var(--blue);
  border-color: var(--blue-border);
}

.badge.Copy, .badge.Design, .badge.Edição, .badge.Revisão {
  background: var(--orange-bg);
  color: var(--orange);
  border-color: var(--orange-border);
}

.badge.Aguardando, .badge.Agendado, .badge.Alta {
  background: var(--amber-bg);
  color: var(--amber);
  border-color: var(--amber-border);
}

/* ── Empty / muted ──────────────────────────────────── */

.empty-state {
  padding: 36px 24px;
  text-align: center;
  color: var(--faint);
  font-size: 0.84rem;
}

.empty-filtered {
  grid-column: 1 / -1;
  padding: 52px 28px;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.muted { color: var(--muted); }

/* ── Loading spinner ────────────────────────────────── */

@keyframes spin { to { transform: rotate(360deg); } }

.loading {
  display: grid;
  place-items: center;
  min-height: 220px;
  color: var(--faint);
  font-size: 0.84rem;
}

.loading::after {
  content: '';
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

/* ── Workflow progress ──────────────────────────────── */

.workflow-progress {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.wp-step {
  width: 18px;
  height: 3px;
  border-radius: 2px;
  background: var(--border);
  flex-shrink: 0;
}
.wp-step.done { background: var(--accent); opacity: 0.35; }
.wp-step.current { background: var(--accent); opacity: 1; }

.wp-label {
  font-size: 0.7rem;
  color: var(--muted);
  margin-left: 4px;
}

/* ── Comment form ───────────────────────────────────── */

.comment-form {
  display: grid;
  gap: 8px;
  padding: 14px;
  background: var(--surface-2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.comment-form label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
}

.comment-actions {
  display: flex;
  justify-content: flex-end;
}

/* ── Filters ────────────────────────────────────────── */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  align-items: flex-end;
}

.filters .field label {
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.filters .input,
.filters .select {
  min-width: 0;
  flex: 1 1 140px;
  max-width: 220px;
}

.filters .input:first-child {
  flex: 2 1 200px;
  max-width: 320px;
}

/* ── Clients ────────────────────────────────────────── */

.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(252px, 1fr));
  gap: 12px;
}

.client-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: grid;
  gap: 16px;
  transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.client-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.client-card h3 { font-size: 0.92rem; font-weight: 700; margin-top: 4px; letter-spacing: -0.01em; }
.client-card p { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }

.client-stats { display: flex; gap: 20px; }

.mini-stat { background: none; border: none; padding: 0; }
.mini-stat strong { display: block; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; }
.mini-stat span { font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }

/* ── Tabs ───────────────────────────────────────────── */

.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
  gap: 2px;
}

.tab-btn {
  min-height: 40px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  padding: 0 15px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
  margin-bottom: -1px;
  border-radius: var(--radius) var(--radius) 0 0;
  transition: color 0.1s, border-color 0.1s, background 0.1s;
}
.tab-btn:hover { color: var(--text-2); background: var(--surface-2); }
.tab-btn.active { color: var(--accent); border-color: var(--accent); background: transparent; font-weight: 600; }

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

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.month-view { display: grid; gap: 28px; }

.month-view-title {
  font-size: 0.92rem;
  font-weight: 700;
  display: flex;
  align-items: baseline;
  gap: 8px;
  letter-spacing: -0.01em;
}

.week-lane { display: grid; gap: 9px; }

.week-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--faint);
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border);
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 7px;
}

/* ── Post card ──────────────────────────────────────── */

.post-card {
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px 14px;
  display: grid;
  gap: 7px;
  text-align: left;
  transition: border-color 0.12s, box-shadow 0.12s;
  box-shadow: var(--shadow-sm);
}

.post-card:hover {
  border-color: var(--border-strong);
  border-left-color: inherit;
  box-shadow: var(--shadow-md);
}
.post-card.post-card-colored:hover { border-left-color: inherit; }
.post-card.overdue { border-color: var(--red-border); border-left-color: var(--red); }
.post-card.overdue:hover { border-color: var(--red-border); box-shadow: 0 4px 14px rgba(220,38,38,0.12); }

.post-card h4 { font-size: 0.84rem; font-weight: 600; line-height: 1.4; }

.post-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 0.74rem;
  color: var(--muted);
  align-items: center;
}

.post-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.post-number {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Task board ─────────────────────────────────────── */

.task-board {
  display: flex;
  overflow-x: auto;
  gap: 12px;
  align-items: start;
  padding-bottom: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.task-board::-webkit-scrollbar { height: 5px; }
.task-board::-webkit-scrollbar-track { background: transparent; }
.task-board::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

.task-column {
  flex: 0 0 278px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 11px 16px;
  display: grid;
  gap: 8px;
  align-content: start;
}

.task-column h3 {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px 11px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}

.task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 13px;
  display: grid;
  gap: 7px;
  transition: border-color 0.12s, box-shadow 0.12s;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.task-card:hover {
  border-color: var(--border-strong);
  border-left-color: inherit;
  box-shadow: var(--shadow-md);
}
.task-card.task-colored:hover { border-left-color: inherit; }
.task-card.overdue { border-color: var(--red-border); border-left-color: var(--red); }
.task-card.overdue:hover { box-shadow: 0 4px 14px rgba(220,38,38,0.1); }
.task-card.task-coming { border-left-color: var(--accent); }

.task-main { display: grid; gap: 2px; }
.task-card h4 { font-size: 0.84rem; font-weight: 600; line-height: 1.35; margin: 0; }
.task-client { font-size: 0.74rem; color: var(--accent); font-weight: 600; }
.task-type { font-size: 0.74rem; color: var(--muted); }
.task-responsible { font-size: 0.74rem; color: var(--muted); }

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 0.74rem;
  color: var(--muted);
  align-items: center;
}

.split-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }

.task-coming-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
}

/* ── Admin ──────────────────────────────────────────── */

.admin-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.65fr) minmax(320px, 1fr);
  gap: 14px;
  align-items: start;
}

.admin-sections { display: grid; gap: 20px; }

.user-list { display: grid; }
.stage-list { display: grid; }

.user-row {
  border: none;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  padding: 13px 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}
.user-row:first-child { border-top: none; }
.user-row strong { font-size: 0.84rem; font-weight: 600; display: block; }
.user-row span { color: var(--muted); font-size: 0.78rem; display: block; margin-top: 1px; }

.stage-row {
  border: none;
  border-top: 1px solid var(--border);
  padding: 11px 0;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 12px;
  align-items: center;
}
.stage-row:first-child { border-top: none; }

.stage-position {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--faint);
  text-align: center;
  line-height: 1;
}

.stage-info strong { font-size: 0.84rem; font-weight: 600; }

.stage-final-badge {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.63rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-light);
  border: 1px solid rgba(13, 148, 136, 0.2);
  border-radius: 4px;
  padding: 1px 5px;
  vertical-align: middle;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  cursor: pointer;
}

/* ── Form grid ──────────────────────────────────────── */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.form-grid .full { grid-column: 1 / -1; }

/* ── Profile ────────────────────────────────────────── */

.profile-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.65fr) minmax(280px, 1fr);
  gap: 14px;
  align-items: start;
}

.profile-avatar-wrap {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 4px;
}
.profile-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 1.6rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-avatar-actions { display: flex; flex-direction: column; gap: 8px; }

/* Draft restore banner */
.draft-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  border-radius: var(--radius);
  font-size: 0.8rem;
  color: var(--amber);
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.draft-banner span { flex: 1; min-width: 0; }

/* field-hint */
.field-hint {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
  margin-bottom: 4px;
}

/* Recording tabs */
.rec-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
}
.rec-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  border: none;
  border-radius: 99px;
  background: var(--surface-raised);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.rec-tab:hover { background: var(--border); color: var(--text-2); }
.rec-tab-active { background: var(--accent); color: #fff; font-weight: 600; }
.rec-tab-active:hover { background: var(--accent-hover); color: #fff; }
.rec-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 99px;
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(255,255,255,0.28);
  color: inherit;
}
.rec-tab:not(.rec-tab-active) .rec-tab-badge { background: var(--border); color: var(--muted); }

/* Operations page tabs (Tarefas / Gravações) */
.ops-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}
.ops-tab {
  padding: 8px 20px;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.ops-tab:hover { color: var(--text-2); }
.ops-tab-active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* Financial monthly history chart */
.fc-history-wrap {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}
.fc-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 12px;
}
.fc-history-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: -0.005em;
}
.fc-history-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.74rem;
  color: var(--muted);
}
.fc-legend-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}
.fc-legend-expected { background: var(--surface-raised); outline: 2px solid var(--border-strong); }
.fc-legend-received { background: var(--accent); }

.fc-history-bars {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 100px;
}
.fc-hbar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  height: 100%;
}
.fc-hbar-track {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  position: relative;
}
.fc-hbar-exp {
  flex: 1;
  background: var(--surface-raised);
  outline: 2px solid var(--border);
  border-radius: 4px 4px 0 0;
  min-height: 3px;
  transition: height 0.4s;
}
.fc-hbar-recv {
  flex: 1;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  min-height: 3px;
  transition: height 0.4s;
}
.fc-hbar-lbl {
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
}

/* ── Modal ──────────────────────────────────────────── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.32);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 80;
  backdrop-filter: blur(4px);
}

.modal {
  width: min(940px, 100%);
  max-height: min(92vh, 940px);
  overflow: auto;
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.modal.modal-sm { width: min(480px, 100%); max-height: min(92vh, 640px); }

.static-value {
  font-size: 0.84rem;
  font-weight: 500;
  padding: 9px 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 20px 26px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.modal-header h2 { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; }
.modal-header .kicker { margin-bottom: 3px; }
.modal-header .brand-subtitle { font-size: 0.78rem; color: var(--muted); margin-top: 3px; }

.modal-body {
  padding: 26px;
  display: grid;
  gap: 22px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding-top: 4px;
}

/* ── Post info row ──────────────────────────────────── */

.post-info-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 0.84rem;
  padding: 11px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.inline-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.84rem;
}
.inline-link:hover { text-decoration: underline; }
.inline-link svg { width: 13px; height: 13px; }

/* ── Advance section ────────────────────────────────── */

.advance-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 18px;
  background: var(--surface-2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.advance-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* ── Nav badge ──────────────────────────────────────── */

.nav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 0.63rem;
  font-weight: 700;
  margin-left: 6px;
  line-height: 1;
}

/* ── Overdue label ──────────────────────────────────── */

.overdue-label {
  color: var(--red);
  font-weight: 700;
  font-size: 0.74rem;
}

/* ── Rich editor ────────────────────────────────────── */

.editor-toolbar {
  display: flex;
  gap: 3px;
  padding: 6px 8px;
  border: 1px solid var(--border-strong);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--surface-2);
}

.editor-toolbar button {
  min-width: 28px;
  height: 26px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-2);
  transition: background 0.1s;
}
.editor-toolbar button:hover { background: var(--border); }
.editor-toolbar button svg { width: 13px; height: 13px; }

.rich-editor {
  min-height: 180px;
  border: 1px solid var(--border-strong);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 13px 15px;
  outline: none;
  line-height: 1.65;
  font-size: 0.88rem;
}

.rich-editor h2 { font-size: 1.05rem; margin-bottom: 6px; }
.rich-editor p { margin-bottom: 6px; }
.rich-editor ul { padding-left: 18px; margin-bottom: 6px; }
.rich-editor li { margin-bottom: 3px; }

/* ── History ────────────────────────────────────────── */

.history-list {
  display: grid;
  max-height: 290px;
  overflow: auto;
  padding-left: 14px;
  border-left: 2px solid var(--border);
}

.history-item {
  padding: 10px 0 10px 14px;
  border-top: 1px solid var(--border);
  position: relative;
}

.history-item::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 16px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent);
}

.history-item:first-child { border-top: none; }
.history-item strong { font-size: 0.8rem; font-weight: 600; display: block; }
.history-item span { font-size: 0.72rem; color: var(--muted); display: block; margin-top: 2px; }
.history-item .muted { font-size: 0.74rem; margin-top: 4px; }

.history-note {
  background: rgba(180, 130, 0, 0.05);
  border-radius: 4px;
  padding-left: 10px;
  margin-left: -10px;
}
.history-note::before { border-color: #b08000; background: #fdf8ec; }

/* ── Color picker ───────────────────────────────────── */

.color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0;
}

.color-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  outline: none;
  flex-shrink: 0;
}

.color-dot-default {
  background: var(--surface-2);
  border: 2px dashed var(--border-strong);
}

.color-dot:hover { transform: scale(1.12); }

.color-dot.selected {
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--text-2);
  transform: scale(1.1);
}

.color-dot-default.selected {
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--border-strong);
}

/* ── Client links ───────────────────────────────────── */

.link-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.15s;
}
.link-card:hover { border-color: var(--accent); }

.link-card-fixed {
  background: var(--surface);
  border-style: dashed;
}

.link-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--accent-faint, rgba(99,102,241,0.08));
  border-radius: 8px;
  color: var(--accent);
  flex-shrink: 0;
}
.link-card-icon svg { width: 16px; height: 16px; }

.link-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.link-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-1);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.link-card-title:hover { color: var(--accent); text-decoration: underline; }

.link-card-host {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* ── Reference Profiles ─────────────────────────────── */

.profile-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 22px 18px 16px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s;
}
.profile-card:hover {
  border-color: var(--border-strong);
  border-top-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.profile-card-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.03em;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(99,102,241,0.25);
}

.profile-card-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.3;
  word-break: break-word;
}

.profile-card-host {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 3px;
}

.profile-card-desc {
  font-size: 0.78rem;
  color: var(--text-2);
  line-height: 1.5;
  margin: 10px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.profile-card-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 14px;
  flex-wrap: wrap;
}

/* ── Extras ─────────────────────────────────────────── */

.extras-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.extras-topbar .input {
  flex: 1;
  max-width: 300px;
}

/* ── Editor counter ─────────────────────────────────── */

.editor-counter {
  font-size: 0.7rem;
  color: var(--faint);
  text-align: right;
  margin-top: 3px;
}

/* ── Toast ──────────────────────────────────────────── */

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 120;
  background: var(--text);
  color: rgba(255, 255, 255, 0.93);
  padding: 11px 18px;
  border-radius: var(--radius-lg);
  max-width: min(340px, calc(100vw - 44px));
  font-size: 0.84rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  letter-spacing: 0.005em;
}

/* ── Client overview stats ──────────────────────────── */

.client-stats { display: flex; gap: 24px; flex-wrap: wrap; }

.mini-stat-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 8px 12px;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, border-color 0.12s;
  margin: -8px -12px;
}
.mini-stat-btn:hover { background: var(--surface-raised); border-color: var(--border); }
.mini-stat-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mini-stat-alert strong { color: var(--red); }

/* ── Responsive ─────────────────────────────────────── */

@media (max-width: 1200px) {
  .metric-grid { flex-wrap: wrap; }
  .metric-card { flex: 1 1 28%; border-bottom: 1px solid var(--border); border-radius: 0; }
  .metric-card:nth-child(3) { border-right: none; }
  .metric-card:nth-child(4) { border-bottom: none; }
  .metric-card:nth-child(5) { border-bottom: none; }
  .metric-card:nth-child(6) { border-bottom: none; border-right: none; }
  .task-column { flex: 0 0 240px; }
}

@media (max-width: 860px) {
  .sidebar {
    position: sticky;
    top: 0;
    width: 100%;
    min-height: auto;
    inset: auto;
    padding: 10px 12px;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    z-index: 40;
  }

  .sidebar .brand-mark { margin-bottom: 0; flex: 0 0 auto; }

  .nav {
    flex-direction: row;
    flex: 1;
    overflow-x: auto;
    padding: 0;
    gap: 0;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }

  .nav-link {
    border-radius: 0;
    border-bottom: 2px solid transparent;
    min-height: 40px;
    justify-content: center;
    padding: 0 12px;
    flex-direction: column;
    gap: 2px;
    font-size: 0.63rem;
  }

  .nav-link::before { display: none; }
  .nav-link svg { width: 17px; height: 17px; }

  .nav-link.active {
    border-bottom-color: var(--accent);
    background: rgba(255, 255, 255, 0.06);
  }

  .nav-link span { display: block; font-size: 0.6rem; }
  .sidebar-footer { display: none; }

  .content { margin-left: 0; padding: 18px; }

  .topbar { flex-direction: column; align-items: stretch; }
  .panel-heading { flex-wrap: wrap; }
  .calendar-toolbar { flex-direction: column; align-items: stretch; }

  .metric-grid { flex-direction: column; }
  .metric-card { border-right: none; border-top: 1px solid var(--border); border-bottom: none; border-radius: 0; }
  .metric-card:first-child { border-top: none; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .metric-card:last-child { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

  .task-column { flex: 0 0 240px; }
  .admin-grid, .profile-grid, .form-grid { grid-template-columns: 1fr; }
  .alert-row { grid-template-columns: 1fr auto; }
  .advance-section { grid-template-columns: 1fr; }
  .filters { flex-direction: column; }
  .filters .input, .filters .select { max-width: 100%; flex: 1; }
  .filters .input:first-child { max-width: 100%; }

  .user-row {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    margin-bottom: 4px;
  }
  .user-row:first-child { border-top: 1px solid var(--border); }

  .tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab-btn { white-space: nowrap; }
}

@media (max-width: 768px) {
  .db-stats { grid-template-columns: 1fr 1fr; }
  .db-grid { grid-template-columns: 1fr; }
  .db-fin-strip { grid-template-columns: 1fr 1fr; }
  .db-fin-go { grid-column: 1 / -1; flex-direction: row; justify-content: center; }
  .db-item-who { display: none; }

  .fc-kpi-row { grid-template-columns: 1fr; gap: 8px; }
  .fc-client-monthly, .fc-client-balance { display: none; }
  .fc-status-banner { flex-direction: column; align-items: flex-start; }
  .fc-banner-stats { flex-wrap: wrap; gap: 12px 20px; }
  .fc-cols { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .db-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .db-fin-strip { grid-template-columns: 1fr; }
  .db-header { flex-direction: column; align-items: flex-start; gap: 8px; }

  .login-card { padding: 26px; }
  .modal-body { padding: 18px; }
  .panel { padding: 16px 18px; }
  .content { padding: 14px; }
  .post-grid { grid-template-columns: 1fr; }
  .client-stats { flex-wrap: wrap; gap: 16px; }
  .modal-backdrop { padding: 8px; }
  .advance-actions { flex-wrap: wrap; }
  .extra-row { margin: 0; width: 100%; }
  .fc-hist-entry { grid-template-columns: 80px 90px 1fr 32px; }
  .fc-hist-note { display: none; }
}

/* ── Role checks ────────────────────────────────────── */

.role-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
}

.role-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--accent-light);
  border: 1px solid rgba(13,148,136,0.2);
  color: var(--accent);
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Recordings screen ──────────────────────────────── */

.rec-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.rec-pending-panel,
.rec-recent-panel { }

.rec-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid rgba(13,148,136,0.2);
  font-size: 0.72rem;
  font-weight: 700;
}

.rec-post-card {
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.rec-post-card:first-of-type { border-top: none; }

.rec-post-info { margin-bottom: 10px; }

.rec-post-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.rec-post-client {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.rec-overdue-badge {
  font-size: 0.63rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid var(--red-border);
}

.rec-post-title {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--text);
  letter-spacing: -0.005em;
}

.rec-post-meta {
  font-size: 0.78rem;
  color: var(--muted);
}

.rec-post-actions { }

.rec-link-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 14px;
  margin-top: 8px;
}

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

.rec-recent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.rec-recent-row:first-of-type { border-top: none; }

.rec-recent-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.rec-recent-info strong { font-size: 0.88rem; font-weight: 600; }
.rec-recent-info span  { font-size: 0.74rem; }

.rec-recent-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.rec-recent-who { font-size: 0.74rem; white-space: nowrap; }

@media (max-width: 900px) {
  .rec-layout { grid-template-columns: 1fr; }
}

/* ── Financial (fc-*) ────────────────────────────────── */

.fc-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.fc-kpi {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex; flex-direction: column; gap: 4px;
  box-shadow: var(--shadow-card);
  position: relative; overflow: hidden;
}
.fc-kpi::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--border-strong);
}
.fc-kpi-green::before { background: var(--green); }
.fc-kpi-red::before   { background: var(--red); }

.fc-kpi-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.fc-kpi-value { font-size: 1.85rem; font-weight: 600; letter-spacing: -0.04em; line-height: 1.15; margin: 5px 0 3px; color: var(--text); }
.fc-kpi-bar { height: 3px; background: var(--bg); border-radius: 2px; overflow: hidden; margin: 8px 0 3px; }
.fc-kpi-bar-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.4s; }
.fc-kpi-sub { font-size: 0.74rem; color: var(--muted); }

.fc-list-wrap {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 8px;
  box-shadow: var(--shadow-card);
}

.fc-section { margin-bottom: 4px; }
.fc-section:last-child { margin-bottom: 0; }

.fc-section-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px 6px;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--muted);
}
.fc-section-head-late { color: var(--red); }
.fc-section-head-ok   { color: var(--green); }

.fc-section-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 99px; font-size: 0.63rem; font-weight: 700;
  background: var(--surface-raised); color: var(--muted);
}
.fc-section-badge-late { background: var(--red-bg); color: var(--red); }
.fc-section-badge-ok   { background: var(--green-bg); color: var(--green); }

.fc-client {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 11px 13px; border: none; border-radius: var(--radius);
  background: none; text-align: left; cursor: pointer;
  transition: background 0.1s; font-size: 0.84rem;
}
.fc-client:hover { background: var(--bg); }

.fc-client-info { flex: 2; display: flex; align-items: center; gap: 10px; min-width: 0; }

.fc-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.fc-dot-ok   { background: var(--green); }
.fc-dot-late { background: var(--red); }
.fc-dot-none { background: var(--border-strong); }

.fc-client-text { min-width: 0; }
.fc-client-text strong { display: block; font-size: 0.84rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-client-text small  { display: block; font-size: 0.74rem; color: var(--muted); margin-top: 1px; }

.fc-client-monthly { flex: 1; font-size: 0.84rem; color: var(--text-2); white-space: nowrap; }
.fc-client-recv { flex: 1.3; display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 0.84rem; }
.fc-mini-prog { height: 3px; background: var(--bg); border-radius: 2px; overflow: hidden; }
.fc-mini-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.3s; }
.fc-mini-full { background: var(--green); }

.fc-client-balance { flex: 1; font-size: 0.84rem; font-weight: 500; white-space: nowrap; }
.fc-neg { color: var(--red); font-weight: 700; }
.fc-pos { color: var(--green); font-weight: 700; }
.fc-green { color: var(--green); }
.fc-red   { color: var(--red); }

.fc-pill {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: 99px;
  font-size: 0.65rem; font-weight: 700;
  letter-spacing: 0.03em; text-transform: uppercase; white-space: nowrap;
}
.fc-pill-ok   { background: var(--green-bg); color: var(--green); }
.fc-pill-late { background: var(--red-bg);   color: var(--red); }
.fc-pill-none { background: var(--surface-raised); color: var(--muted); }

.fc-status-banner {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--surface);
  border-top: 3px solid var(--green);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-card);
}
.fc-banner-alert {
  border-top-color: var(--red);
  background: var(--red-bg);
}

.fc-banner-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 130px;
}

.fc-banner-month {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.fc-banner-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  width: 100%;
}
.fc-banner-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s;
}
.fc-banner-fill-ok { background: var(--green); }

.fc-banner-nosub {
  font-size: 0.74rem;
  color: var(--muted);
  font-style: italic;
}

.fc-banner-stats {
  display: flex;
  gap: 28px;
  flex: 1;
}

.fc-bstat {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.fc-bstat span {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.fc-bstat strong {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.fc-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.fc-info-grid { display: grid; gap: 0; }

.fc-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 0;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  gap: 12px;
}
.fc-info-row:first-child { border-top: none; }
.fc-info-row > span:first-child { color: var(--muted); flex-shrink: 0; }
.fc-info-row strong { font-weight: 700; }
.fc-info-val { color: var(--text-2); font-size: 0.84rem; text-align: right; }

.fc-info-empty {
  font-size: 0.84rem;
  color: var(--muted);
  font-style: italic;
}
