/* ================================================
   HidrôControl - CSS Customizado
   ================================================ */

:root {
    --sidebar-width: 260px;
    --topbar-height: 56px;
    --color-orange: #fd7e14;
}

/* ---- SIDEBAR ---- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: #1a1d23;
    color: #c9d1d9;
    display: flex;
    flex-direction: column;
    z-index: 1040;
    overflow-y: auto;
    transition: transform .25s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.08);
    min-height: var(--topbar-height);
}

.sidebar-nav {
    flex: 1;
    padding: .5rem 0;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: .5rem 1.25rem;
    color: #8b949e;
    font-size: .875rem;
    border-radius: 0;
    transition: background .15s, color .15s;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255,255,255,.06);
    color: #e6edf3;
}

.sidebar-nav .nav-link.active {
    background: rgba(13, 110, 253, .15);
    color: #79c0ff;
    border-right: 3px solid #388bfd;
}

.nav-section {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #484f58;
    padding: .75rem 1.25rem .3rem;
}

.sidebar-footer {
    padding: .75rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,.08);
}

.user-info {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: #8b949e;
    font-size: .8rem;
}

.sidebar-close {
    margin-left: auto;
    color: #8b949e;
    border: none;
    background: none;
    padding: .25rem;
}

/* ---- MAIN CONTENT ---- */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background: #f0f2f5;
    display: flex;
    flex-direction: column;
}

/* ---- TOPBAR ---- */
.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: 0 1.25rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.topbar-title {
    font-weight: 600;
    font-size: .95rem;
    color: #212529;
}

/* ---- PAGE CONTENT ---- */
.page-content {
    padding: 1.5rem;
    flex: 1;
}

/* ---- MOBILE SIDEBAR ---- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1039;
}

.sidebar-overlay.show {
    display: block;
}

@media (max-width: 991.98px) {
    .main-content {
        margin-left: 0;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .page-content {
        padding: 1rem;
    }
}

/* ---- LOGIN PAGE ---- */
.login-page {
    background: linear-gradient(135deg, #0d6efd20 0%, #6c757d10 100%);
    min-height: 100vh;
}

/* ---- UTILITY ---- */
.bg-orange { background-color: var(--color-orange) !important; }
.text-orange { color: var(--color-orange) !important; }

.stat-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ---- BADGES de STATUS ---- */
.status-normal   { background-color: #198754; color: #fff; }
.status-atencao  { background-color: #ffc107; color: #000; }
.status-alerta   { background-color: var(--color-orange); color: #fff; }
.status-critico  { background-color: #dc3545; color: #fff; }
.status-justificado { background-color: #0dcaf0; color: #000; }

/* ---- TABELAS ---- */
.table th {
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6c757d;
}

/* ---- CARDS ---- */
.card {
    border-radius: .75rem;
}

/* ---- FORMULÁRIOS MOBILE ---- */
@media (max-width: 575.98px) {
    .page-content {
        padding: .75rem;
    }

    .btn-lg {
        font-size: 1rem;
        padding: .75rem 1rem;
    }
}

/* ---- SCROLLBAR ---- */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: #484f58; border-radius: 2px; }
