/* ============================================================
   DÍZIMO SANTUÁRIO — Design System
   Paleta: vermelho litúrgico centralizada em variáveis CSS
   ============================================================ */

:root {
    /* Brand — vermelho */
    --primary:       #C0192D;
    --primary-700:   #991322;
    --primary-900:   #6B0D18;
    --primary-50:    #FEF2F2;
    --primary-100:   #FEE2E2;
    --accent:        #E53E3E;

    /* Neutrals */
    --bg:            #F3F4F6;
    --surface:       #FFFFFF;
    --surface-2:     #F9FAFB;
    --line:          #E5E7EB;
    --line-strong:   #D1D5DB;
    --ink:           #111827;
    --ink-2:         #1F2937;
    --ink-soft:      #6B7280;
    --ink-faint:     #9CA3AF;

    /* Status */
    --ok:            #047857;
    --ok-bg:         #ECFDF5;
    --warn:          #B45309;
    --warn-bg:       #FFFBEB;
    --danger:        #B91C1C;
    --danger-bg:     #FEF2F2;
    --info:          #1D4ED8;
    --info-bg:       #EFF6FF;

    /* Shadows */
    --shadow-xs:     0 1px 2px rgba(0,0,0,.05);
    --shadow-sm:     0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md:     0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
    --shadow-lg:     0 10px 15px rgba(0,0,0,.10), 0 4px 6px rgba(0,0,0,.05);
    --shadow-xl:     0 20px 25px rgba(0,0,0,.10), 0 8px 10px rgba(0,0,0,.04);

    /* Radius */
    --radius:        14px;
    --radius-lg:     18px;
    --radius-sm:     10px;
    --radius-xs:     6px;
}

/* ── Base ── */
html { font-size: 15px; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--ink);
    letter-spacing: -.005em;
    line-height: 1.55;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
main { flex: 1; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-700); }

/* ── Navbar ── */
.navbar {
    background: var(--primary) !important;
    box-shadow: var(--shadow-md);
    padding: .6rem 1rem;
}
.navbar-brand {
    font-weight: 700;
    font-size: 1.15rem;
    color: #fff !important;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.navbar-brand .brand-icon {
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,.18);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}
.navbar-nav .nav-link {
    color: rgba(255,255,255,.88) !important;
    font-size: .875rem;
    font-weight: 500;
    padding: .35rem .75rem !important;
    border-radius: var(--radius-xs);
    transition: background .15s, color .15s;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    background: rgba(255,255,255,.15);
    color: #fff !important;
}
.navbar-nav .dropdown-menu {
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-sm);
    padding: .3rem;
}
.navbar-nav .dropdown-item {
    border-radius: var(--radius-xs);
    font-size: .875rem;
    padding: .4rem .75rem;
    color: var(--ink-2);
}
.navbar-nav .dropdown-item:hover {
    background: var(--primary-50);
    color: var(--primary);
}
.navbar-toggler { border-color: rgba(255,255,255,.3); }
.navbar-toggler-icon { filter: invert(1); }

/* ── Page container ── */
.page-container {
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* ── Page header ── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    gap: 1rem;
    flex-wrap: wrap;
}
.page-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--ink-2);
    margin: 0;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.page-title i { color: var(--primary); font-size: 1.2rem; }

