:root {
  --brand: #15803d;
  --brand-600: #166534;
  --brand-soft: #ecfdf3;
  --brand-glow: #4ade80;
  --bg: #f4f6f5;
  --surface: #fff;
  --surface-2: #f8faf9;
  --text: #142019;
  --muted: #64716a;
  --border: #e3e8e5;
  --blue: #2563eb;
  --green: #16a34a;
  --teal: #0891b2;
  --amber: #d97706;
  --purple: #7c3aed;
  --red: #dc2626;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 32, 24, .04), 0 4px 16px -6px rgba(16, 32, 24, .08);
  --shadow-hover: 0 2px 4px rgba(16, 32, 24, .05), 0 12px 28px -10px rgba(16, 32, 24, .18);
  --font-titulo: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  --sidebar-w: 260px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
.muted { color: var(--muted); }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
  background: #0f2a1d; color: #cfe3d8;
  display: flex; flex-direction: column; z-index: 40;
  transition: transform .25s ease;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #22c55e, #0e7490);
  display: grid; place-items: center; color: #fff; font-size: 17px;
}
.brand-logo { flex-shrink: 0; width: 40px; height: 40px; overflow: hidden; }
.brand-logo svg { width: 100%; height: 100%; display: block; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-size: 19px; color: #fff; font-weight: 500; letter-spacing: -.01em; line-height: 1.15; }
.brand-name b { font-weight: 700; color: #4ade80; }
.brand-sub { font-size: 10.5px; color: #8fb3a0; letter-spacing: .02em; }

#nav { flex: 1; overflow-y: auto; padding: 4px 10px 16px; scrollbar-width: thin; scrollbar-color: #2b4a3a transparent; }
.nav-section { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #6f9a84; padding: 16px 10px 6px; font-weight: 600; }
.nav-link, .nav-group-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border-radius: 8px; color: #cfe3d8;
  font: inherit; font-size: 13.5px; background: none; border: 0; cursor: pointer; text-align: left;
}
.nav-link > i, .nav-group-btn > i:first-child { width: 18px; text-align: center; font-size: 14px; }
.nav-link:hover, .nav-group-btn:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.active { background: #1f7a46; color: #fff; }
.nav-group-btn { font-weight: 600; }
.nav-group-btn .chev { margin-left: auto; font-size: 11px; transition: transform .2s; }
.nav-group.open .chev { transform: rotate(180deg); }
.nav-group-items { display: none; padding: 2px 0 6px 8px; margin-left: 18px; border-left: 1px solid rgba(255,255,255,.1); }
.nav-group.open .nav-group-items { display: block; }
.nav-group-items .nav-link { font-size: 13px; padding: 7px 10px; }
.nav-sub { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: #6f9a84; padding: 10px 10px 4px; font-weight: 600; }
.nav-tag { margin-left: auto; font-size: 9.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.nav-tag.new { background: #22c55e; color: #06210f; }
.sidebar-foot { padding: 14px 20px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; color: #8fb3a0; }
.sidebar-foot b { color: #fff; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 35; }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 24px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 600; flex-shrink: 0; }
.menu-btn { display: none; }
.view { padding: 24px; flex: 1; width: 100%; max-width: 1500px; margin: 0 auto; }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 16px; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 9px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.icon-btn {
  width: 34px; height: 34px; display: inline-grid; place-items: center;
  border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.danger:hover { color: var(--red); background: #fef2f2; }
.icon-btn.ok:hover { color: var(--green); background: #f0fdf4; }

/* ---------- Painéis ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.panel-head h3 { font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.panel-head h3 i { color: var(--brand); }
.panel-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.panel-head select { height: 32px; border: 1px solid var(--border); border-radius: 8px; padding: 0 8px; font: inherit; font-size: 12.5px; background: #fff; }
.panel-body { padding: 18px; }
.panel-foot { padding: 12px 18px; border-top: 1px solid var(--border); }
.link { color: var(--brand); font-weight: 600; font-size: 13px; }
.link:hover { text-decoration: underline; }

.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.row-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
.row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.row-2-1 > .panel, .row-3 > .panel { margin-bottom: 0; display: flex; flex-direction: column; }
.row-3 .panel-body { flex: 1; }

/* Atalhos financeiros */
.quick { margin-bottom: 14px; }
.qbtn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; border-radius: 9px; font-weight: 600; font-size: 13px; border: 1.5px solid; transition: filter .15s, background .15s;
}
.qbtn-green { background: var(--green); border-color: var(--green); color: #fff; }
.qbtn-red { background: var(--red); border-color: var(--red); color: #fff; }
.qbtn-green:hover, .qbtn-red:hover { filter: brightness(.93); }
.qbtn-outline-green { color: var(--green); border-color: var(--green); background: #fff; }
.qbtn-outline-red { color: var(--red); border-color: var(--red); background: #fff; }
.qbtn-outline-green:hover { background: #f0fdf4; }
.qbtn-outline-red:hover { background: #fef2f2; }

/* KPIs */
.kpi { display: flex; justify-content: space-between; gap: 12px; padding: 16px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.kpi-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.kpi-value { font-size: 22px; font-weight: 700; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12px; color: var(--muted); }
.kpi-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; flex-shrink: 0; }
.c-blue { background: #dbeafe; color: var(--blue); }
.c-green { background: #dcfce7; color: var(--green); }
.c-red { background: #fee2e2; color: var(--red); }
.c-teal { background: #cffafe; color: var(--teal); }
.c-amber { background: #fef3c7; color: var(--amber); }
.c-purple { background: #ede9fe; color: var(--purple); }

/* Blocos operacionais */
.tile { display: flex; flex-direction: column; gap: 8px; }
.tile-new {
  display: flex; align-items: center; justify-content: center; gap: 7px; height: 34px;
  border-radius: 8px; font-size: 12.5px; font-weight: 600; border: 1.5px solid currentColor; background: #fff;
}
.tile-new:hover { background: var(--surface-2); }
.tile-card {
  position: relative; display: flex; flex-direction: column; gap: 2px; min-height: 100px;
  border-radius: 10px; padding: 14px; color: #fff; transition: transform .15s, box-shadow .15s;
}
.tile-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.12); }
.tile-card .n { font-size: 26px; font-weight: 700; line-height: 1.1; }
.tile-card .l { font-size: 13px; font-weight: 500; opacity: .95; }
.tile-card .big { position: absolute; right: 14px; top: 14px; font-size: 22px; opacity: .45; }
.tile-card .more { margin-top: auto; font-size: 12px; opacity: .85; }
.t-blue { color: var(--blue); } .bg-blue { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.t-green { color: var(--green); } .bg-green { background: linear-gradient(135deg, #22c55e, #15803d); }
.t-teal { color: var(--teal); } .bg-teal { background: linear-gradient(135deg, #06b6d4, #0e7490); }
.t-amber { color: var(--amber); } .bg-amber { background: linear-gradient(135deg, #f59e0b, #c2410c); }
.t-purple { color: var(--purple); } .bg-purple { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }

/* Gráficos, listas e mapa */
.chart-box { position: relative; height: 280px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list li:first-child { padding-top: 0; }
.rank-pos { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; font-size: 11.5px; font-weight: 700; color: var(--muted); flex-shrink: 0; }
.rank-pos.top { background: #fef3c7; border-color: #fde68a; color: #b45309; }
.rank-main { flex: 1; min-width: 0; }
.rank-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-sub { font-size: 12px; color: var(--muted); }
.bar { height: 5px; border-radius: 9px; background: #eef2f0; margin-top: 5px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--brand); border-radius: 9px; }
.rank-val { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 28px 10px; }
.empty i { font-size: 26px; opacity: .45; display: block; margin-bottom: 8px; }
#map { height: 400px; border-radius: 10px; z-index: 0; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 12px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: -1px; }

.banner { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: var(--radius); background: var(--brand-soft); border: 1px solid #bbf7d0; margin-bottom: 20px; flex-wrap: wrap; }
.banner > i { font-size: 20px; color: var(--brand); }
.banner > div { flex: 1; min-width: 200px; }

/* ---------- Listagens ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { font-size: 20px; display: flex; gap: 10px; align-items: center; }
.page-head h2 i { color: var(--brand); font-size: 18px; }
.page-head p { margin: 4px 0 0; }
.card-toolbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.search { position: relative; flex: 1; max-width: 340px; }
.search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; }
.search input { width: 100%; height: 36px; padding: 0 12px 0 34px; border: 1px solid var(--border); border-radius: 8px; font: inherit; background: var(--surface-2); }
.search input:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(22,163,74,.15); }
.card-toolbar .count { margin-left: auto; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 10px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafcfb; }
.right { text-align: right !important; }
.nowrap { white-space: nowrap; }
.table td.right { font-variant-numeric: tabular-nums; white-space: nowrap; }
.strong { font-weight: 600; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-amber { background: #fef3c7; color: #92400e; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-purple { background: #ede9fe; color: #5b21b6; }
.badge-gray { background: #f1f5f9; color: #475569; }

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

/* ---------- Formulários ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: 12.5px; font-weight: 600; color: #344054; }
.field input, .field select, .field textarea {
  height: 38px; padding: 0 12px; border: 1px solid #d0d5dd; border-radius: 8px;
  font: inherit; background: #fff; color: var(--text); width: 100%;
}
.field textarea { height: auto; padding: 10px 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(22,163,74,.15); }

/* ---------- Modal e toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 1000; overflow-y: auto; animation: fade .15s; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 480px; box-shadow: 0 20px 50px rgba(0,0,0,.2); animation: pop .18s; }
.modal-wide { max-width: 740px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 16px; }
.modal-body { padding: 20px; }
.modal-body p { margin: 0; color: #475467; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 14px 14px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

#toast-root { position: fixed; right: 16px; bottom: 16px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #0f2a1d; color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.2); display: flex; gap: 10px; align-items: center; font-weight: 500; transition: opacity .3s, transform .3s; animation: pop .2s; }
.toast i { color: #4ade80; }
.toast-err i { color: #f87171; }
.toast.hide { opacity: 0; transform: translateY(6px); }

/* ---------- Em desenvolvimento ---------- */
.placeholder { max-width: 460px; margin: 8vh auto; text-align: center; }
.ph-icon { width: 72px; height: 72px; border-radius: 20px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 28px; margin: 0 auto 18px; }
.placeholder h2 { margin-bottom: 8px; }
.placeholder p { margin: 0 0 20px; }

/* ---------- Calculadora ---------- */
.calc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.calc-grid > .panel { margin-bottom: 0; }
.sub-title { font-size: 13px; margin: 22px 0 10px; color: #344054; }
.prod-head, .prod-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px 92px 34px; gap: 8px; align-items: center; }
.prod-head { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.prod-row { margin-bottom: 8px; }
.prod-row .field input, .prod-row .field select { height: 36px; }
.result-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.tip { margin-top: 18px; padding: 12px 14px; border-radius: 10px; background: #fffbeb; border: 1px solid #fde68a; font-size: 12.5px; color: #78350f; }
.tip b { display: block; margin-bottom: 4px; }

/* ---------- Contratos ---------- */
.exec { min-width: 130px; font-size: 12.5px; white-space: nowrap; }
.exec .bar { margin-top: 4px; }

/* ---------- Agenda ---------- */
.summary-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.agenda { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.agenda > .panel { margin-bottom: 0; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-nav h3 { min-width: 150px; justify-content: center; text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-dow { padding: 8px; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; text-align: center; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.cal-day {
  min-height: 104px; min-width: 0; padding: 6px; display: flex; flex-direction: column; gap: 3px;
  border: 0; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  background: #fff; text-align: left; font: inherit; color: inherit; cursor: pointer;
}
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day:hover { background: var(--surface-2); }
.cal-day.out { background: #fafbfa; color: #a5aeaa; }
.cal-day.out .cal-ev { opacity: .55; }
.cal-day.sel { box-shadow: inset 0 0 0 2px var(--brand); }
.cal-n { font-size: 12.5px; font-weight: 600; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; flex-shrink: 0; }
.cal-day.today .cal-n { background: var(--brand); color: #fff; }
.cal-ev { display: block; font-size: 11px; padding: 2px 6px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.ev-blue { background: #dbeafe; color: #1e40af; }
.ev-amber { background: #fef3c7; color: #92400e; }
.ev-green { background: #dcfce7; color: #166534; }
.ev-gray { background: #f1f5f9; color: #64748b; text-decoration: line-through; }
.cal-more { font-size: 11px; color: var(--muted); padding-left: 4px; }
.day-item { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.day-item-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.day-item-head .icon-btn { margin-left: auto; width: 30px; height: 30px; }
.day-item dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 8px 0 0; font-size: 12.5px; }
.day-item dt { color: var(--muted); }
.day-item dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.day-done { margin-top: 10px; width: 100%; }
.day-add { width: 100%; }

/* ---------- Deslocamentos ---------- */
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.filters { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { min-width: 160px; flex: 1; max-width: 240px; }
.place { position: relative; display: flex; gap: 6px; }
.place > input { flex: 1; }
.place-btn { height: 38px; padding: 0 12px; flex-shrink: 0; }
.place-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 1200;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.12); max-height: 240px; overflow-y: auto; padding: 4px;
}
.place-results button {
  display: flex; gap: 8px; align-items: flex-start; width: 100%; padding: 8px 10px; border: 0; background: none;
  border-radius: 7px; font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; color: var(--text);
}
.place-results button:hover { background: var(--surface-2); }
.place-results button i { color: var(--red); margin-top: 2px; }
.place-msg { padding: 10px; font-size: 12.5px; color: var(--muted); }
.pick-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.chip { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 5px 11px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--text); }
.chip:hover { background: var(--surface-2); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.route-map { height: 270px; border-radius: 10px; border: 1px solid var(--border); z-index: 0; }
.route-map.picking { cursor: crosshair; }
.route-map.picking .leaflet-grab { cursor: crosshair; }
.route-info { display: flex; gap: 14px; flex-wrap: wrap; justify-content: space-between; font-size: 12.5px; color: #475467; margin-top: 8px; }
.pin { width: 28px; height: 28px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.pin span { transform: rotate(45deg); color: #fff; font-weight: 700; font-size: 12px; }
.calc-total { height: 38px; display: flex; align-items: center; padding: 0 12px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-600); font-weight: 700; }
.route-cell { display: flex; gap: 6px; align-items: baseline; font-size: 12.5px; max-width: 360px; }
.route-cell + .route-cell { margin-top: 3px; }
.ab { flex-shrink: 0; width: 16px; height: 16px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 9.5px; font-weight: 700; color: #fff; }
.ab.a { background: var(--green); }
.ab.b { background: var(--red); }
.small { font-size: 11.5px; }
.clickable { cursor: pointer; }
.row-sel td { background: var(--brand-soft); }
.total-row td { font-weight: 700; background: var(--surface-2); }

/* ---------- Financeiro ---------- */
.pos { color: var(--green); }
.neg { color: var(--red); }
.text-green { color: var(--green); } .text-red { color: var(--red); } .text-amber { color: var(--amber); }
.text-teal { color: var(--teal); } .text-purple { color: var(--purple); } .text-blue { color: var(--blue); }
.mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 12px; }
.badge-teal { background: #cffafe; color: #155e75; }
.btn-excel { background: #15803d; color: #fff; }
.btn-excel:hover { background: #166534; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.row-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.row-2 > .panel { margin-bottom: 0; }

.page-size { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin-left: auto; white-space: nowrap; }
.page-size select, .sel { height: 34px; border: 1px solid var(--border); border-radius: 8px; padding: 0 8px; font: inherit; font-size: 13px; background: #fff; color: var(--text); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12.5px; flex-wrap: wrap; }
.pager:empty { display: none; }
.pager > div { display: flex; align-items: center; gap: 6px; }
.icon-btn:disabled { opacity: .35; cursor: default; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tab { border: 0; background: none; font: inherit; font-weight: 600; font-size: 13.5px; color: var(--muted); padding: 10px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--brand); border-bottom-color: var(--brand); }
.tabs-sm { margin-bottom: 14px; }
.tabs-sm .tab { font-size: 12.5px; padding: 8px 12px; }
.tab-body .page-head h2 { font-size: 16px; }

.panel-head-blue, .panel-head-green, .panel-head-red, .panel-head-grad { color: #fff; border-radius: var(--radius) var(--radius) 0 0; border-bottom: 0; }
.panel-head-blue { background: linear-gradient(90deg, #2563eb, #1d4ed8); }
.panel-head-green { background: linear-gradient(90deg, #16a34a, #15803d); }
.panel-head-red { background: linear-gradient(90deg, #dc2626, #b91c1c); }
.panel-head-grad { background: linear-gradient(90deg, #15803d, #0e7490); }
.panel-head-blue h3 i, .panel-head-green h3 i, .panel-head-red h3 i, .panel-head-grad h3 i { color: #fff; }

.rel-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chk { width: 36px; text-align: center !important; }
.chk input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }
.table tfoot td { border-top: 1px solid var(--border); }
.switch { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.switch input { accent-color: var(--brand); width: 15px; height: 15px; }
.panel-head .switch:first-of-type { margin-left: auto; }

/* DRE */
.dre-filtros { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: end; }
.mes-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 38px; padding: 0 4px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); }
.mes-nav b { text-transform: uppercase; color: var(--brand-600); font-size: 13px; letter-spacing: .03em; }
.dre-grupo { border-bottom: 1px solid var(--border); padding: 4px 0; }
.dre-grupo summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 4px; cursor: pointer; list-style: none; font-weight: 600; }
.dre-grupo summary::-webkit-details-marker { display: none; }
.dre-grupo summary::before { content: '\f078'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: 11px; color: var(--muted); margin-right: 8px; transition: transform .2s; }
.dre-grupo:not([open]) summary::before { transform: rotate(-90deg); }
.dre-label { flex: 1; display: flex; align-items: center; gap: 8px; text-transform: uppercase; font-size: 13px; letter-spacing: .01em; }
.dica { color: #b0b8b4; font-size: 12px; cursor: help; }
.dre-item { display: flex; justify-content: space-between; gap: 12px; padding: 7px 4px 7px 32px; font-size: 13px; color: #475467; font-variant-numeric: tabular-nums; }
.dre-vazio { padding: 4px 4px 12px 32px; font-size: 12.5px; color: var(--muted); font-style: italic; }
.dre-total { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0; padding: 14px 16px; border-radius: 10px; border: 1.5px solid #cbd5e1; background: var(--surface-2); font-weight: 700; }
.dre-total b { font-size: 15px; font-variant-numeric: tabular-nums; }
.dre-green { border-color: #86efac; background: #f0fdf4; }
.dre-blue { border-color: #93c5fd; background: #eff6ff; }
.dre-final { border-color: var(--brand); background: var(--brand-soft); }
.dre-final b { font-size: 18px; }
.dre-mensal th, .dre-mensal td { padding: 9px 10px; font-size: 12.5px; white-space: nowrap; }
.dre-mensal thead th { background: #0f2a1d; color: #fff; }
.dre-mensal .col-total { background: #ede9fe; font-weight: 700; color: #4c1d95; }
.dre-mensal thead .col-total { background: var(--purple); color: #fff; }
.dre-row-total td { background: #f8faf9; font-weight: 700; }
.dre-row-final td { background: var(--brand-soft); font-weight: 700; font-size: 13px; }
.dre-row-final .col-total { background: var(--brand); color: #fff; }

/* Fluxo de caixa */
.alerts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-bottom: 16px; }
.alerts:empty { display: none; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 10px; font-size: 13px; border: 1px solid; }
.alert a { font-weight: 700; color: inherit; text-decoration: underline; }
.alert-amber { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-red { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-teal { background: #ecfeff; border-color: #a5f3fc; color: #155e75; }
.cash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 4px; }
.cash-card { padding: 16px 18px; }
.cash-title { font-weight: 600; color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.cash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.cash-cols div { display: flex; flex-direction: column; }
.cash-cols b { font-size: 17px; font-variant-numeric: tabular-nums; }
.cash-saldo { padding-top: 10px; font-size: 13px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; flex-wrap: wrap; }
.seg-btn { border: 0; border-right: 1px solid var(--border); background: #fff; font: inherit; font-size: 12.5px; font-weight: 600; padding: 8px 14px; cursor: pointer; color: var(--text); }
.seg-btn:last-child { border-right: 0; }
.seg-btn.on { background: var(--brand); color: #fff; }
.tl-day { border-left: 3px solid var(--border); padding-left: 14px; margin-bottom: 16px; }
.tl-date { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.tl-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px; margin-bottom: 6px; background: #fff; }
.tl-main { flex: 1; min-width: 0; }
.tl-main .strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cash-foot { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; padding: 14px 18px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: 13px; border-radius: 0 0 var(--radius) var(--radius); }

.shortcuts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.shortcut { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 10px; border: 1px solid var(--border); border-radius: 10px; font-weight: 600; font-size: 12.5px; text-align: center; transition: background .15s, border-color .15s; }
.shortcut i { font-size: 18px; color: var(--brand); }
.shortcut:hover { background: var(--brand-soft); border-color: #bbf7d0; }

/* ---------- Conta, login e assinatura ---------- */
body.auth-mode .app { display: none; }
.auth-wrap {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px;
  background: radial-gradient(circle at 20% 10%, #1f7a46 0, transparent 45%), radial-gradient(circle at 90% 90%, #0e7490 0, transparent 40%), #0f2a1d;
}
.auth-card { width: 100%; max-width: 420px; background: #fff; border-radius: 16px; box-shadow: 0 24px 60px rgba(0,0,0,.35); overflow: hidden; }
.auth-card-wide { max-width: 860px; }
.auth-brand { display: flex; align-items: center; gap: 10px; padding: 20px 24px; background: #0f2a1d; }
.auth-body { padding: 4px 24px 24px; }
.auth-pitch { margin: 16px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-600); font-size: 13px; text-align: center; }
.auth-tabs { margin: 12px 0 16px; }
.auth-tabs .tab { flex: 1; }
.auth-title { margin: 20px 0 6px; font-size: 18px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-msg { font-size: 13px; border-radius: 8px; padding: 10px 12px; }
.auth-msg:empty { display: none; }
.auth-msg.erro { background: #fef2f2; color: #991b1b; }
.auth-msg.ok { background: #f0fdf4; color: #166534; }
.auth-body > .auth-msg { margin-bottom: 14px; }
.auth-loading { padding: 40px 0 20px; text-align: center; color: var(--muted); }
.auth-actions { display: flex; gap: 10px; margin-top: 16px; }
.auth-foot { color: #8fb3a0; font-size: 12px; margin-top: 18px; }
.auth-opcoes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 18px 0 12px; }
.auth-box { border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.auth-box h4 { font-size: 14px; display: flex; gap: 8px; align-items: center; }
.auth-box h4 i { color: var(--brand); }
.auth-lista { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.auth-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: #fff; font: inherit; cursor: pointer; text-align: left; }
.auth-item:hover { background: var(--brand-soft); }
.auth-item > span { flex: 1; display: flex; flex-direction: column; }
.btn-block { width: 100%; }
.btn-google { background: #fff; border: 1px solid #d6ddd9; color: #1f2937; font-weight: 600; gap: 10px; box-shadow: 0 1px 2px rgba(16,32,24,.06); }
.btn-google:hover { background: #f8faf9; border-color: #b8c4bd; }
.btn-google:disabled { opacity: .6; }
#a-google-msg { margin-top: 10px; }
.divisor { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--muted); font-size: 12px; }
.divisor::before, .divisor::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.link-btn { background: none; border: 0; color: var(--brand); font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; align-self: center; padding: 6px; display: block; margin: 8px auto 0; }
.link-btn:hover { text-decoration: underline; }
.danger-link { color: var(--red); }

.avatar-btn { border: 0; cursor: pointer; font: inherit; font-weight: 600; font-size: 13px; }
.avatar-lg { width: 48px; height: 48px; font-size: 18px; }
.sidebar-foot #user-empresa { color: #8fb3a0; }
.conta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.codigo-convite { font-family: ui-monospace, Consolas, monospace; font-size: 26px; letter-spacing: .2em; font-weight: 700; padding: 14px; text-align: center; background: var(--brand-soft); color: var(--brand-600); border-radius: 10px; margin: 6px 0 10px; }

.sync { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.sync.ok i { color: var(--green); }
.sync.salvando i { color: var(--blue); }
.sync.erro { color: var(--red); }
.plano-banner { display: flex; align-items: center; gap: 8px; justify-content: center; flex-wrap: wrap; padding: 8px 16px; background: #eff6ff; color: #1e40af; font-size: 13px; border-bottom: 1px solid #bfdbfe; }
.plano-banner.alerta { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.plano-banner a { font-weight: 700; text-decoration: underline; }

.plano-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; margin-top: 16px; }
.plano-card { position: relative; border: 2px solid var(--brand); border-radius: 14px; padding: 22px; background: linear-gradient(180deg, var(--brand-soft), #fff 60%); }
.plano-tag { position: absolute; top: -11px; left: 20px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; }
.plano-preco { font-size: 34px; font-weight: 700; color: var(--brand-600); margin: 6px 0 12px; }
.plano-preco span { font-size: 15px; color: var(--muted); font-weight: 500; }
.plano-lista { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; }
.plano-lista i { color: var(--green); margin-right: 6px; }
.plano-formas { display: flex; flex-wrap: wrap; gap: 8px; }
.plano-formas span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--border); }
.plano-formas .fa-pix { color: #32bcad; }
.plano-status { border: 1px solid var(--border); border-radius: 14px; padding: 20px; }

/* ---------- Checklists ---------- */
.ck-cab { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ck-datahora { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 6px; }
.ck-perfil { margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; }
.ck-perfil i { color: var(--brand); margin-right: 4px; }
.ck-secao .panel-head span { margin-left: auto; }
.ck-q { padding: 14px 0; border-bottom: 1px solid var(--border); }
.ck-q:first-child { padding-top: 0; }
.ck-q:last-child { border-bottom: 0; padding-bottom: 0; }
.ck-q.ck-falta { background: #fef2f2; box-shadow: 0 0 0 8px #fef2f2; border-radius: 6px; }
.ck-texto { font-weight: 600; display: flex; gap: 8px; align-items: baseline; }
.ck-num { flex-shrink: 0; min-width: 22px; height: 22px; padding: 0 4px; border-radius: 6px; background: var(--brand-soft); color: var(--brand-600); font-size: 11.5px; display: inline-grid; place-items: center; }
.ck-dica { font-size: 12.5px; color: #475467; margin: 4px 0 10px 30px; }
.ck-dica i { color: var(--teal); margin-right: 4px; }
.ck-opcoes { display: flex; flex-wrap: wrap; gap: 8px; margin-left: 30px; }
.ck-op { position: relative; cursor: pointer; }
.ck-op input { position: absolute; opacity: 0; pointer-events: none; }
.ck-op span { display: inline-block; padding: 8px 13px; border-radius: 9px; border: 1.5px solid var(--border); background: #fff; font-size: 13px; line-height: 1.3; transition: background .12s, border-color .12s; }
.ck-op:hover span { border-color: #94a3b8; }
.ck-op input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.ck-ok input:checked + span { background: #dcfce7; border-color: var(--green); color: #14532d; font-weight: 600; }
.ck-alerta input:checked + span { background: #fef3c7; border-color: var(--amber); color: #78350f; font-weight: 600; }
.ck-bloqueio input:checked + span { background: #fee2e2; border-color: var(--red); color: #7f1d1d; font-weight: 600; }
.ck-na input:checked + span { background: #f1f5f9; border-color: var(--gray); font-weight: 600; }
.ck-barra {
  position: sticky; bottom: 0; z-index: 20; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 16px; margin: 0 -4px 12px; background: rgba(255,255,255,.96); backdrop-filter: blur(6px);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 -4px 16px rgba(0,0,0,.06);
}
.ck-prog { flex: 1; min-width: 180px; }
.ck-prog .bar { height: 8px; margin: 0 0 4px; }
.ck-aviso { margin-top: 4px; }
.day-links { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.day-links .btn { flex: 1; }
.info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 16px; }
.info-grid > div { display: flex; flex-direction: column; gap: 2px; }
.ck-resumo-secao { margin-bottom: 12px; }
.ck-resumo-secao > b { display: block; font-size: 13px; margin-bottom: 2px; }
.ck-resumo-secao .dre-item { padding-left: 8px; align-items: center; }
.ck-resumo-secao .dre-item .badge { white-space: normal; text-align: right; max-width: 50%; }

/* ---------- Agenda: disponibilidade dos pilotos ---------- */
.cal-legenda { display: flex; flex-wrap: wrap; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.cal-ev i { font-size: 10px; }
.ev-blue i.fa-circle-check, .ev-amber i.fa-circle-check { color: var(--green); }
.cal-ev i.fa-circle-xmark { color: var(--red); }
.cal-ev i.fa-circle-question { color: var(--amber); }
.resp-box { margin-top: 10px; padding: 10px 12px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); }
.resp-titulo { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 6px; }
.resp-lista { list-style: none; margin: 0 0 4px; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.resp-lista li { display: flex; gap: 8px; align-items: baseline; }
.resp-botoes { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.resp-botoes .btn { flex: 1; }
.resp-sim { background: #fff; border-color: #86efac; color: #166534; }
.resp-sim:hover, .resp-sim.on { background: var(--green); border-color: var(--green); color: #fff; }
.resp-nao { background: #fff; border-color: #fca5a5; color: #991b1b; }
.resp-nao:hover, .resp-nao.on { background: var(--red); border-color: var(--red); color: #fff; }
#lista-extra .list li { flex-wrap: wrap; }

/* ---------- Acesso de piloto ---------- */
/* As regras de verdade ficam no banco; aqui só se escondem controles que o piloto não pode usar. */
.papel-piloto .so-moderador,
.papel-piloto .tile-new,
.papel-piloto .panel-foot,
.papel-piloto .tile-card .more,
.papel-piloto [data-del] { display: none !important; }
.papel-piloto .tile-card { pointer-events: none; }
.vagas { margin-bottom: 8px; }
.vinculo { flex-basis: 100%; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-left: 38px; }
.vinculo select { height: 32px; border: 1px solid var(--border); border-radius: 8px; padding: 0 8px; font: inherit; font-size: 12.5px; background: #fff; max-width: 100%; }
#equipe .list li { flex-wrap: wrap; }
.vagas .bar { height: 8px; margin-bottom: 4px; }

/* =====================================================================
   Acabamento visual (v2): superfícies calmas, uma cor principal e cores
   semânticas só onde informam algo. Fica depois dos componentes e antes
   das regras responsivas.
   ===================================================================== */
h1, h2, h3, h4, .kpi-value, .brand-name, .tile-card .n { font-family: var(--font-titulo); letter-spacing: -.01em; }
::selection { background: #bbf7d0; }
.view { animation: entrar .25s ease; }
@keyframes entrar { from { opacity: 0; transform: translateY(4px); } }

/* Menu lateral */
.sidebar { background: linear-gradient(180deg, #0c2a1b 0%, #0a2016 100%); box-shadow: 1px 0 0 rgba(255,255,255,.04); }
.brand { padding: 20px 20px 18px; }
.brand-logo { box-shadow: 0 6px 18px -6px rgba(34,197,94,.6); }
.nav-section { color: #5f8a73; font-size: 10px; letter-spacing: .12em; padding: 18px 12px 6px; }
.nav-link, .nav-group-btn { position: relative; padding: 9px 12px; border-radius: 10px; color: #b9d3c4; transition: background .15s, color .15s; }
.nav-link > i, .nav-group-btn > i:first-child { color: #7fb398; transition: color .15s; }
.nav-link:hover, .nav-group-btn:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-link:hover > i, .nav-group-btn:hover > i:first-child { color: #fff; }
.nav-link.active { background: linear-gradient(90deg, rgba(74,222,128,.18), rgba(74,222,128,.06)); color: #fff; font-weight: 600; }
.nav-link.active > i { color: var(--brand-glow); }
.nav-link.active::before { content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand-glow); }
.nav-group-items { border-left-color: rgba(255,255,255,.08); }
.nav-group-items .nav-link.active::before { left: -19px; }
.sidebar-foot { display: flex; align-items: center; gap: 10px; padding: 14px 16px; margin: 8px 10px 12px; border: 1px solid rgba(255,255,255,.08); border-radius: 12px; background: rgba(255,255,255,.03); }
.sidebar-foot > div:last-child { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.sidebar-foot b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot #user-empresa { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sf-avatar { flex-shrink: 0; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #06210f; background: linear-gradient(135deg, #86efac, #22c55e); }

/* Topo */
.topbar { height: 64px; background: rgba(244,246,245,.82); backdrop-filter: saturate(160%) blur(10px); border-bottom-color: transparent; box-shadow: 0 1px 0 var(--border); }
.icon-btn.menu-btn { display: none; }
.topbar h1 { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.titulo-ico { width: 32px; height: 32px; border-radius: 9px; display: inline-grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: 14px; flex-shrink: 0; }
.sync { padding: 5px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.user-chip { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.user-chip b { font-size: 13px; }
.user-chip span { font-size: 11px; color: var(--muted); }
.avatar-btn { width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(135deg, #22c55e, var(--brand)); box-shadow: 0 4px 12px -4px rgba(21,128,61,.6); transition: transform .15s; }
.avatar-btn:hover { transform: translateY(-1px); }
.plano-banner { background: linear-gradient(90deg, #eff6ff, #ecfdf3); border-bottom: 1px solid #dbeafe; }

/* Cartões e cabeçalhos de página */
.panel { border-color: var(--border); box-shadow: var(--shadow); }
.panel-head { padding: 16px 20px; }
.panel-head h3 { font-size: 15px; }
.panel-head h3 > i:first-child { width: 28px; height: 28px; border-radius: 8px; display: inline-grid; place-items: center; background: var(--brand-soft); font-size: 13px; }
.panel-head-blue h3 > i:first-child, .panel-head-green h3 > i:first-child, .panel-head-red h3 > i:first-child, .panel-head-grad h3 > i:first-child { background: rgba(255,255,255,.18); }
.panel-body { padding: 20px; }
.page-head { margin-bottom: 22px; }
.page-head h2 { font-size: 22px; }
.page-head h2 > i { width: 38px; height: 38px; border-radius: 11px; display: inline-grid; place-items: center; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: 16px; }

/* Indicadores */
.kpi { background: var(--surface); border-color: var(--border); border-radius: 14px; padding: 18px; position: relative; overflow: hidden; transition: box-shadow .2s, transform .2s; }
.kpi:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.kpi-label { font-size: 11px; letter-spacing: .07em; }
.kpi-value { font-size: 24px; margin: 6px 0 4px; }
.kpi-icon { width: 44px; height: 44px; border-radius: 12px; font-size: 18px; }
.summary .kpi, .grid-4 .kpi { box-shadow: var(--shadow); }

/* Botões */
.btn { height: 40px; border-radius: 11px; transition: background .15s, border-color .15s, box-shadow .15s, transform .1s; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-sm { height: 34px; border-radius: 9px; }
.btn-primary { background: linear-gradient(180deg, #19934a, var(--brand)); box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 4px 12px -4px rgba(21,128,61,.55); }
.btn-primary:hover { background: linear-gradient(180deg, #168540, var(--brand-600)); }
.btn-ghost { box-shadow: 0 1px 2px rgba(16,32,24,.04); }
.btn-ghost:hover { border-color: #cfd8d3; }
.btn:focus-visible, .icon-btn:focus-visible, .nav-link:focus-visible { outline: 2px solid var(--brand-glow); outline-offset: 2px; }
.icon-btn { border-radius: 9px; }

/* Atalhos do resumo financeiro: suaves, a cor só indica entrada/saída */
.qbtn { height: 44px; border-radius: 12px; border-width: 1px; font-size: 13px; transition: background .15s, box-shadow .15s; }
.qbtn-green, .qbtn-outline-green { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.qbtn-red, .qbtn-outline-red { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.qbtn-green:hover, .qbtn-outline-green:hover { background: #dcfce7; filter: none; }
.qbtn-red:hover, .qbtn-outline-red:hover { background: #fee2e2; filter: none; }
.qbtn-outline-green, .qbtn-outline-red { background: var(--surface); }

/* Tabelas */
.table th { background: var(--surface-2); font-size: 11px; letter-spacing: .06em; padding: 12px 16px; color: #7a877f; }
.table td { padding: 12px 16px; border-bottom-color: #eef1ef; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #f6faf7; }
.card-toolbar { padding: 14px 16px; }
.search input { height: 38px; border-radius: 10px; background: var(--surface); }
.badge { padding: 3px 10px; font-weight: 600; letter-spacing: .01em; }

/* Formulários e janelas */
.field label { font-size: 12.5px; color: #3c4a42; }
.field input, .field select, .field textarea { height: 40px; border-radius: 10px; border-color: #d6ddd9; transition: border-color .15s, box-shadow .15s; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #b8c4bd; }
.modal-backdrop { background: rgba(10,22,16,.45); backdrop-filter: blur(3px); }
.modal { border-radius: 18px; box-shadow: 0 30px 70px -20px rgba(0,0,0,.35); }
.modal-head { padding: 18px 22px; }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 22px; }
.modal-foot { border-radius: 0 0 18px 18px; padding: 14px 22px; }
.toast { border-radius: 12px; padding: 13px 18px; }

/* Dashboard: saudação */
.hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; padding: 22px 26px; border-radius: 20px; color: #fff;
  background: radial-gradient(circle at 85% 20%, rgba(74,222,128,.35), transparent 40%), radial-gradient(circle at 10% 120%, rgba(14,116,144,.45), transparent 45%), linear-gradient(120deg, #0c2a1b, #14532d);
  box-shadow: 0 18px 40px -22px rgba(12,42,27,.8); position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; right: -40px; bottom: -60px; width: 260px; height: 260px; border-radius: 50%; border: 36px solid rgba(255,255,255,.04); }
.hero h2 { font-size: 24px; color: #fff; }
.hero p { margin: 6px 0 0; color: #b9d3c4; }
.hero-chips { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero-chip { display: flex; flex-direction: column; min-width: 120px; padding: 10px 14px; border-radius: 14px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(4px); }
.hero-chip b { font-family: var(--font-titulo); font-size: 20px; }
.hero-chip span { font-size: 11.5px; color: #b9d3c4; }

/* Dashboard: blocos operacionais em cartões claros */
.tile-card2 { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); transition: box-shadow .2s, transform .2s, border-color .2s; }
.tile-card2:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); border-color: #d3dcd7; }
.tile-top { display: flex; align-items: center; justify-content: space-between; }
.tile-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 17px; }
.tile-num { font-family: var(--font-titulo); font-size: 28px; font-weight: 700; line-height: 1; }
.tile-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.tile-acoes { display: flex; justify-content: space-between; align-items: center; padding-top: 10px; border-top: 1px dashed var(--border); font-size: 12.5px; font-weight: 600; }
.tile-acoes a { color: var(--brand); white-space: nowrap; }
.tile-acoes a:hover { text-decoration: underline; }
.tile-acoes .tile-novo { color: var(--muted); }
.tile-acoes .tile-novo:hover { color: var(--brand); }
.papel-piloto .tile-acoes { display: none; }

/* Login: apresentação da marca ao lado do formulário */
.auth-split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); width: 100%; max-width: 1040px; border-radius: 24px; overflow: hidden; box-shadow: 0 40px 90px -30px rgba(0,0,0,.6); }
.auth-split .auth-card { max-width: none; border-radius: 0; box-shadow: none; display: flex; flex-direction: column; justify-content: center; }
.auth-split .auth-card .auth-brand { display: none; }
.auth-split .auth-body { padding: 36px 40px; }
.auth-hero { position: relative; padding: 40px; color: #fff; display: flex; flex-direction: column; justify-content: space-between; gap: 30px; min-height: 560px;
  background: radial-gradient(circle at 80% 15%, rgba(74,222,128,.35), transparent 45%), linear-gradient(160deg, #0c2a1b 0%, #14532d 60%, #0e7490 140%); overflow: hidden; }
.auth-hero .brand-name { font-size: 22px; }
.hero-selo { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 14px; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(74,222,128,.14); border: 1px solid rgba(74,222,128,.35); color: #bbf7d0; }
.auth-hero h2 { font-size: 30px; line-height: 1.15; margin: 0 0 12px; }
.auth-hero p { color: #c4dccf; margin: 0; max-width: 380px; }
.auth-hero ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.auth-hero li i { color: var(--brand-glow); width: 22px; }
.auth-hero .faixas { position: absolute; inset: auto -20% -30% -20%; height: 55%; opacity: .14;
  background: repeating-linear-gradient(-18deg, #4ade80 0 2px, transparent 2px 26px); transform: perspective(500px) rotateX(55deg); }
.auth-hero > * { position: relative; }

/* ---------- Responsivo ---------- */
@media (max-width: 1280px) {
  .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .row-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1050px) {
  .row-2-1, .calc-grid, .agenda, .row-2, .cash-grid, .dre-filtros, .plano-grid, .auth-opcoes { grid-template-columns: minmax(0, 1fr); }
  .ck-cab { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4, .summary-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-overlay { display: block; }
  .main { margin-left: 0; }
  .menu-btn, .icon-btn.menu-btn { display: inline-grid; }
  .user-chip { display: none; }
  .auth-split { grid-template-columns: minmax(0, 1fr); max-width: 460px; }
  .auth-hero { display: none; }
  .auth-split .auth-card .auth-brand { display: flex; }
  .auth-split .auth-body { padding: 8px 24px 28px; }
  .view { padding: 16px; }
  .topbar { padding: 0 16px; }
}
@media (max-width: 640px) {
  .grid-4, .row-3, .summary, .form-grid, .result-kpis { grid-template-columns: minmax(0, 1fr); }
  .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar-right .btn span, .sync span { display: none; }
  .kpi-value { font-size: 20px; }
  #map { height: 300px; }
  .summary-4, .ck-cab, .info-grid { grid-template-columns: minmax(0, 1fr); }
  .hero { padding: 18px; }
  .hero h2 { font-size: 20px; }
  .hero-chip { min-width: 0; flex: 1; padding: 10px; }
  .hero-chip b { font-size: 16px; white-space: nowrap; }
  .grid-4.quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qbtn { font-size: 12px; padding: 0 6px; }
  .sync { padding: 5px 8px; }
  .ck-dica, .ck-opcoes { margin-left: 0; }
  .ck-op, .ck-op span { width: 100%; }
  .cal-day { min-height: 58px; padding: 4px; }
  .cal-ev { font-size: 0; height: 6px; padding: 0; border-radius: 3px; }
  .cal-more { display: none; }
  .cal-nav h3 { min-width: 0; }
}
