/* ===== SistemK — Design System ===== */
:root {
  /* Kolbe Produtora — tema escuro (preto neutro + laranja) */
  --bg: #0a0a0b;
  --bg-2: #101012;
  --surface: #151517;
  --surface-2: #0e0e10;
  --border: #24242b;
  --border-soft: #1a1a20;
  --text: #f2f2f5;
  --text-soft: #9a9aa6;
  --text-faint: #64646f;

  --brand: #ff4013;         /* laranja da logo */
  --brand-soft: rgba(255, 64, 19, .14);
  --brand-strong: #ff5c33;

  --ok: #22c55e;
  --ok-soft: rgba(34, 197, 94, .15);
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, .15);
  --danger: #f4483b;
  --danger-soft: rgba(244, 72, 59, .15);
  --info: #3b82f6;
  --info-soft: rgba(59, 130, 246, .15);

  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow: 0 8px 26px rgba(0, 0, 0, .45);
  --shadow-lg: 0 20px 56px rgba(0, 0, 0, .6);

  --sidebar-w: 244px;
  --font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "Space Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* brilho (glow) dos elementos coloridos */
  --glow-brand: rgba(255, 64, 19, .5);
  --glow-ok: rgba(34, 197, 94, .55);
  --glow-danger: rgba(244, 72, 59, .5);
  --glow-warn: rgba(245, 158, 11, .5);
  --glow-info: rgba(59, 130, 246, .5);

  /* fundo do app + chrome (sidebar/topbar) — variam por tema */
  --chrome-bg: rgba(10, 10, 12, .72);
  --app-bg-image:
    radial-gradient(1100px 560px at 100% 0%, rgba(255, 64, 19, .06), transparent 58%),
    radial-gradient(900px 520px at 0% 100%, rgba(255, 92, 51, .03), transparent 55%),
    linear-gradient(160deg, #090909 0%, #0a0a0b 50%, #0b0b0d 100%);
  color-scheme: dark;
}

