/* ==========================================================================
   SISTEMA ECLESIÁSTICO · MODERN SAAS DESIGN SYSTEM (ALTA CLAREZA)
   Sidebar Azul-Marinho + Workspace Limpo em Padrão F
   ========================================================================== */

   :root {
    --bg-app: #f4f7fb;
    --bg-surface: #ffffff;
    --bg-subtle: #f8fafc;
    --border-card: #e2e8f0;
    --border-input: #cbd5e1;

    --sidebar-top: #0a1124;
    --sidebar-bottom: #111d3f;
    --sidebar-hover: rgba(255, 255, 255, 0.07);
    --sidebar-active-bg: linear-gradient(90deg, rgba(37, 99, 235, 0.34) 0%, rgba(56, 189, 248, 0.14) 100%);
    --sidebar-text: #94a3b8;

    --text-main: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;

    --blue-700: #1d4ed8;
    --blue-600: #2563eb;
    --blue-50: #eff6ff;
    --blue-100: #dbeafe;

    --emerald-600: #059669;
    --emerald-500: #10b981;
    --emerald-50: #ecfdf5;
    --emerald-100: #d1fae5;

    --indigo-600: #4f46e5;
    --indigo-50: #eef2ff;
    --indigo-100: #e0e7ff;

    --amber-600: #d97706;
    --amber-500: #f59e0b;
    --amber-50: #fffbeb;
    --amber-100: #fef3c7;

    --rose-600: #e11d48;
    --rose-50: #fff1f2;

    --sidebar-w: 264px;
    --topbar-h: 62px;
    --radius-xl: 16px;
    --radius-lg: 12px;
    --radius-md: 9px;
    --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 14px -4px rgba(15, 23, 42, 0.05);
    --shadow-hover: 0 10px 24px -6px rgba(29, 78, 216, 0.12);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-app);
    color: var(--text-main);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    font-variant-numeric: tabular-nums;
}

h1, h2, h3, .font-display {
    font-family: "Plus Jakarta Sans", "Inter", -apple-system, sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ================= APP SHELL & SIDEBAR AZUL-MARINHO ================= */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--sidebar-top) 0%, var(--sidebar-bottom) 100%);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: 60;
    border-right: 1px solid rgba(148, 163, 184, 0.12);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 1023px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 17, 36, 0.62);
    backdrop-filter: blur(3px);
    z-index: 55;
}

.sidebar-backdrop.open { display: block; }

.sidebar-brand {
    height: var(--topbar-h);
    padding: 0 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, #2563eb 0%, #38bdf8 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
    flex-shrink: 0;
}

