:root {
    /* State of the Art Palette - HSL based for better depth */
    --bg-primary: #0b0e14;
    --bg-secondary: #0f121a;
    --bg-card: rgba(20, 24, 33, 0.6);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --accent: #6366f1; /* More vibrant Indigo */
    --accent-hover: #4f46e5;
    --accent-rgb: 99, 102, 241;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border: rgba(255, 255, 255, 0.05);
    
    /* Advanced Glassmorphism */
    --glass-bg: rgba(15, 18, 26, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shine: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 100%);
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.2), 0 4px 6px -4px rgba(0,0,0,0.2);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.3), 0 8px 10px -6px rgba(0,0,0,0.3);
    --shadow-accent: 0 10px 20px -5px rgba(99, 102, 241, 0.4);
    
    --sidebar-width: 280px;
    --topbar-height: 80px;
    --radius-full: 9999px;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 10px;
    
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

/* Material Icons adjustments */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    z-index: 10;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px 32px;
}

.logo-icon {
    font-size: 32px;
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.15);
    padding: 8px;
    border-radius: var(--radius-sm);
}

.sidebar-header h2 {
    font-weight: 600;
    font-size: 1.25rem;
    letter-spacing: 0.5px;
}

.sidebar-header h2 .highlight {
    color: var(--accent);
    font-weight: 700;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 16px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: var(--transition);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: var(--text-primary);
    background: rgba(108, 92, 231, 0.15);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 60%;
    width: 4px;
    background: var(--accent);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 10px var(--accent);
}

.nav-item.active .material-symbols-outlined {
    font-variation-settings: 'FILL' 1, 'wght' 500;
    color: var(--accent);
}

.sidebar-footer {
    padding: 24px;
    margin-top: auto;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    padding: 12px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
}

.user-profile:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

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

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

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

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Mesh Background Blobs */
.ambient-mesh {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -2;
    overflow: hidden;
    background: var(--bg-primary);
}

.blob {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: blob-float 20s infinite alternate;
}

.blob-1 { background: var(--accent); top: -100px; left: -100px; animation-delay: 0s; }
.blob-2 { background: var(--success); bottom: -100px; right: -100px; animation-delay: -5s; width: 500px; height: 500px; }
.blob-3 { background: #ec4899; top: 30%; left: 50%; animation-delay: -10s; opacity: 0.1; }

@keyframes blob-float {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
    100% { transform: translate(0, 0) scale(1); }
}

/* Sidebar Overhaul */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(15, 18, 26, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 32px 0;
    z-index: 10;
    transition: var(--transition-smooth);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px 40px;
}

.logo-icon {
    font-size: 32px;
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.1);
    padding: 10px;
    border-radius: var(--radius-md);
    box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.2);
    border: 1px solid rgba(var(--accent-rgb), 0.2);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    margin: 0 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition-smooth);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
}

.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(4px);
}

.nav-item.active {
    color: #fff;
    background: rgba(var(--accent-rgb), 0.1);
    box-shadow: inset 0 0 10px rgba(var(--accent-rgb), 0.05);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    right: 12px;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent);
}

/* Modern Topbar */
.topbar {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    background: rgba(11, 14, 20, 0.5);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
    z-index: 5;
}

.search-bar {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    padding: 0 20px;
    height: 48px;
    width: 380px;
    transition: var(--transition-smooth);
}

.search-bar:focus-within {
    width: 420px;
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.1);
}

/* View Sections Entry Animation */
.view-section {
    display: none;
    opacity: 0;
    transform: translate3d(0, 15px, 0);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.view-section.active {
    display: block;
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.search-bar .material-symbols-outlined {
    color: var(--text-secondary);
    margin-right: 12px;
}

.search-bar input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    width: 100%;
    font-size: 0.95rem;
}

.search-bar input::placeholder {
    color: var(--text-secondary);
}

/* Global Search Dropdown */
.search-results-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    width: 500px;
    max-height: 400px;
    background: rgba(26, 29, 45, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-glass);
    overflow-y: auto;
    z-index: 1000;
    animation: slideDown 0.2s ease-out;
}

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

