/* ==========================================================================
   BSC BMS - Dashboard design system (shared by AMS and JMS)
   Started in the Scheduling App (JMS); AMS additions (vehicle colours) are in
   the "AMS" section near the end, BMS additions (app chooser) at the very end.

   All classes are prefixed "dash-" so they cannot affect navbar.html or
   any other page. Built on the existing local Bootstrap 5.3 + Bootstrap Icons.
   ========================================================================== */

:root {
    /* Brand (from the BSC logo) */
    --dash-primary: #1769C2;
    --dash-primary-hover: #11549C;
    --dash-primary-soft: #E7F0FA;
    --dash-accent: #F2A900;
    --dash-accent-soft: #FFF4D6;
    --dash-accent-ink: #8A5A00;

    /* Neutrals */
    --dash-ink: #1F2937;
    --dash-muted: #5B6575;
    --dash-border: #E3E8EF;
    --dash-canvas: #F4F6F9;
    --dash-surface: #FFFFFF;

    /* Product tints */
    --dash-fencing-bg: var(--dash-accent-soft);
    --dash-fencing-ink: var(--dash-accent-ink);
    --dash-shed-bg: var(--dash-primary-soft);
    --dash-shed-ink: var(--dash-primary);
    --dash-carport-bg: #E3F4F2;
    --dash-carport-ink: #0F766E;

    /* Shape & depth */
    --dash-radius: 12px;
    --dash-radius-sm: 8px;
    --dash-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
    --dash-shadow-hover: 0 8px 24px rgba(16, 24, 40, 0.10), 0 2px 6px rgba(16, 24, 40, 0.06);
    --dash-focus: 0 0 0 3px rgba(23, 105, 194, 0.35);

    --dash-font: system-ui, "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto,
                 "Helvetica Neue", Arial, sans-serif;
}

/* Canvas colour only - body padding for the fixed navbars stays with navbar.html */
body.dash-body {
    background: var(--dash-canvas);
}

/* --------------------------------------------------------------------------
   Page container
   -------------------------------------------------------------------------- */
.dash-page {
    font-family: var(--dash-font);
    color: var(--dash-ink);
    font-size: 0.95rem;
    line-height: 1.5;
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 24px 40px;
    text-align: left;
}

@media (max-width: 575.98px) {
    .dash-page {
        padding: 18px 16px 28px;
    }
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.dash-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.dash-eyebrow {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dash-primary);
    margin-bottom: 4px;
}

.dash-title {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
    color: var(--dash-ink);
}

.dash-subtitle {
    color: var(--dash-muted);
    margin: 6px 0 0;
}

.dash-title-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

@media (max-width: 575.98px) {
    .dash-title {
        font-size: 1.45rem;
    }
}

/* --------------------------------------------------------------------------
   Breadcrumb & back
   -------------------------------------------------------------------------- */
.dash-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

/* .breadcrumb.dash-breadcrumb: navbar.html re-loads Bootstrap after this file,
   so the selector must out-rank Bootstrap's .breadcrumb to keep margin-bottom at 0 */
.breadcrumb.dash-breadcrumb {
    --bs-breadcrumb-divider: "\203A";
    --bs-breadcrumb-margin-bottom: 0;
    margin-bottom: 0;
    font-size: 0.875rem;
}

.dash-breadcrumb .breadcrumb-item a {
    color: var(--dash-primary);
    text-decoration: none;
    font-weight: 600;
}

.dash-breadcrumb .breadcrumb-item a:hover {
    text-decoration: underline;
}

.dash-breadcrumb .breadcrumb-item.active {
    color: var(--dash-muted);
}

/* --------------------------------------------------------------------------
   Section labels
   -------------------------------------------------------------------------- */
.dash-section-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dash-muted);
    margin: 0 0 12px;
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.dash-card {
    position: relative;
    background: var(--dash-surface);
    border: 1px solid var(--dash-border);
    border-radius: var(--dash-radius);
    box-shadow: var(--dash-shadow);
    padding: 20px;
}

/* Interactive cards (whole card is a link via .stretched-link) */
.dash-card--link {
    transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.dash-card--link:hover {
    transform: translateY(-2px);
    box-shadow: var(--dash-shadow-hover);
    border-color: rgba(23, 105, 194, 0.45);
}

.dash-card--link:focus-within {
    border-color: var(--dash-primary);
    box-shadow: var(--dash-focus);
}

.dash-card--link .stretched-link:focus-visible {
    outline: none;
}

.dash-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 14px 0 4px;
}

