/* ==================== THEME – Professional & Attractive ==================== */
:root {
    --app-primary: #2563eb;
    --app-primary-dark: #1d4ed8;
    --app-primary-light: #3b82f6;
    --app-accent: #0ea5e9;
    --app-surface: #f1f5f9;
    --app-card-bg: #ffffff;
    --app-border: #e2e8f0;
    --app-border-light: #f1f5f9;
    --app-text: #0f172a;
    --app-text-muted: #64748b;
    --app-sidebar-bg: #1e293b;
    --app-sidebar-text: #e2e8f0;
    --app-sidebar-hover: #334155;
    --app-sidebar-active: rgba(96, 165, 250, 0.5);
    --app-header-bg: #ffffff;
    --app-header-border: #e2e8f0;
    --app-header-text: #0f172a;
    --app-footer-bg: #e2e8f0;
    --app-footer-text: #475569;
    /* Table header: TECH logo blue */
    --app-table-header-bg: #4E9AD9;
    --app-table-header-text: #ffffff;
    --app-table-hover: #f8fafc;
    --app-table-border: #e2e8f0;
    --app-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --app-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --app-shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --app-shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --app-radius: 10px;
    --app-radius-lg: 14px;
    --app-radius-xl: 20px;
    /* QC / status colors – aligned with app theme */
    --app-qc-na-bg: #fef9e7;
    --app-qc-na-text: #78716c;
    --app-qc-na-border: #e7e5e4;
    --app-qc-pass-bg: #ecfdf5;
    --app-qc-pass-text: #047857;
    --app-qc-pass-border: #a7f3d0;
    --app-qc-fail-bg: #fef2f2;
    --app-qc-fail-text: #b91c1c;
    --app-qc-fail-border: #fecaca;
    --app-qc-pending-accent: #64748b;
}

/* ==================== BASE ==================== */
html {
    height: 100%;
    position: relative;
    min-height: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    color: var(--app-text);
    background-color: var(--app-surface);
    overflow-x: hidden;
}

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

/* ==================== FOCUS ==================== */
.btn:focus, .form-control:focus, .form-select:focus, .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
    border-color: var(--app-primary);
}

/* ==================== LAYOUT ==================== */
.div-body {
    flex: 1 1 auto;
    padding: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.div-body .row {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
}
/* Main content always fills remaining space (both expand and collapse) */
.sidebar + main {
    flex: 1 1 0%;
    min-width: 0;
}
.sidebar.collapsed + main { max-width: none; }
main {
    flex: 1 1 auto;
    min-height: 0;
    padding: 1.5rem 1.25rem;
    /* Reserve space so content (e.g. table pagination) is not hidden behind fixed footer */
    padding-bottom: 5rem;
    overflow: auto;
    background: var(--app-surface);
}
main:has(.login-split) { padding: 0; }

/* ==================== SIDEBAR MOBILE OVERLAY ==================== */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1040;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}
@media (max-width: 767.98px) {
    .sidebar-backdrop {
        display: block;
    }
    body.sidebar-overlay-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
    .sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        max-width: 85vw;
        min-width: 260px;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: none;
        min-height: 100vh;
    }
    body.sidebar-overlay-open .sidebar {
        transform: translateX(0);
        box-shadow: var(--app-shadow-lg);
    }
    .sidebar + main {
        flex: 1 1 100%;
        max-width: 100%;
        width: 100%;
        margin-left: 0;
    }
    .sidebar.collapsed + main {
        max-width: 100%;
    }
}

/* ==================== HEADER – Clear separate identity ==================== */
.app-header {
    background: var(--app-header-bg);
    color: var(--app-header-text);
    border-bottom: 2px solid var(--app-header-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.app-header .navbar { padding: 0.6rem 1rem; }
.app-header .navbar-brand {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--app-header-text) !important;
}
.app-header .navbar-brand:hover { color: var(--app-primary) !important; }
.app-header .navbar-brand i { color: var(--app-primary); }
.app-header .navbar-brand .header-logo {
    height: calc(2.5rem + 25px);
    width: auto;
    max-width: 175px;
    object-fit: contain;
}
.app-header .dropdown-menu {
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow-md);
    border: 1px solid var(--app-border);
}

