:root {
    /* TEMA CLARO (Padrão) */
    --primary: #2c3e50;
    --secondary: #4a9fbf;
    --bg: #f4f7f6;
    --card-bg: #ffffff;
    --text: #333;
    --danger: #e74c3c;
    --folga: #ffffff;
    --ok: #daf0f7;
    --puxado: #fdebd0;
    --sofrimento: #ebdef0;
    --upa: #ebdef0;
    --ubs: #d6eaf8;
    --border-color: #eee;
    --btn-bg: #ddd;
    --input-bg: #fff;
    --text-secondary: #7f8c8d;
}

/* TEMA ESCURO (Dark Mode) */
body.dark-mode {
    --primary: #64b5f6;
    --secondary: #5bb5d5;
    --bg: #121212;
    --card-bg: #1e1e1e;
    --text: #e0e0e0;
    --danger: #ff5252;
    --folga: #1e1e1e;
    --ok: #0d2a3b;
    --puxado: #4a330e;
    --sofrimento: #361b3d;
    --upa: #361b3d;
    --ubs: #0d2a3b;
    --border-color: #333;
    --btn-bg: #333;
    --input-bg: #2c2c2c;
    --text-secondary: #95a5a6;
}

/* APLICANDO A FONTE INTER PARA TUDO */
* {
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    transition: background-color 0.3s, color 0.3s;
}

body {
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    font-size: 14.5px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app-container,
#tela-diaria {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
    padding-top: 55px;
    display: none;
}

/* --- BOTÕES FLUTUANTES NO TOPO --- */
/* === Perfil Menu === */
#perfil-container {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 10px);
    left: 10px;
    z-index: 10001;
}

#btn-perfil {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--btn-bg);
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    position: relative;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#btn-perfil img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

#perfil-iniciais {
    display: none;
    font-size: 0.85em;
    font-weight: bold;
    color: #fff;
}

#btn-perfil img[src=""] {
    display: none;
}

#btn-perfil img[src=""]+#perfil-iniciais {
    display: flex;
}

.perfil-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #e74c3c;
    color: #fff;
    font-size: 0.65em;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    animation: badgePulse 0.3s ease;
}

@keyframes badgePulse {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}

/* Dropdown */
.perfil-dropdown {
    position: absolute;
    top: 48px;
    left: 0;
    min-width: 260px;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transform-origin: top left;
    transform: scaleY(0);
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
    pointer-events: none;
    border: 1px solid var(--border-color);
}

.perfil-dropdown.aberto {
    transform: scaleY(1);
    opacity: 1;
    pointer-events: all;
}

.perfil-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-foto {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.dropdown-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.dropdown-user-info strong {
    font-size: 0.95em;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-user-info small {
    font-size: 0.75em;
    color: #7f8c8d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.perfil-dropdown-body {
    padding: 8px;
}

.perfil-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 14px;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    border-radius: 10px;
    transition: background 0.15s ease;
    text-align: left;
}

.perfil-dropdown-item:hover {
    background: var(--btn-bg);
}

.perfil-dropdown-item.item-sair:hover {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
}

/* Dark mode: garantir legibilidade do dropdown */
body.dark-mode .perfil-dropdown {
    background: #1e1e1e;
    border-color: #444;
}

body.dark-mode .perfil-dropdown-item {
    color: #e0e0e0;
}

body.dark-mode .perfil-dropdown-header {
    border-bottom-color: #333;
}

body.dark-mode .dropdown-user-info strong {
    color: #e0e0e0;
}

body.dark-mode .dropdown-user-info small {
    color: #95a5a6;
}

.dropdown-badge {
    background: #e74c3c;
    color: #fff;
    font-size: 0.7em;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

/* === Inbox de Notificações === */
.inbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10010;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.inbox-panel {
    background: var(--card-bg);
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.inbox-header {
    display: flex;
    flex-direction: column;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    gap: 10px;
}

.inbox-header h3 {
    margin: 0;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.inbox-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.inbox-tabs {
    display: flex;
    background: var(--bg);
    border-radius: 12px;
    padding: 3px;
    gap: 2px;
}

.inbox-group {
    margin-bottom: 8px;
    border-radius: 12px;
}

.inbox-group-header {
    padding: 10px 16px;
    font-weight: 600;
    font-size: 0.82em;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--card-bg);
    border-radius: 12px;
    color: var(--text-secondary);
    user-select: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(128, 128, 128, 0.08);
}

.inbox-group[open]>.inbox-group-header {
    color: var(--primary);
    background: var(--card-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.inbox-group-header:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    color: var(--text);
}

.inbox-group-header::before {
    content: '▸';
    font-size: 1.2em;
    transition: transform 0.25s ease;
    display: inline-block;
    opacity: 0.5;
}

.inbox-group[open]>.inbox-group-header::before {
    transform: rotate(90deg);
    opacity: 0.8;
}

/* Hide default marker */
.inbox-group-header::-webkit-details-marker {
    display: none;
}

.inbox-tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.8em;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.inbox-tab.active {
    background: var(--card-bg);
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.inbox-btn-limpar,
.inbox-btn-ler,
.inbox-btn-config {
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8em;
    font-weight: 600;
    transition: background 0.15s;
    flex: 1;
    text-align: center;
}

.inbox-btn-limpar {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.inbox-btn-limpar:hover {
    background: rgba(231, 76, 60, 0.2);
}

.inbox-btn-config {
    background: rgba(149, 165, 166, 0.15);
    color: #7f8c8d;
}

.inbox-btn-config:hover {
    background: rgba(149, 165, 166, 0.3);
}

.inbox-btn-ler {
    background: rgba(39, 174, 96, 0.1);
    color: #27ae60;
}

.inbox-btn-ler:hover {
    background: rgba(39, 174, 96, 0.2);
}

.inbox-btn-fechar {
    background: var(--btn-bg);
    color: var(--text);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inbox-lista {
    overflow-y: auto;
    padding: 12px;
    flex: 1;
}

.inbox-item {
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--btn-bg);
    margin-bottom: 8px;
    transition: all 0.3s;
    border-left: 3px solid transparent;
    cursor: pointer;
    opacity: 0.55;
}

/* Não lida: negrito + borda azul + fundo highlight */
.inbox-item.inbox-nao-lida {
    border-left-color: var(--primary, #3498db);
    background: rgba(52, 152, 219, 0.12);
    opacity: 1;
}

.inbox-item.inbox-nao-lida .inbox-item-titulo {
    font-weight: 800;
    color: var(--text);
}

.inbox-item.inbox-nao-lida .inbox-item-corpo {
    font-weight: 600;
    color: var(--text-secondary, #555);
}

.inbox-item-titulo {
    font-weight: 400;
    font-size: 0.9em;
    color: var(--text-secondary, #7f8c8d);
    margin-bottom: 4px;
}

.inbox-item-corpo {
    font-size: 0.82em;
    color: #7f8c8d;
    line-height: 1.4;
    font-weight: 400;
}

.inbox-item-hora {
    font-size: 0.7em;
    color: #95a5a6;
}

.inbox-vazio {
    text-align: center;
    padding: 40px 20px;
    color: #95a5a6;
    font-size: 0.9em;
}

/* === Config Notificações (toggles) === */
.config-notif-body {
    padding: 16px 20px;
}

.config-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 0.9em;
    color: var(--text);
}

.config-toggle:last-child {
    border-bottom: none;
}

.config-toggle input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    width: 44px;
    height: 24px;
    background: #ccc;
    border-radius: 12px;
    position: relative;
    transition: background 0.25s;
    flex-shrink: 0;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.25s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.config-toggle input:checked+.toggle-slider {
    background: var(--primary);
}

.config-toggle input:checked+.toggle-slider::after {
    transform: translateX(20px);
}

#btn-toggle-visibilidade {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 10px);
    right: 10px;
    z-index: 10001;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--btn-bg);
    color: var(--text);
    border: 2px solid transparent;
    font-weight: bold;
    cursor: pointer;
    display: none;
    font-size: 1.2em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    align-items: center;
    justify-content: center;
    padding: 0;
}

#btn-toggle-tema {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 10px);
    right: 60px;
    z-index: 10001;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--btn-bg);
    color: var(--text);
    border: 2px solid transparent;
    font-weight: bold;
    cursor: pointer;
    display: none;
    font-size: 1.2em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* --- MODO PRIVACIDADE (BLUR) --- */
.valor-financeiro,
.meta-valor,
.destaque-valor,
.total-loc,
.detalhes-loc strong,
.meta-msg,
#total-bruto,
#total-liquido,
#total-falta-receber,
#total-recebido,
#total-global-recebido,
#total-global-receber,
#total-global-anual,
.col-valor,
canvas:not(#game-hospital-canvas) {
    transition: filter 0.3s ease, opacity 0.3s ease;
}

body.ocultar-valores .valor-financeiro,
body.ocultar-valores .meta-valor,
body.ocultar-valores .destaque-valor,
body.ocultar-valores .total-loc,
body.ocultar-valores .detalhes-loc strong,
body.ocultar-valores .meta-msg,
body.ocultar-valores #total-bruto,
body.ocultar-valores #total-liquido,
body.ocultar-valores #total-falta-receber,
body.ocultar-valores #total-recebido,
body.ocultar-valores #total-global-recebido,
body.ocultar-valores #total-global-receber,
body.ocultar-valores #total-global-anual,
body.ocultar-valores .col-valor,
body.ocultar-valores canvas:not(#game-hospital-canvas) {
    filter: blur(6px);
    opacity: 0.4;
    user-select: none;
    pointer-events: none;
}

/* --- TELAS DE LOGIN --- */
#login-screen,
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    background: radial-gradient(circle at center, #1c1c1e 0%, #000 100%);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#login-box {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    padding: 40px;
    border-radius: 35px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    text-align: center;
    max-width: 400px;
    width: 90%;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

#login-logo {
    width: 140px;
    height: 140px;
    margin-bottom: 20px;
    object-fit: contain;
}

#login-box h1 {
    color: white;
    font-size: 2.2em;
    font-weight: 500;
    letter-spacing: -0.5px;
    margin-bottom: 40px;
}

.btn-google {
    background: #fff;
    color: #000;
    border: none;
    padding: 14px 25px;
    border-radius: 30px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    transition: 0.3s;
}

.btn-google:hover {
    background: #e5e5e5;
    transform: scale(1.02);
}

#login-error {
    color: #ff453a;
    font-weight: bold;
    margin-top: 20px;
    display: none;
    font-size: 0.9em;
}

/* --- TELA INICIAL --- */
#tela-diaria {
    text-align: center;
    padding-top: 55px !important;
}

.saudacao {
    font-size: 0.55em;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 2px;
}

.sub-saudacao {
    font-size: 0.45em;
    color: #7f8c8d;
    margin-bottom: 4px;
    letter-spacing: 1.5px;
    opacity: 0.65;
}

.home-widgets-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: flex-start;
    margin-bottom: 8px;
}

.clima-widget {
    display: inline-flex;
    align-items: center;
    background: #e0f7fa;
    color: #00796b;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.78em;
    white-space: nowrap;
    border: 1px solid transparent;
}

.fatigue-widget {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fef9e7;
    color: #7d6608;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.78em;
    border: 1px solid transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.2s ease;
}

body.dark-mode .fatigue-widget {
    background: #2b2500;
    color: #f0c040;
}

.fatigue-widget:active {
    transform: scale(0.96);
}

.fatigue-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.fatigue-header .fatigue-title {
    font-size: 0.78em;
    font-weight: bold;
}

.fatigue-header .fatigue-score-label {
    font-size: 0.78em;
    font-weight: bold;
}

.fatigue-bar-bg {
    width: 100%;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    height: 4px;
    overflow: hidden;
    margin-top: 3px;
}

body.dark-mode .fatigue-bar-bg {
    background: rgba(255, 255, 255, 0.15);
}

.fatigue-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #27ae60, #f39c12, #e74c3c);
    border-radius: 4px;
    transition: width 1s ease-out;
}

