/* ============================================================
   Vnet Management Console - Mobile-First Responsive Styles
   ============================================================ */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary: #64748b;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --dark: #0f172a;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --sidebar-width: 260px;
    --bottom-nav-height: 64px;
    --header-height: 60px;
    --transition: 200ms ease;
    --transition-slow: 300ms ease;

    /* Default theme glows (blue) */
    --theme-primary: #2563eb;
    --theme-primary-light: #60a5fa;
    --theme-primary-dark: #1d4ed8;
    --theme-glow: rgba(37,99,235,0.5);
    --theme-glow-soft: rgba(37,99,235,0.15);
    --theme-glow-subtle: rgba(37,99,235,0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ============================================================
   App Container
   ============================================================ */
.app-container {
    display: flex;
    min-height: 100vh;
    padding-bottom: var(--bottom-nav-height);
}

/* ============================================================
   Sidebar Navigation — Tech Command Center
   Dark glassmorphism + neon-glow aesthetic
   ============================================================ */
.sidebar-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background:
        linear-gradient(180deg, rgba(11,15,25,0.97) 0%, rgba(15,23,42,0.97) 100%),
        repeating-linear-gradient(0deg, transparent, transparent 2px, var(--theme-glow-subtle) 2px, var(--theme-glow-subtle) 3px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, var(--theme-glow-subtle) 2px, var(--theme-glow-subtle) 3px);
    background-blend-mode: normal, screen, screen;
    border-right: 1px solid var(--theme-glow-soft);
    box-shadow: 4px 0 24px rgba(0,0,0,0.4), inset -1px 0 0 rgba(255,255,255,0.04);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform var(--transition-slow);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

.sidebar-nav.open {
    transform: translateX(0);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.15rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo i {
    font-size: 1.35rem;
    color: var(--primary);
    text-shadow: 0 0 16px var(--theme-glow-soft);
}

.sidebar-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    background: rgba(255,255,255,0.06);
    border-radius: var(--radius);
    color: rgba(148,163,184,0.8);
    cursor: pointer;
    font-size: 1rem;
    transition: all var(--transition);
}
.sidebar-close:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.nav-section {
    padding: 0.625rem 0;
}

.nav-section + .nav-section {
    border-top: 1px solid rgba(255,255,255,0.05);
}

.nav-label {
    padding: 0.5rem 1.25rem 0.35rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(100,116,139,0.7);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.nav-label::before {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--theme-glow);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.6rem 0.875rem;
    margin: 0.15rem 0.75rem;
    color: rgba(148,163,184,0.85);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    background: none;
    width: calc(100% - 1.5rem);
    border-radius: 10px;
}

.nav-item:hover {
    background: rgba(255,255,255,0.04);
    color: #e2e8f0;
    transform: translateX(2px);
}
.nav-item:hover i {
    background: rgba(255,255,255,0.08);
    color: #cbd5e1;
}

.nav-item.active {
    background: linear-gradient(90deg, var(--theme-glow-soft), var(--theme-glow-subtle));
    color: #fff;
    font-weight: 600;
    box-shadow: 0 0 20px var(--theme-glow-subtle);
}
.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: linear-gradient(180deg, var(--primary-light), var(--primary));
    border-radius: 0 3px 3px 0;
    box-shadow: 0 0 8px var(--theme-glow);
}
.nav-item.active i {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 0 12px var(--theme-glow-soft);
}

.nav-item i {
    font-size: 1rem;
    width: 34px;
    height: 34px;
    min-width: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    color: rgba(148,163,184,0.7);
    transition: all 0.2s ease;
}

.nav-badge {
    margin-left: auto;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 0 8px rgba(239,68,68,0.3);
}

.sidebar-footer {
    margin-top: auto;
    padding: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    transition: background 0.2s ease;
}
.user-profile:hover {
    background: rgba(255,255,255,0.06);
}

.user-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}
.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--theme-glow-soft);
    box-shadow: 0 0 0 2px rgba(11,15,25,0.8);
}
.user-status-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #0B0F19;
    box-shadow: 0 0 6px rgba(34,197,94,0.5);
}

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #e2e8f0;
}

.user-role {
    font-size: 0.75rem;
    color: rgba(148,163,184,0.7);
}

