/* ==========================================================================
   IglesiaLive — Design tokens & base styles
   ========================================================================== */

:root {
    --ig-primary: #14294A;
    --ig-primary-dark: #0B1A30;
    --ig-primary-light: #2E4F80;
    --ig-secondary: #8A6420;
    --ig-accent: #D9A24A;
    --ig-success: #2E7D32;
    --ig-warning: #ED6C02;
    --ig-error: #C62828;
    --ig-info: #0277BD;
    --ig-bg: #F4F6FA;
    --ig-surface: #FFFFFF;
    --ig-border: #DDE3EC;
    --ig-text: #1F2430;
    --ig-text-muted: #6B7280;
    --ig-radius: 12px;
    --ig-radius-sm: 8px;
    --ig-shadow-sm: 0 1px 2px rgba(31, 36, 48, 0.06), 0 1px 3px rgba(31, 36, 48, 0.08);
    --ig-shadow-md: 0 4px 12px rgba(31, 36, 48, 0.08), 0 2px 4px rgba(31, 36, 48, 0.06);
}

html, body {
    height: 100%;
    margin: 0;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--ig-bg);
    color: var(--ig-text);
}

#app {
    height: 100%;
}

.mud-appbar {
    background: linear-gradient(135deg, var(--ig-primary) 0%, var(--ig-primary-dark) 100%) !important;
    border-bottom: 2px solid var(--ig-accent);
}

.mud-main-content {
    background: var(--ig-bg);
}

/* ==========================================================================
   Splash / loading
   ========================================================================== */

.splash-loading {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--ig-primary) 0%, var(--ig-primary-dark) 100%);
    color: white;
}

.splash-loading-content { text-align: center; }

.splash-spinner {
    width: 48px; height: 48px;
    border: 5px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.offline-banner {
    background: #FB8C00;
    color: white;
    text-align: center;
    padding: 4px 8px;
    font-size: 0.85rem;
    font-weight: 500;
}

.sync-pending-badge {
    font-size: 0.7rem;
}

/* ==========================================================================
   Brand mark (used in the app bar, nav and printed report letterhead)
   ========================================================================== */

.ig-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: var(--ig-radius-sm);
    overflow: hidden;
    box-shadow: var(--ig-shadow-sm);
}

/* ==========================================================================
   Cards / surfaces
   ========================================================================== */

.ig-card {
    background: var(--ig-surface);
    border: 1px solid var(--ig-border);
    border-radius: var(--ig-radius);
    box-shadow: var(--ig-shadow-sm);
}

.mud-paper {
    border-radius: var(--ig-radius) !important;
}

.mud-table-container {
    border-radius: var(--ig-radius);
}

.mud-table.report-table .mud-table-head {
    background: #F7F5FC;
}

.mud-table.report-table .mud-table-head .mud-table-cell {
    font-weight: 700;
    color: var(--ig-primary-dark);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
}

.mud-table.report-table .mud-table-row:nth-of-type(odd) {
    background-color: rgba(20, 41, 74, 0.025);
}

.mud-table.report-table .mud-table-row:hover {
    background-color: rgba(20, 41, 74, 0.06) !important;
}

/* ==========================================================================
   Toolbars (filters above tables / reports)
   ========================================================================== */

.ig-toolbar {
    background: var(--ig-surface);
    border: 1px solid var(--ig-border);
    border-radius: var(--ig-radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: var(--ig-shadow-sm);
}

/* ==========================================================================
   Report totals / summary bars (shared by the accounting reports)
   ========================================================================== */

.report-totals-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: flex-end;
    background: #F7F5FC;
    border: 1px solid var(--ig-border);
    border-radius: var(--ig-radius-sm);
    padding: 12px 18px;
    margin-top: 14px;
}

.report-totals-bar-item {
    text-align: right;
}

.report-totals-bar-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ig-text-muted);
}

.report-totals-bar-value {
    font-weight: 700;
    font-size: 1.05rem;
}

.report-result-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 18px 20px;
    border-radius: var(--ig-radius-sm);
    background: rgba(20, 41, 74, 0.05);
    margin-top: 8px;
}

.report-account-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 4px;
    border-bottom: 1px dashed var(--ig-border);
}

.report-account-row:last-of-type {
    border-bottom: none;
}

.report-journal-entry {
    border-radius: var(--ig-radius) !important;
    border: 1px solid var(--ig-border);
}

.report-journal-entry-header {
    background: #F7F5FC;
    margin: -12px -12px 10px -12px;
    padding: 10px 14px;
    border-radius: var(--ig-radius) var(--ig-radius) 0 0;
    border-bottom: 1px solid var(--ig-border);
}

/* ==========================================================================
   Print styles — used when generating/printing accounting reports
   ========================================================================== */

@media print {
    .no-print {
        display: none !important;
    }

    html, body {
        background: #fff !important;
    }

    .mud-main-content {
        background: #fff !important;
    }

    .mud-container {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .report-sheet {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
    }

    @page {
        margin: 16mm 14mm;
    }
}

/* Faixa do período de teste (contas criadas pelo cadastro online). */
.trial-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 24px;
    background: #FBF1DE;
    border-bottom: 1px solid #EBD3A6;
    color: #5C4410;
    font-size: .88rem;
}

.trial-banner .mud-icon-root { color: #B9822A; }
