/* UNIFIED STYLESHEET */

/* ==========================================================
   Stripe-Inspired Premium Light Design System
   ========================================================== */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700&family=Inter:wght@300;400;500;600&display=swap');

:root {
    /* Colors */
    --ds-primary: #533afd;
    /* Stripe Purple */
    --ds-primary-hover: #4434d4;
    --ds-primary-light: #b9b9f9;

    --ds-bg-main: #ffffff;
    --ds-bg-surface: #ffffff;
    --ds-bg-subtle: #f6f9fc;
    --ds-bg-dark: #1c1e54;
    /* Brand Dark */

    --ds-text-heading: #061b31;
    /* Deep Navy */
    --ds-text-label: #273951;
    /* Dark Slate */
    --ds-text-body: #64748d;
    /* Slate */
    --ds-text-muted: #8492a6;

    --ds-border: #e5edf5;
    --ds-border-active: #b9b9f9;

    /* Status Colors */
    --ds-success-bg: rgba(21, 190, 83, 0.15);
    --ds-success-text: #108c3d;
    --ds-success-border: rgba(21, 190, 83, 0.4);

    --ds-error-bg: rgba(234, 34, 97, 0.15);
    /* Ruby tint */
    --ds-error-text: #ea2261;
    --ds-error-border: rgba(234, 34, 97, 0.4);

    --ds-warning-bg: rgba(255, 179, 0, 0.15);
    --ds-warning-text: #9b6829;

    /* Shadows (Blue/Navy tinted for luxury) */
    --ds-shadow-ambient: rgba(23, 23, 23, 0.05) 0px 3px 6px;
    --ds-shadow-standard: rgba(23, 23, 23, 0.08) 0px 15px 35px;
    --ds-shadow-elevated: rgba(50, 50, 93, 0.25) 0px 30px 45px -30px, rgba(0, 0, 0, 0.1) 0px 18px 36px -18px;
    --ds-shadow-deep: rgba(3, 3, 39, 0.25) 0px 14px 21px -14px, rgba(0, 0, 0, 0.1) 0px 8px 17px -8px;

    /* Form & Radius */
    --ds-radius-sm: 4px;
    --ds-radius-md: 6px;
    --ds-radius-lg: 8px;
    --ds-radius-xl: 12px;

    /* Typography */
    --ds-font-primary: 'Tajawal', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ==========================================================
   Global Reset & Base
   ========================================================== */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--ds-font-primary);
    background-color: var(--ds-bg-subtle);
    color: var(--ds-text-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--ds-text-heading);
    font-weight: 500;
    margin-top: 0;
    letter-spacing: -0.02em;
}

a {
    color: var(--ds-primary);
    text-decoration: none;
    transition: color 0.15s ease-in-out;
}

a:hover {
    color: var(--ds-primary-hover);
}

/* ==========================================================
   Premium Components
   ========================================================== */

/* Buttons */
.ds-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--ds-font-primary);
    font-weight: 500;
    font-size: 15px;
    padding: 8px 16px;
    border-radius: var(--ds-radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    outline: none;
}

.ds-btn-primary {
    background-color: var(--ds-primary);
    color: #ffffff;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
}

.ds-btn-primary:hover {
    background-color: var(--ds-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 7px 14px rgba(50, 50, 93, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
}

.ds-btn-outline {
    background-color: transparent;
    color: var(--ds-primary);
    border: 1px solid var(--ds-border-active);
}

.ds-btn-outline:hover {
    background-color: rgba(83, 58, 253, 0.05);
}

/* Cards */
.ds-card {
    background: var(--ds-bg-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-ambient);
    padding: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ds-card.elevated:hover {
    box-shadow: var(--ds-shadow-standard);
    transform: translateY(-2px);
}

/* Inputs */
.ds-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    font-family: var(--ds-font-primary);
    font-size: 15px;
    color: var(--ds-text-heading);
    background-color: var(--ds-bg-surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ds-input:focus {
    border-color: var(--ds-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(83, 58, 253, 0.15);
}

.ds-input::placeholder {
    color: var(--ds-text-muted);
}

/* Badges */
.ds-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--ds-radius-sm);
    font-size: 12px;
    font-weight: 500;
}

.ds-badge-success {
    background-color: var(--ds-success-bg);
    color: var(--ds-success-text);
    border: 1px solid var(--ds-success-border);
}

.ds-badge-error {
    background-color: var(--ds-error-bg);
    color: var(--ds-error-text);
    border: 1px solid var(--ds-error-border);
}

.ds-badge-warning {
    background-color: var(--ds-warning-bg);
    color: var(--ds-warning-text);
}

/* Tables */
.ds-table-wrapper {
    overflow-x: auto;
    background: var(--ds-bg-surface);
    border-radius: var(--ds-radius-lg);
    border: 1px solid var(--ds-border);
    box-shadow: var(--ds-shadow-ambient);
}

.ds-table {
    width: 100%;
    border-collapse: collapse;
}

.ds-table th,
.ds-table td {
    padding: 12px 16px;
    text-align: right;
    border-bottom: 1px solid var(--ds-border);
}

.ds-table th {
    background-color: #fcfdfe;
    color: var(--ds-text-label);
    font-weight: 500;
    font-size: 14px;
}

.ds-table td {
    font-size: 15px;
    color: var(--ds-text-heading);
}

.ds-table tr:last-child td {
    border-bottom: none;
}

.ds-table tbody tr:hover {
    background-color: #f6f9fc;
}


:root {
    /* Mapped from design-system for legacy classes */
    --sidebar-bg: var(--ds-bg-surface);
    --sidebar-border: var(--ds-border);
    --sidebar-hover: var(--ds-bg-subtle);
    --sidebar-active: rgba(83, 58, 253, 0.08);
    /* Soft primary tint */
    --sidebar-text: var(--ds-text-label);
    --sidebar-text-active: var(--ds-primary);
    --sidebar-text-hover: var(--ds-primary);

    --main-bg: var(--ds-bg-subtle);
    --main-card: var(--ds-bg-surface);
    --main-title: var(--ds-text-heading);
    --main-label: var(--ds-text-muted);

    --main-shadow: var(--ds-shadow-ambient);
    --main-shadow-hover: var(--ds-shadow-standard);

    --border-color: var(--ds-border);
    --accent-blue: var(--ds-primary);
    --accent-purple: #c522e9;
    --accent-orange: #f59e0b;
    --accent-green: #15be53;

    --sidebar-w: 280px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&display=swap');

* {
    box-sizing: border-box;
}

body {
    background: var(--main-bg);
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    direction: rtl;
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.6;
    color: var(--main-title);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
}

.layout-modern {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.main-modern {
    flex: 1;
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: calc(100% - var(--sidebar-w));
    height: 100vh;
    overflow: hidden;
}

.main-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}

.main-title {
    font-size: 28px;
    font-weight: 900;
    color: var(--main-title);
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}

/* ---- Sidebar ---- */
.sidebar-dark {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 5;
    border-left: 1px solid var(--sidebar-border);
    /* RTL layout */
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.02);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 28px 24px 24px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--main-title);
    border-bottom: 1px solid var(--sidebar-border);
    user-select: none;
    flex-shrink: 0;
}

.sidebar-logo .logo {
    font-family: var(--ds-font-primary);
    font-weight: 800;
    font-size: 18px;
    color: #ffffff;
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--ds-primary), var(--ds-primary-hover));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(83, 58, 253, 0.3);
    flex-shrink: 0;
}

.profile-area {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    margin: 0;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.profile-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: cover;
    background: #fff;
    border: 2px solid var(--sidebar-border);
    flex-shrink: 0;
}

.profile-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 4px;
}

.profile-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--main-title);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-role {
    background: rgba(83, 58, 253, 0.08);
    /* Primary subtle tint */
    color: var(--ds-primary);
    border-radius: 6px;
    font-size: 12px;
    padding: 3px 8px;
    font-weight: 600;
    display: inline-block;
    width: fit-content;
    border: 1px solid rgba(83, 58, 253, 0.12);
}

/* ---- Nav ---- */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    list-style: none;
    padding: 16px 12px;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--sidebar-text);
    border-radius: var(--ds-radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    text-decoration: none;
}

.nav-item .icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--sidebar-text);
    transition: color var(--transition);
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: var(--main-title);
}

.nav-item.active {
    background: var(--sidebar-active);
    color: var(--sidebar-text-active);
    border: 1px solid rgba(83, 58, 253, 0.1);
}

.nav-item.active .icon {
    color: var(--sidebar-text-active);
}

.nav-label {
    flex: 1;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-bottom {
    margin-top: auto;
    padding: 16px 20px;
    text-align: center;
    color: var(--sidebar-text);
    font-size: 11px;
    border-top: 1px solid var(--sidebar-border);
    font-weight: 400;
    flex-shrink: 0;
}

.sidebar-bottom button {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 10px;
    padding: 9px 16px;
    margin-top: 8px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: all var(--transition);
    width: 100%;
}

.sidebar-bottom button:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
}

/* ---- Cards Grid ---- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.modern-card {
    background: var(--main-card);
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--main-shadow);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    width: 100%;
    min-height: 130px;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.modern-card:hover {
    box-shadow: var(--main-shadow-hover);
    transform: translateY(-2px);
    border-color: var(--ds-border-active);
}

.modern-card .card-content {
    flex: 1;
    min-width: 0;
}

.modern-card .stat-label {
    color: var(--main-label);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modern-card .stat-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--main-title);
    line-height: 1.1;
    letter-spacing: -1px;
}

/* Circular Progress Indicator */
.modern-card .stat-progress {
    width: 64px;
    height: 64px;
    min-width: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    position: relative;
}

.stat-progress svg {
    position: absolute;
    top: 0;
    left: 0;
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.stat-progress .progress-text {
    position: absolute;
    width: 100%;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--main-title);
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-family: inherit;
}

/* Progress circle colors */
.modern-card:nth-child(1) .stat-progress circle:last-child {
    stroke: var(--accent-blue);
}

.modern-card:nth-child(2) .stat-progress circle:last-child {
    stroke: var(--accent-purple);
}

.modern-card:nth-child(3) .stat-progress circle:last-child {
    stroke: var(--accent-orange);
}

.modern-card:nth-child(4) .stat-progress circle:last-child {
    stroke: var(--accent-green);
}

/* ---- Tables ---- */
.table-title {
    font-size: 18px;
    color: var(--ds-text-heading);
    font-weight: 600;
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.data-table-wrap {
    background: var(--ds-bg-surface);
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-ambient);
    overflow-x: auto;
    padding: 0;
    border: 1px solid var(--ds-border);
}

.data-modern-table {
    width: 100%;
    border-spacing: 0;
    border-collapse: collapse;
    font-family: var(--ds-font-primary);
    min-width: 900px;
}

.data-modern-table th,
.data-modern-table td {
    text-align: center;
    padding: 16px 12px;
    font-size: 15px;
    background: transparent;
}

.data-modern-table th {
    background: var(--ds-bg-subtle);
    color: var(--ds-text-label);
    font-weight: 500;
    border-bottom: 2px solid var(--ds-border);
    position: sticky;
    top: 0;
    z-index: 2;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.data-modern-table tbody tr {
    transition: background .15s ease;
}

.data-modern-table tbody tr:hover {
    background: rgba(83, 58, 253, 0.03);
}

.data-modern-table td {
    color: var(--ds-text-heading);
    border-bottom: 1px solid var(--ds-border);
    font-weight: 400;
}

/* ---- Tags / Badges ---- */
.tag-job {
    padding: 4px 14px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    background: #f4f5fd;
    color: #47589e;
    margin: 0 2px;
    display: inline-block;
    letter-spacing: .3px;
}

.tag-mec {
    background: #fef9e7;
    color: #b7871b;
}

.tag-elec {
    background: #e8f8fb;
    color: #178f8b;
}

.tag-status {
    padding: 4px 14px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 800;
    display: inline-block;
    letter-spacing: .4px;
}

.tag_status_B_View {
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    letter-spacing: .4px;
    background: #dbeafe;
    color: #2563eb;
    cursor: pointer;
    transition: all .15s;
}

.tag_status_B_View:hover {
    background: #2563eb;
    color: #fff;
}

.tag_status_B_View svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
}

.status-inworkshop {
    background: #eff6ff;
    color: #2563eb;
}

.status-inappointments {
    background: #f0fdfa;
    color: #14b8a6;
}

.status-wait {
    background: #fefce8;
    color: #ca8a04;
}

.status-check {
    background: #ecfdf5;
    color: #059669;
}

.status-spare {
    background: #fff1f2;
    color: #e11d48;
}

.status-working {
    background: #eef2ff;
    color: #6366f1;
}

.status-final {
    background: #ecfeff;
    color: #0891b2;
}

.status-ready {
    background: #f0fdf4;
    color: #16a34a;
}

.status-unpaid {
    background: #fffbeb;
    color: #d97706;
}

.status-done {
    background: #eff6ff;
    color: #2563eb;
}

/* ---- Buttons ---- */
.add-user-btn {
    background: #eff6ff;
    color: #2563eb;
    border: 1.5px solid #2563eb;
    padding: 9px 24px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    font-size: 1em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all .15s;
    margin: 0;
}

.add-user-btn:hover {
    background: #2563eb;
    color: #fff;
}

.user-avatar-sm {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid #eee;
    object-fit: cover;
}

