:root {
  color-scheme: light;
  /* Base mono (Cria identity) */
  --bg-primary: #ffffff;
  --bg-secondary: #f7f7f8;
  --bg-tertiary: #fbfbfc;
  --bg-sidebar: rgba(247,247,248,0.78);
  --bg-elevated: #ffffff;
  --separator: rgba(0,0,0,0.08);
  --separator-strong: rgba(0,0,0,0.15);
  --label-primary: #111111;
  --label-secondary: #6e6e73;
  --label-tertiary: #86868b;
  --label-quaternary: #c7c7cc;
  /* Brand — preto puro */
  --brand: #111111;
  --brand-soft: #ece9e3;
  --brand-2: #000000;
  /* Pastéis Apple Sonoma (acentos semânticos) */
  --pastel-sage: #dff3e2;   --text-sage: #2d6a3c;
  --pastel-peach: #ffe9d6;  --text-peach: #9c4f00;
  --pastel-rose: #fcdde0;   --text-rose: #a23240;
  --pastel-sky: #d9eaf7;    --text-sky: #2a6190;
  --pastel-lavender: #e5dff4; --text-lavender: #4f4090;
  --pastel-sand: #ece9e3;   --text-sand: #3d3528;
  --pastel-yellow: #fff3c4; --text-yellow: #8a6c00;
  /* System (mantidos para gráficos e referências legadas) */
  --blue: #007aff;
  --green: #34c759;
  --red: #ff3b30;
  --orange: #ff9500;
  --yellow: #ffcc00;
  --indigo: #5856d6;
  /* Radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 22px;
  /* Shadows - Apple uses extremely subtle shadows */
  --shadow-1: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-2: 0 1px 3px rgba(0,0,0,0.04), 0 6px 18px rgba(0,0,0,0.04);
  --shadow-3: 0 4px 24px rgba(0,0,0,0.08);
  /* Typography scale - Apple HIG */
  --fs-large-title: 34px;
  --fs-title-1: 28px;
  --fs-title-2: 22px;
  --fs-title-3: 20px;
  --fs-headline: 17px;
  --fs-body: 17px;
  --fs-callout: 16px;
  --fs-subhead: 15px;
  --fs-footnote: 13px;
  --fs-caption-1: 12px;
  --fs-caption-2: 11px;
}
* { box-sizing: border-box; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--bg-secondary);
  color: var(--label-primary);
  font-size: var(--fs-body);
  line-height: 1.47;
  letter-spacing: -0.022em;
}
button, input, select, textarea { font-family: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.18); border-radius: 999px; border: 2px solid var(--bg-secondary); }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.32); }

/* ============== APP LAYOUT (sidebar + main) ============== */
.app {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}
.mobile-menu-btn { display: none; }
.sidebar-scrim { display: none; }

/* ============== SIDEBAR ============== */
.sidebar {
  background: var(--bg-sidebar);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-right: 1px solid var(--separator);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px 18px;
  border-bottom: 1px solid var(--separator);
  margin-bottom: 14px;
}
.sidebar-brand svg { height: 32px; width: auto; flex-shrink: 0; max-width: 100%; color: var(--label-primary); }
.sidebar-brand .label { font-size: var(--fs-caption-1); color: var(--label-tertiary); margin-top: 2px; }
.sidebar-brand .name { font-size: var(--fs-subhead); font-weight: 600; color: var(--label-primary); letter-spacing: -0.01em; }

.sidebar-section { margin-bottom: 18px; }
.sidebar-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--label-tertiary);
  letter-spacing: 0.06em;
  padding: 4px 10px 8px;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  color: var(--label-primary);
  font-size: var(--fs-subhead);
  font-weight: 400;
  transition: background 0.15s;
  margin-bottom: 1px;
  letter-spacing: -0.01em;
}
.sidebar-item:hover { background: rgba(0,0,0,0.04); }
.sidebar-item.active { background: rgba(0,0,0,0.07); font-weight: 500; }
.sidebar-item .icon { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.7; }
.sidebar-item.active .icon { opacity: 1; }

.sidebar-project {
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: rgba(0,0,0,0.04);
  margin-bottom: 12px;
}
.sidebar-project .label { font-size: var(--fs-caption-1); color: var(--label-tertiary); margin-bottom: 4px; }
.sidebar-project select {
  width: 100%; background: transparent; border: none;
  font-size: var(--fs-subhead); font-weight: 500; color: var(--label-primary);
  padding: 0; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236e6e73' d='M6 8.5L1.5 4l1-1L6 6.5 9.5 3l1 1z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
  padding-right: 18px;
}

/* ============== MAIN ============== */
.main { min-width: 0; display: flex; flex-direction: column; }
.toolbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255,255,255,0.86);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--separator);
  padding: 18px 32px 14px;
  display: block;
}
.tb-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.tb-greet { font-size: var(--fs-title-2); font-weight: 600; letter-spacing: -0.025em; color: var(--label-primary); margin: 0; }
.tb-meta { color: var(--label-secondary); font-size: var(--fs-footnote); margin-top: 2px; letter-spacing: -0.005em; }
.tb-meta .dot { color: var(--label-quaternary); margin: 0 6px; }
.tb-meta strong { color: var(--label-primary); font-weight: 600; }
.tb-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--separator); }
.toolbar h2 {
  margin: 0; font-size: var(--fs-title-3); font-weight: 500; letter-spacing: -0.022em; color: var(--label-secondary);
}
.toolbar-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.content { padding: 28px 32px 60px; max-width: 1280px; width: 100%; }
.section { display: none; animation: fadeIn 0.25s ease; }
.section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.page-title {
  font-size: var(--fs-large-title);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 6px;
}
.page-subtitle {
  font-size: var(--fs-callout);
  color: var(--label-secondary);
  margin: 0 0 28px;
  letter-spacing: -0.018em;
}

