/* ===== ROOT VARIABLES ===== */
:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: #dbeafe;
    --secondary-color: #10b981;
    --secondary-hover: #059669;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-hover: #f1f5f9;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s ease;
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ===== TOP NAVIGATION ===== */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    white-space: nowrap;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.notification-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--bg-secondary);
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.notification-btn:hover {
    background: var(--bg-hover);
    transform: scale(1.05);
}

/* ===== USER DROPDOWN ===== */
.user-menu {
    position: relative;
}

.user-dropdown {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.user-dropdown:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 260px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.dropdown-item:hover {
    background: var(--bg-hover);
}

.logout-item {
    color: var(--danger-color);
}

.logout-item:hover {
    background: #fee;
}

/* ===== SIDEBAR TOGGLE (MOBILE) ===== */
.sidebar-toggle {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    z-index: 1001;
    box-shadow: var(--shadow-lg);
    display: none;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.sidebar-toggle:hover {
    transform: scale(1.1);
    background: var(--primary-hover);
}

.sidebar-toggle:active {
    transform: scale(0.95);
}

/* Sidebar overlay for mobile */
#sidebarOverlay {
    display: none;
}

@media (max-width: 768px) {
    #sidebarOverlay {
        display: block;
    }
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 64px;
    left: 0;
    width: 240px;
    height: calc(100vh - 64px);
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    padding: 24px 0;
    z-index: 999;
    transition: var(--transition);
    overflow-y: auto;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-item:hover {
    background: var(--bg-hover);
    color: var(--primary-color);
}

.sidebar-item.active {
    background: var(--primary-light);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.sidebar-item span:first-child {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: 240px;
    margin-top: 64px;
    padding: 32px;
    min-height: calc(100vh - 64px);
    transition: var(--transition);
    background: transparent;
}

/* ===== DASHBOARD VIEW ===== */
.dashboard-view {
    max-width: 100%;
    width: 100%;
}

/* ===== KPI CARDS ===== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.kpi-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    transition: var(--transition);
}

.kpi-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.kpi-card:hover::before {
    top: -60%;
    right: -60%;
}

.kpi-card:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 10px 30px rgba(240, 147, 251, 0.3);
}

.kpi-card:nth-child(2):hover {
    box-shadow: 0 15px 40px rgba(240, 147, 251, 0.4);
}

.kpi-value {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.kpi-label {
    font-size: 14px;
    opacity: 0.95;
    font-weight: 500;
    position: relative;
    z-index: 1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== DASHBOARD GRID ===== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 24px;
}

.left-column {
    display: flex;
    flex-direction: column;
    gap: 32px;
    min-width: 0; /* IMPORTANT: Prevents overflow */
}

/* ===== DASHBOARD SECTION ===== */
.dashboard-section {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(59, 130, 246, 0.1);
    transition: var(--transition);
}

.dashboard-section:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    border-color: rgba(59, 130, 246, 0.2);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 2px solid var(--border-color);
    flex-wrap: wrap;
    gap: 16px;
    background: linear-gradient(to right, rgba(59, 130, 246, 0.03), transparent);
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 2px;
}

/* ===== TABLE CONTAINER - FIX SCROLLING ISSUES ===== */
.table-container {
    overflow-x: auto;
    overflow-y: auto;
    width: 100%;
    max-width: 100%;
    max-height: 400px;
    position: relative;
}

/* Custom Scrollbar Styling */
.table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.table-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    box-shadow: 0 0 6px rgba(102, 126, 234, 0.5);
}

/* Firefox Scrollbar */
.table-container {
    scrollbar-width: thin;
    scrollbar-color: #667eea #f1f5f9;
}

.responsive-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.responsive-table thead {
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.responsive-table th {
    padding: 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    white-space: nowrap;
    border-bottom: 2px solid var(--primary-color);
}

.responsive-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-primary);
    word-wrap: break-word;
    overflow-wrap: break-word;
    transition: var(--transition);
    font-weight: 700;
}

.responsive-table tbody tr {
    transition: var(--transition);
    cursor: pointer;
}

.responsive-table tbody tr:hover {
    background: linear-gradient(to right, rgba(102, 126, 234, 0.05), transparent);
    transform: scale(1.01);
}

