/* ==========================================================================
   Material Design 3 Theme - Churrasdora
   ========================================================================== */

:root {
    /* Color Palette - Premium Obsidian Dark Mode */
    --md-sys-color-primary: #FF4E00; /* Neon fire orange */
    --md-sys-color-primary-gradient: linear-gradient(135deg, #FF4E00 0%, #FFA000 100%);
    --md-sys-color-on-primary: #FFFFFF;
    --md-sys-color-primary-container: rgba(255, 78, 0, 0.15);
    --md-sys-color-on-primary-container: #FFCCBC;
    
    --md-sys-color-surface: #161211; /* Dark Obsidian/Charcoal */
    --md-sys-color-on-surface: #F5F0EE;
    --md-sys-color-surface-container: #0A0808; /* Deep rich dark background */
    
    --md-sys-color-background: #0A0808;
    --md-sys-color-on-background: #F5F0EE;
    
    --md-sys-color-outline: rgba(255, 255, 255, 0.08);
    --md-sys-color-secondary-text: rgba(245, 240, 238, 0.6);
    --md-sys-color-error: #CF6679;

    /* Elevations (Shadows) - Smooth & Glowing */
    --md-sys-elevation-1: 0 2px 8px rgba(0, 0, 0, 0.4);
    --md-sys-elevation-2: 0 4px 16px rgba(0, 0, 0, 0.6);
    --md-sys-elevation-3: 0 8px 32px rgba(0, 0, 0, 0.8), 0 0 1px rgba(255, 255, 255, 0.1) inset;

    /* Typography */
    --md-sys-typescale-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    /* Evita rolagem horizontal escondida e o "elastic bounce" que denuncia
       WebView em apps nativos (sensação de app "premium"). */
    overflow-x: hidden;
    overscroll-behavior: none;
}

body {
    font-family: var(--md-sys-typescale-font);
    background-color: var(--md-sys-color-background);
    color: var(--md-sys-color-on-background);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button, a, .icon-btn, .text-btn, .drawer-item, .md-checkbox {
    /* Remove o flash cinza/azul de toque do WebView Android e o delay de 300ms. */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Fallback de segurança: se a fonte remota do Google (Material Symbols) demorar ou
   falhar em uma rede mobile, evita que o nome literal do ícone (ex: "child_care")
   estoure containers de tamanho fixo (botões circulares, badges, etc.). */
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined', sans-serif;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ==========================================================================
   Views & Layout
   ========================================================================== */
.app-container {
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    overflow: hidden;
    position: relative;
    background-color: var(--md-sys-color-background);
    padding-bottom: env(safe-area-inset-bottom);
}

.view {
    display: none;
    height: 100%;
    width: 100%;
}
.view.active {
    display: block;
}

.content-section {
    display: none;
    padding: 24px 16px;
    max-width: 800px;
    margin: 0 auto;
    padding-bottom: 120px; /* Space for FAB/Actions */
}
.content-section.active {
    display: block;
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Top App Bar (Glassmorphic)
   ========================================================================== */
.top-app-bar {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Pushes toggle button to the right */
    /* padding-top respeita a status bar/notch quando roda dentro do app nativo (Capacitor) */
    padding: env(safe-area-inset-top) 24px 0 24px;
    background: rgba(22, 18, 17, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: var(--md-sys-color-on-surface);
    height: calc(72px + env(safe-area-inset-top));
    border-bottom: 1px solid var(--md-sys-color-outline);
    box-shadow: var(--md-sys-elevation-1);
    position: relative;
    z-index: 10;
}

.app-title {
    font-size: 24px;
    font-weight: 800;
    margin-left: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--md-sys-color-primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
    cursor: pointer;
    user-select: none;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

.app-title:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

.app-title:active {
    transform: scale(0.98);
}

.app-title .material-symbols-outlined {
    font-size: 28px;
    background: var(--md-sys-color-primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.main-content {
    height: calc(100vh - 72px - env(safe-area-inset-top));
    height: calc(100dvh - 72px - env(safe-area-inset-top));
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain; /* impede que o scroll "vaze" para o pull-to-refresh do app nativo */
    -webkit-overflow-scrolling: touch;
    background-color: var(--md-sys-color-surface-container);
    /* Custom Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 78, 0, 0.2) transparent;
}

.main-content::-webkit-scrollbar {
    width: 6px;
}
.main-content::-webkit-scrollbar-track {
    background: transparent;
}
.main-content::-webkit-scrollbar-thumb {
    background-color: rgba(255, 78, 0, 0.2);
    border-radius: 3px;
}

/* ==========================================================================
   Navigation Drawer (Glassmorphic & Rounded)
   ========================================================================== */
.navigation-drawer {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100vh;
    height: 100dvh;
    background: rgba(22, 18, 17, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--md-sys-color-outline);
    box-shadow: var(--md-sys-elevation-3);
    z-index: 100;
    transition: left 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}
.navigation-drawer.open {
    left: 0;
}

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.drawer-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.drawer-header {
    padding: calc(32px + env(safe-area-inset-top)) 24px 32px 24px;
    border-bottom: 1px solid var(--md-sys-color-outline);
    background: linear-gradient(135deg, rgba(255, 78, 0, 0.15) 0%, rgba(255, 138, 0, 0.03) 100%);
    color: var(--md-sys-color-on-surface);
}
.drawer-logo {
    font-size: 40px;
    margin-bottom: 12px;
    background: var(--md-sys-color-primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}
.user-email {
    font-weight: 700;
    font-size: 18px;
    color: var(--md-sys-color-on-surface);
    letter-spacing: -0.3px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    /* O tamanho da fonte é ajustado dinamicamente via JS (ajustarFonteEmail em app.js)
       para o e-mail sempre caber em uma única linha, sem vazar. text-overflow como
       rede de segurança final caso o JS não rode a tempo. */
    text-overflow: ellipsis;
}

.drawer-content {
    padding: 16px 0;
    flex: 1;
    overflow-y: auto;
}

/* Rodapé fixo do menu lateral: Sair/Excluir conta ficam sempre colados embaixo,
   separados dos itens de navegação, independente da altura da tela. */
.drawer-footer {
    padding: 8px 0 calc(16px + env(safe-area-inset-bottom)) 0;
    border-top: 1px solid var(--md-sys-color-outline);
    flex-shrink: 0;
}

.drawer-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: rgba(245, 240, 238, 0.75);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    gap: 14px;
    border-radius: 12px;
    margin: 4px 16px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid transparent;
}
.drawer-item .material-symbols-outlined {
    font-size: 22px;
    color: rgba(245, 240, 238, 0.6);
    transition: color 0.3s;
}
.drawer-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--md-sys-color-on-surface);
    border-color: rgba(255, 255, 255, 0.05);
    padding-left: 24px;
}
.drawer-item:hover .material-symbols-outlined {
    color: var(--md-sys-color-primary);
}
.drawer-item.active {
    background: var(--md-sys-color-primary-gradient);
    color: #FFFFFF;
    box-shadow: 0 4px 20px rgba(255, 78, 0, 0.35);
}
.drawer-item.active .material-symbols-outlined {
    color: #FFFFFF;
}

.logout-item {
    color: var(--md-sys-color-error);
}
.logout-item .material-symbols-outlined {
    color: rgba(207, 102, 121, 0.7);
}
.logout-item:hover .material-symbols-outlined {
    color: var(--md-sys-color-error);
}

/* ==========================================================================
   Material Cards & Surfaces
   ========================================================================== */
.material-card {
    background-color: var(--md-sys-color-surface);
    border-radius: 16px;
    box-shadow: var(--md-sys-elevation-1);
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--md-sys-color-outline);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.material-card:hover {
    border-color: rgba(255, 78, 0, 0.2);
    box-shadow: var(--md-sys-elevation-2), 0 0 20px rgba(255, 78, 0, 0.03);
    transform: translateY(-2px);
}

.section-card {
    background: rgba(22, 18, 17, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--md-sys-color-on-surface);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.3px;
}

.card-title .material-symbols-outlined,
.card-title .title-icon-svg {
    color: var(--md-sys-color-primary);
    font-size: 22px;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.page-header {
    margin: 24px 0 32px 0;
}
.page-header h2 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.8px;
    background: var(--md-sys-color-primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.page-header .subtitle {
    color: var(--md-sys-color-secondary-text);
    font-size: 15px;
    margin-top: 6px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 14px; /* More modern than full pills */
    border: none;
    font-size: 15px;
    font-weight: 700;
    font-family: var(--md-sys-typescale-font);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    letter-spacing: 0.3px;
}

.primary-btn {
    background: var(--md-sys-color-primary-gradient);
    color: var(--md-sys-color-on-primary);
    box-shadow: 0 4px 15px rgba(255, 78, 0, 0.3);
}
.primary-btn:hover {
    box-shadow: 0 6px 20px rgba(255, 78, 0, 0.5), 0 0 0 2px rgba(255, 78, 0, 0.2);
    transform: translateY(-2px);
}
.primary-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(255, 78, 0, 0.3);
}

.btn-whatsapp {
    background: #25D366 !important;
    color: #FFFFFF !important;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3) !important;
}
.btn-whatsapp:hover {
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5), 0 0 0 2px rgba(37, 211, 102, 0.2) !important;
    transform: translateY(-2px);
}
.btn-whatsapp:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(37, 211, 102, 0.3) !important;
}

.secondary-btn {
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    border: 1px solid rgba(255, 78, 0, 0.2);
}
.secondary-btn:hover {
    background-color: rgba(255, 78, 0, 0.25);
    border-color: rgba(255, 78, 0, 0.4);
    transform: translateY(-2px);
}

.text-btn {
    background-color: transparent;
    color: var(--md-sys-color-primary);
    padding: 12px 20px;
    border: 1px solid transparent;
}
.text-btn:hover {
    background-color: rgba(255, 78, 0, 0.08);
    border-color: rgba(255, 78, 0, 0.15);
    transform: translateY(-1px);
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px; /* tap target mínimo recomendado (44x44px) */
    height: 44px;
    border-radius: 12px; /* Rounded square is very modern */
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
    color: rgba(245, 240, 238, 0.8);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.12);
    transform: scale(1.05);
}
.icon-btn:active {
    transform: scale(0.95);
}
.icon-btn.danger {
    color: rgba(207, 102, 121, 0.8);
    border-color: rgba(207, 102, 121, 0.15);
    background: rgba(207, 102, 121, 0.03);
}
.icon-btn.danger:hover {
    color: #FF7B90;
    border-color: rgba(207, 102, 121, 0.4);
    background: rgba(207, 102, 121, 0.08);
}

.btn-full {
    width: 100%;
}

.form-actions {
    display: flex;
    flex-direction: row; /* Horizontal actions look cleaner than stacked on desktop */
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
    margin-top: 32px;
}
.form-actions .md-checkbox {
    margin: 0;
    margin-right: auto;
}
@media (max-width: 600px) {
    .form-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .form-actions .md-checkbox {
        margin-right: 0;
        justify-content: center;
        width: 100%;
    }
}

/* ==========================================================================
   Inputs & Forms
   ========================================================================== */
.input-field {
    position: relative;
    margin-bottom: 20px;
    width: 100%;
}

.input-field label {
    display: block;
    font-size: 13px;
    color: rgba(245, 240, 238, 0.6);
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-field input {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    font-family: var(--md-sys-typescale-font);
    background-color: rgba(0, 0, 0, 0.2);
    color: var(--md-sys-color-on-surface);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.input-field input::placeholder {
    color: rgba(245, 240, 238, 0.35);
}

.input-field input:focus {
    outline: none;
    border-color: var(--md-sys-color-primary);
    background-color: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 3px rgba(255, 78, 0, 0.15);
}

.guests-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
@media (max-width: 768px) {
    .guests-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   Checkboxes
   ========================================================================== */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.md-checkbox {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    user-select: none;
    color: rgba(245, 240, 238, 0.85);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 14px 16px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.md-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: relative;
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%; /* Circular indicator */
    margin-right: 12px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.md-checkbox:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 78, 0, 0.3);
    transform: translateY(-2px);
    color: #FFFFFF;
}

.md-checkbox:has(input:checked) {
    background: rgba(255, 78, 0, 0.08);
    border-color: var(--md-sys-color-primary);
    color: #FFFFFF;
    box-shadow: 0 4px 15px rgba(255, 78, 0, 0.12);
}

.md-checkbox input:checked ~ .checkmark {
    background-color: var(--md-sys-color-primary);
    border-color: var(--md-sys-color-primary);
    box-shadow: 0 0 8px rgba(255, 78, 0, 0.4);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 4px;
    top: 1px;
    width: 3px;
    height: 6px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.md-checkbox input:checked ~ .checkmark:after {
    display: block;
}

/* ==========================================================================
   Auth View
   ========================================================================== */
#auth-view {
    background-color: var(--md-sys-color-surface-container);
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 24px 0;
    box-sizing: border-box;
}
#auth-view.active {
    display: flex;
}

.auth-card {
    width: 90%;
    max-width: 400px;
    padding: 20px 24px;
}

.auth-card .input-field {
    margin-bottom: 14px;
}

.auth-card .error-msg {
    margin-bottom: 8px;
}

.auth-header {
    text-align: center;
    margin-bottom: 16px;
}
.auth-header .logo-icon {
    font-size: 38px;
    color: var(--md-sys-color-primary);
}
.auth-header h1 {
    font-size: 21px;
    margin-top: 4px;
}
.auth-header p {
    color: var(--md-sys-color-secondary-text);
    font-size: 13px;
}

.auth-tabs {
    display: flex;
    border-bottom: 1px solid rgba(0,0,0,0.12);
    margin-bottom: 18px;
}

.auth-tabs .tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--md-sys-color-secondary-text);
    cursor: pointer;
    position: relative;
}

.auth-tabs .tab-btn.active {
    color: var(--md-sys-color-primary);
}

.auth-tabs .tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--md-sys-color-primary);
}

.error-msg {
    color: var(--md-sys-color-error);
    font-size: 12px;
    min-height: 18px;
    margin-bottom: 16px;
    text-align: center;
}

/* ==========================================================================
   History List
   ========================================================================== */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    background-color: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--md-sys-elevation-1);
}