/* ============== BUTTONS ============== */
button { cursor: pointer; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: var(--fs-subhead); font-weight: 500;
  padding: 8px 16px; border-radius: 980px;
  border: none; cursor: pointer; transition: all 0.15s ease;
  letter-spacing: -0.01em; text-align: center; white-space: nowrap;
}
.btn-primary { background: var(--label-primary); color: #fff; }
.btn-primary:hover { background: #000; }
.btn-secondary { background: rgba(0,0,0,0.06); color: var(--label-primary); }
.btn-secondary:hover { background: rgba(0,0,0,0.1); }
.btn-tinted { background: var(--pastel-sky); color: var(--text-sky); }
.btn-tinted:hover { background: #c8def0; }
.btn-ghost { background: transparent; color: var(--label-primary); }
.btn-ghost:hover { background: rgba(0,0,0,0.04); }
.btn-danger { background: transparent; color: var(--text-rose); border: 1px solid var(--pastel-rose); }
.btn-danger:hover { background: var(--pastel-rose); }
.btn-success { background: var(--pastel-sage); color: var(--text-sage); border: none; }
.btn-success:hover { background: #cfead4; }
.btn-sm { padding: 5px 12px; font-size: var(--fs-footnote); }

/* ============== INPUTS ============== */
input[type="text"], input[type="number"], input[type="date"], input[type="email"], input[type="tel"], select, textarea {
  font-size: var(--fs-subhead);
  border: 1px solid var(--separator-strong);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  background: var(--bg-elevated);
  color: var(--label-primary);
  letter-spacing: -0.01em;
  transition: all 0.15s;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(0,122,255,0.12);
}
.editable {
  background: rgba(0,0,0,0.03);
  border: 1px solid transparent;
  padding: 6px 10px;
  border-radius: 6px;
  width: 96px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-footnote);
}
.editable:hover { background: rgba(0,0,0,0.06); }
.editable:focus { background: #fff; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,122,255,0.12); }

/* ============== SEARCH FIELD ============== */
.search {
  background: rgba(0,0,0,0.06);
  border: none; border-radius: 980px;
  padding: 8px 16px 8px 36px;
  font-size: var(--fs-subhead);
  width: 280px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%236e6e73' d='M9.5 9c.7-.9 1-2 1-3.1C10.5 3.2 8.3 1 5.5 1S.5 3.2.5 6s2.2 5 5 5c1.2 0 2.3-.4 3.2-1l3.3 3.3 1-1L9.5 9zM5.5 9.5C3.6 9.5 2 7.9 2 6s1.6-3.5 3.5-3.5S9 4.1 9 6 7.4 9.5 5.5 9.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 14px center;
}
.search:focus { background-color: #fff; box-shadow: 0 0 0 4px rgba(0,122,255,0.15); }

/* ============== KPI CARDS ============== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.kpi {
  background: var(--bg-elevated);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-1);
  border: 1px solid var(--separator);
}
.kpi .label {
  font-size: var(--fs-footnote);
  color: var(--label-secondary);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.kpi .value {
  font-size: var(--fs-title-1);
  font-weight: 600;
  margin-top: 6px;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}
.kpi .sub {
  font-size: var(--fs-footnote);
  margin-top: 8px;
  color: var(--label-tertiary);
  letter-spacing: -0.01em;
}
.kpi.success { background: var(--pastel-sage); border-color: rgba(45,106,60,0.12); }
.kpi.success .label, .kpi.success .value, .kpi.success .sub { color: var(--text-sage); }
.kpi.success .sub { opacity: 0.78; }
.kpi.danger { background: var(--pastel-rose); border-color: rgba(162,50,64,0.12); }
.kpi.danger .label, .kpi.danger .value, .kpi.danger .sub { color: var(--text-rose); }
.kpi.danger .sub { opacity: 0.78; }
.kpi.warning { background: var(--pastel-peach); border-color: rgba(156,79,0,0.12); }
.kpi.warning .label, .kpi.warning .value, .kpi.warning .sub { color: var(--text-peach); }
.kpi.warning .sub { opacity: 0.78; }
.kpi.brand { background: var(--pastel-sand); border-color: rgba(61,53,40,0.12); }
.kpi.brand .label, .kpi.brand .value, .kpi.brand .sub { color: var(--text-sand); }
.kpi.brand .sub { opacity: 0.78; }
.kpi.sky { background: var(--pastel-sky); border-color: rgba(42,97,144,0.12); }
.kpi.sky .label, .kpi.sky .value, .kpi.sky .sub { color: var(--text-sky); }
.kpi.lavender { background: var(--pastel-lavender); border-color: rgba(79,64,144,0.12); }
.kpi.lavender .label, .kpi.lavender .value, .kpi.lavender .sub { color: var(--text-lavender); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ============== CARD ============== */
.card {
  background: var(--bg-elevated);
  border-radius: var(--r-lg);
  border: 1px solid var(--separator);
  padding: 24px;
  box-shadow: var(--shadow-1);
  margin-bottom: 16px;
}
.card h3 {
  margin: 0 0 4px;
  font-size: var(--fs-title-3);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.card .card-sub { margin: 0 0 18px; color: var(--label-secondary); font-size: var(--fs-subhead); }
.card-header-row { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.card-header-row > div:first-child { flex: 1; }
.card-header-row h3 { margin: 0 0 4px; }

.chart-wrap { position: relative; height: 280px; }
.chart-wrap.tall { height: 360px; }

/* ============== TABLES ============== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-subhead); }
table th {
  text-align: left;
  font-weight: 500;
  color: var(--label-tertiary);
  padding: 12px 12px;
  border-bottom: 1px solid var(--separator);
  font-size: var(--fs-footnote);
  letter-spacing: -0.005em;
}
table td { padding: 14px 12px; border-bottom: 1px solid var(--separator); letter-spacing: -0.01em; }
table tr:last-child td { border-bottom: none; }
table tr:hover td { background: var(--bg-tertiary); }
table td.right, table th.right { text-align: right; font-variant-numeric: tabular-nums; }
table td.bold { font-weight: 600; }
table tfoot td { font-weight: 600; border-top: 1px solid var(--separator-strong); border-bottom: none; background: var(--bg-secondary); }

/* ============== TAGS ============== */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: var(--fs-caption-1);
  font-weight: 500;
  border-radius: 980px;
  letter-spacing: -0.005em;
}
.tag.success { background: var(--pastel-sage); color: var(--text-sage); }
.tag.danger { background: var(--pastel-rose); color: var(--text-rose); }
.tag.warning { background: var(--pastel-peach); color: var(--text-peach); }
.tag.brand { background: var(--pastel-sand); color: var(--text-sand); }
.tag.neutral { background: rgba(0,0,0,0.06); color: var(--label-secondary); }
.tag.blue { background: var(--pastel-sky); color: var(--text-sky); }
.tag.lavender { background: var(--pastel-lavender); color: var(--text-lavender); }

/* ============== SEGMENTED CONTROL ============== */
.segmented {
  display: inline-flex;
  gap: 2px;
  background: rgba(0,0,0,0.06);
  padding: 2px;
  border-radius: 9px;
}
.segmented button {
  background: transparent;
  border: none;
  padding: 6px 14px;
  font-size: var(--fs-footnote);
  font-weight: 500;
  border-radius: 7px;
  cursor: pointer;
  color: var(--label-primary);
  transition: all 0.2s;
  letter-spacing: -0.01em;
}
.segmented button.active { background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }

/* ============== DRE ============== */
.dre-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  padding: 13px 8px;
  border-bottom: 1px solid var(--separator);
  font-size: var(--fs-subhead);
  align-items: center;
  letter-spacing: -0.01em;
}
.dre-row.header {
  font-weight: 500;
  color: var(--label-tertiary);
  font-size: var(--fs-footnote);
  letter-spacing: 0.005em;
  border-bottom: 1px solid var(--separator-strong);
  padding: 10px 8px 12px;
}
.dre-row.sub { padding-left: 32px; color: var(--label-secondary); font-size: var(--fs-footnote); padding-top: 8px; padding-bottom: 8px; }
.dre-row.total {
  font-weight: 600;
  background: var(--bg-secondary);
  border-radius: 10px;
  padding: 14px 12px;
  margin: 8px 0;
  border-bottom: none;
}
.dre-row.profit {
  font-weight: 600;
  background: var(--brand-soft);
  color: var(--brand-2);
  border-radius: 12px;
  padding: 18px 14px;
  margin-top: 12px;
  font-size: var(--fs-headline);
  border-bottom: none;
}
.dre-row.profit.neg { background: rgba(255,59,48,0.08); color: var(--red); }
.dre-row .val { text-align: right; font-variant-numeric: tabular-nums; }
.dre-row .pct { text-align: right; color: var(--label-tertiary); font-size: var(--fs-footnote); min-width: 68px; font-variant-numeric: tabular-nums; }

/* ============== ITEM CARD (used for projects, clients, briefings, etc.) ============== */
.item-card {
  background: var(--bg-elevated);
  border: 1px solid var(--separator);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-1);
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  transition: all 0.2s;
}
.item-card:hover { box-shadow: var(--shadow-2); }
.item-card .info h4 { margin: 0 0 6px; font-size: var(--fs-headline); font-weight: 600; letter-spacing: -0.018em; }
.item-card .info .meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; color: var(--label-secondary); font-size: var(--fs-footnote); }
.item-card .stats { display: flex; gap: 28px; align-items: center; }
.item-card .stat .lbl { font-size: var(--fs-caption-1); color: var(--label-tertiary); font-weight: 500; letter-spacing: -0.005em; }
.item-card .stat .val { font-size: var(--fs-headline); font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; letter-spacing: -0.018em; }

/* ============== EMPTY STATE ============== */
.empty {
  text-align: center;
  padding: 80px 24px;
  background: var(--bg-elevated);
  border-radius: var(--r-lg);
  border: 1px solid var(--separator);
}
.empty .icon { font-size: 48px; margin-bottom: 12px; opacity: 0.35; }
.empty h3 { font-size: var(--fs-title-3); font-weight: 600; margin: 0 0 6px; letter-spacing: -0.02em; }
.empty p { color: var(--label-secondary); font-size: var(--fs-subhead); margin: 0 0 20px; }

/* ============== TOAST ============== */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translate(-50%, 12px);
  background: rgba(29,29,31,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #fff;
  padding: 13px 22px;
  border-radius: 980px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  font-weight: 500;
  font-size: var(--fs-subhead);
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============== DIALOG ============== */
dialog {
  border: none;
  border-radius: var(--r-lg);
  padding: 0;
  max-width: 540px;
  width: 92%;
  box-shadow: 0 24px 80px rgba(0,0,0,0.28);
  background: var(--bg-elevated);
}
dialog::backdrop { background: rgba(0,0,0,0.35); backdrop-filter: blur(6px); }
.dialog-content { padding: 28px 32px; }
.dialog-content h3 { margin: 0 0 22px; font-size: var(--fs-title-2); font-weight: 600; letter-spacing: -0.022em; }
.field { margin-bottom: 14px; min-width: 0; }
.field label { display: block; font-size: var(--fs-footnote); font-weight: 500; color: var(--label-secondary); margin-bottom: 6px; letter-spacing: -0.005em; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row > * { min-width: 0; }
/* <select> sem largura definida usa como base o texto da opção mais longa,
   nao o container — em grid/flex isso estoura a coluna e quebra o layout no
   mobile. min-width:0 nos itens de grid/flex forca respeitar o espaco real. */
.grid-2 > *, .grid-3 > *, .prop-grid > * { min-width: 0; }
.card { min-width: 0; }
.dialog-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; align-items: center; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--separator); }

/* ============== HINT ============== */
.hint {
  font-size: var(--fs-subhead);
  color: var(--label-primary);
  margin-top: 14px;
  padding: 14px 18px;
  background: var(--brand-soft);
  border-radius: var(--r-md);
  line-height: 1.5;
}

/* ============== PIPELINE (Kanban for CRM) ============== */
.pipeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  overflow-x: auto;
}
@media (max-width: 1100px) { .pipeline { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .pipeline { grid-template-columns: 1fr; } }
.pipeline-col {
  background: var(--bg-secondary);
  border-radius: var(--r-md);
  padding: 12px;
  min-height: 200px;
}
.pipeline-col h4 {
  font-size: var(--fs-footnote);
  font-weight: 600;
  color: var(--label-secondary);
  margin: 0 0 12px;
  padding: 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.pipeline-card {
  background: var(--bg-elevated);
  border-radius: var(--r-sm);
  padding: 12px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-1);
  cursor: pointer;
  border: 1px solid var(--separator);
  transition: all 0.15s;
}
.pipeline-card:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.pipeline-card .nome { font-weight: 600; font-size: var(--fs-subhead); margin-bottom: 2px; letter-spacing: -0.015em; }
.pipeline-card .desc { font-size: var(--fs-caption-1); color: var(--label-secondary); }
.pipeline-card .valor { font-weight: 600; font-size: var(--fs-footnote); margin-top: 8px; color: var(--brand); }

/* ============== DASHBOARD MONDAY-STYLE ============== */
.hero-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 24px; }
@media (max-width: 1100px) { .hero-grid { grid-template-columns: 1fr; } }

.event-hero {
  background: linear-gradient(135deg, var(--pastel-lavender) 0%, #f1edfa 100%);
  color: var(--text-lavender);
  border-radius: var(--r-xl);
  padding: 28px 32px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(79,64,144,0.10);
}
.event-hero::before {
  content: "";
  position: absolute; top: -40%; right: -10%;
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(255,255,255,0.5) 0%, transparent 70%);
  pointer-events: none;
}
.event-hero .lbl-mini { font-size: var(--fs-caption-1); font-weight: 600; opacity: 0.75; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 10px; color: var(--text-lavender); }
.event-hero h2 { margin: 0 0 6px; font-size: 28px; font-weight: 700; letter-spacing: -0.022em; color: var(--text-lavender); }
.event-hero .sub { opacity: 0.8; font-size: var(--fs-subhead); margin-bottom: 18px; color: var(--text-lavender); }
.event-hero .meta-row { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 22px; font-size: var(--fs-footnote); color: var(--text-lavender); opacity: 0.85; }
.event-hero .countdown { display: inline-flex; align-items: baseline; gap: 6px; }
.event-hero .countdown .num { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; color: var(--text-lavender); }
.event-hero .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.event-hero .btn { background: rgba(255,255,255,0.7); color: var(--text-lavender) !important; backdrop-filter: blur(8px); font-weight: 600; }
.event-hero .btn:hover { background: rgba(255,255,255,0.92); }
.event-hero .btn.primary { background: var(--text-lavender); color: #fff !important; }
.event-hero .btn.primary:hover { background: #3d3275; }

.quick-stat {
  background: var(--bg-elevated);
  border: 1px solid var(--separator);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-1);
  transition: transform 0.15s;
}
.quick-stat:hover { transform: translateY(-1px); }
.quick-stat .lbl { font-size: var(--fs-caption-1); color: var(--label-tertiary); font-weight: 500; }
.quick-stat .val { font-size: var(--fs-title-3); font-weight: 600; margin-top: 4px; letter-spacing: -0.018em; font-variant-numeric: tabular-nums; }
.quick-stat.sage { background: var(--pastel-sage); border-color: rgba(45,106,60,0.12); }
.quick-stat.sage .lbl, .quick-stat.sage .val { color: var(--text-sage); }
.quick-stat.peach { background: var(--pastel-peach); border-color: rgba(156,79,0,0.12); }
.quick-stat.peach .lbl, .quick-stat.peach .val { color: var(--text-peach); }
.quick-stat.sky { background: var(--pastel-sky); border-color: rgba(42,97,144,0.12); }
.quick-stat.sky .lbl, .quick-stat.sky .val { color: var(--text-sky); }
.quick-stat.sand { background: var(--pastel-sand); border-color: rgba(61,53,40,0.12); }
.quick-stat.sand .lbl, .quick-stat.sand .val { color: var(--text-sand); }
.quick-stat-grid { display: grid; gap: 10px; }

/* Status board (kanban) */
.status-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(220px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.status-col {
  background: var(--bg-secondary);
  border-radius: var(--r-md);
  padding: 12px;
  min-height: 280px;
}
.status-col-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 4px;
}
.status-col-header .name { font-size: var(--fs-footnote); font-weight: 600; color: var(--label-secondary); text-transform: uppercase; letter-spacing: 0.06em; }
.status-col-header .count {
  background: rgba(0,0,0,0.08);
  font-size: 11px; font-weight: 600; color: var(--label-secondary);
  padding: 1px 8px; border-radius: 980px;
}

.event-card {
  background: var(--bg-elevated);
  border-radius: var(--r-md);
  padding: 14px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-1);
  cursor: pointer;
  border: 1px solid var(--separator);
  transition: all 0.18s;
  border-left: 4px solid var(--brand);
}
.event-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.event-card.cls-Corporativo { border-left-color: var(--text-sky); background: linear-gradient(90deg, rgba(217,234,247,0.4) 0%, var(--bg-elevated) 60%); }
.event-card.cls-Casamento { border-left-color: var(--text-rose); background: linear-gradient(90deg, rgba(252,221,224,0.45) 0%, var(--bg-elevated) 60%); }
.event-card.cls-Premium { border-left-color: var(--text-lavender); background: linear-gradient(90deg, rgba(229,223,244,0.45) 0%, var(--bg-elevated) 60%); }
.event-card.cls-Feira { border-left-color: var(--text-peach); background: linear-gradient(90deg, rgba(255,233,214,0.45) 0%, var(--bg-elevated) 60%); }
.event-card.cls-Coffee_break { border-left-color: var(--text-sage); background: linear-gradient(90deg, rgba(223,243,226,0.45) 0%, var(--bg-elevated) 60%); }
.event-card.cls-Ativacao_de_marca { border-left-color: var(--text-lavender); background: linear-gradient(90deg, rgba(229,223,244,0.35) 0%, var(--bg-elevated) 60%); }
.event-card.cls-Arquitetura\\/_Design { border-left-color: var(--text-sand); background: linear-gradient(90deg, rgba(236,233,227,0.55) 0%, var(--bg-elevated) 60%); }
.event-card.cls-Experiencia_sensorial { border-left-color: var(--text-sky); background: linear-gradient(90deg, rgba(217,234,247,0.4) 0%, var(--bg-elevated) 60%); }

.event-card .h { font-weight: 600; font-size: var(--fs-subhead); margin-bottom: 4px; letter-spacing: -0.015em; }
.event-card .meta { font-size: var(--fs-caption-1); color: var(--label-tertiary); display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.event-card .footer { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: var(--fs-caption-1); }
.event-card .progress { width: 100%; height: 4px; background: rgba(0,0,0,0.06); border-radius: 999px; margin-top: 8px; overflow: hidden; }
.event-card .progress-fill { height: 100%; background: var(--brand); transition: width 0.3s; }

/* Sub-tabs (dentro da página do evento) */
.subtabs {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--separator);
  margin-bottom: 24px;
}
.subtabs-scroll {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  min-width: 0;
  flex: 1;
}
.subtabs-scroll::-webkit-scrollbar { display: none; }
.subtab {
  padding: 12px 18px;
  font-size: var(--fs-subhead);
  font-weight: 500;
  color: var(--label-tertiary);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  letter-spacing: -0.01em;
}
.subtab:hover { color: var(--label-primary); }
.subtab.active { color: var(--label-primary); border-bottom-color: var(--label-primary); font-weight: 600; }

/* Aba "Subeventos" — destacada e fixa fora da lista rolável, sempre visivel */
.subtab-pinned {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  margin-bottom: 8px;
  padding: 7px 16px;
  border-radius: 980px;
  background: var(--brand-soft);
  color: var(--brand-2);
  border: 1px solid transparent;
  font-weight: 600;
}
.subtab-pinned:hover { color: var(--brand-2); background: var(--brand-soft); border-color: var(--separator-strong); }
.subtab-pinned.active { background: var(--label-primary); color: #fff; border-bottom: none; }
.subtab-pinned-badge {
  background: var(--brand-2);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 980px;
  min-width: 16px;
  text-align: center;
  display: none;
}
.subtab-pinned.active .subtab-pinned-badge { background: rgba(255,255,255,0.25); color: #fff; }

/* Event page header */
.event-header {
  background: var(--bg-elevated);
  border: 1px solid var(--separator);
  border-radius: var(--r-xl);
  padding: 24px 28px;
  box-shadow: var(--shadow-1);
  margin-bottom: 24px;
}
.event-header .h-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.event-header h2 { margin: 0 0 6px; font-size: 26px; font-weight: 700; letter-spacing: -0.022em; }
.event-header .meta-row { display: flex; gap: 14px; flex-wrap: wrap; font-size: var(--fs-footnote); color: var(--label-secondary); }
.event-header .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Alert cards (previsibilidade) */
.alert-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin: 14px 0 0; }
.alert {
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--bg-secondary);
  border-left: 3px solid var(--separator-strong);
}
.alert.success { background: rgba(52,199,89,0.08); border-left-color: var(--green); }
.alert.warning { background: rgba(255,149,0,0.08); border-left-color: var(--orange); }
.alert.danger { background: rgba(255,59,48,0.08); border-left-color: var(--red); }
.alert .a-label { font-size: var(--fs-caption-1); font-weight: 500; color: var(--label-tertiary); letter-spacing: -0.005em; }
.alert .a-value { font-size: var(--fs-subhead); font-weight: 600; margin-top: 2px; }
.alert .a-meta { font-size: 11px; color: var(--label-tertiary); margin-top: 2px; }

/* Stars rating */
.stars { display: inline-flex; gap: 6px; font-size: 32px; }
.star { cursor: pointer; color: var(--label-quaternary); transition: color 0.15s, transform 0.15s; line-height: 1; }
.star:hover { transform: scale(1.15); }
.star.active { color: var(--yellow); }

/* ============== CALENDAR ============== */
.cal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; flex-wrap: wrap; gap: 12px; }
.cal-header .month-label { font-size: var(--fs-title-2); font-weight: 600; letter-spacing: -0.022em; min-width: 200px; }
.cal-nav { display: flex; gap: 4px; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--separator);
  border: 1px solid var(--separator);
  border-radius: var(--r-md);
  overflow: hidden;
  gap: 1px;
}
.cal-dow {
  background: var(--bg-secondary);
  padding: 10px 8px;
  font-size: var(--fs-caption-1);
  font-weight: 600;
  color: var(--label-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
}
.cal-day {
  background: var(--bg-elevated);
  min-height: 96px;
  padding: 6px 8px;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}
.cal-day:hover { background: var(--bg-tertiary); }
.cal-day.other { background: var(--bg-secondary); color: var(--label-quaternary); }
.cal-day.today .cal-day-num { background: var(--blue); color: #fff; }
.cal-day-num {
  font-size: var(--fs-footnote);
  font-weight: 600;
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.cal-event {
  display: block;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.005em;
  font-weight: 500;
}
.cal-event.evento { background: rgba(17,17,17,0.15); color: var(--brand-2); }
.cal-event.briefing { background: rgba(0,122,255,0.15); color: var(--blue); }
.cal-event.followup { background: rgba(255,149,0,0.15); color: #c46b00; }
.cal-event.followup-overdue { background: rgba(255,59,48,0.18); color: var(--red); }
.cal-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-legend-item { display: flex; align-items: center; gap: 6px; font-size: var(--fs-footnote); color: var(--label-secondary); }
.cal-legend-dot { width: 10px; height: 10px; border-radius: 50%; }

/* ============== CHECKLIST ============== */
.checklist-template { background: var(--bg-elevated); border: 1px solid var(--separator); border-radius: var(--r-md); padding: 16px 20px; margin-bottom: 12px; }
.checklist-template h4 { margin: 0 0 12px; font-size: var(--fs-headline); font-weight: 600; }
.checklist-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: var(--fs-subhead); border-bottom: 1px solid var(--separator); letter-spacing: -0.01em; }
.checklist-item:last-child { border-bottom: none; }
.checklist-item input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--blue); margin: 0; }
.checklist-item.done span { text-decoration: line-through; color: var(--label-tertiary); }

/* ============== PROPOSTA COMERCIAL ============== */
.prop-grid { display: grid; grid-template-columns: 1fr 360px; gap: 16px; align-items: start; }
@media (max-width: 1120px) { .prop-grid { grid-template-columns: 1fr; } }
.prop-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 16px; }
.price-hero {
  background: linear-gradient(140deg, #000000, #2a2a2a);
  color: #fff; border-radius: var(--r-lg); padding: 24px 26px;
  box-shadow: var(--shadow-2);
}
.price-hero .ph-label { font-size: var(--fs-caption-1); text-transform: uppercase; letter-spacing: 0.09em; opacity: 0.78; font-weight: 600; }
.price-hero .ph-value { font-size: 42px; font-weight: 600; letter-spacing: -0.03em; margin: 3px 0 2px; font-variant-numeric: tabular-nums; }
.price-hero .ph-sub { font-size: var(--fs-footnote); opacity: 0.82; }
.price-hero .ph-divider { height: 1px; background: rgba(255,255,255,0.16); margin: 16px 0; }
.price-hero .ph-line { display: flex; justify-content: space-between; font-size: var(--fs-subhead); padding: 4px 0; }
.price-hero .ph-line .v { font-variant-numeric: tabular-nums; font-weight: 600; }
.cost-line { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--separator); font-size: var(--fs-subhead); }
.cost-line:last-child { border-bottom: none; }
.cost-line .v { font-variant-numeric: tabular-nums; }
.cost-line.tot { font-weight: 600; border-top: 1px solid var(--separator-strong); border-bottom: none; margin-top: 4px; padding-top: 12px; }
.range-margin { -webkit-appearance: none; appearance: none; width: 100%; height: 5px; border-radius: 980px; background: var(--bg-secondary); outline: none; }
.range-margin::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 1px solid var(--separator-strong); box-shadow: 0 1px 4px rgba(0,0,0,0.2); cursor: pointer; }
.range-margin::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 1px solid var(--separator-strong); box-shadow: 0 1px 4px rgba(0,0,0,0.2); cursor: pointer; }
.ai-panel { background: linear-gradient(180deg, rgba(17,17,17,0.06), rgba(17,17,17,0.015)); border: 1px solid var(--brand-soft); border-radius: var(--r-md); padding: 18px 20px; }
.ai-badge { display:inline-flex; align-items:center; gap:6px; font-size:var(--fs-caption-1); font-weight:600; color:var(--brand-2); background:var(--brand-soft); padding:4px 11px; border-radius:980px; }
.ai-factor { display:flex; justify-content:space-between; gap:12px; font-size:var(--fs-footnote); padding:6px 0; border-bottom:1px solid var(--separator); }
.ai-factor:last-child { border-bottom:none; }
.ai-factor .fv { font-variant-numeric: tabular-nums; font-weight:600; }
.bench-track { position: relative; height: 8px; background: var(--bg-secondary); border-radius: 980px; margin: 12px 0 6px; }
.bench-range { position:absolute; top:0; bottom:0; background: var(--brand-soft); border-radius:980px; }
.bench-marker { position:absolute; top:-5px; width:4px; height:18px; background:var(--brand-2); border-radius:2px; transform:translateX(-50%); }
.viab-box { border-radius: var(--r-md); padding: 16px 18px; }
.viab-box.success { background: rgba(52,199,89,0.08); border:1px solid rgba(52,199,89,0.25); }
.viab-box.warning { background: rgba(255,149,0,0.08); border:1px solid rgba(255,149,0,0.32); }
.viab-box.danger  { background: rgba(255,59,48,0.07); border:1px solid rgba(255,59,48,0.3); }
.prop-cat-head { font-size: var(--fs-caption-1); font-weight:600; text-transform:uppercase; letter-spacing:0.06em; color:var(--label-tertiary); margin: 16px 0 2px; }
.catalog-panel { background: var(--bg-secondary); border:1px solid var(--separator); border-radius: var(--r-md); padding: 16px 18px; margin-top: 12px; }
.catalog-row { display:flex; align-items:center; gap:10px; padding:7px 0; border-bottom:1px solid var(--separator); font-size:var(--fs-footnote); }
.catalog-row:last-child { border-bottom:none; }
.catalog-row .cn { flex:1; }
.catalog-row .cmeta { color:var(--label-tertiary); font-variant-numeric:tabular-nums; }

