body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: #0b132b;
    color: #fff;
}

.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(5, 8, 20, 0.9);
    backdrop-filter: blur(6px);
}

.login-overlay.hidden {
    display: none;
}

.login-box {
    width: min(380px, 100%);
    padding: 28px;
    border-radius: 16px;
    background: linear-gradient(180deg, #1d2a57 0%, #111a3a 100%);
    border: 1px solid #3a86ff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.login-title {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
}

.login-subtitle {
    margin: 6px 0 18px;
    font-size: 14px;
    color: #b8cdfd;
}

.login-label {
    display: block;
    margin: 12px 0 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #96b7ff;
}

.login-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #4d78d4;
    background: #0d1531;
    color: #fff;
    font-size: 15px;
}

.login-error {
    margin-top: 12px;
    color: #ffb3c1;
    font-size: 13px;
}

.login-button {
    width: 100%;
    margin-top: 18px;
    padding: 12px 16px;
    border-radius: 10px;
    background: #3a86ff;
    border-color: #3a86ff;
    font-size: 15px;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: #111a3a;
    border-bottom: 2px solid #3a86ff;
    gap: 10px;
}

.brand {
    font-weight: bold;
    color: #3a86ff;
    font-size: 20px;
}

.header-nav {
    display: flex;
    gap: 6px;
}

.nav-btn {
    padding: 8px 16px;
    border: 1px solid #3a86ff;
    border-radius: 8px;
    background: #1c2541;
    color: #fff;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
}

.nav-btn.active {
    background: #3a86ff;
    box-shadow: 0 0 10px rgba(58, 134, 255, 0.5);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nome-logado {
    font-size: 13px;
    color: #96b7ff;
    font-weight: 600;
}

.logout-button {
    padding: 8px 14px;
    background: #1d2a57;
    border: 1px solid #5b8fff;
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

.main-title-banner {
    background: linear-gradient(90deg, #111a3a 0%, #3a86ff 50%, #111a3a 100%);
    text-align: center;
    padding: 15px;
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
    border-bottom: 1px solid #4cc9f0;
}

.status-banner {
    margin: 10px 20px 0;
    padding: 10px 14px;
    border-radius: 8px;
    background: #273469;
    color: #dce7ff;
    font-size: 13px;
}

.status-banner.error {
    background: #5c1d2b;
    color: #ffe3e7;
}

.status-banner.warn {
    background: #5e4b12;
    color: #fff2c4;
}

.filters {
    padding: 15px 20px;
    background: #141e46;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filters-main {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: flex-start;
}

.filter-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
}

.filter-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(28, 37, 65, 0.9);
    border: 1px solid #2f4f9c;
    border-radius: 12px;
}

.filters-advanced {
    border: 1px solid #2f4f9c;
    border-radius: 12px;
    background: rgba(28, 37, 65, 0.82);
    padding: 10px 14px 14px;
}

.filters-advanced summary {
    cursor: pointer;
    color: #96b7ff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    list-style: none;
}

.filters-advanced summary::-webkit-details-marker {
    display: none;
}

.filters-advanced-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.filter-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #96b7ff;
}

.filter-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    width: auto;
}

.config-capacidade {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.capacidade-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid #3a86ff;
    border-radius: 8px;
    background: #1c2541;
}

.capacidade-item label {
    font-size: 13px;
    font-weight: 600;
}

button {
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    background: #1c2541;
    color: #fff;
    cursor: pointer;
    font-weight: bold;
    border: 1px solid #3a86ff;
    white-space: nowrap;
}

button.active {
    background-color: #3a86ff !important;
    box-shadow: 0 0 10px rgba(58, 134, 255, 0.5);
}

.capacidade-item input {
    width: 64px;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #8fb6ff;
    background: #0f1738;
    color: #fff;
}

.btn-exclusao {
    background: #2b355f;
    border-color: #8fb6ff;
}