.responsive-table tbody tr:active {
    transform: scale(0.99);
}

/* Document name cell - allow text wrapping */
.responsive-table td:first-child {
    
    font-weight: bolder;
    
    color: darkblue;
    font-size: 16px;
}

/* Project name in tables */
.responsive-table .project-name {
    font-weight: 600;
    color: var(--text-primary);
}

/* Documents column styling - 4th column in Recent Projects table */
.responsive-table td:nth-child(4) {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
}

.responsive-table th:nth-child(4) {
    text-align: center;
}

.responsive-table .doc-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    display: inline-block;
}

.responsive-table .doc-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* ===== PROJECTS PANEL ===== */
.projects-panel {
    position: sticky;
    top: 96px;
    max-height: calc(100vh - 128px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
}

.project-list {
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 24px 24px;
    flex: 1;
    max-height: 600px;
}

/* Custom Scrollbar for Project List */
.project-list::-webkit-scrollbar {
    width: 8px;
}

.project-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.project-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.project-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    box-shadow: 0 0 6px rgba(102, 126, 234, 0.5);
}

/* Firefox Scrollbar for Project List */
.project-list {
    scrollbar-width: thin;
    scrollbar-color: #667eea #f1f5f9;
}

.projects-list {
    overflow-y: auto;
    padding: 0 24px 24px;
    flex: 1;
}

.project-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    margin-bottom: 12px;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.project-item:hover {
    background: var(--bg-primary);
    border-color: var(--primary-color);
    transform: translateX(8px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2);
}

.project-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}

.project-info {
    flex: 1;
    min-width: 0;
}

.project-name {
    font-weight: 600;
    font-size: 18px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-count {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ===== BUTTONS ===== */
.btn {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--primary-light);
    border-color: var(--primary-hover);
    color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.btn-secondary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-secondary:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

/* ===== MODALS ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    padding: 20px;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: var(--transition);
}

.modal-overlay.show .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 2px solid var(--border-color);
    background: linear-gradient(to right, rgba(102, 126, 234, 0.05), transparent);
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg-secondary);
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--text-secondary);
}

.modal-close:hover {
    background: #fee;
    color: var(--danger-color);
    transform: rotate(90deg);
}

.modal form {
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    background: var(--bg-primary);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

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

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* ===== FOOTER ===== */
.footer {
    margin-left: 240px;
    margin-top: 64px;
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 48px 32px 24px;
    border-top: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
    margin-bottom: 32px;
}

.footer-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--primary-color);
}