/* --- 7-DAY SUMMARY CARD --- */
.resumo-7dias-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    margin: 12px 0 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.resumo-7dias-card .resumo-linha {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.resumo-7dias-card .resumo-linha:last-child {
    border-bottom: none;
}

body.dark-mode .resumo-7dias-card .resumo-linha {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

.btn-expandir-painel {
    display: block;
    width: 100%;
    padding: 10px;
    margin: 6px 0 12px;
    background: var(--card-bg);
    border: 1px dashed var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-expandir-painel:hover {
    background: var(--hover-bg, rgba(0, 0, 0, 0.03));
    color: var(--primary);
}

body.dark-mode .clima-widget {
    background: #0b2b2b;
    color: var(--secondary);
    border-color: #114444;
}



.botoes-home {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.botoes-home button {
    margin-top: 0;
    width: auto;
    flex: 1;
    min-width: 200px;
    max-width: 300px;
    padding: 15px 20px;
    font-size: 1.1em;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

/* Botão agora nasce azul e com texto branco */
.entrar-sistema-btn {
    background-color: var(--primary) !important;
    border: 2px solid var(--primary);
    color: #fff !important;
}

/* Efeito suave ao clicar (feedback visual no celular) */
.entrar-sistema-btn:active {
    opacity: 0.8;
    transform: scale(0.98);
}

/*   body.dark-mode .entrar-sistema-btn { color: var(--primary); } */
/*   body.dark-mode .entrar-sistema-btn:hover { background-color: var(--primary); color: #000; } */

.btn-add-rapido {
    background-color: var(--secondary);
    color: white;
    border: 2px solid var(--secondary);
}

body.dark-mode .btn-add-rapido {
    color: #000;
}

/* CARDS HOJE / WAZE */
.card-plantao-hoje {
    background: linear-gradient(135deg, rgba(74, 159, 191, 0.85), rgba(61, 149, 179, 0.8));
    color: #fff;
    border-radius: 15px;
    padding: 25px 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 25px rgba(74, 159, 191, 0.35);
    text-align: left;
    transition: background 0.5s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: none;
}

.card-plantao-hoje.fim-expediente {
    background: linear-gradient(135deg, #b5ead7, #c1f0c1);
    box-shadow: 0 10px 20px rgba(181, 234, 215, 0.35);
    color: #1b6b3a;
}

.card-plantao-hoje.fim-expediente h3 {
    color: #1b6b3a;
}

.card-plantao-hoje.fim-expediente p {
    color: #1b6b3a;
}

/* Transito overrides for fim-expediente */
.card-plantao-hoje.fim-expediente .transito-grid {
    background: rgba(0, 0, 0, 0.06);
}

.card-plantao-hoje.fim-expediente .transito-item {
    border-right-color: rgba(0, 0, 0, 0.12);
}

.card-plantao-hoje.fim-expediente .transito-item span {
    color: #2c3e50;
}

.card-plantao-hoje.fim-expediente .transito-item strong,
.card-plantao-hoje.fim-expediente .transito-item strong span {
    color: #1b6b3a !important;
}

.card-plantao-hoje.fim-expediente #transito-tempo {
    color: #1b6b3a !important;
}

.card-plantao-hoje.fim-expediente .highlight {
    color: #1b6b3a !important;
}

.card-plantao-hoje h3 {
    margin: 0 0 10px 0;
    font-size: 1.5em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.destaque-valor {
    font-size: 1.4em;
    font-weight: 700;
    color: #ffd966;
    margin: 15px 0;
    display: block;
    text-shadow: none;
    -webkit-text-stroke: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.card-plantao-hoje.fim-expediente .destaque-valor {
    color: #2c3e50;
    text-shadow: none;
}

.endereco-casa {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 15px;
    display: block;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
    line-height: 1.5;
}

.card-plantao-hoje.fim-expediente .endereco-casa {
    color: #2c3e50;
    border-color: rgba(0, 0, 0, 0.12);
}

.transito-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
    background: rgba(0, 0, 0, 0.08);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    backdrop-filter: blur(6px);
}

.transito-item {
    border-right: 1px solid rgba(255, 255, 255, 0.3);
}

.transito-item:last-child {
    border-right: none;
}

.transito-item span {
    display: block;
    font-size: 0.7em;
    color: #a8d4e6;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.transito-item strong {
    font-size: 1.3em;
    font-weight: bold;
    color: #fff;
}

#transito-tempo {
    font-size: inherit;
    color: #fff;
}

.highlight {
    color: #ffd966 !important;
    font-size: 1.3em !important;
}

.waze-btn {
    display: inline-block;
    width: 100%;
    text-align: center;
    background: linear-gradient(135deg, #7ec8e3, #73c2d4);
    color: #1b3a4b;
    font-weight: bold;
    font-size: 1.1em;
    padding: 15px;
    border-radius: 25px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(126, 200, 227, 0.45);
    transition: all 0.25s ease;
    margin-top: 10px;
    border: none;
}

.waze-btn.btn-casa {
    background: linear-gradient(135deg, #6fc3a0, #5bb5a0);
    color: #1b3a4b;
    box-shadow: 0 4px 12px rgba(91, 181, 160, 0.4);
}

.waze-btn:active {
    transform: scale(0.97);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* --- AI SEND BUTTON (PASTEL) --- */
.ai-command-send {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px;
    border-radius: 50% !important;
    background: linear-gradient(135deg, rgba(126, 200, 227, 0.75), rgba(115, 194, 212, 0.7)) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    font-size: 1.15em !important;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(126, 200, 227, 0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.25s ease;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    margin: 0 !important;
}

.ai-command-send:active {
    transform: scale(0.92);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* --- BARRA GAMIFICADA --- */
.gamification-container {
    background: var(--card-bg);
    padding: 40px 20px 80px 20px;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
}

.timeline-title {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.timeline-wrapper {
    position: relative;
    width: 95%;
    height: 26px;
    background: var(--btn-bg);
    border-radius: 15px;
    margin: 0 auto;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.timeline-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 15px;
    background: linear-gradient(90deg, #2ecc71, #3498db);
    width: 0%;
    transition: width 1.5s ease-out;
}

.timeline-knob {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 38px;
    height: 38px;
    background: var(--primary);
    border: 4px solid var(--card-bg);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    transition: left 1.5s ease-out;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65em;
    font-weight: 800;
    color: var(--bg);
    text-shadow: none;
    pointer-events: none;
}

.gamification-container {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.timeline-marker {
    position: absolute;
    top: 0;
    height: 100%;
    z-index: 15;
}

.marker-icon {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2.3em;
    filter: grayscale(100%);
    transition: 0.3s;
    margin-bottom: 12px;
}

.timeline-marker.reached .marker-icon {
    filter: grayscale(0%);
    transform: translateX(-50%) scale(1.15);
}

.marker-text-box {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 15px;
    text-align: center;
    width: 100px;
}

.marker-label {
    font-size: 1.05em;
    font-weight: bold;
    color: var(--secondary);
}

.timeline-marker.reached .marker-label {
    color: var(--secondary);
}

.marker-data {
    font-size: 0.8em;
    color: #bdc3c7;
    display: block;
    margin-top: 2px;
}

@media (max-width: 600px) {
    .gamification-container {
        padding: 30px 15px 50px 15px;
    }

    .timeline-title {
        margin-bottom: 60px;
        font-size: 1.1em;
    }

    .marker-text-box {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        margin-top: 0 !important;
        background: var(--card-bg);
        padding: 2px 6px;
        border-radius: 6px;
        z-index: 20;
        width: auto;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    }

    .marker-label {
        font-size: 0.8em;
        color: var(--primary);
        font-weight: 800;
    }

    .marker-data {
        display: none;
    }

    .marker-icon {
        font-size: 1.4em;
        margin-bottom: 18px;
    }

    .saudacao {
        font-size: 1.35em !important;
        margin-bottom: 2px;
    }

    .sub-saudacao {
        font-size: 0.78em !important;
        font-weight: 500;
        letter-spacing: 0.5px;
        opacity: 0.8;
    }

    .clima-widget {
        font-size: 0.85em !important;
        padding: 6px 15px !important;
        margin-bottom: 20px;
    }

    .botoes-home {
        gap: 10px !important;
        margin-bottom: 20px !important;
    }

    .botoes-home button {
        padding: 12px 16px !important;
        font-size: 0.88em !important;
        font-weight: 600 !important;
        border-radius: 25px !important;
        margin-bottom: 0;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
        min-width: 0 !important;
        flex: 1 1 45% !important;
        max-width: 48% !important;
    }

    /* 3rd button (calendar) spans full width */
    .botoes-home button:last-child {
        flex: 1 1 100% !important;
        max-width: 100% !important;
    }

    /* Hide AI suggestions chips on mobile */
    #ai-sugestoes {
        display: none !important;
    }

    /* Calendar modal: restructure toolbar to avoid X overlap */
    #modal-calendario-view .modal-close {
        z-index: 100;
        font-size: 1.3em;
    }

    #calendar-modal-container {
        padding-top: 5px;
    }


    #calendar-modal-container .fc-header-toolbar {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 6px !important;
        margin-bottom: 0.5em !important;
    }

    /* Row 1: Title centered, full width */
    #calendar-modal-container .fc-toolbar-chunk:nth-child(2) {
        order: 1 !important;
        width: 100% !important;
        text-align: center !important;
        margin-bottom: 4px;
    }

    #calendar-modal-container .fc-toolbar-chunk:nth-child(2) .fc-toolbar-title {
        font-size: 1.1em !important;
        font-weight: 700;
    }

    /* Row 2: Nav arrows + Hoje (left group) */
    #calendar-modal-container .fc-toolbar-chunk:nth-child(1) {
        order: 2 !important;
        display: flex;
        align-items: center;
        gap: 4px;
    }

    /* Row 2: View buttons Mês/Semana/Turnos (right group) */
    #calendar-modal-container .fc-toolbar-chunk:nth-child(3) {
        order: 3 !important;
    }
}

.metas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 50px;
}

.meta-bloco {
    padding: 15px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    text-align: left;
    background: var(--card-bg);
    transition: 0.3s;
    position: relative;
}

.meta-titulo {
    font-size: 0.85em;
    text-transform: uppercase;
    font-weight: bold;
    color: #7f8c8d;
    display: block;
    margin-bottom: 5px;
}

.meta-valor {
    font-size: 1.3em;
    font-weight: bold;
    color: var(--text);
    margin-bottom: 5px;
}

.meta-msg {
    font-size: 0.9em;
    font-weight: 500;
    color: #7f8c8d;
    line-height: 1.3;
}

.meta-bloco.concluida {
    border-color: var(--secondary);
    background: var(--ok);
    box-shadow: 0 4px 6px rgba(74, 159, 191, 0.15);
}

.meta-bloco.concluida .meta-titulo {
    color: var(--secondary);
}

.meta-bloco.concluida .meta-valor {
    color: var(--primary);
}

.meta-bloco.concluida .meta-msg {
    color: var(--secondary);
}

.meta-bloco.pendente {
    opacity: 0.7;
}

.meta-bloco.pendente .meta-valor {
    color: #7f8c8d;
}

/* --- DASHBOARD E SISTEMA --- */
input,
select,
button {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1em;
    background: var(--input-bg);
    color: var(--text);
}

button {
    background-color: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

body.dark-mode button {
    color: #000;
}

.btn-success {
    background-color: var(--secondary);
    color: white !important;
}

body.dark-mode .btn-success {
    color: #000 !important;
}

.btn-danger {
    background-color: var(--danger);
    color: #fff !important;
}

.btn-editar {
    background-color: #f39c12;
    color: #fff !important;
}

nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

nav button {
    width: auto;
    flex: 1;
    margin: 0;
    background-color: var(--btn-bg);
    color: var(--text);
    border-radius: 8px;
    padding: 12px;
}

nav button.active {
    background-color: var(--primary);
    color: white;
}

body.dark-mode nav button.active {
    color: #000;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-top: 40px;
}

.month-filters {
    background: var(--card-bg);
    padding: 10px 15px;
    border-radius: 10px;
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin-bottom: 20px;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 12px;
    border: 1px solid var(--border-color);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.month-filters::-webkit-scrollbar {
    display: none;
}

.btn-filtro {
    background: var(--btn-bg);
    color: var(--text);
    padding: 8px 15px;
    border-radius: 20px;
    border: 2px solid transparent;
    width: auto;
    margin: 0;
    transition: 0.3s;
    font-size: 0.9em;
    flex-shrink: 0;
    cursor: pointer;
    font-weight: 500;
}

.btn-filtro.active {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
    box-shadow: 0 4px 8px rgba(24, 188, 156, 0.4);
}

body.dark-mode .btn-filtro.active {
    color: #000;
}

.btn-filtro-todos {
    background: var(--btn-bg);
    color: var(--text);
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    border: 2px solid transparent;
    width: auto;
    margin: 0;
    transition: 0.3s;
    font-size: 0.9em;
    flex-shrink: 0;
    cursor: pointer;
}

.btn-filtro-todos.active {
    background: #f39c12;
    color: white;
    border-color: #f39c12;
    box-shadow: 0 4px 8px rgba(243, 156, 18, 0.4);
}

body.dark-mode .btn-filtro-todos.active {
    color: #000;
}

.btn-whatsapp-export {
    background-color: #25D366;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 10px 15px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    box-shadow: 0 4px 6px rgba(37, 211, 102, 0.3);
    transition: transform 0.2s;
    font-size: 0.9em;
    margin: 0;
}

.btn-whatsapp-export:hover {
    background-color: #1ebe5d;
    transform: scale(1.02);
    color: white;
}

body.dark-mode .btn-whatsapp-export {
    color: #fff;
}

/* EFEITO DE DRILL-DOWN NOS CARDS */
.clickable-card {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.clickable-card:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--secondary);
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 20px 15px;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

body.dark-mode .card {
    background: rgba(30, 30, 40, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.card h3 {
    margin: 0 0 6px 0;
    font-size: 0.75em;
    color: #7f8c8d;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.card p {
    margin: 0;
    font-size: 1.3em;
    font-weight: 800;
    color: var(--primary);
    white-space: nowrap;
}

.global-cards {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

@media (max-width: 768px) {
    .global-cards {
        grid-template-columns: 1fr;
    }
}

.card.destaque-recebido {
    border: 2px solid rgba(39, 174, 96, 0.4);
    background: rgba(39, 174, 96, 0.08);
    backdrop-filter: blur(12px);
}

.card.destaque-falta {
    border: 2px solid rgba(230, 126, 34, 0.4);
    background: rgba(230, 126, 34, 0.08);
    backdrop-filter: blur(12px);
}

.card.destaque-anual {
    border: 2px solid rgba(52, 152, 219, 0.4);
    background: rgba(52, 152, 219, 0.08);
    backdrop-filter: blur(12px);
}

body.dark-mode .card.destaque-recebido {
    background: rgba(39, 174, 96, 0.12);
    border-color: rgba(39, 174, 96, 0.3);
}

body.dark-mode .card.destaque-falta {
    background: rgba(230, 126, 34, 0.12);
    border-color: rgba(230, 126, 34, 0.3);
}

body.dark-mode .card.destaque-anual {
    background: rgba(52, 152, 219, 0.12);
    border-color: rgba(52, 152, 219, 0.3);
}

.global-cards .card h3 {
    font-size: 0.8em;
}

.global-cards .card p {
    font-size: 1.4em;
}

.ganhos-local-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.ganhos-local-card {
    background: var(--card-bg);
    border-left: 4px solid var(--secondary);
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    border-left-width: 4px;
}

.detalhes-loc {
    display: flex;
    flex-direction: column;
    font-size: 0.85em;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    gap: 4px;
}

.detalhes-loc>div {
    display: flex;
    justify-content: space-between;
}

.thermometer {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    background: var(--card-bg);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    gap: 10px;
    border: 1px solid var(--border-color);
}

.thermo-item {
    text-align: center;
    flex: 1;
    min-width: 80px;
    padding: 5px;
    border-radius: 8px;
    border: 1px solid transparent;
}

.thermo-item span {
    font-size: 1.5em;
    display: block;
    margin-bottom: 5px;
}

.thermo-item strong {
    font-size: 1.1em;
    color: var(--text);
}

.toggle-views {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.toggle-views button {
    width: auto;
    padding: 10px 20px;
    border-radius: 20px;
    background: var(--btn-bg);
    color: var(--text);
    border: 2px solid transparent;
}

.toggle-views button.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

body.dark-mode .toggle-views button.active {
    color: #000;
}

.toggle-metas {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-bottom: 15px;
    flex-wrap: nowrap;
}

.toggle-metas button {
    width: auto;
    padding: 6px 12px;
    border-radius: 20px;
    background: var(--btn-bg);
    color: var(--text);
    border: 2px solid transparent;
    font-size: 0.78em;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    white-space: nowrap;
}

.toggle-metas button.active {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
    box-shadow: 0 4px 8px rgba(24, 188, 156, 0.3);
}

body.dark-mode .toggle-metas button.active {
    color: #000;
}

.toggle-metas .mes-shortcut {
    padding: 5px 10px;
    font-size: 0.75em;
    border-radius: 15px;
    background: var(--btn-bg);
    color: var(--text);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: 0.3s;
    font-weight: 500;
    white-space: nowrap;
}

.toggle-metas .mes-shortcut.active-mes {
    background: linear-gradient(135deg, #5bb5d5, #73c2d4);
    color: white;
    border-color: #5bb5d5;
}

.toggle-metas .separador-toggle {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 4px;
}

.multidias-grid {
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin: 10px 0;
}

.multidias-header {
    display: grid;
    grid-template-columns: 100px 1fr 1fr;
    background: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 0.85em;
    padding: 8px 0;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 1;
}

.multidias-row {
    display: grid;
    grid-template-columns: 100px 1fr 1fr;
    border-bottom: 1px solid var(--border-color);
    min-height: 48px;
    align-items: stretch;
}

.multidias-row:last-child {
    border-bottom: none;
}

.multidias-dia-label {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 6px 8px;
    font-weight: 600;
    font-size: 0.8em;
    background: var(--btn-bg);
    border-right: 1px solid var(--border-color);
}

.multidias-dia-label small {
    font-weight: 400;
    opacity: 0.7;
    font-size: 0.85em;
}

.multidias-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 4px;
    font-size: 0.78em;
    cursor: pointer;
    transition: 0.2s;
    text-align: center;
    border-right: 1px solid var(--border-color);
    user-select: none;
}

.multidias-slot:last-child {
    border-right: none;
}

.multidias-slot.livre {
    background: rgba(46, 204, 113, 0.08);
}

.multidias-slot.livre:hover {
    background: rgba(46, 204, 113, 0.2);
}

.multidias-slot.selecionado {
    background: rgba(46, 204, 113, 0.35);
    font-weight: 700;
    color: var(--secondary);
}

.multidias-slot.ocupado {
    background: var(--btn-bg);
    opacity: 0.6;
    cursor: not-allowed;
    font-size: 0.72em;
}

.multidias-slot.desabilitado {
    background: var(--btn-bg);
    opacity: 0.3;
    cursor: not-allowed;
}

.multidias-resumo {
    background: var(--ok);
    padding: 10px 15px;
    border-radius: 10px;
    margin: 10px 0;
    font-size: 0.9em;
    font-weight: 600;
    text-align: center;
}

/* --- CALENDÁRIO POR TURNOS (Modal) --- */
.turnos-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.turnos-header {
    display: grid;
    grid-template-columns: 110px 1fr 1fr;
    gap: 0;
    font-weight: 700;
    font-size: 0.85em;
    text-align: center;
    padding: 10px 0;
    border-bottom: 2px solid var(--primary);
}

.turnos-row {
    display: grid;
    grid-template-columns: 110px 1fr 1fr;
    gap: 0;
    align-items: stretch;
    min-height: 48px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.turnos-row:hover {
    filter: brightness(0.95);
}

.turnos-dia-label {
    display: flex;
    align-items: center;
    font-size: 0.82em;
    font-weight: 600;
    padding: 6px 8px;
    border-right: 1px solid var(--border-color);
}

.turnos-dia-label.hoje {
    color: var(--primary);
    font-weight: 800;
    border: 2px solid var(--primary);
    border-radius: 6px;
}

.turnos-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-right: 1px solid var(--border-color);
    min-height: 44px;
}

.turnos-cell:last-child {
    border-right: none;
}

.turnos-cell.vazio {
    opacity: 0.4;
    font-size: 0.8em;
}

.turnos-event {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 0.78em;
    font-weight: 600;
    color: #fff;
    width: 95%;
    justify-content: center;
    text-align: center;
    line-height: 1.3;
}

.turnos-event.ev-pendente {
    background: #34495e;
}

.turnos-event.ev-pago {
    background: #27ae60;
}

@media (max-width: 600px) {

    .turnos-header,
    .turnos-row {
        grid-template-columns: 75px 1fr 1fr;
    }

    .turnos-dia-label {
        font-size: 0.68em;
        padding: 4px 4px;
    }

    .turnos-event {
        font-size: 0.62em;
        padding: 3px 4px;
        gap: 2px;
    }

    .turnos-cell {
        padding: 2px;
    }
}

/* --- FULLCALENDAR MOBILE OVERRIDES --- */
@media (max-width: 600px) {
    #calendar .fc-toolbar {
        flex-wrap: wrap;
        gap: 4px;
        padding: 0 2px;
    }

    #calendar .fc-toolbar-title {
        font-size: 0.9em !important;
    }

    #calendar .fc-button {
        padding: 4px 8px !important;
        font-size: 0.7em !important;
    }

    #calendar .fc-col-header-cell {
        font-size: 0.65em;
        padding: 3px 0;
    }

    #calendar .fc-daygrid-day {
        height: 80px !important;
        max-height: 80px !important;
        overflow: hidden;
    }

    #calendar .fc-daygrid-day-frame {
        height: 80px !important;
        max-height: 80px !important;
        overflow: hidden;
    }

    #calendar .fc-daygrid-day-events {
        max-height: 50px !important;
        overflow: hidden;
    }

    #calendar .fc-daygrid-day-top {
        font-size: 0.7em;
        padding: 1px 2px;
    }

    #calendar .fc-daygrid-day-number {
        font-size: 0.8em;
        padding: 1px 3px;
    }

    .badge-horas-cal {
        font-size: 0.65em;
        padding: 0px 2px;
        border-radius: 3px;
        background: rgba(0, 0, 0, 0.1);
    }

    #calendar .fc-scrollgrid {
        font-size: 0.85em;
        table-layout: fixed !important;
    }

    #calendar .fc-scrollgrid-section-body>td {
        height: auto !important;
    }

    #calendar table.fc-scrollgrid-sync-table {
        table-layout: fixed !important;
    }

    /* Dark mode fix for mobile calendar */
    body.dark-mode #calendar .fc-daygrid-day {
        background-color: var(--card-bg) !important;
    }

    body.dark-mode #calendar .split-day-view div {
        filter: none;
    }
}