.dash-card-title a {
    color: var(--dash-ink);
    text-decoration: none;
}

.dash-card-text {
    color: var(--dash-muted);
    margin: 0;
}

/* --------------------------------------------------------------------------
   Icon tiles
   -------------------------------------------------------------------------- */
.dash-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--dash-radius-sm);
    font-size: 1.4rem;
    flex-shrink: 0;
    background: var(--dash-primary-soft);
    color: var(--dash-primary);
}

.dash-icon--lg {
    width: 56px;
    height: 56px;
    font-size: 1.6rem;
}

.dash-icon--fencing          { background: var(--dash-fencing-bg);  color: var(--dash-fencing-ink); }
.dash-icon--shed             { background: var(--dash-shed-bg);     color: var(--dash-shed-ink); }
.dash-icon--carport_verandah { background: var(--dash-carport-bg);  color: var(--dash-carport-ink); }
.dash-icon--success          { background: #E6F4EA;                 color: #146C2E; }

/* --------------------------------------------------------------------------
   Product cards (Home)
   -------------------------------------------------------------------------- */
.dash-product {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Product cards are the only content on Home - give them a balanced, fuller height on desktop */
@media (min-width: 992px) {
    .dash-product {
        min-height: 260px;
        padding: 24px;
    }
}

.dash-product-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.dash-product-actions {
    position: relative;   /* sits above the stretched link */
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 18px;
}

/* --------------------------------------------------------------------------
   Badges
   -------------------------------------------------------------------------- */
.dash-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 26px;
    height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    background: #D92D20;
    color: #FFFFFF;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
}

/* --------------------------------------------------------------------------
   Buttons (scoped - do not override Bootstrap's .btn-primary globally)
   -------------------------------------------------------------------------- */
.dash-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: var(--dash-radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
    white-space: nowrap;
}

.dash-btn:focus-visible {
    outline: none;
    box-shadow: var(--dash-focus);
}

.dash-btn-primary {
    background: var(--dash-primary);
    color: #FFFFFF;
}

.dash-btn-primary:hover {
    background: var(--dash-primary-hover);
    color: #FFFFFF;
}

.dash-btn-secondary {
    background: var(--dash-surface);
    color: var(--dash-ink);
    border-color: var(--dash-border);
}

.dash-btn-secondary:hover {
    background: var(--dash-canvas);
    border-color: #C9D2DE;
    color: var(--dash-ink);
}

.dash-btn-danger {
    background: #FFFFFF;
    color: #B42318;
    border-color: #F1B8B3;
}

.dash-btn-danger:hover {
    background: #FDECEC;
    border-color: #E58F88;
    color: #912018;
}

/* Narrower reading width (e.g. Notifications list) */
.dash-page.dash-page--narrow {
    max-width: 880px;
}

.dash-btn-sm {
    min-height: 40px;
    padding: 0 14px;
    font-size: 0.875rem;
}

/* --------------------------------------------------------------------------
   Action cards (product menus)
   -------------------------------------------------------------------------- */
.dash-action {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    height: 100%;
    padding: 24px;
}

.dash-action-body {
    flex: 1;
    min-width: 0;
}

.dash-action-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 2px 0 4px;
}

.dash-action-title a {
    color: var(--dash-ink);
    text-decoration: none;
}

.dash-action-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    font-weight: 600;
    color: var(--dash-primary);
}

.dash-card--link:hover .dash-action-cta i {
    transform: translateX(2px);
}

.dash-action-cta i {
    transition: transform 150ms ease;
}

/* --------------------------------------------------------------------------
   Pills (product switcher)
   -------------------------------------------------------------------------- */
.dash-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.dash-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--dash-border);
    background: var(--dash-surface);
    color: var(--dash-ink);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: border-color 150ms ease, background-color 150ms ease;
}

.dash-pill:hover {
    border-color: rgba(23, 105, 194, 0.45);
    background: var(--dash-primary-soft);
    color: var(--dash-ink);
}

.dash-pill:focus-visible {
    outline: none;
    box-shadow: var(--dash-focus);
}

/* --------------------------------------------------------------------------
   Chips (product switcher)
   -------------------------------------------------------------------------- */
.dash-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--dash-canvas);
    color: var(--dash-muted);
}

