body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background-color: var(--fundo); color: var(--texto); }

.container { max-width: 900px; margin: 0 auto; padding: 20px 16px; width: 100%; }

/* HEADER DO MÓDULO */
.header-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--borda);
    border-left: 5px solid var(--azul-caixa);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.header-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 600px) {
    .header-grid { grid-template-columns: 1fr; }
}

.input-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--azul-caixa);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    display: block;
}

.input-field {
    width: 100%;
    height: 42px;
    border: 1.5px solid var(--borda);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--texto);
    outline: none;
    background-color: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}
select.input-field {
    padding-right: 36px;
}

.input-field:focus {
    border-color: var(--laranja-caixa);
    box-shadow: 0 0 0 3px rgba(240, 130, 0, 0.1);
}

/* WIZARD EM ETAPAS */
.wizard-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--borda);
}

.wizard-steps-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    position: relative;
}

.wizard-steps-indicator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--borda-sutil);
    z-index: 1;
    transform: translateY(-50%);
}

.step-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--borda-forte);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    color: #64748b;
    z-index: 2;
    transition: all 0.3s;
}

.step-dot.active {
    border-color: var(--azul-caixa);
    background: var(--azul-caixa);
    color: white;
    box-shadow: 0 0 0 4px rgba(var(--primaria-rgb), 0.15);
}

.step-dot.completed {
    border-color: var(--sucesso);
    background: var(--sucesso);
    color: white;
}

.step-content { display: none; }
.step-content.active { display: block; animation: fadeIn 0.3s ease; }

.instruction-banner {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-left: 4px solid var(--azul-caixa);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 18px;
    font-size: 0.88rem;
    color: #1e3a8a;
    line-height: 1.4;
}

.instruction-banner i { margin-right: 6px; color: var(--azul-caixa); }

.live-calc-box {
    background: var(--fundo-sutil);
    border: 1.5px dashed var(--borda-forte);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.live-calc-title { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; color: #475569; }
.live-calc-value { font-size: 1.2rem; font-weight: 900; color: var(--azul-caixa); }

.wizard-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 25px;
    gap: 10px;
}

.wizard-actions button {
    flex: 1 1 140px;
    min-height: 44px;
    padding: 11px 16px;
    font-size: 0.94rem;
    white-space: nowrap;
}

/* HISTÓRICO RECENTE */
.history-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--borda);
}

.table-responsive { overflow-x: auto; margin-top: 15px; }

.custom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.custom-table th {
    background: var(--azul-caixa);
    color: white;
    font-weight: 800;
    padding: 10px 12px;
    text-transform: uppercase;
    font-size: 0.75rem;
    text-align: left;
}

.custom-table td {
    padding: 12px;
    border-bottom: 1px solid var(--borda-sutil);
    color: var(--texto);
    font-weight: 600;
}

.row-hover:hover { background-color: var(--fundo-sutil); cursor: pointer; }

.badge-tag {
    background: #e0f2fe;
    color: #0369a1;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
}

/* CONTROL DE ABAS (HERDADO DO GLOBAL.CSS) */
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeIn 0.3s ease; }

/* KPI CARDS CONSOLIDADOR */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .kpi-grid { grid-template-columns: repeat(3, 1fr); }
}

.kpi-card {
    background: white;
    border: 1px solid var(--borda);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.kpi-title {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.3px;
}

.kpi-value {
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--azul-caixa);
}

.table-responsive {
    overflow-x: auto;
    margin-top: 15px;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
    border: 1px solid var(--borda-sutil);
}

.custom-table th, .custom-table td {
    white-space: nowrap;
}

/* ===== NOVO DESIGN MODERNO DA AUDITORIA DE REPASSES ===== */
.aud-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    padding-bottom: 16px;
    border-bottom: 1.5px solid var(--fundo-hover);
    margin-bottom: 18px;
}