.history-item:hover {
    border-color: rgba(255, 78, 0, 0.25);
    box-shadow: var(--md-sys-elevation-2);
    transform: translateY(-2px);
}

.history-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0; /* permite que os filhos flex (.history-info) encolham em vez de estourar a linha */
}

.history-icon-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 78, 0, 0.15) 0%, rgba(255, 160, 0, 0.05) 100%);
    border: 1px solid rgba(255, 78, 0, 0.25);
    color: var(--md-sys-color-primary);
    flex-shrink: 0;
}
.history-icon-badge span {
    font-size: 24px;
}

.history-info {
    min-width: 0; /* permite encolher/quebrar em vez de estourar a linha (item flex) */
}

.history-info h4 {
    font-size: 18px;
    font-weight: 700;
    color: var(--md-sys-color-on-surface);
    margin-bottom: 6px;
    letter-spacing: -0.3px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.history-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(245, 240, 238, 0.65);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 6px 12px;
    border-radius: 8px;
    line-height: 1;
}
.meta-item span.material-symbols-outlined {
    font-size: 16px;
    color: rgba(245, 240, 238, 0.5);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.meta-item.cost {
    background: rgba(76, 175, 80, 0.06);
    border-color: rgba(76, 175, 80, 0.15);
    color: #81C784;
}
.meta-item.cost span.material-symbols-outlined {
    color: #81C784;
}

.history-actions {
    display: flex;
    gap: 10px;
}

/* Specific button hovers in history actions */
.history-actions .view-btn:hover {
    color: var(--md-sys-color-primary);
    border-color: rgba(255, 78, 0, 0.3);
    background: rgba(255, 78, 0, 0.08);
}
.history-actions .edit-btn:hover {
    color: #4fc3f7;
    border-color: rgba(79, 195, 247, 0.3);
    background: rgba(79, 195, 247, 0.08);
}
.history-actions .delete-btn:hover {
    color: var(--md-sys-color-error);
    border-color: rgba(207, 102, 121, 0.4);
    background: rgba(207, 102, 121, 0.1);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: rgba(245, 240, 238, 0.5);
    font-size: 15px;
    font-weight: 500;
    border: 2px dashed rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.01);
}

