@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Color Palette - Deep Space & Electric Violet */
    --bg-primary: #070a12;
    --bg-secondary: #0f172a;
    --bg-card: rgba(15, 23, 42, 0.75);
    --bg-glass: rgba(15, 23, 42, 0.65);
    
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-hover: rgba(255, 255, 255, 0.18);
    --border-glass-focus: rgba(99, 102, 241, 0.5);
    
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --primary-glow: rgba(99, 102, 241, 0.35);
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
    
    --accent-violet: #8b5cf6;
    --accent-pink: #ec4899;
    
    --accent-emerald: #10b981;
    --accent-emerald-glow: rgba(16, 185, 129, 0.25);
    --accent-rose: #f43f5e;
    --accent-rose-glow: rgba(244, 63, 94, 0.25);
    --accent-amber: #f59e0b;
    --accent-amber-glow: rgba(245, 158, 11, 0.25);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-premium: 0 20px 40px -15px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    --shadow-glow: 0 0 30px -5px rgba(99, 102, 241, 0.25);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-body);
}

body {
    background: radial-gradient(circle at 50% -20%, #1e1b4b 0%, #0c0f1d 50%, #070a12 100%);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Global Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

/* Utilities */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-premium);
    transition: var(--transition-smooth);
}

.glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.text-gradient {
    background: linear-gradient(135deg, #a5b4fc 0%, #818cf8 50%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Auth Layout */
.auth-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

.auth-container::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
}

.auth-card {
    width: 100%;
    max-width: 480px;
    padding: 3rem 2.5rem;
    position: relative;
    z-index: 1;
    animation: slideUp 0.5s var(--transition-smooth);
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 30px rgba(99, 102, 241, 0.1);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h2 {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

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

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

.form-control {
    width: 100%;
    padding: 0.85rem 1.15rem;
    background: rgba(2, 6, 23, 0.6);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-smooth);
}

.form-control:focus {
    border-color: var(--primary);
    background: rgba(2, 6, 23, 0.8);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control option {
    background: #0f172a;
    color: var(--text-primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.85rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 20px -2px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -2px rgba(99, 102, 241, 0.6);
    filter: brightness(1.1);
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--accent-rose) 0%, #e11d48 100%);
    color: white;
    box-shadow: 0 4px 15px var(--accent-rose-glow);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-rose-glow);
    filter: brightness(1.1);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    width: auto;
    border-radius: var(--radius-sm);
}

/* Alert Notification */
.alert {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: none;
    align-items: center;
    animation: fadeIn 0.3s var(--transition-smooth);
}

.alert-danger {
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: #fda4af;
}

.alert-success {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2.5rem;
    border-bottom: 1px solid var(--border-glass);
    background: rgba(7, 10, 18, 0.85);
    backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

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

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(99, 102, 241, 0.15);
    padding: 0.15rem 0.6rem;
    border-radius: 20px;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

/* Dashboard Body */
.dashboard-content {
    flex: 1;
    padding: 2.5rem 2rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

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

.stats-card {
    padding: 2rem 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-smooth);
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-gradient);
    opacity: 0.7;
    transition: var(--transition-smooth);
}

.stats-card:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 15px 35px -10px rgba(99, 102, 241, 0.18);
}

.stats-card:hover::before {
    opacity: 1;
    width: 6px;
}

.clickable-card {
    cursor: pointer;
    user-select: none;
}

.clickable-card:active {
    transform: translateY(-2px) scale(0.99);
}

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

.stats-info h4 {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stats-value {
    font-family: var(--font-heading);
    font-size: clamp(1.35rem, 2vw, 2.15rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}

.stats-icon {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    margin-left: 0.75rem;
    border-radius: var(--radius-md);
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #818cf8;
    font-size: 1.4rem;
    transition: var(--transition-smooth);
}

.stats-card:hover .stats-icon {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    transform: scale(1.08);
}

/* Sections */
.dashboard-section {
    margin-bottom: 2.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h3 {
    font-size: 1.5rem;
    position: relative;
    padding-left: 0.85rem;
}

.section-header h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    height: 70%;
    width: 4px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

/* Tables styling */
.table-responsive {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 520px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    background: rgba(11, 15, 25, 0.6);
    box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.5);
}

.table-responsive thead th {
    position: sticky;
    top: 0;
    background: #0f172a;
    z-index: 5;
    box-shadow: 0 2px 0 rgba(99, 102, 241, 0.25);
}

.custom-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
}

.custom-table th {
    padding: 1rem 1.25rem;
    font-size: 0.775rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    vertical-align: middle;
    white-space: nowrap;
}

.custom-table td {
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    vertical-align: middle;
}

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

.custom-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.015);
}

.custom-table tbody tr:hover td {
    background: rgba(99, 102, 241, 0.07);
    color: #ffffff;
}

