:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary: #10b981;
    --secondary-dark: #059669;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --warning: #f59e0b;
    --warning-light: #fbbf24;
    --dark: #1f2937;
    --dark-light: #374151;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    --sidebar-width: 260px;
    --transition: all 0.3s ease;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    font-size: 0.9375rem;
    overflow-x: hidden;
    max-width: 100vw;
}

/* Prevent scroll when sidebar is open on mobile */
body.sidebar-open {
    overflow: hidden;
    position: relative;
}

@media (min-width: 1025px) {
    body.sidebar-open {
        overflow: auto;
    }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.3;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    max-width: 100vw;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--dark) 0%, var(--gray-900) 100%);
    color: var(--white);
    position: fixed;
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    top: 0;
    left: 0;
}

.sidebar-brand {
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand .brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand .brand-logo i {
    font-size: 1.75rem;
    color: var(--primary-light);
}

.sidebar-brand .brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.sidebar-brand .brand-tagline {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 0.25rem;
}

.sidebar-user {
    padding: 1.25rem 1.5rem;
    background: rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user .user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    color: white;
}

.sidebar-user .user-info {
    margin-left: 0.75rem;
}

.sidebar-user .user-name {
    font-weight: 600;
    font-size: 0.875rem;
}

.sidebar-user .user-role {
    font-size: 0.75rem;
    color: var(--gray-400);
    text-transform: capitalize;
}

.sidebar-menu {
    padding: 1rem 0;
}

.sidebar-menu .menu-section {
    padding: 0.5rem 1rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin-top: 0.5rem;
}

.sidebar-menu .menu-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--gray-400);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.sidebar-menu .menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
}

.sidebar-menu .menu-item.active {
    background: rgba(37, 99, 235, 0.15);
    color: var(--primary-light);
    border-left-color: var(--primary-light);
}

.sidebar-menu .menu-item i {
    width: 1.25rem;
    text-align: center;
    font-size: 1rem;
}

.sidebar-menu .menu-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 0.6875rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    max-width: calc(100vw - var(--sidebar-width));
    overflow-x: hidden;
}

/* Top Navigation */
.top-navbar {
    background: var(--white);
    padding: 1rem 2rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    max-width: 100%;
    overflow: hidden;
}

.top-navbar .page-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.top-navbar .nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.top-navbar .nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--gray-600);
    transition: var(--transition);
    font-size: 0.875rem;
}

.top-navbar .nav-item:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

/* Content Area */
.content-area {
    padding: 2rem;
    max-width: 100%;
    overflow-x: hidden;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header .card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-card .stat-icon.primary {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.stat-card .stat-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary);
}

.stat-card .stat-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stat-card .stat-icon.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.stat-card .stat-content {
    flex: 1;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--gray-700);
    color: white;
}

.btn-secondary:hover {
    background: var(--gray-800);
}

.btn-success {
    background: var(--secondary);
    color: white;
}

.btn-success:hover {
    background: var(--secondary-dark);
}

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

.btn-danger:hover {
    background: var(--danger-dark);
}

.btn-warning {
    background: var(--warning);
    color: var(--gray-900);
}

.btn-warning:hover {
    background: var(--warning-light);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.btn i {
    font-size: 0.875rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--gray-800);
    transition: var(--transition);
}

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

.form-control::placeholder {
    color: var(--gray-400);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

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

.table th,
.table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    background: var(--gray-50);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
}

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

.table tbody tr:hover {
    background: var(--gray-50);
}

.table td {
    font-size: 0.875rem;
    color: var(--gray-700);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

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

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

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

.badge-primary {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.badge-secondary {
    background: var(--gray-200);
    color: var(--gray-600);
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--secondary-dark);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger-dark);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #b45309;
}

.alert-info {
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.2);
    color: var(--primary-dark);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

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

.modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.95);
    transition: var(--transition);
}

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

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--gray-500);
    cursor: pointer;
    border-radius: var(--radius);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Tabs */
.tabs {
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-500);
    border: none;
    background: transparent;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
    margin-bottom: -1px;
}

.tab:hover {
    color: var(--gray-700);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Pagination */
.pagination {
    display: flex;
    gap: 0.25rem;
}

.page-item {
    list-style: none;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-600);
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    text-decoration: none;
    transition: var(--transition);
}

.page-link:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.page-item.disabled .page-link {
    color: var(--gray-400);
    pointer-events: none;
    background: var(--gray-50);
}

.pagination-wrapper {
    margin-top: 1.5rem;
    padding: 1rem 0;
}

.pagination-info {
    font-size: 0.875rem;
    padding-top: 0.5rem;
}