.tag-role {
    font-weight: bold;
    border-radius: 6px;
    padding: 2px 10px;
    margin-left: 2px;
    font-size: .9em;
}

.tag-role.admin {
    background: #2563eb;
    color: #fff;
}

.tag-role.user {
    background: #94a3b8;
    color: #fff;
}

.tag-page,
.tag-perm {
    font-size: .92em;
    padding: 4px 12px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #2563eb;
    font-weight: 700;
    margin: 1.5px;
    cursor: pointer;
    display: inline-block;
    transition: all .15s;
}

.tag-page:hover,
.tag-perm:hover {
    background: #dbeafe;
}

.table-action-btn {
    background: #eff6ff;
    color: #1d4ed8;
    border: none;
    border-radius: 8px;
    padding: 5px 12px;
    margin: 1.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
    font-size: .92em;
}

.table-action-btn:hover {
    background: #dbeafe;
}

.table-action-btn.danger {
    background: #fef2f2;
    color: #dc2626;
}

.table-action-btn.danger:hover {
    background: #fee2e2;
}

/* WhatsApp action button */
.table-action.btn-wa,
a.table-action.btn-wa {
    color: #25D366;
    text-decoration: none;
    transition: all .15s;
}

.table-action.btn-wa:hover,
a.table-action.btn-wa:hover {
    background: #25D366;
    color: #fff;
    border-color: #25D366;
}

.multi-checkbox {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
}

/* ---- Modal ---- */
.modal-blur {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
}

.modal-blur.is-open {
    display: block;
}

.modern-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modern-modal.is-open {
    display: flex;
}

.modern-modal .modal-header {
    font-size: 1.1em;
    font-weight: 600;
    padding: 20px 24px 16px;
    border-radius: var(--ds-radius-xl) var(--ds-radius-xl) 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--ds-border);
}

.modern-modal .modal-close {
    background: none;
    border: none;
    color: var(--ds-text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--ds-radius-sm);
    transition: all .15s;
    line-height: 1;
}

.modern-modal .modal-close:hover {
    background: var(--ds-bg-subtle);
    color: var(--ds-text-heading);
}

.modern-modal .modal-content {
    background: var(--ds-bg-surface);
    padding: 0 24px 24px;
    border-radius: var(--ds-radius-xl);
    box-shadow: var(--ds-shadow-elevated);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    border: 1px solid var(--ds-border);
    overflow-y: auto;
}

.modern-modal label {
    display: block;
    font-weight: 500;
    font-size: 14px;
    margin: 14px 0 6px;
    color: var(--ds-text-label);
}

.modern-modal input,
.modern-modal select,
.modern-modal textarea {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--ds-radius-md);
    border: 1px solid var(--ds-border);
    font-size: 15px;
    color: var(--ds-text-heading);
    background: var(--ds-bg-surface);
    transition: border-color .15s ease, box-shadow .15s ease;
    outline: none;
    box-sizing: border-box;
}

.modern-modal input:focus,
.modern-modal select:focus,
.modern-modal textarea:focus {
    border-color: var(--ds-primary);
    box-shadow: 0 0 0 3px rgba(83, 58, 253, 0.15);
}

.modal-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.modal-actions button {
    padding: 10px 20px;
    border-radius: var(--ds-radius-md);
    border: 1px solid transparent;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s ease;
    font-size: 15px;
}

.table-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 4px;
    align-items: center;
}

/* ---- Tooltip ---- */
.tooltip-more {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.tooltip-more .tooltip-content {
    visibility: hidden;
    opacity: 0;
    min-width: 180px;
    background: #fff;
    color: #24385b;
    text-align: right;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .12);
    padding: 12px 14px;
    position: absolute;
    z-index: 12;
    top: 34px;
    right: 0;
    font-size: .95em;
    font-weight: 600;
    line-height: 2;
    transition: all .15s;
    pointer-events: none;
}

.tooltip-more:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
}

.tooltip-more .tooltip-arrow {
    position: absolute;
    top: 25px;
    right: 19px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #fff;
    z-index: 13;
}

/* ---- Recent Cars Cards ---- */
.recent-cars {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.car-card {
    background: var(--main-card);
    border-radius: 14px;
    border: 1px solid var(--border-color);
    box-shadow: var(--main-shadow);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform .2s ease, box-shadow .2s ease;
    height: 100%;
}

.car-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--main-shadow-hover);
}

.car-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.car-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.car-customer {
    font-weight: 800;
    color: var(--main-title);
    font-size: 14px;
}

.car-date {
    font-size: 12px;
    color: var(--main-label);
}

.car-body {
    font-size: 13px;
    line-height: 1.6;
    color: var(--main-title);
}

.car-line {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.car-line strong {
    color: var(--main-label);
    font-weight: 600;
}

.car-problem {
    font-size: 14px;
    color: var(--ds-text-heading);
    background: var(--ds-bg-subtle);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    padding: 8px 12px;
    margin-top: 8px;
    line-height: 1.6;
    word-break: break-word;
}

.car-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: auto;
}

.btn-view {
    appearance: none;
    border: none;
    cursor: pointer;
    background: var(--ds-primary);
    color: #fff;
    padding: 10px 18px;
    border-radius: var(--ds-radius-md);
    font-size: 14px;
    font-weight: 500;
    transition: all .2s ease;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-view:hover {
    background: var(--ds-primary-hover);
    transform: translateY(-1px);
}

.btn-view:active {
    transform: translateY(1px);
}

/* ---- Scrollbar ---- */
.main-container::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.main-container::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 4px;
}

.main-container::-webkit-scrollbar-thumb {
    background: rgba(37, 99, 235, .15);
    border-radius: 4px;
}

.main-container::-webkit-scrollbar-thumb:hover {
    background: rgba(37, 99, 235, .3);
}

.main-container {
    scrollbar-width: thin;
    scrollbar-color: rgba(37, 99, 235, .15) transparent;
}

/* Prevent horizontal overflow at html/body level */
html {
    height: 100%;
    overflow: hidden;
}

body {
    height: 100%;
    overflow: hidden;
}

/* ===== Table horizontal scroll wrapper ===== */
.cars-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.cars-table {
    min-width: 1100px;
}

/* ======================================
   RESPONSIVE DESIGN
   ====================================== */

/* iPad / Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .modern-card {
        min-height: 110px;
        padding: 16px;
    }

    .modern-card .stat-value {
        font-size: 26px;
    }

    .stat-progress {
        width: 60px;
        height: 60px;
        min-width: 60px;
    }

    .stat-progress .progress-text {
        font-size: 12px;
    }

    .recent-cars {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* Mobile (< 768px) */
@media (max-width: 768px) {
    .main-title {
        font-size: 22px;
        margin-bottom: 16px;
    }

    .cards-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .modern-card {
        min-height: 100px;
        padding: 14px;
        gap: 10px;
    }

    .modern-card .stat-label {
        font-size: 12px;
    }

    .modern-card .stat-value {
        font-size: 24px;
    }

    .stat-progress {
        width: 52px;
        height: 52px;
        min-width: 52px;
    }

    .recent-cars {
        grid-template-columns: 1fr;
    }
}

/* Small mobile (< 480px) */
@media (max-width: 480px) {
    .main-title {
        font-size: 20px;
        margin-bottom: 14px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .modern-card .stat-value {
        font-size: 28px;
    }
}


/* ================================================================
   UTILITY CLASSES (replacing inline styles from EJS)
   ================================================================ */
.filter-group-search {
    min-width: 270px;
    max-width: 320px;
}

.table-wrap-full {
    width: 99%;
    overflow: visible !important;
}

.modal-lg {
    max-width: 880px;
}

.pos-relative {
    position: relative;
}

.opacity-70 {
    opacity: .7;
}

.span-full {
    grid-column: 1 / -1;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    padding: 10px 12px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    background: var(--ds-bg-subtle);
}

.form-textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    font-family: var(--ds-font-primary);
    font-size: 15px;
    color: var(--ds-text-heading);
    background: var(--ds-bg-surface);
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s;
}

.form-textarea:focus {
    border-color: var(--ds-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(83, 58, 253, 0.15);
}

.modal-actions-start {
    justify-content: flex-start;
    margin-top: 16px;
}

.prev-wrap {
    margin-top: 14px;
    display: none;
}

.prev-heading {
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--ds-text-heading);
}

.prev-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.td-muted {
    font-size: .92em;
    color: var(--ds-text-muted);
}

.note-padded {
    padding: 16px;
}

@media (max-width:1024px) {
    .filter-group-search {
        min-width: 100%;
        max-width: 100%;
    }

    .modal-lg {
        max-width: 100%;
        width: 96vw;
    }
}


/* ===== FROM: base.ejs ===== */

.session-expired-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 3, 39, 0.4);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999999;
}

.session-expired-modal.is-open {
    display: flex;
}

.se-box {
    background: var(--ds-bg-surface);
    padding: 32px 40px;
    border-radius: var(--ds-radius-xl);
    text-align: center;
    box-shadow: var(--ds-shadow-elevated);
    max-width: 90%;
    width: 400px;
    animation: dropIn .4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--ds-border);
}

.se-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.se-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--ds-text-heading);
    margin-bottom: 8px;
    font-family: var(--ds-font-primary);
}

.se-desc {
    font-size: 15px;
    color: var(--ds-text-body);
    margin-bottom: 24px;
    font-family: var(--ds-font-primary);
}

.se-btn {
    background: var(--ds-primary);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: var(--ds-radius-md);
    font-size: 16px;
    font-weight: 500;
    width: 100%;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
    font-family: var(--ds-font-primary);
    transition: all .2s ease;
}

.se-btn:hover {
    background: var(--ds-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 7px 14px rgba(50, 50, 93, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
}

@keyframes dropIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}


/* ===== FROM: CarBrands.ejs ===== */

.cb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
    font-family: var(--ds-font-primary);
}

.cb-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--ds-text-heading);
    margin: 0;
}

.cb-btn {
    padding: 10px 24px;
    border-radius: var(--ds-radius-md);
    border: none;
    font-weight: 500;
    cursor: pointer;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--ds-primary);
    color: #fff;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all .15s ease;
    font-family: var(--ds-font-primary);
}

.cb-btn:hover {
    transform: translateY(-1px);
    background: var(--ds-primary-hover);
    box-shadow: 0 6px 10px rgba(50, 50, 93, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cb-btn-sm {
    padding: 8px 14px;
    font-size: 14px;
    border-radius: var(--ds-radius-sm);
}

.cb-btn-danger {
    background: var(--ds-error-text);
    color: #fff;
}

.cb-btn-green {
    background: var(--ds-success-text);
    color: #fff;
}

.cb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 18px;
}

.cb-brand-card {
    background: var(--ds-bg-surface);
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-ambient);
    border: 1px solid var(--ds-border);
    overflow: hidden;
    transition: all .2s ease;
    font-family: var(--ds-font-primary);
}

.cb-brand-card:hover {
    box-shadow: var(--ds-shadow-elevated);
    transform: translateY(-2px);
    border-color: rgba(83, 58, 253, 0.2);
}

.cb-brand-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: var(--ds-bg-subtle);
    border-bottom: 1px solid var(--ds-border);
}

.cb-brand-logo {
    width: 48px;
    height: 48px;
    border-radius: var(--ds-radius-md);
    background: var(--ds-bg-surface);
    border: 1px solid var(--ds-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.4em;
    color: var(--ds-primary);
    overflow: hidden;
    flex-shrink: 0;
}

.cb-brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cb-brand-info {
    flex: 1;
    min-width: 0;
}

.cb-brand-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--ds-text-heading);
}

.cb-brand-name-ar {
    font-weight: 500;
    font-size: 14px;
    color: var(--ds-text-body);
}

.cb-brand-actions {
    display: flex;
    gap: 6px;
}

.cb-brand-actions button {
    width: 32px;
    height: 32px;
    border-radius: var(--ds-radius-sm);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all .15s ease;
}

.cb-brand-actions .edit-btn {
    background: rgba(83, 58, 253, 0.05);
    color: var(--ds-primary);
    border: 1px solid rgba(83, 58, 253, 0.2);
}

.cb-brand-actions .edit-btn:hover {
    background: var(--ds-primary);
    color: #fff;
}

.cb-brand-actions .del-btn {
    background: var(--ds-error-bg);
    color: var(--ds-error-text);
    border: 1px solid var(--ds-error-border);
}

.cb-brand-actions .del-btn:hover {
    background: var(--ds-error-text);
    color: #fff;
}

.cb-models-list {
    padding: 16px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.cb-model-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--ds-bg-subtle);
    border-radius: var(--ds-radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--ds-text-heading);
    margin: 0;
    transition: all .15s ease;
    border: 1px solid var(--ds-border);
}

.cb-model-tag:hover {
    background: var(--ds-border);
}

.cb-model-tag .del-model {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--ds-text-muted);
    font-size: 14px;
    padding: 0;
    margin: 0;
    display: flex;
    transition: color .15s ease;
}

.cb-model-tag .del-model:hover {
    color: var(--ds-error-text);
}

.cb-add-model-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
}

.cb-add-model-inline input {
    width: 140px;
    padding: 8px 12px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-sm);
    font-size: 14px;
    transition: border-color .15s ease;
    font-family: var(--ds-font-primary);
    color: var(--ds-text-heading);
}