.brand-title {
    font-size: 15px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.brand-subtitle {
    font-size: 10px;
    font-weight: 700;
    color: #7dd3fc;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

.sidebar-scroll::-webkit-scrollbar { width: 5px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 999px; }

.nav-group { margin-bottom: 18px; }

.nav-group-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64748b;
    padding: 0 12px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9.5px 12px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 2px;
    transition: all 0.16s ease;
}

.nav-item-left {
    display: flex;
    align-items: center;
    gap: 11px;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    stroke: #64748b;
    flex-shrink: 0;
    transition: stroke 0.16s ease;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: #ffffff;
}

.nav-item:hover svg { stroke: #93c5fd; }

.nav-item.active {
    background: var(--sidebar-active-bg);
    color: #ffffff;
    font-weight: 700;
    box-shadow: inset 3px 0 0 #38bdf8;
}

.nav-item.active svg { stroke: #38bdf8; }

.nav-badge {
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.18);
    color: #7dd3fc;
}

.sidebar-footer {
    padding: 13px 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(6, 11, 25, 0.5);
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    color: #ffffff;
    font-weight: 800;
    font-size: 12.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-meta-name {
    font-size: 12.5px;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.2;
}

.user-meta-role {
    font-size: 10px;
    color: #7dd3fc;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ================= TOPBAR & WORKSPACE ================= */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

@media (min-width: 1024px) {
    .main-wrapper { margin-left: var(--sidebar-w); }
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: var(--topbar-h);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-card);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

@media (max-width: 640px) {
    .topbar { padding: 0 16px; }
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-menu-mobile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border-card);
    background: #ffffff;
    color: var(--text-main);
    cursor: pointer;
}

@media (min-width: 1024px) {
    .btn-menu-mobile { display: none; }
}

.breadcrumb-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.breadcrumb-sub {
    font-size: 12px;
    color: var(--text-muted);
    display: none;
}

@media (min-width: 640px) {
    .breadcrumb-sub { display: block; }
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-chip {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--emerald-50);
    border: 1px solid var(--emerald-100);
    color: var(--emerald-600);
    font-size: 11.5px;
    font-weight: 700;
}

@media (min-width: 768px) {
    .status-chip { display: inline-flex; }
}

.pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--emerald-500);
}

.btn-outline-sm {
    padding: 7px 13px;
    border-radius: 9px;
    border: 1px solid var(--border-card);
    background: #ffffff;
    color: var(--text-secondary);
    font-size: 12.5px;
    font-weight: 700;
    transition: all 0.15s;
}

.btn-outline-sm:hover {
    background: var(--blue-50);
    border-color: var(--blue-100);
    color: var(--blue-700);
}

.btn-danger-sm {
    padding: 7px 13px;
    border-radius: 9px;
    border: none;
    background: var(--rose-50);
    color: var(--rose-600);
    font-size: 12.5px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-danger-sm:hover {
    background: var(--rose-600);
    color: #ffffff;
}

.workspace {
    width: 100%;
    max-width: 1420px;
    margin: 0 auto;
    padding: 20px 24px 36px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

@media (max-width: 640px) {
    .workspace { padding: 14px 14px 28px; gap: 14px; }
}

/* ================= EXECUTIVE HEADER (COMPACTO E CLARO) ================= */
.exec-header {
    background: #ffffff;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-xl);
    padding: 16px 22px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.exec-greeting {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.exec-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.exec-title {
    font-size: 19px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.exec-role-pill {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--blue-50);
    color: var(--blue-700);
    border: 1px solid var(--blue-100);
}

.exec-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

.exec-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.role-segmented {
    display: inline-flex;
    flex-wrap: wrap;
    background: var(--bg-app);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--border-card);
    gap: 2px;
}

.role-seg-btn {
    padding: 5px 11px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.role-seg-btn:hover {
    color: var(--text-main);
}

.role-seg-btn.active {
    background: #ffffff;
    color: var(--blue-700);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

.btn-cta-main {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: 10px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
    transition: transform 0.15s, filter 0.15s;
}

.btn-cta-main:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

/* ================= KPI GRID (4 CARTÕES ALINHADOS EM 1 LINHA) ================= */
.kpi-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 640px) {
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1200px) {
    .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.kpi-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-card);
    border-top-width: 3px;
    border-radius: var(--radius-xl);
    padding: 18px 20px;
    box-shadow: var(--shadow-card);
    transition: transform 0.16s ease, box-shadow 0.16s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.kpi-card.blue { border-top-color: var(--blue-600); }
.kpi-card.indigo { border-top-color: var(--indigo-600); }
.kpi-card.emerald { border-top-color: var(--emerald-600); }
.kpi-card.amber { border-top-color: var(--amber-500); }

.kpi-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.kpi-title {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.kpi-icon-box {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-icon-box svg { width: 19px; height: 19px; }
.kpi-icon-box.blue { background: var(--blue-50); color: var(--blue-700); }
.kpi-icon-box.indigo { background: var(--indigo-50); color: var(--indigo-600); }
.kpi-icon-box.emerald { background: var(--emerald-50); color: var(--emerald-600); }
.kpi-icon-box.amber { background: var(--amber-50); color: var(--amber-600); }

.kpi-metric {
    margin-top: 12px;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
}

.kpi-val {
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.kpi-val.currency { font-size: 23px; }

.kpi-tag {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 999px;
}

.kpi-tag.blue { background: var(--blue-50); color: var(--blue-700); }
.kpi-tag.indigo { background: var(--indigo-50); color: var(--indigo-600); }
.kpi-tag.emerald { background: var(--emerald-50); color: var(--emerald-600); }
.kpi-tag.amber { background: var(--amber-50); color: var(--amber-600); }

.kpi-footer {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.kpi-link {
    color: var(--blue-700);
    font-weight: 700;
    font-size: 11.5px;
}

.kpi-link:hover { text-decoration: underline; }

/* ================= COCKPIT 2 COLUNAS ASSIMÉTRICAS (65% / 35%) ================= */
.cockpit-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: start;
}

@media (min-width: 1120px) {
    .cockpit-grid {
        grid-template-columns: 1.75fr 1fr;
    }
}

.cockpit-col {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.surface-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-xl);
    padding: 20px 22px;
    box-shadow: var(--shadow-card);
}

.card-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.card-head-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.015em;
}

.card-head-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 1px;
}

/* Faixa de Resumo Financeiro Acima do Gráfico (Ultra Clara) */
.fin-summary-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

@media (max-width: 540px) {
    .fin-summary-strip { grid-template-columns: 1fr; }
}

.fin-mini-box {
    padding: 10px 12px;
    border-radius: 11px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-card);
}

.fin-mini-lbl {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.fin-mini-val {
    font-size: 16px;
    font-weight: 800;
    margin-top: 2px;
}

.chart-canvas-wrap {
    position: relative;
    height: 210px;
    width: 100%;
}

/* Ações Rápidas Compactas */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
    gap: 10px;
}

.quick-card {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 14px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-card);
    background: #ffffff;
    transition: all 0.15s ease;
}

.quick-card:hover {
    background: var(--blue-50);
    border-color: #93c5fd;
    transform: translateY(-1px);
}

.quick-ico {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.quick-ico svg { width: 18px; height: 18px; }
.quick-ico.blue { background: var(--blue-100); color: var(--blue-700); }
.quick-ico.emerald { background: var(--emerald-100); color: var(--emerald-600); }
.quick-ico.indigo { background: var(--indigo-100); color: var(--indigo-600); }
.quick-ico.amber { background: var(--amber-100); color: var(--amber-600); }
.quick-ico.rose { background: var(--rose-50); color: var(--rose-600); }
.quick-ico.slate { background: #e2e8f0; color: var(--text-main); }

.quick-name {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
}

.quick-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 1px;
}

/* Barras Proporcionais Horizontais (Leitura Instantânea de Pessoas) */
.segmented-bar {
    display: flex;
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: #e2e8f0;
    margin-bottom: 14px;
    gap: 2px;
}

.seg-part {
    height: 100%;
    transition: width 0.3s ease;
}

.prop-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.prop-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 11px;
    border-radius: 10px;
    background: var(--bg-subtle);
    font-size: 13px;
}

.prop-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-secondary);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    flex-shrink: 0;
}

.prop-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.prop-count {
    font-weight: 800;
    color: var(--text-main);
}

.prop-pct {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 34px;
    text-align: right;
}

/* Listas e Pills */
.empty-state {
    padding: 18px 14px;
    border-radius: var(--radius-lg);
    background: var(--bg-subtle);
    border: 1px dashed #cbd5e1;
    text-align: center;
    font-size: 12.5px;
    color: var(--text-muted);
}

.list-modern { list-style: none; }

.list-modern li {
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.list-modern li:last-child { border-bottom: none; }

.pill-badge {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.pill-blue { background: var(--blue-50); color: var(--blue-700); }
.pill-indigo { background: var(--indigo-50); color: var(--indigo-600); }
.pill-emerald { background: var(--emerald-50); color: var(--emerald-600); }
.pill-amber { background: var(--amber-50); color: var(--amber-600); }

.btn-wpp-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border-radius: 8px;
    background: var(--emerald-50);
    border: 1px solid var(--emerald-100);
    color: var(--emerald-600);
    font-size: 11.5px;
    font-weight: 800;
    transition: all 0.15s;
}

.btn-wpp-chip:hover {
    background: var(--emerald-600);
    color: #ffffff;
}

/* ================= LOGIN & FORMULÁRIOS ================= */
.guest-screen {
    min-height: 100vh;
    background: radial-gradient(circle at 80% 15%, rgba(37, 99, 235, 0.35) 0%, transparent 45%),
                linear-gradient(150deg, #070d1d 0%, #0f172a 55%, #1e3a8a 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.guest-header {
    text-align: center;
    color: #ffffff;
    margin-bottom: 24px;
}

.guest-logo {
    width: 58px;
    height: 58px;
    margin: 0 auto 12px;
    border-radius: 16px;
    background: linear-gradient(135deg, #2563eb 0%, #38bdf8 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.45);
}

.guest-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 22px;
    padding: 32px 28px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 900px) {
    .form-grid-2 { grid-template-columns: 1fr 1fr; }
}

.field-group { margin-bottom: 16px; }

label {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border-input);
    border-radius: 11px;
    background: var(--bg-subtle);
    color: var(--text-main);
    font-size: 14px;
    transition: all 0.15s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--blue-600);
}

.btn-primary,
button[type="submit"]:not(.btn-danger-sm):not(.btn-xs):not(.btn-emerald):not(.btn-secondary) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border: none;
    border-radius: 11px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    font-size: 13.5px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
    transition: transform 0.15s, filter 0.15s;
}

