* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: Arial, Helvetica, sans-serif;
    background: #eef2f7;
    color: #111827;
}

:root {
    --sidebar-w: clamp(150px, 8vw, 175px);
    --topbar-h: clamp(34px, 3.6vh, 46px);
    --blue-dark: #004f7c;
    --blue-mid: #00689b;
    --blue-soft: #7fa6bc;
    --active: #44aee0;
}

.app {
    width: 100vw;
    height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    overflow: hidden;
    background: #eef2f7;
}

/* ================= SIDEBAR ================= */

.sidebar {
    height: 100vh;
    background: linear-gradient(180deg, #00446f 0%, #005b8a 50%, #00446f 100%);
    color: white;
    padding: clamp(8px, 0.9vh, 13px) clamp(8px, 0.8vw, 11px);
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: clamp(8px, 1vh, 13px);
    box-shadow: 5px 0 12px rgba(15, 23, 42, 0.22);
    border-right: 2px solid rgba(255, 255, 255, 0.28);
    border-bottom-right-radius: 42px;
    overflow: hidden;
    z-index: 10;
}

.logo-box {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: clamp(44px, 7.5vh, 80px);
    padding: 2px 3px;
}

.side-logo {
    width: 100%;
    max-width: 132px;
    max-height: clamp(38px, 6.4vh, 72px);
    object-fit: contain;
    display: block;
}

.side-logo-fallback {
    align-items: center;
    justify-content: center;
    width: 100%;
    font-size: clamp(17px, 1.3vw, 23px);
    font-weight: 950;
    letter-spacing: -0.6px;
    text-align: center;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: clamp(7px, 1vh, 11px);
    min-height: 0;
    overflow: hidden;
}

.menu-btn {
    width: 100%;
    border: 2px solid rgba(255, 255, 255, 0.92);
    background: rgba(168, 189, 199, 0.78);
    color: white;
    border-radius: 8px;
    padding: clamp(7px, 0.85vh, 10px) 6px;
    font-size: clamp(11px, 0.8vw, 14px);
    line-height: 1.1;
    font-weight: 900;
    cursor: pointer;
    text-align: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.30);
    transition: all 0.18s ease;
    min-height: clamp(28px, 3.6vh, 38px);
    font-family: inherit;
}

.menu-btn:hover {
    transform: translateY(-1px);
    background: rgba(130, 177, 201, 0.96);
}

.menu-btn.active {
    background: var(--active);
    color: white;
    border-color: rgba(255, 255, 255, 0.96);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
}

.side-pld {
    align-self: end;
    margin-bottom: clamp(18px, 3.2vh, 34px);
    padding: 0 clamp(4px, 0.4vw, 8px);
    color: white;
    min-height: 0;
}

.pld-title {
    font-size: clamp(12px, 0.9vw, 16px);
    font-weight: 950;
    margin-bottom: 1px;
    text-transform: uppercase;
    letter-spacing: -0.2px;
}

.pld-month {
    font-size: clamp(11px, 0.8vw, 14px);
    font-weight: 900;
    margin-bottom: clamp(5px, 0.8vh, 8px);
    opacity: 0.95;
}

.pld-row {
    border-left: 3px solid white;
    padding-left: clamp(6px, 0.55vw, 9px);
    margin-bottom: clamp(4px, 0.75vh, 7px);
    line-height: 1.05;
}

.pld-sub {
    font-size: clamp(12px, 0.9vw, 15px);
    font-weight: 950;
}

.pld-val {
    font-size: clamp(13px, 1vw, 17px);
    font-weight: 950;
    margin-top: 2px;
}

.pld-empty {
    font-size: clamp(10px, 0.75vw, 12px);
    font-weight: 800;
    opacity: 0.85;
}

/* ================= MAIN ================= */

.main {
    min-width: 0;
    min-height: 0;
    height: 100vh;
    display: grid;
    grid-template-rows: var(--topbar-h) minmax(0, 1fr);
    overflow: hidden;
    background: #eef2f7;
}

.topbar {
    background: #eef2f7;
    padding: 0 clamp(10px, 1vw, 16px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.24);
    min-width: 0;
}

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

.page-title {
    font-size: clamp(16px, 1.2vw, 22px);
    font-weight: 950;
    color: #1f2937;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-date {
    font-size: clamp(10px, 0.72vw, 12px);
    font-weight: 850;
    color: #4b5563;
    white-space: nowrap;
}