/* ==========================================================================
   Modal Dialog
   ========================================================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: safe center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.modal.active {
    display: flex;
    animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-surface {
    width: 100%;
    max-width: 540px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    background: #161211;
    border: 1px solid var(--md-sys-color-outline);
    box-shadow: var(--md-sys-elevation-3);
    border-radius: 20px;
    overflow: hidden;
    animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
    from { transform: translateY(20px); }
    to { transform: translateY(0); }
}

.modal-header {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--md-sys-color-outline);
    background: rgba(255, 78, 0, 0.03);
}
.modal-header h2 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--md-sys-color-on-surface);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    color: var(--md-sys-color-on-surface);
}

/* Mantém o total/total-por-pessoa sempre visível, grudado no rodapé do modal,
   mesmo com uma lista de compras longa demais para caber sem rolar. */
.modal-totais-fixos {
    position: sticky;
    bottom: -24px;
    margin: 0 -24px -24px -24px;
    padding: 0 24px 24px 24px;
    background: #161211;
    z-index: 2;
}

body.light-theme .modal-totais-fixos {
    background: #FFFFFF;
}

.modal-footer {
    padding: 16px 24px;
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid var(--md-sys-color-outline);
    background: rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Modais de Confirmação (ícone central + texto) — Sair, Excluir Evento, Excluir Conta
   ========================================================================== */
.confirm-modal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
}