.cb-add-model-inline input:focus {
    border-color: var(--ds-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(83, 58, 253, 0.15);
}

.cb-add-model-inline button {
    padding: 8px 12px;
    border-radius: var(--ds-radius-sm);
    border: none;
    background: var(--ds-success-text);
    color: #fff;
    font-weight: 500;
    cursor: pointer;
    font-size: 14px;
    transition: all .15s ease;
}

.cb-add-model-inline button:hover {
    opacity: 0.9;
}

.cb-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--ds-text-muted);
    font-family: var(--ds-font-primary);
}

.cb-empty i {
    font-size: 3em;
    margin-bottom: 14px;
    display: block;
    opacity: 0.5;
}

.cb-empty p {
    font-weight: 500;
    font-size: 16px;
    color: var(--ds-text-body);
}

/* Modal */
.cb-modal-bg {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cb-modal {
    background: var(--ds-bg-surface);
    border-radius: var(--ds-radius-xl);
    box-shadow: var(--ds-shadow-elevated);
    padding: 28px 32px;
    min-width: 400px;
    max-width: 520px;
    width: 90vw;
    font-family: var(--ds-font-primary);
    border: 1px solid var(--ds-border);
}

.cb-modal h3 {
    margin: 0 0 20px 0;
    font-weight: 600;
    font-size: 18px;
    color: var(--ds-text-heading);
}

.cb-modal label {
    display: block;
    font-weight: 500;
    margin: 8px 0 6px 0;
    color: var(--ds-text-label);
    font-size: 14px;
}

.cb-modal input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    box-sizing: border-box;
    font-size: 15px;
    transition: border-color .15s ease, box-shadow .15s ease;
    color: var(--ds-text-heading);
    background: var(--ds-bg-surface);
    font-family: var(--ds-font-primary);
}

.cb-modal input:focus {
    border-color: var(--ds-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(83, 58, 253, 0.15);
}

.cb-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    justify-content: flex-end;
}

@media(max-width:600px) {
    .cb-grid {
        grid-template-columns: 1fr;
    }

    .cb-modal {
        min-width: 0;
        padding: 20px;
    }
}


/* ===== FROM: Customers.ejs ===== */

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    font-family: var(--ds-font-primary);
}

.filter-bar input {
    padding: 8px 12px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    font-family: var(--ds-font-primary);
    color: var(--ds-text-heading);
    background: var(--ds-bg-surface);
    transition: border-color .15s ease;
}

.filter-bar input:focus {
    border-color: var(--ds-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(83, 58, 253, 0.15);
}

.customers-table-wrap {
    background: var(--ds-bg-surface);
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-ambient);
    padding-bottom: 10px;
    overflow-x: auto;
    border: 1px solid var(--ds-border);
    font-family: var(--ds-font-primary);
}

.customers-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    min-width: 900px;
}

.customers-table th {
    background: var(--ds-bg-subtle);
    color: var(--ds-text-label);
    font-weight: 500;
    padding: 16px 12px;
    border-bottom: 2px solid var(--ds-border);
    text-align: center;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.customers-table tbody tr {
    transition: background .15s ease;
}

.customers-table tbody tr:hover {
    background: rgba(83, 58, 253, 0.03);
}

.customers-table td {
    padding: 16px 12px;
    text-align: center;
    border-bottom: 1px solid var(--ds-border);
    color: var(--ds-text-heading);
    font-size: 15px;
}

.chip {
    background: rgba(83, 58, 253, 0.1);
    color: var(--ds-primary);
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 13px;
    border: 1px solid rgba(83, 58, 253, 0.2);
}

.table-action {
    background: var(--ds-bg-surface);
    color: var(--ds-text-muted);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-sm);
    padding: 6px 12px;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    font-family: var(--ds-font-primary);
    transition: all .15s ease;
}

.table-action+.table-action {
    margin-right: 6px;
}

.table-action:hover {
    color: var(--ds-primary);
    border-color: var(--ds-primary);
    background: rgba(83, 58, 253, 0.05);
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 90;
    background: rgba(0, 0, 0, .4);
    backdrop-filter: blur(4px);
    font-family: var(--ds-font-primary);
}

.modal.is-open {
    display: flex;
}

.modal .panel {
    background: var(--ds-bg-surface);
    min-width: 480px;
    max-width: 560px;
    padding: 28px 32px;
    border-radius: var(--ds-radius-xl);
    box-shadow: var(--ds-shadow-elevated);
    border: 1px solid var(--ds-border);
}

.modal h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--ds-text-heading);
}

.modal label {
    display: block;
    font-weight: 500;
    margin: 8px 0 6px;
    font-size: 14px;
    color: var(--ds-text-label);
}

.modal input,
.modal textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    box-sizing: border-box;
    font-family: var(--ds-font-primary);
    font-size: 15px;
    color: var(--ds-text-heading);
    background: var(--ds-bg-surface);
    transition: border-color .15s ease;
}

.modal input:focus,
.modal textarea:focus {
    border-color: var(--ds-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(83, 58, 253, 0.15);
}

.modal .actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    justify-content: flex-end;
}

.btn {
    border: none;
    border-radius: var(--ds-radius-md);
    padding: 10px 20px;
    font-weight: 500;
    cursor: pointer;
    font-size: 15px;
    font-family: var(--ds-font-primary);
    transition: all .15s ease;
}

.btn-primary {
    background: var(--ds-primary);
    color: #fff;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-primary:hover {
    transform: translateY(-1px);
    background: var(--ds-primary-hover);
    box-shadow: 0 6px 10px rgba(50, 50, 93, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-muted {
    background: var(--ds-bg-surface);
    color: var(--ds-text-muted);
    border: 1px solid var(--ds-border);
}

.btn-muted:hover {
    color: var(--ds-primary);
    border-color: var(--ds-primary);
    background: rgba(83, 58, 253, 0.05);
}


/* ===== FROM: Inventory.ejs ===== */

.filter-bar {
    padding: 16px;
    display: flex;
    gap: 10px;
    align-items: end;
    flex-wrap: wrap;
    font-family: var(--ds-font-primary);
}

.filter-btn {
    padding: 10px 14px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    background: var(--ds-bg-surface);
    cursor: pointer;
    font-weight: 500;
    font-family: var(--ds-font-primary);
    color: var(--ds-text-heading);
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: var(--ds-bg-subtle);
}

.filter-btn.active {
    background: var(--ds-primary);
    color: #fff;
    border-color: var(--ds-primary);
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
}

.in {
    padding: 10px 14px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    font-family: var(--ds-font-primary);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    background: var(--ds-bg-surface);
    color: var(--ds-text-heading);
}

.in:focus {
    border-color: var(--ds-primary);
    box-shadow: 0 0 0 3px rgba(83, 58, 253, 0.15);
    outline: none;
}

.table-wrap {
    background: var(--ds-bg-surface);
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-ambient);
    padding: 0px;
    margin-top: 14px;
    border: 1px solid var(--ds-border);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    font-family: var(--ds-font-primary);
}

th,
td {
    padding: 16px 12px;
    border-bottom: 1px solid var(--ds-border);
    text-align: center;
    font-size: 15px;
}

th {
    background: var(--ds-bg-subtle);
    font-weight: 500;
    color: var(--ds-text-label);
    border-bottom: 2px solid var(--ds-border);
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 0.02em;
}

tbody tr:hover {
    background: rgba(83, 58, 253, 0.03);
    cursor: default;
}

td {
    color: var(--ds-text-heading);
    font-weight: 400;
}

.sec-title {
    font-weight: 600;
    margin: 24px 6px 12px;
    font-family: var(--ds-font-primary);
    color: var(--ds-text-heading);
    font-size: 18px;
}

.btn {
    background: var(--ds-primary);
    color: #fff;
    border: 1px solid transparent;
    padding: 10px 24px;
    border-radius: var(--ds-radius-md);
    font-weight: 500;
    cursor: pointer;
    font-size: 15px;
    font-family: var(--ds-font-primary);
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn:hover {
    background: var(--ds-primary-hover);
    transform: translateY(-1px);
}

.btn.gray {
    background: var(--ds-bg-subtle);
    color: var(--ds-text-heading);
    border: 1px solid var(--ds-border);
    box-shadow: none;
}

.btn.gray:hover {
    background: #eaeef5;
    transform: translateY(0);
}

.badge {
    padding: 3px 12px;
    border-radius: var(--ds-radius-full);
    background: rgba(83, 58, 253, 0.1);
    color: var(--ds-primary);
    font-weight: 500;
    border: 1px solid rgba(83, 58, 253, 0.2);
    font-size: 13px;
}

.row-actions {
    display: flex;
    gap: 8px;
    justify-content: center
}

/* Modal will use modern-modal styles from style.css, but we keep this fallback */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(3, 3, 39, 0.4);
    backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    z-index: 9999;
    font-family: var(--ds-font-primary);
}

.box {
    background: var(--ds-bg-surface);
    border-radius: var(--ds-radius-xl);
    min-width: 340px;
    max-width: 640px;
    width: 96%;
    padding: 32px 36px;
    box-shadow: var(--ds-shadow-elevated);
    border: 1px solid var(--ds-border);
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px
}

.grid label {
    font-weight: 500;
    color: var(--ds-text-label);
    font-size: 14px;
}

/* ===== Mobile only (≤1024px) — Inventory ===== */
@media (max-width:1024px) {

    /* شريط الفلاتر */
    .filter-bar {
        padding: 12px;
        gap: 8px;
        align-items: stretch;
    }

    .filter-bar>div {
        width: 100%;
        display: flex;
        gap: 8px;
    }

    .filter-btn {
        flex: 1;
        min-height: 44px;
        font-size: 14px;
    }

    #f_search,
    #f_type {
        width: 100%;
        min-width: 0;
        flex: 1;
        font-size: 14px;
    }

    /* زر الإضافة يصير بعرض كامل */
    #btnAdd.btn {
        width: 100%;
        min-height: 44px;
        text-align: center;
    }

    /* العناوين والمسافات */
    .sec-title {
        margin: 16px 8px 10px;
        font-size: 16px;
    }

    /* الجدول يلف أفقياً بدون ما ينهار */
    .table-wrap {
        border-radius: var(--ds-radius-lg);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 960px;
    }

    /* نفس إحساس الديسكتوب لكن قابل للسحب */
    th,
    td {
        padding: 12px 8px;
        font-size: 14px;
    }

    .badge {
        font-size: 12px;
    }

    /* أزرار الصف */
    .row-actions {
        gap: 8px;
    }

    .row-actions .btn {
        padding: 8px 12px;
        min-height: 40px;
        font-size: 13px;
    }

    /* المودالات: مريحة على الجوال */
    .modal .box {
        width: 96%;
        max-width: none;
        min-width: 0;
        padding: 24px 20px;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* حق النموذج داخل المودال */
}

/* ===== Mobile cards (≤1024px) — Inventory ===== */
@media (max-width:1024px) {

    /* شبكة البطائق */
    .inv-cards {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 12px;
    }

    /* البطاقة */
    .inv-card {
        background: var(--ds-bg-surface);
        border: 1px solid var(--ds-border);
        border-radius: var(--ds-radius-lg);
        box-shadow: var(--ds-shadow-ambient);
        padding: 16px;
        display: flex;
        flex-direction: column;
        gap: 10px;
        font-family: var(--ds-font-primary);
    }

    .inv-h1 {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        font-weight: 600;
        color: var(--ds-text-heading);
    }

    .inv-id {
        font-weight: 600;
        background: var(--ds-bg-subtle);
        border: 1px solid var(--ds-border);
        border-radius: var(--ds-radius-md);
        padding: 4px 8px;
        font-size: 12px;
        color: var(--ds-text-muted);
    }

    .inv-name {
        font-weight: 600;
        font-size: 16px;
        color: var(--ds-text-heading);
    }

    .inv-chip {
        display: inline-block;
        padding: 3px 12px;
        border-radius: var(--ds-radius-full);
        background: rgba(83, 58, 253, 0.1);
        color: var(--ds-primary);
        font-weight: 500;
        font-size: 12px;
        border: 1px solid rgba(83, 58, 253, 0.2);
    }

    .inv-line {
        display: flex;
        justify-content: space-between;
        gap: 10px;
        font-size: 14px;
        color: var(--ds-text-heading);
    }

    .inv-line small {
        color: var(--ds-text-label);
        font-weight: 500;
    }

    .inv-actions {
        display: flex;
        gap: 8px;
        margin-top: 8px;
        justify-content: flex-end;
    }

    .inv-actions .btn {
        padding: 8px 16px;
        min-height: 40px;
        font-size: 14px;
        flex: 1;
        text-align: center;
    }

    /* نحافظ على شريط الفلاتر السابق */
    .table-wrap {
        display: none;
    }

    /* إخفاء الجدول في الجوال */
}




/* ===== FROM: Login.ejs ===== */

body {
    font-family: var(--ds-font-primary);
    margin: 0;
    background: var(--ds-bg-subtle);
    min-height: 100vh;
    direction: <%=(lang==='ar' ?'rtl':'ltr') %>;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.Main_login {
    min-height: 90vh;
    display: grid;
    place-items: center;
}

.login-card {
    background: var(--ds-bg-surface);
    border-radius: var(--ds-radius-xl);
    box-shadow: var(--ds-shadow-elevated);
    padding: 44px 32px 36px 32px;
    width: 400px;
    max-width: 90vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    border: 1px solid var(--ds-border);
    transition: box-shadow 0.2s ease;
}

.login-card:hover {
    box-shadow: 0 40px 60px -15px rgba(50, 50, 93, 0.2), 0 20px 40px -20px rgba(0, 0, 0, 0.15);
}

.logo-img {
    width: 140px;
    object-fit: contain;
    margin-bottom: 7px;
    display: block;
}

.login-title {
    margin: 0 0 12px 0;
    font-weight: 600;
    font-size: 24px;
    color: var(--ds-text-heading);
    text-align: center;
    letter-spacing: -0.02em;
}

.login-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--ds-radius-md);
    border: 1px solid var(--ds-border);
    background: var(--ds-bg-surface);
    font-size: 15px;
    font-family: var(--ds-font-primary);
    color: var(--ds-text-heading);
    transition: border 0.15s, box-shadow 0.15s;
    outline: none;
    box-sizing: border-box;
}