.footer-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.footer-heading {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.footer-links a:hover {
    padding-left: 4px;
    color: var(--primary-color);
}

.footer-social {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.social-link:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    font-size: 14px;
}

.footer-bottom p {
    margin: 4px 0;
    color: var(--text-secondary);
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablets and below (1024px) */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .projects-panel {
        position: relative;
        top: 0;
        max-height: 600px;
    }
}

/* Mobile devices (768px) */
@media (max-width: 768px) {
    .top-nav {
        padding: 0 16px;
    }

    .logo {
        font-size: 18px;
    }

    /* Sidebar positioning on mobile - hidden by default, slides in when toggled */
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        box-shadow: var(--shadow-lg);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    /* Show toggle button on mobile */
    .sidebar-toggle {
        display: flex;
    }

    /* Adjust main content */
    .main-content {
        margin-left: 0;
        padding: 20px 16px;
    }

    .footer {
        margin-left: 0;
        padding: 32px 16px 16px;
    }

    /* Stack KPI cards */
    .kpi-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .kpi-card {
        padding: 24px;
    }

    .kpi-value {
        font-size: 36px;
    }

    /* Mobile Table Improvements - Make all columns visible but responsive */
    .responsive-table {
        font-size: 13px;
    }

    .responsive-table th,
    .responsive-table td {
        padding: 12px 8px;
        font-size: 12px;
    }

    .responsive-table th {
        font-size: 11px;
        letter-spacing: 0.5px;
    }

    /* Adjust column widths for better mobile display */
    .responsive-table th:nth-child(1),
    .responsive-table td:nth-child(1) {
        min-width: 120px;
    }

    .responsive-table th:nth-child(2),
    .responsive-table td:nth-child(2) {
        min-width: 80px;
    }

    .responsive-table th:nth-child(3),
    .responsive-table td:nth-child(3) {
        min-width: 70px;
    }

    .responsive-table th:nth-child(4),
    .responsive-table td:nth-child(4) {
        min-width: 60px;
        font-size: 14px;
        font-weight: 700;
    }

    /* Allow horizontal scroll with better UX */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }

    /* Add scroll indicator */
    .table-container::after {
        content: '← Scroll →';
        position: absolute;
        bottom: 8px;
        right: 8px;
        background: rgba(102, 126, 234, 0.9);
        color: white;
        padding: 4px 12px;
        border-radius: 12px;
        font-size: 10px;
        font-weight: 600;
        pointer-events: none;
        opacity: 0.7;
    }

    /* Modal adjustments */
    .modal {
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
    }

    /* Section header wrap */
    .section-header {
        padding: 16px;
    }

    .section-title {
        font-size: 18px;
    }

    /* Projects list */
    .projects-list {
        padding: 0 16px 16px;
    }

    .project-item {
        padding: 12px;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .footer-social {
        justify-content: flex-start;
    }
}

/* Small mobile devices (480px) */
@media (max-width: 480px) {
    .top-nav {
        height: 56px;
        padding: 0 12px;
    }

    .logo {
        font-size: 16px;
    }

    .notification-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .user-dropdown {
        padding: 6px 12px;
        font-size: 13px;
    }

    /* Sidebar takes full width on very small screens */
    .sidebar {
        top: 56px;
        width: 85%;
        max-width: 300px;
        height: calc(100vh - 56px);
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-item {
        padding: 12px 16px;
        font-size: 13px;
    }

    .main-content {
        margin-top: 56px;
        padding: 16px 12px;
    }

    .kpi-card {
        padding: 20px;
    }

    .kpi-value {
        font-size: 32px;
    }

    .kpi-label {
        font-size: 13px;
    }

    .btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .sidebar-toggle {
        bottom: 16px;
        left: 16px;
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    /* Extra small table adjustments */
    .responsive-table {
        font-size: 11px;
    }

    .responsive-table th,
    .responsive-table td {
        padding: 10px 6px;
        font-size: 11px;
    }

    .responsive-table th {
        font-size: 10px;
    }

    /* Tighter column widths */
    .responsive-table th:nth-child(1),
    .responsive-table td:nth-child(1) {
        min-width: 100px;
    }

    .responsive-table th:nth-child(2),
    .responsive-table td:nth-child(2) {
        min-width: 70px;
    }

    .responsive-table th:nth-child(3),
    .responsive-table td:nth-child(3) {
        min-width: 60px;
    }

    .responsive-table th:nth-child(4),
    .responsive-table td:nth-child(4) {
        min-width: 50px;
        font-size: 12px;
        font-weight: 700;
    }

    .modal-header {
        padding: 16px;
    }

    .modal-title {
        font-size: 18px;
    }

    .modal form {
        padding: 16px;
    }

    .footer {
        padding: 24px 12px 16px;
    }

    .footer-title {
        font-size: 18px;
    }

    .footer-heading {
        font-size: 15px;
    }

    .footer-text,
    .footer-links a {
        font-size: 13px;
    }

    .section-title {
        font-size: 16px;
    }

    .section-title::before {
        height: 20px;
    }
}

/* ===== UTILITY CLASSES ===== */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

/* ===== SCROLLBAR STYLING ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.dashboard-section {
    animation: fadeIn 0.6s ease;
}

.kpi-card {
    animation: fadeIn 0.5s ease;
}

.kpi-card:nth-child(1) {
    animation-delay: 0.1s;
}

.kpi-card:nth-child(2) {
    animation-delay: 0.2s;
}

.project-item {
    animation: slideIn 0.4s ease;
}

.responsive-table tbody tr {
    animation: fadeIn 0.3s ease;
}

/* ===== PRINT STYLES ===== */
@media print {
    .sidebar,
    .top-nav,
    .sidebar-toggle,
    .footer,
    .btn {
        display: none;
    }

    .main-content {
        margin: 0;
    }
}