.confirm-icon-badge {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-primary);
    margin-bottom: 12px;
    flex-shrink: 0;
}

.confirm-icon-badge .material-symbols-outlined {
    font-size: 32px;
}

.confirm-icon-badge.danger {
    background: rgba(207, 102, 121, 0.15);
    color: var(--md-sys-color-error);
}

.confirm-modal-text {
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 8px 0;
    color: rgba(245, 240, 238, 0.85);
}
body.light-theme .confirm-modal-text {
    color: rgba(31, 27, 26, 0.85);
}

.confirm-modal-body .input-field {
    width: 100%;
    text-align: left;
    margin-top: 8px;
}

.item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 14px;
    font-weight: 500;
    color: rgba(245, 240, 238, 0.9);
}

.item-row b {
    color: var(--md-sys-color-primary);
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 20px 0 8px 0;
    font-weight: 800;
    font-size: 22px;
    letter-spacing: -0.5px;
    color: #FFFFFF;
    border-top: 2px solid rgba(255, 78, 0, 0.2);
    margin-top: 16px;
}

.total-row span:last-child {
    background: var(--md-sys-color-primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ==========================================================================
   Light Theme Overrides
   ========================================================================== */
body.light-theme {
    /* Color Palette - Premium Warm Light Mode */
    --md-sys-color-primary: #D84315; /* Warm churrasco orange */
    --md-sys-color-primary-gradient: linear-gradient(135deg, #D84315 0%, #FF5722 100%);
    --md-sys-color-on-primary: #FFFFFF;
    --md-sys-color-primary-container: #FFDBCF;
    --md-sys-color-on-primary-container: #3B0900;
    
    --md-sys-color-surface: #FFFFFF;
    --md-sys-color-on-surface: #1F1B1A;
    --md-sys-color-surface-container: #F6F1EE; /* Soft warm grey background */
    
    --md-sys-color-background: #FDFBFA;
    --md-sys-color-on-background: #1F1B1A;
    
    --md-sys-color-outline: rgba(0, 0, 0, 0.08);
    --md-sys-color-secondary-text: rgba(31, 27, 26, 0.6);
    --md-sys-color-error: #BA1A1A;

    /* Elevations (Shadows) - Soft Light mode shadows */
    --md-sys-elevation-1: 0 2px 8px rgba(0, 0, 0, 0.06);
    --md-sys-elevation-2: 0 4px 16px rgba(0, 0, 0, 0.1);
    --md-sys-elevation-3: 0 8px 32px rgba(0, 0, 0, 0.15), 0 0 1px rgba(0, 0, 0, 0.05) inset;
}

/* Specific Light Theme Component Adjustments */
body.light-theme .top-app-bar {
    background: rgba(253, 251, 250, 0.8);
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

body.light-theme .top-app-bar .icon-btn {
    color: var(--md-sys-color-on-surface);
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.06);
}
body.light-theme .top-app-bar .icon-btn:hover {
    background: rgba(216, 67, 21, 0.08);
    color: var(--md-sys-color-primary);
    border-color: rgba(216, 67, 21, 0.2);
}

body.light-theme .icon-btn {
    color: rgba(31, 27, 26, 0.7);
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.06);
}
body.light-theme .icon-btn:hover {
    background-color: rgba(0, 0, 0, 0.06);
    color: var(--md-sys-color-primary);
    border-color: rgba(0, 0, 0, 0.12);
}

body.light-theme .navigation-drawer {
    background: rgba(253, 251, 250, 0.95);
    border-right-color: rgba(0, 0, 0, 0.06);
}

body.light-theme .drawer-header {
    background: linear-gradient(135deg, rgba(216, 67, 21, 0.1) 0%, rgba(216, 67, 21, 0.02) 100%);
    color: var(--md-sys-color-on-surface);
}

body.light-theme .drawer-item {
    color: rgba(31, 27, 26, 0.7);
}
body.light-theme .drawer-item .material-symbols-outlined {
    color: rgba(31, 27, 26, 0.5);
}
body.light-theme .drawer-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.04);
}
body.light-theme .drawer-item.active {
    color: #FFFFFF;
}
body.light-theme .drawer-item.active .material-symbols-outlined {
    color: #FFFFFF;
}

body.light-theme .section-card {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.06);
}

body.light-theme .input-field label {
    color: rgba(31, 27, 26, 0.6);
}