.login-input:focus {
    border-color: var(--ds-primary);
    box-shadow: 0 0 0 3px rgba(83, 58, 253, 0.15);
}

.login-btn {
    padding: 12px;
    border: none;
    border-radius: var(--ds-radius-md);
    background: var(--ds-primary);
    color: #fff;
    font-weight: 500;
    font-size: 16px;
    margin-top: 6px;
    width: 100%;
    cursor: pointer;
    font-family: var(--ds-font-primary);
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
}

.login-btn:hover {
    background: var(--ds-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 7px 14px rgba(50, 50, 93, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
}

.login-error {
    color: var(--ds-error-text);
    background: var(--ds-error-bg);
    padding: 10px 14px;
    border-radius: var(--ds-radius-md);
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    margin-bottom: 7px;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--ds-error-border);
}

.footer {
    margin: auto;
    text-align: center;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-direction: column;
    justify-content: center;
    color: var(--ds-text-muted);
    font-size: 12px;
    background: none;
    font-family: var(--ds-font-primary);
    user-select: none;
    padding-bottom: 16px;
}

.footer span {
    color: var(--ds-text-body);
    font-weight: 500;
}

/* Language Switcher */
.btn-container {
    display: table-cell;
    vertical-align: middle;
    text-align: center;
    transform: scale(0.7);
}

.btn-color-mode-switch {
    display: inline-block;
    margin: 0px;
    position: relative;
}

.btn-color-mode-switch>label.btn-color-mode-switch-inner {
    margin: 0px;
    width: 140px;
    height: 40px;
    background-color: var(--ds-text-heading);
    border-radius: 26px;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
    display: block;
}

.btn-color-mode-switch>label.btn-color-mode-switch-inner:before {
    content: attr(data-on);
    position: absolute;
    font-size: 18px;
    font-weight: 600;
    top: 9px;
    right: 20px;
    color: #fff;
}

.btn-color-mode-switch>label.btn-color-mode-switch-inner:after {
    content: attr(data-off);
    width: 70px;
    height: 30px;
    background: #fff;
    border-radius: 26px;
    position: absolute;
    font-size: 18px;
    display: flex;
    justify-content: center;
    left: 5px;
    top: 5px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: var(--ds-shadow-ambient);
    color: var(--ds-text-heading);
    font-weight: 600;
    padding: 0;
    align-items: center;
}

.btn-color-mode-switch input[type="checkbox"] {
    cursor: pointer;
    width: 50px;
    height: 25px;
    opacity: 0;
    position: absolute;
    top: 0;
    z-index: 1;
    margin: 0px;
}

.btn-color-mode-switch input[type="checkbox"]:checked+label.btn-color-mode-switch-inner {
    background-color: var(--ds-primary);
}

.btn-color-mode-switch input[type="checkbox"]:checked+label.btn-color-mode-switch-inner:after {
    content: attr(data-on);
    left: 65px;
}

.btn-color-mode-switch input[type="checkbox"]:checked+label.btn-color-mode-switch-inner:before {
    content: attr(data-off);
    right: auto;
    left: 20px;
}


/* ===== FROM: Pricing.ejs ===== */

.prc-header {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    margin-bottom: 18px;
}

.prc-search {
    padding: 10px 14px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    font-size: 1em;
    background: var(--ds-bg-surface);
    color: var(--ds-text-heading);
    min-width: 220px;
    flex: 1;
    font-family: inherit;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.prc-search:focus {
    border-color: var(--ds-primary);
    box-shadow: 0 0 0 3px rgba(83, 58, 253, 0.15);
    outline: none;
}

.prc-btn {
    padding: 10px 24px;
    border-radius: var(--ds-radius-md);
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    background: var(--ds-primary);
    color: #fff;
    transition: all .2s ease;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
    font-family: inherit;
}

.prc-btn:hover {
    background: var(--ds-primary-hover);
    transform: translateY(-1px);
}

/* Filter badges */
.prc-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.prc-filter-badge {
    padding: 8px 18px;
    border-radius: 20px;
    font-weight: 600;
    font-size: .92em;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all .15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}

.prc-filter-badge .prc-count {
    background: rgba(255, 255, 255, .3);
    border-radius: 10px;
    padding: 2px 8px;
    font-size: .85em;
    font-weight: 700;
}

.prc-filter-badge:hover {
    transform: translateY(-1px);
    box-shadow: var(--ds-shadow-ambient);
}

.prc-filter-badge.active {
    border-color: var(--ds-border-active);
    transform: translateY(-2px);
    box-shadow: var(--ds-shadow-elevated);
}

.prc-fb-all {
    background: var(--ds-bg-subtle);
    color: var(--ds-text-heading);
    border-color: var(--ds-border);
}

.prc-fb-all.active {
    background: var(--ds-text-heading);
    color: #fff;
}

.prc-fb-mec {
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
}

.prc-fb-mec.active {
    background: #2563eb;
    color: #fff;
}

.prc-fb-elec {
    background: rgba(217, 119, 6, 0.1);
    color: #b45309;
}

.prc-fb-elec.active {
    background: #d97706;
    color: #fff;
}

.prc-fb-ac {
    background: rgba(5, 150, 105, 0.1);
    color: #065f46;
}

.prc-fb-ac.active {
    background: #059669;
    color: #fff;
}

.prc-table-wrap {
    background: var(--ds-bg-surface);
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-ambient);
    padding-bottom: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--ds-border);
}

.prc-table {
    width: 100%;
    border-spacing: 0;
    border-collapse: collapse;
    font-family: var(--ds-font-primary);
    min-width: 900px;
}

.prc-table th,
.prc-table td {
    text-align: center;
    padding: 16px 12px;
    font-size: 15px;
}

.prc-table th {
    background: var(--ds-bg-subtle);
    color: var(--ds-text-label);
    font-weight: 500;
    border-bottom: 2px solid var(--ds-border);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.prc-table tbody tr:hover {
    background: rgba(83, 58, 253, 0.03);
}

.prc-table td {
    color: var(--ds-text-heading);
    border-bottom: 1px solid var(--ds-border);
    font-weight: 500;
}

.prc-cat-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: .88em;
}

.prc-cat-mec {
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
}

.prc-cat-elec {
    background: rgba(217, 119, 6, 0.1);
    color: #b45309;
}

.prc-cat-ac {
    background: rgba(5, 150, 105, 0.1);
    color: #065f46;
}

.prc-cat-other {
    background: var(--ds-bg-subtle);
    color: var(--ds-text-heading);
}

/* Price tiers */
.prc-tier {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.prc-tier-label {
    font-size: .72em;
    color: var(--ds-text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.prc-tier-val {
    font-weight: 700;
    font-size: 1.05em;
}

.prc-easy {
    color: #059669;
}

.prc-medium {
    color: #d97706;
}

.prc-hard {
    color: #dc2626;
}

.prc-prices-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    min-width: 180px;
}

.prc-price-cell {
    text-align: center;
    padding: 8px 6px;
    border-radius: var(--ds-radius-md);
    background: var(--ds-bg-surface);
    border: 1px solid var(--ds-border);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.prc-action {
    background: var(--ds-bg-surface);
    border: 1px solid var(--ds-border);
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--ds-radius-md);
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ds-text-muted);
    transition: all .2s ease;
}

.prc-action:hover {
    border-color: var(--ds-primary);
    color: var(--ds-primary);
    box-shadow: var(--ds-shadow-ambient);
    transform: translateY(-1px);
}

.prc-action.del:hover {
    border-color: var(--ds-error-text);
    color: var(--ds-error-text);
}

.prc-action+.prc-action {
    margin-right: 6px;
}

.prc-inactive {
    opacity: .6;
}

/* Modal */
.prc-modal-blur {
    position: fixed;
    inset: 0;
    background: rgba(3, 3, 39, 0.4);
    backdrop-filter: blur(6px);
    z-index: 999;
    display: none;
}

.prc-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--ds-bg-surface);
    border-radius: var(--ds-radius-xl);
    padding: 32px 36px;
    box-shadow: var(--ds-shadow-elevated);
    z-index: 1000;
    display: none;
    min-width: 500px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--ds-border);
    font-family: var(--ds-font-primary);
}

.prc-modal h3 {
    margin: 0 0 20px;
    font-weight: 600;
    color: var(--ds-text-heading);
    font-size: 22px;
    letter-spacing: -0.02em;
}

.prc-modal label {
    font-weight: 500;
    display: block;
    margin: 14px 0 6px;
    color: var(--ds-text-label);
    font-size: 14px;
}

.prc-modal input,
.prc-modal select,
.prc-modal textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    font-size: 15px;
    box-sizing: border-box;
    transition: border-color .15s ease, box-shadow .15s ease;
    background: var(--ds-bg-surface);
    color: var(--ds-text-heading);
    font-family: var(--ds-font-primary);
}