/* Fotos */
.foto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.foto-thumb { position: relative; aspect-ratio: 4/3; border-radius: 12px; overflow: hidden; background: var(--bg-secondary); border: 1px solid var(--separator); box-shadow: var(--shadow-1); }
.foto-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto-thumb .foto-rm {
  position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0,0,0,0.65); color: #fff; border: none; cursor: pointer; font-size: 16px;
  line-height: 1; padding: 0; display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: background 0.15s;
}
.foto-thumb .foto-rm:hover { background: var(--red); }
.foto-empty { padding: 30px 20px; text-align: center; color: var(--label-tertiary); background: var(--bg-secondary); border-radius: 10px; border: 1px dashed var(--separator-strong); }
.foto-mini { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; display: block; cursor: pointer; border: 1px solid var(--separator); }
.foto-mini-add {
  width: 40px; height: 40px; border-radius: 8px; background: var(--bg-secondary);
  border: 1px dashed var(--separator-strong); display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--label-tertiary); transition: all 0.15s;
}
.foto-mini-add:hover { background: var(--bg-tertiary); border-color: var(--brand); color: var(--brand); }
.foto-mini-add input { display: none; }

/* Lista de itens do cardápio (em cards verticais) */
.prop-itens-list { display: flex; flex-direction: column; margin-top: 4px; }
.prop-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  padding: 14px 10px;
  border-bottom: 1px solid var(--separator);
  align-items: flex-start;
  border-radius: 10px;
  transition: background 0.15s;
}
.prop-item:last-child { border-bottom: none; }
.prop-item:hover { background: rgba(0,0,0,0.015); }
.prop-item.hidden { opacity: 0.45; background: rgba(0,0,0,0.025); }
.prop-item .foto-mini, .prop-item .foto-mini-add { width: 60px !important; height: 60px !important; border-radius: 10px !important; }
.prop-item-body { min-width: 0; }
.prop-item-nome {
  font-size: var(--fs-headline) !important;
  font-weight: 500;
  width: 100% !important;
  border: 1px solid var(--separator) !important;
  padding: 10px 14px !important;
  border-radius: 8px !important;
  letter-spacing: -0.015em !important;
}
.prop-item.hidden .prop-item-nome { text-decoration: line-through; }
.prop-item-meta { display: flex; gap: 18px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.prop-item-cat {
  font-size: var(--fs-footnote) !important;
  padding: 6px 12px !important;
  width: auto !important;
  background: var(--bg-secondary) !important;
  border-color: transparent !important;
  min-width: 160px;
}
.prop-item-num { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.prop-item-num .lbl {
  font-size: var(--fs-caption-1);
  color: var(--label-tertiary);
  font-weight: 500;
  letter-spacing: -0.005em;
}
.prop-item-num input[type="number"] {
  width: 90px !important;
  font-size: var(--fs-footnote) !important;
  text-align: right;
  font-variant-numeric: tabular-nums;
  padding: 6px 10px !important;
  min-width: 0;
}
.prop-item-num .val { font-size: var(--fs-subhead); font-weight: 600; font-variant-numeric: tabular-nums; }
.prop-item-actions { display: flex; gap: 4px; align-items: center; padding-top: 8px; }
.prop-itens-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 10px; margin-top: 6px;
  border-top: 1px solid var(--separator-strong);
  font-size: var(--fs-subhead);
}
.prop-itens-foot strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.prop-itens-empty { text-align: center; color: var(--label-tertiary); padding: 36px 16px; font-size: var(--fs-subhead); }

/* ============== CADASTRO DE PESSOAS ============== */
.dlg-section-h {
  font-size: var(--fs-caption-1); font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--label-tertiary);
  margin: 22px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--separator);
}
.dlg-section-h:first-child { margin-top: 0; }
.eq-foto-circle {
  width: 84px; height: 84px; border-radius: 50%; background: var(--bg-secondary);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  overflow: hidden; border: 2px solid var(--separator); font-size: 28px; font-weight: 600;
  color: var(--label-tertiary); letter-spacing: -0.02em; position: relative;
}
.eq-foto-circle img { width: 100%; height: 100%; object-fit: cover; display: block; }
.eq-disp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.eq-disp-day {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 4px; background: var(--bg-secondary); border-radius: 8px;
  border: 2px solid transparent; cursor: pointer; transition: all 0.15s;
  user-select: none;
}
.eq-disp-day:hover { background: var(--bg-tertiary); }
.eq-disp-day.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-2); }
.eq-disp-day .lbl { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.eq-disp-day .ind { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--label-quaternary); background: #fff; }
.eq-disp-day.on .ind { background: var(--brand); border-color: var(--brand); }
.eq-func-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 11px; background: #fff; border: 1px solid var(--separator-strong);
  border-radius: 980px; font-size: var(--fs-footnote); cursor: pointer;
  transition: all 0.15s; user-select: none;
}
.eq-func-chip:hover { border-color: var(--brand); }
.eq-func-chip.on { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 500; }