body.light-theme .input-field input {
    background-color: #FFFFFF;
    border-color: rgba(0, 0, 0, 0.12);
    color: var(--md-sys-color-on-surface);
}
body.light-theme .input-field input:focus {
    background-color: #FFFFFF;
    border-color: var(--md-sys-color-primary);
    box-shadow: 0 0 0 3px rgba(216, 67, 21, 0.12);
}
body.light-theme .input-field input::placeholder {
    color: rgba(31, 27, 26, 0.4);
}

body.light-theme .md-checkbox {
    background: rgba(0, 0, 0, 0.015);
    border-color: rgba(0, 0, 0, 0.05);
    color: rgba(31, 27, 26, 0.8);
}
body.light-theme .md-checkbox:hover {
    background: rgba(0, 0, 0, 0.035);
    border-color: rgba(216, 67, 21, 0.2);
    color: var(--md-sys-color-primary);
}
body.light-theme .md-checkbox:has(input:checked) {
    background: rgba(216, 67, 21, 0.06);
    border-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-primary);
}
body.light-theme .checkmark {
    border-color: rgba(0, 0, 0, 0.25);
}

body.light-theme .history-item {
    border-color: rgba(0, 0, 0, 0.06);
}
body.light-theme .history-item:hover {
    border-color: rgba(216, 67, 21, 0.2);
}
body.light-theme .history-info p {
    color: rgba(31, 27, 26, 0.55);
}

body.light-theme .meta-item {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.04);
    color: rgba(31, 27, 26, 0.65);
}
body.light-theme .meta-item span.material-symbols-outlined {
    color: rgba(31, 27, 26, 0.4);
}
body.light-theme .meta-item.cost {
    background: rgba(76, 175, 80, 0.08);
    border-color: rgba(76, 175, 80, 0.2);
    color: #2E7D32;
}
body.light-theme .meta-item.cost span.material-symbols-outlined {
    color: #2E7D32;
}

body.light-theme .history-actions .icon-btn {
    border-color: rgba(0, 0, 0, 0.06);
    background: rgba(0, 0, 0, 0.01);
    color: rgba(31, 27, 26, 0.7);
}
body.light-theme .history-actions .icon-btn:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--md-sys-color-on-surface);
}
body.light-theme .history-actions .view-btn:hover {
    color: var(--md-sys-color-primary);
    border-color: rgba(216, 67, 21, 0.25);
    background: rgba(216, 67, 21, 0.06);
}
body.light-theme .history-actions .edit-btn:hover {
    color: #0288d1;
    border-color: rgba(2, 136, 209, 0.25);
    background: rgba(2, 136, 209, 0.06);
}
body.light-theme .history-actions .delete-btn:hover {
    color: var(--md-sys-color-error);
    border-color: rgba(186, 26, 26, 0.25);
    background: rgba(186, 26, 26, 0.06);
}

body.light-theme .modal-surface {
    background: #FFFFFF;
    border-color: rgba(0, 0, 0, 0.08);
}
body.light-theme .modal-header {
    background: rgba(216, 67, 21, 0.02);
}
body.light-theme .item-row {
    border-bottom-color: rgba(0, 0, 0, 0.05);
    color: var(--md-sys-color-on-surface);
}
body.light-theme .total-row {
    color: var(--md-sys-color-on-surface);
}

body.light-theme .empty-state {
    color: rgba(31, 27, 26, 0.5);
    border-color: rgba(0, 0, 0, 0.06);
    background: rgba(0, 0, 0, 0.005);
}

/* ==========================================================================
   Theme Toggle Switch (Chavezinha)
   ========================================================================== */
.theme-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 32px;
    flex-shrink: 0;
}

.theme-switch input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: .4s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    overflow: hidden;
    pointer-events: none; /* Let clicks pass through to the input */
}

.slider::before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 3px;
    bottom: 3px;
    background-color: #FFFFFF;
    transition: .4s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    z-index: 2;
}

/* Icons inside the switch */
.slider .material-symbols-outlined {
    font-size: 14px;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    user-select: none;
    z-index: 1;
    transition: opacity 0.3s;
}

.slider .icon-sun {
    color: #FFA000;
    opacity: 0.3;
}

.slider .icon-moon {
    color: #FF4E00;
    opacity: 1;
}

/* Checked (Light Mode) State */
.theme-switch input:checked + .slider {
    background-color: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}

.theme-switch input:checked + .slider::before {
    transform: translateX(28px);
    background-color: #D84315;
    box-shadow: 0 2px 6px rgba(216, 67, 21, 0.3);
}

.theme-switch input:checked + .slider .icon-sun {
    opacity: 1;
}

.theme-switch input:checked + .slider .icon-moon {
    opacity: 0.3;
    color: rgba(31, 27, 26, 0.4);
}

/* Light Theme overrides for switch hover and slider default */
body.light-theme .slider {
    background-color: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}
body.light-theme .slider::before {
    background-color: #D84315;
}

/* ==========================================================================
   Mobile Responsiveness Improvements (Screen widths <= 600px)
   ========================================================================== */