.search-results-dropdown.hidden {
    display: none;
}

.search-header {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border);
}

.search-item {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.search-item:hover {
    background: rgba(108, 92, 231, 0.1);
}

.search-item:last-child {
    border-bottom: none;
}

.search-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent);
}

.search-item-info {
    flex: 1;
}

.search-item-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.search-item-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.search-no-results {
    padding: 32px;
    text-align: center;
    color: var(--text-secondary);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
}

.btn-icon:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border);
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.5);
}

/* Topbar User Menu */
.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 40px;
    cursor: pointer;
    transition: var(--transition);
}

.topbar-user:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.topbar-user .user-info {
    display: flex;
    flex-direction: column;
    margin-right: 8px;
}

.topbar-user .user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

.topbar-user .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.topbar-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: var(--transition);
}

.topbar-logout:hover {
    color: var(--danger);
    background: rgba(255, 118, 117, 0.1);
    border-color: rgba(255, 118, 117, 0.2);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid var(--glass-border);
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-fast);
    backdrop-filter: blur(5px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* Status Badges - Refined */
.badge {
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge.pending { background: rgba(245, 158, 11, 0.15); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.2); }
.badge.active { background: rgba(99, 102, 241, 0.15); color: var(--accent); border: 1px solid rgba(99, 102, 241, 0.2); }
.badge.completed { background: rgba(16, 185, 129, 0.15); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }


/* Content Wrapper */
.content-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    position: relative;
    padding-bottom: 100px;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Views */
.view-section {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.view-section.active {
    display: block;
}

.hidden {
    display: none !important;
}

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

/* Universal Cards & Grid Layouts */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 28px;
    box-shadow: var(--shadow-lg);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.glass-card:hover {
    transform: translateY(-4px) scale(1.005);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.15);
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 100%;
    background: var(--glass-shine);
    pointer-events: none;
    opacity: 0.5;
}


.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.stat-icon.primary { background: rgba(108, 92, 231, 0.15); color: var(--accent); }
.stat-icon.warning { background: rgba(253, 203, 110, 0.15); color: var(--warning); }
.stat-icon.success { background: rgba(0, 184, 148, 0.15); color: var(--success); }
.stat-icon.danger { background: rgba(255, 118, 117, 0.15); color: var(--danger); }

.stat-content h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-content .value, .stat-info h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

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

.section-header h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Tables - Professional Polish */
.table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th, td {
    padding: 20px 24px;
    text-align: left;
}

th {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border);
}

td {
    color: var(--text-primary);
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border);
}


tr {
    transition: var(--transition);
}

tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

#modal-container {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(15px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

#modal-container.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    background-image: var(--glass-shine);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 640px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    animation: modal-enter 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.15);
}

@keyframes modal-enter {
    from { transform: scale(0.95) translate3d(0, 20px, 0); opacity: 0; }
    to { transform: scale(1) translate3d(0, 0, 0); opacity: 1; }
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition-fast);
}

.form-control:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.15);
}


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

/* Signature Canvas */
.signature-pad {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: white;
    width: 100%;
    height: 200px;
    cursor: crosshair;
}

/* Two Column Form Layout */
.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap; /* Allow wrapping */
}

.form-row .form-group {
    flex: 1;
    min-width: 250px; /* Force stack on smaller areas */
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 32px;
}

/* Login Screen Split UI */
.login-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    z-index: 1000;
}

.login-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 24px;
}

.login-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.login-tab.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 10px rgba(108, 92, 231, 0.3);
}