.aud-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.aud-icon-badge {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: #eff6ff;
    color: var(--azul-caixa);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.aud-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.aud-subtitle {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 2px;
}

.aud-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.aud-select-loja {
    min-height: 38px;
    height: auto;
    padding: 6px 34px 6px 10px;
    font-size: 0.85rem;
    font-weight: 700;
    border: 1.5px solid var(--borda-sutil);
    border-radius: var(--radius-sm);
    background-color: white;
    color: #1e293b;
    outline: none;
    cursor: pointer;
}

.aud-month-nav {
    display: inline-flex;
    align-items: center;
    background: white;
    border: 1.5px solid var(--borda-sutil);
    border-radius: var(--radius-sm);
    padding: 2px;
    min-height: 38px;
    box-sizing: border-box;
}

.aud-month-btn {
    border: none;
    background: transparent;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}

.aud-month-btn:hover {
    background: var(--fundo-hover);
    color: var(--azul-caixa);
}

.aud-month-text {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--azul-caixa);
    padding: 0 10px;
    min-width: 120px;
    text-align: center;
    text-transform: capitalize;
    user-select: none;
}

.btn-aud-refresh {
    height: 36px;
    padding: 0 14px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--azul-caixa);
    color: white;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(var(--primaria-rgb), 0.2);
    white-space: nowrap;
}

.btn-aud-refresh:hover {
    background: #004b8a;
    transform: translateY(-1px);
}

/* CARDS KPI 4 COLUNAS EQUILIBRADOS */
.aud-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

@media (max-width: 860px) {
    .aud-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .aud-kpi-grid { grid-template-columns: 1fr; }
}

.aud-kpi-card {
    background: white;
    border: 1px solid var(--borda-sutil);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.aud-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}

.aud-kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.aud-kpi-card.blue::before { background: var(--azul-caixa); }
.aud-kpi-card.green::before { background: #10b981; }
.aud-kpi-card.amber::before { background: #f59e0b; }
.aud-kpi-card.purple::before { background: #8b5cf6; }
.aud-kpi-card.red::before { background: #ef4444; }

.aud-kpi-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.aud-kpi-label {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #64748b;
}

.aud-kpi-icon {
    font-size: 0.85rem;
    opacity: 0.6;
}

.aud-kpi-value {
    font-size: 1.25rem;
    font-weight: 900;
    line-height: 1.2;
    color: #0f172a;
}

.aud-kpi-subtext {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* FILTROS SEGMENTADOS */
.aud-filters-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.aud-filter-chip {
    border: 1px solid var(--borda-sutil);
    background: white;
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-sizing: border-box;
}

.aud-filter-chip:hover {
    background: var(--fundo-sutil);
    border-color: #cbd5e1;
    color: #334155;
}

.aud-filter-chip.active {
    background: var(--azul-caixa) !important;
    color: white !important;
    border-color: var(--azul-caixa) !important;
    box-shadow: 0 2px 4px rgba(var(--primaria-rgb), 0.25);
}

/* TABELA MODERNA */
.aud-table-wrapper {
    background: white;
    border: 1px solid var(--borda-sutil);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    scrollbar-width: thin;
}

.aud-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    text-align: left;
}

.aud-table th {
    background: var(--fundo-sutil);
    color: #475569;
    font-size: 0.67rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 8px 6px;
    border-bottom: 1.5px solid var(--borda-sutil);
    white-space: nowrap;
}

.aud-table td {
    padding: 7px 6px;
    border-bottom: 1px solid var(--fundo-hover);
    color: #1e293b;
    font-weight: 600;
    white-space: nowrap;
    vertical-align: middle;
}

.aud-table tr:last-child td {
    border-bottom: none;
}

.aud-table tr:hover {
    background: var(--fundo-sutil);
}

.cell-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.badge-terminal-clean {
    background: var(--fundo-hover);
    color: #475569;
    font-size: 0.70rem;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 4px;
    border: 1px solid var(--borda-sutil);
}

.btn-view-receipt {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.70rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transition: all 0.15s;
}

.btn-view-receipt:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}

@media (pointer: coarse) {
    .btn-view-receipt {
        min-height: 32px;
        padding: 4px 10px;
    }
}

.badge-status-conferido {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #86efac;
    font-size: 0.70rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.badge-status-divergente {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    font-size: 0.70rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.badge-status-ressalva {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
    font-size: 0.70rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.badge-status-pendente {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
    font-size: 0.70rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