.prc-modal input:focus,
.prc-modal select:focus,
.prc-modal textarea:focus {
    border-color: var(--ds-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(83, 58, 253, 0.15);
}

.prc-prices-input {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.prc-prices-input>div {
    text-align: center;
}

.prc-prices-input label {
    font-size: 13px;
    margin-bottom: 6px;
}

.prc-modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.prc-modal-actions button {
    flex: 1;
    padding: 12px;
    border-radius: var(--ds-radius-md);
    font-weight: 500;
    font-size: 15px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all .2s ease;
}

.prc-modal-actions .save {
    background: var(--ds-primary);
    color: #fff;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
}

.prc-modal-actions .save:hover {
    background: var(--ds-primary-hover);
    transform: translateY(-1px);
}

.prc-modal-actions .cancel {
    background: var(--ds-bg-subtle);
    color: var(--ds-text-heading);
    border-color: var(--ds-border);
}

.prc-modal-actions .cancel:hover {
    background: #eaeef5;
}

@media(max-width:1024px) {
    .prc-modal {
        min-width: auto !important;
        width: 94vw;
        padding: 24px 20px;
        max-height: 88vh;
    }

    .prc-header {
        flex-direction: column;
        gap: 10px;
    }

    .prc-search {
        min-width: 0 !important;
        width: 100%;
    }

    .prc-btn {
        width: 100%;
        text-align: center;
    }

    .prc-filters {
        flex-wrap: wrap;
        gap: 8px;
    }

    .prc-filter-badge {
        flex: 1;
        min-width: 0;
        justify-content: center;
        text-align: center;
        padding: 10px 8px;
        font-size: 13px;
    }

    .prc-table {
        min-width: 700px;
    }

    .prc-prices-input {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
}

@media(max-width:480px) {
    .prc-filter-badge {
        font-size: 12px;
        padding: 8px 6px;
    }

    .prc-modal {
        width: 98vw;
        padding: 20px 16px;
    }
}


/* ===== FROM: Reports.ejs ===== */

/* ===== Filter Bar ===== */
.rpt-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 28px;
    padding: 20px 24px;
    background: var(--ds-bg-surface);
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-ambient);
    border: 1px solid var(--ds-border);
    font-family: var(--ds-font-primary);
}

.rpt-fg {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 140px;
}

.rpt-fg label {
    font-weight: 500;
    color: var(--ds-text-label);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.rpt-fg select,
.rpt-fg input {
    padding: 10px 14px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    font-size: 15px;
    background: var(--ds-bg-surface);
    transition: border-color .15s, box-shadow .15s;
    color: var(--ds-text-heading);
}

.rpt-fg select:focus,
.rpt-fg input:focus {
    border-color: var(--ds-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(83, 58, 253, 0.15);
}

.rpt-actions {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.rpt-btn-primary {
    padding: 10px 24px;
    border-radius: var(--ds-radius-md);
    border: none;
    font-weight: 500;
    cursor: pointer;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--ds-primary);
    color: #fff;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all .15s ease;
    font-family: var(--ds-font-primary);
}

.rpt-btn-primary:hover {
    transform: translateY(-1px);
    background: var(--ds-primary-hover);
    box-shadow: 0 6px 10px rgba(50, 50, 93, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.rpt-btn-ghost {
    padding: 10px 20px;
    border-radius: var(--ds-radius-md);
    border: 1px solid var(--ds-border);
    font-weight: 500;
    cursor: pointer;
    font-size: 15px;
    background: var(--ds-bg-surface);
    color: var(--ds-text-muted);
    transition: all .15s ease;
    font-family: var(--ds-font-primary);
}

.rpt-btn-ghost:hover {
    border-color: var(--ds-primary);
    color: var(--ds-primary);
    background: rgba(83, 58, 253, 0.05);
}

.rpt-btn-export {
    padding: 10px 20px;
    border-radius: var(--ds-radius-md);
    border: 1px solid var(--ds-success-border);
    font-weight: 500;
    cursor: pointer;
    font-size: 15px;
    background: var(--ds-success-bg);
    color: var(--ds-success-text);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all .15s ease;
    font-family: var(--ds-font-primary);
}

.rpt-btn-export:hover {
    background: var(--ds-success-text);
    color: #fff;
    border-color: var(--ds-success-text);
}

/* ===== Summary Cards ===== */
.rpt-summary {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.rpt-card {
    background: var(--ds-bg-surface);
    border-radius: var(--ds-radius-lg);
    padding: 22px 20px;
    position: relative;
    box-shadow: var(--ds-shadow-ambient);
    border: 1px solid var(--ds-border);
    overflow: hidden;
    transition: all .2s ease;
    font-family: var(--ds-font-primary);
}

.rpt-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--ds-shadow-elevated);
    border-color: rgba(83, 58, 253, 0.2);
}

.rpt-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 4px;
    border-radius: 16px 16px 0 0;
}

.rpt-card:nth-child(1)::before {
    background: linear-gradient(90deg, var(--ds-primary), #8e7cfd);
}

.rpt-card:nth-child(2)::before {
    background: linear-gradient(90deg, var(--ds-success-text), #42d6a5);
}

.rpt-card:nth-child(3)::before {
    background: linear-gradient(90deg, var(--ds-warning-text), #ffc841);
}

.rpt-card:nth-child(4)::before {
    background: linear-gradient(90deg, var(--ds-info-text), #44b8f5);
}

.rpt-card:nth-child(5)::before {
    background: linear-gradient(90deg, var(--ds-error-text), #f27474);
}

.rpt-card .rc-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3em;
    margin-bottom: 12px;
}

.rpt-card:nth-child(1) .rc-icon {
    background: rgba(83, 58, 253, 0.1);
    color: var(--ds-primary);
}

.rpt-card:nth-child(2) .rc-icon {
    background: var(--ds-success-bg);
    color: var(--ds-success-text);
}

.rpt-card:nth-child(3) .rc-icon {
    background: var(--ds-warning-bg);
    color: var(--ds-warning-text);
}

.rpt-card:nth-child(4) .rc-icon {
    background: var(--ds-info-bg);
    color: var(--ds-info-text);
}

.rpt-card:nth-child(5) .rc-icon {
    background: var(--ds-error-bg);
    color: var(--ds-error-text);
}

.rpt-card .rc-value {
    font-size: 2em;
    font-weight: 800;
    color: var(--ds-text-heading);
    line-height: 1;
}

.rpt-card .rc-label {
    color: var(--ds-text-muted);
    font-weight: 500;
    font-size: 14px;
    margin-top: 6px;
}

/* ===== Distribution Panels ===== */
.rpt-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 28px;
}

.rpt-panel {
    background: var(--ds-bg-surface);
    border-radius: var(--ds-radius-lg);
    padding: 22px 24px;
    box-shadow: var(--ds-shadow-ambient);
    border: 1px solid var(--ds-border);
    font-family: var(--ds-font-primary);
}

.rpt-panel-title {
    font-weight: 600;
    font-size: 16px;
    color: var(--ds-text-heading);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rpt-panel-title i {
    color: var(--ds-primary);
}

.rpt-bar-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rpt-bar-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rpt-bar-name {
    font-weight: 500;
    font-size: 14px;
    color: var(--ds-text-body);
    min-width: 110px;
}

.rpt-bar-track {
    flex: 1;
    height: 28px;
    background: var(--ds-bg-subtle);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.rpt-bar-fill {
    height: 100%;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    min-width: 36px;
    transition: width .8s cubic-bezier(.4, 0, .2, 1);
}

.rpt-bar-count {
    font-weight: 600;
    font-size: 14px;
    color: var(--ds-text-heading);
    min-width: 36px;
    text-align: left;
}

/* Status colors */
.bar-in-workshop {
    background: linear-gradient(90deg, #2563eb, #60a5fa);
}

.bar-waiting {
    background: linear-gradient(90deg, #eab308, #fbbf24);
}

.bar-working {
    background: linear-gradient(90deg, #6366f1, #818cf8);
}

.bar-under-check {
    background: linear-gradient(90deg, #059669, #6ee7b7);
}

.bar-waiting-parts {
    background: linear-gradient(90deg, #e11d48, #fb7185);
}

.bar-final-check {
    background: linear-gradient(90deg, #0891b2, #67e8f9);
}

.bar-ready {
    background: linear-gradient(90deg, #22c55e, #86efac);
}

.bar-delivered-unpaid {
    background: linear-gradient(90deg, var(--ds-warning-text), #fcd34d);
}

.bar-delivered-paid {
    background: linear-gradient(90deg, var(--ds-success-text), #42d6a5);
}

.bar-in-appointments {
    background: linear-gradient(90deg, #14b8a6, #5eead4);
}

/* Section colors */
.bar-mechanical {
    background: linear-gradient(90deg, var(--ds-warning-text), #fbbf24);
}

.bar-electrical {
    background: linear-gradient(90deg, #14b8a6, #5eead4);
}

.bar-ac {
    background: linear-gradient(90deg, #3b82f6, #93c5fd);
}

.bar-other {
    background: linear-gradient(90deg, var(--ds-text-muted), #9ca3af);
}

/* ===== Detail Table ===== */
.rpt-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    font-family: var(--ds-font-primary);
}

.rpt-detail-title {
    font-weight: 600;
    font-size: 18px;
    color: var(--ds-text-heading);
    display: flex;
    align-items: center;
    gap: 8px;
}

.rpt-detail-title i {
    color: var(--ds-primary);
}

.rpt-detail-count {
    background: rgba(83, 58, 253, 0.1);
    color: var(--ds-primary);
    padding: 4px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid rgba(83, 58, 253, 0.2);
}

.rpt-table-wrap {
    background: var(--ds-bg-surface);
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-ambient);
    border: 1px solid var(--ds-border);
    overflow: auto;
}

.rpt-table-scroll {
    max-height: 480px;
    overflow-y: auto;
    overflow-x: auto;
}

.rpt-table {
    width: 100%;
    border-spacing: 0;
    border-collapse: collapse;
    font-family: var(--ds-font-primary);
    min-width: 900px;
}

.rpt-table th,
.rpt-table td {
    text-align: center;
    padding: 16px 10px;
    font-size: 15px;
}

.rpt-table th {
    background: var(--ds-bg-subtle);
    color: var(--ds-text-label);
    font-weight: 500;
    border-bottom: 2px solid var(--ds-border);
    position: sticky;
    top: 0;
    z-index: 2;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 0.02em;
}

.rpt-table tbody tr {
    transition: background .15s ease;
}

.rpt-table tbody tr:hover {
    background: rgba(83, 58, 253, 0.03);
}

.rpt-table td {
    color: var(--ds-text-heading);
    border-bottom: 1px solid var(--ds-border);
    font-weight: 400;
}

.rpt-table .tag-sm {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--ds-radius-sm);
    font-size: 13px;
    font-weight: 500;
}

/* ===== Empty State ===== */
.rpt-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--ds-text-muted);
    font-family: var(--ds-font-primary);
}

.rpt-empty i {
    font-size: 3em;
    margin-bottom: 14px;
    display: block;
    color: var(--ds-text-muted);
    opacity: 0.5;
}

.rpt-empty p {
    font-weight: 500;
    font-size: 16px;
    color: var(--ds-text-body);
}

/* ===== Loading ===== */
.rpt-loading {
    text-align: center;
    padding: 40px;
    color: var(--ds-text-muted);
}

.rpt-loading i {
    animation: spin 1s linear infinite;
    font-size: 1.5em;
    color: var(--ds-primary);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media(max-width:1024px) {
    .rpt-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .rpt-panels {
        grid-template-columns: 1fr;
    }

    .rpt-filters {
        flex-direction: column;
        padding: 16px;
        border-radius: 0;
        border-left: none;
        border-right: none;
        box-shadow: none;
        border-top: none;
    }

    .rpt-fg {
        min-width: 0;
        width: 100%;
    }

    .rpt-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .rpt-actions>* {
        flex: 1;
        min-width: 0;
        justify-content: center;
    }

    .rpt-table-wrap {
        overflow: hidden;
    }

    .rpt-table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .rpt-table {
        min-width: 750px;
    }

    .rpt-bar-name {
        min-width: 70px;
        font-size: 13px;
    }

    .rpt-detail-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
}

@media(max-width:480px) {
    .rpt-summary {
        grid-template-columns: 1fr;
    }

    .rpt-actions {
        flex-direction: column;
    }
}


/* ===== FROM: Users.ejs ===== */

.section-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--ds-text-heading);
    margin: 32px 0 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.01em;
}

.section-title svg {
    width: 24px;
    height: 24px;
    color: var(--ds-primary);
    background: var(--ds-bg-subtle);
    padding: 4px;
    border-radius: var(--ds-radius-sm);
}

.add-user-btn,
.add-tech-btn {
    background: var(--ds-primary);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: var(--ds-radius-md);
    font-size: 14.5px;
    font-weight: 600;
    font-family: var(--ds-font-primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(83, 58, 253, 0.2);
}

.add-user-btn:hover,
.add-tech-btn:hover {
    background: var(--ds-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(83, 58, 253, 0.3);
}

/* treeselect فوق الكل */
.treeselect,
.treeselect * {
    z-index: 10000 !important;
}

/* المودالات بالـ class بدل inline */
#modalBlur,
#modalForm,
#modalDelete {
    display: none;
}

#modalBlur.is-open {
    display: block;
}

#modalForm.is-open,
#modalDelete.is-open {
    display: flex;
}

/* تأكيد الظهور فوق أي عنصر */
#modalBlur,
#modalForm,
#modalDelete {
    z-index: 10010 !important;
}

/* جدول يسمح بخروج عناصر المودال/القوائم */
.data-table-wrap {
    overflow: visible !important;
}

/* Tooltip + محتواه */
.tooltip-more {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.tooltip-more .tooltip-content {
    visibility: hidden;
    opacity: 0;
    min-width: 220px;
    max-width: 360px;
    background: #fff;
    color: #24385b;
    text-align: right;
    border-radius: 11px;
    box-shadow: 0 4px 22px #2563eb21;
    padding: 11px 13px 9px 13px;
    position: absolute;
    z-index: 10005;
    top: 28px;
    right: 0;
    font-size: 1em;
    font-weight: 600;
    line-height: 2.1;
    transition: opacity .18s;
}

.tooltip-more:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
}

.tooltip-more .tooltip-arrow {
    position: absolute;
    top: 20px;
    right: 19px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #fff;
    z-index: 10006;
}

.tag-role.active {
    background: #dcfce7;
    color: #16a34a;
}

.tag-role.inactive {
    background: #fee2e2;
    color: #b91c1c;
}

/* Users page utility classes (replacing inline styles) */
.users-toolbar {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 1vh;
}

.techs-toolbar {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.modal-sm {
    max-width: 370px;
}

.modal-md {
    max-width: 480px;
}

.modal-delete-icon {
    padding: 12px 0 21px 0;
    text-align: center;
    color: #b91c1c;
}

.modal-actions-center {
    justify-content: center;
}

.modal-actions-mt {
    margin-top: 14px;
}

/* ===== FROM: VehicleEdit.ejs ===== */

.ve-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    font-family: var(--ds-font-primary);
}

.ve-card {
    background: var(--ds-bg-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-ambient);
    overflow: hidden
}

.ve-card-header {
    background: var(--ds-bg-subtle);
    padding: 16px 20px;
    border-bottom: 1px solid var(--ds-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ve-card-header h3 {
    margin: 0;
    font-weight: 600;
    color: var(--ds-text-heading);
    font-size: 18px
}

.ve-sec {
    padding: 20px
}

.ve-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px dashed var(--ds-border);
    align-items: center
}

.ve-k {
    color: var(--ds-text-label);
    font-weight: 500;
    font-size: 14px
}

.ve-v input,
.ve-v select,
.ve-v textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    font-weight: 400;
    font-size: 15px;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
    background: var(--ds-bg-surface);
    color: var(--ds-text-heading);
    font-family: var(--ds-font-primary);
}

.ve-v input:focus,
.ve-v select:focus,
.ve-v textarea:focus {
    border-color: var(--ds-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(83, 58, 253, 0.15);
}

.ve-v textarea {
    min-height: 80px;
    resize: vertical
}

.ve-preview {
    height: calc(100vh - 260px);
    overflow: auto;
    border-top: 1px solid var(--ds-border)
}

.ve-preview iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0
}

/* Brand box */
.ve-brand-box {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: var(--ds-bg-subtle);
    border-radius: var(--ds-radius-md);
    margin-bottom: 12px;
    border: 1px solid var(--ds-border);
}

.ve-brand-box img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: var(--ds-radius-sm)
}

.ve-brand-name {
    font-weight: 600;
    color: var(--ds-text-heading);
    font-size: 16px
}

.ve-brand-model {
    color: var(--ds-text-body);
    font-size: 14px;
    font-weight: 500
}

/* Model autocomplete dropdown */
.ve-model-wrap {
    position: relative
}

.ve-model-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    max-height: 280px;
    overflow-y: auto;
    background: var(--ds-bg-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    box-shadow: var(--ds-shadow-elevated);
    margin-top: 4px;
}

.ve-model-dropdown .brand-header {
    padding: 6px 14px;
    font-weight: 600;
    color: var(--ds-primary);
    font-size: 13px;
    background: rgba(83, 58, 253, 0.05);
    border-bottom: 1px solid var(--ds-border);
    position: sticky;
    top: 0;
    z-index: 1;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.ve-model-dropdown .model-item {
    padding: 10px 14px 10px 28px;
    cursor: pointer;
    transition: background .15s ease;
    font-weight: 500;
    font-size: 15px;
    color: var(--ds-text-body);
}

.ve-model-dropdown .model-item:hover {
    background: var(--ds-bg-subtle);
    color: var(--ds-text-heading);
}

/* Technicians section */
.ve-techs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    padding: 12px 14px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    background: var(--ds-bg-surface);
    min-height: 48px;
}

.ve-techs label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    font-size: 14px;
    color: var(--ds-text-heading);
    padding: 6px 10px;
    border-radius: var(--ds-radius-sm);
    transition: background .15s ease;
}

.ve-techs label:hover {
    background: var(--ds-bg-subtle)
}

.ve-techs input[type="checkbox"] {
    accent-color: var(--ds-primary);
    width: 16px;
    height: 16px
}

/* Toolbar */
.ve-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    padding: 16px 20px;
    border-top: 1px solid var(--ds-border);
    background: var(--ds-bg-subtle);
}

.btn {
    border: none;
    border-radius: var(--ds-radius-md);
    padding: 10px 20px;
    font-weight: 500;
    cursor: pointer;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all .15s ease;
    font-family: var(--ds-font-primary);
}

.btn:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

.btn.green {
    background: var(--ds-success-text);
    color: #fff;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn.blue {
    background: var(--ds-primary);
    color: #fff;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn.gray {
    background: var(--ds-bg-surface);
    color: var(--ds-text-muted);
    border: 1px solid var(--ds-border)
}

.btn.gray:hover {
    color: var(--ds-text-heading);
    border-color: var(--ds-primary);
    box-shadow: var(--ds-shadow-elevated);
    transform: none;
}

.note {
    font-size: 13px;
    color: var(--ds-text-muted);
    margin-right: auto
}

/* Checkbox rows */
.ve-checks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
    padding: 8px 0;
}

.ve-checks-grid label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    font-size: 14px;
    color: var(--ds-text-heading);
    cursor: pointer;
}

.ve-checks-grid input[type="checkbox"] {
    accent-color: var(--ds-primary);
    width: 16px;
    height: 16px
}

/* Overlay */
.wc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999
}

.wc-box {
    background: var(--ds-bg-surface);
    border-radius: var(--ds-radius-xl);
    padding: 28px 32px;
    box-shadow: var(--ds-shadow-elevated);
    text-align: center;
    min-width: 280px;
    border: 1px solid var(--ds-border);
}

.wc-spin {
    width: 44px;
    height: 44px;
    border: 4px solid var(--ds-border);
    border-top-color: var(--ds-primary);
    border-radius: 50%;
    margin: 0 auto 14px;
    animation: spin 1s linear infinite
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

.wc-check {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--ds-success-text);
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 28px;
    margin: 0 auto 14px;
}

/* ===== RESPONSIVE ===== */
@media (max-width:1024px) {
    .ve-wrap {
        grid-template-columns: 1fr !important;
        gap: 16px
    }

    .ve-row {
        grid-template-columns: 1fr !important;
        gap: 4px
    }

    .ve-k {
        font-size: .85em;
        color: #2563eb
    }

    .ve-sec {
        padding: 16px
    }

    .ve-card-header {
        padding: 14px 16px
    }

    .ve-preview {
        height: 50vh;
        min-height: 300px
    }

    .ve-toolbar {
        flex-direction: column;
        gap: 8px
    }

    .ve-toolbar .btn {
        width: 100%;
        justify-content: center
    }

    .ve-toolbar .note {
        margin: 0;
        text-align: center
    }

    .ve-checks-grid {
        grid-template-columns: repeat(2, 1fr)
    }

    .ve-brand-box {
        flex-direction: column;
        text-align: center
    }
}

@media (max-width:480px) {
    .ve-sec {
        padding: 12px
    }

    .ve-checks-grid {
        grid-template-columns: 1fr
    }

    .ve-techs {
        gap: 8px 12px
    }
}


/* ===== FROM: Vehicles.ejs ===== */

/* ================== Filter Bar (Desktop) ================== */
.filter-bar {
    padding: 20px 24px 18px;
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    align-items: flex-end;
    background: var(--ds-bg-surface);
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-ambient);
    border: 1px solid var(--ds-border);
}

.filter-group {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex: 1 1 170px;
    min-width: 160px;
}

.filter-input,
.filter-select {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--ds-radius-md);
    border: 1px solid var(--ds-border);
    font-size: 15px;
    background: var(--ds-bg-subtle);
    color: var(--ds-text-heading);
    font-family: var(--ds-font-primary);
    transition: border-color .15s, box-shadow .15s;
}

.filter-input:focus,
.filter-select:focus {
    border-color: var(--ds-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(83, 58, 253, 0.15);
}

.reset-btn {
    padding: 10px 24px;
    border-radius: var(--ds-radius-md);
    font-weight: 500;
    cursor: pointer;
    font-size: 15px;
    background: transparent;
    color: var(--ds-text-heading);
    border: 1px solid var(--ds-border);
    transition: all .2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--ds-font-primary);
}

.reset-btn:hover {
    background: rgba(23, 23, 23, 0.05);
    transform: translateY(-1px);
}

.add-car-btn {
    background: var(--ds-primary);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: var(--ds-radius-md);
    font-weight: 500;
    cursor: pointer;
    font-size: 15px;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all .2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--ds-font-primary);
}

.add-car-btn:hover {
    transform: translateY(-1px);
    background: var(--ds-primary-hover);
    box-shadow: 0 7px 14px rgba(50, 50, 93, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
}

/* ================== Desktop Table ================== */
.cars-table-wrap {
    background: var(--ds-bg-surface);
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-ambient);
    border: 1px solid var(--ds-border);
    padding-bottom: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

.cars-table {
    width: 100%;
    border-spacing: 0;
    border-collapse: collapse;
    min-width: 1200px;
}

.cars-table th,
.cars-table td {
    text-align: center;
    padding: 16px 12px;
    font-size: 15px;
    color: var(--ds-text-heading);
}

.cars-table th {
    background: var(--ds-bg-subtle);
    color: var(--ds-text-label);
    font-weight: 500;
    font-size: 14px;
    border-bottom: 2px solid var(--ds-border);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.cars-table td {
    border-bottom: 1px solid var(--ds-border);
    font-weight: 400;
}

.cars-table tbody tr {
    transition: background .15s ease;
}

.cars-table tbody tr:hover {
    background: rgba(83, 58, 253, 0.03);
}

.cars-table .table-action {
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    padding: 6px;
    margin: 0 2px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    color: var(--ds-text-label);
    border-radius: var(--ds-radius-sm);
    transition: all .2s ease;
}

.cars-table .table-action:hover {
    background: rgba(83, 58, 253, 0.05);
    color: var(--ds-primary);
    transform: translateY(-1px);
}

.cars-table .table-action.btn-wa {
    color: #108c3d;
    text-decoration: none;
}

.cars-table .table-action.btn-wa:hover {
    background: rgba(21, 190, 83, 0.15);
    color: #108c3d;
}

/* Tooltip للأزرار */
.cars-table .table-action[data-tip] {
    position: relative;
}

.cars-table .table-action[data-tip]:hover {
    z-index: 9999;
}

.cars-table .table-action[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%) translateY(4px) scale(.98);
    background: #1f2d3d;
    color: #fff;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s, transform .15s;
    z-index: 999;
}

.cars-table .table-action[data-tip]::before {
    content: "";
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 7px solid #1f2d3d;
    opacity: 0;
    transition: opacity .15s;
    z-index: 1000;
}

.cars-table .table-action[data-tip]:hover::after,
.cars-table .table-action[data-tip]:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Badges overlay select */
.badge-wrap {
    position: relative;
    display: inline-block;
}

.badge-select {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    appearance: none;
    border: none;
    background: transparent;
}

/* Hover tooltips لنص المشكلة الطويل */
.problem-hover .tooltip-more {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.problem-hover .tooltip-content {
    visibility: hidden;
    opacity: 0;
    min-width: 180px;
    background: #fff;
    color: #24385b;
    text-align: center;
    border-radius: 11px;
    box-shadow: 0 4px 22px #2563eb21;
    padding: 11px 13px 9px;
    position: absolute;
    z-index: 90;
    top: 34px;
    right: 0;
    font-size: 1em;
    font-weight: 600;
    line-height: 2.1;
    transition: opacity .18s;
}

.problem-hover .tooltip-more:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
}

.problem-hover .tooltip-arrow {
    position: absolute;
    top: -8px;
    right: 19px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #fff;
}

/* ================== Mobile Cards ================== */
.cars-cards {
    display: none;
}

@media (max-width:1024px) {

    /* Filter bar mobile */
    .filter-bar {
        /* position:sticky; top:0; z-index:5; */
        background: var(--main-bg, #ffffff);
        border-bottom: 1px solid #eaeef5;
        padding: 12px;
        gap: 10px;
        box-shadow: 0 6px 16px rgba(0, 0, 0, .04);
    }

    .filter-group {
        min-width: 100%;
    }

    .reset-btn,
    .add-car-btn {
        width: 100%;
    }

    /* Hide desktop table, show cards */
    .cars-table-wrap {
        display: none !important;
    }

    .cars-cards {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
        margin-top: 16px;
    }

    .car-card {
        background: var(--ds-bg-surface);
        border: 1px solid var(--ds-border);
        border-radius: var(--ds-radius-lg);
        box-shadow: var(--ds-shadow-ambient);
        padding: 20px;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .car-row {
        display: flex;
        justify-content: space-between;
        gap: 10px;
        align-items: center;
    }

    .car-title {
        font-weight: 600;
        color: var(--ds-text-heading);
        font-size: 16px;
    }

    .car-sub {
        color: var(--ds-text-body);
        font-weight: 400;
        font-size: 14px;
    }

    .car-badges {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        margin-top: 4px;
    }

    .car-actions {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        margin-top: 16px;
        border-top: 1px solid var(--ds-border);
        padding-top: 16px;
    }

    .car-problem {
        background: var(--ds-bg-subtle);
        border: 1px solid var(--ds-border);
        border-radius: var(--ds-radius-md);
        padding: 10px 14px;
        font-weight: 400;
        color: var(--ds-text-heading);
        line-height: 1.6;
        font-size: 14px;
    }

    /* نفس الـ overlay للـ selects داخل البادج */
    .badge-wrap {
        position: relative;
        display: inline-block;
    }

    .badge-select {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        opacity: 0;
        cursor: pointer;
        appearance: none;
        border: none;
        background: transparent;
    }

}

@media (max-width:1024px) {
    .cars-table {
        min-width: 800px;
    }

    .filter-group {
        min-width: 100% !important;
    }

    .add-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    /* Add Car modal - full width on mobile/iPad */
    #addCarModal {
        padding: 12px !important;
        align-items: flex-start !important;
        padding-top: 3vh !important;
    }

    #addCarModal>div,
    #addCarModal>.modal-content,
    .modern-modal .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        max-height: 88vh !important;
        overflow-y: auto !important;
        border-radius: 16px !important;
        padding: 16px !important;
        box-sizing: border-box !important;
    }
}

/* مودال/اقتراحات/لودر (من كودك الأصلي) */
.suggest-box {
    position: absolute;
    right: 0;
    left: 0;
    top: 100%;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 24px #00000014;
    z-index: 50;
    display: none;
    max-height: 320px;
    overflow: auto
}

.suggest-item {
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer
}

.suggest-item:hover {
    background: #f7faff
}

.suggest-name {
    font-weight: 700;
    color: #111827
}

.suggest-meta {
    color: #6b7280;
    font-size: 12px;
    margin-right: auto
}

.suggest-count {
    background: #eef2ff;
    color: #5b6bff;
    border-radius: 10px;
    padding: 2px 8px;
    font-weight: 700;
    font-size: 12px
}

#addCarBlur {
    display: none
}

#addCarModal {
    display: none
}

#addCarBlur.is-open {
    display: block
}

#addCarModal.is-open {
    display: flex
}

.add-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px
}

.add-grid label {
    font-weight: 700;
    margin: 6px 0 4px
}

.add-grid input,
.add-grid select {
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 10px
}

.wc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999
}