/* ===== Tema BLACK (preto puro / OLED) ===== */
:root[data-theme="black"] {
  --bg: #000000;
  --bg-2: #0a0a0d;
  --surface: #0a0a0d;
  --surface-2: #050506;
  --border: #1e1e24;
  --border-soft: #161619;
  --text: #f4f4f7;
  --text-soft: #9b9ba6;
  --text-faint: #5b5b66;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .6);
  --shadow: 0 8px 26px rgba(0, 0, 0, .7);
  --shadow-lg: 0 20px 56px rgba(0, 0, 0, .85);
  --chrome-bg: rgba(0, 0, 0, .82);
  --app-bg-image:
    radial-gradient(1000px 500px at 100% 0%, rgba(255, 64, 19, .07), transparent 60%),
    linear-gradient(180deg, #000000, #000000);
  color-scheme: dark;
}

/* ===== Tema CLARO ===== */
:root[data-theme="light"] {
  --bg: #f3f5fa;
  --bg-2: #e8edf5;
  --surface: #ffffff;
  --surface-2: #eef1f7;
  --border: #e1e6ef;
  --border-soft: #edf0f6;
  --text: #16202e;
  --text-soft: #566175;
  --text-faint: #93a0b2;
  --brand-soft: rgba(255, 64, 19, .12);
  --ok-soft: rgba(34, 197, 94, .16);
  --warn-soft: rgba(245, 158, 11, .18);
  --danger-soft: rgba(244, 72, 59, .14);
  --info-soft: rgba(59, 130, 246, .14);
  --shadow-sm: 0 1px 2px rgba(24, 26, 45, .06);
  --shadow: 0 6px 24px rgba(24, 26, 45, .10);
  --shadow-lg: 0 18px 50px rgba(24, 26, 45, .18);
  --chrome-bg: rgba(255, 255, 255, .82);
  --app-bg-image:
    radial-gradient(1100px 600px at 100% 0%, rgba(59, 130, 246, .10), transparent 60%),
    linear-gradient(135deg, #f6f8fc 0%, #eef2f8 100%);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  background-image: var(--app-bg-image);
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  transition: background-color .2s, color .2s;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
a { text-decoration: none; color: inherit; }

#app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  transition: grid-template-columns .18s ease;
}
#app.sidebar-collapsed { grid-template-columns: 74px 1fr; }

/* marca compacta + botão recolher */
.brand-mini { display: none; font-weight: 800; font-size: 22px; color: var(--text); align-items: baseline; justify-content: center; line-height: 1; }
.sidebar-toggle {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; margin-bottom: 10px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-soft); border-radius: var(--radius-sm);
  font-weight: 700; font-size: 13px; cursor: pointer; transition: background .12s, color .12s;
}
.sidebar-toggle:hover { background: var(--surface); color: var(--text); }
.sidebar-toggle .st-ico { font-size: 15px; width: 18px; text-align: center; }

/* ===== estado recolhido = rail de ícones (só no desktop; no mobile vira drawer completo) ===== */
@media (min-width: 861px) {
.sidebar-collapsed .sidebar { padding: 16px 0; align-items: center; }
.sidebar-collapsed .brand-word,
.sidebar-collapsed .brand-sub,
.sidebar-collapsed .nav-label,
.sidebar-collapsed .nav-section,
.sidebar-collapsed .nav-badge,
.sidebar-collapsed .me > div { display: none; }
/* no rail mostra só o símbolo (branco/preto conforme o tema) */
.sidebar-collapsed .sidebar .brand-full { display: none; }
.sidebar-collapsed .sidebar .brand-symbol { display: inline-flex; }
.sidebar-collapsed .sidebar .brand-symbol svg { height: 30px; }
.sidebar-collapsed .sidebar .brand { padding: 4px 0 20px; display: flex; justify-content: center; }
/* nav como coluna centralizada com respiro */
.sidebar-collapsed .nav { gap: 8px; align-items: center; width: 100%; }
.sidebar-collapsed .nav-item { justify-content: center; gap: 0; width: 44px; height: 44px; padding: 0; border-radius: 13px; color: var(--text-faint); }
.sidebar-collapsed .nav-ico { width: auto; opacity: 1; }
.sidebar-collapsed .nav-ico svg { width: 21px; height: 21px; }
.sidebar-collapsed .nav-item:hover { background: var(--surface-2); color: var(--text); }
.sidebar-collapsed .nav-item.active { background: linear-gradient(150deg, #ff4013, #ff7a3d); color: #fff; box-shadow: 0 0 20px -4px var(--glow-brand); }
/* rodapé do rail: recolher + avatar como ícones */
.sidebar-collapsed .sidebar-foot { border-top: none; padding-top: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.sidebar-collapsed .sidebar-toggle { justify-content: center; gap: 0; width: 40px; height: 40px; padding: 0; margin: 0; border-radius: 12px; }
.sidebar-collapsed .me { justify-content: center; padding: 0; }
.sidebar-collapsed .me:hover { background: transparent; }
.sidebar-collapsed .me-logout { display: none; }
} /* fim @media desktop (rail) */

/* ===== Sidebar ===== */
.sidebar {
  background: var(--chrome-bg);
  backdrop-filter: blur(10px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}
/* ===== Marca / logo (SVG oficial, branco ou preto conforme o tema) ===== */
:root { --logo-ink: #f9f9f9; }
:root[data-theme="light"] { --logo-ink: #191919; }
.sidebar .brand { padding: 10px 10px 20px; color: var(--logo-ink); display: flex; align-items: center; }
.sidebar .brand svg { display: block; }
.sidebar .brand .k-ink { fill: currentColor; }
.sidebar .brand .k-dot { fill: #f90b0b; }
.sidebar .brand-full { display: inline-flex; }
.sidebar .brand-full svg { height: 27px; width: auto; }
.sidebar .brand-symbol { display: none; }
.sidebar .brand-symbol svg { height: 30px; width: auto; }
/* wordmark em texto (usado na página pública de aprovação) */
.brand-word { font-weight: 800; font-size: 26px; letter-spacing: -.04em; color: var(--text); display: inline-flex; align-items: baseline; line-height: 1; }
.brand-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-left: 4px; align-self: flex-start; margin-top: 3px; box-shadow: 0 0 10px 1px var(--glow-brand); }
.brand-sub { font-size: 10.5px; font-weight: 700; letter-spacing: .32em; color: var(--text-faint); margin-top: 4px; padding-left: 2px; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-section {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-faint); font-weight: 700; padding: 16px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--text-soft); font-weight: 600; font-size: 13.5px;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--brand-soft); color: var(--brand-strong); }
.nav-ico { width: 22px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; opacity: .9; }
.nav-ico svg { width: 19px; height: 19px; display: block; }
.nav-badge {
  margin-left: auto; background: var(--surface-2); color: var(--text-soft);
  font-size: 11px; font-weight: 700; min-width: 20px; text-align: center;
  padding: 2px 6px; border-radius: 20px;
}
.nav-item.active .nav-badge { background: #fff; color: var(--brand-strong); }

.sidebar-foot { border-top: 1px solid var(--border); padding-top: 12px; }
.theme-switch {
  display: flex; gap: 2px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 3px;
}
.theme-switch button {
  width: 32px; height: 32px; padding: 0; border: none; background: transparent; color: var(--text-soft);
  border-radius: 7px; font-size: 14px; cursor: pointer;
  display: grid; place-items: center; transition: background .12s, color .12s, box-shadow .12s;
}
.theme-switch button:hover { color: var(--text); background: var(--surface); }
.theme-switch button.active { background: var(--brand-soft); color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--brand); }
.me { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: var(--radius-sm); cursor: pointer; }
.me:hover { background: var(--surface-2); }
.me-name { font-weight: 700; font-size: 13px; }
.me-role { font-size: 11.5px; color: var(--text-faint); }

/* ===== Main ===== */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 66px; background: var(--chrome-bg); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px; padding: 0 26px;
  position: sticky; top: 0; z-index: 5;
}
.topbar-search {
  flex: 1; max-width: 460px; position: relative; display: flex; align-items: center;
}
.search-ico { position: absolute; left: 12px; color: var(--text-faint); font-size: 15px; }
.topbar-search input {
  width: 100%; padding: 10px 12px 10px 34px; border: 1px solid var(--border);
  background: var(--bg); border-radius: 11px; font-size: 13.5px; outline: none;
  transition: border .12s, box-shadow .12s;
}
.topbar-search input { color: var(--text); }
.topbar-search input::placeholder { color: var(--text-faint); }
.topbar-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); background: var(--surface); }
.topbar-search { min-width: 0; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-shrink: 0; flex-wrap: nowrap; }

.content { padding: 26px; max-width: 1400px; width: 100%; }

/* ===== Buttons ===== */
.btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 9px 14px; border-radius: 11px; font-weight: 600; font-size: 13px;
  transition: background .12s, border .12s, transform .06s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 0 16px -2px var(--glow-brand); }
.btn-primary:hover { background: var(--brand-strong); box-shadow: 0 0 22px 0 var(--glow-brand); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-soft); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { color: var(--danger); border-color: var(--danger-soft); background: var(--danger-soft); }
.btn-danger:hover { background: #fbdbd8; }
.btn-sm { padding: 6px 10px; font-size: 12.5px; }

/* ===== Page header ===== */
.page-head { margin-bottom: 22px; }
.page-greeting { font-size: 12px; color: var(--text-faint); font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.page-title { font-size: 30px; font-weight: 800; letter-spacing: -.03em; margin: 4px 0 6px; }
.page-title em { font-style: italic; font-weight: 500; }
.page-sub { color: var(--text-soft); font-size: 14px; }
.section-title { font-size: 15px; font-weight: 800; margin: 26px 0 12px; letter-spacing: -.01em; }

/* ===== Quick actions row ===== */
.quick-row { display: flex; gap: 10px; margin: 16px 0 6px; flex-wrap: wrap; }

/* ===== Alert strip ===== */
.alert-strip {
  border: 1px solid var(--warn-soft); background: var(--warn-soft);
  border-radius: var(--radius); padding: 14px 18px; margin-top: 18px;
  display: flex; align-items: center; gap: 12px;
}
.alert-strip .ico { font-size: 18px; }
.alert-strip b { display: block; font-size: 13px; }
.alert-strip span { color: var(--text-soft); font-size: 13px; }

/* ===== Metric cards ===== */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.metric {
  background:
    linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,0) 42%),
    var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  transition: transform .1s, box-shadow .12s, border-color .12s;
}
.metric:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--border) 60%, var(--text-faint)); }
.metric-label { font-size: 11.5px; font-weight: 700; color: var(--text-soft); text-transform: uppercase; letter-spacing: .06em; }
.metric-desc { font-size: 12px; color: var(--text-faint); margin-top: 3px; }
.metric-value { font-size: 42px; font-weight: 800; letter-spacing: -.035em; margin-top: 14px; line-height: 1; }
.metric.brand { background: linear-gradient(145deg, #ff4013, #ff7a3d); border: none; color: #fff; box-shadow: 0 0 28px -6px var(--glow-brand); }
.metric.brand .metric-label, .metric.brand .metric-desc { color: rgba(255,255,255,.88); }
.metric.brand .metric-value { color: #fff; }
.metric .accent { position: absolute; right: 16px; top: 16px; width: 8px; height: 8px; border-radius: 50%; }
.metric.warn .accent { background: var(--warn); box-shadow: 0 0 10px 1px var(--glow-warn); }
.metric.danger .accent { background: var(--danger); box-shadow: 0 0 10px 1px var(--glow-danger); }
.metric.info .accent { background: var(--info); box-shadow: 0 0 10px 1px var(--glow-info); }

/* ===== Kanban board ===== */
.board-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.board-toolbar .filter {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 11px;
  background: var(--surface); font-size: 13px; color: var(--text); outline: none;
}
.board-toolbar .filter:focus { border-color: var(--brand); }

/* ===== Dropdown customizado (substitui o <select> nativo) ===== */
.cselect { position: relative; }
.cselect.as-field { display: block; width: 100%; }
.cselect.as-filter { display: inline-block; vertical-align: middle; }
.cselect-trigger {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); border-radius: 11px; font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: border-color .12s, box-shadow .12s;
}
.cselect.as-filter .cselect-trigger { width: auto; min-width: 138px; }
.cselect-trigger:hover { border-color: var(--text-faint); }
.cselect-trigger.open { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.cselect-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cselect-arrow { color: var(--text-faint); font-size: 10px; flex-shrink: 0; transition: transform .15s; }
.cselect-trigger.open .cselect-arrow { transform: rotate(180deg); }

.cselect-panel {
  z-index: 300; max-height: 288px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-lg); padding: 6px; display: flex; flex-direction: column; gap: 2px;
  animation: pop .12s cubic-bezier(.2,.8,.2,1);
}
.cselect-option {
  text-align: left; border: none; background: transparent; color: var(--text);
  padding: 9px 11px; border-radius: 7px; font-size: 13px; font-weight: 600; cursor: pointer;
  white-space: nowrap; font-family: inherit;
}
.cselect-option:hover { background: var(--surface-2); }
.cselect-option.selected { background: var(--brand-soft); color: var(--brand); }
.board-scroll { overflow-x: auto; padding-bottom: 10px; }
.board { display: flex; gap: 10px; min-height: 60vh; }
.column {
  background: var(--surface-2); border-radius: var(--radius); flex: 1 1 0; min-width: 172px;
  display: flex; flex-direction: column; max-height: calc(100vh - 220px);
}
.column.drag-over { outline: 2px dashed var(--brand); outline-offset: -2px; background: var(--brand-soft); }
.column-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px; }
.column-dot { width: 9px; height: 9px; border-radius: 50%; }
.column-title { font-weight: 800; font-size: 13.5px; }
.column-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.column-count { font-size: 12px; color: var(--text-soft); background: var(--surface); padding: 2px 8px; border-radius: 20px; font-weight: 700; flex-shrink: 0; }

/* menu da lista (⋯) */
.column-menu-wrap { position: relative; flex-shrink: 0; }
.column-menu { border: none; background: transparent; color: var(--text-faint); font-size: 16px; line-height: 1; padding: 2px 4px; border-radius: 6px; cursor: pointer; }
.column-menu:hover { background: var(--surface); color: var(--text); }
.list-menu {
  position: absolute; top: 26px; right: 0; z-index: 20; min-width: 190px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-lg); padding: 6px; display: flex; flex-direction: column; gap: 2px;
}
.list-menu[hidden] { display: none; }
.list-menu button {
  text-align: left; border: none; background: transparent; color: var(--text);
  padding: 8px 10px; border-radius: 7px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.list-menu button:hover { background: var(--surface-2); }
.list-menu button.danger { color: var(--danger); }
.list-menu button.danger:hover { background: var(--danger-soft); }

/* coluna "Adicionar outra lista" */
.add-list { flex: 0 0 260px; width: 260px; }
.add-list-btn {
  width: 100%; text-align: left; padding: 12px 14px; border-radius: var(--radius);
  border: 1px dashed var(--border); background: rgba(255,255,255,.03); color: var(--text-soft);
  font-weight: 700; font-size: 13.5px; cursor: pointer;
}
.add-list-btn:hover { background: var(--surface-2); color: var(--text); }
.add-list-compose { background: var(--surface-2); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.add-list-compose[hidden] { display: none; }
.add-list-input {
  width: 100%; border: 1px solid var(--brand); border-radius: var(--radius-sm); padding: 10px 12px;
  font-size: 13.5px; outline: none; box-shadow: 0 0 0 3px var(--brand-soft); background: var(--surface); color: var(--text);
}

/* métrica verde (concluídas) */
.metric.ok .accent { background: var(--ok); box-shadow: 0 0 10px 1px var(--glow-ok); }
.column-body { padding: 4px 8px 8px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.column-head { padding: 12px 12px 9px; }
.column-foot { padding: 0 8px 10px; }

/* ===== Card (limpo, check à esquerda) ===== */
.card {
  display: flex; align-items: flex-start; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-left-width: 3px;
  border-radius: var(--radius-sm);
  padding: 8px 9px; box-shadow: var(--shadow-sm); cursor: grab;
  transition: box-shadow .12s, transform .06s;
}
.card.prio-alta  { border-left-color: var(--danger); }
.card.prio-media { border-left-color: var(--warn); }
.card.prio-baixa { border-left-color: var(--info); }
.card:hover { box-shadow: var(--shadow); }
.card.dragging { opacity: .5; cursor: grabbing; }
.card.is-done { opacity: .55; }
.card.is-done .card-title { text-decoration: line-through; color: var(--text-soft); }

.card-main { flex: 1; min-width: 0; }
.card-title { font-weight: 600; font-size: 12px; line-height: 1.3; color: var(--text); }
.card-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 10px; color: var(--text-faint); }
.card-client { display: flex; align-items: center; gap: 5px; font-weight: 600; color: var(--text-soft); min-width: 0; }
.card-client { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.card-recur { color: var(--brand); font-weight: 800; font-size: 12px; line-height: 1; }
.card-due { font-weight: 600; white-space: nowrap; }
.card-due.late { color: var(--danger); }
.card-due.soon { color: var(--warn); }
.card-meta .avatar { margin-left: auto; }
.card-service {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 7px;
  font-size: 10px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase;
  color: var(--sc);
}
.card-service .svc-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sc); box-shadow: 0 0 7px 0 var(--sc); flex-shrink: 0; }
.card .card-labels { margin-bottom: 6px; }
.card .label-bar { height: 5px; width: 22px; }
.card .avatar.sm { width: 19px; height: 19px; font-size: 9px; }

/* pill (usado no detalhe da demanda) */
.pill { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 20px; }
.pill.prio-alta { background: var(--danger-soft); color: var(--danger); box-shadow: 0 0 12px -3px var(--glow-danger); }
.pill.prio-media { background: var(--warn-soft); color: var(--warn); box-shadow: 0 0 12px -3px var(--glow-warn); }
.pill.prio-baixa { background: var(--info-soft); color: var(--info); box-shadow: 0 0 12px -3px var(--glow-info); }

/* checkbox de concluir (lado ESQUERDO do cartão) */
.card-check {
  flex-shrink: 0; margin-top: 1px;
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border);
  background: transparent; color: transparent; cursor: pointer; padding: 0;
  display: grid; place-items: center; font-size: 11px; line-height: 1;
  transition: border-color .12s, background .12s, color .12s, transform .08s;
}
.card-check:hover { border-color: var(--ok); color: var(--ok); }
.card-check.checked { background: var(--ok); border-color: var(--ok); color: #fff; box-shadow: 0 0 12px 0 var(--glow-ok); }
.card-check:active { transform: scale(.88); }
.avatar {
  width: 24px; height: 24px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; flex-shrink: 0;
}
.avatar.sm { width: 22px; height: 22px; font-size: 10px; }
.avatar.lg { width: 40px; height: 40px; font-size: 15px; }
.avatar.none { background: var(--surface-2) !important; color: var(--text-faint); border: 1px dashed var(--border); }
.avatar.has-photo, .client-badge.has-photo, .ig-avatar.has-photo { overflow: hidden; background: var(--surface-2); }
.avatar.has-photo img, .client-badge.has-photo img, .ig-avatar.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* uploader de foto (cliente / usuário) — avatar redondo + botões */
.avatar-uploader { display: flex; align-items: center; gap: 14px; }
.avatar-uploader-prev { width: 64px; height: 64px; border-radius: 16px; overflow: hidden; flex-shrink: 0; background: var(--surface-2); border: 1px solid var(--border); }
.avatar-uploader-prev img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-uploader-prev span { width: 100%; height: 100%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 22px; }
.avatar-uploader-actions { display: flex; flex-direction: column; gap: 6px; }
.avatar-uploader-prev.round { border-radius: 50%; }
.card-due { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--text-soft); display: flex; align-items: center; gap: 4px; }
.card-due.late { color: var(--danger); }
.card-due.soon { color: var(--warn); }

