:root {
    /* Professional Dark Theme Palette */
    --bg-body: #0f172a;
    /* Slate 900 */
    --bg-sidebar: #1e293b;
    /* Slate 800 */
    --bg-card: #1e293b;
    /* Slate 800 */
    --bg-input: #334155;
    /* Slate 700 */

    --text-main: #f8fafc;
    /* Slate 50 */
    --text-muted: #94a3b8;
    /* Slate 400 */

    --primary: #3b82f6;
    /* Blue 500 */
    --primary-hover: #2563eb;
    /* Blue 600 */
    --danger: #ef4444;
    /* Red 500 */
    --success: #22c55e;
    /* Green 500 */
    --warning: #f59e0b;
    /* Amber 500 */

    --border-color: #334155;
    /* Slate 700 */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);

    --sidebar-width: 250px;
    --header-height: 64px;
    --radius: 6px;
}

[data-theme="light"] {
    --bg-body: #f1f5f9;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --primary: #2563eb;
    --border-color: #cbd5e1;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.06);
}

[data-theme="light"] .sidebar {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
    border-right: 1px solid var(--border-color);
}

[data-theme="light"] .brand h1 {
    color: var(--primary);
}

[data-theme="light"] .user-panel {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .user-name {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .nav-links a:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

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

/* Sidebar Navigation */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 50;
    transition: transform 0.3s ease;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
}

.brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.brand h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.nav-links {
    flex: 1;
    padding: 1.5rem 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-links a {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.nav-links a:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    transform: translateX(5px);
    border-left: 3px solid var(--primary);
}

.nav-links a.active {
    background-color: var(--primary);
    color: #ffffff;
}

.user-panel {
    margin: 1rem;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

.user-panel span {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}



/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    max-width: 1600px;
}

/* Standard Components */

/* Cards */
.card,
.glass,
.stat-card,
.login-card,
.report-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    /* Reset glass effects */
    backdrop-filter: none !important;
}

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

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.9rem;
    display: inline-block;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    text-decoration: none;
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background-color 0.2s;
    display: inline-block;
}

.btn-secondary:hover {
    background-color: #334155;
    text-decoration: none;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border-radius: 4px;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-main);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Tables */
.data-table,
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th,
table th {
    background-color: rgba(0, 0, 0, 0.2);
    font-weight: 600;
    text-align: left;
    padding: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.data-table td,
table td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    vertical-align: middle;
}

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

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-tech {
    background-color: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

/* Status Classes */
.status-pending {
    background-color: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.2);
}

.status-in_progress {
    background-color: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.2);
}

.status-completed {
    background-color: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border-color: rgba(34, 197, 94, 0.2);
}

.status-waiting_for_parts {
    background-color: rgba(249, 115, 22, 0.15);
    color: #fb923c;
    border-color: rgba(249, 115, 22, 0.2);
}

.status-cancelled {
    background-color: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.2);
}

/* Status Select Dropdown */
.status-select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    padding: 0.6rem 2rem 0.6rem 1rem !important;
    border-radius: 9999px !important;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    width: 100%;
    min-width: 140px;
    text-align: left;
    line-height: 1.5;

    /* Custom Dropdown Arrow */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='rgba(255,255,255,0.7)'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

.status-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.4);
}

.status-select option {
    background-color: #1e293b;
    color: #f8fafc;
    padding: 0.5rem;
}

/* Compact Status Pill for Tables */
.status-pill {
    appearance: none !important;
    -webkit-appearance: none !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    padding: 0.25rem 1.75rem 0.25rem 0.75rem !important;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    width: 100%;
    text-align: left;
    background-color: transparent;
    transition: all 0.2s;

    /* Small Arrow */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='rgba(255,255,255,0.7)'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 0.8rem;
}

.status-pill:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.status-pill option {
    background-color: #1e293b;
    color: #fff;
    padding: 0.5rem;
}

[data-theme="light"] .status-pill {
    border-color: rgba(0, 0, 0, 0.1);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 0.8rem;
    appearance: none !important;
    -webkit-appearance: none !important;
}