/* User menu (top-right) – professional pill with avatar */
.app-header .user-menu-trigger {
    padding: 0.35rem 0.75rem 0.35rem 0.35rem;
    border-radius: 9999px;
    background: #f8fafc;
    border: 1px solid var(--app-border, #e2e8f0);
    color: var(--app-text, #334155);
    font-weight: 500;
    font-size: 0.9375rem;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    max-width: 220px;
}
.app-header .user-menu-trigger::after {
    display: none;
}
.app-header .user-menu-trigger:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: var(--app-text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.app-header .user-menu-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--app-primary, #2563eb);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}
.app-header .user-menu-name {
    margin-left: 0.5rem;
    max-width: 140px;
    color: #475569;
}
.app-header .user-menu-chevron {
    font-size: 0.75rem;
    color: #64748b;
    transition: transform 0.2s ease;
}

/* Header notification bell */
.app-header .header-notification-btn {
    text-decoration: none;
    border-radius: 50%;
    color: var(--app-text) !important;
}
.app-header .header-notification-btn:hover {
    background: #f1f5f9 !important;
    color: var(--app-primary) !important;
}
.app-header .header-notification-badge {
    font-size: 0.65rem;
    font-weight: 600;
    min-width: 1.25rem;
    min-height: 1.25rem;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* move badge left so circle sits over the bell */
    transform: translate(calc(-50% - 0.35rem), -50%);
    top: 0;
    left: 100%;
}
.app-header .header-notification-badge--pulse {
    animation: header-notification-pulse 2s ease-in-out infinite;
}
@keyframes header-notification-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4); }
    50% { opacity: 0.95; box-shadow: 0 0 0 4px rgba(220, 53, 69, 0); }
}
.app-header .header-notification-dropdown .header-notification-item a:hover {
    background: #f8fafc;
}
.app-header .header-notification-dropdown .dropdown-item:focus {
    background: #f8fafc;
}
.app-header .user-menu-trigger[aria-expanded="true"] .user-menu-chevron {
    transform: rotate(180deg);
}
.app-header .btn-outline-secondary {
    border-color: var(--app-border);
    color: var(--app-text);
}
.app-header .btn-outline-secondary:hover {
    background: var(--app-surface);
    border-color: var(--app-primary);
    color: var(--app-primary);
}