/* ===== Trello labels (etiquetas) ===== */
.card-labels { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 9px; }
.label-bar { height: 8px; width: 34px; border-radius: 5px; }
.label-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.label-chip {
  border: 1.5px solid var(--lc, var(--border)); background: transparent; color: var(--lc, var(--text-soft));
  padding: 5px 12px; border-radius: 20px; font-size: 12.5px; font-weight: 700; opacity: .55; transition: opacity .12s, background .12s;
}
.label-chip:hover { opacity: .85; }
.label-chip.on { opacity: 1; background: var(--lc); color: #fff; border-color: var(--lc); box-shadow: 0 0 12px -2px var(--lc); }

/* ===== Quick add (compor cartão inline) ===== */
.column-foot { padding: 0 10px 12px; }
.column-add {
  width: 100%; padding: 9px; border-radius: var(--radius-sm); border: 1px dashed var(--border);
  background: transparent; color: var(--text-soft); font-weight: 600; font-size: 13px; text-align: left;
}
.column-add:hover { background: var(--surface); color: var(--text); }
.quick-compose { display: flex; flex-direction: column; gap: 8px; }
.quick-compose[hidden] { display: none; }
.quick-input {
  width: 100%; border: 1px solid var(--brand); border-radius: var(--radius-sm); padding: 10px 12px;
  font-size: 13.5px; resize: none; outline: none; box-shadow: 0 0 0 3px var(--brand-soft); font-family: inherit;
  background: var(--surface); color: var(--text);
}
.quick-input::placeholder { color: var(--text-faint); }
.quick-actions { display: flex; align-items: center; gap: 6px; }

/* ===== Calendar (Agenda) ===== */
.cal-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.cal-title { font-size: 17px; font-weight: 800; letter-spacing: -.02em; min-width: 150px; text-align: center; }
.cal-title span { color: var(--text-faint); font-weight: 600; }
.cal-legend { margin-left: auto; font-size: 12px; color: var(--text-faint); }
.cal-legend-late { color: var(--danger); font-weight: 600; }
.cal-panel { padding: 0; overflow: hidden; }
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.cal-head-cell { padding: 10px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-cell {
  min-height: 118px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 8px; display: flex; flex-direction: column; gap: 5px; overflow: hidden;
}
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell.muted { background: var(--surface-2); }
.cal-cell.muted .cal-daynum { color: var(--text-faint); }
/* dias passados: um pouco mais escuros que os próximos, e itens meio apagados */
.cal-cell.past { background: rgba(0, 0, 0, .16); }
.cal-cell.past .cal-daynum { color: var(--text-faint); }
.cal-cell.past.muted { background: rgba(0, 0, 0, .22); }
.cal-cell.past .cal-chip, .cal-cell.past .plan-chip, .cal-cell.past .gcal-chip, .cal-cell.past .cal-more { opacity: .5; transition: opacity .12s; }
.cal-cell.past .cal-chip:hover, .cal-cell.past .plan-chip:hover, .cal-cell.past .gcal-chip:hover { opacity: 1; }
.cal-cell.today { background: var(--brand-soft); }
.cal-daynum { font-size: 12.5px; font-weight: 700; color: var(--text-soft); display: flex; align-items: center; gap: 6px; }
.cal-today-tag { background: var(--brand); color: #fff; font-size: 10px; padding: 1px 7px; border-radius: 20px; font-weight: 700; box-shadow: 0 0 10px 0 var(--glow-brand); }
.cal-items { display: flex; flex-direction: column; gap: 4px; }
.cal-chip {
  display: flex; align-items: center; gap: 6px; width: 100%; text-align: left;
  border: 1px solid var(--border); background: var(--surface); border-radius: 7px; padding: 4px 7px;
  font-size: 11.5px; font-weight: 600; color: var(--text); cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: transform .06s, box-shadow .1s;
}
.cal-chip:hover { box-shadow: var(--shadow-sm); transform: translateX(1px); }
.cal-chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cc); flex-shrink: 0; box-shadow: 0 0 7px 0 var(--cc); }
.cal-chip.late { border-color: var(--danger); border-left: 3px solid var(--danger); }
.cal-chip.done { opacity: .5; text-decoration: line-through; }
.cal-more { font-size: 11px; color: var(--text-faint); font-weight: 600; padding-left: 4px; }

@media (max-width: 860px) {
  .cal-cell { min-height: 76px; padding: 5px; }
  .cal-chip { font-size: 10px; }
}

/* ===== Planejamento social (calendário + prévia do feed) ===== */
.plan-grid { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start; }
@media (max-width: 1024px) { .plan-grid { grid-template-columns: 1fr; } }

.plan-chip {
  position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 3px; width: 100%; text-align: left;
  border: 1px solid var(--border); background: var(--surface); border-radius: 7px; padding: 4px 7px;
  font-size: 11px; font-weight: 700; color: var(--text); cursor: pointer;
  overflow: hidden; border-left: 3px solid var(--pc);
}
.plan-chip-main { display: flex; align-items: center; gap: 6px; min-width: 0; padding-right: 12px; }
.plan-chip:hover { box-shadow: var(--shadow-sm); }
.plan-chip[draggable="true"] { cursor: grab; }
.plan-chip.dragging { opacity: .4; cursor: grabbing; }
.cal-cell.cal-drag-over { background: var(--brand-soft); outline: 2px dashed var(--brand); outline-offset: -2px; }
/* posts sem criativo ficam com borda tracejada no calendário — chama atenção */
.plan-chip.no-art { border-style: dashed; opacity: .82; }
.plan-chip-tag { align-self: flex-start; margin-left: 14px; font-family: var(--font-mono); font-size: 8.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-faint); background: var(--surface-2); border-radius: 4px; padding: 1px 5px; }
.plan-chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pc); box-shadow: 0 0 6px 0 var(--pc); flex-shrink: 0; }
.plan-legend-item { display: inline-flex; align-items: center; gap: 5px; margin-left: 10px; font-size: 11.5px; color: var(--text-faint); }
.cal-cell[data-day] { cursor: pointer; }
.cal-cell[data-day]:hover { background: var(--surface); }
.cal-cell.muted[data-day]:hover { background: var(--surface-2); }

/* prévia do Instagram */
.ig-phone { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); position: sticky; top: 86px; }
.ig-topbar { padding: 12px 14px; border-bottom: 1px solid var(--border); font-weight: 800; font-size: 15px; }
.ig-profile { display: flex; align-items: center; gap: 16px; padding: 14px; }
.ig-avatar { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 19px; flex-shrink: 0; }
.ig-stats { display: flex; gap: 14px; flex: 1; justify-content: space-around; }
.ig-stats > div { text-align: center; }
.ig-stats b { display: block; font-size: 15px; font-weight: 800; }
.ig-stats span { font-size: 11px; color: var(--text-faint); }
.ig-name { padding: 0 14px 12px; font-weight: 700; font-size: 13.5px; }
.ig-bio { font-weight: 500; color: var(--text-soft); font-size: 12.5px; margin-top: 2px; }
.ig-tabs { display: flex; justify-content: center; border-top: 1px solid var(--border); padding: 9px; font-size: 12px; font-weight: 700; color: var(--text); }
.ig-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 2px; background: var(--border); }
.ig-cell {
  position: relative; aspect-ratio: 4 / 5; border: none; padding: 0; cursor: pointer;
  background-size: cover; background-position: center; background-color: var(--surface-2);
  display: grid; place-items: center;
}
.ig-cell.empty { cursor: default; }
.ig-cell:not(.empty):hover { filter: brightness(1.09); }
.ig-corner { position: absolute; top: 5px; right: 6px; color: #fff; font-size: 12px; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.ig-ph { color: rgba(255,255,255,.92); font-size: 22px; }

/* upload de imagem no formulário de post */
.img-drop { cursor: pointer; }
.img-prev {
  border: 1px dashed var(--border); border-radius: 12px; min-height: 150px; overflow: hidden;
  display: grid; place-items: center; color: var(--text-faint); font-size: 13px; background: var(--surface-2);
}
.img-prev img { width: 100%; height: auto; display: block; max-height: 280px; object-fit: cover; }
.img-drop:hover .img-prev { border-color: var(--brand); }
/* comprovantes de pagamento */
.receipt-thumb { display: inline-block; width: 40px; height: 40px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); vertical-align: middle; }
.receipt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.receipt-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 4px 9px; border-radius: 8px; background: var(--surface-2); color: var(--text-soft); border: 1px solid var(--border); text-decoration: none; }
.receipt-badge.pdf { color: var(--danger); }
a.receipt-thumb:hover, a.receipt-badge:hover { border-color: var(--brand); }
/* demanda paga */
.card-paid { font-size: 10.5px; font-weight: 800; color: var(--ok); background: var(--ok-soft); padding: 1px 6px; border-radius: 6px; }
.detail-paid { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.paid-badge { font-size: 12px; font-weight: 800; color: var(--ok); background: var(--ok-soft); padding: 4px 10px; border-radius: 999px; }

/* ===== Tables / lists ===== */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-faint); font-weight: 700; padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.table td { padding: 14px 18px; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--surface-2); }
.cell-main { display: flex; align-items: center; gap: 12px; }
.cell-name { font-weight: 700; }
.cell-sub { font-size: 12px; color: var(--text-faint); }
.tag {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 20px; background: var(--surface-2); color: var(--text-soft);
}
.tag.role-Admin { background: var(--brand-soft); color: var(--brand-strong); }
.tag.role-Gestor { background: var(--info-soft); color: var(--info); }
.tag.role-Membro { background: var(--surface-2); color: var(--text-soft); }
.tag.status-todo { background: var(--surface-2); color: var(--text-soft); }
.tag.status-doing { background: var(--info-soft); color: var(--info); }
.tag.status-review { background: var(--warn-soft); color: var(--warn); }
.tag.status-approval { background: rgba(168, 85, 247, .16); color: #a855f7; }
.tag.status-done { background: var(--ok-soft); color: var(--ok); }

/* input de valor da comissão */
.comm-amount-wrap { display: inline-flex; align-items: center; gap: 6px; }
.comm-amount-wrap .comm-unit { font-size: 12px; font-weight: 700; color: var(--text-faint); }
.comm-amount-wrap input { width: 90px; }
.filter.comm-type { min-width: 150px; }

/* ===== Toggle / switch ===== */
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { display: none; }
.switch-track { width: 40px; height: 22px; border-radius: 20px; background: var(--surface-2); border: 1px solid var(--border); position: relative; transition: background .15s, border-color .15s; flex-shrink: 0; }
.switch-knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-faint); transition: transform .15s, background .15s; }
.switch input:checked + .switch-track { background: var(--brand); border-color: var(--brand); box-shadow: 0 0 12px -2px var(--glow-brand); }
.switch input:checked + .switch-track .switch-knob { transform: translateX(18px); background: #fff; }
.switch-text { font-size: 13px; font-weight: 600; color: var(--text-soft); }

/* ===== Badges de cliente (segmento / fixo) ===== */
.client-tags { display: flex; align-items: center; gap: 8px; margin-top: 5px; flex-wrap: wrap; }
.seg-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: var(--sg); }
.seg-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sg); box-shadow: 0 0 6px 0 var(--sg); flex-shrink: 0; }
.fixo-badge { font-size: 10.5px; font-weight: 800; color: var(--brand); background: var(--brand-soft); padding: 2px 8px; border-radius: 20px; }
/* área de atuação do membro (equipe) */
.area-chip { display: inline-block; font-size: 10.5px; font-weight: 700; color: var(--ac); background: color-mix(in srgb, var(--ac) 16%, transparent); padding: 2px 8px; border-radius: 20px; margin: 1px 3px 1px 0; }

