/* ============================================================
   ADMIN COMMON CSS — Custom Admin Framework
   Mobile-first responsive design. NO Bootstrap dependency.
   Version: 1.0
   ============================================================ */

/* ── 1. CSS Variables (Theming) ── */
:root {
    /* Primary palette */
    --admin-primary: #2563eb;
    --admin-primary-hover: #1d4ed8;
    --admin-primary-light: #dbeafe;
    --admin-primary-dark: #1e40af;

    /* Neutral palette */
    --admin-bg: #f1f5f9;
    --admin-surface: #ffffff;
    --admin-border: #e2e8f0;
    --admin-border-dark: #cbd5e1;

    /* Sidebar */
    --admin-sidebar-bg: #0f172a;
    --admin-sidebar-text: #94a3b8;
    --admin-sidebar-hover: #1e293b;
    --admin-sidebar-active: #2563eb;
    --admin-sidebar-width: 260px;

    /* Header */
    --admin-header-bg: #ffffff;
    --admin-header-height: 60px;
    --admin-header-shadow: 0 1px 3px rgba(0,0,0,0.08);

    /* Text */
    --admin-text: #1e293b;
    --admin-text-secondary: #64748b;
    --admin-text-muted: #94a3b8;
    --admin-text-inverse: #ffffff;

    /* Status colors */
    --admin-success: #16a34a;
    --admin-success-light: #dcfce7;
    --admin-danger: #dc2626;
    --admin-danger-light: #fee2e2;
    --admin-warning: #d97706;
    --admin-warning-light: #fef3c7;
    --admin-info: #0284c7;
    --admin-info-light: #e0f2fe;

    /* Spacing scale */
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 20px;
    --sp-6: 24px;
    --sp-8: 32px;
    --sp-10: 40px;
    --sp-12: 48px;

    /* Border radius */
    --radius-sm: 4px;
    --radius: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 200ms ease;
    --transition-slow: 300ms ease;
}

/* ── 2. Reset / Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body, .ad-admin-body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--admin-text);
    background: var(--admin-bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--admin-primary); text-decoration: none; }
a:hover { color: var(--admin-primary-hover); text-decoration: underline; }

img { max-width: 100%; height: auto; }

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--admin-text);
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }

ul, ol { list-style: none; }

/* ── 3. Layout System ──
   Header and sidebar are position:fixed, so no CSS Grid needed.
   Main content uses margin-left/margin-top to offset from fixed elements.
   ── */
.ad-admin-body {
    min-height: 100vh;
}

/* No-sidebar layout (login, register, forgot password, etc.) */
.ad-no-sidebar .ad-sidebar,
.ad-no-sidebar .ad-sidebar-overlay {
    display: none !important;
}
/* No sidebar (logged out) → hide the hamburger toggle; it has nothing to toggle. */
.ad-no-sidebar .ad-sidebar-toggle {
    display: none !important;
}

/* ── 4. Custom Grid System ── */
/* Grid: negative-margin row + padded columns (same as Bootstrap approach).
   Outer edges of first/last columns align perfectly with content outside the row. */
.ad-row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -8px;
    margin-right: -8px;
}
.ad-row-dense { margin-left: -4px; margin-right: -4px; }
.ad-row-dense > [class*="ad-col"] { padding-left: 4px; padding-right: 4px; }
.ad-row-no-gap { margin-left: 0; margin-right: 0; }
.ad-row-no-gap > [class*="ad-col"] { padding-left: 0; padding-right: 0; }

/* All columns get horizontal padding to create gutters */
[class*="ad-col"] { padding-left: 8px; padding-right: 8px; min-width: 0; }

.ad-col { flex: 1; }
.ad-col-auto { flex: 0 0 auto; width: auto; }
/* Mobile-first: all columns stack full-width by default */
.ad-col-12 { flex: 0 0 100%; max-width: 100%; }
.ad-col-6 { flex: 0 0 100%; max-width: 100%; }
.ad-col-4 { flex: 0 0 100%; max-width: 100%; }
.ad-col-3 { flex: 0 0 100%; max-width: 100%; }
.ad-col-8 { flex: 0 0 100%; max-width: 100%; }
.ad-col-2 { flex: 0 0 100%; max-width: 100%; }
.ad-col-9 { flex: 0 0 100%; max-width: 100%; }
.ad-col-10 { flex: 0 0 100%; max-width: 100%; }

/* Small (576px+) */
@media (min-width: 576px) {
    .ad-col-sm-4 { flex: 0 0 33.333%; max-width: 33.333%; }
    .ad-col-sm-6 { flex: 0 0 50%; max-width: 50%; }
    .ad-col-sm-12 { flex: 0 0 100%; max-width: 100%; }
}

/* Tablet (768px+) */
@media (min-width: 768px) {
    .ad-col-md-1 { flex: 0 0 8.333%; max-width: 8.333%; }
    .ad-col-md-2 { flex: 0 0 16.666%; max-width: 16.666%; }
    .ad-col-md-3 { flex: 0 0 25%; max-width: 25%; }
    .ad-col-md-4 { flex: 0 0 33.333%; max-width: 33.333%; }
    .ad-col-md-5 { flex: 0 0 41.666%; max-width: 41.666%; }
    .ad-col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .ad-col-md-7 { flex: 0 0 58.333%; max-width: 58.333%; }
    .ad-col-md-8 { flex: 0 0 66.666%; max-width: 66.666%; }
    .ad-col-md-9 { flex: 0 0 75%; max-width: 75%; }
    .ad-col-md-10 { flex: 0 0 83.333%; max-width: 83.333%; }
    .ad-col-md-11 { flex: 0 0 91.666%; max-width: 91.666%; }
    .ad-col-md-12 { flex: 0 0 100%; max-width: 100%; }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    .ad-col-lg-1 { flex: 0 0 8.333%; max-width: 8.333%; }
    .ad-col-lg-2 { flex: 0 0 16.666%; max-width: 16.666%; }
    .ad-col-lg-3 { flex: 0 0 25%; max-width: 25%; }
    .ad-col-lg-4 { flex: 0 0 33.333%; max-width: 33.333%; }
    .ad-col-lg-5 { flex: 0 0 41.666%; max-width: 41.666%; }
    .ad-col-lg-6 { flex: 0 0 50%; max-width: 50%; }
    .ad-col-lg-7 { flex: 0 0 58.333%; max-width: 58.333%; }
    .ad-col-lg-8 { flex: 0 0 66.666%; max-width: 66.666%; }
    .ad-col-lg-9 { flex: 0 0 75%; max-width: 75%; }
    .ad-col-lg-10 { flex: 0 0 83.333%; max-width: 83.333%; }
    .ad-col-lg-11 { flex: 0 0 91.666%; max-width: 91.666%; }
    .ad-col-lg-12 { flex: 0 0 100%; max-width: 100%; }
}

/* Wide (1280px+) */
@media (min-width: 1280px) {
    .ad-col-xl-2 { flex: 0 0 calc(16.666% - 13px); max-width: calc(16.666% - 13px); }
    .ad-col-xl-3 { flex: 0 0 calc(25% - 12px); max-width: calc(25% - 12px); }
    .ad-col-xl-4 { flex: 0 0 calc(33.333% - 11px); max-width: calc(33.333% - 11px); }
    .ad-col-xl-6 { flex: 0 0 calc(50% - 8px); max-width: calc(50% - 8px); }
    .ad-col-xl-8 { flex: 0 0 calc(66.666% - 5px); max-width: calc(66.666% - 5px); }
    .ad-col-xl-12 { flex: 0 0 100%; max-width: 100%; }
}

/* ── 5. Typography ── */
.ad-page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--admin-text);
    margin-bottom: var(--sp-6);
}
.ad-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--admin-text);
    margin-bottom: var(--sp-4);
}
.ad-text-muted { color: var(--admin-text-muted); }
.ad-text-secondary { color: var(--admin-text-secondary); }
.ad-text-success { color: var(--admin-success); }
.ad-text-danger { color: var(--admin-danger); }
.ad-text-warning { color: var(--admin-warning); }
.ad-text-primary { color: var(--admin-primary); }

/* Inline status message (block + spacing). Pair with .ad-text-success /
   .ad-text-danger to color it per-outcome instead of a hard-coded ForeColor. */
.ad-msg { display: block; margin-bottom: 10px; font-weight: 500; }

/* ── 6. Forms ── */
.ad-form-group {
    margin-bottom: var(--sp-4);
}

.ad-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--admin-text, #1e293b);
    margin-bottom: var(--sp-1);
}

.ad-input,
.ad-select,
.ad-textarea,
input[type="text"].ad-input,
input[type="email"].ad-input,
input[type="password"].ad-input,
input[type="tel"].ad-input,
input[type="url"].ad-input,
input[type="number"].ad-input,
select.ad-select,
textarea.ad-textarea {
    display: block;
    width: 100%;
    padding: 9px 12px;
    font-size: 0.9375rem;
    font-family: inherit;
    line-height: 1.5;
    color: var(--admin-text);
    background: var(--admin-surface);
    border: 1px solid var(--admin-border-dark);
    border-radius: var(--radius);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
}

.ad-input:focus,
.ad-select:focus,
.ad-textarea:focus {
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px var(--admin-primary-light);
}

.ad-input::placeholder { color: var(--admin-text-muted); }

/* Protect ad-input from Bootstrap .input-group overrides — ensure border and radius are always applied */
.input-group .ad-input,
.form-group .ad-input,
.ad-form-group .ad-input {
    border: 1px solid var(--admin-border-dark) !important;
    border-radius: var(--radius) !important;
}
.input-group .ad-input:focus,
.form-group .ad-input:focus,
.ad-form-group .ad-input:focus {
    border-color: var(--admin-primary) !important;
    box-shadow: 0 0 0 3px var(--admin-primary-light) !important;
}

.ad-input.ad-input-error,
.ad-input-error {
    border-color: var(--admin-danger);
}
.ad-input-error:focus {
    box-shadow: 0 0 0 3px var(--admin-danger-light);
}

/* --- Custom dropdown (.ad-dropdown) — reusable styled select wrapper --- */
/* Usage: wrap a <select> with <div class="ad-dropdown"> or add class="ad-dropdown" to <select> directly.
   Wrapper approach gives the custom arrow; direct class gives base styling only. */
.ad-dropdown {
    position: relative;
    display: block;
    width: 100%;
}
.ad-dropdown select,
select.ad-dropdown {
    display: block;
    width: 100%;
    padding: 9px 36px 9px 12px;
    font-size: 0.9375rem;
    font-family: inherit;
    line-height: 1.5;
    color: var(--admin-text);
    background: var(--admin-surface);
    border: 1px solid var(--admin-border-dark);
    border-radius: var(--radius);
    outline: none;
    cursor: pointer;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    /* Remove default browser arrow */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    /* Custom chevron arrow via inline SVG */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 8px;
}
.ad-dropdown select:focus,
select.ad-dropdown:focus {
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px var(--admin-primary-light);
}
.ad-dropdown select:hover,
select.ad-dropdown:hover {
    border-color: var(--admin-border-dark);
}
.ad-dropdown select:focus:hover,
select.ad-dropdown:focus:hover {
    border-color: var(--admin-primary);
}
/* Disabled state */
.ad-dropdown select:disabled,
select.ad-dropdown:disabled {
    background: var(--admin-bg);
    color: var(--admin-text-muted);
    cursor: not-allowed;
    opacity: 0.7;
}
/* Size variants */
.ad-dropdown-sm select,
select.ad-dropdown.ad-dropdown-sm {
    padding: 5px 32px 5px 10px;
    font-size: 0.8125rem;
}
.ad-dropdown-lg select,
select.ad-dropdown.ad-dropdown-lg {
    padding: 12px 40px 12px 14px;
    font-size: 1rem;
}
/* Option styling (limited browser support, mainly Chromium) */
.ad-dropdown select option,
select.ad-dropdown option {
    padding: 8px 12px;
    color: var(--admin-text);
    background: var(--admin-surface);
}

/* Password field with eye toggle */
.ad-password-wrapper {
    position: relative;
    display: flex;
    align-items: stretch;
}
.ad-password-wrapper .ad-input {
    padding-right: 44px;
}
.ad-password-toggle {
    position: absolute;
    right: 1px;
    top: 1px;
    bottom: 1px;
    width: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-left: 1px solid var(--admin-border-dark);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--admin-text-muted);
    cursor: pointer;
    font-size: 1rem;
    transition: color var(--transition-fast), background var(--transition-fast);
    outline: none;
    padding: 0;
}
.ad-password-toggle:hover {
    color: var(--admin-primary);
    background: var(--admin-primary-light);
}
.ad-password-toggle:focus-visible {
    box-shadow: 0 0 0 2px var(--admin-primary-light);
}
.ad-password-toggle .fa-eye-slash { display: none; }
.ad-password-toggle.active .fa-eye { display: none; }
.ad-password-toggle.active .fa-eye-slash { display: inline; }

.ad-form-hint {
    font-size: 0.75rem;
    color: var(--admin-text-muted);
    margin-top: var(--sp-1);
}
.ad-form-error {
    font-size: 0.75rem;
    color: var(--admin-danger);
    margin-top: var(--sp-1);
}

/* ASP.NET validation styles */
.field-validation-error {
    color: var(--admin-danger);
    font-size: 0.8125rem;
    display: block;
    margin-top: var(--sp-1);
}
.validation-summary-errors ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.validation-summary-errors {
    color: var(--admin-danger);
    font-size: 0.875rem;
    background: var(--admin-danger-light);
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--radius);
    margin-bottom: var(--sp-4);
    border: 1px solid #fecaca;
}

.ad-checkbox-group,
.ad-radio-group {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    margin-bottom: var(--sp-2);
}

.ad-checkbox-group input[type="checkbox"],
.ad-radio-group input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--admin-primary);
    flex-shrink: 0;
}