/* Desktop badge styling */
@media (min-width: 601px) {
    .badge-horas-cal {
        font-size: 0.75em;
        padding: 1px 4px;
        border-radius: 4px;
        background: rgba(0, 0, 0, 0.1);
    }
}

/* Dark mode calendar overrides */
body.dark-mode .fc-daygrid-day {
    background-color: var(--card-bg) !important;
}

body.dark-mode .split-day-view div[style*="background:#f5f5f5"] {
    background: var(--btn-bg) !important;
}

body.dark-mode .split-day-view div[style*="background:#f9f9f9"] {
    background: var(--btn-bg) !important;
}

.turnos-folga-icon {
    font-size: 1.3em;
    opacity: 0.4;
}

.conquistas-section {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
}

.conquistas-section h3 {
    color: var(--primary);
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.conquista-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--ok);
    border-radius: 10px;
    margin-bottom: 8px;
    border: 1px solid var(--secondary);
}

.conquista-item .conquista-icone {
    font-size: 1.8em;
}

.conquista-item .conquista-info {
    flex: 1;
}

.conquista-item .conquista-titulo {
    font-weight: bold;
    color: var(--primary);
}

.conquista-item .conquista-data {
    font-size: 0.85em;
    color: var(--secondary);
}

.surplus-bar {
    margin-top: 8px;
    background: var(--btn-bg);
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
}