[data-theme="light"] .status-pill option {
    background-color: #ffffff;
    color: #0f172a;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

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

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

.stat-card {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0.5rem 0;
}

.stat-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Reports */
.report-card h3 {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

/* Alert / Flash Messages */
.alert {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
}

.alert-success {
    background-color: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.alert-error {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* Financial Section Styles */
.section-box-danger {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

/* ... (existing financial styles) ... */

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* Technician Page Styles */
.tech-name {
    font-weight: 500;
    color: #fff;
}

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

.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-tech {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.badge-admin {
    background: rgba(236, 72, 153, 0.15);
    color: #f472b6;
    border: 1px solid rgba(236, 72, 153, 0.2);
}

.search-input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 3.5rem !important;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 2rem;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s;
}

.search-input:focus {
    background: rgba(0, 0, 0, 0.6);
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: #9ca3af;
    /* text-muted */
    transition: all 0.2s;
    margin: 0 0.2rem;
}

.edit-icon:hover {
    color: var(--primary);
    background: rgba(59, 130, 246, 0.15);
}

.delete-icon:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.15);
}

.view-icon:hover {
    color: var(--success);
    background: rgba(34, 197, 94, 0.15);
}

/* Light Mode Overrides for Technicians */
[data-theme="light"] .tech-name {
    color: #0f172a;
}

[data-theme="light"] .badge-tech {
    background: #f3e8ff;
    color: #7e22ce;
    border-color: #d8b4fe;
}

[data-theme="light"] .badge-admin {
    background: #fce7f3;
    color: #db2777;
    border-color: #f9a8d4;
}

[data-theme="light"] .search-input {
    background: #ffffff;
    color: #0f172a;
    border-color: #cbd5e1;
}

[data-theme="light"] .search-input:focus {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

[data-theme="light"] .action-icon {
    color: #64748b;
}

[data-theme="light"] .edit-icon:hover {
    background: #eff6ff;
}

[data-theme="light"] .delete-icon:hover {
    background: #fef2f2;
}

[data-theme="light"] .view-icon:hover {
    background: #dcfce7;
}

/* Table Date Styles */
.table-date {
    font-size: 0.85rem;
}

/* Timeline Date Colors */
.timeline-created {
    color: #60a5fa;
}

/* Blue 400 */
.timeline-completed {
    color: #4ade80;
}

/* Green 400 */
.timeline-delivered {
    color: #c084fc;
}

/* Purple 400 */

[data-theme="light"] .timeline-created {
    color: #2563eb;
}

[data-theme="light"] .timeline-completed {
    color: #16a34a;
}

[data-theme="light"] .timeline-delivered {
    color: #9333ea;
}

.table-date-muted {
    color: var(--text-muted);
}

.table-date-success {
    color: var(--success);
}

.table-date-blue {
    color: #60a5fa;
}

[data-theme="light"] .table-date-blue {
    color: #2563eb;
}

[data-theme="light"] .text-truncate {
    color: #334155;
}

/* Repair Job Page Styles */
/* Enhanced Filter Toolbar Styles (Global) */
.filter-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.75rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 1rem;
}

.search-group {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-group .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-group .search-input {
    width: 100%;
    padding-left: 2.5rem !important;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    height: 42px;
}

.filter-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.select-wrapper {
    position: relative;
    min-width: 180px;
}

.select-wrapper .select-icon {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    font-size: 0.85rem;
}

.filter-select {
    width: 100%;
    padding: 0 1rem 0 2.2rem;
    height: 42px;
    background: rgba(255, 255, 255, 0.05);
    /* Increased contrast */
    border: 1px solid rgba(255, 255, 255, 0.15);
    /* More visible border */
    border-radius: 8px;
    color: var(--text-main);
    appearance: none;
    cursor: pointer;
    transition: all 0.2s;

    /* Custom Dropdown Arrow with higher opacity */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='rgba(255,255,255,0.9)'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

.filter-select:hover {
    background-color: rgba(255, 255, 255, 0.08);
    /* Brighter on hover */
    border-color: rgba(255, 255, 255, 0.3);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Ensure dropdown options have dark background */
.filter-select option {
    background-color: #1e293b;
    color: #f8fafc;
    padding: 0.5rem;
}

[data-theme="light"] .filter-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3e%3c/svg%3e");
}

.date-group {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0 0.5rem;
    height: 42px;
}

.date-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.date-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
}

.filter-date {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    width: 110px;
    padding: 0.2rem 0;
    color-scheme: dark;
    /* Force dark mode native UI for calendar */
    cursor: pointer;
}

.filter-date::-webkit-calendar-picker-indicator {
    opacity: 0.6;
    cursor: pointer;
    transition: opacity 0.2s;
}

.filter-date:hover::-webkit-calendar-picker-indicator {
    opacity: 1;
}

[data-theme="light"] .filter-date {
    color-scheme: light;
}

.date-separator {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 0 0.5rem;
}

.btn-filter,
.btn-clear {
    height: 42px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-filter {
    background: var(--primary);
    color: white;
    gap: 0.5rem;
}

.btn-filter:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-clear {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    width: 42px;
    padding: 0;
}

.btn-clear:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

[data-theme="light"] .filter-toolbar,
[data-theme="light"] .search-group .search-input,
[data-theme="light"] .filter-select,
[data-theme="light"] .date-group {
    background: #ffffff;
    border-color: #e2e8f0;
}

[data-theme="light"] .btn-clear {
    background: #f1f5f9;
    color: #64748b;
}

[data-theme="light"] .filter-toolbar {
    background: #f8fafc;
}

/* Status Filters Scrollable/Wrap */
.filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    /* Allow wrapping on small screens */
    align-items: center;
    padding-bottom: 0.5rem;
    /* Space for scrollbar if needed */
}

.filter-btn {
    background: rgba(255, 255, 255, 0.03);
    /* Slight background for visibility */
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    /* Brighter on hover */
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.3);
}

.filter-btn.active {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.1);
}

[data-theme="light"] .filter-btn {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #64748b;
}

[data-theme="light"] .filter-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

[data-theme="light"] .filter-btn.active {
    background: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
}

.count-badge {
    display: inline-block;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    margin-left: 0.5rem;
    font-weight: 600;
}

.filter-btn.active .count-badge {
    background: rgba(59, 130, 246, 0.3);
    color: #fff;
}

/* Tech Select - ensure it matches new toolbar style if used elsewhere */
.tech-select {
    background: transparent;
    color: inherit;
    border: 1px solid var(--border-color);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
    width: 100%;
}

.tech-select option {
    background-color: #1e293b;
    color: #fff;
}

/* Light Mode Overrides for Repair Jobs */
[data-theme="light"] .filter-btn {
    border-color: #cbd5e1;
    color: #64748b;
}

[data-theme="light"] .filter-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

[data-theme="light"] .filter-btn.active {
    background: #eff6ff;
    color: #2563eb;
    border-color: #93c5fd;
    box-shadow: 0 0 5px rgba(37, 99, 235, 0.2);
}

[data-theme="light"] .count-badge {
    background: #e2e8f0;
    color: #475569;
}

[data-theme="light"] .filter-btn.active .count-badge {
    background: #bfdbfe;
    color: #1e3a8a;
}

[data-theme="light"] .tech-select {
    color: #0f172a;
    border-color: #cbd5e1;
}

/* Global Badge Styles */
.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-jobs {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Light Mode Badge Overrides */
[data-theme="light"] .badge-success,
[data-theme="light"] .badge-jobs {
    background: #dcfce7;
    color: #15803d;
    border-color: #86efac;
}

[data-theme="light"] .badge-warning {
    background: #fef3c7;
    color: #b45309;
    border-color: #fcd34d;
}

[data-theme="light"] .badge-danger {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fca5a5;
}

/* Table Specific Text Styles */
.table-text-main {
    font-weight: 600;
    color: #fff;
    font-size: 1rem;
}

.table-text-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

[data-theme="light"] .table-text-main {
    color: #0f172a;
}


.section-box-success {
    background: rgba(34, 197, 94, 0.05);
    border: 1px solid rgba(34, 197, 94, 0.2);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.section-box-success h4 {
    color: #86efac;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.summary-box {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    text-align: center;
    border: 1px solid transparent;
}

/* Light Mode Overrides for Financials */
[data-theme="light"] .section-box-danger {
    background: #fef2f2;
    border-color: #fca5a5;
}

[data-theme="light"] .section-box-danger h4 {
    color: #ef4444;
}

[data-theme="light"] .section-box-success {
    background: #f0fdf4;
    border-color: #86efac;
}

[data-theme="light"] .section-box-success h4 {
    color: #16a34a;
}

[data-theme="light"] .summary-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .summary-box label {
    color: #64748b !important;
}



/* Toast Notification Styles */
.toast {
    min-width: 320px;
    padding: 1rem 1.25rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
    background-color: var(--bg-card);
    /* Ensure opaque background */
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideIn 0.3s ease-out forwards;
}

.toast.alert-success {
    border-left: 4px solid var(--success);
}

.toast.alert-error {
    border-left: 4px solid var(--danger);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Utility */
.text-right {
    text-align: right;
}

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

.mt-2 {
    margin-top: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

/* Mobile Responsive Sidebar & Layout */
.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 40;
}

.mobile-brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-main);
}

.mobile-toggle-btn,
.mobile-close-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-close-btn {
    display: none;
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 45;
    backdrop-filter: blur(2px);
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .mobile-header {
        display: flex;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        /* Wider for easier touch */
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 50;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    }

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

    .sidebar-overlay {
        display: block;
        /* Managed by x-show logic technically, but CSS structure needed */
    }

    .mobile-close-btn {
        display: block;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
        width: 100%;
    }

    .nav-links {
        display: flex;
        /* Ensure it's never hidden by old styles */
    }
}

/* Light Mode Mobile Header */
[data-theme="light"] .mobile-header {
    background: #ffffff;
    border-color: #e2e8f0;
}

[data-theme="light"] .sidebar {
    border-right: none;
    /* Shadow handles it */
}

/* Modern Logout Button */
.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.8rem;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.1);
    transform: translateY(-1px);
    border-color: rgba(239, 68, 68, 0.4);
}

/* Dashboard Styles Migrated */
.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.text-date {
    font-weight: 400;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    color: var(--text-main);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.highlight-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.7), rgba(59, 130, 246, 0.1));
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Light Mode Overrides for Dashboard */
[data-theme="light"] .text-date {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .highlight-card {
    background: linear-gradient(145deg, #ffffff, #f0f9ff);
    border: 1px solid #bae6fd;
    box-shadow: 0 4px 6px -1px rgba(14, 165, 233, 0.1);
}

[data-theme="light"] .stat-card {
    background: #ffffff;
    border-color: #e2e8f0;
}

/* Light Mode Tables */
[data-theme="light"] .card.glass,
[data-theme="light"] .card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .data-table th,
[data-theme="light"] table th {
    background-color: #f8fafc;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

[data-theme="light"] .data-table td,
[data-theme="light"] table td {
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
}

[data-theme="light"] .data-table tr:hover td {
    background-color: #f8fafc;
}

/* Fix Status Dropdowns in Light Mode */
[data-theme="light"] .status-select option {
    background-color: #ffffff;
    color: #0f172a;
}

[data-theme="light"] .status-select {
    color: inherit;
    border-color: rgba(0, 0, 0, 0.1);
}

/* Responsive Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* Smooth scroll on iOS */
    margin-bottom: 1rem;
    border-radius: 8px;
    /* Hide scrollbar but keep functionality */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

.table-responsive::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

/* Ensure table doesn't shrink weirdly */
.data-table {
    width: 100%;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--warning);
    /* Sun/Moon color */
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 0 10px var(--warning);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border-color: var(--text-muted);
}

[data-theme="light"] .btn-secondary:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

[data-theme="light"] .theme-toggle-btn {
    background: #e0f2fe;
    /* Light blueish tint */
    border-color: #bae6fd;
    color: #0ea5e9;
    /* Sky blue for sun */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .theme-toggle-btn:hover {
    background: #bae6fd;
    box-shadow: 0 0 10px #0ea5e9;
}

/* Global Form & Grid Utilities */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: #fff;
    font-family: inherit;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    background: rgba(0, 0, 0, 0.5);
}

.form-control option {
    background-color: #1e293b;
    color: #fff;
}

/* Light Mode Overrides for Forms */
[data-theme="light"] .form-control {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

[data-theme="light"] .form-control:focus {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

[data-theme="light"] .form-control option {
    background-color: #ffffff;
    color: #0f172a;
}

@media (max-width: 640px) {

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Light Mode Navigation Hover Fix */
[data-theme="light"] .nav-links a:hover {
    background-color: #e0f2fe;
    /* Light sky blue */
    color: #0284c7;
    /* Darker blue text */
    transform: translateX(5px);
    font-weight: 600;
}

/* Global Toolbar & Search Styles */
.toolbar-container {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: nowrap;
    /* Force single line */
    overflow: hidden;
    /* Prevent container scroll, let children handle it */
}

.search-box {
    position: relative;
    width: 280px;
    /* Fixed reduced width */
    flex-shrink: 0;
    /* Prevent search bar from squishing */
}

.search-icon {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    font-size: 1rem;
}

[data-theme="light"] .toolbar-container {
    border-bottom: 1px solid #e2e8f0;
}

[data-theme="light"] .search-icon {
    color: #94a3b8;
}