/* ── ASP.NET CheckBox Custom Wrapper ──
   Hides the native ASP.NET CheckBox rendering (input + label)
   so the custom ad-checkbox-label > ad-checkbox-custom pattern takes over.
   Usage: set CssClass="ad-checkbox-wrap" on asp:CheckBox, then wrap with
   <label class="ad-checkbox-label"><asp:CheckBox .../><span class="ad-checkbox-custom"></span>Text</label> */
.ad-checkbox-wrap {
    display: inline-flex;
    align-items: center;
}
/* Hide the native checkbox input inside the ASP.NET wrapper */
.ad-checkbox-wrap input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
/* Hide the ASP.NET-generated label text (we provide our own outside) */
.ad-checkbox-wrap label {
    display: none;
}
/* Checked state — fill the custom checkbox visual when native input is checked */
.ad-checkbox-wrap input[type="checkbox"]:checked ~ .ad-checkbox-custom,
.ad-checkbox-label:has(.ad-checkbox-wrap input[type="checkbox"]:checked) .ad-checkbox-custom {
    background: var(--admin-primary, #2563eb);
    border-color: var(--admin-primary, #2563eb);
}
/* Checkmark on checked state */
.ad-checkbox-label:has(.ad-checkbox-wrap input[type="checkbox"]:checked) .ad-checkbox-custom::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
/* JS-driven checked state — 'checked' class added via jQuery for cross-browser support */
.ad-checkbox-custom.checked {
    background: var(--admin-primary, #2563eb) !important;
    border-color: var(--admin-primary, #2563eb) !important;
}
.ad-checkbox-custom.checked::after {
    content: '' !important;
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
/* Focus ring for keyboard navigation */
.ad-checkbox-wrap input[type="checkbox"]:focus ~ .ad-checkbox-custom,
.ad-checkbox-label:has(.ad-checkbox-wrap input[type="checkbox"]:focus) .ad-checkbox-custom {
    box-shadow: 0 0 0 3px var(--admin-primary-light, rgba(37,99,235,0.15));
}

/* ── ASP.NET RadioButtonList — Pill/Toggle Button Style ──
   Renders server-side RadioButtonList as horizontal pill buttons
   matching the btn-group[data-toggle="buttons"] pattern.
   Usage: wrap RadioButtonList in <div class="ad-radio-pills"> */
.ad-radio-pills {
    margin-bottom: var(--sp-2);
}
/* Override the generated table layout so items sit in a row */
.ad-radio-pills table {
    display: flex;
    gap: 0;
    border-collapse: separate;
}
.ad-radio-pills table tr {
    display: flex;
    gap: 0;
}
.ad-radio-pills table td {
    padding: 0;
    display: flex;
}
/* Hide the native radio input */
.ad-radio-pills input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
/* Style each label as a pill button */
.ad-radio-pills label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 18px;
    font-size: 0.875rem;
    font-weight: 500;
    background: var(--admin-surface);
    color: var(--admin-text);
    border: 1px solid var(--admin-border-dark);
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
    margin: 0;
    white-space: nowrap;
}
/* Round left corners on first pill, right corners on last */
.ad-radio-pills table td:first-child label {
    border-radius: var(--radius) 0 0 var(--radius);
}
.ad-radio-pills table td:last-child label {
    border-radius: 0 var(--radius) var(--radius) 0;
}
/* Collapse double borders between pills */
.ad-radio-pills table td + td label {
    border-left: 0;
}
/* Hover state */
.ad-radio-pills label:hover {
    background: var(--admin-bg);
    border-color: var(--admin-border-dark, #cbd5e1);
}
/* Checked/active state — filled primary blue */
.ad-radio-pills input[type="radio"]:checked + label,
.ad-radio-pills td:has(input[type="radio"]:checked) label {
    background: var(--admin-primary);
    color: var(--admin-text-inverse, #fff);
    border-color: var(--admin-primary);
}
.ad-radio-pills input[type="radio"]:checked + label:hover,
.ad-radio-pills td:has(input[type="radio"]:checked) label:hover {
    background: var(--admin-primary-hover, #1d4ed8);
    border-color: var(--admin-primary-hover, #1d4ed8);
}
/* JS-driven active state — 'active' class added to <td> via jQuery for cross-browser support */
.ad-radio-pills table td.active label {
    background: var(--admin-primary) !important;
    color: var(--admin-text-inverse, #fff) !important;
    border-color: var(--admin-primary) !important;
}
.ad-radio-pills table td.active label:hover {
    background: var(--admin-primary-hover, #1d4ed8) !important;
    border-color: var(--admin-primary-hover, #1d4ed8) !important;
}
/* Focus ring for keyboard navigation */
.ad-radio-pills input[type="radio"]:focus + label {
    box-shadow: 0 0 0 3px var(--admin-primary-light, rgba(37,99,235,0.15));
    z-index: 1;
    position: relative;
}

.ad-form-inline {
    display: flex;
    gap: var(--sp-3);
    align-items: flex-end;
    flex-wrap: wrap;
}

/* Form section (grouped fields with header) */
.ad-form-section {
    border: 1px solid var(--admin-border-dark);
    border-radius: var(--radius-lg);
    margin-bottom: var(--sp-5);
    overflow: hidden;
}
.ad-form-section-header {
    padding: var(--sp-4) var(--sp-5);
    background: var(--admin-bg);
    border-bottom: 1px solid var(--admin-border-dark);
    font-weight: 600;
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}
.ad-form-section-body {
    padding: var(--sp-5);
}

/* ── 7. Buttons ── */
.ad-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: 9px 18px;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    line-height: 1.4;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
}
.ad-btn:hover { text-decoration: none; }

.ad-btn-primary {
    background: var(--admin-primary);
    color: var(--admin-text-inverse);
    border-color: var(--admin-primary);
}
.ad-btn-primary:hover {
    background: var(--admin-primary-hover);
    border-color: var(--admin-primary-hover);
    color: var(--admin-text-inverse);
}

.ad-btn-secondary {
    background: var(--admin-surface);
    color: var(--admin-text);
    border-color: var(--admin-border-dark);
}
.ad-btn-secondary:hover {
    background: var(--admin-bg);
    border-color: var(--admin-border-dark);
}

.ad-btn-danger {
    background: var(--admin-danger);
    color: var(--admin-text-inverse);
    border-color: var(--admin-danger);
}
.ad-btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }

.ad-btn-success {
    background: var(--admin-success);
    color: var(--admin-text-inverse);
    border-color: var(--admin-success);
}
.ad-btn-success:hover { background: #15803d; border-color: #15803d; }

.ad-btn-warning {
    background: var(--admin-warning);
    color: var(--admin-text-inverse);
    border-color: var(--admin-warning);
}
.ad-btn-warning:hover { background: #b45309; border-color: #b45309; }

.ad-btn-ghost {
    background: transparent;
    color: var(--admin-text-secondary);
    border-color: transparent;
}
.ad-btn-ghost:hover {
    background: var(--admin-bg);
    color: var(--admin-text);
}

.ad-btn-link {
    background: transparent;
    color: var(--admin-primary);
    border: none;
    padding: 0;
    font-weight: 400;
}
.ad-btn-link:hover { text-decoration: underline; }

.ad-btn-sm { padding: 5px 12px; font-size: 0.8125rem; }
.ad-btn-lg { padding: 12px 24px; font-size: 1rem; }
.ad-btn-block { width: 100%; }

.ad-btn:disabled, .ad-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.ad-btn-group {
    display: flex;
    gap: var(--sp-2);
    flex-wrap: wrap;
}

/* ── 8. Cards ── */
.ad-card {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border-dark);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.ad-card-header {
    padding: var(--sp-4) var(--sp-5);
    border-bottom: 1px solid var(--admin-border-dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.ad-card-header h3 { margin: 0; }
.ad-card-body { padding: var(--sp-5); }
.ad-card-footer {
    padding: var(--sp-4) var(--sp-5);
    border-top: 1px solid var(--admin-border-dark);
    background: var(--admin-bg);
}

/* Stat cards */
.ad-stat-card {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border-dark);
    border-radius: var(--radius-lg);
    padding: var(--sp-5);
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    box-shadow: var(--shadow-sm);
}
.ad-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.ad-stat-icon.primary { background: var(--admin-primary-light); color: var(--admin-primary); }
.ad-stat-icon.success { background: var(--admin-success-light); color: var(--admin-success); }
.ad-stat-icon.warning { background: var(--admin-warning-light); color: var(--admin-warning); }
.ad-stat-icon.danger { background: var(--admin-danger-light); color: var(--admin-danger); }
.ad-stat-icon.info { background: var(--admin-info-light); color: var(--admin-info); }
.ad-stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1.2; color: var(--admin-text); }
.ad-stat-label { font-size: 0.8125rem; color: var(--admin-text-secondary); }

/* Dashboard Welcome */
.ad-dashboard-welcome {
    margin-bottom: var(--sp-6);
}
.ad-dashboard-welcome h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--sp-1);
}
.ad-dashboard-welcome p {
    color: var(--admin-text-secondary);
    font-size: 0.9375rem;
    margin: 0;
}

/* Quick Actions Grid */
.ad-quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-3);
}
.ad-quick-action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-4) var(--sp-3);
    border-radius: var(--radius-lg);
    border: 1px solid var(--admin-border-dark);
    background: var(--admin-bg);
    color: var(--admin-text);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    text-align: center;
    transition: all var(--transition-fast);
}
.ad-quick-action-item:hover {
    border-color: var(--admin-primary);
    background: var(--admin-primary-light);
    color: var(--admin-primary);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.ad-quick-action-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: var(--admin-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    color: var(--admin-primary);
    box-shadow: var(--shadow-sm);
}
.ad-quick-action-item:hover .ad-quick-action-icon {
    background: var(--admin-primary);
    color: var(--admin-text-inverse);
}

/* Dashboard Overview — Content Manager (Option B).
   The Content Manager dashboard is trimmed to the Blog Posts card and the
   "New Blog Post" quick action. The .cm-compact hook (added in code-behind on
   the dashboard grid wrapper for that role) lays those two cards out in a focused
   single column aligned to the LEFT. Fully responsive: full width on phones,
   capped on tablets, laptops and large desktops. Other roles are unaffected. */
.cm-compact .ad-row {
    justify-content: flex-start;
}
.cm-compact .ad-row > [class*="ad-col"] {
    flex: 0 0 100%;
    width: 100%;
    max-width: 480px;       /* focused column width on larger screens */
    margin-left: 0;         /* align to the left edge instead of centering */
    margin-right: auto;
}
/* Lone "New Blog Post" tile fills the card width instead of a half cell. */
.cm-compact .ad-quick-actions {
    grid-template-columns: 1fr;
}
/* Phones / small tablets: use the full available width so nothing looks cramped. */
@media (max-width: 575.98px) {
    .cm-compact .ad-row > [class*="ad-col"] { max-width: 100%; }
}
/* Large desktops / ultrawide: allow a slightly roomier focused column. */
@media (min-width: 1400px) {
    .cm-compact .ad-row > [class*="ad-col"] { max-width: 520px; }
}

/* Notification / Activity List */
.ad-notification-list {
    display: flex;
    flex-direction: column;
}
.ad-notification-item {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    border-bottom: 1px solid var(--admin-border-dark);
}
.ad-notification-item:last-child {
    border-bottom: none;
}
.ad-notification-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--admin-primary-light);
    color: var(--admin-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    flex-shrink: 0;
    margin-top: 2px;
}
.ad-notification-content {
    flex: 1;
    min-width: 0;
}
.ad-notification-title {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--admin-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ad-notification-meta {
    font-size: 0.75rem;
    color: var(--admin-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── 9. Tables ── */
.ad-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* DataTables single-table horizontal scroll (Option A).
   admin-common.js wraps ONLY the <table> node in this div on init.dt, so the
   table scrolls sideways while DataTables' pagination / search / info / length
   controls (siblings outside this div) stay fixed in view. One table = thead and
   tbody columns are always aligned by the browser; no scrollX two-table drift. */
.ad-dt-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}
/* Let the table grow to its natural content width inside the scroll box so
   horizontal scroll actually engages when columns exceed the viewport. */
.ad-dt-scroll > table.dataTable {
    width: 100% !important;
}

.ad-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.ad-table th {
    text-align: left;
    padding: var(--sp-3) var(--sp-4);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--admin-text-secondary);
    background: var(--admin-bg);
    border-bottom: 2px solid var(--admin-border-dark);
    white-space: nowrap;
}

.ad-table td {
    padding: var(--sp-3) var(--sp-4);
    border-bottom: 1px solid var(--admin-border-dark);
    vertical-align: middle;
}

.ad-table-striped tbody tr:nth-child(even) {
    background: #f8fafc;
}

.ad-table-hover tbody tr:hover {
    background: var(--admin-primary-light);
}

/* Compact table variant */
.ad-table-compact th,
.ad-table-compact td {
    padding: var(--sp-2) var(--sp-3);
    font-size: 0.8125rem;
}

/* ── 10. Tabs ── */
.ad-tabs {
    border-bottom: 2px solid var(--admin-border-dark);
    display: flex;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.ad-tab-item {
    padding: var(--sp-3) var(--sp-5);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--admin-text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    white-space: nowrap;
    background: none;
    border-left: none;
    border-right: none;
    border-top: none;
    font-family: inherit;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}
.ad-tab-item:hover { color: var(--admin-text); }
.ad-tab-item.active {
    color: var(--admin-primary);
    font-weight: 600;
    border-bottom-color: var(--admin-primary);
    background: var(--admin-primary-light);
    border-radius: var(--radius) var(--radius) 0 0;
}

.ad-tab-panel {
    display: none;
    padding: var(--sp-5) 0;
}
.ad-tab-panel.active { display: block; }

/* Vehicle Edit page — tab nav spacing + sticky save bar at bottom of each tab */
.ad-vehicle-edit-tabs {
    margin: 16px 0 0;
}
.ad-vehicle-edit-panel {
    padding-bottom: 0px;
}
.ad-vehicle-edit-actions {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--admin-surface);
    border-top: 1px solid var(--admin-border-dark);
    padding: 12px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
    z-index: 50;
    margin-top: 16px;
}
.ad-vehicle-edit-actions .ad-btn-secondary { margin-right: auto; }

/* ── 11. Modal ── */
.ad-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: var(--sp-4);
}
.ad-modal-overlay.active { display: flex; }

.ad-modal {
    background: var(--admin-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}
.ad-modal-lg { max-width: 800px; }
.ad-modal-sm { max-width: 360px; }

.ad-modal-header {
    padding: var(--sp-5);
    border-bottom: 1px solid var(--admin-border-dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.ad-modal-header h3 { margin: 0; }
.ad-modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--admin-text-muted);
    cursor: pointer;
    padding: var(--sp-1);
    line-height: 1;
}
.ad-modal-close:hover { color: var(--admin-text); }
.ad-modal-body { padding: var(--sp-5); }
.ad-modal-footer {
    padding: var(--sp-4) var(--sp-5);
    border-top: 1px solid var(--admin-border-dark);
    display: flex;
    gap: var(--sp-2);
    justify-content: flex-end;
}

/* ── 12. Sidebar ── */
.ad-sidebar {
    background: var(--admin-sidebar-bg);
    width: var(--admin-sidebar-width);
    height: calc(100vh - var(--admin-header-height));
    position: fixed;
    top: var(--admin-header-height);
    left: 0;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
    transition: transform var(--transition-slow);
}

.ad-sidebar::-webkit-scrollbar { width: 4px; }
.ad-sidebar::-webkit-scrollbar-track { background: transparent; }
.ad-sidebar::-webkit-scrollbar-thumb { background: var(--admin-sidebar-hover); border-radius: 4px; }

.ad-sidebar-nav { padding: var(--sp-3) 0; }

/* ── Sidebar Menu Search (client-side filter) ── */
.ad-sidebar-search {
    position: sticky;          /* stays visible while the menu list scrolls */
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    margin: 0 var(--sp-4) var(--sp-3);
    padding: var(--sp-2) var(--sp-3);
    background: var(--admin-sidebar-hover);
    border-radius: var(--radius);
}
.ad-sidebar-search-icon {
    font-size: 0.8125rem;
    color: var(--admin-sidebar-text);
    opacity: 0.7;
    flex-shrink: 0;
}
.ad-sidebar-search-input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    outline: none;
    color: var(--admin-text-inverse);
    font-size: 0.875rem;
}
.ad-sidebar-search-input::placeholder { color: var(--admin-sidebar-text); opacity: 0.7; }
.ad-sidebar-search-clear {
    display: none;             /* JS adds .is-visible only when input has text */
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--admin-sidebar-text);
    opacity: 0.7;
    flex-shrink: 0;
}
.ad-sidebar-search-clear:hover { opacity: 1; color: var(--admin-text-inverse); }
.ad-sidebar-search-clear.is-visible { display: inline-flex; }
.ad-sidebar-no-results {
    padding: var(--sp-3) var(--sp-5);
    color: var(--admin-sidebar-text);
    font-size: 0.8125rem;
    font-style: italic;
}

.ad-sidebar-group { margin-bottom: var(--sp-1); }

.ad-sidebar-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: var(--sp-3) var(--sp-5);
    background: none;
    border: none;
    color: var(--admin-sidebar-text);
    font-size: 0.6875rem;
    font-weight: 600;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: color var(--transition-fast);
}
.ad-sidebar-group-toggle:hover { color: var(--admin-text-inverse); }
.ad-sidebar-group-toggle .fa { font-size: 0.625rem; transition: transform var(--transition-fast); }
.ad-sidebar-group.open .ad-sidebar-group-toggle .fa { transform: rotate(180deg); }

.ad-sidebar-group-items {
    list-style: none;
    max-height: 0;          /* closed state (structural) */
    overflow: hidden;       /* clips content while collapsed */
    padding: 0;
    margin: 0;
    /* NOTE: the open/close ANIMATION is owned entirely by admin-common.js
       (it sets an inline `transition` + an exact `max-height` = scrollHeight).
       No `transition` is declared here on purpose so CSS and JS never both
       animate the same property. */
}
/* Static initial-render / no-JS state only — NOT animated (no transition above).
   JS overrides this inline with the group's real scrollHeight at runtime. Kept
   so the hardcoded-open group paints expanded before JS runs (avoids a flash). */
.ad-sidebar-group.open .ad-sidebar-group-items {
    max-height: 1200px;
}

.ad-sidebar-group-items li { list-style: none; }

.ad-sidebar-group-items a {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-2) var(--sp-5) var(--sp-2) var(--sp-8);
    color: var(--admin-sidebar-text);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
    text-decoration: none;
    border-left: 3px solid transparent;
}
.ad-sidebar-group-items a:hover {
    color: var(--admin-text-inverse);
    background: var(--admin-sidebar-hover);
    text-decoration: none;
}
.ad-sidebar-group-items a.active {
    color: var(--admin-text-inverse);
    background: var(--admin-sidebar-hover);
    border-left-color: var(--admin-sidebar-active);
}
.ad-sidebar-group-items a .fa { width: 18px; text-align: center; font-size: 0.8125rem; }

/* Mobile sidebar */
@media (max-width: 1023px) {
    .ad-sidebar {
        transform: translateX(-100%);
        z-index: 200;
    }
    .ad-sidebar.open {
        transform: translateX(0);
    }
}

.ad-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 150;
}
.ad-sidebar-overlay.active { display: block; }

/* ── 13. Admin Header ── */
.ad-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--admin-header-height);
    background: var(--admin-header-bg);
    box-shadow: var(--admin-header-shadow);
    z-index: 300;
    display: flex;
    align-items: center;
}

