/* ═══════════════════════════════════════════════════════════════
   layout-premium.css — Sidebar claro, layout premium CDC
   ═══════════════════════════════════════════════════════════════ */

:root {
  --sidebar-bg: #f8fafc;
  --sidebar-border: rgba(0,0,0,.06);
  --sidebar-text: #334155;
  --sidebar-text-muted: #64748b;
  --sidebar-hover: rgba(0,0,0,.04);
  --sidebar-active: rgba(245,158,11,.12);
}

/* Sidebar claro */
#sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  box-shadow: 2px 0 12px rgba(0,0,0,.04);
}

.sb-logo { border-bottom-color: var(--sidebar-border); }
.sb-logo-text .brand { color: var(--sidebar-text); }
.sb-logo-text .sub { color: var(--sidebar-text-muted); }

.sb-clock { border-bottom-color: var(--sidebar-border); }
#sb-time { color: var(--orange); }
#sb-date { color: var(--sidebar-text-muted); }

.sb-section { color: var(--sidebar-text-muted); }

.sb-item {
  color: var(--sidebar-text);
  position: relative;
}
.sb-item:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text);
}
.sb-item.active {
  background: var(--sidebar-active);
  color: var(--orange2);
  border-color: rgba(245,158,11,.25);
}
.sb-item.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 18%;
  height: 64%;
  width: 3px;
  background: linear-gradient(180deg, #f59e0b, #d97706);
  border-radius: 0 3px 3px 0;
}

.sb-footer { border-top-color: var(--sidebar-border); }
.sb-user {
  background: rgba(0,0,0,.03);
  border: 1px solid var(--sidebar-border);
}
.sb-user:hover { background: rgba(0,0,0,.05); }
.sb-user-name { color: var(--sidebar-text); }
.sb-user-role { color: var(--sidebar-text-muted); }

/* Grupos de preço (admin) — um bloco por nome de grupo */
.grupo-preco-acc {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.65);
}
.grupo-preco-acc > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  user-select: none;
}
.grupo-preco-acc > summary::-webkit-details-marker {
  display: none;
}
.grupo-preco-acc > summary::before {
  content: '▸';
  display: inline-block;
  transition: transform 0.2s ease;
  color: var(--sidebar-text-muted, #64748b);
  font-size: 12px;
}
.grupo-preco-acc[open] > summary::before {
  transform: rotate(90deg);
}
.grupo-preco-acc .grupo-preco-inner {
  padding: 0 8px 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.grupo-preco-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 8px 0 0;
  gap: 6px;
}
.grupo-preco-toolbar .btn-sm {
  padding: 5px 10px;
  font-size: 11px;
  min-height: 30px;
}

/* ═══ Fechamento de caixa (Repasse) — padrão premium ═══ */
.tag-pgto-pendente {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
}

.btn-fechamento-caixa {
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-fechamento-caixa:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.28);
}

.icon-premium-sm {
  width: 14px;
  height: 14px;
  vertical-align: text-bottom;
  margin-right: 5px;
}
.icon-premium-md {
  width: 18px;
  height: 18px;
  vertical-align: text-bottom;
  margin-right: 6px;
  color: var(--orange);
}

#modal-fechamento-caixa .modal.modal-fechamento {
  max-width: min(1120px, 96vw);
  border-radius: var(--r-lg, 20px);
  box-shadow:
    0 25px 50px -12px rgba(15, 23, 42, 0.2),
    0 0 0 1px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}
