/* =====================================================================
   QMS — application styles
   Built on Bootstrap 5.3 with native data-bs-theme dark/light support.
   ===================================================================== */

:root {
    --qms-sidebar-width: 250px;
    --qms-primary: #2563eb;
    --qms-primary-dark: #1d4ed8;
}

body {
    min-height: 100vh;
}

/* ---------- Auth (login) screen ---------- */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
    padding: 1.5rem;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    border: none;
    border-radius: 1rem;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
}
.auth-logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--qms-primary);
    color: #fff;
    font-size: 1.75rem;
    font-weight: 700;
}

/* ---------- App shell ---------- */
.app-shell {
    display: flex;
    min-height: 100vh;
}
.sidebar {
    width: var(--qms-sidebar-width);
    flex-shrink: 0;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    overflow-y: auto;
    transition: transform 0.25s ease;
    border-right: 1px solid var(--bs-border-color);
    background-color: var(--bs-body-bg);
}
.sidebar .brand {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.3px;
}
.sidebar .nav-link {
    border-radius: 0.5rem;
    padding: 0.6rem 0.85rem;
    margin: 0.1rem 0.5rem;
    color: var(--bs-body-color);
    display: flex;
    align-items: center;
    gap: 0.65rem;
}
.sidebar .nav-link:hover {
    background-color: var(--bs-tertiary-bg);
}
.sidebar .nav-link.active {
    background-color: var(--qms-primary);
    color: #fff;
}
.sidebar .nav-section {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.6;
    padding: 1rem 1.1rem 0.35rem;
}

.main-content {
    margin-left: var(--qms-sidebar-width);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    background-color: var(--bs-body-bg);
    border-bottom: 1px solid var(--bs-border-color);
}
.content-area {
    padding: 1.5rem;
    flex: 1;
}

/* ---------- Stat cards ---------- */
.stat-card {
    border: none;
    border-radius: 0.85rem;
    overflow: hidden;
}
.stat-card .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}
.stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
}

/* ---------- Misc ---------- */
.table-responsive { border-radius: 0.5rem; }
.card { border-radius: 0.75rem; }
.badge { font-weight: 600; }
.cursor-pointer { cursor: pointer; }

/* Backdrop for mobile sidebar */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
    display: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .sidebar-backdrop.show {
        display: block;
    }
}

/* Print: hide chrome when printing on-screen reports */
@media print {
    .sidebar, .topbar, .no-print { display: none !important; }
    .main-content { margin-left: 0; }
}