.btn-primary:hover,
button[type="submit"]:not(.btn-danger-sm):not(.btn-xs):not(.btn-emerald):not(.btn-secondary):hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

.alert-success {
    padding: 11px 14px;
    border-radius: 10px;
    background: var(--emerald-50);
    border: 1px solid var(--emerald-100);
    color: var(--emerald-600);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 14px;
}

.alert-error {
    color: var(--rose-600);
    font-size: 12px;
    font-weight: 700;
    margin-top: 4px;
}
/* ==========================================================================
   MÓDULO DE CADASTROS: TABELAS, INPUT + QUICK-ADD (ESTILO D3), MODAIS E CARTEIRINHA
   ========================================================================== */

   .toolbar-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.filter-group input,
.filter-group select {
    max-width: 240px;
    padding: 9px 12px;
    font-size: 13px;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 15px;
    border-radius: 10px;
    border: 1px solid var(--border-input);
    background: #ffffff;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-secondary:hover {
    background: var(--bg-subtle);
    color: var(--text-main);
    border-color: #94a3b8;
}

.btn-emerald {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 15px;
    border-radius: 10px;
    border: none;
    background: var(--emerald-600);
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: filter 0.15s;
}

.btn-emerald:hover { filter: brightness(1.08); }

.btn-xs {
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 700;
    border: 1px solid var(--border-card);
    background: #ffffff;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s;
}

