/*
 * Maxeme Auto theme: colour tokens from the legacy app (Bootstrap 3 + AutoTuneBundle main.css),
 * re-pointing the tokens app.css reads. Load after app.css. Layout and components stay app.css.
 */
:root {
    /* Primary action colour — Bootstrap 3 .btn-primary on Maxeme */
    --mx-primary: #428bca;
    --mx-primary-hover: #3071a9;
    --mx-primary-soft: #eaf2fa;
    --mx-primary-light: #c4dcf0;

    /* Navbar / chrome — Maxeme .main-navigation */
    --mx-navbar: #206eb8;
    --mx-navbar-hover: #1a5c9c;
    --mx-navbar-border: #333333;
    --mx-navbar-ink: #efefef;
    --mx-side-panel: #efefef;
    --mx-side-panel-border: #cccccc;

    /* Status colours — Bootstrap 3 contextual palette used across Maxeme */
    --mx-success: #5cb85c;
    --mx-success-hover: #449d44;
    --mx-success-soft: #dff0d8;
    --mx-info: #5bc0de;
    --mx-info-soft: #d9edf7;
    --mx-warning: #f0ad4e;
    --mx-warning-hover: #ec971f;
    --mx-warning-soft: #fcf8e3;
    --mx-danger: #d9534f;
    --mx-danger-hover: #c9302c;
    --mx-danger-soft: #f2dede;
    /* Bootstrap 3 .btn-default */
    --mx-default-ink: #333333;
    --mx-default-border: #cccccc;
    --mx-default-hover: #e6e6e6;
    --mx-default-hover-border: #adadad;

    /* Appointment status (calendar events) — #2 AppointmentController::convertAppointmentToArray() */
    --mx-appt-new: #489ce5; /* booked (thread 13485) */
    --mx-appt-in-progress: #ee9d3a;
    --mx-appt-complete: #53ac75;
    --mx-appt-extended: #8e5cc5;
    --mx-appt-no-show: #8a94a6;
    --mx-appt-cancelled: #d9534f;

    /* ── Re-point the app.css tokens ─────────────────────────────────────── */
    --brand: var(--mx-primary);
    --brand-mid: var(--mx-primary);
    --brand-dark: var(--mx-primary-hover);
    --brand-bg: var(--mx-primary-soft);
    --brand-light: var(--mx-primary-light);
    --blue: var(--mx-primary);
    --amber: var(--mx-warning);
    --red: var(--mx-danger);

    --admin-navy: var(--mx-navbar);
    --admin-navy-hover: var(--mx-navbar-hover);
    --admin-navy-border: var(--mx-navbar-border);
    --admin-blue: var(--mx-primary);
    --admin-blue-hover: var(--mx-primary-hover);
    --admin-blue-soft: var(--mx-primary-soft);
    --admin-success: var(--mx-success);
    --admin-success-soft: var(--mx-success-soft);
    --admin-row-hover: var(--mx-primary-soft);

    /* Desktop sidebar = #2 .side-menu (light grey panel, dark text) */
    --admin-sidebar-bg: var(--mx-side-panel);
    --admin-sidebar-border: var(--mx-side-panel-border);
    --admin-sidebar-ink: #333333;
    --admin-sidebar-muted: #555555;
    --admin-sidebar-hover: #e2e2e2;
}
@media (max-width: 980px) {
    .site-admin .topbar {
        background: var(--mx-navbar);
    }
}

/* Current submenu item: no highlight. #1 fills it solid blue; here it is plain text, identical
   to its siblings (values copied from app.css .site-admin .nav a, desktop and mobile). */
.site-admin .nav a.nav-sub.is-current,
.site-admin .nav-sub.is-current {
    color: #181c2e !important;
    background: transparent !important;
    border-color: transparent !important;
    font-weight: 500;
    box-shadow: none;
}
.site-admin .nav a.nav-sub.is-current:hover {
    background: var(--admin-sidebar-hover) !important;
}
@media (max-width: 980px) {
    .site-admin .nav a.nav-sub.is-current,
    .site-admin .nav-sub.is-current {
        color: #cbd5e1 !important;
    }
}

/* ── Sidebar searches: Customer, Vehicle, Invoice # (one box each) ────────── */
.mx-side-search {
    margin: 10px 0 6px;
    padding: 12px 2px 4px;
    border-top: 1px solid var(--mx-side-panel-border);
}
.mx-side-search h5 {
    margin: 0 0 8px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--admin-sidebar-muted);
}
.mx-side-search form + form {
    margin-top: 10px;
}
.mx-side-field {
    display: flex;
    align-items: stretch;
    margin-bottom: 6px;
    border: 1px solid var(--mx-side-panel-border);
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
}
.mx-side-field > .mx-addon {
    display: grid;
    place-items: center;
    width: 30px;
    flex: 0 0 30px;
    color: var(--admin-sidebar-muted);
    background: #f5f5f5;
    border-right: 1px solid var(--mx-side-panel-border);
}
.mx-side-field > .mx-inputs { flex: 1; min-width: 0; }
.mx-side-field input {
    display: block;
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 8px 10px;
    border: 0;
    border-radius: 0;
    font: inherit;
    font-size: 0.8125rem;
    color: var(--ink-body);
    background: transparent;
    box-shadow: none;
}
.mx-side-field input:focus { outline: 2px solid var(--mx-primary); outline-offset: -2px; }
.mx-side-search .mx-side-go {
    flex: 0 0 36px;
    width: 36px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    display: grid;
    place-items: center;
}
.mx-side-search .mx-side-go svg { width: 14px; height: 14px; }

/* A list opened from a sidebar search: what matched, and back to the full list. */
.mx-search-results {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
    padding: 8px 12px;
    border-radius: 6px;
    background: var(--mx-warning-soft);
}
body.admin-sidebar-collapsed .mx-side-search { display: none; }


/* ── Login: legacy login.css dark page (#333) behind #1's card ───────────── */
.site-admin-login .admin-login-shell { background: var(--mx-navbar-border); }

/* ── Manage Admins ──────────────────────────────────────────────────────── */

/* ── My Profile ─────────────────────────────────────────────────────────── */
.mx-profile-card { max-width: 640px; }
.mx-profile-card .panel-actions { margin-top: 18px; }
.mx-profile-password { margin-top: 20px; }
.mx-profile-password h2 { margin: 0 0 14px; font-size: 1.05rem; }
.site-admin-login .admin-login-shell { flex-direction: column; gap: 18px; }
.admin-login-form input[type="text"] { margin-top: 6px; font-size: 0.9rem; }
.login-help { margin-top: 4px; }
.mx-form-error { grid-column: 1 / -1; margin: 0; }
.mx-auth-message { margin: 0 0 22px; color: var(--ink-body); line-height: 1.55; }