/* Hamburger / menu toggle – visible on mobile & tablet */
/* Hamburger visible on mobile/tablet only (d-md-none) – dark box, white icon, no "Menu" text */
.app-header .btn-menu-toggle {
    background: #1e293b;
    border: 1px solid #334155;
    color: #fff;
    font-weight: 600;
    padding: 0.4rem 0.65rem;
    min-height: 2.5rem;
    border-radius: var(--app-radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.app-header .btn-menu-toggle i {
    font-size: 1.5rem;
    color: #fff;
    display: block;
    line-height: 1;
}
.app-header .btn-menu-toggle:hover {
    background: #334155;
    border-color: #475569;
    color: #fff;
}
.app-header .btn-menu-toggle:hover i { color: #fff; }
.app-header .btn-menu-toggle:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
    color: #fff;
}
.app-header .btn-menu-toggle:focus i { color: #fff; }
@media (max-width: 991.98px) {
    .app-header .navbar { padding: 0.5rem 0.75rem 0.5rem 0.5rem; }
    .app-header .navbar .container-fluid { padding-left: 0.5rem; padding-right: 0.75rem; }
    .app-header .navbar-brand { font-size: 0.95rem; }
}
@media (max-width: 575.98px) {
    .app-header .navbar { padding-left: 0.375rem; }
    .app-header .navbar .container-fluid { padding-left: 0.375rem; }
    .app-header .navbar-brand span { font-size: 0.9rem; }
}

/* ==================== SIDEBAR – Dark theme (left panel only) ==================== */
/* Expanded: sidebar only as wide as needed (no blank space inside); collapsed: 72px */
.sidebar {
    min-height: 100vh;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-right: 1px solid rgba(255,255,255,0.08);
    padding: 0;
    display: flex;
    flex-direction: column;
    transition: width 0.25s ease, min-width 0.25s ease, max-width 0.25s ease;
    flex: 0 0 auto;
    width: auto;
    min-width: 260px;
    max-width: 320px;
}
.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}
.sidebar-toggle {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #e2e8f0 !important;
    font-size: 1.5rem;
    border-radius: var(--app-radius);
    transition: background 0.2s ease, color 0.2s ease;
}
.sidebar-toggle:hover { color: #fff !important; background: rgba(255,255,255,0.1); }
.sidebar-toggle i { margin: 0; }
.sidebar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    overflow: hidden;
}
.sidebar-brand .bi { font-size: 1.25rem; color: var(--app-accent); flex-shrink: 0; }
.sidebar-brand .sidebar-logo {
    width: 90px;
    height: 38px;
    object-fit: contain;
    object-position: left center;
    flex-shrink: 0;
    display: block;
}
.sidebar-brand-text { white-space: nowrap; }
.sidebar-menu-wrap { flex: 1; overflow-x: hidden; overflow-y: auto; padding: 0.75rem 0.5rem; min-width: 0; }

/* Sidebar nav – bigger icons, dark theme */
.sidebar .sidebar-icon {
    font-size: 1.35rem;
    width: 1.35rem;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.95;
}
.sidebar .accordion-item { background: transparent; border: none; margin-bottom: 0.5rem; }
.sidebar .accordion-item:last-child { margin-bottom: 0; }
.sidebar .accordion-button {
    background: transparent !important;
    color: #e2e8f0 !important;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.8rem 1rem;
    border: none;
    box-shadow: none !important;
    border-radius: var(--app-radius);
    display: flex;
    align-items: center;
}
.sidebar .accordion-button:not(.collapsed) {
    color: #fff !important;
    background: rgba(37, 99, 235, 0.2) !important;
}
.sidebar .accordion-button:not(.collapsed) .sidebar-icon { color: var(--app-accent); }
/* Space between option text and expand/collapse arrow */
.sidebar .accordion-button .sidebar-label { margin-right: 1rem; }
.sidebar .accordion-button::after {
    filter: brightness(0) invert(1);
    opacity: 0.8;
    margin-left: auto;
}
.sidebar .accordion-body { padding: 0.35rem 0 0.65rem 0.5rem; }
/* Top-level nav-link (e.g. Home) – left-align with tree items below (same as accordion-button) */
.sidebar .accordion-header > a.nav-link {
    padding: 0.75rem 1rem;
    margin-left: 0;
    margin-right: 0.25rem;
    margin-bottom: 0;
    color: #e2e8f0;
    font-weight: 600;
    font-size: 0.95rem;
}
.sidebar .accordion-header > a.nav-link .sidebar-icon { font-size: 1.35rem; width: 1.35rem; }
.sidebar nav.accordion a.nav-link {
    color: #94a3b8;
    padding: 0.55rem 1rem 0.55rem 2rem;
    border-radius: var(--app-radius);
    margin: 0 0.25rem 0.35rem 0.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}
.sidebar nav.accordion a.nav-link .sidebar-icon { font-size: 1.2rem; width: 1.2rem; }
.sidebar nav.accordion a.nav-link:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.sidebar nav.accordion a.nav-link.active {
    background: var(--app-sidebar-active);
    color: #fff !important;
    font-weight: 600;
}
.sidebar nav.accordion a.nav-link.active .sidebar-icon { color: #e0f2fe; }

/* Sidebar collapsed state – only hamburger at top + icons below, no text/truncation */
.sidebar.collapsed {
    flex: 0 0 72px !important;
    width: 72px !important;
    min-width: 72px !important;
    max-width: 72px !important;
    overflow: hidden;
}
.sidebar.collapsed .sidebar-header {
    padding: 0.5rem;
    justify-content: center;
    min-height: 52px;
    flex-shrink: 0;
}
.sidebar.collapsed .sidebar-brand { display: none !important; }
.sidebar.collapsed .sidebar-toggle { margin: 0; }
.sidebar.collapsed .sidebar-label { display: none !important; visibility: hidden; }
.sidebar.collapsed .accordion-button::after { display: none !important; }
.sidebar.collapsed .accordion-button {
    justify-content: center;
    padding: 0.6rem 0.5rem;
    min-width: 0;
}
.sidebar.collapsed .accordion-body .nav-link {
    justify-content: center;
    padding: 0.6rem 0.5rem;
}
.sidebar.collapsed .accordion-body .nav-link .me-2,
.sidebar.collapsed .accordion-button .me-2,
.sidebar.collapsed .accordion-header > .nav-link .me-2 { margin-right: 0 !important; }
.sidebar.collapsed .accordion-header > .nav-link {
    justify-content: center;
    padding: 0.6rem 0.5rem;
}
.sidebar.collapsed .sidebar-menu-wrap {
    padding: 0.5rem 0.25rem;
    overflow: hidden;
}
.sidebar.collapsed .accordion-button .sidebar-icon,
.sidebar.collapsed .nav-link .sidebar-icon { margin: 0; }

/* ==================== FOOTER – Soft bar, not too dark ==================== */
footer.footer {
    flex-shrink: 0;
    margin-top: auto;
    background: var(--app-footer-bg);
    border-top: 1px solid var(--app-border);
    padding: 0.75rem 1rem;
    color: var(--app-footer-text);
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

footer .container { color: var(--app-footer-text); font-size: 0.875rem; }
footer a { color: var(--app-primary); text-decoration: none; }
footer a:hover { color: var(--app-primary-dark); text-decoration: underline; }

/* ==================== PAGE HEADER ==================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--app-text);
    margin: 0;
    letter-spacing: -0.02em;
}

/* ==================== CARDS ==================== */
.card-app {
    background: var(--app-card-bg);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    box-shadow: var(--app-shadow);
    overflow: hidden;
}
.card-app .card-body { padding: 1.5rem 1.75rem; }

/* ==================== DATA TABLES – Strong header ==================== */
.table-app {
    margin-bottom: 0;
    font-size: 0.9375rem;
}
.table-app thead th {
    background: var(--app-table-header-bg) !important;
    color: var(--app-table-header-text) !important;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.9rem 1rem;
    border: none;
    border-bottom: 2px solid var(--app-primary);
    vertical-align: middle;
}
.table-app tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--app-table-border);
}
.table-app tbody tr { transition: background 0.15s ease; }
.table-app tbody tr:hover { background: var(--app-table-hover) !important; }
.table-app tbody tr:last-child td { border-bottom: none; }

/* ==================== DETAILS TABLE ==================== */
.details-table th {
    width: 28%;
    font-weight: 600;
    color: var(--app-text-muted);
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border: 1px solid var(--app-border);
}
.details-table td {
    width: 72%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--app-border);
}

/* ==================== BUTTONS ==================== */
.btn-primary {
    background: linear-gradient(135deg, var(--app-primary) 0%, var(--app-primary-dark) 100%) !important;
    border: none !important;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    border-radius: var(--app-radius);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--app-primary-dark) 0%, #1e40af 100%) !important;
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}
.btn-success {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    border: none !important;
    font-weight: 600;
    border-radius: var(--app-radius);
}
.btn-success:hover { filter: brightness(1.08); }
.btn-outline-primary {
    border-width: 2px;
    font-weight: 500;
    border-radius: var(--app-radius);
}
.btn-outline-secondary, .btn-outline-dark {
    border-radius: var(--app-radius);
    font-weight: 500;
}
.btn-sm { border-radius: 8px; padding: 0.35rem 0.65rem; }