/* Settings Sub-Tabs */
.settings-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 8px;
    overflow-x: auto;
}
.settings-tab {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 8px 16px;
    font-size: 1rem;
    cursor: pointer;
    font-family: inherit;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
    white-space: nowrap;
}
.settings-tab:hover {
    background: rgba(108, 92, 231, 0.1);
    color: var(--text-primary);
}
.settings-tab.active {
    background: var(--accent);
    color: #fff;
}
.settings-section {
    display: none;
    animation: fadeIn 0.3s ease;
}
.settings-section.active {
    display: block;
}

/* Star Rating System */
.star-rating {
    display: inline-flex;
    flex-direction: row-reverse;
    font-size: 2rem;
    justify-content: center;
    padding: 1rem;
}
.star-rating input { display: none; }
.star-rating label {
    color: var(--border);
    cursor: pointer;
    transition: color 0.2s;
}
.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label {
    color: #ffca28;
}

/* Glass Tabs for Timeframes */
.glass-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    width: fit-content;
}

.tab-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
    font-weight: 500;
    font-family: inherit;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    background: var(--accent);
    color: #ffffff;
    box-shadow: var(--shadow-md);
}

 / *   - - -   R E S P O N S I V E   D E S I G N   - - -   * / 
 @ m e d i a   ( m a x - w i d t h :   9 9 2 p x )   { 
         . s i d e b a r   { 
                 p o s i t i o n :   f i x e d ; 
                 l e f t :   - 3 0 0 p x ; 
                 t o p :   0 ; 
                 h e i g h t :   1 0 0 v h ; 
                 t r a n s i t i o n :   l e f t   0 . 3 s   c u b i c - b e z i e r ( 0 . 2 5 ,   0 . 8 ,   0 . 2 5 ,   1 ) ; 
                 b o x - s h a d o w :   1 0 p x   0   3 0 p x   r g b a ( 0 , 0 , 0 , 0 . 5 ) ; 
         } 
         . s i d e b a r . o p e n   { 
                 l e f t :   0 ; 
         } 
         . m o b i l e - m e n u - b t n   { 
                 d i s p l a y :   f l e x   ! i m p o r t a n t ; 
                 m a r g i n - r i g h t :   1 2 p x ; 
         } 
         . t o p b a r   { 
                 p a d d i n g :   0   1 6 p x ; 
         } 
         . d a s h b o a r d - g r i d ,   . s t a t s - g r i d   { 
                 g r i d - t e m p l a t e - c o l u m n s :   1 f r ; 
         } 
         . t o p b a r - u s e r   . u s e r - i n f o   { 
                 d i s p l a y :   n o n e ; 
         } 
         . s e a r c h - b a r   { 
                 w i d t h :   1 5 0 p x ; 
         } 
         . s e a r c h - b a r : f o c u s - w i t h i n   { 
                 w i d t h :   2 5 0 p x ; 
         } 
         . f o r m - r o w   { 
                 f l e x - d i r e c t i o n :   c o l u m n ; 
                 g a p :   0 ; 
         } 
         . l o g i n - w r a p p e r   { 
                 p a d d i n g :   2 0 p x ; 
         } 
 } 
 
 @ m e d i a   ( m a x - w i d t h :   6 0 0 p x )   { 
         . c o n t e n t - w r a p p e r   { 
                 p a d d i n g :   1 6 p x ; 
         } 
         . s t a t s - g r i d ,   . d a s h b o a r d - g r i d   { 
                 g r i d - t e m p l a t e - c o l u m n s :   1 f r ; 
         } 
         . g l a s s - c a r d   { 
                 p a d d i n g :   1 6 p x ; 
         } 
         . s t a t - c a r d   { 
                 f l e x - d i r e c t i o n :   r o w ; 
                 a l i g n - i t e m s :   c e n t e r ; 
                 t e x t - a l i g n :   l e f t ; 
         } 
         . s e a r c h - b a r   { 
                 w i d t h :   1 2 0 p x ; 
         } 
         . s e a r c h - b a r : f o c u s - w i t h i n   { 
                 p o s i t i o n :   a b s o l u t e ; 
                 w i d t h :   c a l c ( 1 0 0 v w   -   8 0 p x ) ;   / *   F i l l   m o s t   o f   b a r   * / 
                 l e f t :   5 0 p x ; 
                 b a c k g r o u n d :   v a r ( - - b g - p r i m a r y ) ; 
                 z - i n d e x :   1 0 0 0 ; 
         } 
         . m o d a l - c o n t e n t   { 
                 p a d d i n g :   2 0 p x ; 
                 w i d t h :   9 5 % ; 
         } 
         . s e c t i o n - h e a d e r   { 
                 f l e x - d i r e c t i o n :   c o l u m n ; 
                 a l i g n - i t e m s :   f l e x - s t a r t ; 
                 g a p :   1 6 p x ; 
         } 
         . s e c t i o n - h e a d e r   >   d i v : l a s t - c h i l d   { 
                 w i d t h :   1 0 0 % ; 
         } 
         . s e c t i o n - h e a d e r   b u t t o n   { 
                 w i d t h :   1 0 0 % ; 
                 j u s t i f y - c o n t e n t :   c e n t e r ; 
         } 
         . t a b l e - c o n t a i n e r   { 
                 f o n t - s i z e :   0 . 8 5 r e m ; 
         } 
         t h ,   t d   { 
                 p a d d i n g :   1 0 p x   8 p x ; 
         } 
 } 
  
 /* Appended Mobile Responsiveness Overrides */