/* Grid de pessoas */
.pessoa-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px;
}
.pessoa-card {
  background: var(--bg-elevated); border: 1px solid var(--separator);
  border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow-1);
  cursor: pointer; transition: all 0.2s;
  display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center;
}
.pessoa-card:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.pessoa-card.inativo { opacity: 0.55; }
.pessoa-avatar {
  width: 64px; height: 64px; border-radius: 50%; background: var(--bg-secondary);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; font-size: 22px; font-weight: 600; color: var(--label-tertiary);
  letter-spacing: -0.02em;
}
.pessoa-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pessoa-info h4 { margin: 0 0 4px; font-size: var(--fs-headline); font-weight: 600; letter-spacing: -0.018em; }
.pessoa-info .funcoes { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.pessoa-info .funcoes .tag { font-size: 10px; padding: 2px 7px; }
.pessoa-info .pmeta { display: flex; gap: 10px; flex-wrap: wrap; font-size: var(--fs-footnote); color: var(--label-secondary); align-items: center; }
.pessoa-info .pmeta .v { font-weight: 600; color: var(--label-primary); font-variant-numeric: tabular-nums; }

.pessoa-filter-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.pessoa-filter-chip {
  padding: 6px 14px; background: var(--bg-secondary); border-radius: 980px;
  font-size: var(--fs-footnote); cursor: pointer; transition: all 0.15s;
  border: 1px solid transparent;
}
.pessoa-filter-chip:hover { background: var(--bg-tertiary); }
.pessoa-filter-chip.on { background: var(--brand); color: #fff; font-weight: 500; }
.pessoa-filter-chip .c { opacity: 0.7; margin-left: 4px; }

/* ============== EVENT STATUS PIPELINE ============== */
.event-pipeline-wrap { margin-top: 14px; }
.event-pipeline {
  display: flex; gap: 0; align-items: flex-start;
  background: var(--bg-secondary); padding: 16px 12px 14px;
  border-radius: 14px;
}
.event-pipeline-step {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center;
  position: relative; padding: 0 6px; cursor: pointer;
  transition: transform 0.15s;
}
.event-pipeline-step:hover { transform: translateY(-1px); }
.event-pipeline-step .ind {
  width: 28px; height: 28px; border-radius: 50%; background: var(--bg-elevated);
  border: 2px solid var(--separator-strong);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: var(--label-tertiary);
  position: relative; z-index: 2;
}
.event-pipeline-step.done .ind { background: var(--pastel-sage); border-color: var(--text-sage); color: var(--text-sage); }
.event-pipeline-step.current .ind { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 0 0 5px rgba(17,17,17,0.12); }
.event-pipeline-step .lbl {
  margin-top: 8px; font-size: 11px; font-weight: 500; text-align: center;
  color: var(--label-secondary); letter-spacing: -0.005em; line-height: 1.25;
  overflow-wrap: break-word; hyphens: auto;
}
.event-pipeline-step.current .lbl { color: var(--brand-2); font-weight: 600; }
.event-pipeline-step.done .lbl { color: var(--label-primary); }
.event-pipeline-step::after {
  content: ""; position: absolute; top: 14px; right: -50%; left: 50%;
  height: 2px; background: var(--separator-strong); z-index: 1;
}
.event-pipeline-step:last-child::after { display: none; }
.event-pipeline-step.done::after { background: var(--green); }
.event-pipeline-actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.event-cancelled-banner {
  background: rgba(255,59,48,0.08); border: 1px solid rgba(255,59,48,0.25);
  border-radius: 12px; padding: 14px 18px; margin-top: 14px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-size: var(--fs-subhead); font-weight: 500; color: var(--red);
}

/* Alocação de equipe (lista por evento) */
.aloc-list { display: flex; flex-direction: column; gap: 8px; }
.aloc-row {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 14px; align-items: center;
  padding: 10px 12px; background: var(--bg-tertiary);
  border: 1px solid var(--separator); border-radius: 12px;
  transition: background 0.15s;
}
.aloc-row:hover { background: var(--bg-secondary); }
.aloc-body { min-width: 0; }
.aloc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: var(--fs-subhead); margin-bottom: 6px; }
.aloc-fields { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.aloc-fields label { display: inline-flex; flex-direction: column; gap: 3px; font-size: var(--fs-caption-1); color: var(--label-tertiary); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 500; }
.aloc-total { display: inline-flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.aloc-total .lbl { font-size: var(--fs-caption-1); color: var(--label-tertiary); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 500; }
.aloc-total b { font-size: var(--fs-subhead); font-weight: 600; color: var(--brand-2); font-variant-numeric: tabular-nums; }

/* Avaliações de pessoa */
.aval-list { display: flex; flex-direction: column; gap: 10px; }
.aval-row {
  display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: flex-start;
  padding: 12px; background: var(--bg-tertiary); border: 1px solid var(--separator); border-radius: 10px;
}
.aval-body { min-width: 0; }
.aval-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.aval-stars { display: inline-flex; align-items: center; gap: 3px; }
.star-mini {
  font-size: 22px; cursor: pointer; color: var(--label-quaternary);
  transition: color 0.15s, transform 0.15s; line-height: 1;
  -webkit-user-select: none; user-select: none;
}
.star-mini:hover { transform: scale(1.15); }
.star-mini.on { color: var(--yellow); }
.pessoa-rating { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--label-secondary); font-variant-numeric: tabular-nums; }
.pessoa-rating .s { color: var(--yellow); font-size: 13px; }

/* Lista financeira (recebimentos / contas a pagar) */
.fin-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.fin-row {
  display: grid; grid-template-columns: 1fr auto; gap: 10px;
  padding: 12px; background: var(--bg-tertiary); border: 1px solid var(--separator); border-radius: 10px;
  align-items: flex-start;
}
.fin-row > .btn { align-self: center; }
.fin-main { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; grid-column: 1 / -1; }
.fin-main > input { flex: 1; min-width: 180px; }
.fin-fields { display: flex; gap: 10px; flex-wrap: wrap; grid-column: 1; }
.fin-fields label { display: inline-flex; flex-direction: column; gap: 3px; font-size: var(--fs-caption-1); color: var(--label-tertiary); font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.fin-fields input { font-size: var(--fs-footnote); padding: 5px 9px; width: 130px; }
.fin-foot { display: flex; gap: 18px; justify-content: flex-end; flex-wrap: wrap; padding: 12px 4px 0; border-top: 1px solid var(--separator-strong); margin-top: 10px; font-size: var(--fs-footnote); color: var(--label-secondary); }
.fin-foot b { color: var(--label-primary); font-variant-numeric: tabular-nums; }

/* ============== CRM ============== */
.crm-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--separator); margin-bottom: 22px; }
.crm-tab {
  padding: 11px 18px; font-size: var(--fs-subhead); font-weight: 500; cursor: pointer;
  color: var(--label-tertiary); border-bottom: 2px solid transparent;
  transition: all 0.15s; letter-spacing: -0.01em;
}
.crm-tab:hover { color: var(--label-primary); }
.crm-tab.active { color: var(--label-primary); border-bottom-color: var(--brand); font-weight: 600; }
.crm-tab .badge { background: var(--bg-secondary); color: var(--label-secondary); padding: 1px 8px; border-radius: 980px; margin-left: 6px; font-size: 10px; font-weight: 600; }
.crm-tab.active .badge { background: var(--brand-soft); color: var(--brand-2); }

/* Kanban CRM */
.crm-kanban { display: grid; grid-template-columns: repeat(7, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.crm-kanban-col {
  background: var(--bg-secondary); border-radius: 12px; padding: 12px;
  min-width: 220px; display: flex; flex-direction: column; gap: 8px;
}
.crm-kanban-col h4 { margin: 0 0 4px; font-size: var(--fs-footnote); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--label-tertiary); display: flex; justify-content: space-between; align-items: center; }
.crm-kanban-col .col-count { background: var(--bg-elevated); border-radius: 980px; padding: 1px 8px; font-size: 10px; color: var(--label-secondary); }
.crm-kanban-col .col-total { font-size: var(--fs-caption-1); color: var(--label-tertiary); font-weight: 500; margin-bottom: 6px; }

.crm-card {
  background: var(--bg-elevated); border-radius: 10px; padding: 12px;
  box-shadow: var(--shadow-1); cursor: pointer;
  transition: all 0.15s; border: 1px solid var(--separator);
}
.crm-card:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.crm-card-h { display: flex; gap: 9px; align-items: center; margin-bottom: 6px; }
.crm-card .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--bg-secondary); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: var(--label-tertiary); overflow: hidden; flex-shrink: 0; }
.crm-card .avatar img { width: 100%; height: 100%; object-fit: cover; }
.crm-card .nm { font-size: var(--fs-subhead); font-weight: 600; letter-spacing: -0.015em; flex: 1; min-width: 0; }
.crm-card .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.crm-card .meta .tag { font-size: 9px; padding: 2px 7px; }
.crm-card .vl { color: var(--brand-2); font-weight: 600; font-size: var(--fs-footnote); font-variant-numeric: tabular-nums; margin-top: 4px; }
.crm-card .next { font-size: 10px; color: var(--label-secondary); margin-top: 6px; padding: 4px 8px; background: var(--bg-secondary); border-radius: 6px; display: flex; align-items: center; gap: 5px; }
.crm-card .next.warn { background: rgba(255,149,0,0.12); color: #c46b00; }
.crm-card .next.late { background: rgba(255,59,48,0.1); color: var(--red); }
.crm-card .tarefa-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; padding: 2px 7px; background: rgba(0,122,255,0.1); color: var(--blue); border-radius: 980px; }