/* ── Cards ── */
.card {
    background: var(--surface);
    border: 1.5px solid var(--line-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-header {
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    padding: .85rem 1.1rem;
    font-weight: 600;
    font-size: .925rem;
    color: var(--ink-2);
    border-radius: var(--radius) var(--radius) 0 0;
}
.card-body { padding: 1.1rem; }

/* ── Stat cards (dashboard) ── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: var(--surface);
    border: 1.5px solid var(--line-strong);
    border-top: 3px solid var(--primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .3rem;
}
.stat-card .stat-label {
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ink-soft);
}
.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.1;
}
.stat-card .stat-sub {
    font-size: .8rem;
    color: var(--ink-faint);
}
.stat-card.stat-ok .stat-value   { color: var(--ok); }
.stat-card.stat-ok               { border-top-color: var(--ok); }
.stat-card.stat-warn .stat-value { color: var(--warn); }
.stat-card.stat-warn             { border-top-color: var(--warn); }

/* ── Tables ── */
.table-card {
    background: var(--surface);
    border: 1.5px solid var(--line-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.table {
    margin: 0;
    font-size: .9rem;
}
.table thead th {
    background: var(--surface-2);
    border-bottom: 2px solid var(--line-strong);
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ink-soft);
    padding: .75rem 1rem;
    white-space: nowrap;
}
.table tbody td {
    padding: .7rem 1rem;
    vertical-align: middle;
    border-color: var(--line);
    color: var(--ink);
}
.table tbody tr:hover { background: var(--primary-50); }
.table-toolbar {
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

/* ── Buttons ── */
.btn-primary {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
    font-weight: 600;
    box-shadow: var(--shadow-xs);
    transition: background .15s, transform .1s;
}
.btn-primary:hover {
    background: var(--primary-700) !important;
    border-color: var(--primary-700) !important;
    transform: translateY(-1px);
}
.btn-outline-primary {
    color: var(--primary) !important;
    border-color: var(--primary) !important;
}
.btn-outline-primary:hover {
    background: var(--primary) !important;
    color: #fff !important;
}
.btn-sm { font-size: .8rem; padding: .3rem .65rem; }

/* ── Badges ── */
.badge-ativo    { background: var(--ok-bg); color: var(--ok); border: 1px solid #A7F3D0; }
.badge-inativo  { background: var(--danger-bg); color: var(--danger); border: 1px solid #FECACA; }
.badge-nivel    { background: var(--primary-100); color: var(--primary-900); border: 1px solid #FECACA; }
.badge-custom {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .01em;
}

/* ── Forms ── */
.form-label {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--ink-soft);
    margin-bottom: .3rem;
}
.form-control, .form-select {
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-xs);
    font-size: .9rem;
    padding: .45rem .75rem;
    transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(192, 25, 45, .12);
    outline: none;
}
.form-section {
    background: var(--surface);
    border: 1.5px solid var(--line-strong);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.form-section-title {
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--primary);
    margin-bottom: .85rem;
    display: flex;
    align-items: center;
    gap: .35rem;
}
.text-danger { color: var(--danger) !important; font-size: .8rem; }

/* ── Search bar ── */
.search-bar {
    display: flex;
    gap: .5rem;
    align-items: flex-end;
    flex-wrap: wrap;
    background: var(--surface);
    border: 1.5px solid var(--line-strong);
    border-radius: var(--radius);
    padding: .85rem 1rem;
    box-shadow: var(--shadow-xs);
    margin-bottom: 1rem;
}

/* ── Pivot table (Pagamentos) ── */
.pivot-table th.mes { width: 56px; text-align: center; }
.pivot-table td.mes { text-align: center; }
.pivot-pago {
    background: var(--ok-bg);
    color: var(--ok);
    font-weight: 600;
    font-size: .8rem;
    border-radius: 4px;
    padding: 2px 6px;
    white-space: nowrap;
}
.pivot-aberto {
    font-size: .75rem;
    border-radius: 4px;
    padding: 2px 6px;
    cursor: pointer;
    border: 1px dashed var(--danger);
    color: var(--danger);
    background: transparent;
}
.pivot-aberto:hover { background: var(--danger); color: #fff; }
.pivot-futuro { color: var(--ink-faint); font-size: .75rem; }

/* ── Empty state ── */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--ink-soft);
}
.empty-state i { font-size: 2.5rem; opacity: .3; display: block; margin-bottom: .75rem; }
.empty-state p { margin: 0; font-size: .95rem; }

/* ── Alert override ── */
.alert { border-radius: var(--radius-sm); font-size: .9rem; }
.alert-success { background: var(--ok-bg); border-color: #A7F3D0; color: var(--ok); }
.alert-danger   { background: var(--danger-bg); border-color: #FECACA; color: var(--danger); }
.alert-warning  { background: var(--warn-bg); border-color: #FDE68A; color: var(--warn); }

/* ── Auth split screen ── */
.auth-split {
    min-height: 100vh;
    display: flex;
}
.auth-brand {
    flex: 0 0 420px;
    background: linear-gradient(145deg, var(--primary-900) 0%, var(--primary) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    color: #fff;
    gap: 1.5rem;
}
.auth-brand .brand-logo {
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,.15);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
}
.auth-brand h1 {
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    margin: 0;
}
.auth-brand p {
    opacity: .75;
    text-align: center;
    font-size: .95rem;
    margin: 0;
}
.auth-features { list-style: none; padding: 0; margin: 0; width: 100%; }
.auth-features li {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .75rem;
    background: rgba(255,255,255,.08);
    border-radius: var(--radius-xs);
    margin-bottom: .4rem;
    font-size: .875rem;
    opacity: .9;
}
.auth-features li i { font-size: 1rem; opacity: .8; }
.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--surface);
}
.auth-form-box {
    width: 100%;
    max-width: 380px;
}
.auth-form-box h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--ink-2);
    margin-bottom: .25rem;
}
.auth-form-box p.subtitle {
    color: var(--ink-soft);
    font-size: .9rem;
    margin-bottom: 1.75rem;
}
.btn-login {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: .75rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    width: 100%;
    cursor: pointer;
    transition: background .15s, transform .1s;
}
.btn-login:hover {
    background: var(--primary-700);
    transform: translateY(-1px);
}

/* ── Footer ── */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--line);
    padding: .75rem 1.5rem;
    text-align: center;
    font-size: .8rem;
    color: var(--ink-faint);
}

/* ── Responsivo ── */
@media (max-width: 768px) {
    .auth-brand { display: none; }
    .page-container { padding: 1rem; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .pivot-table { font-size: .75rem; }
}

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

/* ── Quick Access Cards (Dashboard) ── */
.qa-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .75rem;
}
.qa-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: .3rem;
    padding: 0.7rem 0.75rem;
    border: 1.5px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    text-decoration: none;
    color: var(--ink-2);
    cursor: pointer;
    box-shadow: var(--shadow-xs);
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.qa-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
    color: var(--ink-2);
}
.qa-card:hover .qa-circle {
    background: var(--primary) !important;
    color: #fff !important;
}
.qa-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--qa-bg, var(--primary-100));
    color: var(--qa-color, var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: background .15s, color .15s;
}
.qa-title {
    font-weight: 700;
    font-size: .875rem;
    color: var(--ink-2);
    line-height: 1.2;
}
.qa-sub {
    font-size: .7rem;
    color: var(--ink-soft);
    line-height: 1.3;
}

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

/* ── Relatórios print ── */
@media print {
    .navbar, .btn, .search-bar, .no-print { display: none !important; }
    .table-card { box-shadow: none; border: none; }
}