/* ===== Cards grid (clients) ===== */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.client-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-sm); transition: transform .1s, box-shadow .12s;
}
.client-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.client-card.is-fixo { box-shadow: var(--shadow-sm), inset 3px 0 0 var(--brand); }
.client-card.is-fixo:hover { box-shadow: var(--shadow), inset 3px 0 0 var(--brand); }
.client-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.client-badge { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 17px; }
.client-stats { display: flex; gap: 18px; margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--border); }
.client-stat b { display: block; font-size: 20px; font-weight: 800; }
.client-stat span { font-size: 11.5px; color: var(--text-faint); }

/* ===== Empty state ===== */
.empty { text-align: center; color: var(--text-faint); padding: 50px 20px; }
.empty .ico { font-size: 40px; opacity: .4; }
.empty p { margin: 10px 0 0; line-height: 1.5; }
.empty .empty-title { margin: 12px 0 2px; font-size: 15px; font-weight: 700; color: var(--text-soft); }
.empty .btn { margin-top: 16px; }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(24, 26, 45, .42);
  display: grid; place-items: center; z-index: 50; padding: 20px;
  animation: fade .12s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto;
  animation: pop .14s cubic-bezier(.2,.8,.2,1);
}
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.modal-head { padding: 20px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.modal-head h3 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.modal-close { margin-left: auto; background: none; border: none; font-size: 22px; color: var(--text-faint); line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 22px; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

.field { margin-bottom: 16px; }
.field > label:not(.switch) { display: block; font-size: 12.5px; font-weight: 700; color: var(--text-soft); margin-bottom: 6px; }
/* switch dentro de .field: mantém o layout em linha (senão a regra acima empurrava o botão pra cima do texto) */
.field label.switch { display: flex; align-items: center; gap: 10px; margin-bottom: 0; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 13.5px; outline: none; background: var(--surface); color: var(--text); transition: border .12s, box-shadow .12s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.field textarea { resize: vertical; min-height: 84px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.detail-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0; }
.detail-meta .m-label { font-size: 11.5px; color: var(--text-faint); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.detail-meta .m-val { font-size: 14px; font-weight: 700; margin-top: 4px; display: flex; align-items: center; gap: 8px; }
.detail-desc { background: var(--surface-2); border-radius: 12px; padding: 14px; font-size: 13.5px; color: var(--text-soft); line-height: 1.55; white-space: pre-wrap; }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #1a2536; color: #fff; border: 1px solid var(--border);
  padding: 12px 20px; border-radius: 12px;
  font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-lg); z-index: 100;
  animation: toast-in .2s ease;
}
@keyframes toast-in { from { transform: translate(-50%, 12px); opacity: 0; } }

/* ===== Responsive ===== */
/* botão de menu (só aparece no mobile) + backdrop do drawer */
.topbar-menu { display: none; align-items: center; justify-content: center; width: 40px; height: 40px; flex: 0 0 auto; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 10px; font-size: 18px; cursor: pointer; }
.topbar-menu:hover { background: var(--surface); }
.sidebar-backdrop { display: none; }

@media (max-width: 860px) {
  #app, #app.sidebar-collapsed { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: 0; left: 0; width: 258px; max-width: 82vw; height: 100dvh; z-index: 60; transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .sidebar-backdrop.show { opacity: 1; pointer-events: auto; }
  .sidebar-foot .sidebar-toggle { display: none; }
  .topbar-menu { display: inline-flex; }
  .topbar { height: auto; min-height: 60px; padding: 10px 16px; gap: 10px; }
  .topbar-search { max-width: none; }
  .topbar-actions { gap: 8px; }
  .content { padding: 16px; }
  .metrics, .fin-summary { grid-template-columns: 1fr; }
  .panel { overflow-x: auto; }
  .page-head { gap: 12px; }
}
/* telas bem estreitas: botão "Lançar demanda" vira só o + */
@media (max-width: 560px) {
  .topbar .btn-label-full { display: none; }
  #btn-new-demand { padding: 10px 13px; }
  .theme-switch { display: none; }
  .content { padding: 13px; }
  .metric-value { font-size: 34px; }
}

/* ===== Tela de login / cadastro (modo real) ===== */
.auth-overlay { position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; padding: 20px; background: var(--bg); background-image: var(--app-bg-image); background-attachment: fixed; }
.auth-overlay[hidden] { display: none; }
.auth-card { width: 100%; max-width: 384px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 30px 26px; }
.auth-brand { font-weight: 800; font-size: 34px; letter-spacing: -.04em; color: var(--logo-ink); display: inline-flex; align-items: baseline; line-height: 1; }
.auth-brand svg { height: 34px; width: auto; display: block; }
.auth-brand .k-ink { fill: currentColor; }
.auth-brand .k-dot { fill: #f90b0b; }
.auth-brand-mobile svg { height: 30px; }
.auth-subtitle { font-size: 10.5px; font-weight: 700; letter-spacing: .26em; color: var(--text-faint); margin: 7px 0 22px; }
.auth-tabs { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 4px; margin-bottom: 18px; }
.auth-tab { flex: 1; border: none; background: transparent; color: var(--text-soft); padding: 9px; border-radius: 7px; font-weight: 700; font-size: 13px; cursor: pointer; transition: background .12s, color .12s; }
.auth-tab.on { background: var(--brand); color: #fff; box-shadow: 0 0 12px -2px var(--glow-brand); }
.auth-form { display: flex; flex-direction: column; gap: 4px; }
.auth-form[hidden] { display: none; }
.auth-form label { font-size: 12.5px; font-weight: 700; color: var(--text-soft); margin-top: 10px; }
.auth-form input { padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font-size: 14px; outline: none; transition: border-color .12s, box-shadow .12s; }
.auth-form input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.auth-submit { margin-top: 20px; width: 100%; justify-content: center; padding: 12px; }
.auth-link { background: none; border: none; color: var(--text-faint); font-size: 12.5px; cursor: pointer; margin-top: 12px; }
.auth-link:hover { color: var(--brand); }
.auth-note { font-size: 12px; color: var(--text-faint); margin-top: 16px; line-height: 1.5; }
.auth-msg { font-size: 13px; margin-top: 14px; text-align: center; min-height: 18px; font-weight: 600; }
.auth-msg.err { color: var(--danger); }
.auth-msg.ok { color: var(--ok); }
.auth-loading { text-align: center; color: var(--text-soft); margin-top: 12px; font-size: 13px; }
.auth-loading[hidden] { display: none; }

.me-logout { margin-left: auto; background: transparent; border: none; color: var(--text-faint); font-size: 16px; cursor: pointer; padding: 4px 7px; border-radius: 6px; flex-shrink: 0; }
.me-logout:hover { color: var(--danger); background: var(--surface-2); }

/* ===== Estilo premium (editorial cinematográfico — site Kolbe) ===== */
/* micro-labels em fonte mono, maiúsculas e bem espaçadas (assinatura do site) */
.page-greeting,
.nav-section,
.brand-sub,
.detail-meta .m-label,
.client-stat span,
.ig-stats span,
.table th,
.metric-label {
  font-family: var(--font-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.page-greeting { font-size: 11px; letter-spacing: .2em; }
.nav-section { letter-spacing: .16em; }
.brand-sub { letter-spacing: .24em; }
.metric-label { font-size: 10.5px; letter-spacing: .1em; font-weight: 700; }
.metric.brand .metric-label { color: rgba(255,255,255,.9); }
.table th { font-size: 10px; letter-spacing: .1em; }
.detail-meta .m-label { font-size: 10px; letter-spacing: .12em; }
.client-stat span, .ig-stats span { font-size: 9.5px; letter-spacing: .1em; }

/* títulos maiores e mais editoriais */
.page-title { font-weight: 700; letter-spacing: -.035em; }
.page-title:not([style*="font-size"]) { font-size: 34px; line-height: 1.05; }
.page-title em { font-weight: 400; }
.brand-word { letter-spacing: -.05em; }

/* botões e busca em pílula (como o site) */
.btn, .btn-sm { border-radius: 999px; }
.topbar-search input { border-radius: 999px; padding-left: 40px; }
.topbar-search .search-ico { left: 15px; }
.metric { border-radius: var(--radius); }

/* ===== Permissões por pessoa (toggles) ===== */
.perm-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.perm-item { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text); }
.perm-item:hover { border-color: var(--text-faint); }
.perm-item input { accent-color: var(--brand); width: 16px; height: 16px; flex-shrink: 0; }
@media (max-width: 520px) { .perm-list { grid-template-columns: 1fr; } }

/* mensalidade de contrato no card do cliente */
.monthly-badge { font-size: 10.5px; font-weight: 800; color: var(--ok); background: var(--ok-soft); padding: 2px 8px; border-radius: 20px; }

/* abas do Financeiro (Empresa / Meu) */
.fin-tabs { display: inline-flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 4px; margin-bottom: 22px; }
.fin-tab { border: none; background: transparent; color: var(--text-soft); padding: 9px 20px; border-radius: 999px; font-weight: 700; font-size: 13px; cursor: pointer; transition: background .12s, color .12s; }
.fin-tab.on { background: var(--brand); color: #fff; box-shadow: 0 0 14px -2px var(--glow-brand); }
.fin-tab:hover:not(.on) { color: var(--text); }

/* ===== Planejamento: legenda maior, status e lista de posts ===== */
.caption-area { min-height: 170px; line-height: 1.5; }
.plan-chip-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-appr { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.ig-appr { position: absolute; top: 5px; left: 5px; width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(0,0,0,.4); }

.post-list { display: flex; flex-direction: column; gap: 14px; max-width: 920px; }
.post-list-card { display: flex; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow-sm); cursor: pointer; transition: box-shadow .12s; }
.post-list-card:hover { box-shadow: var(--shadow); }
.pl-img { width: 116px; flex-shrink: 0; aspect-ratio: 4 / 5; border-radius: 12px; background-size: cover; background-position: center; background-color: var(--surface-2); display: grid; place-items: center; }
.pl-img.ph span { font-size: 26px; color: rgba(255,255,255,.9); }
.pl-body { flex: 1; min-width: 0; }
.pl-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.pl-date { font-size: 11.5px; color: var(--text-faint); font-weight: 700; }
.appr-badge { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--ac); border: 1.5px solid var(--ac); padding: 2px 9px; border-radius: 20px; }
.pl-caption { font-size: 13.5px; line-height: 1.55; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.pl-note { margin-top: 10px; font-size: 12.5px; color: var(--warn); background: var(--warn-soft); padding: 8px 11px; border-radius: 10px; }

/* ===== Página pública de aprovação (cliente) ===== */
.appr-page { max-width: 640px; margin: 0 auto; padding: 8px 16px 60px; }
.appr-head { display: flex; align-items: center; gap: 14px; padding: 18px 0 18px; border-bottom: 1px solid var(--border); margin-bottom: 20px; position: sticky; top: 0; background: var(--bg); z-index: 2; }
.appr-brand { display: flex; align-items: center; gap: 12px; flex: 1; }
.appr-title { font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
.appr-sub { font-size: 10px; color: var(--text-faint); font-family: var(--font-mono); letter-spacing: .1em; text-transform: uppercase; margin-top: 2px; }
.appr-count { font-size: 12px; font-weight: 800; color: var(--brand); background: var(--brand-soft); padding: 6px 12px; border-radius: 20px; white-space: nowrap; }
.appr-count.done { color: var(--ok); background: var(--ok-soft); }
.appr-list { display: flex; flex-direction: column; gap: 18px; }
.appr-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.appr-img { width: 100%; aspect-ratio: 4 / 5; max-height: 440px; background-size: cover; background-position: center; background-color: var(--surface-2); display: grid; place-items: center; }
.appr-img.ph span { font-size: 42px; color: rgba(255,255,255,.9); }
.appr-cbody { padding: 16px 18px 18px; }
.appr-actions { display: flex; gap: 10px; margin-top: 14px; }
.btn-appr-ok, .btn-appr-no { flex: 1; justify-content: center; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-weight: 700; }
.btn-appr-ok.on, .btn-appr-ok:hover { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-appr-no.on, .btn-appr-no:hover { background: var(--warn); border-color: var(--warn); color: #fff; }
.appr-noteform { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.appr-noteform[hidden] { display: none; }
.appr-foot { text-align: center; color: var(--text-faint); font-size: 12px; margin-top: 34px; display: flex; align-items: center; justify-content: center; gap: 7px; }
.appr-empty { max-width: 360px; margin: 90px auto; text-align: center; }
.appr-empty p { color: var(--text-soft); margin-top: 18px; line-height: 1.6; }
/* logo oficial na página de aprovação */
.appr-logo { color: var(--logo-ink); display: flex; justify-content: center; margin-bottom: 4px; }
.appr-logo svg.klogo { height: 34px; width: auto; display: block; }
.appr-foot-logo { display: inline-flex; align-items: center; color: var(--logo-ink); }
.appr-foot-logo svg.klogo { height: 15px; width: auto; display: block; }
.appr-logo .k-ink, .appr-foot-logo .k-ink { fill: currentColor; }
.appr-logo .k-dot, .appr-foot-logo .k-dot { fill: #f90b0b; }

/* imagem COMPLETA (sem recorte) nos cards de post e na aprovação */
img.pl-img { aspect-ratio: auto; height: auto; background: none; display: block; align-self: flex-start; object-fit: contain; }
img.appr-img { aspect-ratio: auto; height: auto; max-height: none; background: none; display: block; width: 100%; object-fit: contain; }

/* Aprovação — imagem à esquerda, legenda à direita (desktop) */
@media (min-width: 760px) {
  .appr-page { max-width: 900px; }
  .appr-card { display: flex; align-items: flex-start; }
  .appr-card > .appr-carousel-wrap,
  .appr-card > .appr-img { flex: 0 0 42%; max-width: 42%; }
  .appr-card > .appr-img { align-self: stretch; }
  .appr-cbody { flex: 1 1 0; min-width: 0; padding: 20px 22px 22px; border-left: 1px solid var(--border); align-self: stretch; }
}

/* badge de conteúdo + contato no card de cliente */
.content-badge { font-size: 10.5px; font-weight: 800; color: #a855f7; background: rgba(168,85,247,.14); padding: 2px 8px; border-radius: 20px; }
.client-contact { font-size: 12.5px; color: var(--text-soft); margin-top: 12px; padding: 8px 11px; background: var(--surface-2); border-radius: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* bloco de anotações (rodapé) */
.notes-widget { display: none; position: fixed; right: 20px; bottom: 20px; z-index: 400; }
.notes-toggle { background: var(--surface); border: 1px solid var(--border); color: var(--text); font-weight: 700; font-size: 13px; padding: 10px 16px; border-radius: 999px; cursor: pointer; box-shadow: var(--shadow); }
.notes-toggle:hover { background: var(--surface-2); }
.notes-panel { position: absolute; right: 0; bottom: 52px; width: 320px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; }
.notes-panel[hidden] { display: none; }
.notes-head { display: flex; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); font-weight: 800; font-size: 13.5px; }
.notes-head .modal-close { margin-left: auto; font-size: 20px; }
.notes-panel textarea { width: 100%; border: none; background: transparent; color: var(--text); padding: 14px; font-size: 13.5px; line-height: 1.55; resize: vertical; min-height: 200px; outline: none; font-family: inherit; }
@media (max-width: 520px) { .notes-panel { width: calc(100vw - 40px); } }

/* Participantes e divisão do valor da demanda */
.part-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.part-row .cselect, .part-row select { flex: 1 1 130px; min-width: 0; }
.part-row .comm-amount-wrap { flex: 1 1 120px; }
.part-row .comm-amount-wrap input { width: 100%; }
.part-row .part-del { flex: 0 0 auto; margin-left: auto; padding: 6px 10px; color: var(--text-faint); }
.part-row .part-del:hover { color: var(--danger); }
.part-sum { margin-top: 6px; font-size: 12.5px; color: var(--text-faint); }
.detail-parts { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.detail-part { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.detail-part b { margin-left: auto; }
.card-avatars { display: inline-flex; align-items: center; }
.card-avatars .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }
.card-avatars .avatar:first-child { margin-left: 0; }
.card-avatar-more { margin-left: -4px; font-size: 10px; font-weight: 800; color: var(--text-faint); background: var(--surface-2); border-radius: 999px; padding: 1px 5px; }

/* Editor de imagens do post (carrossel) */
.carousel-edit { display: flex; flex-wrap: wrap; gap: 8px; }
.cedit-item { position: relative; width: 84px; aspect-ratio: 4 / 5; border-radius: 10px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.cedit-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cedit-num { position: absolute; left: 5px; bottom: 5px; font-size: 10px; font-weight: 800; color: #fff; background: rgba(0,0,0,.6); border-radius: 999px; min-width: 16px; height: 16px; display: grid; place-items: center; padding: 0 4px; }
.cedit-del, .cedit-mv { position: absolute; top: 4px; border: none; color: #fff; background: rgba(0,0,0,.6); width: 20px; height: 20px; border-radius: 999px; cursor: pointer; font-size: 12px; line-height: 1; display: grid; place-items: center; padding: 0; }
.cedit-del { right: 4px; }
.cedit-del:hover { background: var(--danger); }
.cedit-mv { left: 4px; font-size: 15px; }
.cedit-mv:hover { background: var(--brand); }
.carousel-empty { font-size: 12.5px; color: var(--text-faint); border: 1px dashed var(--border); border-radius: 10px; padding: 16px; text-align: center; }
/* título do post na lista + selo de carrossel */
.pl-title { font-weight: 800; font-size: 14.5px; letter-spacing: -.01em; margin: 2px 0 3px; }
.pl-img-wrap { position: relative; flex-shrink: 0; align-self: flex-start; }
.pl-carousel { position: absolute; top: 7px; right: 7px; font-size: 11px; font-weight: 800; color: #fff; background: rgba(0,0,0,.6); border-radius: 999px; padding: 2px 7px; }
/* selo de status do criativo (pronto / sem criativo ainda) */
.pl-art-badge { position: absolute; left: 7px; bottom: 7px; font-size: 10px; font-weight: 800; border-radius: 999px; padding: 2px 8px; }
.pl-art-badge.ready { color: #fff; background: rgba(23,166,115,.92); }
.pl-art-badge.missing { position: static; margin-top: 8px; color: var(--warn); background: var(--warn-soft); }
.pl-img.ph.no-art { flex-direction: column; gap: 4px; border: 1.5px dashed var(--border); }
.post-list-card.no-art { box-shadow: inset 3px 0 0 var(--warn); }
/* carrossel na página de aprovação do cliente */
.appr-carousel-wrap { position: relative; }
.appr-carousel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; touch-action: pan-y pinch-zoom; }
.appr-carousel::-webkit-scrollbar { display: none; }
.appr-carousel[data-carousel] { cursor: grab; }
.appr-carousel[data-carousel].dragging { cursor: grabbing; scroll-snap-type: none; }
.appr-carousel[data-carousel].dragging img.appr-img { pointer-events: none; }
.appr-carousel img.appr-img { scroll-snap-align: center; flex: 0 0 100%; -webkit-user-drag: none; user-select: none; }
.appr-carousel-count { position: absolute; top: 10px; right: 10px; font-size: 12px; font-weight: 800; color: #fff; background: rgba(0,0,0,.62); border-radius: 999px; padding: 3px 9px; pointer-events: none; }
.appr-dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; gap: 6px; justify-content: center; }
.appr-dot { width: 6px; height: 6px; border-radius: 999px; background: rgba(255,255,255,.5); cursor: pointer; transition: width .15s, height .15s, background .15s; box-shadow: 0 0 3px rgba(0,0,0,.4); }
.appr-dot.on { background: #fff; width: 7px; height: 7px; }

/* ===== Login — layout split-screen (marca + formulário) ===== */
.auth-shell { display: flex; width: 100%; max-width: 860px; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-lg); }
.auth-brandpanel { flex: 1 1 46%; padding: 42px 36px; display: flex; flex-direction: column; gap: 30px; background: linear-gradient(165deg, var(--surface-2), var(--surface)); position: relative; overflow: hidden; }
.auth-brandpanel::before { content: ""; position: absolute; width: 280px; height: 280px; border-radius: 50%; background: radial-gradient(closest-side, var(--glow-brand), transparent 70%); top: -70px; right: -70px; opacity: .55; pointer-events: none; }
.auth-brandpanel > * { position: relative; }
.auth-bp-title { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.22; text-wrap: balance; margin: 0; }
.auth-bp-list { list-style: none; display: flex; flex-direction: column; gap: 16px; margin: 24px 0 0; padding: 0; }
.auth-bp-list li { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--text-soft); }
.auth-bp-list li span { width: 30px; height: 30px; border-radius: 9px; background: var(--brand-soft); color: var(--brand-strong); display: grid; place-items: center; font-size: 15px; flex: 0 0 auto; }
.auth-bp-foot { margin-top: auto; font-size: 11px; color: var(--text-faint); font-family: var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
/* card do formulário (agora dentro do shell) */
.auth-card { flex: 1 1 54%; max-width: none; border: none; border-radius: 0; box-shadow: none; padding: 44px 40px; }
.auth-card-head { margin-bottom: 22px; }
.auth-brand-mobile { display: none; font-size: 30px; margin-bottom: 16px; }
.auth-welcome { font-size: 23px; font-weight: 800; letter-spacing: -.02em; margin: 0; text-wrap: balance; }
.auth-welcome-sub { font-size: 13.5px; color: var(--text-faint); margin: 5px 0 0; line-height: 1.5; }
@media (max-width: 720px) {
  .auth-shell { flex-direction: column; max-width: 420px; }
  .auth-brandpanel { display: none; }
  .auth-card { flex-basis: auto; padding: 34px 28px; }
  .auth-brand-mobile { display: inline-flex; align-items: baseline; }
}

/* Dashboard — cartões de métrica clicáveis */
.metric-link { position: relative; cursor: pointer; transition: transform .12s ease, border-color .12s ease; }
.metric-link:hover { transform: translateY(-2px); border-color: var(--brand); }
.metric-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.metric-link::after { content: "→"; position: absolute; top: 12px; right: 14px; font-size: 14px; color: var(--text-faint); opacity: 0; transition: opacity .12s; }
.metric-link:hover::after { opacity: .8; }

/* Quadro de demandas — legenda de leitura */
.board-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-size: 12px; color: var(--text-faint); margin: 0 0 12px; }
.board-legend span { display: inline-flex; align-items: center; gap: 6px; }
.board-legend .bl-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.board-legend .bl-bar { width: 4px; height: 14px; border-radius: 2px; display: inline-block; }

/* Financeiro — 2 cartões-resumo (avulso x recorrente), conta clara */
.fin-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; margin-bottom: 6px; }
.fin-sum-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px; }
.fin-sum-card.recur { box-shadow: inset 3px 0 0 var(--brand); }
.fin-sum-head { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-soft); font-weight: 700; display: flex; align-items: baseline; gap: 8px; margin-bottom: 14px; }
.fin-sum-head span { font-size: 10px; color: var(--text-faint); letter-spacing: .04em; }
.fin-sum-lines { display: flex; flex-direction: column; gap: 9px; }
.fin-sum-lines > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13.5px; color: var(--text-soft); }
.fin-sum-lines > div b { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fin-sum-lines .minus, .fin-sum-lines .minus b { color: var(--text-faint); }
.fin-sum-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--border); }
.fin-sum-total span { font-weight: 700; font-size: 13.5px; }
.fin-sum-total b { font-size: 25px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fin-sum-card.recur .fin-sum-total b { color: var(--brand); }
.fin-sum-note { font-size: 12px; color: var(--text-faint); margin: 8px 0 18px; line-height: 1.5; }
/* banner de total geral (avulso + recorrente) — financeiro pessoal */
.fin-total-banner { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 12px 0 22px; padding: 16px 22px; border-radius: 16px; background: linear-gradient(120deg, var(--brand), var(--brand-strong, var(--brand))); color: #fff; box-shadow: 0 10px 30px -12px var(--glow-brand); }
.fin-total-banner span { font-weight: 700; font-size: 14px; }
.fin-total-banner span em { font-style: normal; font-weight: 600; opacity: .8; font-size: 12.5px; }
.fin-total-banner b { font-size: 30px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fin-total-banner .fin-total-done { font-size: 12px; opacity: .85; font-weight: 600; }

/* Financeiro — regras de comissão mais intuitivas */
.section-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 26px 0 4px; }
.section-title-row .section-title { margin: 0; }
.section-badge { font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-faint); border: 1px solid var(--border); }
.section-badge.editable { background: var(--brand-soft); color: var(--brand-strong); border-color: transparent; }
.section-badge.readonly { background: transparent; }
/* guia rápido de como o dinheiro flui */
.fin-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: 6px 0 4px; }
.fin-legend-item { display: flex; gap: 11px; align-items: flex-start; padding: 13px 15px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.fin-legend-ico { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 15px; background: var(--surface-2); }
.fin-legend-item > div > b { display: block; font-size: 13.5px; margin-bottom: 3px; color: var(--text); }
.fin-legend-item span { display: block; font-size: 12px; color: var(--text-faint); line-height: 1.5; text-wrap: pretty; }
/* painel de configuração destacado (é editável) */
.panel.editable-panel { border-color: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }

/* ============================================================
   UX & acessibilidade — diretrizes de interface (sistema todo)
   ============================================================ */

/* Números alinhados e legíveis (essencial num app financeiro) */
.metric-value, .table td, .table th, .comm-amount-wrap input,
.m-val, .client-stat b, .part-sum, .card-due, .column-count,
.nav-badge, .metric-desc, .fin-metric-value {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* Foco visível para quem navega por teclado (sem sumir com outline) */
:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}
/* Toque mais responsivo no mobile, sem flash cinza */
button, a, .nav-item, .card, .label-chip, .fin-tab, .plan-chip, [role="button"] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Títulos quebram de forma equilibrada */
.page-title, .section-title, h1, h2, h3, .metric-value { text-wrap: balance; }

/* Modais não “vazam” o scroll pra página atrás */
.modal, .modal-body, #modal-root { overscroll-behavior: contain; }

/* Respeita quem pede menos movimento */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== Splash de entrada (após login) — símbolo K se desenhando ===== */
.splash {
  position: fixed; inset: 0; z-index: 900; display: grid; place-items: center;
  background: var(--bg); background-image: var(--app-bg-image); background-attachment: fixed;
}
.splash[hidden] { display: none; }
.splash.out { animation: splash-out .55s ease forwards; }
@keyframes splash-out { to { opacity: 0; visibility: hidden; } }
.splash-glow {
  position: absolute; width: 440px; height: 440px; max-width: 82vw; max-height: 82vw;
  border-radius: 50%; background: radial-gradient(closest-side, var(--glow-brand), transparent 70%);
  opacity: 0; animation: splash-glow 2s ease forwards;
}
@keyframes splash-glow { 0% { opacity: 0; transform: scale(.55); } 45% { opacity: .7; } 100% { opacity: .4; transform: scale(1); } }
.splash-k { position: relative; width: 128px; height: auto; color: var(--logo-ink); overflow: visible; animation: splash-k-in .6s ease forwards; }
@keyframes splash-k-in { from { opacity: 0; transform: scale(.86); } to { opacity: 1; transform: scale(1); } }
.splash-k .sk-ink {
  fill: transparent; stroke: currentColor; stroke-width: 6; stroke-linejoin: round;
  stroke-dasharray: 1300; stroke-dashoffset: 1300;
  animation: sk-draw 1.15s cubic-bezier(.65, 0, .35, 1) forwards .2s, sk-fill .55s ease forwards 1.05s;
}
@keyframes sk-draw { to { stroke-dashoffset: 0; } }
@keyframes sk-fill { to { fill: currentColor; stroke-width: 0; } }
.splash-k .sk-dot { fill: #f90b0b; transform-box: fill-box; transform-origin: center; transform: scale(0); animation: sk-pop .55s cubic-bezier(.34, 1.56, .64, 1) forwards 1.1s; }
@keyframes sk-pop { 0% { transform: scale(0); } 70% { transform: scale(1.28); } 100% { transform: scale(1); } }

/* ============================================================
   Documentos (orçamento / recibo / contrato) + impressão
   ============================================================ */
.doc-kind-badge { font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.doc-kind-badge.doc-orcamento { color: var(--info); background: var(--info-soft); }
.doc-kind-badge.doc-recibo { color: var(--ok); background: var(--ok-soft); }
.doc-kind-badge.doc-contrato { color: #a855f7; background: rgba(168,85,247,.15); }
/* seletor de tipo */
.doc-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.doc-picker-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; padding: 16px; border: 1px solid var(--border); background: var(--surface-2); border-radius: 12px; cursor: pointer; color: var(--text); transition: border-color .12s, transform .1s; }
.doc-picker-btn:hover { border-color: var(--brand); transform: translateY(-2px); }
.doc-picker-btn span { font-size: 24px; }
.doc-picker-btn b { font-size: 15px; }
.doc-picker-btn small { font-size: 12px; color: var(--text-faint); }
/* linha de item no formulário */
.doc-item { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.doc-item .di-desc { flex: 1 1 auto; min-width: 0; }
.doc-item .di-qty { width: 60px; flex: 0 0 auto; text-align: center; }
.doc-item .comm-amount-wrap { flex: 0 0 auto; }
.doc-item .di-unit { width: 100px; }
.doc-item .di-del { flex: 0 0 auto; color: var(--text-faint); }
.doc-item .di-del:hover { color: var(--danger); }
.doc-total-line { margin-top: 10px; text-align: right; font-size: 15px; }
.doc-total-line b { font-size: 18px; }
@media (max-width: 560px) { .doc-item { flex-wrap: wrap; } .doc-item .di-desc { flex-basis: 100%; } }

/* overlay de impressão */
.print-overlay { position: fixed; inset: 0; z-index: 700; background: #6b7280; overflow: auto; }
.print-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 12px 18px; background: var(--chrome-bg); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.print-scroll { padding: 28px 16px 60px; display: flex; justify-content: center; }

/* documento em si (sempre claro, pronto pra papel A4) */
.pdoc { width: 100%; max-width: 720px; background: #ffffff; color: #1c1c1c; border-radius: 6px; padding: 46px 46px 40px; box-shadow: 0 10px 40px rgba(0,0,0,.35); font-size: 13.5px; line-height: 1.5; }
.pdoc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; border-bottom: 2px solid #f90b0b; padding-bottom: 18px; }
.pdoc-logo { flex: 0 0 auto; }
.pdoc-logo-img { max-height: 60px; max-width: 200px; display: block; }
.pdoc-logo-k { display: inline-flex; color: #191919; }
.pdoc-logo-k svg.klogo { height: 34px; width: auto; display: block; }
.pdoc-logo-k .k-ink { fill: currentColor; }
.pdoc-logo-k .k-dot { fill: #f90b0b; }
.pdoc-co { text-align: right; font-size: 11.5px; color: #555; }
.pdoc-co-name { font-size: 15px; font-weight: 800; color: #1c1c1c; margin-bottom: 3px; }
.pdoc-title-row { display: flex; justify-content: space-between; align-items: flex-end; margin: 24px 0 4px; }
.pdoc-title-row h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 0; color: #111; }
.pdoc-meta { text-align: right; font-size: 12px; color: #555; }
.pdoc-meta b { color: #111; }
.pdoc-client { margin: 20px 0; padding: 14px 16px; background: #f7f7f8; border-radius: 8px; }
.pdoc-label { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #888; margin-bottom: 4px; }
.pdoc-client-name { font-size: 15px; font-weight: 700; color: #111; }
.pdoc-client-lines { font-size: 12px; color: #555; margin-top: 3px; }
.pdoc-items { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 13px; }
.pdoc-items th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #888; padding: 8px 10px; border-bottom: 1.5px solid #e2e2e5; }
.pdoc-items td { padding: 10px; border-bottom: 1px solid #eee; color: #222; }
.pdoc-items .num { text-align: right; }
.pdoc-items tfoot td { border-bottom: none; border-top: 2px solid #e2e2e5; padding-top: 12px; font-size: 14px; }
.pdoc-total { color: #f90b0b; font-weight: 800; font-size: 17px; }
.pdoc-recibo-frase { margin: 18px 0; font-size: 13.5px; color: #333; line-height: 1.6; }
.pdoc-body { margin: 10px 0; }
.pdoc-body p { margin: 0 0 9px; color: #2a2a2a; }
.pdoc-notes { margin: 22px 0; padding-top: 16px; border-top: 1px solid #eee; font-size: 12.5px; color: #444; }
.pdoc-sign { display: flex; justify-content: space-around; gap: 40px; margin: 60px 0 10px; }
.pdoc-sign-line { flex: 1; max-width: 260px; border-top: 1px solid #999; padding-top: 6px; text-align: center; font-size: 12px; color: #444; }
.pdoc-foot { margin-top: 34px; text-align: center; font-size: 10.5px; color: #aaa; }

@media print {
  body.printing > *:not(.print-overlay) { display: none !important; }
  .print-overlay { position: static; background: #fff; overflow: visible; }
  .print-overlay .no-print, .print-bar { display: none !important; }
  .print-scroll { padding: 0; display: block; }
  .pdoc { box-shadow: none; max-width: none; width: auto; border-radius: 0; padding: 0; }
}

/* Google Agenda — eventos (só leitura) no calendário */
.gcal-chip { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; border: 1px solid var(--border); background: var(--surface-2); border-radius: 7px; padding: 3px 7px; font-size: 11px; font-weight: 600; color: var(--text-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; border-left: 3px solid #4285F4; }
.gcal-chip:hover { color: var(--text); box-shadow: var(--shadow-sm); }
.gcal-dot { width: 7px; height: 7px; border-radius: 50%; background: #4285F4; flex-shrink: 0; box-shadow: 0 0 6px -1px #4285F4; }

/* Google Agenda — seletor de agendas (mostrar/ocultar) */
.gcal-cals { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.gcal-cals-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); margin-right: 2px; }
.gcal-cal-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font-size: 12.5px; font-weight: 600; cursor: pointer; transition: opacity .12s, background .12s; }
.gcal-cal-chip .gcal-cal-dot { width: 11px; height: 11px; border-radius: 3px; background: var(--gc); flex-shrink: 0; }
.gcal-cal-chip:hover { background: var(--surface-2); }
.gcal-cal-chip.off { opacity: .45; }
.gcal-cal-chip.off .gcal-cal-dot { background: var(--text-faint); }
.gcal-cal-chip.off { text-decoration: line-through; }

/* Orçamento com opções/planos — formulário */
.doc-option { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; background: var(--surface-2); }
.doc-option-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.doc-option-head .do-name { flex: 1 1 auto; min-width: 0; font-weight: 700; }
.doc-option-head .do-total { font-size: 13px; color: var(--text-soft); white-space: nowrap; }
.doc-option-head .do-total b { font-variant-numeric: tabular-nums; }
.doc-option-head .do-del { flex: 0 0 auto; color: var(--text-faint); }
.doc-option-head .do-del:hover { color: var(--danger); }
/* Orçamento com opções — impressão */
.pdoc-opts-intro { font-size: 13px; color: #555; margin: 6px 0 4px; }
.pdoc-option { margin: 16px 0; padding: 4px 0 8px; border-top: 1px dashed #ddd; }
.pdoc-option:first-of-type { border-top: none; }
.pdoc-option-name { font-size: 16px; font-weight: 800; color: #111; margin: 8px 0 2px; }

/* ============================================================
   Orçamento — layout escuro / editorial (proposta comercial)
   ============================================================ */
.print-overlay.print-dark { background: #08080a; }
.qdoc {
  width: 100%; max-width: 470px; background:
    radial-gradient(120% 60% at 100% 0%, rgba(249,11,11,.10), transparent 60%),
    linear-gradient(180deg, #101012, #0b0b0d);
  color: #f4f4f5; border-radius: 8px; padding: 40px 34px 30px;
  font-family: var(--font-ui, "Manrope", sans-serif); box-shadow: 0 24px 70px rgba(0,0,0,.5);
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.qdoc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.qdoc-logo { color: #f4f4f5; display: inline-flex; }
.qdoc-logo svg { height: 40px; width: auto; display: block; }
.qdoc-logo .k-ink { fill: currentColor; }
.qdoc-logo .k-dot { fill: #f90b0b; }
.qdoc-meta { text-align: right; font-family: var(--font-mono, monospace); font-size: 11px; letter-spacing: .08em; color: #7a7a82; line-height: 1.7; }
.qdoc-meta b { color: #f4f4f5; }
.qdoc-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin: 30px 0 8px; }
.qdoc-title { font-size: 46px; font-weight: 300; line-height: .96; letter-spacing: -.02em; margin: 0; color: #fff; }
.qdoc-tag { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 15px; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; font-size: 13px; color: #d0d0d4; max-width: 45%; }
.qdoc-tag i { width: 8px; height: 8px; border-radius: 50%; background: #f90b0b; flex: 0 0 auto; box-shadow: 0 0 8px 0 #f90b0b; }
.qcard { background: #161619; border: 1px solid rgba(255,255,255,.07); border-radius: 20px; padding: 24px 24px 8px; margin-top: 20px; }
.qcard-pill { display: inline-block; font-family: var(--font-mono, monospace); font-size: 10.5px; font-weight: 700; letter-spacing: .12em; color: #f26a5f; border: 1px solid rgba(249,11,11,.5); border-radius: 999px; padding: 5px 13px; }
.qcard-name { font-size: 32px; font-weight: 500; letter-spacing: -.01em; color: #fff; margin: 14px 0 0; }
.qcard-dash { border-bottom: 1px dashed rgba(255,255,255,.18); margin: 16px 0; }
.qcard-total-label { font-family: var(--font-mono, monospace); font-size: 11px; letter-spacing: .16em; color: #6f6f77; }
.qcard-total { color: #fff; margin: 2px 0 6px; line-height: 1; }
.qct-int { font-size: 62px; font-weight: 700; letter-spacing: -.03em; }
.qct-cents { font-size: 24px; font-weight: 700; vertical-align: super; color: #c8c8cc; }
.qcard-items { margin-top: 6px; }
.qitem { display: flex; gap: 16px; padding: 18px 0; border-top: 1px solid rgba(255,255,255,.07); }
.qitem-idx { font-family: var(--font-mono, monospace); font-size: 11px; color: #5f5f66; padding-top: 5px; flex: 0 0 auto; }
.qitem-body { flex: 1; min-width: 0; }
.qitem-name { font-size: 19px; font-weight: 500; color: #f0f0f2; }
.qitem-desc { font-size: 13px; color: #85858c; margin-top: 2px; }
.qitem-price { margin-top: 8px; color: #fff; }
.qip-int { font-size: 25px; font-weight: 700; letter-spacing: -.02em; }
.qip-cents { font-size: 13px; color: #9a9aa0; }
.qpay { padding-bottom: 22px; }
.qpay-label { font-family: var(--font-mono, monospace); font-size: 11px; letter-spacing: .12em; color: #6f6f77; }
.qpay-label span { color: #f90b0b; font-weight: 800; }
.qpay-title { font-size: 22px; font-weight: 500; color: #fff; margin: 12px 0 0; }
.qpay-desc { font-size: 13.5px; color: #9a9aa0; margin-top: 6px; line-height: 1.5; }
.qpay-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.08); flex-wrap: wrap; }
.qpay-pill { display: inline-flex; align-items: center; gap: 7px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 8px 15px; font-size: 12.5px; color: #d0d0d4; }
.qpay-key { font-size: 13px; color: #9a9aa0; }
.qpay-key b { color: #f0f0f2; }
.qdoc-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 26px; font-family: var(--font-mono, monospace); font-size: 10px; letter-spacing: .1em; color: #55555c; }
@media print {
  .print-overlay.print-dark { background: #08080a; }
  .qdoc { box-shadow: none; max-width: none; width: auto; border-radius: 0; }
}

/* campo de unidade no item de documento (ex.: vídeo, post) */
.doc-item .di-label { width: 74px; flex: 0 0 auto; text-align: center; }
@media (max-width: 560px) { .doc-item .di-label { width: 100%; } }

/* ============================================================
   CRM — pipeline, atividades, dashboard, config
   ============================================================ */
.crm-tabs { margin-bottom: 18px; flex-wrap: wrap; }
.crm-search { position: relative; display: inline-flex; align-items: center; }
.crm-search span { position: absolute; left: 10px; color: var(--text-faint); font-size: 14px; pointer-events: none; }
.crm-search input {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 8px 12px 8px 30px; font-size: 13px; min-width: 240px; font-family: inherit;
}
.crm-search input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }

/* cards do pipeline */
.crm-col-sum { padding: 0 14px 6px; font-size: 11.5px; font-weight: 700; color: var(--text-faint); }
.crm-card-co { font-size: 11px; color: var(--text-soft); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-card-val { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12.5px; font-weight: 800; letter-spacing: -.01em; }
.crm-noval { color: var(--text-faint); font-weight: 600; font-size: 11px; }
.crm-prob { font-size: 10px; font-weight: 700; color: var(--info); background: var(--info-soft); border-radius: 12px; padding: 1px 6px; }
.crm-days { font-size: 10px; color: var(--text-faint); font-weight: 700; white-space: nowrap; }
.crm-card.is-won { box-shadow: inset 0 0 0 1px var(--ok-soft); }
.crm-card.is-won .card-title::after { content: " ✓"; color: var(--ok); }
.crm-card.is-lostc { opacity: .6; }
.crm-card.is-lostc .card-title { text-decoration: line-through; color: var(--text-soft); }
.tag.crm-lost { background: var(--danger-soft); color: var(--danger); }

/* formulário do lead */
.crm-form-sec {
  font-size: 11.5px; font-weight: 800; color: var(--text-faint); text-transform: uppercase;
  letter-spacing: .07em; margin: 18px 0 10px; padding-top: 14px; border-top: 1px solid var(--border);
}
.crm-form-sec:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.modal.modal-lg { max-width: min(860px, 96vw); width: 96vw; }

/* atividades */
.crm-act-list { display: flex; flex-direction: column; gap: 6px; }
.crm-act-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
}
.crm-act-panel { padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.crm-act-panel .crm-act-row { background: var(--surface-2); }
.crm-act-row.concluida { opacity: .6; }
.crm-act-row.concluida .crm-act-title { text-decoration: line-through; }
.crm-act-row.cancelada { opacity: .45; }
.crm-act-ico { font-size: 16px; flex-shrink: 0; }
.crm-act-main { flex: 1; min-width: 0; }
.crm-act-title { font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-act-sub { font-size: 11.5px; color: var(--text-faint); margin-top: 1px; }
.crm-act-sub.late, .crm-act-sub.late b { color: var(--danger); }
.crm-act-done { color: var(--ok); border-color: var(--ok-soft); background: var(--ok-soft); }
.crm-act-done:hover { background: var(--ok); color: #fff; }
.crm-lead-link { color: var(--brand); font-weight: 700; cursor: pointer; text-decoration: none; }
.crm-lead-link:hover { text-decoration: underline; }

/* timeline */
.crm-tl { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 0; padding-right: 4px; }
.tl-item { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.tl-item:last-child { border-bottom: none; }
.tl-ico {
  width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border);
  display: grid; place-items: center; font-size: 12px; flex-shrink: 0;
}
.tl-body { flex: 1; min-width: 0; }
.tl-desc { font-size: 13px; font-weight: 600; line-height: 1.35; }
.tl-meta { font-size: 11px; color: var(--text-faint); margin-top: 1px; }

/* dashboard: gráficos em barras */
.crm-dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-top: 18px; }
.crm-fu-grid { margin-top: 0; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.crm-chart-panel { padding: 16px 18px; overflow: visible; }
.crm-chart-title { font-size: 13.5px; font-weight: 800; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.crm-hbar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.crm-hbar-label { width: 120px; flex-shrink: 0; font-size: 12px; font-weight: 600; color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-hbar { flex: 1; height: 14px; background: var(--surface-2); border-radius: 8px; overflow: hidden; }
.crm-hbar span { display: block; height: 100%; border-radius: 8px; min-width: 2px; transition: width .3s; }
.crm-hbar-val { width: 76px; flex-shrink: 0; text-align: right; font-size: 12px; font-weight: 800; }
.crm-hbar-val em { display: block; font-style: normal; font-weight: 600; font-size: 10px; color: var(--text-faint); }
.crm-cols { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 16px; }
.crm-col-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; min-width: 0; }
.crm-col-item b { font-size: 10px; font-weight: 700; color: var(--text-soft); white-space: nowrap; }
.crm-col-bar { width: 70%; max-width: 46px; background: linear-gradient(180deg, #ff7a3d, var(--brand)); border-radius: 6px 6px 2px 2px; box-shadow: 0 0 14px -4px var(--glow-brand); }
.crm-col-item span { font-size: 11px; color: var(--text-faint); font-weight: 700; text-transform: capitalize; }
.crm-fu-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 13px; font-weight: 600; }
.crm-fu-row:last-child { border-bottom: none; }
.crm-metric-money { font-size: 26px !important; }
.metric.crm-metric-on { outline: 2px solid var(--brand); outline-offset: 2px; }

/* configurações */
.crm-cfg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.crm-cfg-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.crm-cfg-row input[type="color"] {
  width: 34px; height: 34px; padding: 2px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-2); cursor: pointer; flex-shrink: 0;
}
.crm-cfg-row input[type="text"] {
  flex: 1; min-width: 0; background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 7px 10px; font-size: 13px; font-family: inherit;
}
.crm-cfg-row input[type="text"]:focus { border-color: var(--brand); outline: none; }
.crm-cfg-row .cselect { flex-shrink: 0; }
.crm-cfg-row button[disabled] { opacity: .3; pointer-events: none; }

/* responsivo */
@media (max-width: 860px) {
  .crm-search input { min-width: 0; width: 100%; }
  .crm-search { width: 100%; }
  .crm-hbar-label { width: 88px; }
  .crm-tabs { overflow-x: auto; flex-wrap: nowrap; max-width: 100%; }
  .crm-tabs .fin-tab { white-space: nowrap; padding: 9px 14px; }
  .modal.modal-lg { width: 100vw; }
}

/* ============================================================
   Orçamento em PDF — apresentação comercial do pacote
   (valores por período e por unidade vêm digitados; nada é calculado)
   ============================================================ */
.qitem-pkg { padding: 22px 0 20px; }
.qitem-name-up { text-transform: uppercase; letter-spacing: .02em; font-weight: 600; font-size: 17px; line-height: 1.25; }
.qspec { margin-top: 7px; font-size: 13.5px; color: #9a9aa0; line-height: 1.65; }
.qprices { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; margin-top: 14px; }
.qprice-main { font-size: 30px; font-weight: 700; letter-spacing: -.025em; color: #fff; white-space: nowrap; }
.qprice-main em { font-style: normal; font-size: 15px; font-weight: 500; color: #9a9aa0; letter-spacing: 0; }
.qprice-unit {
  display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap;
  font-size: 17px; font-weight: 700; color: #f26a5f; letter-spacing: -.01em;
  border: 1px solid rgba(249,11,11,.42); border-radius: 999px; padding: 6px 15px;
}
.qprice-unit span { font-size: 12.5px; font-weight: 500; color: #b98b86; letter-spacing: .02em; }
.qspec-total { margin-top: 12px; font-size: 12.5px; color: #7a7a82; letter-spacing: .01em; }
.qitem-sub { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed rgba(255,255,255,.12); font-size: 13px; color: #85858c; }
.qitem-sub b { font-size: 16px; color: #f0f0f2; font-weight: 700; }

/* comparativo entre pacotes */
.qcmp { padding-bottom: 20px; }
.qcmp-label { font-family: var(--font-mono, monospace); font-size: 11px; letter-spacing: .12em; color: #6f6f77; }
.qcmp-label span { color: #f90b0b; font-weight: 800; }
.qcmp-list { margin-top: 14px; }
.qcmp-row {
  display: grid; grid-template-columns: minmax(0,1fr) auto auto;
  align-items: baseline; gap: 10px 14px; padding: 12px 0;
  border-top: 1px solid rgba(255,255,255,.07); font-size: 14px;
}
.qcmp-row > span { min-width: 0; }
.qcmp-qty { overflow-wrap: anywhere; }
.qcmp-month, .qcmp-unit { white-space: nowrap; }
.qcmp-head {
  border-top: none; padding: 0 0 4px; font-family: var(--font-mono, monospace);
  font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: #5f5f66;
}
.qcmp-qty { font-weight: 600; color: #f0f0f2; }
.qcmp-month { color: #c8c8cc; font-variant-numeric: tabular-nums; text-align: right; }
.qcmp-head > span:nth-child(2), .qcmp-head > span:nth-child(3) { text-align: right; }
.qcmp-month em, .qcmp-unit em { font-style: normal; font-size: 11.5px; color: #7a7a82; }
.qcmp-unit { font-weight: 700; color: #f26a5f; font-variant-numeric: tabular-nums; text-align: right; }

/* nome do cliente: encolhe em vez de estourar a margem do documento */
.qdoc-tag { flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; }

@media (max-width: 620px) {
  .qdoc-title-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .qdoc-tag { max-width: 100%; margin-top: 0; }
  .qprices { gap: 10px; }
  .qprice-main { font-size: 25px; }
  .qcmp-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 4px 10px; }
  .qcmp-row .qcmp-qty { grid-column: 1 / -1; }
  .qcmp-month { text-align: left; }
  .qcmp-head { display: none; }
}

/* pacote do orçamento — formulário simples */
.doc-option .doc-option-head { margin-bottom: 12px; }
.do-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px 12px; }
.do-f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.do-f > span { font-size: 11px; font-weight: 700; color: var(--text-faint); }
.do-f-wide { grid-column: span 2; }
.do-f-full { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; }
.do-f input, .do-f textarea {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 8px 10px; font-size: 13px; font-family: inherit; width: 100%; min-width: 0;
}
.do-f textarea { resize: vertical; min-height: 46px; }
.do-f input:focus, .do-f textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.do-f .comm-amount-wrap { width: 100%; }
.do-f[hidden] { display: none; }
.do-calc {
  margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface);
  border: 1px dashed var(--border); font-size: 12.5px; color: var(--text-soft); line-height: 1.6;
}
.do-calc b { color: var(--text); font-variant-numeric: tabular-nums; }
.do-calc span { color: var(--text-faint); }
.do-calc .do-calc-unit { color: var(--brand); }
@media (max-width: 560px) { .do-f-wide { grid-column: span 1; } }

/* itens inclusos no pacote (PDF do orçamento) */
.qincludes { margin: 14px 0 0; padding: 0 0 0 18px; color: #9a9aa0; font-size: 13.5px; line-height: 1.7; }
.qincludes li { margin: 0; }
.qincludes li::marker { color: #f26a5f; }

/* ============================================================
   PWA — botões de instalar / notificações + ajustes de app instalado
   ============================================================ */
.btn-icon {
  width: 40px; height: 40px; padding: 0; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; line-height: 1; border-radius: 10px;
}
.btn-icon.on { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
.btn-icon[hidden] { display: none; }

/* rodapé seguro em iPhone com notch quando instalado */
@media (display-mode: standalone) {
  .sidebar-foot { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .notes-widget { bottom: max(18px, env(safe-area-inset-bottom)); }
  .topbar { padding-top: max(10px, env(safe-area-inset-top)); }
}

/* telas estreitas: a barra superior não pode espremer os botões */
@media (max-width: 560px) {
  .topbar-actions { gap: 6px; }
  .btn-icon { width: 36px; height: 36px; font-size: 15px; }
}
@media (max-width: 380px) {
  .topbar-search { flex: 1 1 100%; order: 3; }
  .topbar-actions { gap: 5px; }
}

/* ============================================================
   Responsividade — correções de vazamento em telas estreitas
   ============================================================ */
/* barra da agenda: sem quebra, os filtros empurravam a página inteira pro lado */
.cal-toolbar { flex-wrap: wrap; }
.cal-legend { margin-left: auto; }

@media (max-width: 700px) {
  /* tabelas largas rolam DENTRO do painel em vez de ficarem cortadas */
  .panel { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .panel > .table { min-width: 560px; }
  .cal-legend { margin-left: 0; flex-basis: 100%; }
  .cal-toolbar > .cselect.as-filter { flex: 1 1 auto; }
  .cal-toolbar .cselect.as-filter .cselect-trigger { width: 100%; min-width: 0; }
}

/* nada no app pode empurrar a página para os lados */
html, body { max-width: 100%; overflow-x: hidden; }

/* sino: risco aparece quando as notificações estão desligadas */
.btn-icon svg { width: 19px; height: 19px; display: block; }
.btn-icon .bell-slash { opacity: 1; transition: opacity .15s; }
.btn-icon.on .bell-slash { opacity: 0; }

/* senha de acesso gerada pelo Admin */
.pass-box { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.pass-box code {
  flex: 1; min-width: 0; font-family: var(--font-mono, monospace); font-size: 22px; font-weight: 700;
  letter-spacing: .06em; color: var(--brand); user-select: all; overflow-wrap: anywhere;
}
@media (max-width: 480px) { .pass-box { flex-wrap: wrap; } .pass-box code { font-size: 19px; } }
.pass-msg { font-size: 12.5px; margin-top: 8px; line-height: 1.5; }
.pass-msg.err { color: var(--danger); }
.pass-msg.ok { color: var(--ok); font-weight: 600; }