/* Pagina do cliente */
.cli-page-h {
  background: var(--bg-elevated); border: 1px solid var(--separator);
  border-radius: var(--r-xl); padding: 22px 26px; box-shadow: var(--shadow-1); margin-bottom: 18px;
}
.cli-page-h .topr { display: flex; gap: 16px; align-items: flex-start; }
.cli-page-h .avbig { width: 72px; height: 72px; border-radius: 50%; background: var(--bg-secondary); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 600; color: var(--label-tertiary); overflow: hidden; flex-shrink: 0; border: 2px solid var(--separator); }
.cli-page-h .avbig img { width: 100%; height: 100%; object-fit: cover; }
.cli-page-h .nominfo { flex: 1; min-width: 0; }
.cli-page-h h2 { margin: 0 0 6px; font-size: 26px; font-weight: 700; letter-spacing: -0.022em; }
.cli-page-h .meta-row { display: flex; gap: 12px; flex-wrap: wrap; font-size: var(--fs-footnote); color: var(--label-secondary); margin-top: 4px; }

/* Sub-abas internas do cliente */
.cli-subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--separator); margin-bottom: 18px; overflow-x: auto; }
.cli-subtab { padding: 10px 16px; font-size: var(--fs-subhead); font-weight: 500; color: var(--label-tertiary); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; letter-spacing: -0.01em; }
.cli-subtab:hover { color: var(--label-primary); }
.cli-subtab.active { color: var(--label-primary); border-bottom-color: var(--label-primary); font-weight: 600; }