.surplus-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #f39c12, #e67e22);
    border-radius: 10px;
    transition: width 1s ease;
}

/* === FEATURE 1: Fade-in animations === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-animate {
    opacity: 0;
    animation: fadeInUp 0.1s ease forwards;
}

/* === FEATURE 3: Skeleton loading === */
@keyframes shimmer {
    0% {
        background-position: -400px 0;
    }

    100% {
        background-position: 400px 0;
    }
}

.skeleton-card {
    background: linear-gradient(90deg, var(--btn-bg) 25%, var(--border-color) 50%, var(--btn-bg) 75%);
    background-size: 800px 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: 12px;
    height: 90px;
    margin-bottom: 10px;
}

.skeleton-bar {
    background: linear-gradient(90deg, var(--btn-bg) 25%, var(--border-color) 50%, var(--btn-bg) 75%);
    background-size: 800px 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: 8px;
    height: 20px;
    width: 60%;
    margin: 8px 0;
}

/* === FEATURE 4 & 5: Weekly/Comparison cards === */
.card-resumo-semanal {
    background: linear-gradient(135deg, rgba(41, 128, 185, 0.12), rgba(46, 204, 113, 0.12));
    border: 1px solid rgba(41, 128, 185, 0.25);
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 14px;
}

.card-resumo-semanal h4 {
    margin: 0 0 10px;
    color: var(--primary);
    font-size: 0.95em;
}

.card-resumo-semanal .stats-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.card-resumo-semanal .stat-item {
    flex: 1;
    min-width: 80px;
    text-align: center;
    background: var(--card-bg);
    border-radius: 10px;
    padding: 10px 6px;
}

.card-resumo-semanal .stat-item .stat-val {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--primary);
    display: block;
}

.card-resumo-semanal .stat-item .stat-label {
    font-size: 0.75em;
    color: #7f8c8d;
    display: block;
    margin-top: 2px;
}

.card-comparativo {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 14px 18px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-comparativo .comp-icon {
    font-size: 2em;
}

.card-comparativo .comp-text {
    font-size: 0.9em;
    flex: 1;
}

.card-comparativo .comp-pct {
    font-size: 1.3em;
    font-weight: 700;
    white-space: nowrap;
}

/* === FEATURE 7: Search bar === */
.search-bar-container {
    position: relative;
    margin-bottom: 12px;
}

.search-bar-container input {
    width: 100%;
    padding: 10px 38px 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text);
    font-size: 0.9em;
    outline: none;
    transition: border-color 0.2s;
}

.search-bar-container input:focus {
    border-color: var(--primary);
}

.search-bar-container .search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #7f8c8d;
    pointer-events: none;
}

.search-bar-container .search-clear {
    position: absolute;
    right: 34px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    font-size: 1em;
    display: none;
    padding: 2px 6px;
}

/* === FEATURE 8: Pull-to-refresh === */
.pull-indicator {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-60px);
    background: var(--card-bg);
    color: var(--primary);
    padding: 10px 20px;
    border-radius: 0 0 14px 14px;
    font-size: 0.85em;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pull-indicator.visible {
    transform: translateX(-50%) translateY(0);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.pull-indicator .spinner {
    display: inline-block;
    animation: spin 0.8s linear infinite;
}

/* === FEATURE 6: Undo toast === */
.toast-undo-btn {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    padding: 4px 14px;
    margin-left: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85em;
    transition: background 0.2s;
}

.toast-undo-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* === FEATURE: Confetti badges === */
@keyframes confettiBurst {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 1;
    }

    50% {
        transform: scale(1.2) rotate(180deg);
        opacity: 0.8;
    }

    100% {
        transform: scale(0) rotate(360deg);
        opacity: 0;
    }
}

@keyframes badgePulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(74, 159, 191, 0.4);
    }

    50% {
        box-shadow: 0 0 20px 8px rgba(74, 159, 191, 0.2);
    }
}

.meta-bloco.concluida {
    animation: badgePulse 2s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.meta-bloco.concluida .confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.confetti-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    animation: confettiDrop 1.5s ease-out forwards;
    opacity: 0;
}

@keyframes confettiDrop {
    0% {
        transform: translateY(-20px) rotate(0deg) scale(0);
        opacity: 1;
    }

    60% {
        opacity: 1;
    }

    100% {
        transform: translateY(80px) rotate(720deg) scale(1);
        opacity: 0;
    }
}

/* === FEATURE: Tela diária dinâmica === */
#tela-diaria.periodo-manha {
    background: linear-gradient(180deg, rgba(255, 200, 87, 0.15) 0%, rgba(135, 206, 235, 0.08) 100%);
    border-radius: 20px;
    padding: 55px 20px 20px;
}

#tela-diaria.periodo-tarde {
    background: linear-gradient(180deg, rgba(255, 140, 66, 0.15) 0%, rgba(255, 107, 129, 0.08) 100%);
    border-radius: 20px;
    padding: 55px 20px 20px;
}

#tela-diaria.periodo-noite {
    background: linear-gradient(180deg, rgba(44, 62, 80, 0.2) 0%, rgba(108, 92, 231, 0.1) 100%);
    border-radius: 20px;
    padding: 55px 20px 20px;
}

/* === FEATURE: Mapa modal === */
#modal-mapa .modal-content {
    max-width: 95vw;
    width: 700px;
    max-height: 90vh;
}

#mapa-container {
    width: 100%;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 10px;
}