.btn-xs:hover {
    background: var(--blue-50);
    color: var(--blue-700);
    border-color: var(--blue-100);
}

.btn-xs.danger {
    background: var(--rose-50);
    color: var(--rose-600);
    border-color: transparent;
}

.btn-xs.danger:hover {
    background: var(--rose-600);
    color: #ffffff;
}

/* Input / Select com botão + Rápido ao lado (Padrão D3 Categoria/Setor) */
.input-with-add {
    display: flex;
    align-items: stretch;
    gap: 6px;
}

.input-with-add select {
    flex: 1;
}

.btn-quick-add {
    padding: 0 13px;
    border-radius: 10px;
    border: 1.5px solid var(--blue-100);
    background: var(--blue-50);
    color: var(--blue-700);
    font-size: 12.5px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-quick-add:hover {
    background: var(--blue-600);
    color: #ffffff;
    border-color: var(--blue-600);
}

/* Tabelas Modernas Responsivas */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13.5px;
}

.modern-table thead {
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border-card);
}

.modern-table th {
    padding: 12px 14px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    white-space: nowrap;
}

.modern-table td {
    padding: 13px 14px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.modern-table tbody tr:hover {
    background: #f8fafd;
}

.member-cell {
    display: flex;
    align-items: center;
    gap: 11px;
}

.avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    color: #ffffff;
    font-weight: 800;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.avatar-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Grids de Formulário */
.form-row-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

@media (min-width: 768px) {
    .form-row-3 { grid-template-columns: repeat(3, 1fr); }
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

@media (min-width: 768px) {
    .form-row-2 { grid-template-columns: repeat(2, 1fr); }
}

.form-section-title {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--blue-700);
    padding-bottom: 6px;
    border-bottom: 1px solid var(--blue-100);
    margin: 18px 0 14px;
}

/* Modais Nativos Limpos */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(10, 17, 36, 0.65);
    backdrop-filter: blur(3px);
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-overlay.open {
    display: flex;
}

.modal-box {
    width: 100%;
    max-width: 480px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
    overflow: hidden;
    animation: modalPop 0.18s ease-out;
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.modal-head {
    padding: 16px 20px;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border-card);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-head h3 {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-main);
}

.modal-close {
    border: none;
    background: transparent;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    padding: 20px;
}

.modal-foot {
    padding: 14px 20px;
    background: var(--bg-subtle);
    border-top: 1px solid var(--border-card);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Carteirinha Digital de Membro (Mobile & Impressão) */
.id-card-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 12px 0;
}

.digital-id-card {
    width: 100%;
    max-width: 400px;
    border-radius: 22px;
    background: linear-gradient(145deg, #0a1124 0%, #172a63 55%, #1d4ed8 100%);
    color: #ffffff;
    padding: 24px;
    box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.45);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.digital-id-card::after {
    content: "";
    position: absolute;
    right: -40px;
    top: -40px;
    width: 180px;
    height: 180px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.25) 0%, transparent 70%);
    pointer-events: none;
}