@media (max-width: 600px) {
    /* Main Content Padding & Margins */
    .content-section {
        padding: 16px 10px;
        padding-bottom: 140px;
    }

    .page-header {
        margin: 16px 0 24px 0;
    }

    .page-header h2 {
        font-size: 26px;
    }

    .page-header .subtitle {
        font-size: 14px;
    }

    /* Cards */
    .material-card {
        padding: 16px;
        margin-bottom: 16px;
        border-radius: 12px;
    }

    .card-title {
        font-size: 16px;
        margin-bottom: 16px;
    }

    /* Top App Bar Sizing & Padding */
    .top-app-bar {
        height: calc(64px + env(safe-area-inset-top));
        padding: env(safe-area-inset-top) 12px 0 12px;
    }

    .main-content {
        height: calc(100vh - 64px - env(safe-area-inset-top));
        height: calc(100dvh - 64px - env(safe-area-inset-top));
    }

    .app-title {
        font-size: 20px;
    }

    /* Menu Lateral (Drawer) Mobile adjustments */
    .navigation-drawer {
        width: 280px;
        left: -280px;
    }
    .navigation-drawer.open {
        left: 0;
    }

    /* Checkbox Grids */
    .checkbox-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 8px;
    }

    .md-checkbox {
        padding: 12px 12px; /* tap target mínimo recomendado (44x44px) */
        font-size: 13px;
        border-radius: 10px;
    }

    .checkmark {
        width: 14px;
        height: 14px;
        margin-right: 8px;
    }

    .checkmark:after {
        left: 3px;
        top: 0px;
        width: 2px;
        height: 5px;
    }

    /* History list and history items */
    .history-item {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding: 16px;
        border-radius: 12px;
    }

    .history-left {
        gap: 12px;
        align-items: flex-start;
    }

    .history-icon-badge {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .history-icon-badge span {
        font-size: 20px;
    }

    .history-info h4 {
        font-size: 16px;
        margin-bottom: 4px;
    }

    .history-meta {
        gap: 6px;
    }

    .meta-item {
        font-size: 12px;
        padding: 4px 8px;
        border-radius: 6px;
    }

    .meta-item span.material-symbols-outlined {
        font-size: 14px;
    }

    .history-actions {
        justify-content: flex-end;
        border-top: 1px solid var(--md-sys-color-outline);
        padding-top: 12px;
        margin-top: 4px;
        gap: 8px;
    }

    .history-actions .icon-btn {
        width: 44px;
        height: 44px;
        border-radius: 10px;
    }

    /* Modal Mobile Adjustments */
    .modal-surface {
        max-height: 90vh;
        max-height: 90dvh;
        border-radius: 16px;
    }

    .modal-header {
        padding: 16px;
    }

    .modal-header h2 {
        font-size: 18px;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-totais-fixos {
        bottom: -16px;
        margin: 0 -16px -16px -16px;
        padding: 0 16px 16px 16px;
    }

    .modal-footer {
        padding: 16px;
        flex-direction: column;
        gap: 12px;
    }
    
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }

    .item-row {
        padding: 8px 0;
        font-size: 13px;
    }

    .total-row {
        font-size: 18px;
        padding: 12px 0 4px 0;
        margin-top: 12px;
    }

    /* Home Section (Dashboard) Mobile Customizations */
    .home-hero-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 24px 20px;
    }
    
    .home-hero-banner h2 {
        font-size: 22px;
    }
    
    .hero-subtitle {
        font-size: 13.5px;
    }

    .home-metrics-row {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        margin-bottom: 20px;
    }

    .metric-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 12px 6px;
        gap: 6px;
        border-radius: 12px;
    }

    .metric-icon {
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }

    .metric-icon span {
        font-size: 18px;
    }

    .metric-info {
        gap: 2px;
    }

    .metric-label {
        font-size: 9px;
        letter-spacing: 0.2px;
    }

    .metric-value {
        font-size: 14px;
    }

    .home-card-premium {
        min-height: auto;
        padding: 18px;
        border-radius: 16px;
    }

    .home-card-body {
        margin-bottom: 12px;
        gap: 12px;
    }

    .home-card-icon-wrapper {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .home-card-icon-wrapper span {
        font-size: 20px;
    }

    .home-card-text h3 {
        font-size: 16px;
    }

    .home-card-text p {
        font-size: 12.5px;
    }

    .recent-activity-item {
        padding: 12px 14px;
        border-radius: 12px;
    }

    .activity-icon-indicator {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }

    .activity-icon-indicator span {
        font-size: 16px;
    }

    .activity-details h4 {
        font-size: 14px;
    }

    .activity-details span {
        font-size: 11px;
    }

    .activity-cost {
        font-size: 14px;
    }
}

/* Extra small screen optimizations */
@media (max-width: 400px) {
    .top-app-bar {
        padding: env(safe-area-inset-top) 8px 0 8px;
    }

    .app-title {
        font-size: 18px;
        margin-left: 4px;
        gap: 6px;
    }

    .app-title .material-symbols-outlined {
        font-size: 22px;
    }

    .guests-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .history-info h4 {
        font-size: 15px;
    }

    .meta-item {
        font-size: 11px;
        padding: 3px 6px;
    }
}

/* ==========================================================================
   Home Section (Premium SaaS Dashboard Design)
   ========================================================================== */

/* Hero Banner */
.home-hero-banner {
    background: linear-gradient(135deg, rgba(255, 78, 0, 0.15) 0%, rgba(255, 160, 0, 0.03) 100%);
    border: 1px solid rgba(255, 78, 0, 0.15);
    border-radius: 20px;
    padding: 32px 28px;
    margin-bottom: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--md-sys-elevation-2);
}

.home-hero-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(255, 78, 0, 0.2) 0%, transparent 70%);
    filter: blur(40px);
    pointer-events: none;
}

.hero-content {
    flex: 1;
    z-index: 1;
}

.home-hero-banner h2 {
    font-size: 28px;
    font-weight: 850;
    letter-spacing: -0.8px;
    background: var(--md-sys-color-primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.hero-subtitle {
    font-size: 15px;
    color: var(--md-sys-color-secondary-text);
    max-width: 500px;
    line-height: 1.6;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 160, 0, 0.15);
    border: 1px solid rgba(255, 160, 0, 0.3);
    color: #FFB300;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
    z-index: 1;
}

.hero-badge span.material-symbols-outlined {
    font-size: 16px;
}

/* Subtitles */
.section-subtitle {
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(245, 240, 238, 0.45);
    margin: 32px 0 16px 0;
}

/* Metrics Dashboard */
.home-metrics-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

@media (max-width: 768px) {
    .home-metrics-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.metric-card {
    background-color: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--md-sys-elevation-1);
}

.metric-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 78, 0, 0.2);
    box-shadow: var(--md-sys-elevation-2);
}