.settings-tabs, .glass-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    padding-bottom: 5px;
}
.settings-tabs::-webkit-scrollbar, .glass-tabs::-webkit-scrollbar {
    height: 4px;
}
@media (max-width: 600px) {
    .section-header > div:last-child {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
    }
    .section-header button {
        width: 100% !important;
        margin: 0 !important;
        padding: 10px 4px !important;
        font-size: 0.8rem;
    }
    .table-container {
        font-size: 0.85rem;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        display: block;
        width: 100%;
    }
    th, td {
        white-space: nowrap;
    }
    .modal-content {
        padding: 16px !important;
    }
    .glass-card {
        padding: 16px 12px !important;
    }
    .stat-card {
        padding: 12px !important;
    }
    .pos-layout {
        flex-direction: column !important;
    }
    .pos-products {
        max-height: 45vh;
        overflow-y: auto;
    }
}

/* Premium Animations & Effects */

/* Login Logo Breathing Glow */
#login-logo-container .logo-icon {
    animation: logo-breathing 3s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(var(--accent-rgb), 0.3));
}

@keyframes logo-breathing {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(var(--accent-rgb), 0.3)); }
    50% { transform: scale(1.05); filter: drop-shadow(0 0 20px rgba(var(--accent-rgb), 0.6)); }
}

/* Urgent Pulse Effect */
.urgent-pulse {
    border: 2px solid var(--danger) !important;
    animation: urgent-grow 2s ease-in-out infinite;
}

@keyframes urgent-grow {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 118, 117, 0.2); }
    50% { box-shadow: 0 0 25px rgba(255, 118, 117, 0.5); }
}

/* Rotating icon for syncing */
.rotating {
    animation: rotate 1.5s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* View Transition Fade */
.view-section {
    animation: fade-in 0.4s ease-out;
}

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

/* Status Pulse for On-Site jobs */
.badge.active {
    position: relative;
    overflow: hidden;
}

.badge.active::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: inherit;
    animation: status-pulse 1.5s infinite;
}

@keyframes status-pulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* Glass Card Hover Elevation */
.glass-card {
    transition: var(--transition);
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.15);
}

/* New Item Highlight Animation */
.new-item-highlight {
    animation: highlight-green 2s ease-out;
}

@keyframes highlight-green {
    0% { background-color: rgba(0, 184, 148, 0.2); }
    100% { background-color: transparent; }
}