.dash-chip--fencing          { background: var(--dash-fencing-bg);  color: var(--dash-fencing-ink); }
.dash-chip--shed             { background: var(--dash-shed-bg);     color: var(--dash-shed-ink); }
.dash-chip--carport_verandah { background: var(--dash-carport-bg);  color: var(--dash-carport-ink); }

/* --------------------------------------------------------------------------
   Flash messages
   -------------------------------------------------------------------------- */
/* Floating at the bottom centre - matches the editing pages (#flash-message-container) */
.dash-flash {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    z-index: 11000;                     /* above navbar (10000) */
    width: 100%;
    max-width: 350px;
    padding: 0.5rem;
    font-family: var(--dash-font);
}

/* Sit above the bottom navigation where navbar.html shows it */
@media (max-width: 900px) {
    .dash-flash {
        bottom: var(--bottom-nav-height, 64px);
    }
}

@media (min-width: 901px) and (max-width: 1366px) and (orientation: landscape) and (hover: none) and (pointer: coarse) {
    .dash-flash {
        bottom: var(--bottom-nav-height, 64px);
    }
}

.dash-flash .alert {
    display: flex;
    align-items: center;
    min-height: 52px;
    margin-bottom: 0.5rem;
    padding: 0.5rem 3rem 0.5rem 0.75rem;
    font-size: 0.875rem;
    border-radius: var(--dash-radius-sm);
    box-shadow: 0 4px 14px rgba(16, 24, 40, 0.12);
    text-align: left;
}

.dash-flash .alert:last-child {
    margin-bottom: 0;
}

/* Long unbroken text (file paths, server error details) wraps inside the
   message instead of running outside it. (No inner scrolling: the close
   button is taller than a one-line message and would trigger a scrollbar.) */
.dash-flash .alert,
#flash-message-container .alert {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* ==========================================================================
   OPERATIONAL DASHBOARDS (tables)
   First used by: shed_enquiries_dashboard.html

   NOTE: navbar.html loads Bootstrap again after this stylesheet, so any rule
   that overlaps a Bootstrap rule uses a more specific selector.
   ========================================================================== */

/* Full-width page for wide tables */
.dash-page.dash-page--wide {
    max-width: none;
}

body.dash-no-hscroll {
    overflow-x: hidden;
    overscroll-behavior-x: none;
}

.dash-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

/* --------------------------------------------------------------------------
   Segmented control (Active / Archived)
   -------------------------------------------------------------------------- */
.dash-segment {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: #E9EDF3;
    border-radius: 10px;
    margin-bottom: 16px;
}

.dash-segment a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 16px;
    border-radius: var(--dash-radius-sm);
    color: var(--dash-muted);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
}

.dash-segment a:hover {
    color: var(--dash-ink);
}

.dash-segment a.active {
    background: var(--dash-surface);
    color: var(--dash-ink);
    box-shadow: var(--dash-shadow);
}

.dash-segment a:focus-visible {
    outline: none;
    box-shadow: var(--dash-focus);
}

.dash-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    padding: 1px 8px;
    border-radius: 999px;
    background: #DCE2EA;
    color: var(--dash-ink);
    font-size: 0.75rem;
    font-weight: 700;
}

.dash-segment a.active .dash-count {
    background: var(--dash-primary-soft);
    color: var(--dash-primary);
}

/* --------------------------------------------------------------------------
   Filter card
   -------------------------------------------------------------------------- */
.dash-filters {
    margin-bottom: 20px;
}

.dash-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 14px;
    color: var(--dash-ink);
}

.dash-panel-title i {
    color: var(--dash-primary);
}

.dash-filters .form-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--dash-muted);
    margin-bottom: 4px;
}

.dash-filters .form-control,
.dash-filters .form-select {
    min-height: 42px;
    border-color: var(--dash-border);
    border-radius: var(--dash-radius-sm);
    font-size: 0.9rem;
    color: var(--dash-ink);
}

.dash-filters .form-control:focus,
.dash-filters .form-select:focus {
    border-color: var(--dash-primary);
    box-shadow: var(--dash-focus);
}

.dash-input-icon {
    position: relative;
}

.dash-input-icon > i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9AA4B2;
    pointer-events: none;
}

.dash-filters .dash-input-icon .form-control {
    padding-left: 36px;
}

.dash-filter-actions {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 8px;
}

button.dash-btn {
    cursor: pointer;
}

/* --------------------------------------------------------------------------
   Table card
   -------------------------------------------------------------------------- */
.dash-table-card {
    padding: 0;
    overflow: hidden;
}