.btn-mapa-home {
    background: linear-gradient(135deg, #2980b9, #3498db);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 12px 20px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-top: 8px;
    transition: transform 0.2s;
}

.btn-mapa-home:active {
    transform: scale(0.97);
}

/* === FEATURE: AI Command Input === */
.ai-command-container {
    margin: 0 auto 20px;
    max-width: 500px;
}

.ai-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-command-input {
    width: 100%;
    padding: 12px 48px 12px 16px;
    border-radius: 25px;
    border: 2.5px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text);
    font-size: 0.95em;
    outline: none;
    transition: box-shadow 0.4s ease;
    box-sizing: border-box;
}

/* Siri-style animated gradient border */
.ai-command-input.siri-active {
    border: 2.5px solid transparent;
    background:
        linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
        conic-gradient(from var(--siri-angle, 0deg), #6c5ce7, #a29bfe, #00cec9, #00b894, #fdcb6e, #e17055, #d63031, #e84393, #6c5ce7) border-box;
    box-shadow: 0 0 18px rgba(108, 92, 231, 0.2), 0 0 40px rgba(0, 206, 201, 0.1);
    animation: siriRotate 2.5s linear infinite;
}

@property --siri-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes siriRotate {
    to {
        --siri-angle: 360deg;
    }
}

.ai-command-input::placeholder {
    color: #95a5a6;
    font-size: 0.88em;
}

.ai-command-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #2980b9);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.ai-command-send:active {
    transform: scale(0.9);
}

.ai-command-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ai-typing {
    display: none;
    text-align: center;
    padding: 8px;
    font-size: 0.85em;
    color: var(--primary);
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.ai-typing.visible {
    display: block;
}

.ai-result-preview {
    background: var(--card-bg);
    border: 2.5px solid transparent;
    border-radius: 16px;
    padding: 16px;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    max-height: 0;
    padding: 0 16px;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        padding 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        margin 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 0;
}

.ai-result-preview.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    max-height: 65vh;
    overflow-y: auto;
    padding: 16px;
    pointer-events: auto;
    margin-top: 10px;
    animation: aiMagicAppear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    background:
        linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
        conic-gradient(from var(--siri-angle, 0deg), #6c5ce7, #a29bfe, #00cec9, #00b894, #fdcb6e, #e17055, #d63031, #e84393, #6c5ce7) border-box;
    border: 2.5px solid transparent;
    box-shadow: 0 0 20px rgba(108, 92, 231, 0.15), 0 8px 30px rgba(0, 0, 0, 0.08);
}

.ai-result-preview.visible {
    animation: aiMagicAppear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards, siriRotateCard 2.5s linear infinite;
}

@keyframes siriRotateCard {
    to {
        --siri-angle: 360deg;
    }
}

/* Glow externo no card */
.ai-result-preview.visible::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 19px;
    background: conic-gradient(from var(--siri-angle, 0deg),
            #6c5ce7, #a29bfe, #00cec9, #00b894, #fdcb6e,
            #e17055, #d63031, #e84393, #6c5ce7);
    opacity: 0.2;
    filter: blur(14px);
    z-index: -1;
    animation: siriRotateCard 2.5s linear infinite;
}

.ai-result-preview.visible::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
    animation: aiShimmer 1.2s 0.3s ease-out forwards;
    pointer-events: none;
}

@keyframes aiMagicAppear {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
        filter: blur(4px);
    }

    60% {
        opacity: 1;
        filter: blur(0);
    }

    80% {
        transform: translateY(-3px) scale(1.01);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes aiShimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

@keyframes aiBorderGlow {

    0%,
    100% {
        box-shadow: 0 0 15px rgba(108, 92, 231, 0.12), 0 4px 20px rgba(0, 0, 0, 0.06);
    }

    50% {
        box-shadow: 0 0 25px rgba(108, 92, 231, 0.25), 0 4px 25px rgba(0, 206, 201, 0.1);
    }
}

.ai-result-preview h4 {
    margin: 0 0 10px 0;
    color: var(--primary);
}

.ai-result-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.92em;
}

.ai-result-row:last-child {
    border-bottom: none;
}

.ai-result-label {
    color: #7f8c8d;
}

.ai-result-value {
    font-weight: 600;
    color: var(--text);
}

.ai-result-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.ai-result-actions button {
    flex: 1;
    padding: 10px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95em;
}

.ai-btn-confirm {
    background: var(--secondary);
    color: #fff;
}

.ai-btn-edit {
    background: var(--primary);
    color: #fff;
}

.ai-btn-cancel {
    background: #e74c3c;
    color: #fff;
}

/* === AI Rich Response Styles === */
.ai-rich-response {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 0.92em;
    line-height: 1.7;
    color: var(--text);
    border: 1px solid var(--border-color);
}

.ai-rich-response h3 {
    font-size: 1.05em;
    color: var(--primary);
    margin: 16px 0 6px 0;
    padding-bottom: 4px;
    border-bottom: 2px solid var(--secondary);
    display: inline-block;
}

.ai-rich-response h3:first-child {
    margin-top: 0;
}

.ai-rich-response b,
.ai-rich-response strong {
    color: var(--primary);
    font-weight: 700;
}

body.dark-mode .ai-rich-response b,
body.dark-mode .ai-rich-response strong {
    color: var(--secondary);
}

.ai-rich-response .ai-divider {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    margin: 10px 0;
}

.ai-rich-response ul {
    padding-left: 8px;
    margin: 6px 0;
    list-style: none;
}

.ai-rich-response ul li {
    padding: 4px 0;
    position: relative;
    padding-left: 20px;
}

.ai-rich-response ul li::before {
    content: '▸';
    position: absolute;
    left: 2px;
    color: var(--secondary);
    font-weight: bold;
}

.ai-rich-response .ai-highlight-box {
    background: linear-gradient(135deg, rgba(24, 188, 156, 0.08), rgba(44, 62, 80, 0.05));
    border-left: 3px solid var(--secondary);
    border-radius: 0 8px 8px 0;
    padding: 8px 12px;
    margin: 8px 0;
    font-weight: 600;
}

body.dark-mode .ai-rich-response .ai-highlight-box {
    background: linear-gradient(135deg, rgba(24, 188, 156, 0.12), rgba(255, 255, 255, 0.03));
}

.ai-rich-response table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
    font-size: 0.9em;
}

.ai-rich-response table th {
    background: var(--primary);
    color: #fff;
    padding: 6px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85em;
}

.ai-rich-response table th:first-child {
    border-radius: 6px 0 0 0;
}

.ai-rich-response table th:last-child {
    border-radius: 0 6px 0 0;
}

.ai-rich-response table td {
    padding: 5px 10px;
    border-bottom: 1px solid var(--border-color);
}

.ai-rich-response table tr:nth-child(even) td {
    background: rgba(0, 0, 0, 0.02);
}

body.dark-mode .ai-rich-response table tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.03);
}

.ai-rich-response .valor-financeiro {
    color: var(--secondary) !important;
    font-weight: 700;
}

.view-section,
.tab-content {
    display: none;
}

.view-section.active,
.tab-content.active {
    display: block;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.tab-content.slide-right {
    animation: slideInRight 0.25s ease-out;
}

.tab-content.slide-left {
    animation: slideInLeft 0.25s ease-out;
}

.main-grid {
    display: grid;
    grid-template-columns: 1fr 2.5fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}

.panel {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 15px;
}

th,
td {
    padding: 10px 12px;
    text-align: left;
    font-size: 0.88em;
}

th {
    background: linear-gradient(135deg, #18bc9c, #1abc9c);
    color: #fff;
    font-weight: 600;
    font-size: 0.78em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    position: sticky;
    top: 0;
    z-index: 2;
}

th:first-child {
    border-radius: 10px 0 0 0;
}

th:last-child {
    border-radius: 0 10px 0 0;
}

td {
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

body.dark-mode td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

body.dark-mode tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.03);
}

tbody tr:hover {
    background: rgba(26, 188, 156, 0.06);
    transition: background 0.15s;
}

body.dark-mode tbody tr:hover {
    background: rgba(26, 188, 156, 0.1);
}

.status-pago {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(39, 174, 96, 0.12);
    color: #27ae60;
    font-weight: 700;
    font-size: 0.82em;
    cursor: pointer;
}

.status-pendente {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(230, 126, 34, 0.12);
    color: #e67e22;
    font-weight: 700;
    font-size: 0.82em;
    cursor: pointer;
}

tr.row-recente {
    background: rgba(39, 174, 96, 0.15) !important;
    border-left: 4px solid #27ae60;
}

tr.row-recente td {
    font-weight: bold;
}

/* --- CALENDÁRIO --- */
#calendar {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

body.dark-mode .fc {
    color: var(--text);
}

body.dark-mode .fc-theme-standard td,
body.dark-mode .fc-theme-standard th {
    border-color: #333;
}

/* Calendar day-of-week header bar - matching app palette */
.fc .fc-col-header-cell {
    background: linear-gradient(135deg, #18bc9c, #1abc9c) !important;
    color: #fff !important;
    padding: 6px 0 !important;
    font-size: 0.8em;
    font-weight: 600;
    letter-spacing: 0.03em;
    border: none !important;
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.fc .fc-col-header-cell:last-child {
    border-right: none !important;
}

.fc .fc-col-header-cell a,
.fc .fc-col-header-cell .fc-scrollgrid-sync-inner {
    color: #fff !important;
    text-decoration: none !important;
}

body.dark-mode .fc .fc-col-header-cell {
    background: linear-gradient(135deg, #1a252f, #253545) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.fc-event {
    cursor: pointer;
    border: none !important;
}

.fc-daygrid-day-top {
    flex-direction: row !important;
    justify-content: space-between;
    padding: 5px;
    align-items: center;
    z-index: 2;
    position: relative;
    cursor: pointer;
}

.fc .fc-toolbar-title {
    font-size: 1.3em;
    color: var(--primary);
}

.fc .fc-button {
    padding: 0.3em 0.7em;
    font-weight: 600;
    text-transform: capitalize;
    background-color: var(--primary);
    color: #fff;
    border: none;
    border-radius: 20px !important;
    font-size: 0.85em;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.fc .fc-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.fc .fc-button:active {
    transform: scale(0.95);
}

.fc .fc-button-group {
    border-radius: 20px !important;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.fc .fc-button-group .fc-button {
    border-radius: 0 !important;
    box-shadow: none;
    margin: 0;
}



.fc .fc-button-group .fc-button:first-child {
    border-radius: 20px 0 0 20px !important;
}

/* Block ALL scrollbars inside calendars */
#calendar-modal-container .fc-scroller,
#calendar-modal-container .fc-scroller-liquid-absolute,
#calendar .fc-scroller,
#calendar .fc-scroller-liquid-absolute {
    overflow: hidden !important;
}

#calendar-modal-container .fc-scroller::-webkit-scrollbar,
#calendar .fc-scroller::-webkit-scrollbar {
    display: none !important;
}

/* Remove gap between day-of-week header and calendar body */
#calendar-modal-container .fc-scrollgrid,
#calendar .fc-scrollgrid {
    border-collapse: collapse !important;
}

#calendar-modal-container .fc-scrollgrid-section,
#calendar-modal-container .fc-scrollgrid-section>td,
#calendar .fc-scrollgrid-section,
#calendar .fc-scrollgrid-section>td {
    padding: 0 !important;
}

#calendar-modal-container .fc-col-header,
#calendar .fc-col-header {
    margin-bottom: 0 !important;
}

/* Override global table margin that causes gap between header and body */
#calendar-modal-container table,
#calendar table {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.fc .fc-button-group .fc-button:last-child {
    border-radius: 0 20px 20px 0 !important;
}