.wc-box {
    background: #fff;
    border-radius: 16px;
    padding: 28px 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .15);
    text-align: center;
    min-width: 280px
}

.wc-spin {
    width: 44px;
    height: 44px;
    border: 4px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    margin: 0 auto 14px;
    animation: spin 1s linear infinite
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

.wc-title {
    font-weight: 900;
    color: #111827;
    margin-bottom: 6px
}

.wc-note {
    color: #6b7280
}


/* ===== FROM: vehiclesAppointments.ejs ===== */

.filter-bar {
    padding: 18px 16px 10px 16px;
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px 20px;
    align-items: flex-end;
    background: var(--ds-bg-surface);
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-ambient);
    border: 1px solid var(--ds-border);
    font-family: var(--ds-font-primary);
}

.filter-group {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex: 1 1 170px;
    min-width: 160px;
}

.filter-label {
    font-weight: 500;
    color: var(--ds-text-label);
    margin-bottom: 4px;
    font-size: 14px;
}

.filter-input,
.filter-select {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--ds-radius-md);
    border: 1px solid var(--ds-border);
    font-size: 15px;
    background: var(--ds-bg-surface);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    color: var(--ds-text-heading);
    font-family: var(--ds-font-primary);
}

.filter-input:focus,
.filter-select:focus {
    border-color: var(--ds-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(83, 58, 253, 0.15);
}

.filter-btn,
.reset-btn {
    padding: 10px 24px;
    border-radius: var(--ds-radius-md);
    border: none;
    font-weight: 500;
    cursor: pointer;
    font-size: 15px;
    background: var(--ds-primary);
    color: #fff;
    margin-left: 9px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
    font-family: var(--ds-font-primary);
}

.filter-btn:hover {
    background: var(--ds-primary-hover);
    transform: translateY(-1px);
}

.reset-btn {
    background: var(--ds-bg-subtle);
    color: var(--ds-text-heading);
    border: 1px solid var(--ds-border);
    margin-left: 0;
    box-shadow: none;
}

.reset-btn:hover {
    background: #eaeef5;
    transform: translateY(0);
}

.add-car-btn {
    background: var(--ds-primary);
    color: #fff;
    font-weight: 500;
    border: none;
    border-radius: var(--ds-radius-md);
    padding: 10px 24px;
    cursor: pointer;
    font-size: 15px;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--ds-font-primary);
}