.ad-header-inner {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0 var(--sp-4);
    gap: var(--sp-4);
}

.ad-sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--admin-text-secondary);
    cursor: pointer;
    padding: var(--sp-2);
}
@media (max-width: 1023px) {
    .ad-sidebar-toggle { display: flex; }
}

.ad-header-logo {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    font-weight: 600;
    font-size: 1.0625rem;
    color: var(--admin-text);
    text-decoration: none;
    flex-shrink: 0;
}
.ad-header-logo img { height: 42px; width: auto; }
.ad-header-logo span {
    color: var(--admin-text-secondary);
    font-weight: 400;
    font-size: 0.875rem;
    padding-left: var(--sp-2);
    border-left: 1px solid var(--admin-border-dark);
}

.ad-header-spacer { flex: 1; }

.ad-header-user {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    font-size: 0.875rem;
}
.ad-header-user-name { color: var(--admin-text-secondary); }

@media (max-width: 480px) {
    .ad-header-user-name { display: none; }
}

/* ── 14. Alerts / Notifications ── */
.ad-alert {
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: var(--sp-4);
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
}
.ad-alert-success { background: var(--admin-success-light); color: #15803d; border: 1px solid #bbf7d0; }
.ad-alert-danger { background: var(--admin-danger-light); color: #b91c1c; border: 1px solid #fecaca; }
.ad-alert-warning { background: var(--admin-warning-light); color: #92400e; border: 1px solid #fde68a; }
.ad-alert-info { background: var(--admin-info-light); color: #075985; border: 1px solid #bae6fd; }

/* ── 15. Dropdowns ── */
.ad-dropdown {
    position: relative;
    display: inline-block;
}
.ad-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 180px;
    background: var(--admin-surface);
    border: 1px solid var(--admin-border-dark);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 500;
    padding: var(--sp-1) 0;
}
.ad-dropdown.open .ad-dropdown-menu { display: block; }
.ad-dropdown-item {
    display: block;
    padding: var(--sp-2) var(--sp-4);
    color: var(--admin-text);
    font-size: 0.875rem;
    text-decoration: none;
    transition: background var(--transition-fast);
}
.ad-dropdown-item:hover {
    background: var(--admin-bg);
    text-decoration: none;
    color: var(--admin-text);
}
.ad-dropdown-divider {
    border-top: 1px solid var(--admin-border-dark);
    margin: var(--sp-1) 0;
}

/* ── 16. Utilities ── */
.ad-hidden { display: none !important; }
.ad-sr-only { position: absolute; width: 1px; height: 1px; clip: rect(0,0,0,0); overflow: hidden; }

.ad-text-center { text-align: center; }
.ad-text-right { text-align: right; }
.ad-text-left { text-align: left; }

.ad-d-flex { display: flex; }
.ad-d-block { display: block; }
.ad-d-inline { display: inline; }
.ad-d-inline-block { display: inline-block; }
.ad-d-none { display: none; }

.ad-flex-wrap { flex-wrap: wrap; }
.ad-flex-column { flex-direction: column; }
.ad-items-center { align-items: center; }
.ad-items-start { align-items: flex-start; }
.ad-items-end { align-items: flex-end; }
.ad-justify-between { justify-content: space-between; }
.ad-justify-center { justify-content: center; }
.ad-justify-end { justify-content: flex-end; }
.ad-gap-1 { gap: var(--sp-1); }
.ad-gap-2 { gap: var(--sp-2); }
.ad-gap-3 { gap: var(--sp-3); }
.ad-gap-4 { gap: var(--sp-4); }
.ad-gap-6 { gap: var(--sp-6); }

.ad-mt-0 { margin-top: 0; }
.ad-mt-1 { margin-top: var(--sp-1); }
.ad-mt-2 { margin-top: var(--sp-2); }
.ad-mt-3 { margin-top: var(--sp-3); }
.ad-mt-4 { margin-top: var(--sp-4); }
.ad-mt-5 { margin-top: var(--sp-5); }
.ad-mt-6 { margin-top: var(--sp-6); }
.ad-mt-8 { margin-top: var(--sp-8); }

.ad-mb-0 { margin-bottom: 0; }
.ad-mb-1 { margin-bottom: var(--sp-1); }
.ad-mb-2 { margin-bottom: var(--sp-2); }
.ad-mb-3 { margin-bottom: var(--sp-3); }
.ad-mb-4 { margin-bottom: var(--sp-4); }
.ad-mb-5 { margin-bottom: var(--sp-5); }
.ad-mb-6 { margin-bottom: var(--sp-6); }
.ad-mb-8 { margin-bottom: var(--sp-8); }

.ad-mr-1 { margin-right: var(--sp-1); }
.ad-mr-2 { margin-right: var(--sp-2); }
.ad-mr-3 { margin-right: var(--sp-3); }
.ad-ml-auto { margin-left: auto; }
.ad-mr-auto { margin-right: auto; }

.ad-p-0 { padding: 0; }
.ad-p-2 { padding: var(--sp-2); }
.ad-p-3 { padding: var(--sp-3); }
.ad-p-4 { padding: var(--sp-4); }
.ad-p-5 { padding: var(--sp-5); }
.ad-p-6 { padding: var(--sp-6); }

.ad-px-4 { padding-left: var(--sp-4); padding-right: var(--sp-4); }
.ad-py-2 { padding-top: var(--sp-2); padding-bottom: var(--sp-2); }
.ad-py-4 { padding-top: var(--sp-4); padding-bottom: var(--sp-4); }

.ad-w-100 { width: 100%; }
.ad-w-auto { width: auto; }
.ad-rounded { border-radius: var(--radius); }
.ad-border { border: 1px solid var(--admin-border-dark); }
.ad-border-top { border-top: 1px solid var(--admin-border-dark); }
.ad-border-bottom { border-bottom: 1px solid var(--admin-border-dark); }

.ad-overflow-hidden { overflow: hidden; }
.ad-overflow-auto { overflow: auto; }

.ad-float-right { float: right; }
.ad-float-left { float: left; }
.ad-clearfix::after { content: ""; display: table; clear: both; }

/* Responsive visibility */
@media (max-width: 767px) {
    .ad-hidden-mobile { display: none !important; }
}
@media (min-width: 768px) and (max-width: 1023px) {
    .ad-hidden-tablet { display: none !important; }
}
@media (min-width: 1024px) {
    .ad-hidden-desktop { display: none !important; }
}
@media (max-width: 1023px) {
    .ad-hidden-below-desktop { display: none !important; }
}
@media (min-width: 768px) {
    .ad-hidden-above-mobile { display: none !important; }
}

/* ── 17. Page-Specific: Auth Pages ── */
.ad-auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--admin-header-height));
    background: var(--admin-bg);
    padding: var(--sp-6);
}

.ad-auth-card {
    background: var(--admin-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 440px;
    padding: var(--sp-8) var(--sp-6);
    box-sizing: border-box;
}
.ad-auth-card-wide { max-width: 560px; }

.ad-auth-logo {
    text-align: center;
    margin-bottom: var(--sp-6);
}
.ad-auth-logo img { height: 40px; }
.ad-auth-logo h2 { margin-top: var(--sp-3); font-size: 1.375rem; }
.ad-auth-logo p {
    color: var(--admin-text-secondary);
    font-size: 0.875rem;
    margin-top: var(--sp-1);
}

.ad-auth-footer {
    text-align: center;
    margin-top: var(--sp-5);
    font-size: 0.875rem;
    color: var(--admin-text-secondary);
}

/* ── 17c. Page-Specific: Auth — OR divider ──
   Centered "OR" label with horizontal rules on each side. Used between the
   primary credential form and alternative sign-in methods (social login). */
.ad-or-divider {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin: var(--sp-5) 0;
    color: var(--admin-text-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.ad-or-divider::before,
.ad-or-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--admin-border-dark);
}

/* ── 17b. Page-Specific: Breadcrumb ── */
.ad-breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: 0.8125rem;
    color: var(--admin-text-muted);
    margin-bottom: var(--sp-5);
    flex-wrap: wrap;
}
.ad-breadcrumb a {
    color: var(--admin-text-secondary);
    text-decoration: none;
}
.ad-breadcrumb a:hover { color: var(--admin-primary); text-decoration: none; }
.ad-breadcrumb .separator { color: var(--admin-border-dark); }