.sidebar-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.5rem;
    border: none;
    border-radius: 8px;
    background: rgba(239,68,68,0.1);
    color: rgba(239,68,68,0.8);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}
.sidebar-logout:hover {
    background: rgba(239,68,68,0.2);
    color: #ef4444;
    box-shadow: 0 0 12px rgba(239,68,68,0.15);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

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

/* ============================================================
   Main Content
   ============================================================ */
.main-content {
    flex: 1;
    margin-left: 0;
    width: 100%;
    min-height: 100vh;
}

/* ============================================================
   Mobile Header
   ============================================================ */
.mobile-header {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 1rem;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    z-index: 50;
}

.menu-toggle,
.header-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--gray-700);
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: var(--radius);
}

.header-action {
    background: var(--primary);
    color: var(--white);
    box-shadow: var(--shadow);
}

.header-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-800);
}

/* ============================================================
   Desktop Header
   ============================================================ */
.desktop-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 1.5rem;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-search {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    padding: 0.5rem 1rem;
    width: 100%;
    max-width: 400px;
}

.header-search i {
    color: var(--gray-400);
    font-size: 0.9375rem;
}

.header-search input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.9375rem;
    color: var(--gray-700);
    width: 100%;
    font-family: inherit;
}

.header-search input::placeholder {
    color: var(--gray-400);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--gray-100);
    color: var(--gray-600);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1rem;
    position: relative;
    transition: all var(--transition);
}

.btn-icon:hover {
    background: var(--gray-200);
}

.notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--gray-100);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    text-decoration: none;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* ============================================================
   Page Content
   ============================================================ */
.page-content {
    padding: 1rem;
}

.view-section {
    display: none;
    animation: fadeIn 0.2s ease;
}

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

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

.page-header {
    margin-bottom: 1.25rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.page-subtitle {
    color: var(--gray-500);
    font-size: 0.9375rem;
}

/* ============================================================
   Stats Grid
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

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

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    color: var(--white);
    flex-shrink: 0;
}

.bg-blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.bg-amber { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.bg-green { background: linear-gradient(135deg, #34d399, #22c55e); }
.bg-red { background: linear-gradient(135deg, #f87171, #ef4444); }

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

.stat-label {
    font-size: 0.8125rem;
    color: var(--gray-500);
    font-weight: 500;
}

/* ============================================================
   Dashboard Grid
   ============================================================ */
.dashboard-grid {
    display: grid;
    gap: 1rem;
}

.dashboard-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

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

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

.card-link {
    font-size: 0.875rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.card-body {
    padding: 0.75rem;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--gray-400);
    gap: 0.5rem;
}

.empty-state i {
    font-size: 2rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.9375rem;
}

/* ============================================================
   Search & Filter Bar
   ============================================================ */
.search-filter-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 0.625rem 1rem;
}

.search-input i {
    color: var(--gray-400);
    font-size: 0.875rem;
}

.search-input input,
.filter-select select {
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.9375rem;
    color: var(--gray-700);
    width: 100%;
    font-family: inherit;
}

.filter-select {
    display: flex;
    align-items: center;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 0.625rem 1rem;
    min-width: 150px;
}

.filter-select select {
    cursor: pointer;
}

.filter-date {
    display: flex;
    align-items: center;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 0.625rem 1rem;
    min-width: 150px;
}

.filter-date input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.9375rem;
    color: var(--gray-700);
    width: 100%;
    font-family: inherit;
    cursor: pointer;
}

/* ============================================================
   Data Tables (Desktop) & Cards (Mobile)
   ============================================================ */