.id-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.id-profile {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.id-photo {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid #38bdf8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 900;
    overflow: hidden;
    flex-shrink: 0;
}

.id-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.id-grid-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 12px;
    font-size: 12px;
    margin-bottom: 16px;
}

.id-grid-info small {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    color: #93c5fd;
    font-weight: 700;
}

.id-qr-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #ffffff;
    color: #0f172a;
    border-radius: 14px;
    padding: 10px 14px;
}

/* Chamada de Presença no Culto */
.presence-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
}

.presence-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1.5px solid var(--border-card);
    background: #ffffff;
    transition: all 0.15s;
}

.presence-card.present {
    border-color: var(--emerald-500);
    background: var(--emerald-50);
}

@media print {
    .sidebar, .topbar, .no-print { display: none !important; }
    .main-wrapper { margin-left: 0 !important; }
    body { background: #ffffff !important; }
}
/* ==========================================================================
   CANTINA TOUCHSCREEN & MOBILE-FIRST (CARDS / LISTA SEM CORTES)
   ========================================================================== */

   .cantina-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.cantina-search-input {
    flex: 1;
    min-width: 200px;
    min-height: 42px;
    padding: 9px 14px;
    border-radius: 11px;
    font-size: 14px;
}

.view-switcher {
    display: inline-flex;
    background: var(--bg-app);
    border: 1px solid var(--border-card);
    border-radius: 11px;
    padding: 3px;
    gap: 3px;
}

.view-switch-btn {
    min-height: 36px;
    padding: 6px 13px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12.5px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
}

.view-switch-btn.active {
    background: #ffffff;
    color: var(--blue-700);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
}

.cat-pills-row {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 6px;
    margin-bottom: 14px;
    -webkit-overflow-scrolling: touch;
}

.cat-pill {
    min-height: 34px;
    padding: 6px 13px;
    border-radius: 999px;
    border: 1px solid var(--border-card);
    background: var(--bg-subtle);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.15s;
}

.cat-pill.active {
    background: var(--blue-700);
    color: #ffffff;
    border-color: var(--blue-700);
}

/* ==================== MODO 1: VISUALIZAÇÃO EM CARDS ==================== */
.cantina-products-container.mode-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
    gap: 12px;
}