.add-car-btn:hover {
    background: var(--ds-primary-hover);
    transform: translateY(-1px);
}

.add-car-btn i {
    font-size: 1.18em;
}

/* Table styles */
.cars-table-wrap {
    background: var(--ds-bg-surface);
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-ambient);
    padding-bottom: 13px;
    border: 1px solid var(--ds-border);
    overflow-x: auto;
    position: relative;
}

.cars-table {
    width: 100%;
    border-spacing: 0;
    border-collapse: collapse;
    font-family: var(--ds-font-primary);
    min-width: 1200px;
}

.cars-table th,
.cars-table td {
    text-align: center;
    padding: 16px 10px;
    font-size: 15px;
    background: transparent;
}

.cars-table th {
    background: var(--ds-bg-subtle);
    color: var(--ds-text-label);
    font-weight: 500;
    border-bottom: 2px solid var(--ds-border);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.cars-table tbody tr {
    transition: background 0.15s ease;
}

.cars-table tbody tr:hover {
    background: rgba(83, 58, 253, 0.03);
}

.cars-table td {
    color: var(--ds-text-heading);
    border-bottom: 1px solid var(--ds-border);
    font-weight: 400;
}

.cars-table .table-action {
    background: var(--ds-bg-surface);
    border: 1px solid var(--ds-border);
    cursor: pointer;
    padding: 8px 12px;
    font-size: 14px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    color: var(--ds-text-muted);
    border-radius: var(--ds-radius-md);
    transition: all 0.2s ease;
}

.cars-table .table-action:hover {
    border-color: var(--ds-primary);
    color: var(--ds-primary);
    box-shadow: var(--ds-shadow-ambient);
    transform: translateY(-1px);
}

.cars-table .table-action+.table-action {
    margin-right: 5px;
}

.cars-table .table-action.btn-del:hover {
    border-color: var(--ds-error-text);
    color: var(--ds-error-text);
}

.cars-table .vin-hover,
.cars-table .problem-hover {
    position: relative;
}

.cars-table .tooltip {
    visibility: hidden;
    opacity: 0;
    min-width: 170px;
    background: var(--ds-bg-surface);
    color: var(--ds-text-heading);
    text-align: right;
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-elevated);
    padding: 11px 13px;
    border: 1px solid var(--ds-border);
    position: absolute;
    z-index: 11;
    top: 38px;
    right: 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.6;
    transition: opacity .18s;
}

.cars-table .vin-hover:hover .tooltip,
.cars-table .problem-hover:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

.cars-table .select-status {
    background: rgba(83, 58, 253, 0.1);
    color: var(--ds-primary);
    border-radius: var(--ds-radius-md);
    border: none;
    font-weight: 500;
    font-size: 14px;
    padding: 7px 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(83, 58, 253, 0.2);
}

.cars-table .select-status:focus {
    box-shadow: 0 0 0 3px rgba(83, 58, 253, 0.15);
    outline: none;
}

@media (max-width:1024px) {
    .cars-table {
        min-width: 800px;
    }

    .filter-bar {
        flex-direction: column;
        gap: 9px;
        padding: 12px;
        border-radius: 0;
        border-left: none;
        border-right: none;
        box-shadow: none;
        border-top: none;
    }

    .filter-group {
        min-width: 100%;
    }

    .add-car-btn {
        position: static;
        width: 100%;
        margin-top: 12px;
        justify-content: center;
    }

    .add-grid {
        grid-template-columns: 1fr !important;
    }

    .cars-table .table-action {
        font-size: 14px;
        padding: 8px 10px;
        min-height: 40px;
        min-width: 40px;
    }
}

.tooltip-more {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.tooltip-more .tooltip-content {
    visibility: hidden;
    opacity: 0;
    min-width: 180px;
    background: var(--ds-bg-surface);
    color: var(--ds-text-heading);
    text-align: center;
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-elevated);
    border: 1px solid var(--ds-border);
    padding: 11px 13px;
    position: absolute;
    z-index: 90;
    top: 34px;
    right: 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.6;
    transition: opacity .18s;
}

.tooltip-more:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
}

.tooltip-more .tooltip-arrow {
    position: absolute;
    top: -8px;
    right: 19px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid var(--ds-bg-surface);
}

.badge-wrap {
    position: relative;
    display: inline-block;
}

.badge-select {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    border: none;
    background: transparent;
}

/* Tooltip for action buttons */
.cars-table .table-action[data-tip] {
    position: relative;
}

.cars-table .table-action[data-tip]:hover {
    z-index: 9999;
}

.cars-table .table-action[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%) translateY(4px) scale(.98);
    background: var(--ds-text-heading);
    color: #fff;
    padding: 6px 10px;
    border-radius: var(--ds-radius-md);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: var(--ds-shadow-elevated);
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease, transform .15s ease;
    z-index: 999;
}

.cars-table .table-action[data-tip]::before {
    content: "";
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 7px solid var(--ds-text-heading);
    opacity: 0;
    transition: opacity .15s ease;
    z-index: 1000;
}

.cars-table .table-action[data-tip]:hover::after,
.cars-table .table-action[data-tip]:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* dropdown نتائج البحث */
.suggest-box {
    position: absolute;
    right: 0;
    left: 0;
    top: 100%;
    background: var(--ds-bg-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    box-shadow: var(--ds-shadow-elevated);
    z-index: 50;
    display: none;
    max-height: 320px;
    overflow: auto
}

.suggest-item {
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-family: var(--ds-font-primary)
}

.suggest-item:hover {
    background: var(--ds-bg-subtle)
}

.suggest-name {
    font-weight: 500;
    color: var(--ds-text-heading);
    font-size: 14px
}

.suggest-meta {
    color: var(--ds-text-label);
    font-size: 12px;
    margin-right: auto
}

.suggest-count {
    background: rgba(83, 58, 253, 0.1);
    color: var(--ds-primary);
    border-radius: 10px;
    padding: 2px 8px;
    font-weight: 600;
    font-size: 12px
}

/* Modal styling fallback (handled by modern-modal) */
#addCarBlur {
    display: none
}

#addCarModal {
    display: none
}

#addCarBlur.is-open {
    display: block
}

#addCarModal.is-open {
    display: flex
}

.add-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px
}

.add-grid label {
    font-weight: 500;
    margin: 6px 0 4px;
    font-family: var(--ds-font-primary);
    color: var(--ds-text-label);
    font-size: 14px
}

.add-grid input,
.add-grid select {
    padding: 10px 14px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    font-family: var(--ds-font-primary);
    font-size: 15px;
    background: var(--ds-bg-surface);
    color: var(--ds-text-heading);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.add-grid input:focus,
.add-grid select:focus {
    border-color: var(--ds-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(83, 58, 253, 0.15);
}

.wc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 3, 39, 0.4);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999
}

.wc-box {
    background: var(--ds-bg-surface);
    border-radius: var(--ds-radius-xl);
    padding: 32px 36px;
    box-shadow: var(--ds-shadow-elevated);
    text-align: center;
    min-width: 260px;
    border: 1px solid var(--ds-border);
    font-family: var(--ds-font-primary)
}

.wc-spin {
    width: 42px;
    height: 42px;
    border: 4px solid var(--ds-bg-subtle);
    border-top-color: var(--ds-primary);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 1s linear infinite
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

.wc-title {
    font-weight: 600;
    color: var(--ds-text-heading);
    margin-bottom: 8px;
    font-size: 18px
}

.wc-note {
    color: var(--ds-text-muted);
    font-size: 14px
}


/* ===== FROM: VehicleView.ejs ===== */

/* ===== MATCH VehicleEdit DESIGN ===== */
.v-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    font-family: var(--ds-font-primary);
}

.v-card {
    background: var(--ds-bg-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-ambient);
    overflow: hidden
}

.v-card-header {
    background: var(--ds-bg-subtle);
    padding: 16px 20px;
    border-bottom: 1px solid var(--ds-border);
    display: flex;
    align-items: center;
    gap: 14px;
}

.v-card-header-info {
    flex: 1;
    min-width: 0
}

.v-h {
    font-weight: 600;
    color: var(--ds-text-heading);
    margin: 0;
    font-size: 18px
}

.v-card-header-model {
    font-weight: 500;
    color: var(--ds-text-body);
    font-size: 14px;
    margin-top: 2px
}

.v-sec {
    padding: 20px
}

.v-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px dashed var(--ds-border);
    align-items: center
}

.v-k {
    color: var(--ds-text-label);
    font-weight: 500;
    font-size: 14px
}

.v-v {
    font-weight: 500;
    color: var(--ds-text-heading);
    font-size: 15px
}

.v-v pre {
    white-space: pre-wrap;
    margin: 0;
    font-family: var(--ds-font-primary)
}

.v-preview {
    height: calc(100vh - 260px);
    overflow: auto;
    border-top: 1px solid var(--ds-border)
}

.v-preview iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0
}