/* ── 17c. Badges ── */
.ad-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.ad-badge-success { background: var(--admin-success-light); color: var(--admin-success); }
.ad-badge-warning { background: var(--admin-warning-light); color: var(--admin-warning); }
.ad-badge-danger { background: var(--admin-danger-light); color: var(--admin-danger); }
.ad-badge-info { background: var(--admin-info-light); color: var(--admin-info); }
.ad-badge-neutral { background: #f1f5f9; color: var(--admin-text-secondary); }
.ad-badge-primary { background: var(--admin-primary-light); color: var(--admin-primary); }

/* ── 17d. Accordion (for existing admin pages with collapsible sections) ── */
.ad-accordion { border: 1px solid var(--admin-border-dark); border-radius: var(--radius-lg); overflow: hidden; }
.ad-accordion-item { border-bottom: 1px solid var(--admin-border-dark); }
.ad-accordion-item:last-child { border-bottom: none; }
.ad-accordion-header {
    padding: var(--sp-4) var(--sp-5);
    background: var(--admin-bg);
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.ad-accordion-body { padding: var(--sp-5); display: none; }
.ad-accordion-item.open .ad-accordion-body { display: block; }

/* ── 17e. Progress bar ── */
.ad-progress {
    height: 8px;
    background: var(--admin-border-dark);
    border-radius: 9999px;
    overflow: hidden;
}
.ad-progress-bar {
    height: 100%;
    background: var(--admin-primary);
    border-radius: 9999px;
    transition: width var(--transition-slow);
}

/* ── 18. Main Content Area ── */
.ad-main {
    padding: var(--sp-6);
    margin-top: var(--admin-header-height);
    margin-left: var(--admin-sidebar-width);
    min-height: calc(100vh - var(--admin-header-height));
}

@media (max-width: 1023px) {
    .ad-main {
        padding: var(--sp-4);
        margin-left: 0;
    }
}

/* No-sidebar: full-width main */
.ad-no-sidebar .ad-main {
    margin-left: 0;
    margin-top: 0;
}

/* ── 19. Responsive Fine-tuning ── */
@media (max-width: 480px) {
    .ad-card-body { padding: var(--sp-4); }
    .ad-page-title { font-size: 1.25rem; }
    .ad-auth-card { padding: var(--sp-6) var(--sp-4); }
    .ad-form-section-body { padding: var(--sp-4); }
    .ad-form-section-header { padding: var(--sp-3) var(--sp-4); }
}

/* ── 20. Print styles ── */
@media print {
    .ad-sidebar,
    .ad-header,
    .ad-sidebar-overlay,
    .ad-sidebar-toggle {
        display: none !important;
    }
    .ad-main {
        margin-left: 0 !important;
        margin-top: 0 !important;
        padding: 0 !important;
    }
    .ad-admin-body {
        display: block;
    }
}

/* ============================================================
   21. Bootstrap Compatibility Layer
   Maps common Bootstrap 3 class names to admin CSS equivalents.
   This ensures existing admin pages work without renaming every class.
   Over time, pages should migrate to ad-* classes and this section
   can be removed.
   ============================================================ */

/* --- Grid --- */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--sp-4); box-sizing: border-box; }
.container-fluid { width: 100%; padding: 0 var(--sp-4); box-sizing: border-box; }
.row { display: flex; flex-wrap: wrap; margin-left: -8px; margin-right: -8px; }
[class*="col-"] { box-sizing: border-box; padding: 0 8px; min-height: 1px; width: 100%; }

/* xs columns (always apply) */
.col-xs-1 { width: 8.333%; } .col-xs-2 { width: 16.667%; } .col-xs-3 { width: 25%; }
.col-xs-4 { width: 33.333%; } .col-xs-5 { width: 41.667%; } .col-xs-6 { width: 50%; }
.col-xs-7 { width: 58.333%; } .col-xs-8 { width: 66.667%; } .col-xs-9 { width: 75%; }
.col-xs-10 { width: 83.333%; } .col-xs-11 { width: 91.667%; } .col-xs-12 { width: 100%; }

/* sm columns (≥576px) */
@media (min-width: 576px) {
    .col-sm-1 { width: 8.333%; } .col-sm-2 { width: 16.667%; } .col-sm-3 { width: 25%; }
    .col-sm-4 { width: 33.333%; } .col-sm-5 { width: 41.667%; } .col-sm-6 { width: 50%; }
    .col-sm-7 { width: 58.333%; } .col-sm-8 { width: 66.667%; } .col-sm-9 { width: 75%; }
    .col-sm-10 { width: 83.333%; } .col-sm-11 { width: 91.667%; } .col-sm-12 { width: 100%; }
}

/* md columns (≥768px) */
@media (min-width: 768px) {
    .col-md-1 { width: 8.333%; } .col-md-2 { width: 16.667%; } .col-md-3 { width: 25%; }
    .col-md-4 { width: 33.333%; } .col-md-5 { width: 41.667%; } .col-md-6 { width: 50%; }
    .col-md-7 { width: 58.333%; } .col-md-8 { width: 66.667%; } .col-md-9 { width: 75%; }
    .col-md-10 { width: 83.333%; } .col-md-11 { width: 91.667%; } .col-md-12 { width: 100%; }
}

/* lg columns (≥1024px) */
@media (min-width: 1024px) {
    .col-lg-1 { width: 8.333%; } .col-lg-2 { width: 16.667%; } .col-lg-3 { width: 25%; }
    .col-lg-4 { width: 33.333%; } .col-lg-5 { width: 41.667%; } .col-lg-6 { width: 50%; }
    .col-lg-7 { width: 58.333%; } .col-lg-8 { width: 66.667%; } .col-lg-9 { width: 75%; }
    .col-lg-10 { width: 83.333%; } .col-lg-11 { width: 91.667%; } .col-lg-12 { width: 100%; }
}

/* --- Column offsets --- */
.col-xs-offset-1 { margin-left: 8.333%; } .col-xs-offset-2 { margin-left: 16.667%; } .col-xs-offset-3 { margin-left: 25%; }
.col-xs-offset-4 { margin-left: 33.333%; } .col-xs-offset-6 { margin-left: 50%; }
@media (min-width: 576px) {
    .col-sm-offset-1 { margin-left: 8.333%; } .col-sm-offset-2 { margin-left: 16.667%; } .col-sm-offset-3 { margin-left: 25%; }
    .col-sm-offset-4 { margin-left: 33.333%; } .col-sm-offset-6 { margin-left: 50%; }
}
@media (min-width: 768px) {
    .col-md-offset-0 { margin-left: 0; } .col-md-offset-1 { margin-left: 8.333%; } .col-md-offset-2 { margin-left: 16.667%; }
    .col-md-offset-3 { margin-left: 25%; } .col-md-offset-4 { margin-left: 33.333%; } .col-md-offset-5 { margin-left: 41.667%; }
    .col-md-offset-6 { margin-left: 50%; }
}
@media (min-width: 1024px) {
    .col-lg-offset-0 { margin-left: 0; } .col-lg-offset-1 { margin-left: 8.333%; } .col-lg-offset-2 { margin-left: 16.667%; }
    .col-lg-offset-3 { margin-left: 25%; } .col-lg-offset-4 { margin-left: 33.333%; }
}

/* --- Forms --- */
.form-group { margin-bottom: var(--sp-4); }
.form-control {
    display: block; width: 100%; padding: 8px 12px;
    font-size: 14px; line-height: 1.5; color: var(--admin-text);
    background: var(--admin-surface); border: 1px solid var(--admin-border-dark);
    border-radius: var(--radius); transition: border-color 0.15s;
    box-sizing: border-box;
}
.form-control:focus { outline: none; border-color: var(--admin-primary); box-shadow: 0 0 0 3px var(--admin-primary-light); }
.form-horizontal { } /* no-op, forms already stack */
.control-label { display: block; margin-bottom: 4px; font-weight: 600; font-size: 14px; color: var(--admin-text); }
.input-group { display: flex; align-items: stretch; }
.input-group .form-control { flex: 1; border-radius: 0; }
.input-group-addon {
    display: flex; align-items: center; padding: 6px 12px;
    font-size: 14px; color: var(--admin-text-secondary);
    background: var(--admin-bg); border: 1px solid var(--admin-border-dark);
    white-space: nowrap;
}
.input-group > :first-child, .input-group-addon:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.input-group > :last-child, .input-group-addon:last-child { border-radius: 0 var(--radius) var(--radius) 0; border-left: 0; }
.input-group-addon + .form-control { border-left: 0; }
.form-control + .input-group-addon { border-left: 0; }
.input-group-btn { position: relative; display: flex; align-items: stretch; }
.input-group-btn .btn { border-radius: 0; }
.input-group > .input-group-btn:first-child .btn { border-radius: var(--radius) 0 0 var(--radius); }
.input-group > .input-group-btn:last-child .btn { border-radius: 0 var(--radius) var(--radius) 0; }
.form-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.checkbox { margin-bottom: var(--sp-2); }
.checkbox label, .radio label { font-weight: normal; cursor: pointer; }
.radio-inline { display: inline-block; padding-left: 20px; margin-right: 10px; font-weight: normal; cursor: pointer; }
.form-check { margin-bottom: var(--sp-2); }
.form-check-input { margin-right: var(--sp-2); }

/* --- Buttons --- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 8px 16px; font-size: 14px; font-weight: 500;
    border: 1px solid var(--admin-border-dark); border-radius: var(--radius);
    cursor: pointer; transition: all 0.15s; text-decoration: none;
    background: var(--admin-surface); color: var(--admin-text);
    line-height: 1.5; white-space: nowrap;
}
.btn:hover { background: var(--admin-bg); }
.btn-primary { background: var(--admin-primary); color: #fff; border-color: var(--admin-primary); }
.btn-primary:hover { background: var(--admin-primary-hover); border-color: var(--admin-primary-hover); }
.btn-default { background: var(--admin-surface); color: var(--admin-text); border-color: var(--admin-border-dark); }
.btn-default:hover { background: var(--admin-bg); }
.btn-default.active { background: #e6e6e6; border-color: #adadad; }
.btn-danger { background: var(--admin-danger); color: #fff; border-color: var(--admin-danger); }
.btn-danger:hover { opacity: 0.9; }
.btn-success { background: var(--admin-success); color: #fff; border-color: var(--admin-success); }
.btn-success:hover { opacity: 0.9; }
.btn-warning { background: var(--admin-warning); color: #fff; border-color: var(--admin-warning); }
.btn-warning:hover { opacity: 0.9; }
.btn-info { background: var(--admin-info); color: #fff; border-color: var(--admin-info); }
.btn-info:hover { opacity: 0.9; }
.btn-link { background: none; border: none; color: var(--admin-primary); padding: 4px 8px; }
.btn-link:hover { text-decoration: underline; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }
.btn-block { display: block; width: 100%; }
.btn-group { display: inline-flex; }
.btn-group > .btn { border-radius: 0; margin-left: -1px; }
.btn-group > .btn:first-child { border-radius: var(--radius) 0 0 var(--radius); margin-left: 0; }
.btn-group > .btn:last-child { border-radius: 0 var(--radius) var(--radius) 0; }

/* --- Toggle button group (data-toggle="buttons") — hides radio/checkbox inputs, styles labels as buttons --- */
.btn-group[data-toggle="buttons"] > .btn > input[type="radio"],
.btn-group[data-toggle="buttons"] > .btn > input[type="checkbox"] {
    position: absolute; clip: rect(0,0,0,0); pointer-events: none;
}
.btn-group[data-toggle="buttons"] > .btn {
    cursor: pointer; user-select: none;
    padding: 7px 16px; font-size: 0.875rem; font-weight: 500;
    background: var(--admin-surface); color: var(--admin-text); border: 1px solid var(--admin-border-dark);
    transition: all var(--transition-fast);
}
.btn-group[data-toggle="buttons"] > .btn:hover {
    background: var(--admin-bg); border-color: var(--admin-border-dark);
}
.btn-group[data-toggle="buttons"] > .btn.active {
    background: var(--admin-primary); color: var(--admin-text-inverse); border-color: var(--admin-primary);
}
.btn-group[data-toggle="buttons"] > .btn.active:hover {
    background: var(--admin-primary-hover); border-color: var(--admin-primary-hover);
}

/* --- Collapse utility --- */
.collapse { display: none; }
.collapse.in { display: block; }

/* --- Tables --- */
.table { width: 100%; border-collapse: collapse; margin-bottom: var(--sp-4); }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--admin-border-dark); font-size: 14px; }
.table th { font-weight: 600; background: var(--admin-bg); color: var(--admin-text); }
.table-striped tbody tr:nth-child(odd) { background: var(--admin-bg); }
.table-bordered, .table-bordered th, .table-bordered td { border: 1px solid var(--admin-border-dark); }
.table-hover tbody tr:hover { background: var(--admin-primary-light); }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* --- Tabs (Bootstrap nav-tabs) --- */
.nav-tabs {
    display: flex; flex-wrap: wrap; list-style: none; padding: 0; margin: 0;
    border-bottom: 2px solid var(--admin-border-dark); gap: 0;
}
.nav-tabs > li { margin-bottom: -2px; }
.nav-tabs > li > a {
    display: block; padding: 10px 18px; color: var(--admin-text-secondary);
    text-decoration: none; border: 2px solid transparent;
    border-bottom: none; border-radius: var(--radius) var(--radius) 0 0;
    transition: color 0.15s, border-color 0.15s; cursor: pointer;
    font-size: 14px; font-weight: 500;
}
.nav-tabs > li > a:hover { color: var(--admin-primary); background: var(--admin-primary-light); }
.nav-tabs > li.active > a,
.nav-tabs > li > a[aria-selected="true"] {
    color: var(--admin-primary); border-color: var(--admin-primary);
    border-bottom: 2px solid var(--admin-surface); background: var(--admin-surface);
}
.tab-content { padding: var(--sp-4) 0; }
.tab-content > .tab-pane { display: none; }
.tab-content > .tab-pane.active { display: block; }
.tab-content > .tab-pane.in { display: block; }
.fade { opacity: 1; transition: opacity 0.15s; }