/* ── Server-side list toolbar (legacy DataTables "Show N entries" / "Search:") ── */
.mx-grid-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mx-grid-tools label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.82rem; font-weight: 500; }
.mx-modal-wide { max-width: 760px; }
/* One small-button spec wherever it sits (table header, form head, table cell): the same box
   .table-header > .button gets, so Client Profile's Update, Vehicles' Add and the row buttons match. */
/* ── Buttons: the legacy app's Bootstrap 3 colours ───────────────────────────
   .primary = btn-primary (blue), .mx-success = btn-success (green), .mx-warning = btn-warning
   (orange), .danger = btn-danger (red), .outline = btn-default (white). Staff pages and the
   sign-in / reset pages alike. */
:is(.site-admin, .site-admin-login) .button.mx-success { color: #fff; background: var(--mx-success); border-color: var(--mx-success); }
:is(.site-admin, .site-admin-login) .button.mx-success:hover { color: #fff; background: var(--mx-success-hover); border-color: var(--mx-success-hover); }
:is(.site-admin, .site-admin-login) .button.mx-warning { color: #fff; background: var(--mx-warning); border-color: var(--mx-warning); }
:is(.site-admin, .site-admin-login) .button.mx-warning:hover { color: #fff; background: var(--mx-warning-hover); border-color: var(--mx-warning-hover); }
:is(.site-admin, .site-admin-login) .button.danger { color: #fff !important; background: var(--mx-danger) !important; border-color: var(--mx-danger); }
:is(.site-admin, .site-admin-login) .button.danger:hover { background: var(--mx-danger-hover) !important; border-color: var(--mx-danger-hover); }
:is(.site-admin, .site-admin-login) .button.outline { color: var(--mx-default-ink); background: #fff; border-color: var(--mx-default-border); }
:is(.site-admin, .site-admin-login) .button.outline:hover { color: var(--mx-default-ink); background: var(--mx-default-hover); border-color: var(--mx-default-hover-border); }
.site-admin .mini-action.item-add { border-color: var(--mx-success); background: var(--mx-success); }
.site-admin .mini-action.item-add:hover { border-color: var(--mx-success-hover); background: var(--mx-success-hover); }
.site-admin .mini-action.danger { border-color: var(--mx-danger); background: var(--mx-danger); }
.site-admin .mini-action.danger:hover { border-color: var(--mx-danger-hover); background: var(--mx-danger-hover); }

/* An action group (table row or page toolbar): the first two actions show as buttons, the rest
   go in core's ⋯ dropdown (maxeme.js moves them; hidden here until it does, so nothing jumps). */
.mx-actions { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
td .mx-actions { flex-wrap: nowrap; }
.mx-actions:not(.is-grouped) > :nth-child(n+3) { display: none; }
.mx-toolbar { display: flex; margin: 0 20px 16px; }
.mx-title-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.mx-title-actions h1 { margin: 0; }
.site-admin .row-action-dropdown :is(a, button).danger, .site-admin .row-action-dropdown :is(a, button).danger:hover { color: var(--mx-danger); }

.mx-btn-sm { display: inline-flex; align-items: center; justify-content: center; height: 30px; min-height: 30px; padding: 0 12px; border-radius: 5px; font-size: 0.8rem; line-height: 1; }

/* ── Client List ────────────────────────────────────────────────────────── */
.client-table td { white-space: nowrap; }
/* Names open the profile (as View does), without looking like a button. */
.client-table a.mx-row-link { color: var(--mx-primary); font-weight: 600; text-decoration: none; }
.client-table a.mx-row-link:hover { text-decoration: underline; }
/* Every sortable header shows it can be sorted (core only draws the arrow on the sorted column):
   a faint up/down pair, and the sorted column's arrow for its direction. */
.site-admin thead th.is-sortable::after {
    opacity: 0.45;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 9 5-5 5 5'/%3E%3Cpath d='m7 15 5 5 5-5'/%3E%3C/svg%3E");
}
.site-admin thead th.is-sortable:hover::after { opacity: 0.8; }
.site-admin thead th.is-sorted-asc::after,
.site-admin thead th.is-sorted-desc::after {
    opacity: 1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='2.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
.mx-muted-cell { color: var(--muted); }
.mx-colour-field { display: flex; gap: 8px; align-items: center; }
.mx-colour-field input[type=color] { width: 44px; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: 5px; background: #fff; flex: 0 0 auto; }
.mx-template-editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
@media (max-width: 1000px) { .mx-template-editor { grid-template-columns: 1fr; } }
.mx-code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.82rem; line-height: 1.5; white-space: pre; }
.mx-template-tags { padding: 18px 20px; }
.mx-template-tags h2 { margin: 0 0 6px; font-size: 0.92rem; }
.mx-template-tags dl { margin: 12px 0 0; display: grid; gap: 4px; }
.mx-template-tags dd { margin: 0 0 10px; color: var(--muted); font-size: 0.8rem; word-break: break-word; }
.mx-tag { border: 1px solid var(--mx-default-border); border-radius: 5px; background: #fff; padding: 3px 8px; font-family: ui-monospace, Consolas, monospace; font-size: 0.8rem; cursor: pointer; }
.mx-tag:hover { background: var(--mx-default-hover); }
.mx-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(0,0,0,.15); vertical-align: -2px; }
/* The header search boxes (core filter-row: filters[field] in the URL). */
.table-card .filter-row th { padding: 6px 8px; background: #fbfcfe; }
.table-card .filter-row input,
.table-card .filter-row select { width: 100%; min-width: 90px; height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; font-size: 0.8rem; font-weight: 400; }
.client-table td[data-label="Address"], .client-table td[data-label="Note"] { white-space: normal; min-width: 180px; }
.client-table tfoot th, .table-card tfoot th { color: var(--muted); font-size: 0.78rem; font-weight: 500; background: #fbfcfe; }

/* ── Client Profile ─────────────────────────────────────────────────────── */
.mx-profile-tabs { margin: 4px 0 16px; }
.mx-tab-stack { display: grid; gap: 18px; }
.mx-form-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.mx-form-head h2 { margin: 0; font-size: 0.92rem; font-weight: 700; }
.mx-address-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 0 22px 20px; }
@media (max-width: 700px) { .mx-address-cards { grid-template-columns: 1fr; } }
.mx-address-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; background: #fff; }
.mx-address-card p { margin: 0 0 6px; line-height: 1.45; }
.mx-address-card-label { font-weight: 700; }
.mx-empty-line { margin: 0; padding: 0 22px 20px; color: var(--muted); }
.mx-notes-table .mx-note-text { white-space: normal; min-width: 240px; }
/* The rows carry core's .note-entry (app.js's Edit reads data-note from it), which core styles as
   a flex card; here each note is a table row, so keep it one (below 760px core stacks every
   table row as a block, which is right for notes too). */
@media (min-width: 761px) { .mx-notes-table tr.note-entry { display: table-row; padding: 0; } }
/* legacy tr.in_progress td { background-color: #F5EBCC; font-weight: bold } */
tr.in_progress td { background: var(--mx-warning-soft) !important; font-weight: 700; }

/* ── Parts Inventory: click-to-edit cells ───────────────────────────────── */
td.mx-inline { cursor: text; }
td.mx-inline:hover { outline: 1px dashed var(--mx-primary); outline-offset: -3px; }
td.mx-inline.is-editing { outline: 2px solid var(--mx-primary); outline-offset: -3px; }
td.mx-inline input, td.mx-inline select { width: 100%; min-width: 80px; min-height: 30px; font-size: 0.82rem; padding: 2px 6px; }
.table-card td.num { text-align: right; white-space: nowrap; }
.mx-modal-scroll { max-height: 92vh; overflow-y: auto; }
.mx-inline-hint { font-size: 0.78rem; color: var(--muted); margin: 0; }

/* ── Calendars (FullCalendar 6): Schedule › Appointments and the booking form ── */
.calendar-card { padding: 16px; }
.mx-calendar {
    --fc-border-color: var(--line); --fc-today-bg-color: var(--mx-warning-soft);
    --fc-button-bg-color: var(--mx-primary); --fc-button-border-color: var(--mx-primary);
    --fc-button-hover-bg-color: var(--mx-primary-hover); --fc-button-hover-border-color: var(--mx-primary-hover);
    --fc-button-active-bg-color: var(--mx-primary-hover); --fc-button-active-border-color: var(--mx-primary-hover);
}
.mx-calendar .fc-toolbar-title { font-size: 1.25rem; font-weight: 800; }
.mx-calendar .fc-event { cursor: pointer; font-size: 0.75rem; }
.mx-calendar .fc-timegrid-event .fc-event-title { white-space: normal; }
/* Event colour per status (legacy convertAppointmentToArray) */
.mx-calendar .fc-event.appt-new { background: var(--mx-appt-new); border-color: var(--mx-appt-new); }
.mx-calendar .fc-event.appt-in_progress { background: var(--mx-appt-in-progress); border-color: var(--mx-appt-in-progress); }
.mx-calendar .fc-event.appt-complete { background: var(--mx-appt-complete); border-color: var(--mx-appt-complete); }
.mx-calendar .fc-event.appt-extended { background: var(--mx-appt-extended); border-color: var(--mx-appt-extended); }
.mx-calendar .fc-event.appt-no_show { background: var(--mx-appt-no-show); border-color: var(--mx-appt-no-show); }
.mx-calendar .mx-event-lines { overflow: hidden; font-size: 0.78rem; line-height: 1.3; padding: 1px 2px; }
.mx-calendar .mx-event-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mx-calendar .fc-timegrid-event .mx-event-line { white-space: normal; }
/* Day and Week headers read "Tue 11/17 (4)" as in the mockup, not upper case. */
.mx-calendar .fc-col-header-cell-cushion { text-transform: none; }
.mx-calendar .mx-day-count { color: var(--muted); font-weight: normal; }
/* Week / day views: an event the mouse is over comes to the top, whole, over the ones it overlaps. */
.mx-calendar .fc-timegrid-event-harness:hover { z-index: 40 !important; }
.mx-calendar .fc-timegrid-event-harness:hover .fc-timegrid-event { box-shadow: 0 6px 18px rgba(0,0,0,.25); min-height: max-content; }
.mx-calendar .fc-timegrid-event-harness:hover .fc-event-main { overflow: visible; }
.mx-calendar .fc-event.appt-cancelled { background: var(--mx-appt-cancelled); border-color: var(--mx-appt-cancelled); text-decoration: line-through; }
.mx-calendar .fc-event.appt-fixed { cursor: pointer; }
.page-alerts .alert { margin-bottom: 14px; }

/* Icon strip beside a clicked event (legacy css/calendar.css #calendar_event_edit_ui) */
#calendar_event_edit_ui { position: absolute; z-index: 1000; }
#calendar_event_edit_ui ul { list-style: none; margin: 0; padding: 0; }
#calendar_event_edit_ui li { margin-bottom: 2px; }
#calendar_event_edit_ui a, #calendar_event_edit_ui button {
    width: 25px; height: 25px; padding: 0; display: grid; place-items: center;
    border: 0; border-radius: 4px; color: #fff; cursor: pointer;
}
#calendar_event_edit_ui .client_info_btn { background: var(--mx-success); }
#calendar_event_edit_ui .view_event_btn { background: var(--mx-primary); }
#calendar_event_edit_ui .checkin_event_btn { background: var(--mx-warning); }
#calendar_event_edit_ui .delete_event_btn { background: var(--mx-danger); }

/* Booking form: form 35% | calendar; in day view the slot detail sits beside the day grid */
.appt-layout { display: grid; grid-template-columns: minmax(260px, 35%) 1fr; gap: 18px; align-items: start; }
.appt-layout .form-card { padding: 22px; }
.appt-form-grid { grid-template-columns: 1fr; }
.appt-form-grid input[readonly] { background: none; }
.appt-start-time { display: block; min-height: 38px; padding: 8px 11px; border: 1.5px solid #d1d5db; border-radius: var(--radius-sm); font-weight: 500; color: var(--ink); }
.appt-duration { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.appt-duration input { width: 80px; }
.appointment-calendar-wrap.is-day { display: grid; grid-template-columns: 52% 1fr; gap: 14px; align-items: start; }
.appointment-calendar-wrap .fc-timegrid-slot-label { color: var(--mx-primary-hover); }
.appointment-calendar-wrap .fc-event { border: none; background: none; box-shadow: none; }
.appointment-calendar-wrap .fc-event .fc-title { text-align: center; color: #555; padding-top: 1px; font-size: 0.75rem; }
.appointment-calendar-wrap .fc-timegrid-event:hover, .appointment-calendar-wrap .fc-event.is-picked { background: var(--mx-primary-hover); }
.appointment-calendar-wrap .fc-timegrid-event:hover .fc-title, .appointment-calendar-wrap .fc-event.is-picked .fc-title { color: #fff; }
.app-count { background-color: grey; border-radius: 2px; color: #fff; font-size: 12px; padding: 1px 4px; }
.app-count.has-event, .app-count.full { background-color: var(--mx-primary-hover); font-weight: bold; }
.appointment-calendar-wrap .daily_count .fc-title { line-height: 2; }
.appointment-calendar-wrap .daily_count span { background-color: var(--mx-primary-hover); border-radius: 2px; color: #fff; font-size: 12px; padding: 1px 4px; }
#timeslot-detail { border: 1px solid var(--line); height: 401px; padding: 1px 8px; margin-top: 52px; }
#timeslot-detail h5 { text-align: center; margin: 10px 0; font-size: 0.85rem; }
#timeslot-detail-time { background-color: grey; border-radius: 2px; color: #fff; font-size: 12px; padding: 1px 4px; }
#timeslot-detail-list { height: 340px; overflow-y: auto; }
.timeslot-detail-event { background-color: var(--mx-primary-hover); border-radius: 4px; color: #fff; font-size: 12px; margin: 0 0 4px 7px; padding: 2px 6px; width: 90%; }
#delete-modal .delete-modal-body { white-space: pre-line; }
@media (max-width: 900px) { .appt-layout, .appointment-calendar-wrap.is-day { grid-template-columns: 1fr; } #timeslot-detail { margin-top: 0; } }

/* ── Invoice builder (legacy invoice_builder.css) ───────────────────────── */
.mx-builder-body { display: grid; gap: 20px; margin: 0 20px 20px; }
.site-admin .mx-builder-body > .detail-page-card { margin-left: 0; margin-right: 0; }
.mx-builder-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.mx-builder-cards .form-card, .mx-created-on .form-card { margin: 0; }
.mx-created-on .form-card { max-width: 560px; }
@media (max-width: 980px) { .mx-builder-cards { grid-template-columns: 1fr; } }
.mx-mileage { display: flex; align-items: center; gap: 8px; }
.mx-mileage span { font-weight: 600; color: var(--muted); }
.mx-item-table td { vertical-align: top; }
.mx-item-table th.num, .mx-item-table td.num { width: 9em; text-align: center; }
.mx-item-table th.ctl, .mx-item-table td.ctl { width: 92px; text-align: center; white-space: nowrap; }
.mx-item-table tr.tfoot td { border-bottom: 0; }
.mx-item-table tr.tfoot td:first-child { text-align: right; font-weight: 700; color: var(--ink); }
.mx-item-table tr.tfoot td.amount { font-weight: 600; text-align: center; }
.mx-item-table tr#total-row td { font-size: 1rem; font-weight: 800; color: var(--admin-blue-hover); border-top: 2px solid var(--line); }
.mx-item-table tr.item-row + tr.tfoot td { border-top: 2px solid var(--line); }
.mx-name-group { position: relative; display: flex; gap: 8px; align-items: center; }
.mx-name-group input.item-name-search, .mx-name-group input.part-name-search { flex: 1; }
.mx-item-table .mini-action { width: 26px; height: 26px; font-size: 0.95rem; line-height: 1; }
.mx-tax-input { width: 64px !important; display: inline-block !important; margin-right: 4px; }
.mx-parts-list { list-style: none; margin: 8px 0 0 18px; padding: 0; }
.mx-parts-list li.part-row { position: relative; display: flex; gap: 8px; align-items: center; margin-bottom: 6px; padding-left: 10px; border-left: 2px solid var(--mx-primary-light); }
.mx-parts-list li.part-row .mx-name-group { flex: 1; }
.mx-parts-list li.part-row input.part-quantity-field { width: 76px; }
.mx-ac-menu { position: absolute; top: 100%; left: 0; right: 0; z-index: 50; margin-top: 2px; max-height: 260px; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.mx-ac-menu .cat { padding: 6px 10px; font-size: 0.72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: var(--line-light); border-bottom: 1px dashed var(--line); }
.mx-ac-menu a { display: flex; justify-content: space-between; gap: 12px; padding: 7px 10px; color: var(--ink-body); text-decoration: none; font-size: 0.85rem; }
.mx-ac-menu a:hover { background: var(--mx-primary-soft); }
.mx-ac-menu a small { color: var(--muted); }
.mx-ac-menu mark { background: transparent; color: var(--mx-danger); font-weight: 700; }
.mx-ac-menu.is-floating { position: fixed; right: auto; margin-top: 0; z-index: 2000; }
.mx-ac-empty { padding: 8px 10px; font-size: 0.8rem; color: var(--muted); }
.mx-email-error { color: var(--mx-danger); font-size: 0.82rem; min-height: 1em; margin: 4px 0 0; }
.mx-help { font-size: 0.8rem; color: var(--muted); margin: 8px 0 0; }

/* ── Printable invoice / work order page ────────────────────────────────── */
.invoice-page-container { padding: 24px 20px 30px; max-width: 860px; margin: 0 auto; }
.invoice-document tbody tr:hover, .invoice-document tbody tr:hover td { background: transparent !important; }
.invoice-document select { min-height: 28px; padding: 2px 8px; font-size: 11.5px; width: auto; display: inline-block; }
@media print {
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
    html, body { background: #fff !important; margin: 0 !important; padding: 0 !important; }
    .topbar, .site-footer, .admin-content-header, .no-print, .toast, .delete-modal-overlay, .admin-modal-overlay { display: none !important; }
    .app-shell, .content-frame, #main-content, .invoice-page-container { display: block !important; padding: 0 !important; margin: 0 !important; width: 100% !important; max-width: none !important; border: none !important; background: #fff !important; }
    .invoice-document { border: none !important; }
    .invoice-document select { border: 0; appearance: none; -webkit-appearance: none; padding: 0; }
    .invoice-table tr { page-break-inside: avoid; }
}

/* ── Summary Report (legacy list_report.css) ────────────────────────────── */
.mx-report-query { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 16px 20px; font-size: 0.875rem; font-weight: 600; color: var(--ink-body); }
.mx-report-query input { width: 150px; }
.mx-report-query .field-error { flex-basis: 100%; margin: 0; color: var(--mx-danger); }
.mx-report-tabs { padding: 0 20px; border-bottom: 1px solid var(--line); margin-bottom: 0; }
.list-report-table td.positive { color: var(--mx-success); font-weight: 600; }
.list-report-table td.negative { color: var(--mx-danger); font-weight: 600; }
.list-report-table td.num, .list-report-table th.num { text-align: right; }
.list-report-table tfoot td { border-top: 3px solid var(--ink-body); font-weight: 800; padding-top: 10px; padding-bottom: 10px; }

/* ── Reminder Todo's ────────────────────────────────────────────────────── */
.reminder-table td { vertical-align: top; }
.reminder-table ul { margin: 4px 0 0; padding-left: 18px; }
.phone-line { display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.phone-line svg { color: var(--muted); }
.muted-line { color: var(--muted); font-size: 0.82rem; }

/* Config › Roles & Access */
.mx-muted { color: var(--muted-soft); }
.mx-code-list { display: flex; flex-wrap: wrap; gap: 6px; }
#role-route-table .mx-group-row th { background: var(--line); text-align: left; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
#role-route-table tr.mx-denied td { color: var(--muted-soft); }
#role-matrix td, #role-matrix th { white-space: nowrap; }

/* Logs › Activity Log */
.mx-log-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 14px; align-items: end; }
.mx-log-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; }
.mx-log-filter-actions { display: flex; gap: 8px; }
.mx-role-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.mx-role-chips .badge { text-decoration: none; }

/* Config › Manage Admins: one colour per staff role (class mx-role-{permissionKey}). */
.badge.mx-role.mx-role-tech-support { color: #ffffff; background: #334155; }
.badge.mx-role.mx-role-super-admin { color: #9f1239; background: #ffe4e6; }
.badge.mx-role.mx-role-admin { color: #9a3412; background: #ffedd5; }
.badge.mx-role.mx-role-secretary-1 { color: #6b21a8; background: #f3e8ff; }
.badge.mx-role.mx-role-secretary-2 { color: #3730a3; background: #e0e7ff; }
.badge.mx-role.mx-role-receptionist { color: #0f766e; background: #ccfbf1; }
.badge.mx-role.mx-role-technician { color: #3f6212; background: #ecfccb; }
.mx-change-list { margin: 0; padding-left: 14px; font-size: 0.82rem; }
.mx-change-list li { word-break: break-word; }
.mx-nowrap { white-space: nowrap; }

/* Choose a client (the sidebar "+" that needs a client first) */
.mx-pick-search { display: flex; gap: 8px; }
.mx-pick-search input { flex: 1; }
.mx-count-footer { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mx-count-footer label { display: flex; flex-direction: column; gap: 4px; min-width: 240px; }

/* A checkbox row in a label-left form: the text in the label column, the box on the left of the
   input column (the text comes first in the markup). */
.form-grid > label.mx-check > input[type="checkbox"] { justify-self: start; }
.form-grid > label.mx-check small { display: block; }

/* A sectioned popup (mockup clients.html): a head with eyebrow + title + ×, a two-column body with
   each label above its input, and a grey foot holding Cancel / Save.
   <div class="admin-modal mx-modal-wide mx-modal-sectioned">
     <div class="mx-modal-head"><div><p class="eyebrow">…</p><h2>…</h2></div><button class="admin-modal-x">×</button></div>
     <form><div class="mx-modal-body form-grid inline-form-grid">…</div><div class="mx-modal-foot">…</div></form>
   </div>
   .mx-form-two is the same two-column, label-above grid for a form on a page (Client Profile). */
.admin-modal.mx-modal-sectioned { padding: 0; }
.mx-modal-sectioned .mx-modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.mx-modal-sectioned .mx-modal-head > div { flex: 1; }
.mx-modal-sectioned .mx-modal-head .eyebrow { margin: 0 0 4px; }
.mx-modal-sectioned .mx-modal-head h2 { margin: 0; font-size: 1rem; }
.mx-modal-sectioned .mx-modal-head .admin-modal-x { position: static; flex: none; width: 30px; height: 30px; font-size: 18px; border-color: transparent; }
.site-admin .mx-modal-sectioned .form-grid.inline-form-grid.mx-modal-body,
.site-admin .form-grid.inline-form-grid.mx-form-two { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 12px 16px; }
.site-admin .mx-modal-sectioned .form-grid.inline-form-grid.mx-modal-body { padding: 18px 20px; }
.site-admin .form-grid.inline-form-grid.mx-form-two > .span-2 { grid-column: 1 / -1; }
.site-admin .mx-modal-sectioned .form-grid.inline-form-grid.mx-modal-body > .span-2 { grid-column: 1 / -1; }
.mx-modal-sectioned .mx-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); background: #fafbfc; border-radius: 0 0 12px 12px; }
@media (max-width: 640px) {
    .site-admin .mx-modal-sectioned .form-grid.inline-form-grid.mx-modal-body,
    .site-admin .form-grid.inline-form-grid.mx-form-two { grid-template-columns: 1fr; }
}

/* A field the person has changed and left in a shape its pattern / type / length rejects. */
.site-admin input:user-invalid, .site-admin textarea:user-invalid, .site-admin select:user-invalid { border-color: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 15%, transparent); }

/* A page form holding several cards (the service page): each card and the Cancel / Save row below
   them share the header's 20px inset, so they line up with each other, and sit 20px apart. */
.site-admin .content-frame > form > :is(.form-card, .table-card, .mx-card, .form-actions) { margin: 20px 20px 0; }
.site-admin .content-frame > form > .form-actions { display: flex; align-items: center; }
.site-admin .content-frame > form > .form-actions .button { width: auto; }

/* The Services list's Service Lines cell: one line per row, small. */
.mx-service-lines { margin: 0; padding: 0; list-style: none; font-size: 0.8rem; line-height: 1.5; }
.mx-service-lines li { white-space: nowrap; }
.mx-service-lines .badge { font-size: 0.68rem; padding: 1px 6px; }

/* The service page's "+ Add line", under its lines table. */
.mx-line-actions { padding: 12px 16px; }

/* Cancel / Save (and the buttons beside them) sit 5px apart, on every form and popup. */
.site-admin .form-actions, .site-admin .form-card .form-actions, .mx-modal-sectioned .mx-modal-foot { gap: 5px; }

/* The star after a required field's label. */
.mx-req { color: var(--red); font-weight: 700; }

/* A label-left form row whose label carries a hint: the hint sits under the label text, in the label column. */
.site-admin .form-grid:not(.inline-form-grid) > label > span > small.muted-line { display: block; margin-top: 2px; font-weight: 400; }

/* A checkbox in a sectioned popup (mockup labour.html): a bordered box, its label on the left, the tick on the right. */
.mx-modal-sectioned .mx-modal-body > label.mx-check { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 8px; border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; font-weight: 600; }
.mx-modal-sectioned .mx-modal-body > label.mx-check small { display: block; font-weight: 400; }
.mx-modal-sectioned .mx-modal-body > label.mx-check input[type="checkbox"] { justify-self: end; }

/* ── Repair order page (templates/maxeme/repair_order/form.html.twig) ───────────────────────── */
/* Customer · Vehicle · Visit, side by side (stacked on a phone). */
.mx-ro-head { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 28px; align-items: start; }
@media (max-width: 980px) { .mx-ro-head { grid-template-columns: 1fr; } }
.mx-ro-col { display: grid; gap: 10px; align-content: start; }
.mx-ro-col > .button { justify-self: start; width: auto; }
.mx-ro-info { font-size: 0.88rem; line-height: 1.6; }
.mx-ro-new { display: grid; gap: 8px; padding: 10px; border: 1px dashed var(--line); border-radius: 6px; }
.mx-ro-new[hidden] { display: none; }
/* A card holding several tables (the repair order's services): .table-card's look, without its list script. */
.mx-card { border: 1.5px solid var(--line); background: #fff; padding-bottom: 4px; }
.mx-ro-field { display: grid; gap: 4px; font-weight: 600; font-size: 0.85rem; }
.site-admin .is-invalid { border-color: var(--red); }
/* A service: its name, category, price and Delete on one row; its lines under it. */
#ro-jobs { display: grid; gap: 14px; padding: 14px 16px 0; }
.mx-job { border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.mx-job-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; background: var(--line-light); border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0; }
.mx-job-number { font-weight: 800; min-width: 1.6em; }
.mx-job-name { flex: 1 1 280px; }
.mx-job-name .mx-name-group input { flex: 1; }
.mx-job-category { white-space: nowrap; }
.mx-job-price { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.mx-job-price input { width: 110px; text-align: right; }
.mx-job .mx-lines-table { font-size: 0.88rem; }
/* Appointments: label and its date/time input together. */
/* Client Profile form in four columns (mockup e0fde70); the Appointments card's group rows. */
.site-admin .form-grid.inline-form-grid.mx-form-two.mx-form-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .site-admin .form-grid.inline-form-grid.mx-form-two.mx-form-four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .site-admin .form-grid.inline-form-grid.mx-form-two.mx-form-four { grid-template-columns: 1fr; } }
.mx-group-row td { background: var(--line-light); }

/* Appointments › List (mockup deba1ef). */
.mx-list-views { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.mx-list-views h2 { flex: 1 1 auto; text-align: center; margin: 0; }
.mx-list-views .is-active { background: var(--mx-primary, #206eb8); color: #fff; }
.mx-inline-form { display: inline-flex; margin: 0; }
.mx-appt-badge { color: #fff; }
.mx-appt-badge.appt-new { background: var(--mx-appt-new); }
.mx-appt-badge.appt-in_progress { background: var(--mx-appt-in-progress); }
.mx-appt-badge.appt-complete { background: var(--mx-appt-complete); }
.mx-appt-badge.appt-extended { background: var(--mx-appt-extended); }
.mx-appt-badge.appt-no_show { background: var(--mx-appt-no-show); }
.mx-appt-badge.appt-cancelled { background: var(--mx-appt-cancelled); }

/* Calendar drag (mockup d6f741f): the landing line and time, and the moving block outlined. */
.mx-calendar .fc-timegrid-body { position: relative; }
.mx-drag-line { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid #dc2626; z-index: 5; pointer-events: none; }
.mx-drag-time { position: absolute; left: 2px; transform: translateY(-50%); background: #dc2626; color: #fff; font-size: 0.7rem; font-weight: 700; padding: 1px 5px; border-radius: 3px; z-index: 6; pointer-events: none; }
.mx-calendar .fc-event-mirror { border: 2px dashed #dc2626 !important; background: rgba(220, 38, 38, 0.10) !important; color: #991b1b !important; }
.mx-calendar .fc-event-mirror .mx-event-line { color: #991b1b; }
.mx-appt-field { display: flex; flex-direction: column; align-items: stretch; gap: 3px; }
.mx-appt-field strong, .mx-appt-label { white-space: nowrap; }
.mx-appt-label { display: block; font-size: 0.72rem; font-weight: 600; color: var(--muted); }
.mx-appt-field .appt-duration { width: 6em; }
/* Totals, with the custom fee / discount rows between the subtotal and the taxes. */
.mx-ro-totals .mx-ro-label { text-align: right; font-weight: 600; }
.mx-ro-totals td.num { width: 140px; }
.mx-ro-totals .mx-charge-fields { display: flex; gap: 8px; justify-content: flex-end; }
.mx-ro-totals .charge-kind { width: auto; }
.mx-ro-totals .charge-label { max-width: 320px; }
.mx-ro-totals .charge-amount { width: 120px; text-align: right; }
.mx-ro-totals .mx-ro-total td { font-size: 1.05rem; font-weight: 800; }
/* A service with no lines: a short note, not a tall empty table. */
.mx-lines-editor .mx-lines-empty { margin: 0; padding: 10px 16px; }
.mx-ro-after { display: grid; gap: 20px; margin: 20px 20px 0; }

/* A list row's leading search icon (the Client List's, as the legacy app had): opens the record, as View does. */
.mx-row-icon-col { width: 1%; white-space: nowrap; }
.mx-row-icon { display: inline-flex; align-items: center; justify-content: center; padding: 4px 7px; }
.mx-row-icon svg { width: 14px; height: 14px; }

/* ── Documents: the action bar's named menus (Invoice PDF ▾ …), charge-through rows, the email page ── */
.mx-doc-actions { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.mx-menu { position: relative; }
.mx-menu > summary { list-style: none; cursor: pointer; }
.mx-menu > summary::-webkit-details-marker { display: none; }
.mx-menu-list { position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; min-width: 170px; display: grid; padding: 4px; background: var(--card, #fff); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.mx-menu-list a, .mx-menu-list button { display: block; width: 100%; padding: 7px 10px; text-align: left; border: 0; background: none; color: var(--ink-body); font: inherit; font-size: 0.88rem; text-decoration: none; border-radius: 5px; cursor: pointer; }
.mx-menu-list a:hover, .mx-menu-list button:hover { background: var(--mx-primary-soft); }
.invoice-table tr.charge-through td { color: #475569; }
.invoice-table .ct-mark { padding-left: 10px; color: #94a3b8; }
.mx-ct-name { display: flex; align-items: center; gap: 8px; }
.mx-ct-row .mx-ct-name { padding-left: 18px; }
.mx-attachment { display: flex; align-items: center; gap: 10px; }
.mx-attachment-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--line-light); font-size: 0.85rem; }
.mx-ro-docbar { margin-bottom: 8px; }
@media print { .mx-ro-docbar, .mx-menu, .mx-docnav { display: none !important; } }
/* A repair order's document switcher beside its title (mockup 345c037). */
.mx-docnav { display: inline-flex; align-items: stretch; margin-left: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 0.82rem; vertical-align: middle; }
.mx-docnav > a, .mx-docnav > .mx-docnav-menu > summary { display: inline-flex; align-items: center; gap: 4px; padding: 5px 14px; color: var(--ink-body); text-decoration: none; }
.mx-docnav > * + * { border-left: 1px solid var(--line); }
.mx-docnav > a:hover, .mx-docnav > .mx-docnav-menu > summary:hover { background: var(--mx-primary-soft); }
.mx-docnav > :first-child { border-radius: 7px 0 0 7px; }
.mx-docnav > :last-child, .mx-docnav > :last-child > summary { border-radius: 0 7px 7px 0; }
.mx-docnav .is-current { background: var(--mx-primary, #3071a9); color: #fff; }
.mx-docnav .mx-menu-list { min-width: 260px; }
.mx-docnav .mx-menu-list a.is-current { background: var(--mx-primary-soft); color: inherit; }
.mx-menu-note { display: block; padding: 6px 10px; }
/* The More (⋯) menu at the end of a header's actions opens to the left. */
.mx-more .mx-menu-list { left: auto; right: 0; min-width: 190px; }
.mx-doc-head .panel-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }

/* ── Vehicle page: details beside its stats, the history filters ── */
.mx-vehicle-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin: 20px 20px 0; align-items: start; }
@media (max-width: 980px) { .mx-vehicle-top { grid-template-columns: 1fr; } }
.mx-vehicle-top .form-card { margin: 0; }
.mx-dl { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 6px 14px; margin: 10px 0 0; }
.mx-dl dt { font-weight: 600; color: var(--muted); }
.mx-dl dd { margin: 0; }
.mx-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.mx-stat { display: grid; gap: 4px; padding: 16px; border: 1.5px solid var(--line); background: #fff; }
.mx-stat-value { font-size: 1.35rem; font-weight: 800; color: var(--ink); }
.mx-stat-label { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.mx-history-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mx-history-filter select { width: auto; min-width: 180px; }

/* Click-to-edit cells (maxeme.js td[data-inline-field]): a hint on hover, the field while editing. */
.site-admin td[data-inline-field] { cursor: text; }
.site-admin td[data-inline-field]:not(.is-editing):hover { background: var(--mx-primary-soft); box-shadow: inset 0 -2px 0 var(--mx-primary); }
.site-admin td[data-inline-field].is-editing input, .site-admin td[data-inline-field].is-editing select { width: 100%; min-width: 90px; }

/* A report's time filter: [preset] From [ ] to [ ] [Run]. */
.mx-period { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.mx-period-field { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.mx-period-field select, .mx-period-field input { width: auto; }

/* Service Reminder Queue: phone numbers past the second behind a +, and the email preview. */
.mx-more-lines summary { cursor: pointer; display: inline-block; font-weight: 700; padding: 0 6px; border: 1px solid var(--line, #d8dee9); border-radius: 4px; line-height: 1.3; }
.mx-more-lines summary::-webkit-details-marker { display: none; }
.mx-reminder-email { padding: 16px 20px; }
.mx-reminder-email-meta { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 14px; }
.mx-reminder-email-meta dt { font-weight: 600; }
.mx-reminder-email-meta dd { margin: 0; }
.mx-reminder-email-body { width: 100%; min-height: 420px; border: 1px solid var(--line, #d8dee9); border-radius: 6px; background: #fff; }

/* Work Order Board: one card per category, in the vehicle's order; the current one is outlined. */
.mx-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; padding: 16px 20px 6px; }
.mx-board-stage { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: inherit; text-decoration: none; position: relative; }
.mx-board-stage:hover { border-color: var(--mx-primary, #3071a9); }
.mx-board-stage.is-current { border-color: var(--mx-primary, #3071a9); box-shadow: 0 0 0 2px rgba(48, 113, 169, 0.18); }
.mx-board-step { position: absolute; top: 10px; right: 12px; font-size: 0.75rem; font-weight: 700; color: var(--muted, #64748b); }
.mx-board-label { font-weight: 600; font-size: 0.85rem; padding-right: 18px; }
.mx-board-count { font-size: 1.9rem; font-weight: 700; line-height: 1.1; color: var(--mx-primary, #3071a9); }
.mx-board-total { font-size: 0.85rem; color: var(--muted, #64748b); }
.mx-board-note { padding: 0 20px 14px; }
/* Repair Order Board kanban (mockup aa322bb): one column per repair order status. */
.mx-kb { display: grid; grid-template-columns: repeat(9, minmax(215px, 1fr)); gap: 10px; padding: 12px 20px 8px; overflow-x: auto; align-items: start; }
.mx-kb-col { background: #f3f7fb; border: 1px solid var(--line); border-radius: 10px; padding: 8px; min-height: 140px; display: flex; flex-direction: column; gap: 8px; position: relative; }
.mx-kb-col.is-over { outline: 2px dashed var(--mx-primary, #3071a9); outline-offset: -3px; }
.mx-kb-col.is-current { border-color: var(--mx-primary, #3071a9); }
.mx-kb-head { display: flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; padding: 2px 2px 4px; }
.mx-kb-head .mx-board-step { position: static; }
.mx-kb-head:hover .mx-kb-label { text-decoration: underline; }
.mx-kb-label { font-weight: 700; font-size: 0.82rem; line-height: 1.25; flex: 1; }
.mx-kb-sum { text-align: right; font-size: 0.75rem; color: var(--muted, #64748b); line-height: 1.25; }
.mx-kb-sum b { display: block; font-size: 1.05rem; color: inherit; }
.mx-kb-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font-size: 0.82rem; display: flex; flex-direction: column; gap: 3px; }
.mx-kb-card[draggable="true"] { cursor: grab; }
.mx-kb-card.dragging { opacity: 0.4; }
.mx-kb-card:hover { border-color: var(--mx-primary, #3071a9); box-shadow: 0 3px 10px rgba(0, 0, 0, 0.07); }
.mx-kb-top { display: flex; justify-content: space-between; gap: 6px; font-weight: 700; }
.mx-kb-top a { text-decoration: none; }
.mx-kb-name { font-weight: 600; }
.mx-kb-meta { color: var(--muted, #64748b); font-size: 0.78rem; }
.mx-kb-foot { display: flex; justify-content: space-between; gap: 6px; font-size: 0.75rem; margin-top: 3px; }
.mx-kb-tech { background: #e8f0f8; color: var(--mx-primary, #3071a9); border-radius: 20px; padding: 1px 8px; }
.mx-kb-empty { color: var(--muted, #64748b); font-size: 0.78rem; text-align: center; padding: 14px 4px; }
.mx-kb-more { font-size: 0.78rem; text-align: center; }

/* The invoice builder's charge-through lines under a service (read-only), and on the printed invoice. */
.mx-charge-through { list-style: none; margin: 4px 0 0; padding: 0 0 0 4px; font-size: 0.8rem; }

/* The footer, as in the mockup (mockup-maxeme-auto mx.css .footer): one slim line,
   "© 2026 Maxeme Auto · Powered by Restobox", fixed to the bottom of the window beside the sidebar.
   The content frame keeps 80px clear at its bottom, so nothing hides behind it. */
.site-admin .site-footer {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    margin: 0; padding: 14px 24px; gap: 6px;
    justify-content: flex-start; text-align: left; font-size: 0.75rem;
}
.site-admin .site-footer .footer-powered::before { content: '·'; margin-right: 6px; }
.site-admin .content-frame { padding-bottom: 80px; }
/* A short page stays white down to the footer (no grey band under the content). */
@media (min-width: 981px) { .site-admin .content-frame { min-height: calc(100vh - 48px); box-sizing: border-box; } }
@media (min-width: 981px) {
    .site-admin .site-footer { left: 218px; margin: 0; transition: left 220ms ease; }
    body.admin-sidebar-collapsed.site-admin .site-footer { left: 76px; margin: 0; }
}
@media (max-width: 980px) {
    .site-admin .site-footer { flex-direction: row; align-items: center; }
}

/* Scrollbars (mockup 9f94e48): slim rounded thumb on a clear track, no arrow buttons. */
::-webkit-scrollbar { width: 12px; height: 12px; background: transparent; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c3c8d1; border: 3px solid transparent; border-radius: 999px; background-clip: padding-box; min-height: 36px; }
::-webkit-scrollbar-thumb:hover { background: #9aa3b2; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: #c3c8d1 transparent; } }

/* Movement History (mockup 1cb62e9): From and To stacked, so they don't run into the Type filter. */
.filter-row th:has(> input[name="filters[from]"]) { min-width: 150px; }
.filter-row input[name="filters[from]"], .filter-row input[name="filters[to]"] { display: block; width: 100%; }
.filter-row input[name="filters[from]"] { margin-bottom: 4px; }

/* KM / MILES beside a mileage box (mockup 986d771). */
.mx-mileage .mx-unit-select { width: auto; flex: 0 0 auto; font-weight: 600; }

/* A repair order service's technician and work status (mockup 169b599). */
.mx-job-work { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 8px 12px; background: #f6f8fb; border-bottom: 1px solid var(--line); }
.mx-job-work label { display: inline-flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--muted, #64748b); }
.mx-job-work select { min-width: 160px; }
/* A repair order's own GST % / PST % in its Totals box (mockup 55f432c). */
.mx-rate-input { width: 64px; height: 26px; padding: 2px 6px; text-align: right; }
.mx-field-error { margin: 2px 0; color: var(--mx-danger, #b42318); font-size: 0.82rem; text-align: right; }
/* A page notice with an action on the right (offer to complete and lock, offer to issue the invoice, paid lock). */
.mx-alert { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 0 0 12px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.mx-alert p { margin: 4px 0 0; }
.mx-alert-info { border-color: #b6d4f0; background: #f0f7fd; }
.mx-alert-warn { border-color: #f1d18a; background: #fff9eb; }
.mx-alert-actions { display: flex; gap: 8px; align-items: center; }
/* A paid, locked repair order (mockup ee7a843): no add / delete buttons. */
#repair-order-form[data-locked] .job-remove, #repair-order-form[data-locked] .charge-remove, #repair-order-form[data-locked] .line-remove,
#repair-order-form[data-locked] #ro-job-add, #repair-order-form[data-locked] #ro-charge-add, #repair-order-form[data-locked] .mx-lines-add { display: none !important; }
/* Several roles per staff account (mockup 3d5095e): a row of checkboxes. */
.mx-roles-field { display: grid; gap: 6px; }
.mx-check-row { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.mx-check-row .mx-check { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.mx-level-badges { display: inline-flex; flex-wrap: wrap; gap: 3px; }
/* An invoice's internal Remark above the document (mockup d2fbfc8). */
.mx-remark-card { margin-bottom: 12px; }
.mx-remark-form { display: flex; gap: 8px; align-items: flex-start; margin-top: 6px; }
.mx-remark-form textarea { flex: 1; min-height: 44px; }
/* Payment report: the payment-method checkbox list and the Remark column (mockups c857353, df38f34). */
.mx-method-filter > summary { padding: 0 7px; height: 30px; line-height: 30px; background: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.mx-method-list { min-width: 180px; max-height: 60vh; overflow: auto; }
.mx-method-option { display: flex !important; align-items: center; gap: 8px; padding: 4px 6px; font-weight: normal; text-transform: none; letter-spacing: 0; white-space: nowrap; }
.mx-method-option input, .table-card .filter-row .mx-method-option input { width: 14px; height: 14px; margin: 0; flex: none; }
.mx-remark-cell { min-width: 260px; white-space: normal; }
.mx-remark-cell .mx-remark-text { white-space: pre-wrap; }
.mx-remark-edit { border: 0; background: none; cursor: pointer; color: #6b7280; padding: 0 2px; margin-left: 4px; }

/* Dashboard (mockup 345c037): work on the left, Needs attention and unpaid invoices on the right. */
.mx-dash { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 14px; align-items: start; }
@media (max-width: 1000px) { .mx-dash { grid-template-columns: 1fr; } }
.mx-dash .table-card { margin-bottom: 14px; }
.mx-dash .table-header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.mx-dash .table-header a { font-size: .85rem; font-weight: 500; }
.mx-dash-empty { margin: 6px 12px 10px; }
.mx-dash-todo a { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border, #e5e7eb); color: inherit; text-decoration: none; }
.mx-dash-todo a:last-child { border-bottom: 0; }
.mx-dash-todo a:hover { background: var(--primary-soft, #eef2ff); }
.mx-dash-todo b { min-width: 2ch; text-align: right; }
.mx-dash-todo b.is-zero { color: var(--muted, #6b7280); font-weight: 400; }
.mx-dash-todo small { color: var(--muted, #6b7280); }

/* MxConfirm (maxeme.js): a question that is not a delete, in the shared #delete-modal. */
.delete-modal-overlay.mx-confirm .delete-modal-icon {
    background: var(--mx-primary-soft);
    color: var(--mx-primary);
}
.delete-modal-overlay.mx-confirm .delete-modal-confirm {
    background: var(--mx-primary) !important;
    border-color: var(--mx-primary) !important;
}
.delete-modal-overlay.mx-confirm .delete-modal-confirm:hover {
    background: var(--mx-primary-hover) !important;
    border-color: var(--mx-primary-hover) !important;
}
/* Its text keeps its line breaks (the appointment summary is one line per field). */
.delete-modal-overlay.mx-confirm .delete-modal-body {
    white-space: pre-line;
}
