:root {
    --primary-color: #4a69bd;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-bg: #f4f6f9;
    --dark-text: #333;
    --sidebar-bg: #4a69bd;
    --sidebar-text: #fff;
    --card-bg: #fff;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--light-bg);
    color: var(--dark-text);
    margin: 0;
    padding: 0;
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100%;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem;
    font-weight: 700;
    font-size: 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li a {
    display: block;
    padding: 1rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background-color: rgba(0, 0, 0, 0.1);
    color: #fff;
}

/* Sidebar Dropdown */
.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: rgba(0, 0, 0, 0.1);
    display: none;
}

.has-submenu.open .submenu {
    display: block;
}

.submenu li a {
    padding-left: 3rem;
    font-size: 0.9rem;
}

.ml-auto {
    margin-left: auto;
}

.sidebar-section-title {
    padding: 1rem 1.5rem 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto;
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    line-height: 1.5;
}

.sidebar-footer p {
    margin: 0.25rem 0;
}

.sidebar-footer a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.sidebar-footer a:hover {
    color: #fff;
    text-decoration: underline;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 250px;
    display: flex;
    flex-direction: column;
}

/* Header */
.top-header {
    background: #fff;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #555;
}

/* Dashboard Widgets */
.dashboard-container {
    padding: 2rem;
}

.page-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #444;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

/* Form Grid System */
.form-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
    align-items: end;
    /* Align inputs with labels */
}

.col-span-12 {
    grid-column: span 12;
}

.col-span-8 {
    grid-column: span 8;
}

.col-span-6 {
    grid-column: span 6;
}

.col-span-4 {
    grid-column: span 4;
}

.col-span-3 {
    grid-column: span 3;
}

.form-section-title {
    grid-column: span 12;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--secondary-color);
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    /* Ensure padding doesn't affect width */
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 105, 189, 0.1);
}

select.form-control {
    background-color: #fff;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.card {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 4px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table th {
    text-align: left;
    color: #888;
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.table td {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f9f9f9;
    color: #555;
}

/* Utilities */
.text-muted {
    color: #6c757d;
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

/* Menu Toggle Button (Hidden on Desktop) */
.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary-color);
}

/* Mobile Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

.sidebar-overlay.active {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {

    /* Show menu toggle button */
    .menu-toggle {
        display: block;
    }

    /* Hide sidebar by default on mobile */
    .sidebar {
        position: fixed;
        left: -250px;
        top: 0;
        height: 100vh;
        z-index: 999;
        transition: left 0.3s ease;
    }

    /* Show sidebar when active */
    .sidebar.active {
        left: 0;
    }

    /* Remove margin from main content */
    .main-content {
        margin-left: 0;
        width: 100%;
    }

    /* Single column grid on mobile */
    .grid-container,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .col-span-12,
    .col-span-8,
    .col-span-6,
    .col-span-4,
    .col-span-3 {
        grid-column: span 1;
    }

    /* Adjust header padding */
    .top-header {
        padding: 1rem;
    }

    /* Adjust dashboard container padding */
    .dashboard-container {
        padding: 1rem;
    }

    /* Make user profile more compact */
    .user-profile {
        font-size: 0.85rem;
        gap: 8px;
    }

    .user-profile span {
        font-size: 0.85rem;
    }
}

/* File Upload Styles */
.file-upload-container {
    grid-column: span 12;
    margin-bottom: 1rem;
}

.file-upload-label {
    font-weight: bold;
    margin-bottom: 0.5rem;
    display: block;
    color: #333;
}

.drop-zone {
    border: 2px dashed #ccc;
    border-radius: 4px;
    padding: 2rem;
    text-align: center;
    background-color: #f9f9f9;
    transition: border-color 0.3s, background-color 0.3s;
    cursor: pointer;
    width: 100%;
    /* Ensure full width */
    box-sizing: border-box;
}

.drop-zone.dragover {
    border-color: var(--primary-color);
    background-color: #eef2ff;
}

.drop-zone-text {
    margin-bottom: 1rem;
    color: #666;
}

.btn-select-files {
    background-color: #e2e6ea;
    border: 1px solid #ced4da;
    color: #495057;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.btn-select-files:hover {
    background-color: #dbe0e5;
}

.file-list {
    margin-top: 1rem;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background-color: #fff;
    border: 1px solid #eee;
    margin-bottom: 0.5rem;
    border-radius: 4px;
}

.file-name {
    font-size: 0.9rem;
    color: #333;
}

.file-remove {
    color: var(--danger-color);
    cursor: pointer;
    font-size: 0.9rem;
}

.file-limits {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.5rem;
}