.dash-table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--dash-border);
}

.dash-table-toolbar .dash-panel-title {
    margin: 0;
}

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

/* Top mirror scrollbar (class names used by the page JavaScript) */
.dash-table-card .table-scroll-top {
    overflow-x: auto;
    overflow-y: hidden;
    height: 14px;
}

.dash-table-card .table-scroll-top .scroll-inner {
    height: 1px;
}

/* Scroll container: required for the sticky header + sticky ID column */
.dash-table-wrap {
    overflow: auto;
    max-height: 75vh;
    overscroll-behavior-x: none;
}

table.dash-table {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-family: var(--dash-font);
    font-size: 0.875rem;
    color: var(--dash-ink);
    background: var(--dash-surface);
}

table.dash-table thead th {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #F8FAFC;
    color: var(--dash-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: left;
    white-space: nowrap;
    padding: 12px 14px;
    border-bottom: 1px solid var(--dash-border);
}

table.dash-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid #EEF1F5;
    vertical-align: top;
    white-space: nowrap;
    background: var(--dash-surface);
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

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

table.dash-table tbody tr:hover td {
    background: #F5F9FF;
}

/* Sticky first (ID) column */
table.dash-table .dash-sticky-col {
    position: sticky;
    left: 0;
    z-index: 2;
    box-shadow: inset -1px 0 0 var(--dash-border);
}

table.dash-table thead th.dash-sticky-col {
    z-index: 25;
}

table.dash-table .dash-col-center {
    text-align: center;
}

table.dash-table .dash-col-wrap {
    white-space: normal;
    min-width: 200px;
    max-width: 260px;
}

.dash-cell-sub {
    color: var(--dash-muted);
    font-size: 0.8rem;
    margin-top: 4px;
}

.dash-cell-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

/* --------------------------------------------------------------------------
   Record ID chips (links) - solid, same colours as before
   -------------------------------------------------------------------------- */
.dash-id {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.dash-id:focus-visible {
    outline: none;
    box-shadow: var(--dash-focus);
}

.dash-id--job     { background: #198754; color: #FFFFFF; }
.dash-id--quote   { background: #ffc107; color: #212529; }
.dash-id--enquiry { background: #0d6efd; color: #FFFFFF; }

.dash-id--job:hover     { background: #146C43; color: #FFFFFF; }
.dash-id--quote:hover   { background: #E0A800; color: #212529; }
.dash-id--enquiry:hover { background: #0B5ED7; color: #FFFFFF; }

.dash-id-repair {
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.85);
    color: #212529;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* --------------------------------------------------------------------------
   Status / stage tags - soft tint of the existing colour + exact-colour dot
   -------------------------------------------------------------------------- */
.dash-tag {
    --tag-bg: #EEF0F3;
    --tag-fg: #495057;
    --tag-dot: #6c757d;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--tag-bg);
    color: var(--tag-fg);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
}

.dash-tag::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--tag-dot);
    flex-shrink: 0;
}

/* Bootstrap-equivalent colours (primary / warning / success / secondary / danger / dark) */
.dash-tag--blue   { --tag-bg: #E7F0FD; --tag-fg: #0A4FB8; --tag-dot: #0d6efd; }
.dash-tag--amber  { --tag-bg: #FFF5D6; --tag-fg: #7A5200; --tag-dot: #ffc107; }
.dash-tag--green  { --tag-bg: #E3F3EA; --tag-fg: #116B3F; --tag-dot: #198754; }
.dash-tag--grey   { --tag-bg: #EEF0F3; --tag-fg: #495057; --tag-dot: #6c757d; }
.dash-tag--red    { --tag-bg: #FCE8EA; --tag-fg: #A61E2D; --tag-dot: #dc3545; }
.dash-tag--dark   { --tag-bg: #E2E4E7; --tag-fg: #212529; --tag-dot: #212529; }

/* Job stage colours (same hues as the previous stage-* badges) */
.dash-tag--council       { --tag-bg: #F0E9FA; --tag-fg: #5A2CA0; --tag-dot: #6f42c1; }
.dash-tag--bom           { --tag-bg: #E7F0FD; --tag-fg: #0A4FB8; --tag-dot: #0d6efd; }
.dash-tag--manufacturing { --tag-bg: #FFEEDF; --tag-fg: #9A4A00; --tag-dot: #fd7e14; }
.dash-tag--delivery      { --tag-bg: #E3F3EA; --tag-fg: #116B3F; --tag-dot: #198754; }
.dash-tag--pickup        { --tag-bg: #DFF7F0; --tag-fg: #0B6B55; --tag-dot: #20c997; }
.dash-tag--occupancy     { --tag-bg: #DDF1F3; --tag-fg: #06606B; --tag-dot: #087f8c; }
.dash-tag--installation  { --tag-bg: #FCE8EA; --tag-fg: #A61E2D; --tag-dot: #dc3545; }
.dash-tag--warning       { --tag-bg: #FFF5D6; --tag-fg: #7A5200; --tag-dot: #ffc107; }

/* --------------------------------------------------------------------------
   Folder (SharePoint) button
   -------------------------------------------------------------------------- */
.dash-folder-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 10px;
    border-radius: var(--dash-radius-sm);
    border: 1px solid #B9D3F1;
    background: var(--dash-primary-soft);
    color: var(--dash-primary);
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
}

.dash-folder-btn:hover {
    background: var(--dash-primary);
    border-color: var(--dash-primary);
    color: #FFFFFF;
}

.dash-folder-btn:focus-visible {
    outline: none;
    box-shadow: var(--dash-focus);
}

/* --------------------------------------------------------------------------
   Row action icon buttons
   -------------------------------------------------------------------------- */
.dash-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.dash-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--dash-radius-sm);
    border: 1px solid transparent;
    background: transparent;
    font-size: 1.1rem;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 150ms ease, border-color 150ms ease;
}

.dash-icon-btn:hover {
    background: var(--dash-canvas);
    border-color: var(--dash-border);
}

.dash-icon-btn:focus-visible {
    outline: none;
    box-shadow: var(--dash-focus);
}

.dash-icon-btn--primary { color: #0d6efd; }
.dash-icon-btn--success { color: #198754; }
.dash-icon-btn--danger  { color: #dc3545; }

/* --------------------------------------------------------------------------
   Modals (Bootstrap modals, restyled)
   -------------------------------------------------------------------------- */
.dash-modal .modal-content {
    border: none;
    border-radius: var(--dash-radius);
    box-shadow: var(--dash-shadow-hover);
    font-family: var(--dash-font);
    overflow: hidden;
}

.dash-modal .modal-header {
    border-bottom: 1px solid var(--dash-border);
}

.dash-modal .modal-footer {
    border-top: 1px solid var(--dash-border);
}

/* --------------------------------------------------------------------------
   Table empty state
   -------------------------------------------------------------------------- */
.dash-table-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    padding: 48px 16px;
    color: var(--dash-muted);
}

.dash-table-empty .dash-icon {
    margin-bottom: 6px;
}

.dash-table-empty strong {
    color: var(--dash-ink);
    font-size: 1rem;
}

.dash-table-empty .dash-btn {
    margin-top: 10px;
}

/* --------------------------------------------------------------------------
   iPad / narrow screens
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    .dash-page.dash-page--wide {
        padding-left: 16px;
        padding-right: 16px;
    }

    .dash-topbar {
        flex-wrap: wrap;
    }

    .dash-table-wrap {
        /* leave room for the fixed top bar and the iPad/mobile bottom nav */
        max-height: calc(100vh - 200px);
    }

    .dash-filter-actions {
        justify-content: flex-start;
    }
}

/* ==========================================================================
   SETTINGS PAGES (pin_setup, users_dashboard, add/edit user, email_alerts)
   ========================================================================== */

/* Toggle switch: <label class="dash-switch"><input type="checkbox" id="..."><span class="dash-switch-track"></span></label> */
.dash-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    width: 50px;
    height: 28px;
    margin: 0;
    cursor: pointer;
}

.dash-switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
    z-index: 1;
}

.dash-switch-track {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: #C9D2DE;
    transition: background-color 150ms ease;
}

.dash-switch-track::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.2);
    transition: transform 150ms ease;
}

.dash-switch input:checked + .dash-switch-track {
    background: #198754;
}

.dash-switch input:checked + .dash-switch-track::before {
    transform: translateX(22px);
}

.dash-switch input:focus-visible + .dash-switch-track {
    box-shadow: var(--dash-focus);
}

.dash-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.dash-setting-row strong {
    display: block;
    color: var(--dash-ink);
}

/* List rows (e.g. email recipients) */
.dash-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--dash-border);
    border-radius: 10px;
    background: #FAFBFD;
    margin-bottom: 8px;
}

.dash-list-row strong {
    word-break: break-word;
    color: var(--dash-ink);
}

/* --------------------------------------------------------------------------
   Field validation display (same look as the enquiry / workflow pages).
   "body" prefix out-ranks Bootstrap, which navbar.html loads again later.
   -------------------------------------------------------------------------- */
body .form-control.is-invalid,
body .form-select.is-invalid {
    border-color: #dc3545 !important;
    padding-right: calc(1.5em + 0.75rem);
    background-image: none;
}

body .form-control.is-invalid:focus,
body .form-select.is-invalid:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.15);
}

body .field-validation-message {
    display: block;
    width: 100%;
    margin-top: 5px;
    font-size: 0.875rem;
    color: #dc3545;
    font-weight: 500;
}

.validation-scroll-target {
    scroll-margin-top: 100px;
}

/* Pagination */
.dash-pagination .page-link {
    border-color: var(--dash-border);
    color: var(--dash-primary);
    font-weight: 600;
    font-size: 0.875rem;
}

.dash-pagination .page-item.disabled .page-link {
    color: var(--dash-muted);
    background: #F8FAFC;
}

.dash-pagination .page-link:focus-visible {
    box-shadow: var(--dash-focus);
}

/* ==========================================================================
   AMS: vehicle colours (icon tiles, chips, ID chips)
   ========================================================================== */
:root {
    --dash-forklift-bg: var(--dash-accent-soft);
    --dash-forklift-ink: var(--dash-accent-ink);
    --dash-excavator-bg: #FFEEDF;
    --dash-excavator-ink: #9A4A00;
    --dash-truck-bg: var(--dash-primary-soft);
    --dash-truck-ink: var(--dash-primary);
    --dash-utility-bg: #E3F4F2;
    --dash-utility-ink: #0F766E;
}

.dash-icon--forklift  { background: var(--dash-forklift-bg);  color: var(--dash-forklift-ink); }
.dash-icon--excavator { background: var(--dash-excavator-bg); color: var(--dash-excavator-ink); }
.dash-icon--truck     { background: var(--dash-truck-bg);     color: var(--dash-truck-ink); }
.dash-icon--utility   { background: var(--dash-utility-bg);   color: var(--dash-utility-ink); }
.dash-icon--danger    { background: #FCE8EA;                  color: #A61E2D; }

.dash-chip--forklift  { background: var(--dash-forklift-bg);  color: var(--dash-forklift-ink); }
.dash-chip--excavator { background: var(--dash-excavator-bg); color: var(--dash-excavator-ink); }
.dash-chip--truck     { background: var(--dash-truck-bg);     color: var(--dash-truck-ink); }
.dash-chip--utility   { background: var(--dash-utility-bg);   color: var(--dash-utility-ink); }

/* Vehicle ID chip (links to the vehicle's edit page) */
.dash-id--vehicle       { background: #1769C2; color: #FFFFFF; }
.dash-id--vehicle:hover { background: #11549C; color: #FFFFFF; }

/* Sortable table headers (static/js/vehicle-dashboard.js) */
table.dash-table thead th.sortable {
    cursor: pointer;
}

table.dash-table thead th.sortable:hover,
table.dash-table thead th.sortable:focus-visible {
    color: var(--dash-ink);
    outline: none;
}

table.dash-table thead th.sortable::after {
    content: "\2195";               /* up/down arrow */
    margin-left: 4px;
    opacity: 0.35;
}

table.dash-table thead th[aria-sort="ascending"]::after  { content: "\2191"; opacity: 0.8; }
table.dash-table thead th[aria-sort="descending"]::after { content: "\2193"; opacity: 0.8; }

/* QR code thumbnail in vehicle tables */
.dash-qr {
    display: block;
    width: 44px;
    height: 44px;
    border: 1px solid var(--dash-border);
    border-radius: 6px;
    background: #FFFFFF;
}

/* Status tags stacked in a table cell */
.dash-tag-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

/* Action icon buttons that are links to other sites (Renew Rego) */
.dash-icon-btn--warning { color: #B07A00; }

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .dash-card--link,
    .dash-card--link:hover,
    .dash-action-cta i,
    .dash-btn,
    .dash-pill,
    .dash-icon-btn {
        transition: none;
        transform: none;
    }
}

/* ==========================================================================
   BMS: app chooser (choose_app.html)
   ========================================================================== */
.dash-app-name {
    display: block;
    margin-top: 2px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--dash-muted, #5B6575);
}
