
/* ---------- CARDS ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 4px;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: hidden;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card .label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.7px; font-weight: 600; }
.stat-card .value { font-size: 28px; font-weight: 700; color: var(--ink); letter-spacing: -0.03em; margin-top: 2px; }
.stat-card .detail { font-size: 12px; color: var(--muted); }
.stat-card::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: transparent;
}
.stat-card.accent::after { background: var(--yellow); }
.stat-card.danger::after { background: var(--danger); }
.stat-card.success::after { background: var(--success); }
.stat-card.info::after { background: var(--info); }
.stat-card.warning::after { background: var(--warning); }

/* ---------- HERO (real-time banner) ---------- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #0B0B0C 0%, #1D1D1F 100%);
  color: #fff;
  border-radius: var(--r-xl);
  padding: 22px 26px;
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px; align-items: center;
  box-shadow: var(--shadow-sm);
}
.hero::before {
  content: ""; position: absolute;
  right: -80px; top: -80px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(245,197,24,0.22) 0%, transparent 60%);
  pointer-events: none;
}
.hero-left { display: flex; flex-direction: column; gap: 6px; position: relative; z-index: 1; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase;
  color: rgba(255,255,255,0.7);
}
.live-dot {
  width: 8px; height: 8px; border-radius: 999px; background: #1DD04B;
  box-shadow: 0 0 0 0 rgba(29,208,75,0.5);
  animation: livePulse 1.6s ease-in-out infinite;
}
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(29,208,75,0.55); }
  70%  { box-shadow: 0 0 0 10px rgba(29,208,75,0); }
  100% { box-shadow: 0 0 0 0 rgba(29,208,75,0); }
}
.hero-title { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.hero-title .accent { color: var(--yellow); }
.hero-sub { font-size: 13.5px; color: rgba(255,255,255,0.65); max-width: 640px; }
.hero-right { display: flex; flex-direction: column; gap: 4px; text-align: right; position: relative; z-index: 1; }
.hero-clock {
  font-size: 30px; font-weight: 700; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.hero-date { font-size: 12px; color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: 0.8px; }
@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; }
  .hero-right { text-align: left; }
  .hero-title { font-size: 20px; }
  .hero-clock { font-size: 26px; }
}

/* ---------- EQUIPE HERO ---------- */
.equipe-hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px; align-items: center;
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 24px 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.equipe-hero::before {
  content: ""; position: absolute;
  right: 0; top: 0; bottom: 0; width: 240px;
  background: linear-gradient(90deg, transparent 0%, rgba(245,197,24,0.08) 100%);
  pointer-events: none;
}
.equipe-hero-avatar {
  width: 72px; height: 72px;
  border-radius: 20px;
  background: var(--black);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 34px;
  box-shadow: 0 6px 18px -8px rgba(0,0,0,0.35);
  position: relative; z-index: 1;
  flex-shrink: 0;
}
.equipe-hero-text { min-width: 0; position: relative; z-index: 1; }
.equipe-hero-text .eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 1.2px;
  color: var(--muted); text-transform: uppercase;
}
.equipe-hero-text h1 {
  font-size: 26px; font-weight: 700; color: var(--ink);
  letter-spacing: -0.02em; margin: 4px 0 2px;
}
.equipe-hero-text p { font-size: 13.5px; color: var(--muted); margin: 0; }
.equipe-hero-stats {
  display: flex; gap: 16px; position: relative; z-index: 1;
}
.equipe-hero-stats .pill {
  background: var(--surface-2);
  border-radius: var(--r); padding: 10px 16px;
  display: flex; flex-direction: column; gap: 2px; text-align: right;
  min-width: 96px;
}
.equipe-hero-stats .pill .n {
  font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.equipe-hero-stats .pill .l {
  font-size: 10.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px;
}
@media (max-width: 820px) {
  .equipe-hero { grid-template-columns: auto 1fr; }
  .equipe-hero-stats { grid-column: 1 / -1; justify-content: flex-start; flex-wrap: wrap; }
}

/* ---------- DASHBOARD GRID ---------- */
.dash-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}
.dash-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}
.dash-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}
@media (max-width: 1024px) {
  .dash-grid, .dash-grid-3, .dash-grid-2 { grid-template-columns: 1fr; }
}

/* ---------- CHART CARDS ---------- */
.chart-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 16px;
  min-height: 260px;
  transition: box-shadow 0.2s;
}
.chart-card:hover { box-shadow: var(--shadow); }
.chart-card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px;
}
.chart-card-header h3 {
  font-size: 14px; font-weight: 600; color: var(--ink);
  letter-spacing: -0.01em;
  margin: 0;
}
.chart-card-header p {
  font-size: 12px; color: var(--muted); margin: 2px 0 0;
}
.chart-card-header .chart-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; color: var(--muted);
  padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
}
.chart-card-header .chart-chip .dot { width: 6px; height: 6px; border-radius: 999px; background: var(--success); }

.chart-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }

/* Donut */
.donut-wrap { display: flex; align-items: center; gap: 22px; }
.donut-wrap svg { flex-shrink: 0; }
.donut-center {
  font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; font-weight: 600;
}
.donut-center b {
  display: block; font-size: 28px; color: var(--ink); font-weight: 700; letter-spacing: -0.02em;
  text-transform: none;
}
.donut-legend { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.donut-legend-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}
.donut-legend-item .dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.donut-legend-item .lbl { color: var(--ink); font-weight: 500; flex: 1; }
.donut-legend-item .val { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Bar chart (horizontal bars) */
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 42px; gap: 10px; align-items: center; }
.bar-row .lbl { font-size: 12.5px; color: var(--ink); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .bar {
  height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden;
  position: relative;
}
.bar-row .bar > span {
  display: block; height: 100%; border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.bar-row .val { font-size: 12.5px; color: var(--muted); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

/* Bar chart (vertical bars) */
.bars-v {
  display: flex; align-items: flex-end; gap: 10px;
  height: 180px; padding: 10px 4px 24px;
  border-bottom: 1px dashed var(--line);
}
.bars-v .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; height: 100%; }
.bars-v .col .bar {
  width: 100%; max-width: 42px; border-radius: 8px 8px 0 0;
  background: var(--ink);
  transition: height 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  margin-top: auto;
  position: relative;
}
.bars-v .col .bar.accent { background: var(--yellow); }
.bars-v .col .bar::after {
  content: attr(data-val); position: absolute; top: -20px; left: 50%; transform: translateX(-50%);
  font-size: 11px; font-weight: 600; color: var(--ink); white-space: nowrap;
}
.bars-v-labels { display: flex; gap: 10px; padding: 0 4px; }
.bars-v-labels .lbl { flex: 1; text-align: center; font-size: 11px; color: var(--muted); font-weight: 500; }

/* Sparkline */
.sparkline-wrap { display: flex; flex-direction: column; gap: 6px; }
.sparkline-value { font-size: 28px; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }
.sparkline-delta { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.sparkline-delta.up { color: var(--success); }
.sparkline-delta.down { color: var(--danger); }
.sparkline-delta.neutral { color: var(--muted); }
.sparkline svg { width: 100%; height: 50px; display: block; }

/* Live list */
.live-list { display: flex; flex-direction: column; }
.live-list-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.live-list-item:last-child { border-bottom: 0; }
.live-list-item .ico-box {
  width: 32px; height: 32px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--line);
}
.live-list-item .ico-box.danger { background: rgba(217,55,43,0.08); color: var(--danger); border-color: rgba(217,55,43,0.2); }
.live-list-item .ico-box.warning { background: rgba(197,138,0,0.09); color: var(--warning); border-color: rgba(197,138,0,0.2); }
.live-list-item .ico-box.success { background: rgba(14,159,110,0.09); color: var(--success); border-color: rgba(14,159,110,0.2); }
.live-list-item .ico-box.info { background: rgba(10,110,225,0.09); color: var(--info); border-color: rgba(10,110,225,0.2); }
.live-list-item .lbl { font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.live-list-item .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.live-list-item .val { font-size: 12.5px; color: var(--muted); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

/* Mini progress line (used inside cards) */
.mini-progress {
  display: flex; align-items: center; gap: 10px;
}
.mini-progress .track {
  flex: 1; height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden;
}
.mini-progress .track > span {
  display: block; height: 100%; border-radius: 999px; background: var(--yellow);
  transition: width 0.5s cubic-bezier(0.2,0.8,0.2,1);
}
.mini-progress .pct {
  font-size: 12px; font-weight: 700; color: var(--ink); min-width: 36px; text-align: right; font-variant-numeric: tabular-nums;
}

/* Big metric tile */
.metric-tile {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 4px;
  position: relative;
  transition: box-shadow 0.18s var(--ease), transform 0.18s var(--ease);
}
.metric-tile:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.metric-tile .label {
  font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.metric-tile .label .ico {
  width: 26px; height: 26px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px;
  background: var(--surface-2); border: 1px solid var(--line);
}
.metric-tile .value {
  font-size: 30px; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; line-height: 1.1;
}
.metric-tile .value .suffix { font-size: 14px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.metric-tile .delta {
  font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 5px;
}
.metric-tile .delta.up { color: var(--success); }
.metric-tile .delta.down { color: var(--danger); }
.metric-tile .delta.neutral { color: var(--muted); }
.metric-tile.accent .label .ico { background: var(--yellow-soft); border-color: transparent; color: var(--black); }
.metric-tile.danger .label .ico { background: rgba(217,55,43,0.09); border-color: transparent; color: var(--danger); }
.metric-tile.warning .label .ico { background: rgba(197,138,0,0.09); border-color: transparent; color: var(--warning); }
.metric-tile.success .label .ico { background: rgba(14,159,110,0.09); border-color: transparent; color: var(--success); }
.metric-tile.info .label .ico { background: rgba(10,110,225,0.09); border-color: transparent; color: var(--info); }

/* ---------- TURNO BANNER ---------- */
.turno-banner {
  display: none;
  background: var(--surface);
  color: var(--ink);
  padding: 14px 20px;
  border-radius: var(--r-lg);
  margin-bottom: 18px;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.turno-banner::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--yellow);
}
.turno-banner .turno-ico { font-size: 20px; }
.turno-banner .turno-sub { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: auto; }

/* ---------- DAY SELECTOR (seletor de dia da semana) ---------- */
.day-selector {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: var(--r-lg);
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}
.day-selector .day-label {
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.7px;
  margin-right: 6px;
}
.day-selector .day-btn {
  appearance: none;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 13px;
  font-size: 13px; font-weight: 500;
  background: transparent;
  color: var(--muted);
  border: none;
  border-radius: var(--r-full);
  cursor: pointer;
  transition: all .15s;
}
.day-selector .day-btn:hover { background: rgba(0,0,0,0.05); color: var(--ink); }
.day-selector .day-btn.active {
  background: var(--black); color: var(--yellow);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}
.day-selector .day-btn.today { outline: 2px solid rgba(245,197,24,0.5); outline-offset: 2px; }
.day-selector .day-btn .off-dot {
  width: 6px; height: 6px; border-radius: 999px;
  background: var(--danger);
}

/* ---------- FOLGA BANNER ---------- */
.folga-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  background: #FEF3C7;
  border: 1px solid #F5DE8C;
  border-radius: var(--r-lg);
  margin-bottom: 14px;
  font-size: 13.5px;
  color: #8A5A00;
}
.folga-banner strong { color: #0B0B0C; }
.folga-banner .ico { font-size: 22px; }
.folga-banner .cover-pill {
  margin-left: auto;
  padding: 4px 10px;
  background: #FFF;
  border: 1px solid #F5DE8C;
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
  color: #0B0B0C;
}

.cover-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  background: #FEE2E2; color: #991B1B;
  border: 1px solid #FCA5A5;
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
  line-height: 1.4;
}

/* quando estou cobrindo outra função */
.covering-group {
  border-left: 3px dashed var(--danger);
  padding-left: 10px;
  margin-top: 14px;
}
.covering-group h4 { color: var(--danger) !important; }

/* Folga day highlight in Cronograma task-row */
.task-row.is-folga-day { opacity: 0.75; background: #FEF3C7; border-color: #F5DE8C; }

/* Schedule modal */
.schedule-table-wrap { max-height: 60vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--r); }
.schedule-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.schedule-table th, .schedule-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.schedule-table thead th { position: sticky; top: 0; background: var(--surface-2); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.schedule-table tbody tr:last-child td { border-bottom: 0; }
.day-checks { display: flex; gap: 8px; flex-wrap: wrap; }
.day-check { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 12px; font-weight: 600; background: var(--surface); transition: all .12s ease; user-select: none; }
.day-check input { margin: 0; }
.day-check:has(input:checked) { background: var(--danger-soft, #FEE2E2); border-color: #FCA5A5; color: #991B1B; }

/* ---------- STATUS BAR ---------- */
.status-bar {
  display: inline-block;
  width: 68px; height: 6px;
  border-radius: 999px;
  background: var(--line);
  position: relative;
  overflow: hidden;
  vertical-align: middle;
  margin-right: 8px;
}
.status-bar > span {
  display: block; height: 100%;
  border-radius: 999px;
  transition: width 0.25s ease, background 0.2s;
}
.check-done-meta { font-size: 10px; color: var(--muted); margin-top: 4px; }
.check-done-meta b { color: var(--ink-soft); font-weight: 600; }

.panel {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
  transition: box-shadow 0.18s;
}
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.panel-header h2 { font-size: 16px; font-weight: 700; color: var(--ink); letter-spacing: -0.025em; }
.panel-header p { font-size: 12px; color: var(--muted); margin-top: 3px; }
.panel-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- BUTTONS ---------- */
.btn {
  padding: 9px 18px;
  border-radius: var(--r-full);
  font-weight: 600;
  font-size: 13px;
  transition: transform 0.12s var(--ease), background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid transparent;
  white-space: nowrap;
  letter-spacing: -0.01em;
  cursor: pointer;
}
.btn:active { transform: scale(0.96); }
.btn:focus-visible { box-shadow: var(--ring); outline: none; }

.btn-primary {
  background: var(--black); color: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.20), 0 1px 2px rgba(0,0,0,0.12);
}
.btn-primary:hover { background: #2c2c2e; box-shadow: 0 3px 12px rgba(0,0,0,0.28); }
.btn-primary .ico-dot { width: 6px; height: 6px; background: var(--yellow); border-radius: 50%; display: inline-block; }

.btn-dark { background: var(--black); color: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.18); }
.btn-dark:hover { background: #2c2c2e; }

.btn-accent {
  background: var(--yellow); color: var(--black);
  box-shadow: 0 1px 4px rgba(245,197,24,0.35);
  font-weight: 700;
}
.btn-accent:hover { background: var(--yellow-dark); box-shadow: 0 3px 10px rgba(245,197,24,0.45); }

.btn-outline {
  background: rgba(255,255,255,0.92); color: var(--ink);
  border-color: var(--line-strong);
  backdrop-filter: blur(6px);
}
.btn-outline:hover { background: #fff; border-color: var(--ink-soft); }

.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: rgba(0,0,0,0.05); color: var(--ink); }

.btn-danger {
  background: var(--danger); color: #fff;
  box-shadow: 0 1px 4px rgba(255,59,48,0.25);
}
.btn-danger:hover { background: #e0352b; box-shadow: 0 3px 10px rgba(255,59,48,0.35); }

.btn-danger-outline { background: transparent; color: var(--danger); border-color: rgba(255,59,48,0.28); }
.btn-danger-outline:hover { background: var(--danger-soft); border-color: var(--danger); }

.btn-danger-ghost { background: transparent; color: var(--danger); border-color: var(--line-strong); }
.btn-danger-ghost:hover { background: var(--danger-soft); border-color: var(--danger); }

.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-xs { padding: 3px 10px; font-size: 11px; }
.btn-icon { padding: 0; width: 32px; height: 32px; border-radius: var(--r); font-size: 14px; justify-content: center; }

/* ---------- TABLES ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
table.data {
  width: 100%;
  border-collapse: separate; border-spacing: 0;
  font-size: 13px;
}
table.data th {
  text-align: left;
  padding: 11px 16px;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 700;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  border-bottom: 1px solid var(--line);
}
table.data td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(60,60,67,0.07);
  vertical-align: middle;
  color: var(--ink);
}
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: var(--surface-2); }
table.data .row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
  font-size: 14px;
}
.empty-state .ico { font-size: 38px; margin-bottom: 12px; display: block; }
.empty-state .title { font-weight: 600; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

/* ---------- PAGINATION ---------- */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin-top: 16px; padding: 12px 4px 4px;
}
.pagination-info {
  color: var(--muted); font-size: 13px; font-weight: 500;
}
.pagination-controls {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.pagination-size {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--muted); font-weight: 500;
}
.pagination-size select { min-width: 72px; }
.pagination-buttons {
  display: inline-flex; align-items: center; gap: 4px;
}
.pagination-buttons .btn {
  min-width: 34px; padding: 6px 10px; font-size: 13px; font-weight: 500;
}
.pagination-buttons .pag-ellipsis {
  padding: 0 4px; color: var(--muted-2); font-weight: 600; letter-spacing: 1px;
}

/* ---------- BADGES ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.badge-success { background: var(--success-soft); color: #0a7a55; }
.badge-danger { background: var(--danger-soft); color: #a2271e; }
.badge-warning { background: var(--warning-soft); color: #8a6200; }
.badge-info { background: var(--info-soft); color: #0a58b0; }
.badge-dark { background: var(--ink); color: var(--yellow); }
.badge-soft { background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--line); }

/* ---------- FORMS ---------- */
.form-grid { display: grid; gap: 14px; }
.form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 720px) {
  .form-grid.cols-2, .form-grid.cols-3 { grid-template-columns: 1fr; }
}
.form-field label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
  letter-spacing: 0.01em;
}
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 10px 13px;
  border-radius: var(--r);
  border: 1.5px solid var(--line-strong);
  background: var(--surface-2);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  color: var(--ink);
  font-size: 14px;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus { border-color: var(--yellow); background: #fff; box-shadow: var(--ring); }
.form-field textarea { min-height: 88px; resize: vertical; }
.form-field .hint { font-size: 11px; color: var(--muted); margin-top: 4px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ---------- MODAL ---------- */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.28);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  z-index: 50;
  align-items: center; justify-content: center;
  padding: 20px;
  animation: overlayIn 0.18s var(--ease);
}
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
.modal-overlay.active { display: flex; }
.modal {
  background: #FFFFFF;
  border-radius: var(--r-xl);
  width: 100%; max-width: 560px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,0.05);
  animation: modalIn 0.28s var(--ease-spring);
}
@keyframes modalIn { from { transform: scale(0.93) translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 17px; font-weight: 700; color: var(--ink); letter-spacing: -0.025em; }
.modal-close {
  font-size: 16px; color: var(--muted-2);
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2);
  transition: background 0.12s, color 0.12s;
  flex-shrink: 0;
}
.modal-close:hover { background: rgba(0,0,0,0.08); color: var(--ink); }
.modal-body { padding: 20px 24px; overflow-y: auto; }
.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 8px;
  background: var(--surface-2);
}

/* ---------- CATEGORY BADGES ---------- */
.cat-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

/* ---------- CRONOGRAMA ---------- */
.cat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 22px; }
.cat-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--yellow);
  cursor: pointer;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
  position: relative;
}
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.cat-card .ico { font-size: 22px; }
.cat-card .label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; margin-top: 6px; }
.cat-card .value { font-size: 26px; font-weight: 700; margin-top: 2px; color: var(--ink); letter-spacing: -0.02em; }
.cat-card .detail { font-size: 11px; color: var(--muted); margin-top: 2px; }

