:root {
    /* Color Palette - Modern & Professional */
    --primary-color: #4f46e5;
    /* Indigo 600 */
    --primary-hover: #4338ca;
    /* Indigo 700 */
    --secondary-color: #64748b;
    /* Slate 500 */
    --background-color: #f3f4f6;
    /* Gray 100 */
    --surface-color: #ffffff;
    --text-color: #1f2937;
    /* Gray 800 */
    --text-muted: #6b7280;
    /* Gray 500 */
    --border-color: #e5e7eb;
    /* Gray 200 */

    /* Status Colors */
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* Spacing & Radius */
    --radius: 0.5rem;
    --header-height: 64px;
}

/* Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Layout Structure */
.main-header {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 2rem;
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Add padding to container so content doesn't hide behind fixed header */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: var(--header-height);
}

.logo a {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.025em;
    white-space: nowrap;
}

.main-nav ul {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.main-nav a {
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary-color);
}

.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
}

.main-footer {
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: auto;
}

/* Modern Cards */
.card {
    background-color: var(--surface-color);
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: box-shadow 0.2s, transform 0.2s;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.card:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 1px 2px 0 rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-secondary {
    background-color: white;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.btn-secondary:hover {
    background-color: var(--background-color);
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    outline: none;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid var(--border-color);
}

.stat-value {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-color);
    margin: 0.5rem 0;
    line-height: 1;
}

.stat-label {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.875rem;
}

/* Modern Professional Tables */
.table-container {
    overflow-x: auto;
    background: var(--surface-color);
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: separate;
    /* Allows border radius */
    border-spacing: 0;
    text-align: left;
}

th {
    background-color: #f8fafc;
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: #64748b;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
    font-size: 0.9rem;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: #f8fafc;
}

/* User avatar in table */
.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e2e8f0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #475569;
    font-size: 0.85rem;
    margin-right: 0.75rem;
}

/* Utilities */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 1.5rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.flex-wrap {
    flex-wrap: wrap;
}

.gap-2 {
    gap: 0.5rem;
}

.w-full {
    width: 100%;
}