.fc .fc-button-group .fc-button:only-child {
    border-radius: 20px !important;
}

/* Refined prev/next nav buttons */
.fc .fc-prev-button,
.fc .fc-next-button {
    width: 34px;
    height: 34px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    background: var(--btn-bg) !important;
    color: var(--text) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color) !important;
}

.fc .fc-prev-button:hover,
.fc .fc-next-button:hover {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
}

/* Replace ugly default arrow icons with clean chevrons */
.fc .fc-prev-button .fc-icon,
.fc .fc-next-button .fc-icon {
    font-size: 1em;
}

/* Today button refined */
.fc .fc-today-button {
    border-radius: 20px !important;
    padding: 0.25em 0.9em !important;
    font-size: 0.8em;
    font-weight: 600;
    background: var(--secondary) !important;
    border: none !important;
    color: #fff !important;
    text-transform: none;
}

body.dark-mode .fc .fc-today-button {
    color: #000 !important;
}

.fc .fc-today-button:disabled {
    opacity: 0.4;
}

/* Active button state */
.fc .fc-button-active {
    background-color: var(--secondary) !important;
    border-color: var(--secondary) !important;
}

/* Tighter toolbar spacing */
.fc .fc-header-toolbar {
    margin-bottom: 0.6em !important;
}

body.dark-mode .fc .fc-button {
    color: #000;
}

.dia-emoji {
    font-size: 1.2em;
    display: flex;
    align-items: center;
    gap: 4px;
}

.badge-horas-cal {
    font-size: 0.6em;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.15);
    padding: 2px 5px;
    border-radius: 4px;
    color: var(--text);
}

body.dark-mode .badge-horas-cal {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

td.bg-folga {
    background-color: var(--folga) !important;
    cursor: pointer;
}

td.bg-12h {
    background-color: var(--ok) !important;
    cursor: pointer;
}

td.bg-24h {
    background-color: var(--puxado) !important;
    cursor: pointer;
}

td.bg-36h {
    background-color: var(--sofrimento) !important;
    cursor: pointer;
}

td.bg-upa {
    background-color: var(--upa) !important;
    cursor: pointer;
}

td.bg-ubs {
    background-color: var(--ubs) !important;
    cursor: pointer;
}


td.fc-day-today {
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
    border: 2px solid var(--primary);
}

td.bg-folga.fc-day-today {
    background-color: var(--folga) !important;
}

td.bg-12h.fc-day-today {
    background-color: var(--ok) !important;
}

td.bg-24h.fc-day-today {
    background-color: var(--puxado) !important;
}

td.bg-36h.fc-day-today {
    background-color: var(--sofrimento) !important;
}

td.fc-day {
    cursor: pointer;
}

td.fc-day:hover .fc-daygrid-day-frame {
    background: rgba(0, 0, 0, 0.05);
}

.folga-watermark {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #bdc3c7;
    font-size: 0.8em;
    font-weight: bold;
    pointer-events: none;
    opacity: 0.6;
    line-height: 1.2;
}

.mobile-only-summary {
    display: none;
}

@media (max-width: 600px) {
    .fc-header-toolbar {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: space-between !important;
        gap: 6px;
        margin-bottom: 0.3em !important;
    }

    .fc-toolbar-chunk:nth-child(1) {
        order: 1;
    }

    .fc-toolbar-chunk:nth-child(3) {
        order: 2;
    }

    .fc-toolbar-chunk:nth-child(2) {
        order: 3;
        width: 100%;
        text-align: center;
        margin-top: 2px;
    }

    .fc-toolbar-title {
        font-size: 1.05em !important;
        font-weight: 700;
    }

    /* Bigger nav buttons on mobile for easy tapping */
    .fc .fc-prev-button,
    .fc .fc-next-button {
        width: 40px;
        height: 40px;
        font-size: 1.1em;
    }

    .fc .fc-today-button {
        padding: 0.2em 0.6em !important;
        font-size: 0.72em;
    }

    /* Smaller view buttons on mobile */
    .fc .fc-button-group .fc-button {
        padding: 0.2em 0.5em;
        font-size: 0.72em;
    }

    /* Maximize calendar height on mobile */
    .fc .fc-scrollgrid {
        min-height: 420px;
    }

    .fc .fc-daygrid-body {
        min-height: 380px;
    }

    /* Tighter spacing between header and scrollgrid */
    .fc .fc-view-harness {
        margin-top: 0 !important;
    }

    /* Remove extra padding in calendar container on mobile */
    #calendar {
        padding: 10px;
    }

    #calendar-modal-container {
        padding: 0;
    }

    .fc-daygrid-day-top {
        justify-content: flex-end !important;
    }

    .fc-daygrid-day-top .dia-emoji {
        display: none !important;
    }

    .mobile-only-summary {
        display: block !important;
    }

    .fc-event {
        display: none !important;
    }

    .folga-watermark {
        font-size: 0.6em;
    }

    /* Cards hospital menores no mobile */
    .ganhos-local-card {
        min-width: 100%;
        padding: 10px;
    }

    .ganhos-local-card h4 {
        font-size: 0.9em;
    }

    .ganhos-local-card .total-loc {
        font-size: 1em;
    }

    .detalhes-loc {
        font-size: 0.75em;
        gap: 4px;
    }

    /* Botões flutuantes menores no mobile */
    #btn-perfil {
        width: 32px;
        height: 32px;
    }

    #btn-toggle-visibilidade,
    #btn-toggle-tema {
        width: 32px;
        height: 32px;
        font-size: 1em;
    }

    #btn-toggle-tema {
        right: 48px;
    }
}

.config-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    background: var(--btn-bg);
    border-radius: 8px;
    margin-bottom: 10px;
}

.config-item div {
    flex: 1;
}

.config-item .botoes {
    display: flex;
    gap: 5px;
    flex: 0;
}

.config-item button {
    width: auto;
    padding: 8px 12px;
    margin: 0;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
}

.modal-content {
    background: var(--card-bg);
    color: var(--text);
    padding: 25px;
    border-radius: 15px;
    width: 100%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    margin: auto;
    border: 1px solid var(--border-color);
}

/* --- MODERN PLANTÃO MODAL --- */
.modal-plantao-modern {
    border-radius: 16px;
    padding: 18px 16px 14px;
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.modal-header-modern {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid;
    border-image: linear-gradient(90deg, var(--primary), #27ae60) 1;
}

.modal-header-icon {
    font-size: 1.3em;
}

.modal-header-modern h3 {
    margin: 0;
    font-size: 1em;
    color: var(--text);
    font-weight: 700;
}

.form-group-modern {
    margin-bottom: 8px;
}

.label-modern {
    display: block;
    font-size: 0.78em;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 3px;
    letter-spacing: 0.02em;
}

.label-icon {
    font-size: 1em;
}

.input-modern {
    width: 100%;
    padding: 8px 10px;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 0.88em;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.input-modern:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 188, 156, 0.15);
}

.form-row-modern {
    display: flex;
    gap: 8px;
}

.form-row-modern .form-group-modern {
    flex: 1;
}

.form-options-row {
    display: flex;
    gap: 6px;
    margin: 6px 0 8px;
    flex-wrap: wrap;
}

.option-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 18px;
    background: var(--bg);
    border: 1.5px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.75em;
    font-weight: 600;
    color: var(--text-secondary);
    user-select: none;
    margin: 0;
}

.option-pill input[type="checkbox"] {
    width: auto;
    margin: 0;
    accent-color: var(--primary);
    transform: scale(1.1);
}

.option-pill:has(input:checked) {
    background: rgba(26, 188, 156, 0.12);
    border-color: var(--primary);
    color: var(--primary);
}

.pill-label {
    white-space: nowrap;
}

.btn-submit-modern {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), #27ae60);
    color: #fff;
    font-size: 0.95em;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(26, 188, 156, 0.3);
    letter-spacing: 0.02em;
}

.btn-submit-modern:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(26, 188, 156, 0.4);
}

.btn-submit-modern:active {
    transform: scale(0.98);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5em;
    cursor: pointer;
    color: #7f8c8d;
    transition: 0.2s;
}

.modal-close:hover {
    color: var(--danger);
}

#toast {
    visibility: hidden;
    min-width: 280px;
    max-width: 90vw;
    color: #fff;
    text-align: center;
    border-radius: 16px;
    padding: 14px 24px;
    position: fixed;
    z-index: 99999;
    left: 50%;
    bottom: 30px;
    font-size: 1em;
    font-weight: 600;
    transform: translateX(-50%) translateY(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease, bottom 0.4s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.95), rgba(46, 204, 113, 0.95));
}

#toast.toast-error {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.95), rgba(192, 57, 43, 0.95));
}

#toast.toast-warning {
    background: linear-gradient(135deg, rgba(230, 126, 34, 0.95), rgba(243, 156, 18, 0.95));
}

#toast.toast-info {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.95), rgba(41, 128, 185, 0.95));
}

#toast.show {
    visibility: visible;
    opacity: 1;
    bottom: 40px;
    transform: translateX(-50%) translateY(0);
}

#toast .toast-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 0 0 16px 16px;
    animation: toastBar 3s linear forwards;
}

@keyframes toastBar {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

/* Custom Confirm Modal */
#confirm-custom-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

#confirm-custom-overlay.show {
    display: flex;
}