.metric-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background-color: rgba(255, 78, 0, 0.12);
    color: var(--md-sys-color-primary);
    border: 1px solid rgba(255, 78, 0, 0.2);
    flex-shrink: 0;
}

.metric-icon.green {
    background-color: rgba(76, 175, 80, 0.12);
    color: #81C784;
    border-color: rgba(76, 175, 80, 0.2);
}

.metric-icon.blue {
    background-color: rgba(3, 169, 244, 0.12);
    color: #4fc3f7;
    border-color: rgba(3, 169, 244, 0.2);
}

.metric-icon span {
    font-size: 22px;
}

.metric-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.metric-label {
    font-size: 11px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--md-sys-color-secondary-text);
}

.metric-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--md-sys-color-on-surface);
    letter-spacing: -0.5px;
}

/* Quick Access Cards */
.home-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 600px) {
    .home-menu-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

.home-card-premium {
    background: rgba(22, 18, 17, 0.4);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    min-height: 180px;
    box-shadow: var(--md-sys-elevation-1);
    position: relative;
    overflow: hidden;
}

.home-card-premium::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(255, 78, 0, 0.05) 0%, transparent 70%);
    filter: blur(20px);
    transition: transform 0.4s ease;
    pointer-events: none;
}

.home-card-premium:hover::after {
    transform: scale(1.3);
}

.home-card-premium.new-churras:hover {
    border-color: rgba(255, 78, 0, 0.35);
    box-shadow: var(--md-sys-elevation-2), 0 0 25px rgba(255, 78, 0, 0.08);
    transform: translateY(-4px);
}

.home-card-premium.view-history:hover {
    border-color: rgba(255, 160, 0, 0.35);
    box-shadow: var(--md-sys-elevation-2), 0 0 25px rgba(255, 160, 0, 0.08);
    transform: translateY(-4px);
}

.home-card-body {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

@media (max-width: 440px) {
    .home-card-body {
        flex-direction: column;
        gap: 12px;
    }
}

.home-card-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 78, 0, 0.12);
    color: var(--md-sys-color-primary);
    border: 1px solid rgba(255, 78, 0, 0.2);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.view-history .home-card-icon-wrapper {
    background: rgba(255, 160, 0, 0.12);
    color: #FFB300;
    border-color: rgba(255, 160, 0, 0.2);
}

.home-card-premium:hover .home-card-icon-wrapper {
    transform: scale(1.1) rotate(5deg);
}

.home-card-text {
    flex: 1;
}

.home-card-text h3 {
    font-size: 18px;
    font-weight: 750;
    color: var(--md-sys-color-on-surface);
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.home-card-text p {
    font-size: 13.5px;
    color: var(--md-sys-color-secondary-text);
    line-height: 1.5;
}

.home-card-action {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--md-sys-color-primary);
    transition: gap 0.2s ease;
}

.view-history .home-card-action {
    color: #FFB300;
}

.home-card-premium:hover .home-card-action {
    gap: 10px;
}

.home-card-action span.material-symbols-outlined {
    font-size: 16px;
}