.btn-exclusao.excluida {
    background: #5c1d2b !important;
    border-color: #ff8aa1;
    color: #ffe3e7;
    box-shadow: none;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

select {
    padding: 8px 10px;
    border-radius: 4px;
    background: #1c2541;
    color: white;
    border: 1px solid #3a86ff;
}

.cardbar {
    display: flex;
    gap: 10px;
    padding: 10px;
}

.card {
    flex: 1;
    background: linear-gradient(180deg, #24305a 0%, #1c2541 100%);
    padding: 18px 15px 12px;
    border-radius: 10px;
    text-align: center;
    border-bottom: 3px solid #3a86ff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.big {
    font-size: 32px;
    font-weight: bold;
    color: #4cc9f0;
    line-height: 1.1;
    letter-spacing: 0.02em;
}

.card-label {
    margin-top: 6px;
    font-size: 14px;
    color: #f5f8ff;
    font-weight: 600;
}

.card-sub {
    margin-top: 6px;
    font-size: 12px;
    color: #9fc1ff;
    font-weight: 600;
}

.container {
    display: flex;
    gap: 10px;
    padding: 10px;
    min-height: 480px;
}

.left,
.right {
    flex: 1;
    background: #1c2541;
    padding: 15px;
    border-radius: 10px;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.chart-wrapper {
    flex-grow: 1;
    position: relative;
}

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

.legend-custom {
    font-size: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

th {
    padding: 8px;
    background: #111a3a;
    color: #3a86ff;
}

td,
th {
    border: 1px solid #2a3b6b;
    text-align: center;
}

#calendar td {
    height: 85px;
    vertical-align: middle;
    position: relative;
    width: 14.2%;
}

.day {
    position: absolute;
    top: 4px;
    left: 6px;
    font-weight: bold;
}

.cell-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
}

canvas {
    flex-grow: 1;
    width: 100% !important;
}

@media (max-width: 768px) {
    .filters-main {
        flex-direction: column;
    }

    .filter-inline {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-title-banner {
        font-size: 18px;
        padding: 10px;
    }

    .cardbar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .big {
        font-size: 26px;
    }

    .container {
        flex-direction: column;
    }

    .left {
        flex: none;
        height: auto;
        min-height: unset;
    }

    #calendar {
        height: auto;
    }

    #calendar td {
        height: 95px;
        padding: 6px;
    }

    .right {
        flex: none;
        height: 260px;
    }

    .container.modo-geral .left,
    .container.modo-geral .right {
        height: 360px;
    }

    canvas {
        height: 100% !important;
    }

    .prod-cards {
        flex-direction: column;
        padding: 6px;
    }

    .prod-card {
        padding: 14px 12px 10px;
    }

    .prod-card-big {
        font-size: 28px;
    }

    .prod-charts {
        flex-direction: column;
    }

    .prod-chart-box {
        height: 280px !important;
        min-height: 240px;
    }

    .prod-table-wrapper {
        overflow-x: auto;
        padding: 6px;
        -webkit-overflow-scrolling: touch;
    }

    .prod-table {
        min-width: 700px;
    }

    .prod-subtabs {
        padding: 6px 6px 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .prod-subtab {
        padding: 8px 16px;
        font-size: 12px;
        white-space: nowrap;
    }

    /* ANALISE GERAL: card-view em mobile */
    .analise-tabela { display: none; }
    .analise-cards { display: flex; flex-direction: column; gap: 8px; padding: 4px; }

    .header-container {
        padding: 10px 12px;
        flex-wrap: wrap;
        gap: 6px;
    }

    .brand {
        font-size: 16px;
    }

    .header-nav {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .nav-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .header-right {
        gap: 6px;
    }

    .nome-logado {
        font-size: 11px;
    }

    .filters {
        padding: 10px;
    }

    .cal-quick {
        flex-wrap: wrap;
    }

    .cal-quick button, .cal-qbtn {
        padding: 4px 8px !important;
        font-size: 10px !important;
    }

    .cal-grid {
        font-size: 11px;
    }

    .cal-day {
        padding: 4px 1px;
    }

    .timeline-user {
        margin-bottom: 8px;
    }

    .timeline-header {
        padding: 8px 10px;
        flex-wrap: wrap;
        gap: 4px;
    }

    .timeline-sessao {
        flex-wrap: wrap;
        gap: 6px;
    }

    .login-box {
        padding: 20px;
    }
}

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

@media (min-width: 769px) {
    .analise-cards { display: none; }
    .analise-tabela { display: block; }
}

/* Cards mobile da Analise Geral */
.analise-card {
    background: #0f1738;
    border: 1px solid #2f4f9c;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 12px;
    color: #c4dbff;
}
.analise-card.corpo-mole { background: rgba(233,69,96,0.08); border-color: #5c1d2b; }
.analise-card-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.analise-card-sigla { font-weight: 700; color: #4cc9f0; font-size: 14px; }
.analise-card-nome { color: #96b7ff; font-size: 11px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.analise-card-row { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; }
.analise-card-row b { color: #fff; font-weight: 700; }
.analise-card-where { background: #66bb6a; color: #0a1230; padding: 1px 6px; border-radius: 3px; font-weight: 700; font-size: 10px; }

/* ── Produtividade ──────────────────────────────────────────────── */

.prod-cards {
    display: flex;
    gap: 10px;
    padding: 10px;
}

.prod-card {
    flex: 1;
    padding: 18px 15px 14px;
    border-radius: 10px;
    text-align: center;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.prod-card-phone {
    background: linear-gradient(180deg, #1a3a5c 0%, #0f2744 100%);
    border-bottom: 3px solid #3a86ff;
}

.prod-card-whats {
    background: linear-gradient(180deg, #1a3c2a 0%, #0f2a1a 100%);
    border-bottom: 3px solid #25d366;
}

.prod-card-consolid {
    background: linear-gradient(180deg, #2d2a4a 0%, #1a1840 100%);
    border-bottom: 3px solid #f2c94c;
}

.prod-card-icon {
    font-size: 28px;
    margin-bottom: 4px;
}

.prod-card-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #96b7ff;
    margin-bottom: 6px;
}

.prod-card-big {
    font-size: 36px;
    font-weight: bold;
    color: #4cc9f0;
    line-height: 1.1;
}

.prod-card-label {
    font-size: 13px;
    color: #f5f8ff;
    font-weight: 600;
    margin-top: 4px;
}

.prod-card-sub {
    font-size: 12px;
    color: #9fc1ff;
    margin-top: 4px;
}

.prod-table-wrapper {
    padding: 10px;
}

.prod-subtabs {
    display: flex;
    gap: 0;
    padding: 10px 10px 0;
}

.prod-subtab {
    padding: 10px 24px;
    border: 1px solid #3a86ff;
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    background: #1c2541;
    color: #96b7ff;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.08em;
    cursor: pointer;
}

.prod-subtab.active {
    background: #3a86ff;
    color: #fff;
    box-shadow: 0 0 10px rgba(58, 134, 255, 0.3);
}

.prod-section-title {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: #3a86ff;
    padding: 16px 0 6px;
    border-bottom: 1px solid #2f4f9c;
    margin-bottom: 8px;
    margin-top: 10px;
}

.prod-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    background: #1c2541;
    border-radius: 10px;
    overflow: hidden;
}

.prod-table thead th {
    padding: 10px 8px;
    background: #111a3a;
    color: #3a86ff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.prod-table tbody td {
    padding: 8px;
    border-top: 1px solid #2a3b6b;
    color: #dce7ff;
}

.prod-table tbody tr:hover {
    background: rgba(58, 134, 255, 0.1);
}

.prod-charts {
    display: flex;
    gap: 10px;
    padding: 0 10px 10px;
}

.prod-chart-box {
    flex: 1;
    background: #1c2541;
    padding: 15px;
    border-radius: 10px;
    min-height: 350px;
    display: flex;
    flex-direction: column;
}

.prod-chart-box b {
    color: #f5f8ff;
    margin-bottom: 8px;
}

.prod-chart-box .chart-wrapper {
    flex: 1;
    position: relative;
    min-height: 280px;
}

.num-cell {
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.rank-cell {
    text-align: center;
    font-weight: bold;
    color: #f2c94c;
    width: 30px;
}

.total-cell {
    font-weight: bold;
    color: #4cc9f0;
    background: rgba(58, 134, 255, 0.08);
}

.total-row {
    background: #111a3a;
    font-weight: bold;
}

.prod-detalhe {
    margin: 8px 0;
    border: 1px solid #2f4f9c;
    border-radius: 8px;
    padding: 8px 12px;
    background: rgba(28, 37, 65, 0.5);
}

.prod-detalhe summary {
    cursor: pointer;
    color: #96b7ff;
    font-size: 12px;
    font-weight: 600;
}

.prod-table-sm { font-size: 11px; }

.btn-ocultar {
    background: transparent;
    border: 1px solid #5c1d2b;
    color: #ff8aa1;
    padding: 2px 6px;
    font-size: 10px;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.5;
}

.btn-ocultar:hover { opacity: 1; }

.setor-marc { color: #3a86ff; font-weight: 600; font-size: 11px; }
.setor-recep { color: #25d366; font-weight: 600; font-size: 11px; }

.timeline-user {
    margin-bottom: 12px;
    border: 1px solid #2f4f9c;
    border-radius: 10px;
    overflow: hidden;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #1c2541;
    cursor: pointer;
}

.timeline-header:hover { background: #243052; }

.timeline-sigla {
    font-weight: bold;
    color: #3a86ff;
    font-size: 14px;
    min-width: 50px;
}

.timeline-nome {
    flex: 1;
    color: #dce7ff;
    font-size: 13px;
    margin-left: 10px;
}

.timeline-sessoes {
    padding: 0 14px 10px;
    background: #141e3a;
}

.timeline-sessao {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(47, 79, 156, 0.3);
    font-size: 12px;
}

.timeline-hora {
    color: #f2c94c;
    font-weight: bold;
    min-width: 55px;
}

.timeline-host {
    color: #4cc9f0;
    font-weight: 600;
    min-width: 120px;
}

.timeline-ramal {
    color: #96b7ff;
    min-width: 70px;
}

.timeline-setor-tag {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.tag-marcacao { background: rgba(58,134,255,0.2); color: #3a86ff; }
.tag-recepcao { background: rgba(37,211,102,0.2); color: #25d366; }
.tag-adm { background: rgba(242,201,76,0.2); color: #f2c94c; }
.tag-ti { background: rgba(155,89,182,0.2); color: #9b59b6; }
.tag-outro { background: rgba(150,183,255,0.15); color: #96b7ff; }

.btn-restaurar {
    background: #1c2541;
    border: 1px solid #3a86ff;
    color: #96b7ff;
    padding: 2px 8px;
    font-size: 11px;
    border-radius: 4px;
    cursor: pointer;
    margin: 0 2px;
}

/* ── Painel Usuarios ────────────────────────────────────────────── */

.user-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 14px;
    background: rgba(28, 37, 65, 0.9);
    border: 1px solid #2f4f9c;
    border-radius: 12px;
}

.user-form .login-input {
    padding: 8px 10px;
    font-size: 13px;
}
