/* ==========================================================================
   1. RESET GLOBAL E REGRAS BASE DO TEMPLATE
   ========================================================================== */
html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: 100% !important;
    box-sizing: border-box;
}

.full-screen-container {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    min-height: 100vh !important;
    box-sizing: border-box;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

h1:focus {
    outline: none;
}

.validation-message {
    color: #e50000;
}

/* ==========================================================================
   2. ESTRUTURA GERAL DA PÁGINA DE LOGIN
   ========================================================================== */
.login-container {
    display: flex;
    min-height: 100vh;
    background-color: #ffffff;
    box-sizing: border-box;
}

.info-panel {
    background-color: #004B93;
    color: #ffffff;
    width: 50%;
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 700;
}

.logo-icon {
    background-color: #ffffff;
    color: #004B93;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-weight: 800;
}

.logo-sub {
    color: #6BA4FF;
}

.info-content h1 {
    font-size: 38px;
    margin-bottom: 20px;
    line-height: 1.25;
    font-weight: 700;
}

.info-content p {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 40px;
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .features-list li {
        margin-bottom: 16px;
        position: relative;
        padding-left: 24px;
        font-size: 15px;
    }

        .features-list li::before {
            content: "•";
            color: #6BA4FF;
            position: absolute;
            left: 4px;
            font-size: 24px;
        }

.form-panel {
    width: 50%;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    box-sizing: border-box;
}

.form-box {
    width: 100%;
    max-width: 440px;
}

    .form-box h2 {
        font-size: 28px;
        color: #111111;
        margin-bottom: 6px;
        font-weight: 700;
    }

.subtitle {
    color: #666666;
    font-size: 14px;
    margin-bottom: 35px;
}

.input-group {
    margin-bottom: 24px;
    position: relative;
}

    .input-group .rz-label {
        display: block;
        font-size: 14px;
        color: #333333;
        margin-bottom: 8px;
    }

    .input-group .rz-textbox, .input-group .rz-password {
        border: 1px solid #004B93 !important;
        padding: 12px 14px !important;
        width: 100%;
    }

    .input-group .rz-message-error {
        font-size: 12px !important;
        color: #dc3545 !important;
        position: absolute;
        bottom: -20px;
    }

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    margin: 28px 0;
}

.forgot-link {
    color: #004B93;
    text-decoration: none;
}

.btn-submit-radzen {
    background-color: #004B93 !important;
    color: #ffffff !important;
    height: 48px !important;
    font-weight: 600 !important;
    border: none !important;
    cursor: pointer;
}

    .btn-submit-radzen:hover {
        background-color: #00366b !important;
    }

/* ==========================================================================
   3. PAINEL DE ADMINISTRAÇÃO (EIXO HORIZONTAL OBRIGATÓRIO)
   ========================================================================== */
.admin-dashboard-container {
    display: flex !important;
    flex-direction: row !important;
    min-height: 100vh !important;
    width: 100% !important;
    background-color: #F1F5F9 !important;
}

.sidebar-admin {
    width: 260px !important;
    background-color: #031B33 !important;
    color: #ffffff !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
}

.logo-text-group {
    display: flex;
    flex-direction: column;
}

.logo-admin-tag {
    font-size: 11px;
    color: #6BA4FF;
    text-transform: uppercase;
    font-weight: bold;
}

.user-profile-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 25px;
}

    .user-profile-box .avatar {
        background-color: #0056B3;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: bold;
    }

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.user-status {
    margin: 0;
    font-size: 11px;
    color: #22C55E;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-section-title {
    font-size: 11px;
    color: #64748B;
    font-weight: 700;
    margin: 20px 0 8px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #94A3B8;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 14px;
}

    .nav-item:hover {
        color: #ffffff;
        background-color: rgba(255, 255, 255, 0.02);
    }

/* Ativação automática do item do menu pelo Razor NavLink */
.sidebar-nav .active {
    background-color: #004B93 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

.badge-live {
    background-color: #22C55E;
    color: white;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: auto;
    font-weight: bold;
}

.main-content-admin {
    flex-grow: 1 !important;
    padding: 30px !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
    height: 100vh !important;
    background-color: #F1F5F9 !important;
}

/* ==========================================================================
   4. CONTEÚDO DO DASHBOARD (MÉTRICAS E MAPAS)
   ========================================================================== */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
}