/* ==================== FORMS – Professional ==================== */
.card-app.form-card .card-body { padding: 0; }
.card-app.form-card .card-body > form { display: flex; flex-direction: column; }
.form-card .form-section:first-of-type { padding-top: 1.5rem; }
.form-card .form-section:last-of-type { margin-bottom: 0; }
.form-card .form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    padding: 1rem 1.5rem 1.25rem;
    margin: 0 1.5rem 1.25rem;
    background: #f8fafc;
    border-radius: var(--app-radius);
    border: 1px solid var(--app-border-light);
}
.form-card .card-body > form > .text-danger.mb-3,
.form-card .card-body > form > [data-valmsg-summary="true"] {
    margin: 1rem 1.5rem 0.75rem;
}

.form-control, .form-select {
    border-radius: var(--app-radius);
    border: 1px solid var(--app-border);
    padding: 0.5rem 0.875rem;
    font-size: 0.9375rem;
    min-height: 2.5rem;
    background-color: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-control:hover, .form-select:hover { border-color: #cbd5e1; }
.form-control:focus, .form-select:focus {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    outline: 0;
}
.form-control::placeholder { color: #94a3b8; }
.form-control[readonly] { background-color: #f8fafc; color: #64748b; cursor: default; }
textarea.form-control { min-height: 2.5rem; padding-top: 0.5rem; resize: vertical; }

.form-label {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--app-text);
    margin-bottom: 0.375rem;
    display: block;
    letter-spacing: 0.01em;
}
.form-check-label { font-weight: 500; font-size: 0.9375rem; color: var(--app-text); }
.form-check-input { width: 1.125rem; height: 1.125rem; margin-top: 0.15rem; }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2); }

.form-section {
    background: #fff;
    border: 1px solid var(--app-border);
    border-left: 3px solid var(--app-primary);
    border-radius: var(--app-radius-lg);
    padding: 1.25rem 1.5rem;
    margin: 0 1.5rem 1.25rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.form-section legend {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--app-primary);
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--app-border);
    display: block;
    width: 100%;
}