#confirm-custom-box {
    background: var(--card-bg, #fff);
    border-radius: 16px;
    padding: 24px;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: confirmIn 0.25s ease;
}

@keyframes confirmIn {
    from {
        transform: scale(0.85);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

#confirm-custom-msg {
    font-size: 1.05em;
    margin-bottom: 20px;
    color: var(--text, #333);
    line-height: 1.5;
}

#confirm-custom-box .confirm-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
}

#confirm-custom-box .confirm-btns button {
    padding: 10px 24px;
    border: none;
    border-radius: 10px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

#confirm-custom-box .confirm-btns button:active {
    transform: scale(0.95);
}

.btn-confirm-yes {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: #fff;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.btn-confirm-no {
    background: var(--input-bg, #f0f0f0);
    color: var(--text, #333);
}

.autocomplete-wrapper {
    position: relative;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-top: none;
    z-index: 99;
    max-height: 200px;
    overflow-y: auto;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    display: none;
}

.autocomplete-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9em;
}

.autocomplete-item:hover {
    background: var(--btn-bg);
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    max-height: 250px;
    overflow-y: auto;
    padding: 15px;
    background: var(--btn-bg);
    border-radius: 8px;
    margin-top: 10px;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.emoji-btn {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1.8em;
    cursor: pointer;
    padding: 10px 5px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: 0.2s;
    margin: 0;
    color: var(--text);
}

.emoji-btn:hover {
    background: var(--ok);
    border-color: var(--secondary);
    transform: scale(1.1);
}

/* === Inline styles (loading screen) === */
@keyframes loadingSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes loadingPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.85;
    }
}

.loading-dots::after {
    content: '';
    animation: loadingDots 1.5s steps(4, end) infinite;
}

@keyframes loadingDots {
    0% {
        content: '';
    }

    25% {
        content: '.';
    }

    50% {
        content: '..';
    }

    75% {
        content: '...';
    }
}

/* === Inline styles (AI input) === */
.ai-help-item {
    background: var(--bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 6px;
    font-size: 0.88em;
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s;
}

.ai-help-item:active {
    transform: scale(0.97);
    background: var(--secondary);
    color: #fff;
    border-color: var(--secondary);
}

@media (hover: hover) {
    .ai-help-item:hover {
        background: var(--secondary);
        color: #fff;
        border-color: var(--secondary);
    }
}

/* === iOS 26 TIMELINE MARKER ANIMATIONS === */
.timeline-marker {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    z-index: 15;
}

.timeline-marker .marker-icon {
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1),
        filter 0.3s ease;
}

.timeline-marker:active .marker-icon {
    transform: translateX(-50%) scale(1.35) !important;
}

/* === MARKER HOSPITAL (uses standard modal-lista-generica) === */

/* === METAS HOSPITAL SUBMENU ITEMS === */
.meta-submenu-header {
    font-size: 0.78em;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--secondary);
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.meta-submenu-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.meta-hospital-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--input-bg);
    border-left: 3px solid var(--secondary);
    transition: transform 0.2s ease, background 0.2s ease;
    cursor: default;
    -webkit-tap-highlight-color: transparent;
    opacity: 0;
    transform: translateY(8px);
    animation: submenuItemIn 0.35s ease forwards;
}

.meta-hospital-item .hospital-nome {
    font-size: 0.88em;
    font-weight: 600;
    color: var(--text);
}

.meta-hospital-item .hospital-valor {
    font-size: 0.85em;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

.meta-hospital-item .hospital-qtd {
    font-size: 0.72em;
    color: #7f8c8d;
    margin-top: 2px;
}

.meta-submenu-empty {
    font-size: 0.82em;
    color: #7f8c8d;
    text-align: center;
    padding: 8px 0;
    font-style: italic;
}

@keyframes submenuItemIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Screen slide transitions === */
body {
    overflow-x: hidden;
}

#tela-diaria,
#app-container {
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
    will-change: transform, opacity;
}

.screen-enter-right {
    transform: translateX(30%);
    opacity: 0;
}

.screen-enter-left {
    transform: translateX(-30%);
    opacity: 0;
}

.screen-exit-left {
    transform: translateX(-30%);
    opacity: 0;
}

.screen-exit-right {
    transform: translateX(30%);
    opacity: 0;
}

.screen-active {
    transform: translateX(0);
    opacity: 1;
}

/* === Version Footer (profile dropdown) === */
.perfil-dropdown-footer {
    padding: 8px 16px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.65em;
    color: #95a5a6;
    letter-spacing: 0.3px;
    opacity: 0.7;
}

/* === Dashboard bottom: hidden on mobile === */
.dashboard-bottom {
    display: none;
}

/* =============================================
   DESKTOP DASHBOARD — min-width: 900px
   Card do plantão à esquerda, gamification + 
   metas à direita. Wider container.
   ============================================= */
@media (min-width: 900px) {

    /* --- Container mais largo no desktop --- */
    #tela-diaria {
        max-width: 1100px;
        margin-left: auto;
        margin-right: auto;
        padding: 0 24px;
    }

    /* --- Dashboard row: 2 colunas --- */
    .dashboard-row {
        display: grid;
        grid-template-columns: 1.1fr 1fr;
        gap: 20px;
        align-items: start;
    }

    .dashboard-col-left,
    .dashboard-col-right {
        min-width: 0;
        /* prevent grid blowout */
    }

    /* --- Card plantão: sticky no topo ao scrollar --- */
    .dashboard-col-left {
        position: sticky;
        top: 16px;
    }

    .card-plantao-hoje {
        border-radius: 20px;
        transition: box-shadow 0.3s ease;
    }

    /* Hide mobile tabs on desktop — only mobile needs them */
    .chrome-tabs-bar {
        display: none !important;
    }

    /* Desktop: no tab-card specific overrides needed — mobile media query handles it */

    /* Keep calendar-mobile hidden on desktop (desktop has its own calendar) */
    #calendario-mobile {
        display: none !important;
    }

    .card-plantao-hoje:hover {
        box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12);
    }

    .card-plantao-hoje #mini-mapa-rota {
        height: 200px !important;
        border-radius: 14px !important;
    }

    .card-plantao-hoje .waze-btn {
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    .card-plantao-hoje .waze-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    }

    /* --- Coluna direita: metas compactas --- */
    .dashboard-col-right .toggle-metas {
        margin-bottom: 12px;
    }

    .dashboard-col-right .gamification-container {
        margin-bottom: 16px;
    }

    .dashboard-col-right .metas-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    /* --- Botões de navegação: maiores --- */
    .botoes-home-v2 {
        gap: 14px !important;
        max-width: 520px;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .botoes-home-v2 button {
        max-width: 160px !important;
        padding: 14px 12px !important;
        font-size: 0.85em !important;
        border-radius: 16px !important;
        transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    }

    .botoes-home-v2 button:hover {
        transform: translateY(-3px) !important;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12) !important;
    }

    .botoes-home-v2 button span {
        font-size: 1.6em !important;
    }

    /* --- Widgets topo --- */
    .home-widgets-row {
        gap: 12px !important;
        justify-content: center !important;
    }

    .clima-widget,
    .fatigue-widget {
        flex: 0 1 auto !important;
        max-width: 280px !important;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    .clima-widget:hover,
    .fatigue-widget:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    }

    /* --- Metas cards: hover --- */
    .meta-bloco {
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    .meta-bloco:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    }

    /* --- Gamification container hover --- */
    .gamification-container {
        transition: box-shadow 0.25s ease;
    }

    .gamification-container:hover {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    }

    /* --- Botões flutuantes: hover --- */
    #btn-perfil,
    #btn-toggle-tema,
    #btn-toggle-visibilidade {
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    #btn-perfil:hover,
    #btn-toggle-tema:hover,
    #btn-toggle-visibilidade:hover {
        transform: scale(1.08);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    /* --- Dashboard bottom panel --- */
    .dashboard-bottom {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        margin-top: 20px;
        padding-bottom: 32px;
    }

    .dashboard-bottom-card {
        background: var(--card-bg);
        border-radius: 16px;
        padding: 20px;
        border: 1px solid var(--border-color);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
        transition: box-shadow 0.25s ease;
    }

    .dashboard-bottom-card:hover {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    }

    .dashboard-bottom-card h4 {
        margin: 0 0 16px 0;
        font-size: 0.95em;
        color: var(--primary);
        font-weight: 700;
    }
}

/* === Próximos Plantões — Executive Big Numbers === */
.proximos-plantoes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.prox-exec {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--prox-accent, var(--primary));
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
}

.prox-exec:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.prox-exec-left {
    text-align: center;
    min-width: 48px;
    flex-shrink: 0;
}

.prox-exec-bigday {
    font-size: 1.8em;
    font-weight: 900;
    color: var(--prox-accent, var(--primary));
    line-height: 1;
}