#modal-fechamento-caixa .modal-header {
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.99));
  border-bottom: 1px solid var(--border);
  padding: 18px 22px;
}
#modal-fechamento-caixa .modal-title {
  font-family: 'Sora', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--navy);
}
.fc-modal-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.5;
  max-width: 52rem;
}
#modal-fechamento-caixa .modal-body {
  padding: 18px 22px 22px;
}
.fc-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  margin-bottom: 14px;
  padding: 14px 16px;
  background: var(--surface2);
  border-radius: 12px;
  border: 1px solid var(--border);
}
.fc-toolbar .form-group {
  margin: 0;
}
.fc-date-input {
  width: 152px;
}
.fc-radios {
  display: flex;
  gap: 8px 18px;
  align-items: center;
  flex-wrap: wrap;
}
.fc-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 10px;
  transition: background 0.15s ease;
}
.fc-radio-label:hover {
  background: rgba(0, 0, 0, 0.04);
}
.fc-radio-label input {
  accent-color: var(--orange);
}
.fc-warn-compact {
  font-size: 11px;
  margin-bottom: 14px;
  line-height: 1.45;
}
.modal-fechamento-body {
  max-height: min(72vh, 640px);
  overflow: auto;
  padding-right: 6px;
  scrollbar-gutter: stable;
}
.fc-placeholder {
  font-size: 12px;
  color: var(--muted);
  padding: 14px 6px;
  line-height: 1.5;
}
.fc-placeholder-sub {
  padding: 6px 6px 0;
  font-size: 11px;
}
.fc-resumo-top {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 12px;
  font-family: 'Sora', sans-serif;
  letter-spacing: -0.02em;
}
.fc-resumo-top .fc-resumo-meta {
  font-weight: 500;
  color: var(--muted);
  font-size: 11px;
  font-family: 'DM Sans', sans-serif;
  letter-spacing: 0;
}
.fc-table-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}
.fc-fechamento-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.fc-fechamento-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 11px 12px;
  text-align: left;
  border: none;
  white-space: nowrap;
}
.fc-fechamento-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.fc-fechamento-table tbody tr:nth-child(even) td {
  background: rgba(248, 250, 252, 0.65);
}
.fc-fechamento-table tbody tr.fc-row--pendente td {
  background: rgba(239, 68, 68, 0.06);
  box-shadow: inset 3px 0 0 var(--red);
}
.fc-fechamento-table tfoot td {
  background: linear-gradient(180deg, var(--surface2), #e2e8f0);
  font-weight: 800;
  font-size: 12px;
  padding: 12px;
  border-top: 2px solid var(--navy);
  border-bottom: none;
}
.fc-fechamento-table tfoot td:first-child {
  text-align: right;
}
.fc-cell-ref {
  font-size: 10px;
  color: var(--muted);
  max-width: 200px;
  line-height: 1.4;
}
.fc-cell-nome {
  font-weight: 600;
  font-size: 12px;
}
.fc-cell-doc {
  font-size: 9px;
  color: var(--muted);
  margin-top: 2px;
}
.fc-cell-gss {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 12px;
}
.fc-cell-cert {
  font-size: 11px;
  max-width: 180px;
  line-height: 1.35;
}
.fc-cell-parc {
  font-size: 11px;
}
.fc-badge-ok {
  font-size: 9px;
}
.fc-money {
  white-space: nowrap;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.fc-money--venda {
  color: var(--green);
}
.fc-money--custo {
  color: var(--red);
}
.fc-money--parc {
  color: var(--orange2);
}
.fc-money--colab {
  color: var(--yellow);
}
.fc-money--na {
  color: var(--muted);
  font-weight: 500;
}
.grupo-preco-acc .grupo-preco-inner .table-wrap {
  margin-top: 8px;
}
.grupo-preco-sum-spacer {
  flex: 1;
  min-width: 8px;
}
.grupo-preco-sum-title {
  flex: 1;
  min-width: 0;
  word-break: break-word;
  text-align: left;
}

/* ═══ Repasse — filtros, relatório na tela, PDFs (padrão premium) ═══ */
/* Botões compactos só na área principal (não nos overlays/modais de fechamento) */
#page-repasse .section-head .btn.btn-sm,
#page-repasse .rep-filtros-card .btn.btn-sm,
#page-repasse .rep-pdf-bar .btn.btn-sm {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  gap: 4px;
  line-height: 1.25;
  min-height: 0;
}
#page-repasse .section-head .btn.btn-sm .icon-premium-sm,
#page-repasse .rep-filtros-card .btn.btn-sm .icon-premium-sm,
#page-repasse .rep-pdf-bar .btn.btn-sm .icon-premium-sm {
  width: 12px;
  height: 12px;
  margin-right: 4px;
}

#page-repasse .section-title .icon-premium-title-rep {
  width: 20px;
  height: 20px;
  vertical-align: text-bottom;
  margin-right: 6px;
  color: var(--orange);
}

.rep-filtros-card {
  margin-bottom: 14px;
  border-radius: var(--r, 16px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow, 0 4px 12px rgba(0, 0, 0, 0.04));
  overflow: hidden;
}
.rep-filtros-card .card-body {
  padding: 18px 20px;
}
.rep-form-grid {
  margin-bottom: 14px;
}
.rep-periodo-wrap {
  margin-bottom: 12px;
}
.rep-periodo-wrap > .form-label {
  margin-bottom: 8px;
}
.rep-chips-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.rep-chip-icon {
  width: 12px;
  height: 12px;
  vertical-align: text-bottom;
  margin-right: 3px;
}

#page-repasse .rep-chip {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.95);
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
#page-repasse .rep-chip-icon {
  width: 10px;
  height: 10px;
  margin-right: 2px;
}
#page-repasse .rep-chip:hover:not(.active) {
  border-color: rgba(245, 158, 11, 0.45);
  color: var(--orange2);
  background: rgba(245, 158, 11, 0.07);
}
#page-repasse .rep-chip.active {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.22);
}