/* Mobile Pagination Styles */
@media (max-width: 768px) {
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.375rem;
    }
    
    .page-link {
        min-width: 2rem;
        height: 2rem;
        padding: 0 0.375rem;
        font-size: 0.8125rem;
    }
    
    .pagination-info {
        font-size: 0.8125rem;
        padding-top: 0.75rem;
    }
    
    .pagination-wrapper {
        margin-top: 1rem;
        padding: 0.75rem 0;
    }
}

@media (max-width: 480px) {
    .pagination {
        gap: 0.25rem;
    }
    
    .page-link {
        min-width: 1.75rem;
        height: 1.75rem;
        padding: 0 0.25rem;
        font-size: 0.75rem;
    }
    
    .pagination-info {
        font-size: 0.75rem;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-500); }
.text-primary { color: var(--primary); }
.text-success { color: var(--secondary); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2rem; }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }

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

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

/* Mobile Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
    visibility: visible;
}

/* Mobile-Friendly Tables */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
    }
    
    .content-area {
        padding: 1rem;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .table-container {
        position: relative;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -1rem;
        padding: 0 1rem;
    }
    
    .table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        max-width: max-content;
    }
    
    .table th,
    .table td {
        white-space: nowrap;
    }
    
    /* ZPO Mobile Cards - Hide tables, show cards */
    .zpo-mobile-cards {
        display: flex !important;
        flex-direction: column;
        gap: 1rem;
    }
    
    .zpo-table-view {
        display: none !important;
    }
    
    .zpo-card {
        background: white;
        border: 1px solid var(--gray-200);
        border-radius: var(--radius);
        padding: 1rem;
    }
    
    .zpo-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.75rem;
        padding-bottom: 0.75rem;
        border-bottom: 1px solid var(--gray-100);
    }
    
    .zpo-card-title {
        font-weight: 600;
        color: var(--gray-800);
        font-size: 0.9375rem;
    }
    
    .zpo-card-row {
        display: flex;
        justify-content: space-between;
        margin-bottom: 0.5rem;
        font-size: 0.8125rem;
    }
    
    .zpo-card-label {
        color: var(--gray-500);
    }
    
    .zpo-card-value {
        font-weight: 500;
        color: var(--gray-700);
        text-align: right;
        max-width: 60%;
        word-break: break-word;
    }
    
    .zpo-card-actions {
        display: flex;
        gap: 0.5rem;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid var(--gray-100);
        flex-wrap: wrap;
    }
    
    .zpo-card-actions .btn {
        flex: 1;
        min-width: 80px;
        justify-content: center;
    }
}

/* Desktop View - Show tables, hide mobile cards */
@media (min-width: 769px) {
    .zpo-mobile-cards {
        display: none !important;
    }
    
    .zpo-table-view {
        display: block !important;
    }
}

/* Mobile Cards for Attendance History */
@media (max-width: 768px) {
    .attendance-history-cards {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .attendance-history-table {
        display: none;
    }
    
    .attendance-card {
        background: white;
        border: 1px solid var(--gray-200);
        border-radius: var(--radius);
        padding: 1rem;
    }
    
    .attendance-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.75rem;
        padding-bottom: 0.75rem;
        border-bottom: 1px solid var(--gray-100);
    }
    
    .attendance-card-date {
        font-weight: 600;
        color: var(--gray-800);
    }
    
    .attendance-card-status {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
        border-radius: 9999px;
    }
    
    .attendance-card-row {
        display: flex;
        justify-content: space-between;
        margin-bottom: 0.5rem;
        font-size: 0.875rem;
    }
    
    .attendance-card-label {
        color: var(--gray-500);
    }
    
    .attendance-card-value {
        font-weight: 500;
        color: var(--gray-700);
    }
}

/* Sidebar Close Button (Mobile) */
.sidebar-close-btn {
    display: none;
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    cursor: pointer;
    border-radius: var(--radius);
    font-size: 1.25rem;
    z-index: 10;
}

/* Responsive - Tablet and Mobile */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 280px;
    }
    
    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: var(--sidebar-width);
        max-width: var(--sidebar-width);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-close-btn {
        display: flex;
    }
    
    .main-content {
        margin-left: 0;
        max-width: 100vw;
    }
    
    .mobile-menu-btn {
        display: flex !important;
    }
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    width: 2.5rem;
    height: 2.5rem;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--gray-700);
    cursor: pointer;
    border-radius: var(--radius);
    font-size: 1.25rem;
}

.mobile-menu-btn:hover {
    background: var(--gray-100);
}