/* Status Badges */
.badge {
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Login Page Specific */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: white;
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Premium Service Call Card Redesign */
.service-card-premium {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    margin-bottom: 1.5rem;
}

.service-card-premium:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

.sc-header {
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sc-id {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.85rem;
    color: #64748b;
    background: #e2e8f0;
    padding: 2px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.sc-date {
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 500;
}

.sc-body {
    padding: 1.25rem;
}

.sc-user-info {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.sc-avatar {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #3b82f6;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.sc-details h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.sc-device-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: #475569;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 20px;
    margin-top: 0.25rem;
}

.sc-issue-box {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: #9f1239;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.sc-location-box {
    background: #f8fafc;
    border-radius: 8px;
    padding: 0.75rem;
    border: 1px dashed #cbd5e1;
}

.sc-loc-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: #475569;
}

.sc-loc-row:last-child {
    margin-bottom: 0;
}

.sc-loc-row i {
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.sc-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
}

/* Camera / Video Styles */
.video-wrapper {
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
    border-radius: var(--radius);
    overflow: hidden;
    background-color: #000;
    position: relative;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
}

.video-feed {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transform: scaleX(-1);
}

/* Modern Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #334155;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #1e293b;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    transition: all 0.2s ease-in-out;
}

.form-control:focus {
    color: #0f172a;
    background-color: #fff;
    border-color: var(--primary-color);
    outline: 0;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.form-control::placeholder {
    color: #9ca3af;
    opacity: 1;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Auth Pages (Login/Register) */
.auth-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 2rem;
}

.auth-card {
    background: white;
    width: 100%;
    max-width: 500px;
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    margin: auto;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: inline-block;
}

.auth-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-muted);
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Helper Text */
.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Required Asterisk */
.required-field::after {
    content: " *";
    color: var(--danger-color);
}

/* Responsive */
@media (max-width: 768px) {
    .main-header {
        flex-direction: row;
        height: auto;
        padding: 0.75rem 1rem;
        gap: 0.5rem;
        justify-content: space-between;
    }

    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .main-content {
        padding: 1rem;
    }

    .stat-value {
        font-size: 2.5rem;
    }

    .dashboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }

    .card {
        padding: 1.5rem;
    }

    .login-card,
    .auth-card {
        padding: 2rem;
        margin: 1rem;
    }

    table {
        font-size: 0.9rem;
    }

    th,
    td {
        padding: 0.75rem 1rem;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .main-header {
        padding: 0.75rem;
    }

    .logo a {
        font-size: 1.25rem;
    }

    .main-nav a {
        font-size: 0.85rem;
    }

    .main-content {
        padding: 0.75rem;
    }

    .stat-value {
        font-size: 2rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .card {
        padding: 1.25rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .login-card,
    .auth-card {
        padding: 1.5rem;
        margin: 0.5rem;
    }

    .auth-header h1 {
        font-size: 1.5rem;
    }

    .auth-header i {
        font-size: 2.5rem;
    }

    table {
        font-size: 0.85rem;
    }

    th,
    td {
        padding: 0.5rem 0.75rem;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .form-control {
        font-size: 0.9rem;
        padding: 0.625rem 0.875rem;
    }
}

/* Sidebar Navigation */
.app-container.with-sidebar {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Adjust Layout for Sidebar */
@media (min-width: 992px) {
    .app-container.with-sidebar .main-content {
        margin-left: 260px;
        padding: 2rem;
        width: calc(100% - 260px);
    }

    .app-container.with-sidebar .main-footer {
        margin-left: 260px;
        width: calc(100% - 260px);
    }
}

/* Professional Sidebar Redesign */
/* Professional Sidebar Redesign (Light) */
.sidebar {
    position: fixed;
    top: 64px;
    left: 0;
    bottom: 0;
    width: 260px;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    overflow-y: auto;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 900;
    padding-top: 1.5rem;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.03);
}

/* Scrollbar styling for sidebar */
.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.sidebar-menu {
    list-style: none;
    padding: 0 0.75rem;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-menu li {
    border-bottom: none;
}

.sidebar-menu>li>a,
.sidebar-menu>li>.menu-header {
    display: flex;
    align-items: center;
    padding: 0.85rem 1rem;
    color: #475569;
    /* Slate 600 */
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s;
    cursor: pointer;
    justify-content: space-between;
    border-radius: 0.5rem;
    margin-bottom: 2px;
}

.sidebar-menu>li>a:hover,
.sidebar-menu>li>.menu-header:hover {
    background: #f1f5f9;
    /* Slate 100 */
    color: var(--primary-color);
    transform: translateX(4px);
}

.sidebar-menu>li>a.active,
.sidebar-menu>li.active>a {
    background: #eff6ff;
    /* Blue 50 */
    color: var(--primary-color);
    box-shadow: none;
    font-weight: 600;
    border-left: 3px solid var(--primary-color);
}

.sidebar-menu>li>a i,
.sidebar-menu>li>.menu-header i {
    width: 24px;
    text-align: center;
    font-size: 1.1em;
    opacity: 0.9;
}

/* Submenu */
.submenu {
    list-style: none;
    padding: 0.25rem 0 0.25rem 0;
    margin: 0;
    background: #f8fafc;
    border-radius: 0.5rem;
    margin-top: 0.25rem;
    display: none;
}

.submenu.open {
    display: block;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.submenu li a {
    display: block;
    padding: 0.65rem 1rem 0.65rem 3.25rem;
    font-size: 0.9rem;
    color: #64748b;
    /* Slate 500 */
    text-decoration: none;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.submenu li a:hover {
    color: var(--primary-color);
    background: transparent;
}

.submenu li a i {
    font-size: 0.85em;
    width: 20px;
    margin-right: 0.5rem;
    opacity: 0.7;
}

/* Menu Chevron */
.menu-chevron {
    font-size: 0.75rem;
    transition: transform 0.3s;
    opacity: 0.6;
}

.menu-header.active .menu-chevron {
    transform: rotate(180deg);
}

/* Mobile Responsive */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
        top: 0;
        z-index: 1100;
        height: 100vh;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 899;
        display: none;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

.menu-toggle-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
    margin-right: 1rem;
}

@media (max-width: 991px) {
    .menu-toggle-btn {
        display: block;
    }
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 480px) {
    .table-container table {
        font-size: 0.8rem;
    }

    .table-container th,
    .table-container td {
        padding: 0.5rem;
    }
}

/* Ensure Sidebar Overlay is Topmost */
.sidebar-overlay {
    z-index: 1000 !important;
}

.sidebar {
    z-index: 1001 !important;
}

/* Better Touch Targets */
.menu-toggle-btn {
    padding: 0.5rem;
    font-size: 1.75rem;
}

/* Mobile Navigation For Staff/Customer */
@media (max-width: 991px) {
    .main-nav {
        display: none;
        /* Hidden by default on mobile */
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: white;
        border-bottom: 1px solid var(--border-color);
        padding: 1rem;
        box-shadow: var(--shadow-md);
        z-index: 999;
    }

    .main-nav.show {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }

    .main-nav a {
        padding: 0.75rem;
        border-radius: var(--radius);
    }

    .main-nav a:hover {
        background-color: var(--background-color);
    }
}

/* Improved Sidebar Aesthetics (Compact) */
.sidebar-menu>li>a,
.sidebar-menu>li>.menu-header {
    font-size: 0.9rem !important;
    padding: 0.75rem 1rem !important;
}

.submenu li a {
    font-size: 0.85rem !important;
    padding: 0.6rem 1rem 0.6rem 3.25rem !important;
}

.menu-chevron {
    font-size: 0.8rem !important;
}

/* Global Font Size Adjustment */
body {
    font-size: 0.9rem;
    /* Slightly smaller base */
}

h1,
.h1 {
    font-size: 1.5rem;
}

h2,
.h2 {
    font-size: 1.25rem;
}

h3,
.h3 {
    font-size: 1.1rem;
}

.stat-value {
    font-size: 2rem;
}

/* Reduced from 3rem */
th,
td {
    font-size: 0.85rem;
}

/* Compact tables */

/* --- MOBILE OVERFLOW FIXES --- */
html,
body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
    margin: 0;
    padding: 0;
}

.main-content {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    padding: 1rem;
    box-sizing: border-box;
}

.app-container {
    width: 100%;
    overflow-x: hidden;
}

.app-container {
    width: 100%;
    overflow-x: hidden;
}

.card,
.widget-box {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    /* Removed overflow: hidden to prevent clipping of dropdowns/tooltips */
}

.table-container {
    max-width: 100%;
    width: 100%;
    overflow-x: auto;
    /* Always allow scroll */
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    display: block;
}

/* Prevent flex items from forcing overflow */
.stat-card,
.col,
.flex-item {
    min-width: 0;
}

/* Ensure grids collapse properly */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem;
    }

    .main-header {
        padding: 0.5rem 0.5rem 0.5rem 0 !important;
        /* Zero padding on left */
        flex-wrap: nowrap;
        justify-content: flex-start;
        /* Force start alignment if needed */
        gap: 0.5rem;
    }

    .d-flex.align-items-center {
        gap: 0;
        margin-left: 0;
    }

    .menu-toggle-btn {
        margin: 0 !important;
        padding: 0.5rem !important;
    }

    .logo a {
        font-size: 1.1rem;
        padding-left: 0;
    }

    .table-container {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 480px) {

    .stats-grid,
    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }

    .main-content {
        padding: 1rem;
        /* Increased from 0.5rem for better spacing */
    }

    .stat-value {
        font-size: 1.75rem;
    }
}

/* Sidebar Profile Section */
.sidebar-profile {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
    background: linear-gradient(to bottom, #ffffff, #f8fafc);
}

.sidebar-profile .profile-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-profile .profile-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.1), 0 2px 4px -1px rgba(79, 70, 229, 0.06);
}

.sidebar-profile .profile-info {
    display: flex;
    flex-direction: column;
}

.sidebar-profile .profile-name {
    font-weight: 700;
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.2;
}

.sidebar-profile .profile-role {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-top: 2px;
}

/* Menu Labels */
.menu-label {
    padding: 1rem 1.25rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #94a3b8;
    /* Slate 400 */
    letter-spacing: 0.08em;
    display: block;
}

/* Refined Menu Items */
.sidebar-menu>li>a,
.sidebar-menu>li>.menu-header {
    margin: 0 0.5rem 2px 0.5rem;
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.sidebar-menu>li>a:hover,
.sidebar-menu>li>.menu-header:hover {
    background: #f1f5f9;
}

.sidebar-menu>li>a.active,
.sidebar-menu>li.active>a {
    background: #e0e7ff;
    /* Indigo 50 */
    color: var(--primary-color);
}