.system-status-tag {
    font-size: 11px;
    color: #22C55E;
    font-weight: bold;
}

.dashboard-header h1 {
    font-size: 32px;
    margin: 5px 0;
    font-weight: 700;
    color: #031B33;
}

.subtitle-municipio {
    font-size: 13px;
    color: #64748B;
    margin: 0;
}

.header-right-area {
    text-align: right;
}

.clock-display {
    font-size: 28px;
    font-weight: bold;
    color: #031B33;
}

.date-display {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 10px;
}

.filter-pills-row {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.pill-filter {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    background: #ffffff;
    border: 1px solid #E2E8F0;
}

    .pill-filter.active {
        background-color: #004B93;
        color: white;
        border-color: #004B93;
    }

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.metric-card {
    background: #ffffff !important;
    border-radius: 8px !important;
    padding: 15px !important;
    border: 1px solid #E2E8F0 !important;
}

.metric-label {
    font-size: 12px;
    color: #64748B;
    display: block;
}

.metric-value-row {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
}

.metric-number {
    font-size: 24px;
    font-weight: bold;
}

.metric-trend {
    font-size: 11px;
}

.dashboard-middle-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.territory-panel, .alerts-panel {
    background: #ffffff !important;
    border: 1px solid #E2E8F0 !important;
    padding: 20px !important;
    border-radius: 8px !important;
}

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

    .panel-header h3 {
        font-size: 16px;
        margin: 0;
        font-weight: 700;
        color: #031B33;
    }

.territory-blocks-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    background-color: #031B33;
    padding: 15px;
    border-radius: 8px;
}

.block-cell {
    padding: 20px;
    border-radius: 6px;
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
}

    .block-cell strong {
        font-size: 18px;
        font-weight: bold;
    }

.bg-orange {
    background-color: #D97706;
}

.bg-red {
    background-color: #DC2626;
}

.bg-green {
    background-color: #059669;
}

.bg-darkgreen {
    background-color: #064E3B;
}

.panel-header-alerts {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.alerts-count-badge {
    background-color: #FEE2E2;
    color: #EF4444;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: bold;
}

.alerts-list-scroll {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alert-item {
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
    display: flex;
    flex-direction: column;
}

.alert-danger {
    background-color: #FEE2E2;
    border-left: 4px solid #EF4444;
    color: #991B1B;
}

.alert-warning {
    background-color: #FEF3C7;
    border-left: 4px solid #F59E0B;
    color: #92400E;
}

.alert-info {
    background-color: #E0F2FE;
    border-left: 4px solid #0EA5E9;
    color: #075985;
}

.dashboard-bottom-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.chart-card-static {
    background: #ffffff !important;
    border: 1px solid #E2E8F0 !important;
    padding: 20px !important;
    border-radius: 8px !important;
}

.static-bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 120px;
    border-bottom: 2px solid #E2E8F0;
}

.chart-bar {
    flex-grow: 1;
    background-color: #004B93;
    border-radius: 4px 4px 0 0;
}

.env-indicators-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.env-row-item {
    padding: 10px;
    background-color: #F8FAFC;
    border-radius: 6px;
    font-size: 14px;
}

.demo-card {
    background-color: #F8FAFC !important;
    border: 1px solid #E2E8F0 !important;
    margin-top: 35px !important;
    padding: 15px;
}

.demo-title {
    color: #64748B;
    font-weight: 600;
    font-size: 13px;
}

.demo-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 5px;
}

    .demo-row span {
        color: #E28743;
    }

.demo-pass {
    border-top: 1px dashed #CBD5E1;
    margin-top: 10px;
    padding-top: 10px;
    text-align: center;
    font-size: 13px;
}

@media (max-width: 1024px) {
    .metrics-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .dashboard-middle-row, .dashboard-bottom-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .login-container, .admin-dashboard-container {
        flex-direction: column !important;
    }

    .info-panel, .form-panel {
        width: 100%;
    }

    .sidebar-admin {
        width: 100% !important;
    }
}