/* Portal Interactive Elements */
.choice-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}
.choice-card:hover {
    background: rgba(108, 92, 231, 0.1);
    border-color: var(--primary);
    transform: translateY(-2px);
}
.choice-card.active {
    background: rgba(108, 92, 231, 0.2);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(108, 92, 231, 0.2);
}
.choice-card .material-symbols-outlined {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 12px;
}

.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
}
.star-rating input {
    display: none;
}
.star-rating label {
    font-size: 2.5rem;
    color: #444;
    cursor: pointer;
    transition: color 0.2s ease;
}
.star-rating input:checked ~ label {
    color: #fdcb6e;
}
.star-rating label:hover,
.star-rating label:hover ~ label {
    color: #ffeaa7;
}

.pending-item {
    background: rgba(255,255,255,0.05);
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.9rem;
}

.track-timeline {
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    display: flex;
    margin: 20px 0;
}
.track-step {
    flex: 1;
    height: 100%;
}
.track-step.active {
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary);
}

/* --- PORTAL UI --- */
.client-header {
    background: rgba(15, 15, 15, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 16px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 90;
}

.client-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.client-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.glass-card.job-track-card {
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.glass-card.job-track-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
}

.pending-item {
    background: rgba(255, 255, 255, 0.02);
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Modal Overlay hardening */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: none;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active {
    display: flex;
}

/* Pulse animation for Action Required */
@keyframes pulse-border {
    0% { border-color: rgba(108, 92, 231, 0.3); box-shadow: 0 0 0 0 rgba(108, 92, 231, 0); }
    50% { border-color: rgba(108, 92, 231, 0.8); box-shadow: 0 0 15px 5px rgba(108, 92, 231, 0.1); }
    100% { border-color: rgba(108, 92, 231, 0.3); box-shadow: 0 0 0 0 rgba(108, 92, 231, 0); }
}

/* Toast Notification System */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    min-width: 300px;
    max-width: 450px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    box-shadow: var(--shadow-glass);
    display: flex;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(12px);
    animation: toastSlideIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes toastSlideIn {
    from { transform: translateX(100%) scale(0.9); opacity: 0; }
    to { transform: translateX(0) scale(1); opacity: 1; }
}

.toast.removing {
    animation: toastSlideOut 0.3s forwards;
}

@keyframes toastSlideOut {
    to { transform: translateX(100%); opacity: 0; }
}

.toast.success { border-left: 4px solid var(--success); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--accent); }

/* --- MOBILE BACKDROP --- */
.mobile-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-backdrop.active {
    display: block;
    opacity: 1;
}

.toast-icon { font-size: 24px; }
.toast.success .toast-icon { color: var(--success); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.error .toast-icon { color: var(--danger); }
.toast.info .toast-icon { color: var(--accent); }

/* Table to Card Transformation (Mobile) */
@media (max-width: 768px) {
    .table-container table, 
    .table-container thead, 
    .table-container tbody, 
    .table-container th, 
    .table-container td, 
    .table-container tr {
        display: block !important;
    }

    .table-container thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .table-container tr {
        background: rgba(255, 255, 255, 0.02);
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        margin-bottom: 20px;
        padding: 12px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    }

    .table-container td {
        border: none;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        position: relative;
        padding-left: 45% !important;
        text-align: right !important;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }

    .table-container td:last-child {
        border-bottom: 0;
        margin-top: 8px;
        justify-content: center !important;
        padding-left: 12px !important;
    }

    .table-container td::before {
        content: attr(data-label);
        position: absolute;
        left: 12px;
        width: 40%;
        text-align: left;
        font-weight: 700;
        font-size: 0.75rem;
        text-transform: uppercase;
        color: var(--text-secondary);
        letter-spacing: 0.5px;
    }
}

/* Search Highlighting */
.search-item.highlighted {
    background: rgba(var(--accent-rgb), 0.15) !important;
    border-left: 4px solid var(--accent);
}

/* --- STATE OF THE ART: SKELETON LOADERS --- */
.skeleton-wrap {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.skeleton {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.03) 25%, 
        rgba(255, 255, 255, 0.08) 50%, 
        rgba(255, 255, 255, 0.03) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-header { height: 40px; width: 300px; margin-bottom: 20px; }
.skeleton-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.skeleton-card { height: 160px; border-radius: var(--radius-md); }
.skeleton-table { height: 400px; width: 100%; border-radius: var(--radius-md); }

/* --- PREMIUM INTERACTION CLASSES --- */
.hover-float {
    transition: var(--transition-smooth);
}
.hover-float:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.3);
    border-color: var(--accent);
}

.pill-nav {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px;
    border-radius: var(--radius-full);
    width: fit-content;
}

/* Custom Scrollbar for State of the Art look */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

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

.animate-in {
    animation: fadeIn 0.5s ease-out forwards;
}

/* --- PDF GENERATION FIXES --- */
#pdf-render-page {
    width: 794px !important;
    max-width: 794px !important;
    overflow: hidden !important;
}