.data-container {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.data-table-wrapper {
    display: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.data-table th {
    background: var(--gray-50);
    padding: 0.875rem 1rem;
    text-align: left;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: var(--gray-500);
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
    vertical-align: middle;
}

.data-table tr:last-child td {
    border-bottom: none;
}

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

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-Pending { background: #f3f4f6; color: #4b5563; }
.status-Scheduled { background: #dbeafe; color: #1e40af; }
.status-In\ Progress { background: #fef3c7; color: #92400e; }
.status-On\ Hold { background: #fee2e2; color: #991b1b; }
.status-Completed { background: #dcfce7; color: #166534; }
.status-Cancelled { background: #fee2e2; color: #991b1b; }
.status-Lead { background: #e0e7ff; color: #3730a3; }
.status-Active { background: #dcfce7; color: #166534; }
.status-Inactive { background: #f3f4f6; color: #4b5563; }
.status-Paid { background: #dcfce7; color: #166534; }
.status-Unpaid { background: #fef3c7; color: #92400e; }
.status-Overdue { background: #fee2e2; color: #991b1b; }
.status-Overdue { background: #fee2e2; color: #991b1b; }
.status-Draft { background: #f3f4f6; color: #4b5563; }
.status-Sent { background: #dbeafe; color: #1e40af; }
.status-To\ Do { background: #f3f4f6; color: #4b5563; }
.status-Done { background: #dcfce7; color: #166534; }
.status-Blocked { background: #fee2e2; color: #991b1b; }
.status-Product { background: #dbeafe; color: #1e40af; }
.status-Service { background: #e0e7ff; color: #3730a3; }

.priority-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.priority-Urgent { background: #fee2e2; color: #991b1b; }
.priority-High { background: #ffedd5; color: #9a3412; }
.priority-Medium { background: #dbeafe; color: #1e40af; }
.priority-Low { background: #f3f4f6; color: #4b5563; }

/* Card List (Mobile Default) */
.card-list {
    display: flex;
    flex-direction: column;
}

.data-card {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: background var(--transition);
}

.data-card:active {
    background: var(--gray-100);
}

.data-card:last-child {
    border-bottom: none;
}

.card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.card-row:last-child {
    margin-bottom: 0;
}

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

.card-subtitle {
    color: var(--gray-500);
    font-size: 0.875rem;
}

.card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.card-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.375rem 0.625rem;
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-weight: 500;
    font-family: inherit;
}

.btn-outline {
    background: var(--white);
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
}

.btn-outline:hover {
    background: var(--gray-50);
}

.text-right { text-align: right; }
.text-center { text-align: center; }

/* ============================================================
   Calendar Styles
   ============================================================ */
.calendar-wrapper {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.calendar-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.calendar-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
    min-width: 140px;
    text-align: center;
}

.calendar-view-toggle {
    display: none;
    gap: 0.25rem;
    background: var(--gray-100);
    padding: 0.25rem;
    border-radius: var(--radius);
}

.btn-toggle {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--gray-500);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition);
}

.btn-toggle.active {
    background: var(--white);
    color: var(--gray-800);
    box-shadow: var(--shadow-sm);
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--gray-200);
}

.calendar-day-header {
    background: var(--gray-50);
    padding: 0.625rem 0.25rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--gray-500);
    letter-spacing: 0.025em;
}

.calendar-day {
    background: var(--white);
    min-height: 80px;
    padding: 0.375rem;
    position: relative;
    cursor: pointer;
    transition: background var(--transition);
}

.calendar-day:hover {
    background: var(--gray-50);
}

.calendar-day.other-month {
    background: var(--gray-50);
    color: var(--gray-400);
}

.calendar-day.today {
    background: var(--primary-light);
}

.calendar-day.today .day-number {
    background: var(--primary);
    color: var(--white);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 600;
}

.day-number {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.25rem;
    display: inline-block;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.calendar-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.calendar-event {
    font-size: 0.6875rem;
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    color: var(--white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    font-weight: 500;
}

.calendar-event-more {
    font-size: 0.6875rem;
    color: var(--gray-500);
    padding: 0 0.25rem;
}

/* Week View */
.calendar-week-view {
    display: grid;
    grid-template-columns: 50px repeat(7, 1fr);
    gap: 1px;
    background: var(--gray-200);
}

.calendar-week-view .week-header-cell {
    background: var(--gray-50);
    padding: 0.5rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
}

.calendar-week-view .week-day-cell {
    background: var(--white);
    min-height: 60px;
    padding: 0.375rem;
    position: relative;
}

/* Day View */
.calendar-day-view {
    background: var(--white);
}

.day-view-header {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    text-align: center;
    font-weight: 600;
    color: var(--gray-800);
}

.day-view-events {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.day-view-event {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    border-left: 3px solid var(--primary);
}

.day-view-event-time {
    font-size: 0.8125rem;
    color: var(--gray-500);
    min-width: 60px;
    font-weight: 500;
}

.day-view-event-details {
    flex: 1;
}

.day-view-event-title {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.9375rem;
}

.day-view-event-meta {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

/* Event Panel (Mobile Slide-up) */
.event-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    z-index: 200;
    transform: translateY(100%);
    transition: transform var(--transition-slow);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.event-panel.open {
    transform: translateY(0);
}

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

.event-panel-title {
    font-weight: 700;
    font-size: 1.125rem;
}

.event-panel-body {
    padding: 1.25rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.event-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
        z-index: 199;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

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

.event-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-100);
}

.event-detail-label {
    color: var(--gray-500);
    font-size: 0.875rem;
}

.event-detail-value {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.875rem;
}

/* ============================================================
   Projects Page — Kanban, Chips, Budget Bar, Detail Panel
   ============================================================ */

/* View Toggle Buttons */
.view-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--gray-400);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}
.view-toggle:hover {
    color: var(--gray-700);
    background: var(--gray-200);
}
.view-toggle.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* Filter Chips */
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--gray-200);
    background: var(--white);
    color: var(--gray-500);
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}
.filter-chip:hover {
    border-color: var(--gray-300);
    color: var(--gray-700);
}
.filter-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 12px var(--theme-glow-soft, rgba(37,99,235,0.15));
}

/* Kanban Board */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    min-height: 300px;
}

.kanban-column {
    display: flex;
    flex-direction: column;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    min-width: 240px;
    max-height: calc(100vh - 280px);
}

.kanban-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gray-700);
}

.kanban-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.kanban-count {
    margin-left: auto;
    background: var(--gray-200);
    color: var(--gray-600);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.1rem 0.5rem;
    border-radius: 9999px;
    min-width: 20px;
    text-align: center;
}

.kanban-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem;
    overflow-y: auto;
    flex: 1;
}

/* Kanban Card */
.kanban-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 0.875rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.kanban-card:hover {
    border-color: var(--gray-300);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.kanban-card .card-title {
    font-weight: 600;
    font-size: 0.925rem;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}
.kanban-card .card-meta {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}
.kanban-card .card-actions {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.kanban-card:hover .card-actions {
    opacity: 1;
}
.kanban-card .card-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: none;
    background: var(--gray-100);
    border-radius: 6px;
    color: var(--gray-500);
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.15s ease;
}
.kanban-card .card-actions button:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}
.kanban-card .card-actions button.btn-danger-icon:hover {
    background: rgba(239,68,68,0.1);
    color: var(--danger);
}

/* Budget Bar */
.budget-bar-bg {
    width: 100%;
    height: 8px;
    background: var(--gray-100);
    border-radius: 9999px;
    overflow: hidden;
}
.budget-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--theme-primary-light, #60a5fa));
    border-radius: 9999px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 4px;
}
.budget-bar-fill.over {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

/* Project Detail Slide-in Panel */
.project-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    z-index: 200;
    transform: translateY(100%);
    transition: transform var(--transition-slow);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}
.project-panel.open {
    transform: translateY(0);
}

.project-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1.25rem 1.25rem 0.75rem;
    border-bottom: 1px solid var(--gray-100);
}

.project-panel-title {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--gray-800);
}

.project-panel-body {
    padding: 1.25rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}

.project-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 199;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}
.project-panel-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================================
   Bottom Navigation (Mobile) — Dark Tech Theme
   ============================================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: linear-gradient(180deg, #0f172a, #0B0F19);
    border-top: 1px solid var(--theme-glow-soft);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 90;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -4px 24px rgba(0,0,0,0.3);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    color: rgba(148,163,184,0.6);
    text-decoration: none;
    font-size: 0.625rem;
    font-weight: 500;
    flex: 1;
    height: 100%;
    position: relative;
    transition: all var(--transition);
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    padding-top: 4px;
}

.bottom-nav-item i {
    font-size: 1.25rem;
    transition: transform var(--transition), filter var(--transition);
}

.bottom-nav-item.active {
    color: var(--primary-light);
}

.bottom-nav-item.active i {
    transform: translateY(-2px);
    filter: drop-shadow(0 0 6px var(--theme-glow));
}

.bottom-nav-item .nav-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 18px);
    margin: 0;
    font-size: 0.625rem;
    padding: 0 4px;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 0 6px rgba(239,68,68,0.3);
}

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

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

.modal {
    background: var(--white);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform var(--transition-slow);
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

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

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
}

.modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

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

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

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    color: var(--gray-800);
    background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

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

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-100);
}

.form-actions button {
    width: 100%;
}

/* ============================================================
   Toast Notifications
   ============================================================ */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 400;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 90vw;
    width: 360px;
    pointer-events: none;
}

.toast {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9375rem;
    font-weight: 500;
    animation: slideInRight 0.3s ease;
    pointer-events: auto;
    border-left: 3px solid var(--primary);
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

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

.form-row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

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

.line-item-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    align-items: end;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.line-item-row .form-group {
    margin-bottom: 0;
}

.receipt-totals .total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
}

.receipt-totals .grand-total {
    font-size: 1.125rem;
    font-weight: 700;
    border-top: 1px solid var(--gray-200);
    padding-top: 0.5rem;
    margin-top: 0.5rem;
}

/* Tablet and above (≥ 768px) */
@media (min-width: 768px) {
    .form-row {
        flex-direction: row;
    }

    .form-row-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .line-item-row {
        grid-template-columns: 2fr 2fr 0.8fr 1.4fr 1.4fr auto;
        gap: 0.5rem;
        padding: 0;
        background: transparent;
        border-radius: 0;
    }

    .line-item-row .form-group input,
    .line-item-row .form-group select {
        min-width: 80px;
    }

    .form-actions {
        flex-direction: row;
        justify-content: flex-end;
    }

    .form-actions button {
        width: auto;
    }
}

/* ============================================================
   Responsive Breakpoints
   ============================================================ */

/* Tablet and above (≥ 768px) */
@media (min-width: 768px) {
    .app-container {
        padding-bottom: 0;
    }

    .main-content {
        margin-left: var(--sidebar-width);
    }

    .sidebar-nav {
        transform: translateX(0);
        position: fixed;
    }

    .sidebar-close {
        display: none;
    }

    .sidebar-overlay {
        display: none !important;
    }

    .mobile-header {
        display: none;
    }

    .desktop-header {
        display: flex;
    }

    .bottom-nav {
        display: none;
    }

    .page-content {
        padding: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .stat-card {
        padding: 1.25rem;
    }

    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .data-table-wrapper {
        display: block;
    }

    .card-list {
        display: none;
    }

    .calendar-wrapper {
        min-height: 500px;
    }

    .calendar-day {
        min-height: 100px;
        padding: 0.5rem;
    }

    .calendar-view-toggle {
        display: flex;
    }

    .modal-overlay {
        align-items: center;
        padding: 2rem;
    }

    .modal {
        border-radius: var(--radius-xl);
        max-width: 560px;
        width: 100%;
        transform: translateY(20px);
    }

    .modal-overlay.active .modal {
        transform: translateY(0);
    }

    .event-panel {
        left: auto;
        right: 1rem;
        bottom: auto;
        top: 50%;
        transform: translateY(-50%) translateX(120%);
        width: 380px;
        max-height: 70vh;
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-xl);
    }

    .event-panel.open {
        transform: translateY(-50%) translateX(0);
    }

    /* Projects Kanban — desktop right-side drawer */
    .project-panel {
        left: auto;
        right: 0;
        top: 0;
        bottom: 0;
        max-height: 100vh;
        width: 420px;
        border-radius: 0;
        transform: translateX(100%);
    }
    .project-panel.open {
        transform: translateX(0);
    }

    .kanban-board {
        grid-template-columns: repeat(4, 1fr);
        gap: 1rem;
        overflow-x: visible;
    }
    .kanban-column {
        max-height: calc(100vh - 260px);
    }
}

/* Desktop (≥ 1024px) */
@media (min-width: 1024px) {
    .page-content {
        padding: 2rem;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .calendar-grid {
        gap: 2px;
    }

    .calendar-day {
        min-height: 120px;
    }
}

/* Large Desktop (≥ 1280px) */
@media (min-width: 1280px) {
    .stats-grid {
        gap: 1.5rem;
    }

    .dashboard-grid {
        gap: 1.5rem;
    }
}

/* Small Mobile adjustments */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .stat-card {
        padding: 0.875rem;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 0.875rem;
    }

    .stat-value {
        font-size: 1.125rem;
    }

    .page-header h1 {
        font-size: 1.25rem;
    }

    .calendar-day {
        min-height: 50px;
        padding: 0.25rem;
    }

    .day-number {
        width: 22px;
        height: 22px;
        font-size: 0.75rem;
    }

    .calendar-event {
        display: none;
    }

    .calendar-day.has-events .day-number::after {
        content: '';
        position: absolute;
        bottom: 2px;
        left: 50%;
        transform: translateX(-50%);
        width: 4px;
        height: 4px;
        border-radius: 50%;
        background: var(--primary);
    }

    .calendar-day {
        position: relative;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .nav-item:hover,
    .bottom-nav-item:hover {
        background: transparent;
    }

    .data-card:hover {
        background: var(--white);
    }

    .btn-primary:hover {
        transform: none;
    }

    .calendar-day:active {
        background: var(--gray-100);
    }
}

/* ============================================================
   Reports & Analytics
   ============================================================ */
.report-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.report-tile {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1rem;
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}
.report-tile:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.report-tile.active {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    background: var(--gray-50);
}
.report-tile .tile-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}
.report-tile .tile-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}
.report-tile .tile-desc {
    font-size: 0.75rem;
    color: var(--gray-500);
    line-height: 1.3;
}

.report-toolbar {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.report-title-display {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
}

.report-result {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    min-height: 300px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.kpi-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
}
.kpi-card .kpi-label {
    font-size: 0.7rem;
    color: var(--gray-500);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.03em;
    margin-bottom: 0.35rem;
}
.kpi-card .kpi-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--gray-800);
}
.kpi-card .kpi-delta {
    font-size: 0.8rem;
    margin-top: 0.25rem;
}
.kpi-card.positive .kpi-value { color: #16a34a; }
.kpi-card.negative .kpi-value { color: #dc2626; }

/* Print styles for PDF export */
@media print {
    .sidebar-nav, .bottom-nav, .header-bar, .report-tiles, .report-toolbar,
    #exportReportPdfBtn, .btn-primary, .btn-outline, .btn-sm, .form-actions {
        display: none !important;
    }
    .app-container { grid-template-columns: 1fr; }
    .main-content { padding: 0; }
    #reportsView { display: block !important; }
    .view-section { display: none; }
    #reportsView.view-section { display: block !important; }
    .report-result { border: none; box-shadow: none; }
    body { background: #fff; }
}

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

/* ============================================================
   Users & Profile
   ============================================================ */
.role-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.role-badge.role-Admin {
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
}
.role-badge.role-Manager {
    background: rgba(124, 58, 237, 0.12);
    color: #7c3aed;
}
.role-badge.role-Employee {
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
}
.role-badge.role-Contractor {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.user-avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gray-200);
}

.avatar-preview {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gray-200);
    display: block;
    margin-bottom: 0.75rem;
}

.profile-form .form-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
    margin: 1.25rem 0 0.75rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--gray-200);
}

/* Nav item visibility helpers */
.nav-item.hidden-by-role {
    display: none !important;
}

.bottom-nav-item.hidden-by-role {
    display: none !important;
}


/* Users table avatar cell */
.user-cell {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.user-cell .user-meta {
    display: flex;
    flex-direction: column;
}
.user-cell .user-meta .name {
    font-weight: 600;
    font-size: 0.9rem;
}
.user-cell .user-meta .email {
    font-size: 0.78rem;
    color: var(--gray-500);
}

/* ============================================================
   Color Themes — Scoped via body[data-theme]
   ============================================================ */

/* Theme helper: each theme defines its accent hue */
body[data-theme="blue"] {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --theme-primary: #2563eb;
    --theme-primary-light: #60a5fa;
    --theme-primary-dark: #1d4ed8;
    --theme-glow: rgba(37,99,235,0.5);
    --theme-glow-soft: rgba(37,99,235,0.15);
    --theme-glow-subtle: rgba(37,99,235,0.08);
}

body[data-theme="emerald"] {
    --primary: #059669;
    --primary-dark: #047857;
    --primary-light: #d1fae5;
    --theme-primary: #059669;
    --theme-primary-light: #34d399;
    --theme-primary-dark: #047857;
    --theme-glow: rgba(5,150,105,0.5);
    --theme-glow-soft: rgba(5,150,105,0.15);
    --theme-glow-subtle: rgba(5,150,105,0.08);
}

body[data-theme="purple"] {
    --primary: #7c3aed;
    --primary-dark: #6d28d9;
    --primary-light: #ede9fe;
    --theme-primary: #7c3aed;
    --theme-primary-light: #a78bfa;
    --theme-primary-dark: #6d28d9;
    --theme-glow: rgba(124,58,237,0.5);
    --theme-glow-soft: rgba(124,58,237,0.15);
    --theme-glow-subtle: rgba(124,58,237,0.08);
}

body[data-theme="orange"] {
    --primary: #ea580c;
    --primary-dark: #c2410c;
    --primary-light: #ffedd5;
    --theme-primary: #ea580c;
    --theme-primary-light: #fb923c;
    --theme-primary-dark: #c2410c;
    --theme-glow: rgba(234,88,12,0.5);
    --theme-glow-soft: rgba(234,88,12,0.15);
    --theme-glow-subtle: rgba(234,88,12,0.08);
}

body[data-theme="rose"] {
    --primary: #e11d48;
    --primary-dark: #be123c;
    --primary-light: #ffe4e6;
    --theme-primary: #e11d48;
    --theme-primary-light: #fb7185;
    --theme-primary-dark: #be123c;
    --theme-glow: rgba(225,29,72,0.5);
    --theme-glow-soft: rgba(225,29,72,0.15);
    --theme-glow-subtle: rgba(225,29,72,0.08);
}

body[data-theme="cyan"] {
    --primary: #0891b2;
    --primary-dark: #0e7490;
    --primary-light: #cffafe;
    --theme-primary: #0891b2;
    --theme-primary-light: #22d3ee;
    --theme-primary-dark: #0e7490;
    --theme-glow: rgba(8,145,178,0.5);
    --theme-glow-soft: rgba(8,145,178,0.15);
    --theme-glow-subtle: rgba(8,145,178,0.08);
}

/* ============================================================
   Theme-colored Navigation Backgrounds
   Dark base with visible theme tint — keeps the advanced look
   ============================================================ */

[data-theme] .sidebar-nav {
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--theme-primary-dark) 18%, #070b14) 0%, color-mix(in srgb, var(--theme-primary-dark) 10%, #050810) 100%),
        repeating-linear-gradient(0deg, transparent, transparent 2px, var(--theme-glow-soft) 2px, var(--theme-glow-soft) 3px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, var(--theme-glow-soft) 2px, var(--theme-glow-soft) 3px);
    background-blend-mode: normal, screen, screen;
    border-right: 1px solid var(--theme-glow-soft);
    box-shadow: 4px 0 24px rgba(0,0,0,0.5), inset -1px 0 0 rgba(255,255,255,0.03);
}

[data-theme] .sidebar-header {
    background: linear-gradient(135deg, color-mix(in srgb, var(--theme-primary) 22%, #0c1220), color-mix(in srgb, var(--theme-primary) 12%, #080e18));
    border-bottom: 1px solid var(--theme-glow-soft);
}

[data-theme] .bottom-nav {
    background: linear-gradient(180deg, color-mix(in srgb, var(--theme-primary-dark) 20%, #0B0F19), color-mix(in srgb, var(--theme-primary-dark) 10%, #070b14));
    border-top: 1px solid var(--theme-glow-soft);
}

[data-theme] .nav-item:hover {
    background: color-mix(in srgb, var(--theme-primary) 8%, transparent);
    color: #fff;
}

[data-theme] .nav-item:hover i {
    background: color-mix(in srgb, var(--theme-primary) 15%, transparent);
    color: var(--theme-primary-light);
}

/* Theme selector swatches */
.theme-swatch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    position: relative;
}
.theme-swatch:hover {
    transform: scale(1.15);
}
.theme-swatch.active {
    border-color: #fff;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.3), 0 0 8px rgba(255,255,255,0.2);
}
.theme-swatch.blue    { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.theme-swatch.emerald { background: linear-gradient(135deg, #34d399, #059669); }
.theme-swatch.purple  { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.theme-swatch.orange  { background: linear-gradient(135deg, #fb923c, #ea580c); }
.theme-swatch.rose    { background: linear-gradient(135deg, #fb7185, #e11d48); }
.theme-swatch.cyan    { background: linear-gradient(135deg, #22d3ee, #0891b2); }