/* Stage selector */
.stage-pills { display: flex; gap: 0; border-radius: 10px; overflow: hidden; background: var(--bg-secondary); }
.stage-pill { flex: 1; padding: 9px 6px; text-align: center; font-size: var(--fs-footnote); cursor: pointer; transition: all 0.15s; color: var(--label-secondary); border-right: 1px solid var(--bg-elevated); position: relative; }
.stage-pill:last-child { border-right: none; }
.stage-pill:hover { background: var(--bg-tertiary); color: var(--label-primary); }
.stage-pill.active { background: var(--brand); color: #fff; font-weight: 600; }
.stage-pill.done { background: var(--pastel-sage); color: var(--text-sage); }

/* Timeline de atividades */
.activity-list { display: flex; flex-direction: column; gap: 0; position: relative; padding-left: 28px; }
.activity-list:before { content: ""; position: absolute; left: 11px; top: 6px; bottom: 6px; width: 2px; background: var(--separator); }
.activity-item { position: relative; padding: 12px 0; border-bottom: 1px solid var(--separator); }
.activity-item:last-child { border-bottom: none; }
.activity-item .dot { position: absolute; left: -23px; top: 16px; width: 18px; height: 18px; border-radius: 50%; background: var(--brand-soft); border: 2px solid var(--bg-elevated); display: flex; align-items: center; justify-content: center; color: var(--brand); }
.activity-item .h { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; flex-wrap: wrap; }
.activity-item .tipo { font-weight: 600; font-size: var(--fs-subhead); }
.activity-item .data { font-size: var(--fs-caption-1); color: var(--label-tertiary); }
.activity-item .desc { font-size: var(--fs-footnote); color: var(--label-primary); white-space: pre-wrap; line-height: 1.5; }
.activity-item .rm { float: right; background: transparent; border: none; cursor: pointer; color: var(--label-quaternary); font-size: 16px; padding: 0 4px; }
.activity-item .rm:hover { color: var(--red); }

/* Tarefas */
.tarefa-row {
  display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px; align-items: center;
  padding: 10px 12px; background: var(--bg-tertiary); border: 1px solid var(--separator);
  border-radius: 10px; margin-bottom: 6px;
}
.tarefa-row.done { opacity: 0.55; }
.tarefa-row.done .titulo { text-decoration: line-through; }
.tarefa-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); cursor: pointer; }
.tarefa-row .titulo { font-size: var(--fs-subhead); font-weight: 500; }
.tarefa-row .data { font-size: var(--fs-caption-1); color: var(--label-secondary); white-space: nowrap; }
.tarefa-row .data.late { color: var(--red); font-weight: 600; }
.tarefa-row .data.today { color: var(--orange); font-weight: 600; }
.tarefa-row .rm { background: transparent; border: none; color: var(--label-quaternary); cursor: pointer; font-size: 18px; padding: 0 6px; }
.tarefa-row .rm:hover { color: var(--red); }

