/* Application CSS */
:root {
    --sidebar-bg: #1a1d23;
    --main-bg: #f0f2f5;
    --primary: #0d6efd;
    --accent: #20c997;
    --sidebar-width: 250px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* Master Layout: Body has 250px left padding on desktop so all content sits naturally without offset */
body {
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    padding-left: var(--sidebar-width) !important;
    margin: 0 !important;
    background-color: var(--main-bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    overflow-x: hidden !important;
    box-sizing: border-box;
}

/* Auth pages have zero sidebar padding */
body.login-page, body.register-page {
    padding-left: 0 !important;
}

/* Sidebar Fixed in 0-250px region */
.sidebar {
    width: var(--sidebar-width) !important;
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 1030 !important;
    overflow-y: auto !important;
    background-color: var(--sidebar-bg) !important;
}

/* Main Content: Naturally fills 100% of the padded body */
.main-content,
.main-content.container-fluid,
.container-fluid.main-content {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 24px 28px !important;
    min-height: 100vh;
    background-color: var(--main-bg);
    box-sizing: border-box !important;
    overflow-x: hidden !important;
}

/* Auth layout */
.login-page, .register-page {
    background: linear-gradient(135deg, #0d6efd 0%, #6610f2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    width: 100%;
    max-width: 450px;
    border-radius: 1rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border-radius: 0.5rem;
    background-color: #fff;
    max-width: 100%;
}

.table-clean th {
    font-weight: 600;
    color: #495057;
    border-top: none;
    border-bottom: 2px solid #dee2e6;
}

.table-clean tbody tr {
    transition: background-color 0.2s ease;
}

.table-clean tbody tr:hover {
    background-color: rgba(0,0,0,0.02);
}

/* Sidebar nav styles */
.sidebar .nav-link {
    color: #adb5bd !important;
    border-left: 3px solid transparent;
    transition: all 0.2s;
    opacity: 0.8;
}

.sidebar .nav-link:hover {
    border-left: 3px solid var(--accent);
    background-color: rgba(255,255,255,0.05);
    color: #fff !important;
    opacity: 1;
}

.sidebar .nav-link.active {
    border-left: 3px solid var(--accent);
    background-color: var(--primary) !important;
    color: #fff !important;
    opacity: 1;
}

/* Status indicators */
.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-dot.pending { background-color: #ffc107; }
.status-dot.processing { background-color: #0dcaf0; }
.status-dot.completed { background-color: #198754; }
.status-dot.failed { background-color: #dc3545; }

/* Badges for severity */
.badge-critical { background-color: #dc3545; color: white; }
.badge-major { background-color: #fd7e14; color: white; }
.badge-minor { background-color: #ffc107; color: black; }
.badge-opportunity { background-color: #0dcaf0; color: black; }

/* Document Viewer */
.document-viewer {
    font-family: Consolas, Monaco, 'Courier New', monospace;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    overflow-x: auto;
    white-space: pre-wrap;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Responsive Sidebar for Tablets & Mobile */
@media (max-width: 991.98px) {
    body {
        padding-left: 0 !important;
    }
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content,
    .main-content.container-fluid,
    .container-fluid.main-content {
        padding: 16px !important;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1; 
}
::-webkit-scrollbar-thumb {
    background: #c1c1c1; 
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8; 
}

/* Print Styles */
@media print {
    body {
        padding-left: 0 !important;
    }
    .sidebar, .navbar, .btn, .no-print {
        display: none !important;
    }
    .main-content,
    .main-content.container-fluid {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        background-color: white !important;
    }
    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
        margin-bottom: 2rem !important;
    }
}