.stale-banner {
    font-size: clamp(10px, 0.72vw, 12px);
    font-weight: 850;
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 999px;
    padding: 4px 10px;
    white-space: nowrap;
}

.content {
    min-width: 0;
    min-height: 0;
    position: relative;
    overflow: auto;
    padding: 10px 18px 16px 18px;
}

.module {
    display: none;
}

.module.active {
    display: block;
}

/* ================= CARDS (shared) ================= */

.cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 10px;
}

.card {
    background: white;
    border-radius: 14px;
    padding: 11px 14px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
    text-align: center;
}

.card.clickable {
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.card.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.13);
}

.card.inactive {
    opacity: 0.35;
    filter: grayscale(0.8);
}

.empty-state {
    grid-column: 1 / -1;
    background: white;
    border-radius: 14px;
    padding: 28px 20px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    font-weight: 700;
}

.sub-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 6px;
}

.line-symbol {
    width: 38px;
    height: 4px;
    border-radius: 10px;
    position: relative;
}

.line-symbol::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 13px;
    height: 13px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: inherit;
}

.media {
    font-size: 23px;
    font-weight: bold;
    margin-bottom: 2px;
}

.desc {
    font-size: 12px;
    color: #4b5563;
}

/* ================= PLD DIÁRIO ================= */

.header-compacto {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 8px;
    min-height: 30px;
}

.top-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

.top-controls label {
    font-size: 14px;
    color: #374151;
    font-weight: bold;
}

.top-controls select {
    padding: 7px 13px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: white;
    color: #111827;
    font-size: 14px;
    font-weight: bold;
    outline: none;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.05);
    font-family: inherit;
}

.hint {
    text-align: center;
    margin-top: -4px;
    margin-bottom: 8px;
    color: #4b5563;
    font-size: 13px;
}

.chart-box {
    background: white;
    border-radius: 16px;
    padding: 10px 14px 8px 14px;
    box-shadow: 0 7px 22px rgba(15, 23, 42, 0.08);
}

#grafico-pld {
    width: 100%;
    height: calc(100vh - 330px);
    min-height: 420px;
}

.footer {
    margin-top: 4px;
    font-size: 12px;
    color: #374151;
}

/* ================= EAR / RESERVATÓRIOS ================= */

.module-header-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 8px;
}

.module-title {
    font-size: 24px;
    font-weight: 900;
    color: #111827;
}

.module-subtitle {
    font-size: 14px;
    color: #2b9bd8;
    font-weight: 900;
    margin-top: 4px;
}

.updated {
    color: #4b5563;
    font-size: 12px;
    font-weight: 700;
}

.card-value {
    font-size: 28px;
    font-weight: 900;
    color: #020617;
}

.grid-charts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.chart-card {
    background: white;
    border-radius: 12px;
    padding: 10px 14px 6px 14px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
    height: 280px;
}

.chart-card .chart-title {
    font-size: 15px;
    font-weight: 900;
    color: #111827;
    margin-bottom: 2px;
}

.chart-card .chart {
    width: 100%;
    height: calc(100% - 22px);
}

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

/* ================= NOTÍCIAS ================= */

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

.news-wrapper {
    background: white;
    border-radius: 18px;
    padding: 8px 28px 20px 28px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.news-card {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 24px;
    padding: 22px 0;
    border-bottom: 1px solid #d1d5db;
    align-items: center;
}

.news-card:last-child {
    border-bottom: none;
}

.news-image-link {
    display: block;
    text-decoration: none;
}

.news-placeholder {
    width: 100%;
    height: 190px;
    border-radius: 12px;
    background: linear-gradient(135deg, #004d7f, #38aee0);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 26px;
    font-weight: 900;
    text-align: center;
    padding: 14px;
}

.news-source {
    font-size: 14px;
    color: #444;
    font-weight: 800;
    margin-bottom: 8px;
}

.news-title {
    display: block;
    color: #c91414;
    font-size: 24px;
    font-weight: 900;
    line-height: 1.08;
    text-decoration: none;
    margin-bottom: 10px;
}

.news-title:hover {
    text-decoration: underline;
}

.news-summary {
    color: #c91414;
    font-size: 15px;
    line-height: 1.4;
    margin-bottom: 10px;
}

.news-meta {
    color: #555;
    font-size: 13px;
}

@media (max-width: 900px) {
    .news-card {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .news-placeholder {
        height: 170px;
    }

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