.rep-datas-toolbar {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
  padding-top: 2px;
}
.rep-datas-toolbar .form-group {
  margin: 0;
}
.rep-date-input {
  width: 148px;
}
.rep-btn-gerar {
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.rep-btn-gerar:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.28);
}

.rep-pdf-bar {
  display: none;
  margin-bottom: 14px;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: var(--surface2);
  border-radius: 10px;
  border: 1px solid var(--border);
  align-items: center;
}
.rep-pdf-bar.rep-pdf-bar--visible {
  display: flex;
}
.rep-btn-pdf-pri {
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}
.rep-btn-pdf-sec {
  box-shadow: 0 1px 5px rgba(15, 23, 42, 0.08);
}

.rep-extrato-card {
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.07);
}
.rep-extrato-card .card-header {
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.99));
  border-bottom: 1px solid var(--border);
  padding: 16px 18px;
}
.rep-extrato-card .card-title {
  font-family: 'Sora', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--navy);
}
.rep-extrato-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.rep-extrato-table thead th {
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 11px 10px;
  text-align: left;
}
.rep-extrato-table tbody td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.rep-extrato-table tbody tr:nth-child(even) td {
  background: rgba(248, 250, 252, 0.55);
}
.rep-th-nowrap {
  white-space: nowrap;
}
.rep-cell-gss {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 12px;
}
.rep-cell-nome {
  font-weight: 600;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rep-cell-doc {
  font-size: 9px;
  color: var(--muted);
}
.rep-cell-prod {
  font-size: 11px;
  white-space: nowrap;
}
.rep-cell-parc-nome {
  font-size: 12px;
}
.rep-badge-tiny {
  font-size: 9px;
}
.rep-money-venda {
  font-weight: 700;
  color: var(--green);
  white-space: nowrap;
}
.rep-money-parc {
  color: var(--orange2);
  white-space: nowrap;
}
.rep-money-colab {
  color: var(--yellow);
  white-space: nowrap;
}

.rep-totais-box {
  margin-top: 16px;
  padding: 16px 18px;
  background: linear-gradient(180deg, var(--surface2), rgba(241, 245, 249, 0.92));
  border-radius: 12px;
  border: 1px solid var(--border);
}
.rep-totais-titulo {
  font-size: 11px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.rep-totais-titulo .icon-premium-sm {
  margin-right: 0;
}
.rep-totais-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 900px) {
  .rep-totais-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.rep-total-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 10px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.15s ease;
}
.rep-total-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.rep-total-val {
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 15px;
}
.rep-total-lbl {
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.35;
}
.rep-total-lbl .icon-premium-sm {
  margin-right: 4px;
  vertical-align: text-bottom;
}
.rep-empty-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}

/* ═══ Botões compactos — evita largura “barra” em flex / mobile ═══ */
.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
}
.section-head > .toolbar-actions {
  margin-left: auto;
}
@media (max-width: 768px) {
  body:not(.modo-app):not(.plataforma-android) .section-head > .toolbar-actions {
    margin-left: 0;
  }
}
.prov-toolbar .prov-toolbar-lbl {
  margin: 0;
  font-size: 11px;
}
.rep-datas-toolbar .btn.rep-btn-gerar {
  flex: 0 0 auto;
  width: auto;
  max-width: 100%;
  align-self: flex-end;
}
.ag-tabs-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.ag-tabs-row .btn.ag-tab {
  flex: 0 0 auto;
  width: auto;
  max-width: 100%;
}
.ag-filtros-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}
.ag-filtros-toolbar .btn {
  flex: 0 0 auto;
  align-self: flex-end;
}
.btn.btn-icon-premium {
  width: 36px;
  height: 36px;
  min-height: 0;
  max-height: none;
  padding: 0;
  max-width: none;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}
.btn.btn-icon-premium.btn-sm {
  width: 34px;
  height: 34px;
  padding: 0;
  min-height: 0;
}
.btn.btn-icon-premium i[data-lucide] {
  width: 18px !important;
  height: 18px !important;
  flex-shrink: 0;
}
.prov-btn-rateio.btn-icon-premium {
  border-color: rgba(148, 163, 184, 0.55);
  color: var(--muted);
  background: linear-gradient(180deg, #fff, #f8fafc);
}
.prov-btn-rateio.btn-icon-premium:hover {
  border-color: rgba(245, 158, 11, 0.45);
  color: var(--orange2);
  background: rgba(245, 158, 11, 0.06);
}
.prov-card--pausa .prov-btn-rateio.btn-icon-premium {
  border-color: rgba(245, 158, 11, 0.35);
  color: var(--orange2);
  background: rgba(245, 158, 11, 0.08);
}
#page-cdc-painel-superbot .card-body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
#page-cdc-painel-superbot .card-body > .btn {
  flex: 0 0 auto;
  width: auto;
  max-width: 100%;
  align-self: flex-start;
}