.prox-exec-mes {
    font-size: 0.58em;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.prox-exec-right {
    flex: 1;
    min-width: 0;
}

.prox-exec-local {
    font-size: 0.85em;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prox-exec-meta {
    font-size: 0.72em;
    color: var(--text-secondary);
    margin-top: 1px;
}

.prox-exec-valor {
    font-size: 0.82em;
    font-weight: 800;
    color: var(--primary);
    margin-top: 2px;
}

.prox-exec-tag {
    font-size: 0.58em;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    flex-shrink: 0;
}

.proximo-vazio {
    text-align: center;
    padding: 20px;
    font-size: 0.85em;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* === Mini Calendar === */
.mini-cal-month {
    user-select: none;
}

.mini-cal-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 700;
    font-size: 0.9em;
    color: var(--text);
}

.mini-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
}

.mini-cal-dow {
    font-size: 0.65em;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    padding: 4px 0;
    letter-spacing: 0.5px;
}

.mini-cal-day {
    font-size: 0.78em;
    padding: 6px 2px;
    border-radius: 8px;
    color: var(--text);
    position: relative;
}

.mini-cal-day.empty {
    visibility: hidden;
}

.mini-cal-day.today {
    font-weight: 800;
    background: var(--primary);
    color: #fff;
}

.mini-cal-day.has-shift {
    font-weight: 700;
    background: rgba(52, 152, 219, 0.15);
    color: #2980b9;
}

.mini-cal-day.has-shift.today {
    background: #3498db;
    color: #fff;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.35);
}

.mini-cal-day:hover:not(.empty) {
    background: rgba(0, 0, 0, 0.04);
    transform: scale(1.1);
    transition: background 0.15s, transform 0.1s;
}

.mini-cal-day.selected {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
    border-radius: 8px;
}

/* === Calendar Day Detail — Executive KPIs === */
.mini-cal-detalhe {
    margin-top: 14px;
    padding: 16px;
    background: var(--card-bg);
    border-radius: 14px;
    border: 1px solid var(--border-color);
    animation: calFadeIn 0.2s ease;
}

@keyframes calFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cal-exec-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.cal-exec-big-day {
    font-size: 2.2em;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
    min-width: 48px;
    text-align: center;
}

.cal-exec-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cal-exec-weekday {
    font-size: 0.82em;
    font-weight: 600;
    color: var(--text);
}

.cal-exec-badge {
    font-size: 0.58em;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: fit-content;
}

.cal-exec-shift-line {
    font-size: 0.75em;
    color: var(--text-secondary);
    padding: 6px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
}

.cal-exec-kpis {
    display: flex;
    gap: 8px;
}

.cal-exec-kpi {
    flex: 1;
    text-align: center;
    padding: 10px 6px;
    border-radius: 10px;
    background: rgba(46, 204, 113, 0.06);
    border: 1px solid rgba(46, 204, 113, 0.12);
}

.cal-exec-kpi.folga {
    background: rgba(52, 152, 219, 0.06);
    border-color: rgba(52, 152, 219, 0.12);
}

.cal-exec-kpi.warn {
    background: rgba(243, 156, 18, 0.08);
    border-color: rgba(243, 156, 18, 0.2);
}

.cal-exec-kpi.danger {
    background: rgba(231, 76, 60, 0.08);
    border-color: rgba(231, 76, 60, 0.2);
}

.cal-exec-kpi-big {
    font-size: 1.4em;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
}

.cal-exec-kpi-big small {
    font-size: 0.55em;
    font-weight: 600;
    color: var(--text-secondary);
}

.cal-exec-kpi.warn .cal-exec-kpi-big {
    color: #f39c12;
}

.cal-exec-kpi.danger .cal-exec-kpi-big {
    color: #e74c3c;
}

.cal-exec-kpi-label {
    font-size: 0.62em;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-top: 2px;
}

/* === Weekly Summary Bar === */
.cal-exec-week {
    margin-top: 16px;
    padding: 8px 12px;
    background: rgba(52, 152, 219, 0.06);
    border: 1px solid rgba(52, 152, 219, 0.12);
    border-radius: 10px;
}

.cal-exec-week-title {
    font-size: 0.58em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.cal-exec-week-info {
    font-size: 0.75em;
    font-weight: 600;
    color: var(--text);
}

/* === Resumo Semanal Widget (mobile + desktop) === */
.resumo-semanal-widget {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 16px;
    margin: 10px 0;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.resumo-semanal-tabs {
    display: flex;
    gap: 0;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 10px;
    padding: 3px;
    margin-bottom: 14px;
}

.resumo-tab {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    font-size: 0.75em;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.resumo-tab.active {
    background: var(--card-bg);
    color: var(--primary);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.resumo-sem-kpis {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

.resumo-sem-row2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.resumo-sem-kpi {
    text-align: center;
    padding: 12px 8px;
    border-radius: 12px;
    background: rgba(46, 204, 113, 0.04);
    border: 1px solid var(--border-color);
}

.resumo-sem-kpi.small {
    padding: 10px 8px;
}

.resumo-sem-big {
    font-size: 1.3em;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
}

.resumo-sem-big small {
    font-size: 0.5em;
    font-weight: 600;
    color: var(--text-secondary);
}

.resumo-sem-label {
    font-size: 0.62em;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-top: 4px;
}

/* === Tab Card Wrapper (tabs + card, no gap) === */
.tab-card-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Only remove top border-radius on mobile (where tabs are visible) */
@media (max-width: 899px) {
    .tab-card-wrapper .card-plantao-hoje {
        border-top-left-radius: 0 !important;
        border-top-right-radius: 0 !important;
        margin-top: 0 !important;
    }
}

.tab-card-wrapper #lista-plantoes-hoje,
.tab-card-wrapper #calendario-mobile {
    margin-top: 0;
}

/* === Chrome-style Tabs === */
.chrome-tabs-bar {
    display: flex;
    gap: 0;
    padding: 0;
    align-items: flex-end;
}

.chrome-tab {
    flex: 1;
    margin: 0;
    padding: 8px 18px;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    background: rgba(0, 0, 0, 0.04);
    font-size: 0.8em;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chrome-tab.active {
    background: linear-gradient(135deg, rgba(74, 159, 191, 0.85), rgba(61, 149, 179, 0.8));
    color: #fff;
    border-color: rgba(74, 159, 191, 0.6);
    box-shadow: 0 -2px 8px rgba(74, 159, 191, 0.3);
    height: 44px;
    font-weight: 800;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

/* Tabs follow fim-expediente green variant */
.chrome-tab.active.tab-fim-expediente {
    background: linear-gradient(135deg, #88d4aa, #6fc3a0);
    color: #1b4b3a;
    border-color: rgba(111, 195, 160, 0.6);
    box-shadow: 0 -2px 8px rgba(111, 195, 160, 0.3);
}

.chrome-tab:not(.active).tab-fim-expediente {
    background: rgba(111, 195, 160, 0.15);
    color: #1b4b3a;
}

.chrome-tab:not(.active):hover {
    background: rgba(126, 200, 227, 0.15);
}

.chrome-tab:not(.active).tab-fim-expediente:hover {
    background: rgba(111, 195, 160, 0.25);
}

/* Mobile calendar container */
.mini-cal-container-mobile {
    background: var(--card-bg);
    border-radius: 0 0 16px 16px;
    padding: 20px 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.mini-cal-title {
    text-align: center;
    font-weight: 800;
    font-size: 1em;
    margin-bottom: 8px;
    color: var(--text);
}

/* ====== DARK MODE OVERRIDES (tema pastel azul) ====== */

body.dark-mode .card-plantao-hoje {
    background: linear-gradient(135deg, rgba(30, 70, 95, 0.9), rgba(25, 60, 85, 0.85));
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

body.dark-mode .card-plantao-hoje.fim-expediente {
    background: linear-gradient(135deg, rgba(30, 80, 55, 0.9), rgba(25, 70, 50, 0.85));
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
    color: #a3e4c4;
}

body.dark-mode .card-plantao-hoje.fim-expediente h3,
body.dark-mode .card-plantao-hoje.fim-expediente p {
    color: #c8f0dc;
}

body.dark-mode .card-plantao-hoje.fim-expediente .transito-item span {
    color: #a3e4c4;
}

body.dark-mode .card-plantao-hoje.fim-expediente .transito-item strong,
body.dark-mode .card-plantao-hoje.fim-expediente .transito-item strong span {
    color: #6ee7b7 !important;
}

body.dark-mode .card-plantao-hoje.fim-expediente #transito-tempo {
    color: #6ee7b7 !important;
}

body.dark-mode .card-plantao-hoje.fim-expediente .highlight {
    color: #6ee7b7 !important;
}

body.dark-mode .destaque-valor {
    color: #4ade80;
}

body.dark-mode .card-plantao-hoje.fim-expediente .destaque-valor {
    color: #6ee7b7;
}

body.dark-mode .endereco-casa {
    color: rgba(255, 255, 255, 0.6);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .card-plantao-hoje.fim-expediente .endereco-casa {
    color: rgba(200, 240, 220, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Dark mode tab override for fim-expediente */
body.dark-mode .chrome-tab.active.tab-fim-expediente {
    background: linear-gradient(135deg, rgba(30, 80, 55, 0.9), rgba(25, 70, 50, 0.85));
    color: #c8f0dc;
    border-color: rgba(80, 160, 120, 0.4);
}

body.dark-mode .chrome-tab:not(.active).tab-fim-expediente {
    background: rgba(80, 160, 120, 0.1);
    color: rgba(200, 240, 220, 0.6);
}

body.dark-mode .transito-grid {
    background: rgba(0, 0, 0, 0.25);
}

body.dark-mode .transito-item span {
    color: #7ec8e3;
}

body.dark-mode .transito-item strong {
    color: #e0e0e0;
}

body.dark-mode #transito-tempo {
    color: #e0e0e0;
}

body.dark-mode .highlight {
    color: #ffd966 !important;
}

body.dark-mode .waze-btn {
    background: linear-gradient(135deg, rgba(91, 181, 213, 0.8), rgba(74, 168, 199, 0.75));
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark-mode .waze-btn.btn-casa {
    background: linear-gradient(135deg, rgba(80, 160, 120, 0.8), rgba(70, 150, 110, 0.75));
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark-mode .chrome-tab.active {
    background: linear-gradient(135deg, rgba(30, 70, 95, 0.9), rgba(25, 60, 85, 0.85));
    border-color: rgba(91, 181, 213, 0.4);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .ai-command-send {
    background: linear-gradient(135deg, rgba(91, 181, 213, 0.7), rgba(74, 168, 199, 0.65)) !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

body.dark-mode .toggle-metas .mes-shortcut.active-mes {
    background: linear-gradient(135deg, rgba(91, 181, 213, 0.8), rgba(74, 168, 199, 0.75));
    border-color: rgba(91, 181, 213, 0.5);
}

body.dark-mode .clima-widget,
body.dark-mode .fatigue-widget {
    color: #7ec8e3 !important;
    background: rgba(30, 30, 30, 0.5) !important;
    border-color: rgba(91, 181, 213, 0.2) !important;
}

body.dark-mode .transito-item {
    border-right-color: rgba(255, 255, 255, 0.15);
}

body.dark-mode .chrome-tab {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.5);
}

body.dark-mode .chrome-tab:not(.active):hover {
    background: rgba(255, 255, 255, 0.12);
}

body.dark-mode .toggle-metas button {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .toggle-metas button.active {
    background: var(--secondary);
    color: #fff;
    border-color: var(--secondary);
}

body.dark-mode .toggle-metas .mes-shortcut {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.12);
}

body.dark-mode .card-plantao-hoje[style*="var(--card-bg)"] {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
    color: var(--text) !important;
}

body.dark-mode .mini-cal-container-mobile {
    background: var(--card-bg);
    border-color: var(--border-color);
}

/* === FORCE UPDATE BLOCKER === */
#update-blocker {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.update-blocker-card {
    background: var(--card-bg, #fff);
    border-radius: 20px;
    padding: 32px 28px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.1));
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(40px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#btn-forcar-update:hover {
    transform: scale(1.03);
}

#btn-forcar-update:active {
    transform: scale(0.97);
}