:root {
    --primary: #4f46e5;
    --primary-light: rgba(79, 70, 229, 0.1);
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg-gradient: linear-gradient(135deg, #f0f7ff 0%, #fff1f6 50%, #f0f7ff 100%);
    --radius: 12px;
    --radius-md: 10px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
}


html,
body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

body {
    background: var(--bg-gradient);
    background-attachment: fixed;
    font-family: 'Outfit', sans-serif;
    color: #1e293b;
    min-height: 100vh;
}

/* App Shell Layout - Reinforced */
.app-shell {
    display: flex !important;
    min-height: 100vh !important;
    width: 100% !important;
    position: relative !important;
}

.app-sidebar {
    width: var(--sidebar-width);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.25rem 0.75rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-sidebar.collapsed {
    width: var(--sidebar-collapsed-width) !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    align-items: center;
    background: #ffffff !important;
    border-right: 1px solid #e2e8f0 !important;
    box-shadow: 2px 0 10px rgba(0,0,0,0.02) !important;
}



.app-main {
    flex: 1 !important;
    margin-left: var(--sidebar-width) !important;
    padding: 1rem 2rem !important;
    width: calc(100% - var(--sidebar-width)) !important;
    min-width: 0;
    /* Prevents flex items from overflowing */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.app-sidebar.collapsed+.app-main {
    margin-left: var(--sidebar-collapsed-width) !important;
    width: calc(100% - var(--sidebar-collapsed-width)) !important;
}


/* Sidebar Elements */
.sidebar-link-text {
    transition: opacity 0.2s ease;
    white-space: nowrap;
}

/* Collapsed sidebar: hide the text but keep the icons (they used to be hidden too, leaving an empty white strip) */
.app-sidebar.collapsed .sidebar-link-text {
    display: none !important;
}

.app-sidebar.collapsed .nav-menu,
.app-sidebar.collapsed .sidebar-footer {
    width: 100%;
}

.app-sidebar.collapsed .sidebar-brand .sidebar-link-text {
    display: none !important;
}

.app-sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 0.75rem 0 !important;
    width: 100%;
}

.app-sidebar.collapsed .nav-link i {
    margin-right: 0;
    font-size: 1.4rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.app-sidebar.collapsed .nav-link.active i {
    background: var(--primary);
    color: white !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.app-sidebar.collapsed .nav-link.active {
    background: transparent !important;
    box-shadow: none !important;
}

.app-sidebar.collapsed .sidebar-brand {
    padding: 0 !important;
    width: 70px !important;
    height: 60px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin-bottom: 1.5rem !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.app-sidebar.collapsed #sidebarToggle {
    margin: 0 !important;
    width: 70px !important;
    height: 60px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    border-radius: 0;
}

.app-header {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

/* Page Header & Breadcrumb Cleanup */
.head {
    background: transparent !important;
    border: none !important;
    padding: 0.5rem 1rem !important;
    margin-bottom: 1.5rem !important;
}

.breadcrumb {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "/" !important;
    color: var(--secondary) !important;
    opacity: 0.5;
}

.breadcrumb-item a {
    color: var(--primary) !important;
    text-decoration: none !important;
    font-weight: 500;
}

.breadcrumb-item.active {
    color: var(--secondary) !important;
}




/* EduMate Navigation */
.nav-menu {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.nav-item {
    margin-bottom: 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--secondary);
    text-decoration: none !important;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.nav-link i {
    width: 20px;
    margin-right: 0.75rem;
    font-size: 1.1rem;
    text-align: center;
}

/* Sidebar Footer Centering */
.app-sidebar.collapsed .sidebar-footer {
    padding: 0 !important;
    display: flex;
    justify-content: center;
}

.app-sidebar.collapsed .sidebar-footer .nav-link {
    width: 100%;
    justify-content: center;
}

.nav-link:hover {
    background: rgba(79, 70, 229, 0.05);
    color: var(--primary);
}

.nav-link.active {
    background: var(--primary);
    color: white !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.app-sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 0.75rem;
}

.app-sidebar.collapsed .nav-link i {
    margin-right: 0;
}

/* Modern Unified Table Design */
.modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    table-layout: auto;
}

.modern-table thead th {
    background: #f8fafc;
    color: var(--secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.modern-table tbody td {
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
    vertical-align: middle;
    font-size: 0.92rem;
}

/* Specific Padding for start and end of row */
.modern-table th:first-child, 
.modern-table td:first-child {
    padding-left: 2rem !important;
}

.modern-table th:last-child, 
.modern-table td:last-child {
    padding-right: 2rem !important;
}

/* Checkbox Column Precision - Absolute Centering */
.modern-table th.col-checkbox, 
.modern-table td.col-checkbox {
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
    padding: 1.1rem 0 !important;
    text-align: center !important;
    vertical-align: middle !important;
}

.modern-table .custom-control {
    padding-left: 0 !important;
    margin: 0 auto !important;
    display: inline-flex !important;
    justify-content: center;
    align-items: center;
    width: 1.5rem;
    height: 1.5rem;
}

.modern-table .custom-control-label {
    margin: 0 !important;
    cursor: pointer;
}

.modern-table .custom-control-label::before,
.modern-table .custom-control-label::after {
    left: 0 !important; /* Resetting the -1.5rem offset from Bootstrap */
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
}

.modern-table tbody tr:hover {
    background-color: #f8fcfd;
}


.modern-table tbody tr:last-child td {
    border-bottom: none;
}

/* Table Header Actions & Search - Balanced Padding */
.table-header-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #f1f5f9;
    flex-wrap: wrap;
    gap: 15px;
}


.smart-search-group {
    position: relative;
    max-width: 320px;
    width: 100%;
    display: flex;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    background: #f8fcfb;
    overflow: hidden;
    transition: all 0.2s;
}

.smart-search-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 221, 0.1);
    background: white;
}

.smart-search-input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    font-size: 0.85rem;
    outline: none !important;
    box-shadow: none !important;
}


.smart-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary);
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 2;
}

.smart-search-btn {
    border: none;
    border-left: 1px solid #e2e8f0;
    background: white;
    padding: 0 15px;
    color: var(--primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}

.smart-search-btn:hover {
    background: var(--primary);
    color: white;
}


/* DataTables UI Overrides - Balanced Padding */
.dataTables_length,
.dataTables_info {
    padding-left: 2rem !important;
    padding-top: 1.25rem !important;
    padding-bottom: 1.25rem !important;
    font-size: 0.85rem;
    color: #64748b;
}

.dataTables_paginate {
    padding-right: 2rem !important;
    padding-top: 1.25rem !important;
    padding-bottom: 1.25rem !important;
}

/* Compact Components */

.content-card {
    background: transparent;
    padding: 0;
}

.card {
    border: 0 !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow) !important;
    background: white;
    overflow: hidden;
    /* This keeps the table corners inside the card radius */
}

/* Hide Search Button for LiveSearch */
.smart-search-btn {
    display: none !important;
}

.smart-search-group {
    max-width: 300px;
}


.btn-primary {
    background: var(--primary);
    border: 0;
    padding: 0.6rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
}

.btn-primary:hover {
    background: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

/* Soft Pill Badges */
.badge-soft {
    padding: 0.5rem 1rem;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-soft-primary {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-soft-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-soft-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-soft-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* Used for "Audit" / "Audit Report" and for "no audit yet" - these two had no style at all */
.badge-soft-info {
    background: rgba(8, 145, 178, 0.1);
    color: #0891b2;
}

.badge-soft-secondary {
    background: rgba(100, 116, 139, 0.12);
    color: #64748b;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.1);
}