/* Recent Activity Section */
.home-recent-activity {
    margin-top: 36px;
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.activity-header h3 {
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(245, 240, 238, 0.45);
}

.recent-list-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recent-activity-item {
    background: rgba(22, 18, 17, 0.3);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.recent-activity-item:hover {
    background: rgba(22, 18, 17, 0.6);
    border-color: rgba(255, 78, 0, 0.2);
    transform: translateX(4px);
}

.activity-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.activity-icon-indicator {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 78, 0, 0.08);
    color: var(--md-sys-color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon-indicator span {
    font-size: 18px;
}

.activity-details h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--md-sys-color-on-surface);
    margin-bottom: 2px;
}

.activity-details span {
    font-size: 12px;
    color: var(--md-sys-color-secondary-text);
}

.activity-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.activity-cost {
    font-size: 15px;
    font-weight: 750;
    color: #81C784;
}

.activity-right span.chevron {
    font-size: 18px;
    color: rgba(245, 240, 238, 0.3);
    transition: transform 0.2s ease, color 0.2s ease;
}

.recent-activity-item:hover .chevron {
    transform: translateX(2px);
    color: var(--md-sys-color-primary);
}

.recent-empty-state {
    text-align: center;
    padding: 36px 20px;
    color: rgba(245, 240, 238, 0.4);
    font-size: 14px;
    border: 1px dashed var(--md-sys-color-outline);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.recent-empty-state span {
    font-size: 32px;
    color: rgba(245, 240, 238, 0.2);
}

/* Light Theme Overrides for Dashboard */
body.light-theme .home-hero-banner {
    background: linear-gradient(135deg, rgba(216, 67, 21, 0.08) 0%, rgba(216, 67, 21, 0.02) 100%);
    border-color: rgba(216, 67, 21, 0.12);
}

body.light-theme .home-hero-banner h2 {
    background: var(--md-sys-color-primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.light-theme .hero-badge {
    background: rgba(255, 160, 0, 0.1);
    border-color: rgba(255, 160, 0, 0.2);
    color: #B26A00;
}

body.light-theme .section-subtitle,
body.light-theme .activity-header h3 {
    color: rgba(31, 27, 26, 0.5);
}

body.light-theme .home-card-premium {
    background: #FFFFFF;
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .home-card-premium.new-churras:hover {
    border-color: rgba(216, 67, 21, 0.3);
    box-shadow: var(--md-sys-elevation-2), 0 0 25px rgba(216, 67, 21, 0.06);
}

body.light-theme .home-card-premium.view-history:hover {
    border-color: rgba(255, 160, 0, 0.35);
    box-shadow: var(--md-sys-elevation-2), 0 0 25px rgba(255, 160, 0, 0.06);
}

body.light-theme .recent-activity-item {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.06);
}

body.light-theme .recent-activity-item:hover {
    background: #FFFFFF;
    border-color: rgba(216, 67, 21, 0.2);
}

body.light-theme .activity-icon-indicator {
    background: rgba(216, 67, 21, 0.06);
}

body.light-theme .activity-cost {
    color: #2E7D32;
}

body.light-theme .recent-empty-state {
    border-color: rgba(0, 0, 0, 0.08);
    color: rgba(31, 27, 26, 0.4);
}

/* Password Visibility Toggle */
.password-input-wrapper {
    position: relative;
    width: 100%;
}

.password-input-wrapper input {
    padding-right: 52px;
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(245, 240, 238, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px; /* tap target ~44x44px */
    border-radius: 50%;
    transition: color 0.2s, background-color 0.2s;
}

.password-toggle-btn:hover {
    color: var(--md-sys-color-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.light-theme .password-toggle-btn {
    color: rgba(22, 18, 17, 0.4);
}

.light-theme .password-toggle-btn:hover {
    color: var(--md-sys-color-primary);
    background-color: rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

@media (max-width: 600px) {
    .toast-container {
        top: auto;
        bottom: calc(24px + env(safe-area-inset-bottom));
        left: 24px;
        right: 24px;
    }
}

.toast {
    pointer-events: auto;
    min-width: 280px;
    max-width: 380px;
    padding: 16px 20px;
    border-radius: 14px;
    background: rgba(22, 18, 17, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--md-sys-color-outline);
    box-shadow: var(--md-sys-elevation-3);
    color: var(--md-sys-color-on-surface);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.toast-message {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

/* Toast Success Styles */
.toast.success {
    border-color: rgba(76, 175, 80, 0.3);
    background: rgba(22, 18, 17, 0.9);
}
.toast.success .toast-icon {
    color: #81C784;
}

/* Toast Error Styles */
.toast.error {
    border-color: rgba(207, 102, 121, 0.3);
    background: rgba(22, 18, 17, 0.9);
}
.toast.error .toast-icon {
    color: var(--md-sys-color-error);
}

/* Light theme overrides for toast */
.light-theme .toast {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.08);
}
.light-theme .toast.success {
    border-color: rgba(76, 175, 80, 0.2);
}
.light-theme .toast.error {
    border-color: rgba(207, 102, 121, 0.2);
}

/* ==========================================================================
   Details Modal Division by Person
   ========================================================================== */
.per-person-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0 8px 0;
    margin-top: 8px;
    font-weight: 700;
    font-size: 16px;
    color: var(--md-sys-color-secondary-text);
    border-top: 1px dashed var(--md-sys-color-outline);
}

.per-person-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.child-toggle-btn {
    background: rgba(255, 78, 0, 0.05); /* subtle tint */
    border: 2px solid var(--md-sys-color-outline);
    border-radius: 50%;
    width: 44px; /* tap target mínimo recomendado (44x44px) */
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(245, 240, 238, 0.6);
    transition: all 0.25s ease;
    position: relative;
}

.child-toggle-btn .material-symbols-outlined {
    font-size: 20px; /* larger icon */
    /* Contém qualquer fallback de texto do ícone (ex: "child_care") caso a fonte
       remota do Google falhe/demore — sem isso, o texto estouraria o círculo de 44px.
       Escopado só ao ícone (não a qualquer <span>) para não afetar o texto
       "Meio dia/Noite" do botão de turno, que reusa essa mesma classe de botão. */
    display: inline-block;
    width: 22px;
    height: 22px;
    overflow: hidden;
    text-align: center;
}

.child-toggle-btn:hover {
    color: var(--md-sys-color-primary);
    border-color: var(--md-sys-color-primary);
    background-color: rgba(255, 78, 0, 0.15);
    box-shadow: 0 0 8px rgba(255, 78, 0, 0.3);
}

.child-toggle-btn.active {
    color: #FFFFFF;
    background-color: var(--md-sys-color-primary);
    border-color: var(--md-sys-color-primary);
    box-shadow: 0 2px 12px rgba(255, 78, 0, 0.4);
}

/* Tooltip Custom styling on Hover */
.child-toggle-btn[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    max-width: 160px;
    width: max-content;
    white-space: normal;
    overflow-wrap: break-word;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 1001;
}

/* :active cobre o toque em telas touch, já que :hover não é confiável nelas */
.child-toggle-btn[data-tooltip]:hover::before,
.child-toggle-btn[data-tooltip]:active::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Light Theme overrides for modal division */
.light-theme .per-person-row {
    color: var(--md-sys-color-secondary-text);
}
.light-theme .child-toggle-btn {
    color: rgba(31, 27, 26, 0.4);
}
.light-theme .child-toggle-btn:hover {
    color: var(--md-sys-color-primary);
    background-color: rgba(216, 67, 21, 0.08);
    border-color: var(--md-sys-color-primary);
}
.light-theme .child-toggle-btn.active {
    color: #FFFFFF;
    background-color: var(--md-sys-color-primary);
    border-color: var(--md-sys-color-primary);
}