#pdf-render-page * {
    max-width: none !important;
    box-sizing: border-box !important;
}

#pdf-render-page table {
    width: 100% !important;
}

/* --- MOBILE BOTTOM NAV --- */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: rgba(26, 29, 45, 0.95);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10000;
    padding-bottom: env(safe-area-inset-bottom);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.7rem;
    gap: 4px;
    transition: 0.3s;
}

.mobile-nav-item .material-symbols-outlined {
    font-size: 24px;
}

.mobile-nav-item.active {
    color: var(--accent);
}

.mobile-nav-item.active .material-symbols-outlined {
    font-variation-settings: 'FILL' 1;
}

/* Mobile Specific UX Enhancements */
@media (max-width: 992px) {
    .mobile-bottom-nav {
        display: flex;
    }

    .main-content {
        padding-bottom: 90px; /* Space for bottom nav */
    }

    /* Larger tap targets for mobile */
    .btn-primary, .btn-secondary, .form-control {
        min-height: 48px;
        font-size: 1rem;
    }

    .sidebar {
        display: none; /* Hide sidebar on mobile in favor of bottom nav and backdrop menu */
    }
    
    .sidebar.active {
        display: block;
        z-index: 9999;
    }

    /* Repair Console Mobile Optimization */
    .pos-wrapper {
        grid-template-columns: 1fr !important;
        height: auto !important;
    }

    #repair-timeline {
        max-height: 400px;
    }
}

/* Glassmorphism for mobile cards */
@media (max-width: 600px) {
    .glass-card {
        padding: 16px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}
/* Global Sync Status & Refresh */
.sync-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.2);
    border-radius: 20px;
    color: #2ecc71;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 16px;
    transition: all 0.3s ease;
}

.sync-status.offline {
    background: rgba(231, 76, 60, 0.1);
    border-color: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.sync-status .material-symbols-outlined {
    font-size: 16px;
}

.rotating {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@media (max-width: 992px) {
    .sync-status {
        display: none; /* Hide on mobile to save space */
    }
}

/* Technician Quick Action Buttons */
.quick-status-bar {
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 30px;
    border: 1px solid var(--border);
    display: flex;
}

.btn-icon-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 2px;
}

.btn-icon-label span:not(.material-symbols-outlined) {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
}

.btn-icon-label .material-symbols-outlined {
    font-size: 20px;
}

.btn-icon-label:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.btn-icon-label.active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
}

@media (max-width: 600px) {
    .quick-status-bar {
        width: 100%;
        justify-content: space-around;
        order: 1; /* Move to top on mobile wrap */
    }
    
    .hidden-mobile {
        display: none !important;
    }
}

/* Sync Animations */
#db-status-dot.syncing {
    animation: pulse-green 1s infinite;
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(46, 204, 113, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}