.cantina-item-card {
    background: #ffffff;
    border: 1.5px solid var(--border-card);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cantina-item-card:hover {
    border-color: #93c5fd;
    box-shadow: var(--shadow-hover);
}

.cantina-item-card.in-cart {
    border-color: var(--emerald-500);
    background: #f6fef9;
}

.cantina-item-card.paused {
    opacity: 0.62;
}

.cantina-tap-zone {
    padding: 14px 15px 12px;
    cursor: pointer;
    user-select: none;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cantina-tap-zone:active {
    background: var(--emerald-50);
}

.cantina-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.cantina-item-cat {
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.cantina-item-name {
    font-size: 15.5px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.3;
    word-break: break-word;
}

.cantina-item-ing {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.35;
}

.cantina-item-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
}

.cantina-item-price {
    font-size: 19px;
    font-weight: 900;
    color: var(--emerald-600);
    white-space: nowrap;
}

.cantina-cart-qty-badge {
    display: none;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--emerald-600);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.cantina-item-card.in-cart .cantina-cart-qty-badge {
    display: inline-flex;
    align-items: center;
}

/* Rodapé do Card em 2 linhas organizadas (sem aperto e sem corte) */
.cantina-item-footer {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 10px 12px;
    background: var(--bg-subtle);
    border-top: 1px solid #f1f5f9;
    border-radius: 0 0 14px 14px;
}

.cantina-add-btn {
    width: 100%;
    min-height: 36px;
    padding: 7px 12px;
    border: none;
    border-radius: 9px;
    background: var(--emerald-600);
    color: #ffffff;
    font-size: 12.5px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.cantina-add-btn:hover {
    filter: brightness(1.07);
}

.cantina-mini-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}

.cantina-mini-actions form {
    margin: 0;
    display: flex;
}

/* Especificidade reforçada para vencer button[type="submit"] global */
button.touch-chip-btn,
.touch-chip-btn {
    width: 100%;
    min-height: 30px;
    padding: 4px 6px;
    border-radius: 7px;
    border: 1px solid var(--border-card);
    background: #ffffff;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    box-shadow: none;
}

button.touch-chip-btn:hover,
.touch-chip-btn:hover {
    background: var(--blue-50);
    color: var(--blue-700);
    border-color: var(--blue-100);
    transform: none;
}

button.touch-chip-btn.hoje-sim {
    background: var(--emerald-50);
    color: var(--emerald-600);
    border-color: var(--emerald-100);
}

button.touch-chip-btn.hoje-nao {
    background: var(--amber-50);
    color: var(--amber-600);
    border-color: var(--amber-100);
}

/* ==================== MODO 2: VISUALIZAÇÃO EM LISTA AMPLA ==================== */
.cantina-products-container.mode-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cantina-products-container.mode-list .cantina-item-card {
    flex-direction: column;
    border-radius: 14px;
}

.cantina-products-container.mode-list .cantina-tap-zone {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 16px;
}

.cantina-products-container.mode-list .cantina-item-top {
    justify-content: flex-start;
    margin-bottom: 3px;
}

.cantina-products-container.mode-list .cantina-item-name {
    font-size: 15.5px;
}

.cantina-products-container.mode-list .cantina-item-price-row {
    margin-top: 0;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.cantina-products-container.mode-list .cantina-item-footer {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
}

.cantina-products-container.mode-list .cantina-add-btn {
    width: auto;
    min-width: 130px;
}

.cantina-products-container.mode-list .cantina-mini-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cantina-products-container.mode-list button.touch-chip-btn {
    width: auto;
    padding: 5px 11px;
}

/* BARRA FIXA DE PEDIDO NO CELULAR */
.mobile-sticky-pdv {
    display: none;
}

@media (max-width: 1119px) {
    body.has-mobile-pdv {
        padding-bottom: 78px;
    }
    .mobile-sticky-pdv {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 45;
        background: #0f172a;
        color: #ffffff;
        padding: 10px 16px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        box-shadow: 0 -6px 20px rgba(15, 23, 42, 0.25);
    }
}