.form-section .row { --bs-gutter-x: 1.25rem; --bs-gutter-y: 1rem; }
.form-section .row + .row { margin-top: 0; }
.form-section [class^="col-"] .form-label { margin-bottom: 0.375rem; }
.form-section .form-check { min-height: 2.5rem; display: flex; align-items: center; }
.form-section .form-check .form-check-input { margin-top: 0; }
.form-section .form-check .form-check-label { margin-left: 0.375rem; margin-bottom: 0; }
.form-section .text-danger.small { font-size: 0.75rem; margin-top: 0.25rem; display: block; }

/* ==================== LOGIN / AUTH – Full impact ==================== */
/* Fill viewport minus header/footer so form is vertically centered; max-height prevents scroll */
.auth-wrapper {
    min-height: calc(100vh - 96px - 3.5rem);
    max-height: calc(100vh - 56px - 3.5rem);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: var(--app-surface, #f8fafc);
    position: relative;
}
.auth-wrapper::before {
    display: none;
}
.auth-card {
    width: 100%;
    max-width: 520px;
    min-width: 320px;
    background: var(--app-card-bg);
    border: none;
    border-radius: var(--app-radius-xl);
    box-shadow: var(--app-shadow-lg);
    padding: 2.75rem 2.5rem;
    position: relative;
    z-index: 1;
}
/* Login split: form card uses more of the right panel */
.login-split-form .auth-card {
    max-width: min(680px, 96%);
    width: 100%;
    padding: 3.5rem 3.25rem;
    min-height: 480px;
}
.auth-card .form-control {
    padding: 0.65rem 1rem;
    font-size: 1rem;
    border-radius: var(--app-radius);
}
.auth-card .input-group-text {
    background: #f8fafc;
    border: 1px solid var(--app-border);
    border-right: none;
    border-radius: var(--app-radius) 0 0 var(--app-radius);
}
.auth-card .input-group .form-control {
    border-radius: 0 var(--app-radius) var(--app-radius) 0;
    border-left: none;
}
.auth-card .input-group:focus-within .input-group-text,
.auth-card .input-group:focus-within .form-control {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.auth-card .btn-primary {
    padding: 0.65rem 1rem;
    font-size: 1rem;
    border-radius: var(--app-radius);
}

/* ==================== LOGIN SPLIT (left branding panel) ==================== */
/* Prevent horizontal scroll: use 100% width; parent padding removed via :has() below */
.div-body:has(.login-split) { padding-left: 0; padding-right: 0; }
main:has(.login-split) { padding-left: 0 !important; padding-right: 0 !important; }
.login-split {
    min-height: calc(100vh - 56px - 3.5rem);
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.login-split-brand {
    flex: 1 1 45%;
    min-height: calc(100vh - 56px - 3.5rem);
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 60%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem 2rem;
    color: #fff;
}
.login-split-brand .login-logo {
    max-height: 4rem;
    width: auto;
    object-fit: contain;
}
.login-split-brand h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.login-split-brand p {
    color: #94a3b8;
    font-size: 1rem;
    max-width: 320px;
    text-align: center;
}
.login-split-form {
    flex: 1 1 55%;
    min-height: calc(100vh - 56px - 3.5rem);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 3rem;
    background: var(--app-surface);
}
.login-split-form .auth-card .form-label { font-weight: 500; }
.login-split-form .auth-card .mb-3 { margin-bottom: 1.25rem !important; }
.login-split-form .auth-card .mb-4 { margin-bottom: 1.5rem !important; }
.login-split-form .auth-card .btn-primary { padding: 0.75rem 1.25rem; }

/* ==================== ALERTS & EMPTY STATE ==================== */
.alert-app {
    border-radius: var(--app-radius);
    border-left-width: 4px;
}
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--app-text-muted);
    background: var(--app-card-bg);
    border: 2px dashed var(--app-border);
    border-radius: var(--app-radius-lg);
    font-size: 1rem;
}

/* ==================== UTILITY ==================== */
.content-wrap { max-width: 100%; margin: 0 auto; }
.content-wrap:has(.login-split) { max-width: none; padding: 0; }
.action-buttons .btn { margin-right: 0.35rem; }

/* ==================== RESPONSIVE – Mobile & Tablet ==================== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}
.table-responsive .table-app { min-width: 600px; }

@media (max-width: 767.98px) {
    main { padding: 1rem 0.75rem; max-width: 100%; overflow-x: hidden; }
    .div-body .container-fluid { max-width: 100%; padding-left: 0.5rem; padding-right: 0.5rem; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; flex-wrap: wrap; padding-left: 0.75rem; padding-right: 0.75rem; }
    .page-header .btn { width: 100%; max-width: 100%; }
    .page-title { font-size: 1.25rem; }
    .card-app .card-body { padding: 1rem; }
    .card-app.form-card .card-body { padding: 1rem; }
    .form-label, .form-check-label { font-size: 0.875rem; }
    .table-app thead th { font-size: 0.65rem; padding: 0.6rem 0.5rem; white-space: nowrap; }
    .table-app tbody td { padding: 0.6rem 0.5rem; font-size: 0.875rem; }
    .filter-bar .btn { margin-bottom: 0.25rem; }
    .action-buttons .btn { margin-right: 0.25rem; margin-bottom: 0.25rem; }
}
@media (max-width: 991.98px) {
    main { padding: 1.25rem 1rem; }
    .page-header { padding-left: 1rem; padding-right: 1rem; }
    .card-app .card-body { padding: 1.25rem 1.25rem; }
}
@media (max-width: 575.98px) {
    .row.g-2 [class^="col-"], .row.g-3 [class^="col-"] { flex: 0 0 100%; max-width: 100%; }
}