/* Oportunidades */
.opp-row {
  display: grid; grid-template-columns: 1fr auto; gap: 14px;
  padding: 14px 16px; background: var(--bg-tertiary); border: 1px solid var(--separator);
  border-radius: 10px; margin-bottom: 8px;
}
.opp-h { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.opp-h .titulo { font-size: var(--fs-subhead); font-weight: 600; flex: 1; min-width: 0; }
.opp-fields { display: flex; gap: 12px; flex-wrap: wrap; }
.opp-fields label { display: inline-flex; flex-direction: column; gap: 3px; font-size: var(--fs-caption-1); color: var(--label-tertiary); font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.opp-fields input, .opp-fields select { width: 130px; font-size: var(--fs-footnote); padding: 5px 8px; }

/* Contatos múltiplos */
.contato-card {
  background: var(--bg-tertiary); border: 1px solid var(--separator); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 10px;
}
.contato-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.contato-star {
  display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-caption-1); font-weight: 600;
  color: var(--label-quaternary); cursor: pointer; user-select: none;
}
.contato-star.on { color: var(--yellow); }
.contato-star svg { flex-shrink: 0; }
.contato-remove {
  background: transparent; border: none; color: var(--label-quaternary); cursor: pointer;
  font-size: 18px; line-height: 1; padding: 2px 6px; border-radius: 6px;
}
.contato-remove:hover { color: var(--red); background: rgba(199,111,122,0.1); }
.contato-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.contato-fields .cf { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.contato-fields .cf label { font-size: var(--fs-caption-1); color: var(--label-tertiary); font-weight: 500; }
.contato-fields .cf input { font-size: var(--fs-footnote); padding: 7px 10px; width: 100%; }
.contato-fields .cf-whats label { color: var(--green); font-weight: 600; }
.contato-fields .cf-whats input { border-color: var(--green); }
@media (max-width: 480px) { .contato-fields { grid-template-columns: 1fr; } }

/* Tags chip input */
.tags-display { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tag-chip-rm { background: var(--brand-soft); color: var(--brand-2); padding: 3px 9px 3px 12px; border-radius: 980px; font-size: var(--fs-caption-1); display: inline-flex; align-items: center; gap: 5px; font-weight: 500; }
.tag-chip-rm .x { cursor: pointer; opacity: 0.6; font-weight: 700; padding: 0 2px; }
.tag-chip-rm .x:hover { opacity: 1; color: var(--red); }

/* Funil visual */
.funil-wrap { display: flex; flex-direction: column; gap: 4px; }
.funil-bar {
  display: flex; align-items: center; padding: 12px 16px;
  background: linear-gradient(90deg, var(--brand-soft) 0%, var(--brand-soft) 100%);
  border-radius: 8px; font-size: var(--fs-subhead); cursor: pointer;
  transition: all 0.2s;
}
.funil-bar:hover { background: var(--bg-secondary); }
.funil-bar .lbl { flex: 1; font-weight: 500; }
.funil-bar .cnt { font-weight: 600; color: var(--brand-2); font-variant-numeric: tabular-nums; }
.funil-bar .val { color: var(--label-tertiary); font-size: var(--fs-footnote); margin-left: 8px; }

/* ============== MOBILE (menu-gaveta + ajustes gerais) ==============
   Fica no fim do arquivo de proposito: sobrescreve, com a mesma
   especificidade, regras base declaradas mais acima (.sidebar, .toolbar,
   .content, .field-row, .item-card, .dialog-content etc.) — em CSS, quando a
   especificidade empata, quem vem depois no arquivo vence. */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; left: 0; z-index: 210;
    width: 280px; max-width: 82vw; height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow-3);
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .mobile-menu-btn {
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 38px; height: 38px; border-radius: 10px;
    border: 1px solid var(--separator); background: var(--bg-elevated);
    color: var(--label-primary); cursor: pointer;
  }
  .sidebar-scrim.show {
    display: block; position: fixed; inset: 0; z-index: 205;
    background: rgba(0,0,0,0.38); backdrop-filter: blur(2px);
  }
  .toolbar { padding: 14px 16px 12px; }
  .content { padding: 18px 16px 40px; }
  .field-row { grid-template-columns: 1fr; }
  .item-card { grid-template-columns: 1fr; }
  .item-card .stats { flex-wrap: wrap; gap: 16px; margin-top: 4px; }
  .dialog-content { padding: 22px 18px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .prop-grid { grid-template-columns: 1fr; }
  .subtab-pinned-label { display: none; }
  .subtab-pinned { padding: 8px 10px; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
}