/* Brand box */
.brand-box {
    width: 52px;
    height: 52px;
    border-radius: var(--ds-radius-sm);
    background: var(--ds-bg-subtle);
    border: 1px solid var(--ds-border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.brand-box img {
    max-width: 44px;
    max-height: 44px;
    object-fit: contain
}

.brand-box .brand-fallback {
    font-weight: 600;
    font-size: 20px;
    color: var(--ds-primary);
    text-transform: uppercase;
}

/* Toolbar */
.v-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    padding: 16px 20px;
    border-top: 1px solid var(--ds-border);
    background: var(--ds-bg-subtle);
}

.btn {
    border: none;
    border-radius: var(--ds-radius-md);
    padding: 10px 20px;
    font-weight: 500;
    cursor: pointer;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all .15s ease;
    text-decoration: none;
    font-family: var(--ds-font-primary);
}

.btn:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

.btn.secondary {
    background: rgba(83, 58, 253, 0.05);
    color: var(--ds-primary);
    border: 1px solid rgba(83, 58, 253, 0.2);
}

.btn.secondary:hover {
    background: var(--ds-primary);
    color: #fff;
    border-color: var(--ds-primary);
}

.btn.gray {
    background: var(--ds-bg-surface);
    color: var(--ds-text-muted);
    border: 1px solid var(--ds-border)
}

.btn.gray:hover {
    color: var(--ds-text-heading);
    border-color: var(--ds-primary);
    box-shadow: var(--ds-shadow-elevated);
    transform: none;
}

.btn:not(.secondary):not(.gray) {
    background: var(--ds-primary);
    color: #fff;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn:not(.secondary):not(.gray):hover {
    background: var(--ds-primary-hover);
    box-shadow: 0 6px 10px rgba(50, 50, 93, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.note {
    font-size: 13px;
    color: var(--ds-text-muted);
    margin-right: auto
}

#printFrame {
    position: fixed;
    left: -99999px;
    top: -99999px;
    width: 1px;
    height: 1px;
    border: 0
}

/* ===== RESPONSIVE ===== */
@media (max-width:1024px) {
    .v-wrap {
        grid-template-columns: 1fr !important;
        gap: 16px
    }

    .v-row {
        grid-template-columns: 1fr !important;
        gap: 4px
    }

    .v-k {
        font-size: 13px;
        color: var(--ds-primary)
    }

    .v-sec {
        padding: 16px
    }

    .v-card-header {
        padding: 14px 16px
    }

    .v-preview {
        height: 50vh;
        min-height: 300px
    }

    .v-toolbar {
        flex-direction: column;
        gap: 8px
    }

    .v-toolbar .btn {
        width: 100%;
        justify-content: center
    }

    .v-toolbar .note {
        margin: 0;
        text-align: center
    }
}

@media (max-width:480px) {
    .v-sec {
        padding: 12px
    }

    .v-card-header {
        flex-direction: column;
        text-align: center;
        padding: 14px 14px 10px
    }

    .brand-box {
        width: 48px;
        height: 48px
    }
}



/* === Mobile Skin: app-like styling on screens ≤1024px ================== */
:root {
    /* Safe-area aware variables */
}

/* General rules (won't hurt desktop) */
html {
    box-sizing: border-box;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

html {
    touch-action: manipulation;
}

/* ↓↓↓ Mobile only ↓↓↓ */
@media (max-width: 1024px) {

    body.mobile-skin {
        margin: 0;
        font-family: 'Cairo', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
        -webkit-font-smoothing: antialiased;
        text-rendering: optimizeLegibility;
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    /* App Shell */
    body.mobile-skin .app-shell {
        min-height: 100dvh;
        display: flex;
        flex-direction: column;
    }

    body.mobile-skin .app-main {
        flex: 1;
        padding: 0;
    }

    body.mobile-skin .app-container {
        max-width: 100%;
        margin: 0 auto;
    }

    /* Transparent backgrounds to not break your colors */
    body.mobile-skin .layout-modern,
    body.mobile-skin .main-modern,
    body.mobile-skin .main-container {
        background: transparent;
    }

    /* Inputs */
    body.mobile-skin input,
    body.mobile-skin select,
    body.mobile-skin textarea {
        font-size: 16px;
        /* prevents iOS zoom */
    }

    /* Headings */
    body.mobile-skin h1 {
        font-size: clamp(1.2rem, 3.5vw, 1.5rem);
        margin: 0 0 8px;
    }

    body.mobile-skin h2 {
        font-size: clamp(1rem, 3vw, 1.2rem);
        margin: 0 0 6px;
    }

    /* Links */
    body.mobile-skin a {
        color: inherit;
        text-decoration: none;
    }

    /* Reduce motion */
    @media (prefers-reduced-motion: reduce) {
        * {
            animation-duration: .001ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: .001ms !important;
            scroll-behavior: auto !important;
        }
    }
}

/* ===== Mobile Overrides ===== */
/* Desktop-only header hide */
.mobile-header {
    display: none;
}

/* ===== TABLET & MOBILE (≤1024px) ===== */
@media (max-width: 1024px) {

    /* ---------- Mobile Header ---------- */
    .mobile-header {
        position: sticky;
        top: 0;
        z-index: 40;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 16px;
        background: var(--main-bg);
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 4px 12px rgba(0, 0, 0, .04);
    }

    .mh-btn {
        appearance: none;
        border: 0;
        border-radius: var(--ds-radius-md);
        padding: 10px 12px;
        cursor: pointer;
        background: var(--ds-bg-subtle);
        color: var(--ds-primary);
        font-weight: 600;
        font-size: 16px;
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all .2s ease;
    }

    .mh-btn:hover {
        background: rgba(83, 58, 253, 0.1);
    }

    .mh-title {
        font-weight: 600;
        font-size: 16px;
        letter-spacing: -0.01em;
        color: var(--ds-text-heading);
    }

    /* ---------- Layout ---------- */
    html,
    body {
        height: auto !important;
        overflow: visible !important;
    }

    .layout-modern {
        display: block !important;
        width: 100% !important;
        min-height: 100dvh;
        overflow: visible !important;
    }

    :root {
        --sidebar-w: 0px !important;
    }

    .main-modern {
        margin: 0 !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        padding: 16px 14px !important;
    }

    .main-modern .main-container {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        overflow: visible !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }

    .main-title {
        font-size: 22px;
        margin-bottom: 16px;
    }

    /* ---------- Sidebar as Drawer ---------- */
    .sidebar-dark {
        position: fixed !important;
        top: 0;
        bottom: 0;
        right: 0;
        left: auto;
        width: 280px !important;
        min-width: 280px !important;
        transform: translateX(100%) !important;
        transition: transform .25s ease;
        border-right: 1px solid var(--sidebar-border);
        border-left: none !important;
        background: var(--sidebar-bg);
        box-shadow: -16px 0 48px rgba(0, 0, 0, .3);
        z-index: 50;
    }

    .sidebar-dark.is-open {
        transform: translateX(0) !important;
    }

    .drawer-overlay {
        position: fixed;
        inset: 0;
        z-index: 45;
        background: rgba(0, 0, 0, .4);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease;
    }

    .drawer-overlay.show {
        opacity: 1;
        pointer-events: auto;
    }

    /* ---------- Dashboard Cards ---------- */
    .cards-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    .modern-card {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 110px;
        overflow: visible !important;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 14px 16px !important;
    }

    .card-content {
        flex: 1;
        min-width: 0;
    }

    .stat-progress {
        display: grid;
        place-items: center;
        width: 60px;
        height: 60px;
        min-width: 60px;
        flex: 0 0 60px;
        position: relative;
    }

    .stat-progress svg {
        width: 100%;
        height: 100%;
        display: block;
    }

    .stat-progress .ring-bg,
    .stat-progress .ring-fg {
        stroke-width: 6.5;
    }

    /* ---------- Recent Cars ---------- */
    .recent-cars {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 14px;
        margin-bottom: 32px;
    }

    .car-card {
        direction: rtl;
        text-align: start;
        padding: 14px;
        border-radius: 14px;
    }

    .car-card>* {
        margin: 0;
    }

    .car-header {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        gap: 6px;
    }

    .car-info {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .car-customer {
        font-weight: 800;
        color: var(--main-title);
        font-size: 14px;
    }

    .car-date {
        font-size: 12px;
        color: var(--main-label);
    }

    .car-body {
        font-size: 13px;
        line-height: 1.6;
    }

    .car-line {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-wrap: wrap;
    }

    .car-line strong {
        color: var(--main-label);
        font-weight: 700;
    }

    .car-problem {
        background: var(--ds-bg-subtle);
        color: var(--ds-text-heading);
        border-radius: var(--ds-radius-md);
        padding: 7px 10px;
        line-height: 1.6;
        word-break: break-word;
        margin-top: 6px;
        border: 1px solid var(--ds-border);
    }

    .car-footer {
        display: flex;
        justify-content: flex-end;
        margin-top: auto;
    }

    .btn-view {
        appearance: none;
        border: 0;
        cursor: pointer;
        background: var(--ds-primary);
        color: #fff;
        padding: 9px 14px;
        border-radius: var(--ds-radius-md);
        font-size: 14px;
        font-weight: 500;
        transition: all .2s ease;
        box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
    }

    .btn-view:active {
        transform: translateY(1px);
    }

    /* ---------- Tables (scrollable container) ---------- */
    .data-table-wrap {
        -webkit-overflow-scrolling: touch;
        overflow-x: auto;
    }

    .data-modern-table {
        min-width: 900px;
    }

    .cars-table {
        min-width: 900px;
    }

    .cars-table-wrap {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Touch targets */
    button,
    .table-action-btn,
    .tag_status_B_View {
        min-height: 40px;
    }

    /* ---------- TOOLTIP Z-INDEX FIX (ALL vehicle pages) ---------- */
    .cars-table .table-action[data-tip]::after {
        z-index: 999 !important;
    }

    .cars-table .table-action[data-tip]::before {
        z-index: 1000 !important;
    }

    /* ---------- Modal Responsive ---------- */
    .modal-blur {
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }

    .modern-modal {
        padding: 12px;
        align-items: flex-start;
        padding-top: 5vh;
    }

    .modern-modal .modal-content {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: 85vh;
        border-radius: 16px;
        padding: 0 16px 16px;
    }

    .modern-modal .modal-header {
        padding: 14px 16px 10px;
    }

    /* ---------- Add Car Modal ---------- */
    .add-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    #addCarBlur.is-open,
    #addCarModal.is-open {
        display: flex !important;
    }

    #addCarModal {
        padding: 12px !important;
        align-items: flex-start !important;
        padding-top: 3vh !important;
    }

    #addCarModal>div,
    #addCarModal>.modal-content,
    #addCarModal>[style] {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        max-height: 88vh !important;
        overflow-y: auto !important;
        border-radius: 16px !important;
        padding: 16px !important;
        box-sizing: border-box !important;
    }

    /* ---------- Reports ---------- */
    .rpt-filters {
        flex-direction: column;
        gap: 10px;
        padding: 16px;
        box-sizing: border-box;
    }

    .rpt-fg {
        min-width: 0 !important;
        width: 100% !important;
    }

    .rpt-summary {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }

    .rpt-panels {
        grid-template-columns: 1fr !important;
    }

    .rpt-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .rpt-table {
        min-width: 700px;
    }

    .rpt-actions {
        width: 100%;
        justify-content: stretch;
    }

    .rpt-actions>* {
        flex: 1;
    }

    .rpt-bar-name {
        min-width: 60px;
        font-size: .85em;
    }

    .rpt-detail-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    /* ---------- VehicleEdit / VehicleView ---------- */
    .ve-wrap {
        grid-template-columns: 1fr !important;
    }

    .ve-row {
        grid-template-columns: 1fr !important;
        gap: 4px;
    }

    .v-wrap {
        grid-template-columns: 1fr !important;
    }

    .v-row {
        grid-template-columns: 1fr !important;
        gap: 4px;
    }

    /* ---------- Pricing ---------- */
    .prc-header {
        flex-direction: column;
        gap: 10px;
    }

    .prc-search {
        width: 100% !important;
        min-width: 0 !important;
    }

    .prc-btn {
        width: 100%;
        text-align: center;
    }

    .prc-filters {
        flex-wrap: wrap;
        gap: 6px;
    }

    .prc-filter-badge {
        flex: 1;
        min-width: 0;
        justify-content: center;
        padding: 8px 10px;
        font-size: .85em;
    }

    .prc-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .prc-table {
        min-width: 750px;
    }

    .prc-modal {
        min-width: auto !important;
        width: 94% !important;
        max-width: 100% !important;
        padding: 18px 16px !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
        box-sizing: border-box !important;
    }

    .prc-prices-input {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    /* ---------- Inventory Modal ---------- */
    .modal .box {
        width: 96% !important;
        max-width: none !important;
        min-width: 0 !important;
        border-radius: 16px !important;
        padding: 16px !important;
        max-height: 88vh !important;
        overflow-y: auto !important;
        box-sizing: border-box !important;
    }

    .grid {
        grid-template-columns: 1fr !important;
    }

    /* ---------- Filter Bar (Vehicles pages) ---------- */
    .filter-bar {
        flex-direction: column;
        gap: 10px !important;
        padding: 12px !important;
        background: var(--ds-bg-surface);
        border-bottom: 1px solid var(--ds-border);
        box-shadow: 0 4px 12px rgba(0, 0, 0, .03);
    }

    .filter-group {
        min-width: 100% !important;
        width: 100% !important;
    }

    .reset-btn,
    .add-car-btn {
        width: 100%;
        justify-content: center;
        box-sizing: border-box;
    }

    /* ---------- Add User Button ---------- */
    .add-user-btn {
        margin: 0 !important;
        width: auto;
    }

    /* WhatsApp button */
    .btn-wa {
        text-decoration: none !important;
    }
}

/* ===== SMALL MOBILE (≤480px) ===== */
@media (max-width: 480px) {
    .main-modern {
        padding: 12px 10px !important;
    }

    .main-title {
        font-size: 20px;
        margin-bottom: 12px;
    }

    .cards-grid {
        grid-template-columns: 1fr !important;
    }

    .modern-card .stat-value {
        font-size: 28px;
    }

    .recent-cars {
        grid-template-columns: 1fr !important;
    }

    .rpt-summary {
        grid-template-columns: 1fr !important;
    }

    .rpt-actions {
        flex-direction: column;
    }

    .prc-filter-badge {
        font-size: .8em;
        padding: 6px 8px;
    }

    /* Sidebar smaller on very small screens */
    .sidebar-dark {
        width: 260px !important;
        min-width: 260px !important;
    }
}

/* ===== DESKTOP ONLY (>1024px) ===== */
@media (min-width: 1025px) {
    .stat-progress {
        width: 72px;
        height: 72px;
        min-width: 72px;
        flex-basis: 72px;
    }

    .stat-progress .progress-text {
        font-size: 13px;
    }

    .recent-cars {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 18px;
        margin-bottom: 32px;
    }

    .car-card {
        background: var(--main-card);
        border-radius: 14px;
        border: 1px solid var(--border-color);
        box-shadow: var(--main-shadow);
        padding: 14px 16px;
        display: flex;
        flex-direction: column;
        gap: 8px;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        height: 100%;
    }

    .car-card:hover {
        transform: translateY(-3px);
        box-shadow: var(--main-shadow-hover);
    }

    .car-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .car-info {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .car-customer {
        font-weight: 700;
        color: var(--main-title);
        font-size: 14px;
    }

    .car-date {
        font-size: 12px;
        color: var(--main-label);
    }

    .car-body {
        font-size: 13px;
        line-height: 1.5;
        color: var(--ds-text-heading);
    }

    .car-line strong {
        color: var(--ds-text-label);
        font-weight: 600;
    }

    .car-problem {
        font-size: 13px;
        color: var(--ds-text-heading);
        background: var(--ds-bg-subtle);
        border-radius: var(--ds-radius-md);
        border: 1px solid var(--ds-border);
        padding: 6px 10px;
        margin-top: 4px;
        line-height: 1.6;
    }

    .car-footer {
        display: flex;
        justify-content: flex-end;
        margin-top: auto;
    }

    .btn-view {
        border: none;
        background: var(--ds-primary);
        color: #fff;
        padding: 8px 16px;
        border-radius: var(--ds-radius-md);
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s ease;
        box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
    }

    .btn-view:hover {
        background: var(--ds-primary-hover);
        transform: translateY(-1px);
    }

    /* TOOLTIP Z-INDEX FIX - Desktop */
    .cars-table .table-action[data-tip]::after {
        z-index: 999;
    }

    .cars-table .table-action[data-tip]::before {
        z-index: 1000;
    }
}