/* --- Panels (→ Cards) --- */
.panel { background: var(--admin-surface); border: 1px solid var(--admin-border-dark); border-radius: var(--radius); margin-bottom: var(--sp-4); }
.panel-default { }
.panel-heading { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--admin-border-dark); font-weight: 600; background: var(--admin-bg); border-radius: var(--radius) var(--radius) 0 0; }
.panel-body { padding: var(--sp-4); }
.panel-footer { padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--admin-border-dark); background: var(--admin-bg); border-radius: 0 0 var(--radius) var(--radius); }
.panel-title { font-size: 16px; font-weight: 600; margin: 0; }

/* --- Well --- */
.well { background: var(--admin-bg); border: 1px solid var(--admin-border-dark); border-radius: var(--radius); padding: var(--sp-4); margin-bottom: var(--sp-4); }

/* --- Alerts --- */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: var(--sp-4); border: 1px solid transparent; font-size: 14px; }
.alert-success { background: var(--admin-success-light); color: var(--admin-success); border-color: #bbf7d0; }
.alert-danger { background: var(--admin-danger-light); color: var(--admin-danger); border-color: #fecaca; }
.alert-warning { background: var(--admin-warning-light); color: var(--admin-warning); border-color: #fde68a; }
.alert-info { background: var(--admin-info-light); color: var(--admin-info); border-color: #bae6fd; }

/* --- Labels/Badges --- */
.label { display: inline-block; padding: 2px 8px; font-size: 11px; font-weight: 600; border-radius: 10px; line-height: 1.5; }
.label-default { background: var(--admin-bg); color: var(--admin-text-secondary); }
.label-primary { background: var(--admin-primary); color: #fff; }
.label-success { background: var(--admin-success); color: #fff; }
.label-danger { background: var(--admin-danger); color: #fff; }
.label-warning { background: var(--admin-warning); color: #fff; }
.label-info { background: var(--admin-info); color: #fff; }

/* --- Modals --- */
.modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 1050; overflow-y: auto; }
.modal.in, .modal.show { display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.5); padding: var(--sp-5); }
.modal-dialog { background: var(--admin-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 90%; max-width: 600px; margin: 0 auto; position: relative; max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.modal-lg { max-width: 900px; }
.modal-sm { max-width: 400px; }
.modal-content { border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; max-height: calc(100vh - 40px); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--admin-border-dark); flex-shrink: 0; background: var(--admin-surface); }
.modal-header .close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--admin-text-muted); padding: 4px 8px; line-height: 1; border-radius: var(--radius); transition: all var(--transition-fast); }
.modal-header .close:hover { color: var(--admin-text); background: var(--admin-bg); }
.modal-title { font-size: 1.125rem; font-weight: 600; margin: 0; }
.modal-body { padding: var(--sp-4) var(--sp-5); overflow-y: auto; flex: 1; min-height: 0; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: var(--sp-3) var(--sp-5); border-top: 1px solid var(--admin-border-dark); background: var(--admin-bg); flex-shrink: 0; }
.modal-backdrop { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 1040; }

/* --- Dropdowns --- */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
    display: none; position: absolute; top: 100%; left: 0; z-index: 1000;
    min-width: 160px; padding: 4px 0; background: var(--admin-surface);
    border: 1px solid var(--admin-border-dark); border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}
.dropdown-menu.open, .dropdown.open .dropdown-menu { display: block; }
.dropdown-menu > li > a { display: block; padding: 6px 16px; color: var(--admin-text); text-decoration: none; font-size: 14px; }
.dropdown-menu > li > a:hover { background: var(--admin-bg); }

/* --- Text utilities --- */
.text-danger { color: var(--admin-danger) !important; }
.text-success { color: var(--admin-success) !important; }
.text-warning { color: var(--admin-warning) !important; }
.text-info { color: var(--admin-info) !important; }
.text-muted { color: var(--admin-text-muted) !important; }
.text-primary { color: var(--admin-primary) !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-left { text-align: left !important; }
.text-error { color: var(--admin-danger) !important; }

/* --- Visibility/Display --- */
.hidden { display: none !important; }
.hide { display: none !important; }
.show { display: block !important; }
.invisible { visibility: hidden !important; }
.visible-xs, .visible-sm, .visible-md, .visible-lg { display: none !important; }
@media (max-width: 767px) { .visible-xs { display: block !important; } .hidden-xs { display: none !important; } }
@media (min-width: 768px) and (max-width: 991px) { .visible-sm { display: block !important; } .hidden-sm { display: none !important; } }
@media (min-width: 992px) and (max-width: 1199px) { .visible-md { display: block !important; } .hidden-md { display: none !important; } }
@media (min-width: 1200px) { .visible-lg { display: block !important; } .hidden-lg { display: none !important; } }

/* --- Float/Clear --- */
.pull-right { float: right !important; }
.pull-left { float: left !important; }
.clearfix::after { content: ""; display: table; clear: both; }
.clear-20 { clear: both; height: 20px; }

/* --- Spacing --- */
.margin10 { margin: 10px; }
.no-print { }
@media print { .no-print { display: none !important; } }

/* --- Misc Bootstrap compat --- */
.caret { display: inline-block; width: 0; height: 0; margin-left: 2px; vertical-align: middle; border-top: 4px dashed; border-right: 4px solid transparent; border-left: 4px solid transparent; }
.close { float: right; font-size: 21px; font-weight: 700; line-height: 1; color: #000; text-shadow: none; opacity: .5; background: none; border: none; cursor: pointer; }
.close:hover { opacity: .8; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
small, .small { font-size: 85%; color: var(--admin-text-secondary); }
.img-responsive { max-width: 100%; height: auto; }
.center-block { display: block; margin-left: auto; margin-right: auto; }
.list-unstyled { list-style: none; padding-left: 0; margin: 0; }
.list-inline { list-style: none; padding-left: 0; }
.list-inline > li { display: inline-block; padding: 0 5px; }

/* --- Glyphicons (minimal — most are Font Awesome in admin) --- */
.glyphicon { font-family: 'Glyphicons Halflings'; font-style: normal; font-weight: normal; display: inline-block; }
.glyphicon-question-sign::before { content: "?"; font-family: inherit; font-weight: bold; }
.glyphicon-ok::before { content: "\2713"; font-family: inherit; }
.glyphicon-remove::before { content: "\2715"; font-family: inherit; }

/* --- Popover placeholder (JS-dependent, just prevent errors) --- */
[rel="popover"] { cursor: help; }

/* --- Page-specific compat --- */
.top-container { margin-bottom: var(--sp-4); }
.top-container h1 { font-size: 24px; font-weight: 600; margin: 0; color: var(--admin-text); }
.top-container h1 small { display: block; font-size: 14px; color: var(--admin-text-secondary); margin-top: 4px; }
.inner-container { width: 100%; }
.content-padded { padding: var(--sp-2) 0; }
.body-content-wrapper { }
.form-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: var(--sp-3) 0; border-bottom: 1px solid var(--admin-border-dark); margin-bottom: var(--sp-4); }
.form-title span { font-size: 22px; font-weight: 600; }
.form-horizontal-input-padded { margin-bottom: var(--sp-3); }
.form-label-500 { display: block; font-weight: 500; margin-bottom: 4px; }
.form-line-spacer { border-top: 1px solid var(--admin-border-dark); margin: var(--sp-4) 0; }

/* --- Custom admin page classes --- */
.container_fluid { width: 100%; padding: 0 var(--sp-4); box-sizing: border-box; }
.mdl-white-box { background: var(--admin-surface); padding: var(--sp-4); border-radius: var(--radius); border: 1px solid var(--admin-border-dark); margin-bottom: var(--sp-4); }
.label-group { margin-bottom: var(--sp-3); }
.margintop10 { margin-top: 10px; }
.margin-10 { margin: 10px; }
.breakline-checkbox { display: block; margin-bottom: var(--sp-2); }
.square-box { display: inline-block; position: relative; }
.square-content { display: flex; align-items: center; justify-content: center; }
.rowElem { margin-bottom: var(--sp-3); }
.form-wrapper { padding: var(--sp-4); }
.edit-vehicle-checkbox { margin-bottom: var(--sp-2); }
.addSection { margin-top: var(--sp-4); }
.connectedSortable { min-height: 50px; }

/* ============================================================
   22. DataTables Override — Admin Design System
   Makes jQuery DataTables inherit the ad-* look inside .ad-main
   ============================================================ */
.ad-card .dataTables_wrapper {
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--admin-text);
}

.ad-card .dataTables_wrapper table.dataTable,
.ad-main .dataTables_wrapper table.dataTable,
.ad-main table.display {
    width: 100% !important;
    border-collapse: collapse;
    font-size: 0.875rem;
    margin: 0;
    border: 1px solid var(--admin-border-dark);
}

.ad-card .dataTables_wrapper table.dataTable thead th,
.ad-main .dataTables_wrapper table.dataTable thead th,
.ad-main table.display thead th {
    text-align: left;
    padding: var(--sp-3) var(--sp-4);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--admin-text-secondary);
    background: var(--admin-bg);
    border-bottom: 2px solid var(--admin-border-dark);
    border-right: 1px solid var(--admin-border-dark);
    white-space: nowrap;
}

/* Remove right border on last visible header column for clean edge */
.ad-card .dataTables_wrapper table.dataTable thead th:last-child,
.ad-main table.display thead th:last-child {
    border-right: none;
}

.ad-card .dataTables_wrapper table.dataTable tbody td,
.ad-main .dataTables_wrapper table.dataTable tbody td,
.ad-main table.display tbody td {
    padding: var(--sp-3) var(--sp-4);
    border-bottom: 1px solid var(--admin-border-dark);
    border-right: 1px solid var(--admin-border-dark);
    vertical-align: middle;
}

/* Remove right border on last visible body column for clean edge */
.ad-card .dataTables_wrapper table.dataTable tbody td:last-child,
.ad-main table.display tbody td:last-child {
    border-right: none;
}

.ad-card .dataTables_wrapper table.dataTable tbody tr:nth-child(even),
.ad-main table.display tbody tr:nth-child(even) {
    background: #f8fafc;
}

.ad-card .dataTables_wrapper table.dataTable tbody tr:hover,
.ad-main table.display tbody tr:hover {
    background: var(--admin-primary-light);
}

.ad-card .dataTables_length,
.ad-card .dataTables_filter {
    margin-bottom: var(--sp-4);
    font-size: 0.875rem;
    color: var(--admin-text-secondary);
}

.ad-card .dataTables_length label,
.ad-card .dataTables_filter label {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    margin: 0;
    font-weight: 500;
}

.ad-card .dataTables_length select {
    padding: 9px 36px 9px 14px;
    font-size: 0.875rem;
    border: 1px solid var(--admin-border-dark);
    border-radius: var(--radius);
    color: var(--admin-text);
    background: var(--admin-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E") no-repeat right 12px center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: none;
    cursor: pointer;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    min-width: 75px;
}

.ad-card .dataTables_length select:focus {
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px var(--admin-primary-light);
}

.ad-card .dataTables_filter input {
    padding: 9px 16px 9px 40px;
    font-size: 0.875rem;
    border: 1px solid var(--admin-border-dark);
    border-radius: 9999px;
    color: var(--admin-text);
    background: var(--admin-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat left 14px center;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    min-width: 280px;
    line-height: 1.5;
}

.ad-card .dataTables_filter input::placeholder {
    color: var(--admin-text-muted);
}

.ad-card .dataTables_filter input:focus {
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px var(--admin-primary-light);
}

/* Pagination footer bar — info left, paginate right */
.ad-card .dataTables_info {
    font-size: 0.8125rem;
    color: var(--admin-text-muted);
    padding: var(--sp-4) 0;
    float: left;
}

.ad-card .dataTables_paginate {
    padding: var(--sp-3) 0;
    display: flex;
    align-items: center;
    gap: var(--sp-1);
    flex-wrap: wrap;
    float: right;
}

.ad-card .dataTables_paginate .paginate_button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 7px 14px !important;
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    border: 1px solid var(--admin-border-dark) !important;
    border-radius: var(--radius) !important;
    background: var(--admin-surface) !important;
    color: var(--admin-text-secondary) !important;
    cursor: pointer !important;
    transition: all var(--transition-fast) !important;
    text-decoration: none !important;
    line-height: 1.4 !important;
    min-width: 36px;
    box-shadow: none !important;
}

.ad-card .dataTables_paginate .paginate_button:hover {
    background: var(--admin-primary-light) !important;
    border-color: var(--admin-primary) !important;
    color: var(--admin-primary) !important;
    box-shadow: none !important;
}

.ad-card .dataTables_paginate .paginate_button:active {
    background: var(--admin-primary-light) !important;
    border-color: var(--admin-primary) !important;
    color: var(--admin-primary-hover) !important;
    box-shadow: none !important;
}

.ad-card .dataTables_paginate .paginate_button.current,
.ad-card .dataTables_paginate .paginate_button.current:hover {
    background: var(--admin-primary) !important;
    border-color: var(--admin-primary) !important;
    color: var(--admin-text-inverse) !important;
    font-weight: 600 !important;
    box-shadow: var(--shadow-sm) !important;
}

.ad-card .dataTables_paginate .paginate_button.disabled,
.ad-card .dataTables_paginate .paginate_button.disabled:hover,
.ad-card .dataTables_paginate .paginate_button.disabled:active {
    background: var(--admin-bg) !important;
    border-color: var(--admin-border-dark) !important;
    color: var(--admin-text-muted) !important;
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}

.ad-card .dataTables_paginate .ellipsis {
    padding: 0 var(--sp-2);
    color: var(--admin-text-muted);
}

.ad-card .dataTables_processing {
    padding: var(--sp-4);
    text-align: center;
    font-size: 0.875rem;
    color: var(--admin-text-secondary);
    background: rgba(255,255,255,0.8);
}

.ad-card .dataTables_wrapper .dataTables_length,
.ad-card .dataTables_wrapper .dataTables_filter {
    display: inline-block;
}

.ad-card .dataTables_wrapper .dataTables_filter {
    float: right;
}

.ad-card .dataTables_wrapper .dataTables_length {
    float: left;
}

/* Hide tfoot in DataTables (duplicate header rows) — force hide */
.ad-main .dataTables_wrapper table tfoot,
.ad-main .dataTables_wrapper table.dataTable tfoot,
.ad-main table.display tfoot,
.ad-main table.dataTable tfoot {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* ── Sticky thead for ALL admin tables ── */
/* Ensure no ancestor overflow breaks sticky positioning */
.ad-main .dataTables_wrapper,
.ad-main .dataTables_scroll,
.ad-main .dataTables_scrollBody {
    overflow: visible !important;
}

.ad-main,
.ad-main .ad-card,
.ad-main .ad-card-body,
.ad-main .container,
.ad-main .container-fluid,
.ad-main .body-content-wrapper,
.ad-main .tab-content,
.ad-main .tab-pane {
    overflow: visible !important;
}

/* Sticky table headers removed — per request, headers scroll with the table body. */

/* ── DataTable sorting icons ── */
/* Remove DataTables default background-image sort indicators */
.ad-main .dataTables_wrapper table.dataTable thead th.sorting,
.ad-main .dataTables_wrapper table.dataTable thead th.sorting_asc,
.ad-main .dataTables_wrapper table.dataTable thead th.sorting_desc,
.ad-main table.display thead th.sorting,
.ad-main table.display thead th.sorting_asc,
.ad-main table.display thead th.sorting_desc {
    background-image: none !important;
    padding-right: 28px;
    cursor: pointer;
    position: relative;
}

.ad-main .dataTables_wrapper table.dataTable thead th.sorting::after,
.ad-main .dataTables_wrapper table.dataTable thead th.sorting_asc::after,
.ad-main .dataTables_wrapper table.dataTable thead th.sorting_desc::after,
.ad-main table.display thead th.sorting::after,
.ad-main table.display thead th.sorting_asc::after,
.ad-main table.display thead th.sorting_desc::after {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-style: normal;
    line-height: 1;
}

/* Unsorted — up/down arrow symbol, visible but muted */
.ad-main .dataTables_wrapper table.dataTable thead th.sorting::after,
.ad-main table.display thead th.sorting::after {
    content: "⇅";
    font-size: 0.875rem;
    opacity: 0.4;
    color: var(--admin-text-secondary, #64748b);
}

/* Ascending — up triangle, bold primary color */
.ad-main .dataTables_wrapper table.dataTable thead th.sorting_asc::after,
.ad-main table.display thead th.sorting_asc::after {
    content: "▲";
    color: var(--admin-primary, #2563eb);
    font-size: 0.6875rem;
    opacity: 1;
}

/* Descending — down triangle, bold primary color */
.ad-main .dataTables_wrapper table.dataTable thead th.sorting_desc::after,
.ad-main table.display thead th.sorting_desc::after {
    content: "▼";
    color: var(--admin-primary, #2563eb);
    font-size: 0.6875rem;
    opacity: 1;
}

/* ── DataTable cell overflow — prevent horizontal scroll ── */
.ad-main .dataTables_wrapper table.dataTable tbody td {
    overflow-wrap: break-word;
    word-break: break-word;
}

/* ── DataTable cells: never break words mid-letter. Keeping cells on one line is
   what makes columns refuse to shrink, so the table grows past the container width
   and the .ad-dt-scroll wrapper (overflow-x:auto, applied to every admin DataTable
   via the init.dt handler in admin-common.js) actually engages horizontal scroll.
   Also covers the legacy .ad-table-wrapper grids (e.g. Bulk Incentive Update). ── */
.ad-main .ad-dt-scroll > table.dataTable thead th,
.ad-main .ad-dt-scroll > table.dataTable tbody td,
.ad-main .ad-table-wrapper .dataTables_wrapper table.dataTable thead th,
.ad-main .ad-table-wrapper .dataTables_wrapper table.dataTable tbody td {
    overflow-wrap: normal;
    word-break: normal;
    white-space: nowrap;
}

/* ── DataTable clickable links — Edit, Active, Hidden, All Vehicles ── */
.ad-main .dataTables_wrapper table.dataTable tbody td a.programEdit,
.ad-main .dataTables_wrapper table.dataTable tbody td .itemActive,
.ad-main .dataTables_wrapper table.dataTable tbody td .itemHidden {
    color: var(--admin-primary);
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}
/* When programEdit is styled as an ad-btn, use the button's own colors */
.ad-main .dataTables_wrapper table.dataTable tbody td a.programEdit.ad-btn {
    color: var(--admin-text-inverse);
}
.ad-main .dataTables_wrapper table.dataTable tbody td a.programEdit:hover,
.ad-main .dataTables_wrapper table.dataTable tbody td .itemActive:hover,
.ad-main .dataTables_wrapper table.dataTable tbody td .itemHidden:hover {
    color: var(--admin-primary-hover);
    text-decoration: underline;
}
.ad-main .dataTables_wrapper table.dataTable tbody td a.programEdit.ad-btn:hover {
    color: var(--admin-text-inverse);
    text-decoration: none;
}
.ad-main .dataTables_wrapper table.dataTable tbody td a.programEdit .fa {
    margin-right: 4px;
    font-size: 0.8125rem;
}

/* Lead Status column — larger icons, centered cells */
.ad-card .dataTables_wrapper table.dataTable td .fa-exclamation-circle,
.ad-card .dataTables_wrapper table.dataTable td .fa-check {
    font-size: 1.375rem;
}

.ad-card .dataTables_wrapper table.dataTable td:has(.fa-exclamation-circle),
.ad-card .dataTables_wrapper table.dataTable td:has(.fa-check) {
    text-align: center;
}

/* ============================================================
   23. Regular Bootstrap Tables — Admin Design System
   Applies same vertical dividers and styling to plain .table
   elements inside admin cards (non-DataTable pages)
   ============================================================ */
.ad-card table.table,
.ad-main table.table {
    border: 1px solid var(--admin-border-dark);
    border-collapse: collapse;
    width: 100%;
    font-size: 0.875rem;
}

.ad-card table.table thead th,
.ad-main table.table thead th {
    text-align: left;
    padding: var(--sp-3) var(--sp-4);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--admin-text-secondary);
    background: var(--admin-bg);
    border-bottom: 2px solid var(--admin-border-dark);
    border-right: 1px solid var(--admin-border-dark);
    white-space: nowrap;
}

.ad-card table.table thead th:last-child,
.ad-main table.table thead th:last-child {
    border-right: none;
}

.ad-card table.table tbody td,
.ad-main table.table tbody td {
    padding: var(--sp-3) var(--sp-4);
    border-bottom: 1px solid var(--admin-border-dark);
    border-right: 1px solid var(--admin-border-dark);
    vertical-align: middle;
}

.ad-card table.table tbody td:last-child,
.ad-main table.table tbody td:last-child {
    border-right: none;
}

.ad-card table.table tbody tr:nth-child(even),
.ad-main table.table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.ad-card table.table tbody tr:hover,
.ad-main table.table tbody tr:hover {
    background: var(--admin-primary-light);
}

/* ============================================================
   24. Custom Checkbox — Admin Design System
   Accessible custom checkboxes for admin forms and modals
   ============================================================ */

/* Label wrapper — inline-flex keeps the checkbox and text aligned */
.ad-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--admin-text, #1e293b);
    user-select: none;
    padding: 4px 0;
}

/* Hide native checkbox but keep it accessible for screen readers */
.ad-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Custom checkbox visual — the styled square users see */
.ad-checkbox-custom {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--admin-border-dark, #cbd5e1);
    border-radius: 4px;
    background: var(--admin-surface, #fff);
    transition: all 0.15s ease;
    position: relative;
    flex-shrink: 0;
}

/* Checked state — fill with primary colour */
.ad-checkbox:checked + .ad-checkbox-custom {
    background: var(--admin-primary, #2563eb);
    border-color: var(--admin-primary, #2563eb);
}

/* Checkmark icon drawn with CSS borders */
.ad-checkbox:checked + .ad-checkbox-custom::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Focus ring for keyboard navigation */
.ad-checkbox:focus + .ad-checkbox-custom {
    box-shadow: 0 0 0 3px var(--admin-primary-light, rgba(37,99,235,0.15));
}

/* Hover state — highlight border */
.ad-checkbox-label:hover .ad-checkbox-custom {
    border-color: var(--admin-primary, #2563eb);
}

/* Flex utilities for checkbox layout */
.ad-d-flex { display: flex; }
.ad-flex-wrap { flex-wrap: wrap; }
.ad-gap-3 { gap: 12px; }
.ad-gap-4 { gap: 16px; }

/* ============================================================
   25. jQuery Multiselect Override — Admin Design System
   ============================================================ */
/* Overrides the default jquery.multiselect.js plugin styles so
   the multi-select control matches the ad-input / ad-dropdown
   look-and-feel used throughout the admin panel.                */

/* --- 25a. Trigger button — match ad-input field style --- */
.ms-options-wrap > button,
.ms-options-wrap > button:focus {
    padding: 9px 36px 9px 12px !important;       /* extra right padding for arrow */
    font-size: 0.9375rem !important;
    font-family: inherit !important;
    line-height: 1.5 !important;
    color: var(--admin-text, #1e293b) !important;
    background-color: var(--admin-surface, #fff) !important;
    border: 1px solid var(--admin-border-dark, #cbd5e1) !important;
    border-radius: var(--radius, 6px) !important;
    transition: border-color var(--transition-fast, 0.15s ease),
                box-shadow var(--transition-fast, 0.15s ease) !important;
    outline: none !important;
    text-align: left !important;
    /* Remove ALL background-image to prevent double arrow */
    background-image: none !important;
    position: relative !important;
}
/* Hide the plugin's original CSS triangle arrow (::after pseudo-element) */
.ms-options-wrap > button:after,
.ms-options-wrap > button::after {
    display: none !important;
}
/* Custom single SVG chevron arrow — placed via a ::before pseudo-element */
.ms-options-wrap > button::before {
    content: '' !important;
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 12px !important;
    height: 8px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-size: 12px 8px !important;
    pointer-events: none !important;
}

/* Focus state — primary border + ring, same as ad-input:focus */
.ms-options-wrap > button:focus,
.ms-options-wrap > button:active {
    border-color: var(--admin-primary, #2563eb) !important;
    box-shadow: 0 0 0 3px var(--admin-primary-light, rgba(37,99,235,0.15)) !important;
}

/* Hover state — darker border hint */
.ms-options-wrap > button:hover {
    border-color: var(--admin-border-dark, #94a3b8) !important;
}

/* When the dropdown is open keep focus styling on the button */
.ms-options-wrap.ms-active > button {
    border-color: var(--admin-primary, #2563eb) !important;
    box-shadow: 0 0 0 3px var(--admin-primary-light, rgba(37,99,235,0.15)) !important;
}

/* --- 25b. Dropdown panel --- */
.ms-options-wrap > .ms-options {
    border: 1px solid var(--admin-border-dark, #cbd5e1) !important;
    border-radius: var(--radius, 6px) !important;
    box-shadow: var(--shadow-md, 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06)) !important;
    background: var(--admin-surface, #fff) !important;
    margin-top: 4px !important;
    padding: 0 !important;
    overflow: hidden;
}

/* --- 25c. Search input inside dropdown — match ad-input --- */
.ms-options-wrap > .ms-options > .ms-search > input,
.ms-options-wrap > .ms-options .ms-search input {
    display: block !important;
    width: 100% !important;
    padding: 9px 12px !important;
    font-size: 0.9375rem !important;
    font-family: inherit !important;
    line-height: 1.5 !important;
    color: var(--admin-text, #1e293b) !important;
    background: var(--admin-surface, #fff) !important;
    border: none !important;
    border-bottom: 1px solid var(--admin-border-dark, #cbd5e1) !important;
    border-radius: 0 !important;
    outline: none !important;
    box-sizing: border-box !important;
    transition: box-shadow var(--transition-fast, 0.15s ease) !important;
}

/* Focus ring for the search input */
.ms-options-wrap > .ms-options .ms-search input:focus {
    box-shadow: inset 0 -2px 0 0 var(--admin-primary, #2563eb) !important;
}

/* Placeholder colour */
.ms-options-wrap > .ms-options .ms-search input::placeholder {
    color: var(--admin-text-muted, #94a3b8) !important;
}

/* --- 25d. Option list --- */
.ms-options-wrap > .ms-options > ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 4px 0 !important;
}

/* Individual list items */
.ms-options-wrap > .ms-options > ul > li {
    padding: 0 !important;
    margin: 0 !important;
}

/* Labels wrapping each option (checkbox + text) */
.ms-options-wrap > .ms-options > ul li label {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 7px 12px !important;
    font-size: 0.875rem !important;
    line-height: 1.4 !important;
    color: var(--admin-text, #1e293b) !important;
    cursor: pointer !important;
    transition: background var(--transition-fast, 0.15s ease) !important;
    margin: 0 !important;
    border-radius: 0 !important;
}
/* Ensure the text inside label aligns properly with the checkbox */
.ms-options-wrap > .ms-options > ul li label span {
    display: inline-block !important;
    vertical-align: middle !important;
    line-height: 1.4 !important;
}

/* Hover highlight on list items */
.ms-options-wrap > .ms-options > ul li label:hover {
    background: var(--admin-primary-light, rgba(37,99,235,0.08)) !important;
}

/* --- 25e. Checkboxes — ad-checkbox-custom appearance --- */
/* Style the native checkbox as a custom-drawn box */
.ms-options-wrap > .ms-options > ul li label input[type="checkbox"] {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    border: 2px solid var(--admin-border-dark, #cbd5e1) !important;
    border-radius: 4px !important;
    background: var(--admin-surface, #fff) !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    position: relative !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    vertical-align: middle !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    top: 0px;
}

/* Checked state — filled primary blue */
.ms-options-wrap > .ms-options > ul li label input[type="checkbox"]:checked {
    background: var(--admin-primary, #2563eb) !important;
    border-color: var(--admin-primary, #2563eb) !important;
}

/* White checkmark on checked checkbox — centered inside the box */
.ms-options-wrap > .ms-options > ul li label input[type="checkbox"]:checked::after {
    content: '' !important;
    position: absolute !important;
    left: 4px !important;
    top: 0px !important;
    width: 6px !important;
    height: 10px !important;
    border: solid #fff !important;
    border-width: 0 2px 2px 0 !important;
    transform: rotate(45deg) !important;
    display: block !important;
}

/* Focus ring on checkbox for keyboard navigation */
.ms-options-wrap > .ms-options > ul li label input[type="checkbox"]:focus {
    box-shadow: 0 0 0 3px var(--admin-primary-light, rgba(37,99,235,0.15)) !important;
}

/* Hover state on checkbox */
.ms-options-wrap > .ms-options > ul li label:hover input[type="checkbox"] {
    border-color: var(--admin-primary, #2563eb) !important;
}

/* --- 25f. Selected (checked) item row — subtle primary tint --- */
.ms-options-wrap > .ms-options > ul li.selected label,
.ms-options-wrap > .ms-options > ul li label.selected,
.ms-options-wrap > .ms-options > ul li label:has(input:checked) {
    background: var(--admin-primary-light, rgba(37,99,235,0.08)) !important;
}

/* --- 25g. "Select All" / global option row --- */
.ms-options-wrap > .ms-options > .ms-selectall {
    padding: 6px 12px !important;
    font-size: 0.875rem !important;
    border-bottom: 1px solid var(--admin-border-dark, #cbd5e1) !important;
}

.ms-options-wrap > .ms-options > .ms-selectall label {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
}

/* --- 25h. Option-group headers (if optgroups are used) --- */
.ms-options-wrap > .ms-options > ul > li.optgroup > .label {
    padding: 8px 12px 4px !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: var(--admin-text-muted, #94a3b8) !important;
}

/* ============================================================
   26. Modal Loading Overlay — Admin Design System
   Shows a spinner + message while AJAX loads data into a modal.
   Usage: <div class="ad-modal-loading"><div class="ad-spinner"></div><p>Loading...</p></div>
   ============================================================ */
.ad-modal-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: var(--admin-surface, #fff);
    z-index: 5;
    min-height: 200px;
}
.ad-modal-loading p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--admin-text-muted, #94a3b8);
    font-weight: 500;
}

/* Spinner — simple CSS rotating ring */
.ad-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--admin-border-dark, #cbd5e1);
    border-top-color: var(--admin-primary, #2563eb);
    border-radius: 50%;
    animation: ad-spin 0.7s linear infinite;
}

@keyframes ad-spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   27. Row Status Highlights + Badges — Admin Design System
   Active rows get a green tint, inactive rows are faded.
   ============================================================ */
/* Active row — subtle green left border + light green background */
.ad-row-active {
    background: rgba(34, 197, 94, 0.06) !important;
    border-left: 3px solid var(--admin-success, #22c55e) !important;
}
.ad-row-active:hover {
    background: rgba(34, 197, 94, 0.12) !important;
}

/* Inactive row — faded appearance */
.ad-row-inactive {
    opacity: 0.55;
}
.ad-row-inactive:hover {
    opacity: 0.75;
}

/* Status badges */
.ad-badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 4px;
    line-height: 1.4;
    white-space: nowrap;
}
.ad-badge-success {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}
.ad-badge-muted {
    background: var(--admin-bg, #f1f5f9);
    color: var(--admin-text-muted, #94a3b8);
}
.ad-badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}
.ad-badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}
.ad-badge-primary {
    background: rgba(37, 99, 235, 0.15);
    color: var(--admin-primary, #2563eb);
}

/* Utility: margin-top for cards */
.ad-mt-4 { margin-top: var(--sp-4); }

/* ── Tooltip (Bootstrap-compatible) ── */
.tooltip { position: absolute; z-index: 99999; display: block; font-size: 13px; line-height: 1.5; opacity: 0; transition: opacity 0.15s; pointer-events: none; }
.tooltip.in { opacity: 1; pointer-events: auto; }
.tooltip .tooltip-inner { min-width: 200px; max-width: 1000px; min-height: 30px; max-height: 350px; overflow-x: hidden; overflow-y: auto; padding: 10px 14px; color: #fff; text-align: left; background-color: #333; border-radius: 4px; word-wrap: break-word; display: flex; flex-wrap: wrap; column-gap: 14px; }
.tooltip .tooltip-inner > table { width: calc(50% - 7px) !important; margin: 0 !important; }
.tooltip .tooltip-inner > table:only-child { width: 100% !important; }
.tooltip .tooltip-arrow { position: absolute; width: 0; height: 0; border-style: solid; border-color: transparent; }
.tooltip.top .tooltip-arrow { bottom: -5px; left: 50%; margin-left: -5px; border-width: 5px 5px 0; border-top-color: #333; }
.tooltip.bottom .tooltip-arrow { top: -5px; left: 50%; margin-left: -5px; border-width: 0 5px 5px; border-bottom-color: #333; }
.tooltip.left .tooltip-arrow { top: 50%; right: -5px; margin-top: -5px; border-width: 5px 0 5px 5px; border-left-color: #333; }
.tooltip.right .tooltip-arrow { top: 50%; left: -5px; margin-top: -5px; border-width: 5px 5px 5px 0; border-right-color: #333; }

/* ── Inline <code> tag — boxed token look ──
   Shared across every admin page (Template Selection > Built-in Variables
   for HTML, Content Management > Custom Form Guide, etc.). One rule here
   means individual pages don't redefine the same five lines. Pages that
   want to override (e.g. <code> inside a <pre> block) should set
   background: transparent and border: none in their own scoped selector. */
code {
    background: #fff;
    color: #b45309;
    border: 1px solid #e2e8f0;
    padding: 1px 6px;
    border-radius: 3px;
    font-family: Menlo, Consolas, monospace;
    font-size: 12px;
}

/* ============================================================
   28. Standardized Page-Load Loader — Admin Design System
   Full-screen overlay + backdrop + centered spinner, shown
   while a dashboard first renders. Matches the in-action
   $.blockUI loader so every admin page behaves identically.
   Markup (place as first child of the MainContent area):
     <div id="adminPageLoader" class="admin-page-loader">
         <img src="/Content/Images/new-spinner.gif" width="50" height="50" alt="Loading" />
     </div>
   Hidden on document-ready with: $('#adminPageLoader').fadeOut(200);
   ============================================================ */
.admin-page-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;            /* above sticky action bars (999) and modals */
    display: flex;
    align-items: center;
    justify-content: center;
    /* Near-opaque backdrop — hides half-rendered content behind it */
    background: rgba(255, 255, 255, 0.96);
}

/* ============================================================
   Vehicle Edit page (/admin/vehicleedit) — page-scoped styles.
   Modernizes the legacy Bootstrap-3 form to match the admin
   dashboards. Everything is scoped under .ad-vehicle-edit
   (set on the page wrapper) so no other admin page is affected.
   ============================================================ */

/* --- Title (#vehicleTitle is filled by JS with the vehicle name) --- */
.ad-vehicle-edit-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    flex-wrap: wrap;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--admin-text);
    line-height: 1.4;
    min-height: 1px;
    margin-bottom: var(--sp-5);
    padding-bottom: var(--sp-3);
    border-bottom: 1px solid var(--admin-border);
}
/* "View History" sits at the top-right of the title row */
.ad-vehicle-edit-history { font-size: 0.875rem; font-weight: 500; flex: 0 0 auto; }

/* --- Vehicle image --- */
.ad-vehicle-edit-image {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--admin-border-dark);
    border-radius: var(--radius-lg);
    background: var(--admin-bg);
    margin-bottom: var(--sp-4);
}

/* --- Tidy legacy layout/spacing helpers used in this page's markup --- */
.ad-vehicle-edit .content-padded { padding: var(--sp-3) 0; }
.ad-vehicle-edit .clear { clear: both; }
.ad-vehicle-edit .clear-20 { clear: both; height: 20px; }
.ad-vehicle-edit .padded-15 { padding-top: var(--sp-3); }
.ad-vehicle-edit .nopadding { padding-left: 0; padding-right: 0; }
.ad-vehicle-edit hr { border: 0; border-top: 1px solid var(--admin-border); margin: var(--sp-4) 0; }

/* The compat layer makes .row display:flex; for the full-width sections
   (Upfitting, Youtube, descriptions, pricing preview, grids) that wrongly
   placed stacked fieldsets side-by-side. Force block so they stack. */
.ad-vehicle-edit .content-padded { display: block; }
/* These option fieldsets were right-aligned; left-align for a clean column. */
.ad-vehicle-edit fieldset.text-right,
.ad-vehicle-edit fieldset.text-right .control-label,
.ad-vehicle-edit fieldset.text-right label { text-align: left !important; }
.ad-vehicle-edit fieldset.text-right label.pull-right { float: none !important; }

/* Readonly / disabled form controls — grayed so they clearly read as non-editable
   anywhere in the admin (ContactUsDetail, VehicleEdit, any future page). Global. */
.ad-input[readonly], .ad-input:disabled,
.ad-textarea[readonly], .ad-textarea:disabled,
.ad-select[readonly], .ad-select:disabled,
.form-control[readonly], .form-control:disabled,
input[readonly]:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not(.ad-sidebar-search-input),
textarea[readonly], select[readonly] {
    background: var(--admin-bg) !important;
    color: var(--admin-text-secondary) !important;
    border-color: var(--admin-border) !important;
    cursor: not-allowed;
}
/* Required-field asterisk — use after the label text:
   <label class="ad-label">Email <span class="ad-required">*</span></label> */
.ad-required { color: var(--admin-danger); font-weight: 700; margin-left: 2px; }

/* No blue focus ring on readonly fields — they shouldn't invite editing. */
.ad-input[readonly]:focus,
.ad-textarea[readonly]:focus,
.form-control[readonly]:focus,
input[readonly]:not(.ad-sidebar-search-input):focus,
textarea[readonly]:focus {
    box-shadow: none !important;
    border-color: var(--admin-border) !important;
}

/* ACE code-editor hosts (Feed/Override descriptions, Finance APR disclaimers).
   ACE needs an explicit height on its container to render. */
.ad-vehicle-edit .vehicle-ace-host {
    width: 100%;
    height: 220px;
    border: 1px solid var(--admin-border-dark);
    border-radius: var(--radius);
    margin-bottom: var(--sp-2);
    overflow: hidden;
}
.ad-vehicle-edit #autoWriterDescription_ace,
.ad-vehicle-edit #txtFinanceAPRDisclaimer_ace,
.ad-vehicle-edit #txtfinanceAPRDetailedDisclaimer_ace { height: 280px; }

/* --- Checkbox / option rows: replace the inline black-bordered boxes
       with clean, consistent cards and left-align the floated labels --- */
.ad-vehicle-edit fieldset { border: 0; margin: 0 0 var(--sp-2); padding: 0; min-width: 0; }
.ad-vehicle-edit fieldset.checkbox > .row,
.ad-vehicle-edit fieldset > div[style*="solid 1px"] {
    border: 1px solid var(--admin-border-dark) !important;
    border-radius: var(--radius) !important;
    padding: var(--sp-3) !important;
    margin: 0 0 var(--sp-2) 0 !important;
    background: var(--admin-surface);
}
.ad-vehicle-edit fieldset label,
.ad-vehicle-edit fieldset.checkbox label {
    font-weight: 500;
    color: var(--admin-text);
    cursor: pointer;
}
/* Left-align the option-checkbox labels and give the native checkbox/radio
   a consistent gap from its label text (matches the Website Config dashboard). */
.ad-vehicle-edit fieldset label.pull-right,
.ad-vehicle-edit fieldset label.pull-left {
    float: none !important;
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    text-align: left;
    margin: 0;
    cursor: pointer;
    font-weight: 500;
}
.ad-vehicle-edit fieldset label.pull-right input[type="checkbox"],
.ad-vehicle-edit fieldset label.pull-left input[type="checkbox"],
.ad-vehicle-edit fieldset label.pull-right input[type="radio"],
.ad-vehicle-edit fieldset label.pull-left input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--admin-primary);
    margin: 0;
    flex-shrink: 0;
}
/* Restore the column gutter on fieldset-based columns (the fieldset reset zeroed padding). */
.ad-vehicle-edit fieldset[class*="ad-col"] { padding-left: 8px; padding-right: 8px; }
/* Custom-styled native checkboxes & radios that match the design-system controls.
   Pure CSS (no markup change) so all name/id/:checked JS hooks are preserved.
   The data-toggle="buttons" segmented radios stay clipped by the more-specific
   compat rule, so they remain styled as buttons. */
.ad-vehicle-edit input[type="checkbox"],
.ad-vehicle-edit input[type="radio"] {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    margin: 0 var(--sp-2) 0 0;
    padding: 0;
    border: 1px solid var(--admin-border-dark);
    background: var(--admin-surface);
    vertical-align: -4px;
    cursor: pointer;
    position: relative;
    flex: 0 0 auto;
    transition: background .15s, border-color .15s;
}
.ad-vehicle-edit input[type="checkbox"] { border-radius: var(--radius-sm); }
.ad-vehicle-edit input[type="radio"] { border-radius: 50%; }
.ad-vehicle-edit input[type="checkbox"]:checked,
.ad-vehicle-edit input[type="radio"]:checked {
    background: var(--admin-primary);
    border-color: var(--admin-primary);
}
.ad-vehicle-edit input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px; top: 1px;
    width: 4px; height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.ad-vehicle-edit input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    left: 4px; top: 4px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #fff;
}
.ad-vehicle-edit input[type="checkbox"]:focus,
.ad-vehicle-edit input[type="radio"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--admin-primary-light);
}
.ad-vehicle-edit input[type="checkbox"]:disabled,
.ad-vehicle-edit input[type="radio"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Incentive/Finance box — nested card grouping everything the "Save Incentives"
   button persists (rebate grids + finance APR), to make the two-save-button split clear. */
.ad-vehicle-edit-incentive-box { margin-top: var(--sp-6); }
.ad-incentive-box-note {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--admin-text-secondary);
    margin-left: var(--sp-2);
}

/* Pricing summary box ("Your Price") — cleaner receipt-style card. */
.ad-vehicle-edit .panel.pricing { background: var(--admin-bg); padding: var(--sp-5); }
.ad-vehicle-edit .panel.pricing .row { padding: 3px 0; }
.ad-vehicle-edit .panel.pricing .vdp-price,
.ad-vehicle-edit .panel.pricing h3 {
    font-size: 1.375rem; font-weight: 700; color: var(--admin-text);
    margin: 0 0 var(--sp-3); padding-bottom: var(--sp-3);
    border-bottom: 1px solid var(--admin-border-dark);
}
.ad-vehicle-edit .panel.pricing .price-main,
.ad-vehicle-edit .panel.pricing .finalprice { color: var(--admin-primary); }

/* --- Vehicle Edit page: section headings (real <h3>) for each block --- */
.ad-vehicle-edit .ad-section-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--admin-text);
    margin: var(--sp-6) 0 var(--sp-3);
    padding-bottom: var(--sp-2);
    border-bottom: 1px solid var(--admin-border);
}

/* --- Vehicle Options: full-width responsive checkbox grid --- */
.ad-vehicle-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: var(--sp-3) var(--sp-5);
    align-items: start;
    width: 100%;
}
.ad-vehicle-options-grid > .col-xs-12 { width: auto; padding: 0; margin: 0; }
.ad-vehicle-options-grid > .clear { display: none; }
.ad-vehicle-options-grid img { max-width: 100%; height: auto; }
/* Normalize every checkbox row in the options grid to a consistent
   "[checkbox] label" layout (was previously a pull-right float). */
.ad-vehicle-options-grid .pull-right,
.ad-vehicle-options-grid .pull-left {
    float: none !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    cursor: pointer;
    font-weight: 500;
}
.ad-vehicle-options-grid input[type="checkbox"] { margin: 0; }
.ad-vehicle-options-grid fieldset.checkbox { margin: 0; padding: 0; border: 0; }

/* --- Inventory & Status: 4 bordered boxes in 2-col grid --- */
.ad-vehicle-bordered-boxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(440px, 1fr));
    gap: var(--sp-4);
    align-items: start;
}
.ad-vehicle-bordered-boxes > .hide { display: none !important; }

.ad-status-box {
    border: 1px solid var(--admin-border-dark);
    border-radius: var(--radius);
    padding: var(--sp-4);
    background: var(--admin-surface);
}
/* Box layout: 1 row with left options + right extras side-by-side */
.ad-status-box-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-4);
}
.ad-status-box-options {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    flex: 0 0 auto;
    min-width: 160px;
}
.ad-status-box-extra {
    flex: 1 1 200px;
    min-width: 0;
}
.ad-status-box-extra .ad-form-group { margin: 0; }
.ad-status-box-extra .ad-input,
.ad-status-box-extra .ad-dropdown { width: 100%; }

/* Promo image preview + expiration label inside box 4 */
.ad-status-box-promo-image {
    margin-top: var(--sp-3);
    text-align: center;
}
.ad-status-box-promo-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
}
.ad-status-box-promo-date {
    margin-top: var(--sp-3);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: 0.875rem;
}

/* Promo Offer button next to dropdown (history icon) */
.ad-vehicle-bordered-boxes .ad-btn-icon {
    flex: 0 0 auto;
    padding: 8px 12px;
    line-height: 1;
}

/* Override the global ".ad-checkbox{position:absolute;opacity:0}" hidden-input rule
   when .ad-checkbox is used as a LABEL wrapper around a visible native checkbox. */
.ad-status-box label.ad-checkbox,
.ad-upfitted-options label.ad-checkbox {
    position: static;
    opacity: 1;
    width: auto;
    height: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    white-space: nowrap;
}
.ad-status-box label.ad-checkbox input[type="checkbox"],
.ad-upfitted-options label.ad-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--admin-primary);
    margin: 0;
    flex-shrink: 0;
}

/* Radio buttons inside status boxes — match the checkbox look-and-feel */
.ad-status-box .ad-radio {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    cursor: pointer;
    font-weight: 500;
}
.ad-status-box .ad-radio input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--admin-primary);
    margin: 0;
    flex-shrink: 0;
}
.ad-status-box .ad-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
    margin: 0;
}

/* Upfitted Options: align labels + inputs vertically with consistent spacing */
.ad-upfitted-options .form-group { margin-bottom: var(--sp-4); }
.ad-upfitted-options label.control-label,
.ad-upfitted-options label[for] {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--admin-text);
    letter-spacing: 0.01em;
}
.ad-upfitted-options .input-group { width: 100%; }
.ad-upfitted-options .form-control,
.ad-upfitted-options input[type="text"]:not(.ad-input) {
    width: 100%;
    max-width: 100%;
}

/* === Vehicle Edit polish to match Website Config dashboard ============================ */

/* ACE editor host — match Website Config 14px Consolas */
.ad-vehicle-edit .vehicle-ace-host,
.ad-vehicle-edit .ace_editor {
    font-size: 14px !important;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
}

/* Every form-field label on the page renders identically */
.ad-vehicle-edit .ad-label,
.ad-vehicle-edit label.control-label,
.ad-vehicle-edit fieldset > label[for]:not(.pull-right):not(.pull-left):not(.btn):not(.ad-checkbox):not(.ad-radio) {
    font-size: 14px;
    font-weight: 700;
    color: var(--admin-text);
    letter-spacing: 0.01em;
    margin: 0 0 6px;
    display: block;
}
.ad-vehicle-edit .ad-form-group,
.ad-vehicle-edit fieldset.form-group { margin-bottom: 16px; }

/* Tooltip icon — match Website Config sizing + color */
.ad-vehicle-edit .lablTooltip {
    color: var(--admin-primary);
    margin-left: 4px;
    text-decoration: none;
}
.ad-vehicle-edit .lablTooltip:hover { color: var(--admin-primary-dark, #1d4ed8); }
.ad-vehicle-edit .lablTooltip .fa-info-circle,
.ad-vehicle-edit .lablTooltip .fa-question-circle {
    font-size: 14px !important;
}
/* Bootstrap tooltip box styling */
.ad-vehicle-edit + div.tooltip,
body > div.tooltip { font-size: 13px; }
body > div.tooltip .tooltip-inner {
    max-width: 320px !important;
    width: 100%;
    padding: 8px 12px;
    line-height: 1.5;
}

/* Promo Offer: history button touches the dropdown right edge and matches its height.
   Scoped to the dropdown+button pair only (not the options/extra row in other boxes). */
.ad-status-box .ad-form-group > .ad-status-box-row {
    gap: 0;
    align-items: stretch;
}
.ad-status-box .ad-form-group > .ad-status-box-row .ad-dropdown select {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.ad-status-box .ad-form-group > .ad-status-box-row .ad-dropdown + .ad-btn-icon {
    margin-left: -1px;                  /* overlap the dropdown's 1px right border */
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    align-self: stretch;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
}

/* --- Upfitted Options block --- */
.ad-upfitted-options { display: block; }
.ad-upfitted-options .ad-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 var(--sp-3);
    cursor: pointer;
    font-weight: 500;
}
.ad-upfitted-options input[type="checkbox"] { margin: 0; }

/* ============================================================
   Pricing summary box — match the public "Your Price" layout
   (label on the left, value on the right, on one line each).
   Placed last so it overrides the earlier pricing rules.
   ============================================================ */
.ad-vehicle-edit .panel.pricing { background: var(--admin-surface); padding: var(--sp-5); }

/* Top header: "Your Price" label left, large total right, with a divider. */
.ad-vehicle-edit .panel.pricing h3.vdp-price,
.ad-vehicle-edit .panel.pricing .vdp-price {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--sp-3);
    margin: 0 0 var(--sp-4);
    padding-bottom: var(--sp-4);
    border-bottom: 1px solid var(--admin-border-dark);
    font-weight: 400;
}
.ad-vehicle-edit .panel.pricing .vdp-price-label { font-size: 1.25rem; font-weight: 400; color: var(--admin-text); }
.ad-vehicle-edit .panel.pricing .vdp-price-price { font-size: 1.875rem; font-weight: 800; color: var(--admin-text); white-space: nowrap; }
.ad-vehicle-edit .panel.pricing .vdp-price-price sup { font-size: 1.3rem; font-weight: 700; top: -0.9em; }

/* Each breakdown line: any container whose value cell is .text-right becomes a
   flex row (label left / value right). Robust whether or not col-* are present,
   so the Bootstrap col-* tokens can be safely removed from the markup. */
.ad-vehicle-edit .panel.pricing .row { margin: 0; padding: 0; }
.ad-vehicle-edit .panel.pricing div:has(> .text-right) {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--sp-3);
    width: 100%;
    padding: 4px 0;
}
.ad-vehicle-edit .panel.pricing div:has(> .text-right) > * {
    flex: 0 1 auto;
    width: auto;
    max-width: none;
    padding: 0;
}
.ad-vehicle-edit .panel.pricing .text-right { text-align: right; margin-left: auto; }
/* Pricing box wrapper (replaces the old col-md-offset-7/col-md-5 positioning):
   right-aligned summary card. */
.ad-vehicle-edit .ad-pricing-wrap { max-width: 460px; margin-left: auto; }

/* Colors: MSRP dark, rebates red, FINAL "Your Price" green. */
.ad-vehicle-edit .panel.pricing .msrp-price { color: var(--admin-text); font-weight: 600; }
.ad-vehicle-edit .panel.pricing .openRebate,
.ad-vehicle-edit .panel.pricing .rebate { color: var(--admin-danger) !important; font-weight: 600; }
.ad-vehicle-edit .panel.pricing .finalpriceUsed .price-main,
.ad-vehicle-edit .panel.pricing .finalpriceUsed label,
.ad-vehicle-edit .panel.pricing .finalpricelabel,
.ad-vehicle-edit .panel.pricing .finalprice { color: var(--admin-success) !important; font-weight: 700; }

/* --- Form field labels (legacy .control-label already styled by compat layer) --- */
.ad-vehicle-edit .control-label { font-weight: 700; }

/* --- View History / link buttons --- */
.ad-vehicle-edit .btn-link { font-size: 0.875rem; }

/* --- Pricing preview panel (mirrors the public VDP price box; these VDP
       classes have no admin styling otherwise, so the box looked broken) --- */
.ad-vehicle-edit .panel.pricing {
    border: 1px solid var(--admin-border-dark);
    border-radius: var(--radius-lg);
    background: var(--admin-surface);
    box-shadow: var(--shadow-sm);
    padding: var(--sp-4);
}
.ad-vehicle-edit .panel.pricing .row { margin-left: 0; margin-right: 0; align-items: baseline; }
.ad-vehicle-edit .panel.pricing label,
.ad-vehicle-edit .price-label,
.ad-vehicle-edit .pricing-label-small,
.ad-vehicle-edit .conditionalOffersHeading {
    font-weight: 500;
    color: var(--admin-text-secondary);
    font-size: 0.875rem;
    margin: 0;
}
.ad-vehicle-edit .msrp-price,
.ad-vehicle-edit .price-main,
.ad-vehicle-edit .finalprice { font-weight: 700; color: var(--admin-text); }
.ad-vehicle-edit .openRebate,
.ad-vehicle-edit .rebate { color: var(--admin-danger); font-weight: 600; cursor: pointer; }
.ad-vehicle-edit .dealersaving { color: var(--admin-success); font-weight: 700; }
.ad-vehicle-edit .border-bottom { border-bottom: 1px solid var(--admin-border); padding-bottom: var(--sp-2); margin-bottom: var(--sp-2); }
.ad-vehicle-edit .border-top { border-top: 1px solid var(--admin-border); padding-top: var(--sp-2); margin-top: var(--sp-2); }
.ad-vehicle-edit .label-group.promoOffer img { border-radius: var(--radius); }

/* --- Tables (FB Ads history, log viewer). Borderless grids inside
       .rebateTable keep their own inline override. --- */
.ad-vehicle-edit .table { width: 100%; border-collapse: collapse; }
.ad-vehicle-edit .table-bordered th,
.ad-vehicle-edit .table-bordered td {
    border: 1px solid var(--admin-border);
    padding: var(--sp-2) var(--sp-3);
    font-size: 0.875rem;
    text-align: left;
}
.ad-vehicle-edit .table-bordered thead th {
    background: var(--admin-bg);
    color: var(--admin-text);
    font-weight: 600;
}

/* --- Legend box (the icon key under the pricing preview) --- */
.ad-vehicle-edit .alert-info { background: var(--admin-info-light); }
