:root {
    --sidebar-width: 260px;
    --primary-color: #2563EB;
    /* Royal Blue */
    --secondary-color: #475569;
    /* Slate Grey */
    --bg-color: #F1F5F9;
    /* Slate 100 */
    --sidebar-bg: #0F172A;
    /* Slate 900 */
    --card-border: #E2E8F0;
    --text-main: #1E293B;
    --text-secondary: #475569;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --danger-color: #EF4444;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    overflow-x: hidden;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background-color: var(--sidebar-bg);
    color: #fff;
    padding-top: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.brand-logo {
    font-size: 1.5rem;
    font-weight: 700;
    padding: 0 24px 30px;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    text-align: center;
}

.sidebar-logo {
    max-height: 60px;
    max-width: 100%;
    object-fit: contain;
}

.logo-icon {
    font-size: 2.5rem;
}

.nav-link {
    color: #94a3b8;
    padding: 12px 24px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s;
}

.nav-link:hover,
.nav-link.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
    border-right: 4px solid var(--primary-color);
}

.nav-link i {
    font-size: 1.2rem;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 30px;
}

/* Cards */
.card {
    border: 1px solid var(--card-border);
    border-radius: 8px;
    /* Standardized to 8px */
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    /* Subtle shadow */
    background: white;
    margin-bottom: 24px;
    height: 100%;
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--card-border);
    padding: 16px 20px;
    font-weight: 600;
    font-size: 1rem;
    /* 16px */
    color: #334155;
}

.card-body {
    padding: 20px;
}

/* Dashboard Specifics */
.stat-card {
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.progress {
    height: 8px;
    border-radius: 4px;
}

/* Tables */
.table {
    margin-bottom: 0;
    vertical-align: middle;
}

.table thead th {
    background-color: #F8FAFC;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--card-border);
    padding: 12px 16px;
}

.table td {
    vertical-align: middle;
    font-size: 0.875rem;
    color: var(--text-main);
    padding: 16px;
    border-bottom: 1px solid var(--card-border);
}

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

/* Status Badges */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 9999px;
    font-size: 0.75rem;
}

/* Buttons */
.btn {
    border-radius: 6px;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
    /* Darker blue */
    border-color: #1d4ed8;
}

.btn-outline-secondary {
    border-color: var(--card-border);
    color: var(--text-secondary);
}

.btn-outline-secondary:hover {
    background-color: #F8FAFC;
    color: var(--text-main);
    border-color: #CBD5E1;
}

/* Forms */
.form-control,
.form-select {
    border-color: #CBD5E1;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text-main);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.btn-action {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.sidebar-footer {
    margin-top: auto;
    padding: 20px;
    text-align: center;
    font-size: 0.75rem;
    color: #94a3b8;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Modals */
.modal-content {
    border: none;
    border-radius: 8px;
    /* Consistent with cards */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.modal-header {
    border-bottom: 1px solid var(--card-border);
    padding: 16px 24px;
    background-color: white;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.modal-title {
    font-weight: 600;
    color: var(--text-main);
}

.modal-body {
    padding: 24px;
    color: var(--text-secondary);
}

.modal-footer {
    border-top: 1px solid var(--card-border);
    padding: 16px 24px;
    background-color: #F8FAFC;
    /* Light gray footer */
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}



.modal-header {
    border-bottom: 1px solid var(--card-border);
    padding: 16px 24px;
    background-color: white;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.modal-title {
    font-weight: 600;
    color: var(--text-main);
}

.modal-body {
    padding: 24px;
    color: var(--text-secondary);
}

/* ... existing ... */
.modal-footer {
    border-top: 1px solid var(--card-border);
    padding: 16px 24px;
    background-color: #F8FAFC;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 260px;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
        padding-top: 70px;
        /* Space for toggle button */
    }

    /* Mobile Toggle Button (Injected via JS) */
    .mobile-toggle-btn {
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 1001;
        /* Above sidebar (1000) if needed, but sidebar is 1000? Sidebar should be above button when open?
                          Actually sidebar uses z-index 1000. 
                          If button is 1001, it stays on top.
                          If sidebar opens, maybe we want button to be hidden or move?
                          Let's keep button visible to close. */
        padding: 8px 12px;
        border-radius: 8px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        display: block !important;
    }

    /* Overlay when sidebar is open */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        /* Below sidebar (1000), above content */
        backdrop-filter: blur(2px);
    }

    body.sidebar-open .sidebar-overlay {
        display: block;
    }

    /* Adjust tables for mobile (Card View) */
    .table-responsive {
        border: 0;
        overflow-x: hidden;
        /* Prevent horizontal scroll, we stack them */
    }

    .table thead {
        display: none;
        /* Hide headers */
    }

    .table tbody,
    .table tr,
    .table td {
        display: block;
        width: 100%;
    }

    .table tr {
        margin-bottom: 20px;
        background-color: #fff;
        border: 1px solid var(--card-border);
        border-radius: 12px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
        padding: 10px;
    }

    .table td {
        text-align: left;
        /* specific alignment */
        padding: 8px 10px;
        border-bottom: 1px solid #f1f5f9;
        display: flex;
        justify-content: space-between;
        align-items: center;
        min-height: 40px;
        position: relative;
    }

    .table td:last-child {
        border-bottom: 0;
        justify-content: flex-end;
        /* Actions usually at end */
        gap: 10px;
    }

    /* Optional: Add pseudo-element labels if we could identify columns, 
       but for generic tables, we stick to stacking content. 
       Many cells contain self-descriptive badges or icons. */

    /* Tweaks for specific contents */
    .table td img {
        margin-right: 10px;
    }
}

/* Hide toggle button on desktop */
.mobile-toggle-btn {
    display: none;
}