/* ── Layout ── */
html, body { height: 100%; margin: 0; font-size: 14px; }

@media (min-width: 768px) { html { font-size: 16px; } }

.portal-body { background: #f4f6f9; }

.portal-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ── Sidebar ── */
.portal-sidebar {
    width: 220px;
    min-width: 220px;
    background: #1b3a5c;
    color: #c8d8e8;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 1.25rem 1rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.sidebar-logo {
    max-width: 140px;
    height: auto;
    display: block;
    margin: 0 auto 0.5rem;
    background: #fff;
    padding: 4px;
    border-radius: 4px;
}

.sidebar-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8aaec8;
    display: block;
}

.sidebar-nav {
    padding: 0.5rem 0;
}

.sidebar-nav .nav-link {
    color: #c8d8e8;
    padding: 0.45rem 1.25rem;
    font-size: 0.875rem;
    border-left: 3px solid transparent;
    transition: background 0.15s, color 0.15s;
}

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

.sidebar-nav .nav-link.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-left-color: #4da6e8;
}

.nav-section-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #6a90aa;
    padding: 1rem 1.25rem 0.25rem;
    list-style: none;
}

.sidebar-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.8rem;
}

.sidebar-footer .nav-link,
.sidebar-footer a {
    color: #8aaec8;
    font-size: 0.8rem;
    padding: 0;
    text-decoration: none;
}

.sidebar-footer .nav-link:hover,
.sidebar-footer a:hover { color: #fff; }

/* ── Main area ── */
.portal-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.portal-topbar {
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
}

/* Hamburger — hidden on desktop, shown on mobile via media query */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: #344054;
    padding: 0 0.75rem 0 0;
    margin: 0;
    cursor: pointer;
}

/* Backdrop behind the mobile drawer */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1030;
}

.sidebar-backdrop.is-visible {
    display: block;
}

.topbar-page-title {
    font-size: 1rem;
    font-weight: 600;
    color: #344054;
}

.portal-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* ── Auth pages (login) ── */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1b3a5c;
}

/* ── Focus ring ── */
.btn:focus, .btn:active:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* ── Tables ── */
.table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
}

/* ── Stat cards (dashboard) ── */
.stat-card {
    background: #fff;
    border: 1px solid #e4e7ec;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1b3a5c;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* ── Mobile (< 992px): collapse sidebar into an off-canvas drawer ── */
@media (max-width: 991.98px) {
    .portal-wrapper {
        height: 100vh;
        overflow: visible;
    }

    .sidebar-toggle {
        display: inline-block;
    }

    .portal-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1040;
        transform: translateX(-100%);
        transition: transform 0.2s ease-in-out;
    }

    .portal-sidebar.is-open {
        transform: translateX(0);
        box-shadow: 0 0 24px rgba(0,0,0,0.3);
    }

    .portal-main {
        width: 100%;
    }

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

/* Show/hide password toggle (eyeball), injected by site.js around every password field. */
.pw-toggle-wrap {
    position: relative;
}

.pw-toggle-input {
    padding-right: 2.5rem;
}

.pw-toggle-btn {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: #6c757d;
    cursor: pointer;
}

.pw-toggle-btn:hover {
    color: #212529;
}