/* Table Actions Flex Container */
.table-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.custom-table .btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.775rem;
    font-weight: 600;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.badge-active {
    background: rgba(16, 185, 129, 0.12);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge-active::before {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

.badge-inactive {
    background: rgba(244, 63, 94, 0.12);
    color: #fda4af;
    border: 1px solid rgba(244, 63, 94, 0.3);
}
.badge-inactive::before {
    background: #f43f5e;
    box-shadow: 0 0 8px #f43f5e;
}

.badge-pending {
    background: rgba(245, 158, 11, 0.12);
    color: #fde68a;
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.badge-pending::before {
    background: #f59e0b;
    box-shadow: 0 0 8px #f59e0b;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.75);
    backdrop-filter: blur(12px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal-content {
    width: 100%;
    max-width: 520px;
    padding: 2.5rem;
    animation: modalSlide 0.35s var(--transition-smooth);
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

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

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.modal-close:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(-40px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Footer & Actions */
.footer {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-glass);
    margin-top: auto;
}

.link-action {
    color: #818cf8;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.link-action:hover {
    color: #a5b4fc;
    text-decoration: underline;
}

/* Tables & Grid */
.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.table-card {
    padding: 1.85rem 1.5rem;
    text-align: center;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    transition: var(--transition-smooth);
    background: rgba(15, 23, 42, 0.5);
    position: relative;
    overflow: hidden;
}

.table-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.table-card.free {
    border-color: rgba(16, 185, 129, 0.3);
    background: radial-gradient(circle at top right, rgba(16, 185, 129, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
}
.table-card.free:hover {
    border-color: rgba(16, 185, 129, 0.6);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.15);
}

.table-card.occupied {
    border-color: rgba(244, 63, 94, 0.3);
    background: radial-gradient(circle at top right, rgba(244, 63, 94, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
}
.table-card.occupied:hover {
    border-color: rgba(244, 63, 94, 0.6);
    box-shadow: 0 8px 25px rgba(244, 63, 94, 0.15);
}

.table-card.preparing {
    border-color: rgba(245, 158, 11, 0.3);
    background: radial-gradient(circle at top right, rgba(245, 158, 11, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
}
.table-card.preparing:hover {
    border-color: rgba(245, 158, 11, 0.6);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.15);
}

.table-number {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

/* Orders List */
.orders-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.order-card {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 200px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.order-id {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.order-total {
    font-size: 1.35rem;
    font-weight: 800;
    margin: 1rem 0;
    color: #f8fafc;
}

.order-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.blink-amber {
    animation: amberBlink 1.5s infinite;
}

@keyframes amberBlink {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}

/* Sidebar & Responsive Dashboard */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    width: 280px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 200;
    flex-shrink: 0;
    transition: var(--transition-smooth);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.75rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.sidebar-brand {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: white;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-collapse-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.75rem;
    transition: var(--transition-smooth);
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.sidebar-collapse-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    color: white;
    border-color: rgba(99, 102, 241, 0.35);
}

.sidebar-close-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Desktop Collapsed Sidebar Mode */
.sidebar.collapsed {
    width: 82px !important;
}

.sidebar.collapsed .sidebar-header {
    padding: 1.5rem 0.5rem;
    justify-content: center;
}

.sidebar.collapsed .sidebar-brand span:not(.brand-icon) {
    display: none !important;
}

.sidebar.collapsed .sidebar-item a {
    justify-content: center;
    padding: 0.85rem;
    gap: 0;
}

.sidebar.collapsed .sidebar-item a span:not(.sidebar-icon) {
    display: none !important;
}

.sidebar.collapsed .sidebar-user-info {
    display: none !important;
}

.sidebar.collapsed .sidebar-footer {
    padding: 1rem 0.5rem;
    align-items: center;
}

.sidebar.collapsed #nav-logout-btn span:not(:first-child) {
    display: none !important;
}

.sidebar.collapsed #nav-logout-btn {
    padding: 0.6rem;
    width: auto !important;
}

.sidebar-menu {
    list-style: none;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    overflow-y: auto;
}

.sidebar-item {
    width: 100%;
}

.sidebar-item a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.sidebar-item a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.06);
}

.sidebar-item.active a {
    color: white;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.15);
}

.sidebar-item a .sidebar-icon {
    font-size: 1.2rem;
    transition: var(--transition-smooth);
}

.sidebar-item.active a .sidebar-icon {
    color: var(--primary-hover);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.sidebar-user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: white;
    font-size: 1.1rem;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.sidebar-user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100vh;
    overflow-y: auto;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2.5rem;
    border-bottom: 1px solid var(--border-glass);
    background: rgba(7, 10, 18, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle-btn {
    display: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition-smooth);
}

.sidebar-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.top-user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.top-user-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.top-user-role {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 290;
}

.sidebar-backdrop.active {
    display: block !important;
}

.sidebar-close-btn {
    display: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.1rem;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.sidebar-close-btn:hover {
    background: rgba(244, 63, 94, 0.2);
    color: white;
    border-color: rgba(244, 63, 94, 0.4);
}

.sidebar-toggle-btn {
    display: none;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.2rem;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.35);
    color: white;
}

/* Responsive adjustment for sidebar & mobile layouts */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed !important;
        left: -300px !important;
        top: 0;
        bottom: 0;
        width: 280px !important;
        height: 100vh !important;
        z-index: 300 !important;
        box-shadow: none;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }
    
    .sidebar.open {
        left: 0 !important;
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.8) !important;
    }
    
    .sidebar-close-btn {
        display: flex !important;
    }
    
    .sidebar-toggle-btn {
        display: flex !important;
    }

    .top-header {
        padding: 1rem 1.5rem;
    }
    
    .dashboard-content {
        padding: 1.75rem 1.25rem;
    }
}

@media (max-width: 640px) {
    .top-header {
        padding: 0.85rem 1rem;
    }

    .header-left h2 {
        font-size: 1.05rem !important;
    }

    .top-user-info {
        display: none !important;
    }

    .dashboard-content {
        padding: 1.25rem 0.85rem;
    }

    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .section-header h3 {
        font-size: 1.2rem;
    }

    .modal-content {
        width: 95% !important;
        padding: 1.25rem !important;
        margin: 0.5rem;
    }
}

@media (max-width: 520px) {
    .tables-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }
    .table-card {
        padding: 1.1rem 0.75rem !important;
        border-radius: 12px !important;
    }
    .table-card h3 {
        font-size: 1.15rem !important;
    }
    .table-card p {
        font-size: 0.8rem !important;
    }
}

/* Dashboard tab visibility states */
.dashboard-section {
    display: none;
}
.dashboard-section.active-tab {
    display: block !important;
    animation: tabFadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes tabFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