.moment-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--yellow);
  margin-bottom: 14px;
  position: relative;
  transition: box-shadow 0.2s;
}
.moment-card:hover { box-shadow: var(--shadow); }
.moment-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 2px; color: var(--ink); }
.moment-card .meta { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.moment-card .cat-summary { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.area-group { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.area-group:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.area-group h4 { font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.7px; }
.task-list { display: flex; flex-direction: column; gap: 4px; }
.task-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--r); font-size: 13px; flex-wrap: wrap; transition: background 0.12s; border: 1px solid transparent; }
.task-row:hover { background: #EFEFF3; border-color: var(--line); }
.task-row .task-main { flex: 1; min-width: 160px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task-row .task-text { color: var(--ink); }
.task-row .task-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
/* ---------- PENDÊNCIAS ---------- */
.pendencias-card {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-left: 4px solid #F59E0B;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}
.pendencias-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.pendencias-ico { font-size: 20px; line-height: 1; flex-shrink: 0; }
.pendencias-title { font-size: 14px; font-weight: 700; color: #92400E; }
.pendencias-sub   { font-size: 12px; color: #B45309; margin-top: 2px; }
.task-row--pending { background: #FFF7ED; border-color: #FED7AA; }

.task-exec-row { width: 100%; display: flex; align-items: center; gap: 8px; padding-top: 6px; border-top: 1px solid var(--line); margin-top: 2px; flex-wrap: wrap; }
.exec-start-btn  { font-size: 12px !important; padding: 4px 14px !important; background: var(--surface) !important; border: 1px solid var(--line) !important; border-radius: 20px !important; color: var(--ink-3) !important; cursor: pointer; transition: all .15s; }
.exec-start-btn:hover { border-color: var(--ink) !important; color: var(--ink) !important; }
.exec-finish-btn { font-size: 12px !important; padding: 4px 14px !important; background: var(--yellow) !important; border: 1px solid var(--yellow-dark,#D9AC0E) !important; border-radius: 20px !important; color: var(--black) !important; font-weight: 600 !important; cursor: pointer; transition: all .15s; }
.exec-finish-btn:hover { background: var(--yellow-dark,#D9AC0E) !important; }

/* ---------- BLOCO EXEC (equipe — iniciar/finalizar por bloco) ---------- */
.bloco-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.bloco-header > div:first-child { flex: 1; min-width: 0; }
.bloco-exec { flex-shrink: 0; display: flex; align-items: center; }

.qty-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  background: #FFF7D6; color: #8A5A00;
  border: 1px solid #F5DE8C;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  line-height: 1.4;
}
.time-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  background: #DBEAFE; color: #1E3A8A;
  border: 1px solid #93C5FD;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.days-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  background: #F3E8FF; color: #6B21A8;
  border: 1px solid #D8B4FE;
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
  line-height: 1.4;
}

.task-assign-select {
  padding: 4px 8px;
  font-size: 11.5px;
  font-weight: 500;
  border: 1px dashed var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  max-width: 170px;
  cursor: pointer;
  transition: all .15s ease;
}
.task-assign-select:hover { border-color: var(--ink); color: var(--ink); }
.task-assign-select.is-assigned { border-style: solid; border-color: var(--yellow); background: #FFF8D8; color: var(--ink); font-weight: 600; }

.moment-card .moment-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  margin-bottom: 6px;
}
.moment-card .moment-head h3 { margin: 0; }
/* ---------- CHECKLIST EXECUTION ---------- */
.checklist-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r);
  border: 1.5px solid var(--line);
  margin-bottom: 6px;
  background: var(--surface);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.checklist-item:hover { border-color: var(--line-strong); box-shadow: var(--shadow-xs); }
.checklist-item.checked { background: var(--yellow-soft); border-color: rgba(245,197,24,0.5); }
.checklist-item input[type="checkbox"] { margin-top: 2px; width: 17px; height: 17px; accent-color: var(--black); cursor: pointer; }
.checklist-item .text { flex: 1; color: var(--ink); }
.checklist-item .text.checked { text-decoration: line-through; color: var(--muted); }

/* ---------- TOASTS ---------- */
#toasts { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: rgba(22,22,24,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--r-full);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  min-width: 200px;
  animation: slideIn 0.3s var(--ease-spring);
  display: flex; align-items: center; gap: 10px;
  border: 1px solid rgba(255,255,255,0.08);
}
.toast::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); flex-shrink: 0; }
.toast.success::before { background: var(--success); }
.toast.error::before { background: var(--danger); }
@keyframes slideIn { from { transform: translateX(16px) scale(0.94); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- PAGE ---------- */
.page { display: none; }
.page.active { display: block; animation: fadeIn 0.2s var(--ease); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* ---------- TABS ---------- */
/* ---------- TAREFAS DA OPERAÇÃO ---------- */
.tarefa-row {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  margin-bottom: 7px;
  background: var(--surface);
  overflow: hidden;
  transition: box-shadow .15s, border-color .15s;
}
.tarefa-row:hover { box-shadow: var(--shadow-sm); border-color: var(--line-strong); }
.tarefa-cat-strip { width: 4px; align-self: stretch; flex-shrink: 0; }
.tarefa-body {
  flex: 1;
  padding: 12px 14px;
  min-width: 0;
}
.tarefa-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.tarefa-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.tarefa-actions {
  display: flex;
  gap: 4px;
  padding: 0 10px;
  opacity: 0;
  transition: opacity .15s;
  flex-shrink: 0;
}
.tarefa-row:hover .tarefa-actions { opacity: 1; }

.tarefa-exec {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.exec-btn { font-size: 12px !important; padding: 4px 12px !important; }
.exec-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
}
.exec-badge--running {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
}
.exec-badge--done {
  background: #DCFCE7;
  color: #15803D;
  border: 1px solid #BBF7D0;
}

/* ---------- LISTA DE PRODUÇÃO ---------- */
.prod-group-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.prod-group-label--done { color: var(--gray-400, #c0c0c8); }

.prod-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 8px;
  background: var(--surface);
  transition: opacity .15s;
}
.prod-item--done { opacity: .55; }

.prod-check {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: transparent;
  transition: all .15s;
}
.prod-check:hover { border-color: var(--yellow-dark, #D9AC0E); }
.prod-check--done {
  background: #0E9F6E;
  border-color: #0E9F6E;
  color: #fff;
}

.prod-item-body { flex: 1; min-width: 0; }
.prod-item-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}
.prod-item-qty {
  margin-top: 3px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--ink-2);
  line-height: 1.1;
}
.prod-item-note {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.prod-item-done-meta {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}
.prod-item-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity .15s;
}
.prod-item:hover .prod-item-actions { opacity: 1; }

.tabs {
  display: flex; gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  padding: 4px;
  margin-bottom: 18px;
  width: fit-content;
}
.tab {
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  border-radius: var(--r-full);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); background: rgba(0,0,0,0.04); }
.tab.active {
  color: var(--ink);
  font-weight: 600;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

/* ---------- SEARCH / TOOLBAR ---------- */
.toolbar {
  display: flex; gap: 10px; align-items: center;
  margin-bottom: 14px; flex-wrap: wrap;
}
.toolbar .search {
  flex: 1; min-width: 220px;
  padding: 9px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.toolbar .search:focus { border-color: var(--yellow); box-shadow: var(--ring); }
.search-input {
  flex: 1; min-width: 200px; max-width: 280px;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-input:focus { border-color: var(--yellow); box-shadow: var(--ring); }

/* Caixa modal table inputs */
.cx-table td:last-child { width: 160px; }
.cx-table input[type="number"] {
  width: 100%; padding: 5px 8px; font-size: 13px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); text-align: right;
}
.cx-table input[type="number"]:focus { border-color: var(--yellow); outline: none; box-shadow: var(--ring); }

/* Caixa — sangrias/retiradas itemized rows */
.cx-op-row {
  display: grid;
  grid-template-columns: 1fr 130px 32px;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}
.cx-op-row .cx-op-desc {
  padding: 5px 10px; font-size: 13px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
}
.cx-op-row .cx-op-valor {
  padding: 5px 8px; font-size: 13px; text-align: right;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
}
.cx-op-row input:focus { border-color: var(--yellow); outline: none; box-shadow: var(--ring); }

/* ---------- CHAT MENSAGENS ---------- */
.chat-shell {
  display: flex; height: calc(100vh - 120px); gap: 0;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden;
}
.chat-sidebar {
  width: 220px; min-width: 180px; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; background: var(--gray-50);
}
.chat-sidebar-header {
  padding: 14px 16px 10px; border-bottom: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.chat-role-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: pointer; font-size: 13px;
  border-bottom: 1px solid var(--line); transition: background .1s;
}
.chat-role-item:hover { background: var(--gray-100); }
.chat-role-item--active { background: #FEF3C7; font-weight: 600; }
.chat-role-ico { font-size: 18px; }
.chat-role-label { flex: 1; }
.chat-badge {
  background: var(--yellow); color: #000; font-size: 11px; font-weight: 700;
  border-radius: 99px; padding: 1px 7px; min-width: 18px; text-align: center;
}
.chat-main {
  flex: 1; display: flex; flex-direction: column; min-width: 0;
}
.chat-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.chat-messages {
  flex: 1; overflow-y: auto; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 12px;
  background: var(--gray-50);
}
.chat-empty {
  flex: 1; text-align: center; color: var(--muted);
  font-size: 13px; padding: 40px 0; line-height: 1.8;
}
.chat-msg-group { display: flex; flex-direction: column; gap: 6px; }
.chat-msg-bubble {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 12px 14px; max-width: 720px;
}
.chat-msg-meta {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.chat-msg-text { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink); }
.chat-msg-actions {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; padding-top: 8px;
  border-top: 1px solid var(--line);
}
.chat-reply-bubble {
  background: #F0F9FF; border: 1px solid #BAE6FD; border-radius: var(--r-lg);
  padding: 10px 14px; max-width: 680px; margin-left: 28px;
  font-size: 13px; line-height: 1.5; display: flex; flex-direction: column; gap: 4px;
}
.chat-reply-who { font-size: 11px; color: var(--muted); }
.chat-input-bar {
  border-top: 1px solid var(--line); padding: 12px 16px; background: var(--surface);
}
.chat-input-row {
  display: flex; gap: 8px; align-items: flex-end;
}
.chat-cat-select {
  flex-shrink: 0; font-size: 12px; padding: 6px 8px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
}
.chat-textarea {
  flex: 1; resize: none; padding: 8px 12px; font-size: 14px; line-height: 1.5;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); min-height: 38px; max-height: 120px;
  overflow-y: auto;
}
.chat-textarea:focus { outline: none; border-color: var(--yellow); box-shadow: var(--ring); }
.chat-send-btn { flex-shrink: 0; }

/* ---------- SEGMENTED (Apple-style) ---------- */
.segmented {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 3px;
  border-radius: 10px;
  gap: 2px;
}
.segmented button {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 7px;
  color: var(--muted);
  transition: all 0.15s;
}
.segmented button:hover { color: var(--ink); }
.segmented button.active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

/* ---------- ADMIN ACTION BAR ---------- */
.admin-actionbar {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
}
.admin-actionbar .info { display: flex; align-items: center; gap: 10px; }
.admin-actionbar .info .ico { font-size: 18px; }
.admin-actionbar .info .text { font-size: 13px; color: var(--ink-soft); }
.admin-actionbar .info .text b { color: var(--ink); }
.admin-actionbar .actions { display: flex; gap: 8px; align-items: center; }

/* icon-only row actions (Apple-style: subtle) */
.row-actions .btn-icon {
  width: 30px; height: 30px;
  padding: 0;
  border-radius: 8px;
  color: var(--muted);
  border: 1px solid transparent;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px;
  line-height: 1;
}
.row-actions .btn-icon:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.row-actions .btn-icon.danger:hover { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-soft); }

/* ---------- MULTI-SELECT DROPDOWN (MSD) ---------- */
.msd-wrap { position: relative; }
.msd-trigger {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 13px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r);
  cursor: pointer;
  font-size: 13.5px;
  background: var(--surface-2);
  min-height: 42px;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  color: var(--ink);
  user-select: none;
}
.msd-trigger:hover { border-color: var(--muted-2); background: #fff; }
.msd-trigger:focus, .msd-trigger[aria-expanded="true"] { border-color: var(--yellow); background: #fff; box-shadow: var(--ring); }
.msd-trigger .msd-chevron {
  color: var(--muted-2);
  font-size: 10px;
  flex-shrink: 0;
  margin-left: 6px;
  transition: transform 0.18s var(--ease-in-out);
}
.msd-trigger[aria-expanded="true"] .msd-chevron { transform: rotate(180deg); }
.msd-placeholder { color: var(--muted-2); }
.msd-list {
  display: none;
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  box-shadow: var(--shadow-md);
  z-index: 999;
  padding: 5px;
  animation: msdIn 0.15s var(--ease-spring);
}
.msd-list.open { display: block; }
@keyframes msdIn { from { opacity: 0; transform: translateY(-6px) scale(0.98); } to { opacity: 1; transform: none; } }
.msd-option {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 13.5px;
  border-radius: var(--r-sm);
  transition: background 0.1s;
  color: var(--ink);
  user-select: none;
}
.msd-option:hover { background: var(--surface-2); }
.msd-option input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: var(--black);
  cursor: pointer;
  flex-shrink: 0;
}

/* ---------- BADGE UPGRADES ---------- */
.badge { letter-spacing: 0; }

/* ---------- CARD HOVER ---------- */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s, transform 0.18s;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

/* ---------- EQUIPE-HERO refinements ---------- */
.equipe-hero { border-radius: var(--r-lg); }


/* ============ FINANCE MODULE STYLES ============ */
.vbars { display: flex; gap: 10px; align-items: flex-end; padding: 14px 8px 8px; min-height: 140px; }
.vbar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.vbar-wrap { width: 100%; height: 120px; display: flex; align-items: flex-end; justify-content: center; }
.vbar { width: 70%; max-width: 40px; background: var(--accent); border-radius: 6px 6px 0 0; position: relative; transition: all 0.2s; min-height: 2px; }
.vbar:hover { opacity: 0.85; }
.vbar-value { font-size: 11px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vbar-label { font-size: 11px; color: var(--muted); text-align: center; overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }

.stacked-bars { display: flex; gap: 10px; align-items: flex-end; padding: 14px 8px 8px; min-height: 180px; }
.stack-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.stack-wrap { width: 100%; height: 140px; display: flex; flex-direction: column-reverse; align-items: stretch; justify-content: flex-start; gap: 1px; max-width: 42px; }
.stack-seg { min-height: 1px; border-radius: 2px; transition: all 0.2s; }
.stack-seg:hover { opacity: 0.85; }
.stack-label { font-size: 11px; color: var(--muted); text-align: center; white-space: nowrap; }
.stack-total { font-size: 11px; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

.timeline { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.timeline li { display: flex; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); align-items: flex-start; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.tl-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tl-head { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; color: var(--ink); }
.tl-sub { font-size: 12px; color: var(--muted); }

.legend { display: flex; flex-wrap: wrap; gap: 10px 18px; padding: 8px 4px 0; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 500; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; display: inline-block; }
.legend-row { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 6px 0; }

.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin: 10px 0; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); }
.filter-bar > * { flex: 1 1 140px; min-width: 120px; }
.filter-bar label { font-size: 12px; color: var(--muted); font-weight: 600; display: block; margin-bottom: 4px; }

.pager { display: flex; justify-content: center; gap: 6px; padding: 10px 0; flex-wrap: wrap; }
.pager button { padding: 6px 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: var(--r-sm); cursor: pointer; font-weight: 500; font-size: 13px; }
.pager button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.pager button:hover:not(.active):not(:disabled) { background: var(--surface-2); }
.pager button:disabled { opacity: 0.4; cursor: not-allowed; }

.form-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.form-row label { font-size: 12px; color: var(--muted); font-weight: 600; }
.form-row-inline { display: flex; gap: 10px; flex-wrap: wrap; }
.form-row-inline .form-row { flex: 1 1 200px; min-width: 180px; }

.btn-danger-outline { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-danger-outline:hover { background: var(--danger); color: #fff; }

.kpi-mini { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; }
.kpi-mini .lbl { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.kpi-mini .val { font-size: 22px; color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 4px; }
.kpi-mini .sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.kpi-mini.ok .val { color: var(--success, #10b981); }
.kpi-mini.warn .val { color: var(--warning, #f59e0b); }
.kpi-mini.danger .val { color: var(--danger); }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 10px 0; }

.dre-table { width: 100%; border-collapse: collapse; }
.dre-table td { padding: 8px 12px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.dre-table td:last-child { text-align: right; font-weight: 600; }
.dre-table tr.dre-total td { background: var(--surface-2); font-weight: 700; border-top: 2px solid var(--line-strong); }
.dre-table tr.dre-sub td { color: var(--muted); padding-left: 24px; }
.dre-table tr.dre-neg td:last-child { color: var(--danger); }
.dre-table tr.dre-pos td:last-child { color: var(--success, #10b981); }

.badge-success { background: #10b981; color: #fff; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.badge-warning { background: #f59e0b; color: #fff; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.badge-danger { background: var(--danger); color: #fff; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }

.hero-finance { background: linear-gradient(135deg, #0F172A 0%, #1e293b 100%); color: #fff; padding: 20px 24px; border-radius: var(--r-md); margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; }
.hero-finance h2 { margin: 0; font-size: 20px; font-weight: 700; }
.hero-finance p { margin: 4px 0 0; opacity: 0.75; font-size: 13px; }
.hero-finance .hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hero-finance .btn { background: rgba(255,255,255,0.12); color: #fff; border: 1px solid rgba(255,255,255,0.2); }
.hero-finance .btn:hover { background: rgba(255,255,255,0.2); }


/* ===== HISTÓRICO DIÁRIO DE ESTOQUE ===== */
.stock-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.stock-history-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 14px;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
  box-shadow: var(--shadow-xs);
}
.stock-history-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--yellow);
}
.stock-history-date {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}
.stock-history-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}
.stock-history-total {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

/* ===== PRODUÇÃO — CARDS DE TAREFA ===== */
.prod-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.prod-section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.prod-section-meta {
  margin-left: 10px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.prod-group-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 10px;
}
.prod-group-label--done {
  color: var(--success, #10b981);
}
.prod-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 4px;
}
.prod-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
  transition: box-shadow 0.15s, border-color 0.15s, opacity 0.15s;
  position: relative;
}
.prod-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--yellow);
}
.prod-card--done {
  opacity: 0.6;
  border-color: var(--success, #10b981);
  background: #f0fdf4;
}
.prod-card--running {
  border-color: #F59E0B;
  background: #FFFBEB;
}
.prod-card-check {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--line-strong, #d1d5db);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  line-height: 1;
  color: #6b7280;
  padding: 0;
}
.prod-card-check:hover {
  transform: scale(1.1);
  border-color: var(--yellow);
  background: #fefce8;
}
.prod-card-check--done {
  background: var(--success, #10b981);
  border-color: var(--success, #10b981);
  color: #fff;
}
.prod-card-check--done:hover {
  background: #059669;
  border-color: #059669;
}
.prod-card-check--running {
  background: #FEF3C7;
  border-color: #F59E0B;
  color: #D97706;
}
.prod-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.prod-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 120px;
}
.prod-card-name--done {
  text-decoration: line-through;
  color: var(--muted);
}
.prod-card-qty {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.03em;
  white-space: nowrap;
  flex-shrink: 0;
}
.prod-card-qty--done {
  color: var(--muted);
  text-decoration: line-through;
}
.prod-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}
.prod-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--surface-2);
  color: var(--ink-2);
  white-space: nowrap;
}
.prod-chip--qty {
  background: #FFF7ED;
  color: #C2410C;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 10px;
}
.prod-chip--min {
  background: #FEF9C3;
  color: #854D0E;
}
.prod-chip--time {
  background: #EFF6FF;
  color: #1D4ED8;
}
.prod-chip--shift {
  background: var(--surface-2);
  color: var(--muted);
}
.prod-chip--role {
  background: #F5F3FF;
  color: #6D28D9;
}
.prod-card-done-meta {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.prod-card-actions {
  flex-shrink: 0;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
  margin-left: auto;
}
.prod-card:hover .prod-card-actions {
  opacity: 1;
}

/* ===== USUÁRIOS — CARDS ===== */
.user-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  margin-bottom: 8px;
  background: var(--surface);
  transition: box-shadow 0.15s;
}
.user-card:hover { box-shadow: var(--shadow-sm); }
.user-card--inactive { opacity: 0.55; }
.user-card-avatar {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--yellow);
  color: #1a1a1a;
  font-weight: 700;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.user-card-body { flex: 1; min-width: 0; }
.user-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.user-card-you { font-size: 11px; color: var(--muted); font-weight: 400; }
.user-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 12px;
}
.user-card-login { color: var(--muted); }
.user-card-cargo {
  background: var(--surface-2);
  color: var(--ink-2);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.user-card-perms { display: flex; flex-wrap: wrap; gap: 4px; }
.perm-chip {
  width: 26px; height: 26px;
  border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px;
  border: 1.5px solid transparent;
  cursor: default;
}
.perm-chip--on  { background: #D1FAE5; border-color: #10b981; }
.perm-chip--off { background: var(--surface-2); border-color: var(--line); opacity: 0.45; }
.user-card-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
  align-items: flex-end;
}

/* ===== USUÁRIOS — PERMISSÕES NO MODAL ===== */
.perm-toggle-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 8px 10px;
  background: var(--surface-2);
}
.perm-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.1s;
}
.perm-toggle-row:hover { background: var(--surface); }
.perm-toggle-row input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--yellow); }
.perm-toggle-ico { font-size: 16px; width: 22px; text-align: center; }
.perm-toggle-label { flex: 1; font-weight: 500; color: var(--ink); }
.perm-toggle-default { font-size: 11px; color: var(--muted); }

/* ================================================================
   MÓDULO FINANCEIRO — Insumos · Fichas · Precificação · DRE · Simulador · Config
================================================================ */

/* ── Tabela genérica de insumos/fichas ── */
.fin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.fin-table th {
  text-align: left;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1.5px solid var(--line);
}
.fin-table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.fin-table tbody tr:last-child td { border-bottom: none; }
.fin-table tbody tr:hover { background: var(--surface-2); }
.fin-table td.num, .fin-table th.num { text-align: right; }

/* ── Badges de categoria / status ── */
.fin-cat-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--ink-2);
}
.fin-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}
.fin-pct-badge {
  display: inline-block;
  min-width: 52px;
  text-align: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}

/* ── KPI tiles do módulo financeiro ── */
.fin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.fin-kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 16px;
}
.fin-kpi-card .label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: 4px;
}
.fin-kpi-card .value {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.1;
}
.fin-kpi-card .sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* ── DRE ── */
.dre-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 768px) { .dre-grid { grid-template-columns: 1fr; } }

.dre-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.dre-panel-title {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.dre-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.dre-row:last-child { border-bottom: none; }
.dre-row--result {
  background: var(--surface-2);
  font-weight: 700;
}
.dre-row--positive { background: #F0FDF4; }
.dre-row--negative { background: #FEF2F2; }
.dre-row-label { flex: 1; color: var(--ink-2); }
.dre-row-pct { min-width: 52px; text-align: right; font-size: 11px; color: var(--muted); }
.dre-row-val { min-width: 100px; text-align: right; font-weight: 600; color: var(--ink); }
.dre-row--edit .dre-row-val input {
  width: 90px;
  text-align: right;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface);
  color: var(--ink);
}
.dre-section-title {
  padding: 6px 14px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
}
.dre-pe-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #1F2937, #0F172A);
  color: #fff;
  border-radius: var(--r);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.dre-pe-card .main { flex: 1; }
.dre-pe-card .pe-label { font-size: 11px; opacity: .7; text-transform: uppercase; letter-spacing: .07em; }
.dre-pe-card .pe-val { font-size: 28px; font-weight: 800; }
.dre-pe-card .pe-sub { font-size: 12px; opacity: .7; margin-top: 2px; }
.dre-pe-card .pe-stat { text-align: right; }
.dre-pe-card .pe-stat-label { font-size: 11px; opacity: .7; }
.dre-pe-card .pe-stat-val { font-size: 18px; font-weight: 700; }
.dre-alerts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.dre-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--r);
  font-size: 13px;
  border: 1px solid transparent;
}
.dre-alert--danger  { background: #FEF2F2; border-color: #FCA5A5; color: #991B1B; }
.dre-alert--warning { background: #FFFBEB; border-color: #FCD34D; color: #92400E; }
.dre-alert--info    { background: #EFF6FF; border-color: #93C5FD; color: #1E40AF; }
.dre-alert-ico { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.dre-despesas-list { display: flex; flex-direction: column; }
.dre-desp-add { padding: 8px 14px; }

/* ── Simulador ── */
.sim-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 768px) { .sim-layout { grid-template-columns: 1fr; } }
.sim-controls {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.sim-slider-row { display: flex; flex-direction: column; gap: 6px; }
.sim-slider-header { display: flex; justify-content: space-between; font-size: 13px; }
.sim-slider-label { font-weight: 600; color: var(--ink-2); }
.sim-slider-val { font-weight: 700; color: var(--yellow); font-size: 15px; }
.sim-slider-row input[type=range] {
  width: 100%;
  accent-color: var(--yellow);
}
.sim-results {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.sim-result-header {
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
}
.sim-result-big {
  padding: 20px 16px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.sim-result-big .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.sim-result-big .value { font-size: 32px; font-weight: 800; line-height: 1.1; margin: 4px 0 2px; }
.sim-result-big .delta { font-size: 12px; }
.sim-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.sim-kpi {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
.sim-kpi:nth-child(even) { border-right: none; }
.sim-kpi .k-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.sim-kpi .k-val   { font-size: 16px; font-weight: 700; color: var(--ink); margin-top: 2px; }

/* ── Config ── */
.fin-cfg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.fin-cfg-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.fin-cfg-section-title {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.fin-cfg-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.fin-cfg-row:last-child { border-bottom: none; }
.fin-cfg-row label { flex: 1; color: var(--ink-2); font-weight: 500; }
.fin-cfg-row input[type=number] {
  width: 80px;
  text-align: right;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface);
  color: var(--ink);
}
.fin-cfg-row input[type=number]:focus { outline: none; border-color: var(--yellow); }
.fin-cfg-row .unit { font-size: 11px; color: var(--muted); min-width: 20px; }
.fin-cfg-preview {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 16px;
  font-size: 13px;
}
.fin-cfg-preview h4 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0 0 8px; }
.fin-cfg-preview-row { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid var(--line); }
.fin-cfg-preview-row:last-child { border-bottom: none; }

/* ── Ingredientes no modal de ficha ── */
.ing-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.ing-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
}
.ing-sel { flex: 1; min-width: 0; padding: 5px 8px; border: 1px solid var(--line); border-radius: 4px; font-size: 13px; background: var(--surface); color: var(--ink); }
.ing-qtd { width: 70px; text-align: right; padding: 5px 8px; border: 1px solid var(--line); border-radius: 4px; font-size: 13px; background: var(--surface); color: var(--ink); }
.ing-un  { font-size: 11px; color: var(--muted); min-width: 24px; }
.ing-cost { font-size: 12px; font-weight: 600; color: var(--ink-2); min-width: 64px; text-align: right; }
.ing-del { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 16px; padding: 0 4px; }
.ing-del:hover { color: #ef4444; }

/* ── Ficha calc preview no modal ── */
.fin-ficha-calc {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
  font-size: 13px;
}
.fin-ficha-calc h4 { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0 0 8px; }
.fin-calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.fin-calc-row:last-child { border-bottom: none; }
.fin-calc-row.total { font-weight: 700; font-size: 14px; }
.fin-calc-row.highlight { background: #FFFBEB; margin: 0 -14px; padding: 6px 14px; }

/* ── Config extra classes ── */
.fin-cfg-title {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.fin-cfg-label { flex: 1; }
.fin-cfg-label b { display: block; font-size: 13px; color: var(--ink); }
.fin-cfg-help { font-size: 11px; color: var(--muted); margin-top: 1px; }
.fin-cfg-ctrl {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.fin-cfg-ctrl input[type=number] {
  width: 80px;
  text-align: right;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface);
  color: var(--ink);
}
.fin-cfg-ctrl input[type=number]:focus { outline: none; border-color: var(--yellow); }
.fin-cfg-ctrl span { font-size: 11px; color: var(--muted); min-width: 16px; }
.fin-cfg-preview-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: 10px;
}
.fin-cfg-ex-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.fin-cfg-ex-grid > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
}
.fin-cfg-ex-grid > div span { color: var(--muted); }
.fin-cfg-ex-grid > div b { font-weight: 700; color: var(--ink); }

/* ── Precificação table ── */
.fin-table--prec { min-width: 900px; }
.fin-th-actual { background: #FFFBEB; }
.fin-th-ideal  { background: #F0FDF4; }
.fin-th-legend { }
.fin-th-actual-legend {
  text-align: center;
  background: #FFFBEB;
  font-size: 10px;
  color: #92400E;
  font-weight: 700;
  letter-spacing: .06em;
}
.fin-th-ideal-legend {
  text-align: center;
  background: #F0FDF4;
  font-size: 10px;
  color: #065F46;
  font-weight: 700;
  letter-spacing: .06em;
}
.fin-td-actual { background: #FFFBEB44; }
.fin-td-ideal  { background: #F0FDF444; }
.fin-row--critico td { background: #FEF2F2 !important; }
.fin-row--prejuizo td { background: #FEF2F2 !important; font-style: italic; }

/* ── Precificação KPI card variants ── */
.fin-kpi-card { position: relative; }
.fin-kpi-val   { font-size: 22px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.fin-kpi-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 2px; }
.fin-kpi-sub   { font-size: 11px; color: var(--muted); margin-top: 2px; }
.fin-kpi-card--warn { border-color: #FCD34D; background: #FFFBEB; }
.fin-kpi-card--ok   { border-color: #6EE7B7; background: #F0FDF4; }

/* ── DRE extra classes ── */
.dre-label { flex: 1; color: var(--ink-2); font-size: 13px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dre-valor { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink); flex-shrink: 0; }
.dre-pct   { font-size: 11px; color: var(--muted); min-width: 44px; text-align: right; }
.dre-input {
  width: 100px;
  text-align: right;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface);
  color: var(--ink);
}
.dre-input:focus { outline: none; border-color: var(--yellow); }
.dre-input--label {
  width: auto;
  flex: 1;
  text-align: left;
  font-weight: 500;
}
.dre-label--desp { gap: 6px; }
.dre-row--sub .dre-label { font-weight: 600; color: var(--ink); }
.dre-row--sub .dre-valor { font-weight: 700; }
.dre-row--result-pos .dre-label,
.dre-row--result-pos .dre-valor { color: #065F46; }
.dre-row--result-neg .dre-label,
.dre-row--result-neg .dre-valor { color: #991B1B; }
.dre-row--big .dre-valor b { font-size: 16px; }
.dre-row--desp { gap: 8px; }
.dre-pe-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: linear-gradient(135deg, #1F2937, #0F172A);
  color: #fff;
  border-radius: var(--r);
  padding: 16px 18px;
  margin: 10px 0 4px;
}
.dre-pe-label { font-size: 11px; opacity: .7; text-transform: uppercase; letter-spacing: .07em; }
.dre-pe-val   { font-size: 26px; font-weight: 800; }
.dre-pe-sub   { font-size: 12px; opacity: .7; }

/* ── Alertas DRE ── */
.fin-alertas { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.fin-alerta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--r);
  font-size: 13px;
  border: 1px solid transparent;
}
.fin-alerta--danger  { background: #FEF2F2; border-color: #FCA5A5; color: #991B1B; }
.fin-alerta--warn    { background: #FFFBEB; border-color: #FCD34D; color: #92400E; }
.fin-alerta--info    { background: #EFF6FF; border-color: #93C5FD; color: #1E40AF; }

/* ── Simulador extra classes ── */
.sim-controls-title, .sim-results-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.sim-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.sim-row:last-child { border-bottom: none; }
.sim-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.sim-ctrl {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sim-ctrl input[type=range] { flex: 1; accent-color: var(--yellow); }
.sim-val {
  width: 80px;
  text-align: right;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  background: var(--surface);
  color: var(--ink);
}
.sim-val:focus { outline: none; border-color: var(--yellow); }
.sim-suffix { font-size: 11px; color: var(--muted); min-width: 20px; }
.sim-result-big-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.sim-result-big-val   { font-size: 30px; font-weight: 800; line-height: 1.1; margin: 4px 0 2px; }
.sim-result-big-sub   { font-size: 12px; color: var(--muted); }
.sim-kpi-val { font-size: 15px; font-weight: 700; color: var(--ink); }
.sim-kpi-lbl { font-size: 11px; color: var(--muted); margin-top: 2px; }
.sim-kpi--warn { background: #FFFBEB; }

/* ── Simulador mini-DRE ── */
.sim-dre-mini {
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.sim-dre-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
}
.sim-dre-row:last-child { border-bottom: none; }
.sim-dre-row--result { background: var(--surface-2); font-weight: 700; color: var(--ink); }
.sim-dre-row--big    { font-size: 14px; }
.sim-dre-row--neg    { color: #DC2626; }

/* ── Missing ingredient + ficha calc row classes ── */
.ing-unit  { font-size: 11px; color: var(--muted); min-width: 24px; }
.ing-custo { font-size: 12px; font-weight: 600; color: var(--ink-2); min-width: 64px; text-align: right; }
.fin-calc-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  padding: 6px 0;
}
.form-field--calc { display: flex; flex-direction: column; justify-content: flex-end; }
.fin-calc-row--total { font-weight: 700; border-top: 1.5px solid var(--line); margin-top: 4px; padding-top: 4px; }
.fin-calc-row--rec .fin-calc-row span { color: var(--muted); }
.fin-calc-row--rec b { color: #065F46; }

/* ================================================================
   CANAIS DE VENDA — tabela de config + chips no DRE
================================================================ */
.fin-cfg-section--full {
  grid-column: 1 / -1;
}
.fin-canais-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.fin-canais-table th {
  text-align: left;
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1.5px solid var(--line);
  background: var(--surface-2);
}
.fin-canais-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.fin-canais-table tbody tr:hover { background: var(--surface-2); }
.fin-canais-total { background: var(--surface-2); }
.fin-canais-total td { font-size: 13px; border-top: 1.5px solid var(--line); }
.fin-canal-ico { font-size: 16px; margin-right: 4px; }
.fin-canal-input-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}
.fin-canal-input {
  width: 72px;
  text-align: right;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface);
  color: var(--ink);
}
.fin-canal-input:focus { outline: none; border-color: var(--yellow); }
.fin-canal-unit { font-size: 11px; color: var(--muted); }
.fin-canal-impact { white-space: nowrap; }
.fin-canal-ok   { color: #065F46; }
.fin-canal-warn { color: #DC2626; }

/* ── Chips de canal no DRE ── */
.dre-row--canal { flex-direction: column; align-items: flex-start; gap: 8px; padding: 10px 14px; }
.dre-row--canal .dre-valor { align-self: flex-end; margin-top: -24px; }
.dre-canal-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.dre-canal-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 20px;
  font-size: 11px;
  color: #1E40AF;
  white-space: nowrap;
}
.dre-canal-chip b { color: #1D4ED8; }
.dre-canal-cfg-btn {
  background: none;
  border: 1px dashed var(--line);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
}
.dre-canal-cfg-btn:hover { border-color: var(--yellow); color: var(--yellow); }

/* ================================================================
   LANÇAMENTOS GERENCIAIS
================================================================ */
.fin-lanc-import {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
}
.fin-lanc-import-title { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.fin-lanc-csv {
  width: 100%;
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 11px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  resize: vertical;
  box-sizing: border-box;
}
.fin-lanc-csv:focus { outline: none; border-color: var(--yellow); }

/* Summary cards */
.fin-lanc-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.fin-lanc-sumcard {
  flex: 1;
  min-width: 130px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
}
.fin-lanc-sumcard--green { border-color: #bbf7d0; background: #f0fdf4; }
.fin-lanc-sumcard--red   { border-color: #fecaca; background: #fef2f2; }
.fin-lanc-sumcard--warn  { border-color: #fde68a; background: #fffbeb; }
.fin-lanc-sumcard-label  { font-size: 11px; color: var(--muted); font-weight: 500; margin-bottom: 4px; }
.fin-lanc-sumcard-val    { font-size: 20px; font-weight: 700; color: var(--ink); }
.fin-lanc-sumcard-sub    { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Filter bar */
.fin-lanc-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

/* Table */
.fin-lanc-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.fin-lanc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.fin-lanc-table th {
  background: var(--surface-2);
  padding: 8px 10px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.fin-lanc-table th.ta-r { text-align: right; }
.fin-lanc-table th.ta-c { text-align: center; }
.fin-lanc-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.fin-lanc-table td.ta-c { text-align: center; }
.fin-lanc-table tbody tr:last-child td { border-bottom: none; }
.fin-lanc-table tbody tr:hover { background: var(--surface-2); }

.fin-lanc-row--warn { background: #fffbeb !important; }
.fin-lanc-row--ok   { opacity: 0.85; }

.fin-lanc-data  { white-space: nowrap; color: var(--muted); font-size: 12px; }
.fin-lanc-desc  { font-weight: 500; color: var(--ink); }
.fin-lanc-subcat { font-size: 11px; color: var(--muted); margin-top: 2px; }
.fin-lanc-valor { font-weight: 600; text-align: right; white-space: nowrap; }
.fin-lanc-pos   { color: #10b981; }
.fin-lanc-neg   { color: #dc2626; }

.fin-lanc-tipo-sel {
  font-size: 12px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  border-left-width: 3px;
  cursor: pointer;
  max-width: 200px;
}
.fin-lanc-tipo-sel:focus { outline: none; border-color: var(--yellow); }

/* DRE Gerencial 3 colunas */
.fin-gerencial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 8px;
}
.fin-gerencial-col {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
}
.fin-gerencial-col-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--ink);
}

/* Precificação breakdown */
.fin-prec-breakdown { display: flex; flex-direction: column; gap: 8px; }
.fin-prec-row { display: flex; align-items: center; gap: 8px; }
.fin-prec-lbl { font-size: 12px; color: var(--ink-2); min-width: 160px; }
.fin-prec-bar-wrap { flex: 1; height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.fin-prec-bar { height: 100%; border-radius: 4px; transition: width .3s; }
.fin-prec-pct { font-size: 12px; font-weight: 600; min-width: 46px; text-align: right; }
.fin-prec-row--total .fin-prec-lbl { font-weight: 700; }
.fin-prec-row--total .fin-prec-bar-wrap { height: 10px; }

/* ── Controle Financeiro ── */
.fc-topbar { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:18px; }
.fc-tabs { display:flex; gap:4px; background:var(--surface-2); border-radius:10px; padding:3px; }
.fc-tab { background:none; border:none; padding:6px 14px; border-radius:8px; font-size:13px; cursor:pointer; color:var(--ink-2); font-weight:500; }
.fc-tab--active { background:var(--surface); color:var(--ink); box-shadow:0 1px 4px rgba(0,0,0,.1); }
.fc-mes-nav { display:flex; align-items:center; gap:6px; }
.fc-mes-label { font-size:14px; font-weight:600; min-width:140px; text-align:center; }
.fc-kpi-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:12px; margin-bottom:20px; }
.fc-kpi { background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:14px 16px; }
.fc-kpi-label { font-size:11px; color:var(--muted); font-weight:500; margin-bottom:4px; text-transform:uppercase; letter-spacing:.04em; }
.fc-kpi-val { font-size:22px; font-weight:700; line-height:1.1; }
.fc-kpi-sub { font-size:11px; color:var(--muted); margin-top:2px; }
.fc-kpi--green { border-left:4px solid #10b981; }
.fc-kpi--red   { border-left:4px solid #dc2626; }
.fc-kpi--warn  { border-left:4px solid #f59e0b; }
.fc-kpi--blue  { border-left:4px solid #6366f1; }
.fc-dash-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:16px; }
.fc-dash-card { background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:16px; }
.fc-dash-card-title { font-size:12px; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; margin-bottom:12px; }
.fc-bar-row { display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.fc-bar-label { font-size:12px; color:var(--ink-2); min-width:130px; }
.fc-bar-wrap { flex:1; height:8px; background:var(--surface-2); border-radius:4px; overflow:hidden; }
.fc-bar-fill { height:100%; border-radius:4px; transition:width .3s; }
.fc-bar-val { font-size:12px; font-weight:600; min-width:80px; text-align:right; }
.fc-list { display:flex; flex-direction:column; gap:0; }
.fc-mov-row { display:flex; align-items:center; gap:10px; padding:10px 0; border-bottom:1px solid var(--line); }
.fc-mov-row:last-child { border-bottom:none; }
.fc-mov-ico { width:34px; height:34px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:16px; flex-shrink:0; }
.fc-mov-body { flex:1; min-width:0; }
.fc-mov-desc { font-size:13px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.fc-mov-meta { font-size:11px; color:var(--muted); }
.fc-mov-val { font-size:14px; font-weight:700; text-align:right; }
.fc-mov-val--pos { color:#10b981; }
.fc-mov-val--neg { color:#dc2626; }
.fc-status-chip { display:inline-block; font-size:10px; font-weight:600; padding:2px 7px; border-radius:10px; }
.fc-mov-actions { display:flex; gap:4px; opacity:0; transition:opacity .15s; }
.fc-mov-row:hover .fc-mov-actions { opacity:1; }
.fc-filter-bar { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-bottom:14px; }
.fc-group-header { font-size:11px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.06em; padding:12px 0 4px; }
/* Calendar */
.fc-cal { width:100%; }
.fc-cal-head { display:grid; grid-template-columns:repeat(7,1fr); text-align:center; font-size:11px; color:var(--muted); font-weight:600; margin-bottom:4px; }
.fc-cal-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:3px; }
.fc-cal-day { background:var(--surface); border:1px solid var(--line); border-radius:8px; min-height:72px; padding:6px; cursor:pointer; transition:background .15s; }
.fc-cal-day:hover { background:var(--surface-2); }
.fc-cal-day--today { border-color:var(--accent); }
.fc-cal-day--empty { background:none; border:none; cursor:default; }
.fc-cal-day-num { font-size:12px; font-weight:600; margin-bottom:4px; }
.fc-cal-day-num--today { color:var(--accent); }
.fc-cal-dot { font-size:11px; line-height:1.5; }
.fc-cal-dot--pos { color:#10b981; font-weight:600; }
.fc-cal-dot--neg { color:#dc2626; font-weight:600; }
/* Fluxo */
.fc-fluxo-table { width:100%; border-collapse:collapse; font-size:13px; }
.fc-fluxo-table th, .fc-fluxo-table td { padding:8px 12px; border-bottom:1px solid var(--line); text-align:right; }
.fc-fluxo-table th:first-child, .fc-fluxo-table td:first-child { text-align:left; }
.fc-fluxo-table thead th { background:var(--surface-2); font-weight:600; font-size:12px; }
.fc-fluxo-row--total td { font-weight:700; border-top:2px solid var(--line); }
.fc-fluxo-pos { color:#10b981; font-weight:600; }
.fc-fluxo-neg { color:#dc2626; font-weight:600; }
.fc-contas-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:10px; margin-top:16px; }
.fc-conta-card { background:var(--surface); border:1px solid var(--line); border-radius:10px; padding:12px 14px; }
.fc-conta-label { font-size:11px; color:var(--muted); margin-bottom:2px; }
.fc-conta-saldo { font-size:18px; font-weight:700; }

/* ================================================================
   SISTEMA FINANCEIRO UNIFICADO — Classes .fin-*
================================================================ */

/* ── Tabs e navegação ── */
.fin-ctrl-tabs { display:flex; gap:4px; background:var(--surface-2); border-radius:10px; padding:3px; margin-bottom:16px; }
.fin-ctrl-tab  { background:none; border:none; padding:7px 16px; border-radius:8px; font-size:13px; cursor:pointer; color:var(--ink-2); font-weight:500; transition:all .15s; }
.fin-ctrl-tab--active { background:var(--surface); color:var(--ink); box-shadow:0 1px 4px rgba(0,0,0,.12); font-weight:600; }
.fin-ctrl-topbar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.fin-ctrl-mes-nav { display:flex; align-items:center; gap:6px; }
.fin-ctrl-mes-label { font-size:14px; font-weight:600; min-width:130px; text-align:center; }
.fin-badge-warn { background:#fef3c7; color:#92400e; border-radius:10px; font-size:11px; font-weight:700; padding:2px 8px; }
.fin-empty-msg { padding:48px 24px; text-align:center; color:var(--muted); font-size:14px; line-height:1.7; }
.fin-empty-msg a { color:var(--accent); }

/* ── Alertas ── */
.fin-alertas-bar { display:flex; flex-direction:column; gap:6px; margin-bottom:14px; }
.fin-alerta-item { display:flex; align-items:center; gap:8px; padding:8px 12px; border-radius:8px; font-size:13px; }
.fin-alerta-item--warn   { background:#fef9c3; color:#713f12; border-left:3px solid #eab308; }
.fin-alerta-item--danger { background:#fee2e2; color:#7f1d1d; border-left:3px solid #dc2626; }
.fin-alerta-acao { margin-left:auto; background:none; border:1px solid currentColor; border-radius:6px; font-size:11px; font-weight:600; padding:2px 8px; cursor:pointer; opacity:.8; }
.fin-alerta-acao:hover { opacity:1; }

/* ── Dashboard KPIs ── */
.fin-dash-topbar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:16px; }
.fin-dash-mes-nav { display:flex; align-items:center; gap:6px; }
.fin-dash-mes-label { font-size:15px; font-weight:700; min-width:140px; text-align:center; }
.fin-kpi-row { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:12px; margin-bottom:14px; }
.fin-kpi-row--sm { grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); }
.fin-kpi-card { background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:14px 16px; }
.fin-kpi-card--green { border-left:4px solid #10b981; }
.fin-kpi-card--red   { border-left:4px solid #dc2626; }
.fin-kpi-card--warn  { border-left:4px solid #f59e0b; }
.fin-kpi-card--blue  { border-left:4px solid #6366f1; }
.fin-kpi-card--ok    { border-left:4px solid #10b981; }
.fin-kpi-label { font-size:11px; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; margin-bottom:4px; }
.fin-kpi-val   { font-size:22px; font-weight:700; line-height:1.1; }
.fin-kpi-sub   { font-size:11px; color:var(--muted); margin-top:3px; }
.fin-delta     { font-size:11px; font-weight:700; padding:2px 6px; border-radius:6px; margin-left:6px; }
.fin-delta--pos { background:#d1fae5; color:#065f46; }
.fin-delta--neg { background:#fee2e2; color:#7f1d1d; }

/* ── Dashboard panels ── */
.fin-dash-panels { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:16px; }
.fin-dash-panel { background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:16px; }
.fin-dash-panel-title { font-size:12px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; margin-bottom:12px; }
@media(max-width:640px) { .fin-dash-panels { grid-template-columns:1fr; } }

/* ── Barras de progresso ── */
.fin-bar-row   { display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.fin-bar-label { font-size:12px; color:var(--ink-2); min-width:120px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.fin-bar-track { flex:1; height:8px; background:var(--surface-2); border-radius:4px; overflow:hidden; }
.fin-bar-fill  { height:100%; border-radius:4px; transition:width .3s; }
.fin-bar-val   { font-size:12px; font-weight:600; min-width:80px; text-align:right; }

/* ── Vencimentos ── */
.fin-venc-row  { display:flex; align-items:center; gap:10px; padding:9px 0; border-bottom:1px solid var(--line); cursor:pointer; }
.fin-venc-row:last-child { border-bottom:none; }
.fin-venc-row:hover { opacity:.85; }
.fin-venc-body { flex:1; min-width:0; }
.fin-venc-desc { font-size:13px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.fin-venc-meta { font-size:11px; color:var(--muted); }

/* ── DRE mini ── */
.fin-dre-mini-row { display:flex; justify-content:space-between; align-items:center; padding:5px 0; border-bottom:1px solid var(--line); font-size:13px; }
.fin-dre-mini-row:last-child { border-bottom:none; }
.fin-dre-mini-row--result { font-weight:700; padding:8px 0; margin-top:4px; }
.fin-dre-mini-row--pos { color:#10b981; }
.fin-dre-mini-row--neg { color:#dc2626; }
.fin-dre-mini-pct { font-size:11px; opacity:.6; margin-left:4px; }

/* ── Controle Financeiro — lançamentos ── */
.fin-lanc-header  { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:14px; }
.fin-lanc-totals  { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:12px; }
.fin-lanc-total   { padding:8px 14px; border-radius:10px; font-size:13px; font-weight:600; background:var(--surface-2); }
.fin-lanc-total--green { background:#d1fae5; color:#065f46; }
.fin-lanc-total--red   { background:#fee2e2; color:#7f1d1d; }
.fin-lanc-total--warn  { background:#fef3c7; color:#92400e; }
.fin-lanc-total--alert { background:#fee2e2; color:#7f1d1d; border:1px solid #dc2626; }
.fin-lanc-filters { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-bottom:14px; }
.fin-lanc-grupo   { margin-bottom:16px; }
.fin-grupo-header { font-size:11px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.06em; padding:10px 0 4px; }
.fin-grupo-totais { font-size:12px; color:var(--muted); margin-left:auto; }

/* ── Linha de lançamento ── */
.fin-mov-row  { display:flex; align-items:flex-start; gap:10px; padding:10px 0; border-bottom:1px solid var(--line); }
.fin-mov-row:last-child { border-bottom:none; }
.fin-mov-row--review { background:#fef9c3; border-radius:8px; padding:10px 10px; margin:0 -10px; }
.fin-mov-ico  { width:36px; height:36px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:16px; flex-shrink:0; background:var(--surface-2); }
.fin-mov-body { flex:1; min-width:0; }
.fin-mov-desc { font-size:13px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.fin-mov-meta { font-size:11px; color:var(--muted); display:flex; gap:6px; flex-wrap:wrap; margin-top:2px; }
.fin-mov-right { display:flex; flex-direction:column; align-items:flex-end; gap:4px; flex-shrink:0; }
.fin-mov-val--pos { color:#10b981; font-size:14px; font-weight:700; }
.fin-mov-val--neg { color:#dc2626; font-size:14px; font-weight:700; }
.fin-mov-actions { display:flex; gap:4px; opacity:0; transition:opacity .15s; }
.fin-mov-row:hover .fin-mov-actions { opacity:1; }

/* ── Chips de situação e categoria ── */
.fin-sit-chip  { display:inline-block; font-size:10px; font-weight:600; padding:2px 8px; border-radius:10px; white-space:nowrap; }
.fin-cat-chip  { display:inline-block; font-size:11px; font-weight:500; padding:2px 8px; border-radius:8px; background:var(--surface-2); color:var(--ink-2); white-space:nowrap; }
.fin-cat-chip--sm   { font-size:10px; padding:1px 6px; }
.fin-cat-chip--warn { background:#fef3c7; color:#92400e; }
.fin-cat-chip--sub  { background:#EDE9FE; color:#5B21B6; font-size:10px; padding:1px 6px; }

/* ── Despesas Por Categoria ── */
.despcat-wrap { max-width: 680px; }
.despcat-title {
  font-size: 20px; font-weight: 700; color: var(--ink);
  letter-spacing: -0.03em; margin-bottom: 18px;
}
.despcat-total-bar {
  font-size: 13px; color: var(--ink-soft); margin-bottom: 20px;
  padding: 10px 14px;
  background: var(--surface-2); border-radius: var(--r);
  border: 1px solid var(--line);
}
.despcat-grupo {
  margin-bottom: 4px;
  background: var(--surface);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.despcat-header {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
}
.despcat-ico-circle {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.despcat-info { flex: 1; min-width: 0; }
.despcat-nome {
  font-size: 14px; font-weight: 700; color: #4F46E5;
  letter-spacing: -0.01em; line-height: 1.3;
}
.despcat-pct { font-size: 12px; color: var(--muted); margin-top: 2px; }
.despcat-total {
  font-size: 15px; font-weight: 700;
  color: #EF4444;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.despcat-subs {
  border-top: 1px solid var(--line);
  padding: 6px 18px 10px;
  display: flex; flex-direction: column; gap: 2px;
}
.despcat-sub {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.despcat-sub:last-child { border-bottom: none; }
.despcat-arrow {
  font-size: 14px; color: var(--muted-2); flex-shrink: 0;
  padding-left: 8px;
}
.despcat-dot {
  width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0;
}
.despcat-sub-label {
  flex: 1; font-size: 13px; font-weight: 600; color: #4F46E5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.despcat-sub-val {
  font-size: 13px; font-weight: 700; color: #EF4444;
  font-variant-numeric: tabular-nums; flex-shrink: 0;
}

/* ── Calendário ── */
.fin-cal-head { display:grid; grid-template-columns:repeat(7,1fr); text-align:center; font-size:11px; color:var(--muted); font-weight:600; margin-bottom:4px; }
.fin-cal-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:3px; }
.fin-cal-cell { background:var(--surface); border:1px solid var(--line); border-radius:8px; min-height:64px; padding:6px; cursor:pointer; transition:background .15s; }
.fin-cal-cell:hover { background:var(--surface-2); }
.fin-cal-cell--hoje  { border-color:var(--accent); }
.fin-cal-cell--vazio { background:none; border:none; cursor:default; }
.fin-cal-dia  { font-size:12px; font-weight:600; margin-bottom:3px; }
.fin-cal-dia--hoje { color:var(--accent); }
.fin-cal-dot--rec  { font-size:10px; color:#10b981; font-weight:700; }
.fin-cal-dot--desp { font-size:10px; color:#dc2626; font-weight:700; }

/* ── Painel genérico ── */
.fin-panel { background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:16px; margin-bottom:16px; }
.fin-panel-title { font-size:13px; font-weight:700; margin-bottom:12px; }

/* ── Fluxo de caixa ── */
.fin-fluxo-table { width:100%; border-collapse:collapse; font-size:13px; }
.fin-fluxo-table th, .fin-fluxo-table td { padding:8px 10px; border-bottom:1px solid var(--line); text-align:right; }
.fin-fluxo-table th:first-child, .fin-fluxo-table td:first-child { text-align:left; }
.fin-fluxo-table thead th { background:var(--surface-2); font-weight:600; font-size:11px; }
.fin-fluxo-label { text-align:left !important; font-weight:500; }
.fin-fluxo-real  { font-weight:600; }
.fin-fluxo-total { font-weight:700; border-top:2px solid var(--line) !important; }
.fin-fluxo-pos   { color:#10b981; font-weight:600; }
.fin-fluxo-neg   { color:#dc2626; font-weight:600; }
.fin-fluxo-zero  { color:var(--muted); }

/* ── Contas ── */
.fin-contas-grid  { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:10px; margin-top:12px; }
.fin-conta-card   { background:var(--surface); border:1px solid var(--line); border-radius:10px; padding:12px 14px; }
.fin-conta-label  { font-size:11px; color:var(--muted); margin-bottom:2px; }
.fin-conta-saldo  { font-size:18px; font-weight:700; }

/* ── Importar ── */
.fin-import-layout { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
@media(max-width:640px) { .fin-import-layout { grid-template-columns:1fr; } }
.fin-import-stats  { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:12px; }
.fin-import-stat   { background:var(--surface-2); border-radius:8px; padding:8px 12px; font-size:13px; font-weight:600; }
.fin-import-stat--warn { background:#fef3c7; color:#92400e; }
.fin-import-box   { background:var(--surface-2); border:1px solid var(--line); border-radius:10px; padding:14px; }
.fin-import-title { font-size:13px; font-weight:700; margin-bottom:8px; }

/* ── Sumcards (legado compat) ── */
.fin-lanc-sumcard { background:var(--surface-2); border-radius:12px; padding:14px 16px; min-width:140px; }
.fin-lanc-sumcard-label { font-size:11px; color:var(--muted); font-weight:600; text-transform:uppercase; margin-bottom:4px; }
.fin-lanc-sumcard-val   { font-size:20px; font-weight:700; }
.fin-lanc-sumcard-sub   { font-size:11px; color:var(--muted); margin-top:2px; }
.fin-lanc-sumcard--green { border-left:4px solid #10b981; }
.fin-lanc-sumcard--red   { border-left:4px solid #dc2626; }
.fin-lanc-sumcard--warn  { border-left:4px solid #f59e0b; }

/* ── Rows especiais ── */
.fin-lanc-row--warn { background:#fef9c3 !important; }
.fin-lanc-row--ok   { opacity:.8; }
.fin-row--critico   { border-left:3px solid #f59e0b; }
.fin-row--prejuizo  { border-left:3px solid #dc2626; }
.fin-table--prec .fin-th-actual { color:var(--ink); }
.fin-table--prec .fin-th-ideal  { color:#6366f1; }

/* ================================================================
   TELEGRAM OPERAÇÃO
   ================================================================ */

/* Topbar */
.tg-topbar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; margin-bottom:20px; }
.tg-topbar h2 { font-size:18px; font-weight:700; margin:0; }
.tg-conn { display:flex; align-items:center; gap:8px; font-size:13px; color:var(--muted); }
.tg-status-dot { width:10px; height:10px; border-radius:50%; background:#9ca3af; flex-shrink:0; transition:background 0.3s; }
.tg-status-dot.online  { background:#10b981; box-shadow:0 0 0 3px rgba(16,185,129,.2); }
.tg-status-dot.offline { background:#ef4444; }
.tg-status-label { font-size:12px; font-weight:600; }

/* Filters */
.tg-filters { display:flex; gap:10px; flex-wrap:wrap; align-items:flex-end; margin-bottom:20px; }
.tg-filters .input, .tg-filters select { font-size:13px; padding:7px 10px; }
.tg-filters label { font-size:11px; font-weight:600; color:var(--muted); display:block; margin-bottom:4px; text-transform:uppercase; letter-spacing:.05em; }

/* Summary stat boxes */
.tg-summary { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:20px; }
.tg-stat {
  background:var(--surface);
  border-radius:var(--r-lg);
  box-shadow:var(--shadow-sm);
  padding:14px 18px;
  min-width:130px;
  cursor:pointer;
  transition:box-shadow 0.18s, transform 0.18s;
  border:2px solid transparent;
}
.tg-stat:hover { box-shadow:var(--shadow-md); transform:translateY(-2px); }
.tg-stat.active { border-color:var(--yellow); }
.tg-stat-label { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); margin-bottom:4px; }
.tg-stat-val { font-size:24px; font-weight:700; color:var(--ink); }

/* Message list */
.tg-list { display:flex; flex-direction:column; gap:12px; }
.tg-loading { text-align:center; padding:40px; color:var(--muted); font-size:14px; }

/* Message card */
.tg-msg-card {
  background:var(--surface);
  border-radius:var(--r-lg);
  box-shadow:var(--shadow-sm);
  overflow:hidden;
  transition:box-shadow 0.18s;
}
.tg-msg-card:hover { box-shadow:var(--shadow-md); }

.tg-msg-head {
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  padding:12px 16px;
  border-bottom:1px solid var(--line);
  background:var(--surface-2);
}
.tg-msg-type {
  font-size:11px; font-weight:700; letter-spacing:.07em; text-transform:uppercase;
  background:var(--yellow-soft); color:var(--ink);
  padding:3px 9px; border-radius:var(--r-full);
}
.tg-msg-cmd { font-family:monospace; font-size:13px; font-weight:700; color:#4f46e5; }
.tg-msg-user { font-size:13px; font-weight:600; color:var(--ink); }
.tg-msg-ts { font-size:12px; color:var(--muted); margin-left:auto; }
.tg-msg-chips { display:flex; gap:6px; flex-wrap:wrap; align-items:center; }

/* Status badges */
.tg-badge {
  font-size:11px; font-weight:700; letter-spacing:.05em; text-transform:uppercase;
  padding:3px 9px; border-radius:var(--r-full);
}
.tg-badge--pendente   { background:#fef3c7; color:#92400e; }
.tg-badge--revisar    { background:#ede9fe; color:#5b21b6; }
.tg-badge--processado { background:#d1fae5; color:#065f46; }
.tg-badge--erro       { background:#fee2e2; color:#991b1b; }

/* Confidence chips */
.tg-badge--alta   { background:#d1fae5; color:#065f46; }
.tg-badge--media  { background:#fef3c7; color:#92400e; }
.tg-badge--baixa  { background:#f3f4f6; color:#374151; }

/* Applied / NL indicator */
.tg-msg-card--applied { opacity: .75; }
.tg-msg-card--applied .tg-msg-actions { opacity: .5; pointer-events: none; }

/* Message body */
.tg-msg-body { padding:12px 16px; }
.tg-msg-raw {
  font-size:13px; color:var(--muted); font-style:italic;
  background:var(--surface-2); border-radius:var(--r);
  padding:8px 12px; margin-bottom:10px;
  border-left:3px solid var(--line-strong);
}

/* Parsed preview */
.tg-parsed { display:flex; flex-wrap:wrap; gap:8px 16px; margin-bottom:12px; }
.tg-parsed-row { display:flex; align-items:center; gap:6px; font-size:13px; }
.tg-parsed-key { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); }
.tg-parsed-val { font-weight:600; color:var(--ink); }

/* Action buttons */
.tg-msg-actions { display:flex; gap:8px; flex-wrap:wrap; padding:10px 16px; border-top:1px solid var(--line); background:var(--surface-2); }

/* Rules modal table */
.tg-rules-table { width:100%; border-collapse:collapse; font-size:13px; }
.tg-rules-table th { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); padding:8px 10px; border-bottom:2px solid var(--line); text-align:left; }
.tg-rules-table td { padding:8px 10px; border-bottom:1px solid var(--line); }
.tg-rules-table tr:last-child td { border-bottom:none; }

/* ================================================================
   LEDGER DIÁRIO — Estoque por movimentação diária
   ================================================================ */

/* Navigation */
.ld-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; margin-bottom: 16px; border-bottom: 1px solid var(--line);
  gap: 12px;
}
.ld-nav-center {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.ld-date-label { font-size: 18px; font-weight: 700; }

/* Filters */
.ld-filters {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.ld-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.ld-pill {
  padding: 5px 12px; border-radius: var(--r-full);
  border: 1px solid var(--line); background: var(--surface);
  font-size: 12px; font-weight: 600; cursor: pointer; transition: all .15s;
}
.ld-pill:hover { border-color: var(--yellow); }
.ld-pill.active { background: var(--yellow); border-color: var(--yellow); color: #000; }

/* Table */
.ld-table-wrap { overflow-x: auto; }
.ld-table { min-width: 900px; }
.ld-table th { font-size: 11px; white-space: nowrap; }
.ld-table td { vertical-align: top; padding: 10px 12px; }
.ld-row:hover { background: var(--surface-2); }

/* Item name */
.ld-td-name { min-width: 140px; }
.ld-item-name { font-weight: 700; font-size: 14px; line-height: 1.3; }
.ld-item-cat  { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Values */
.ld-val       { font-weight: 600; font-size: 14px; white-space: nowrap; }
.ld-teorico   { color: #1e40af; font-weight: 700; }
.ld-teorico-warn { color: #b45309; }

/* Movement cell */
.ld-cell { display: flex; flex-direction: column; gap: 5px; min-width: 130px; }
.ld-total { font-weight: 700; font-size: 14px; white-space: nowrap; }
.ld-ent   { color: #15803d; }
.ld-sai   { color: #dc2626; }

.ld-mov {
  display: flex; align-items: flex-start; gap: 6px; flex-wrap: wrap;
  background: var(--surface-2); border-radius: var(--r);
  padding: 4px 8px; font-size: 11px;
}
.ld-mov-qty     { font-weight: 700; white-space: nowrap; flex-shrink: 0; }
.ld-sai-qty     { color: #dc2626; }
.ld-mov-who     { color: var(--muted); font-size: 10px; flex: 1; min-width: 0; }
.btn-micro {
  font-size: 10px; background: none; border: none; cursor: pointer;
  color: var(--muted); padding: 0 2px; line-height: 1; flex-shrink: 0;
}
.btn-micro:hover { color: #dc2626; }
.ld-add-btn { font-size: 11px; align-self: flex-start; }

/* Physical count */
.ld-td-contagem { min-width: 110px; }
.ld-contagem-wrap { display: flex; flex-direction: column; gap: 4px; }
.ld-contagem-input {
  width: 90px; padding: 5px 8px; font-weight: 700; font-size: 14px;
  border: 2px solid var(--line); border-radius: var(--r); text-align: right;
}
.ld-contagem-input:focus { border-color: var(--yellow); outline: none; }
.ld-por { font-size: 10px; color: var(--muted); line-height: 1.3; }

/* Conferência */
.ld-conf {
  font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: var(--r-full); white-space: nowrap; display: inline-block;
}
.ld-confere  { background: #d1fae5; color: #065f46; }
.ld-diverge  { background: #fee2e2; color: #991b1b; }
.ld-conf-empty { color: var(--muted); font-size: 13px; }

/* Editor */
.ld-td-editor { min-width: 100px; }
.ld-editor    { font-size: 12px; font-weight: 600; }
.ld-editor-ts { font-size: 10px; color: var(--muted); }

/* Footer summary */
.ld-footer {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 16px; background: var(--surface-2);
  border-radius: var(--r-lg); font-size: 13px; margin-top: 12px;
  border: 1px solid var(--line);
}
.ld-footer-ok      { color: #065f46; font-weight: 700; }
.ld-footer-warn    { color: #991b1b; font-weight: 700; }
.ld-footer-perfect { color: #1e40af; font-weight: 700; }