/* Mobile Navigation Adjustments */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }
    
    /* Top Navbar */
    .top-navbar {
        padding: 0.75rem 1rem;
        max-width: 100%;
        overflow: hidden;
    }
    
    .top-navbar .page-title {
        font-size: 1rem;
        font-weight: 600;
        color: var(--gray-800);
        display: none;
    }
    
    .top-navbar .nav-actions {
        gap: 0.25rem;
        flex-shrink: 0;
        max-width: 100%;
        overflow: hidden;
    }
    
    .top-navbar .nav-item {
        padding: 0.5rem;
        flex-shrink: 0;
    }
    
    .top-navbar .notification-badge {
        min-width: 16px;
        height: 16px;
        font-size: 0.625rem;
    }
    
    /* Content Area */
    .content-area {
        padding: 1rem;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Cards */
    .card {
        max-width: 100%;
        overflow: hidden;
    }
    
    .card-header {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        max-width: 100%;
    }
    
    .card-header .card-title {
        font-size: 0.9375rem;
    }
    
    .card-body {
        padding: 1rem;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .card-actions {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    /* Stats Grid */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        max-width: 100%;
    }
    
    .stat-card {
        padding: 1rem;
        max-width: 100%;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
    
    /* Tables */
    .table-container {
        margin: 0 -1rem;
        padding: 0 1rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        font-size: 0.8125rem;
        max-width: max-content;
    }
    
    .table th,
    .table td {
        padding: 0.625rem 0.75rem;
    }
    
    /* Buttons */
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.25rem;
        font-size: 0.9375rem;
    }
    
    /* Forms */
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-label {
        font-size: 0.8125rem;
    }
    
    .form-control {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    /* Alerts */
    .alert {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        max-width: 100%;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }
    
    /* Modal */
    .modal {
        position: fixed !important;
        max-width: calc(100% - 1rem) !important;
        width: calc(100% - 1rem) !important;
        max-height: calc(100vh - 1rem) !important;
        height: auto !important;
        margin: 0.5rem auto !important;
        left: 0.5rem !important;
        right: 0.5rem !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        overflow-wrap: break-word;
    }
    
    .modal.modal-content {
        max-height: calc(100vh - 1rem);
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    .modal-header {
        padding: 1rem;
        max-width: 100%;
    }
    
    .modal-header h3,
    .modal-header h4 {
        max-width: calc(100% - 2rem);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .modal-body {
        padding: 1rem;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .modal-footer {
        padding: 0.75rem 1rem;
        flex-direction: column;
        max-width: 100%;
    }
    
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Tabs */
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .tabs::-webkit-scrollbar {
        display: none;
    }
    
    .tab {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
        white-space: nowrap;
    }
    
    /* Notification Dropdown */
    .notification-menu {
        position: fixed;
        right: 0.5rem;
        left: 0.5rem;
        width: auto;
        max-width: 350px;
        margin: 0 auto;
    }
    
    /* Dropdown Menu */
    .dropdown-menu {
        position: fixed;
        right: 0.5rem;
        left: 0.5rem;
        width: auto;
        max-width: 300px;
        margin: 0 auto;
    }
    
    /* Pagination */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* Search Box */
    .header-search {
        display: none !important;
    }
    
    /* Content Header */
    .content-header {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .content-header h1 {
        font-size: 1.25rem;
        margin: 0;
    }
    
    .content-header .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Filters */
    .filters .row {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .filters .col-md-3 {
        width: 100%;
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .filters .filter-buttons {
        display: flex;
        gap: 0.5rem;
    }
    
    .filters .filter-buttons .btn {
        flex: 1;
    }
    
    /* Recent Section */
    .recent-section h3 {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
}

/* Extra Small Devices */
@media (max-width: 480px) {
    /* Page Title in Top Nav */
    .top-navbar .page-title {
        display: block;
        font-size: 0.9375rem;
    }
    
    /* Cards */
    .card {
        border-radius: var(--radius);
    }
    
    /* Stats */
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    .stat-card .stat-icon {
        margin: 0 auto;
    }
    
    /* Tables - Make them scrollable with sticky first column if needed */
    .table-responsive-mobile {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Buttons full width on mobile */
    .btn-block-mobile {
        width: 100%;
        display: flex;
    }
    
    /* Hide less important elements on small screens */
    .hide-mobile {
        display: none !important;
    }
    
    /* Better touch targets */
    .nav-item,
    .menu-item,
    .dropdown-item {
        min-height: 44px;
    }
    
    /* Modal */
    .modal {
        max-width: calc(100% - 1rem);
        margin: 0.5rem auto;
        max-height: calc(100vh - 1rem);
        border-radius: var(--radius);
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .top-navbar,
    .mobile-menu-btn,
    .sidebar-overlay {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content-area {
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
