/*
 * LocalGarage design system, shared by the garage app and the admin portal.
 * Bootstrap 5 underneath; this file sets the brand (dark workshop sidebar, amber accent), the app shell, the sign-in
 * pages and a consistent look for the common Bootstrap components.
 */

/* ===== Tokens ===================================================================================================== */
:root {
    --lg-sidebar-width: 260px;
    --lg-sidebar-bg: #111827;
    --lg-sidebar-border: rgba(255, 255, 255, .07);
    --lg-sidebar-text: #c7cdd8;
    --lg-sidebar-muted: #7c8698;
    --lg-accent: #f5a524;
    --lg-accent-ink: #1a1204;
    --lg-page-bg: #f4f6f9;
    --lg-surface: #ffffff;
    --lg-border: #e3e7ed;
    --lg-text-muted: #667085;
    --lg-radius: .6rem;
    --lg-radius-sm: .45rem;
    --lg-shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --lg-shadow-md: 0 4px 16px rgba(16, 24, 40, .08);

    --bs-primary: #2563eb;
    --bs-primary-rgb: 37, 99, 235;
    --bs-link-color: #1d4ed8;
    --bs-link-color-rgb: 29, 78, 216;
    --bs-link-hover-color: #1e40af;
    --bs-link-hover-color-rgb: 30, 64, 175;
    --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --bs-border-color: var(--lg-border);
    --bs-border-radius: var(--lg-radius-sm);
}

html, body {
    font-family: var(--bs-body-font-family);
}

body {
    background: var(--lg-page-bg);
    color: #1f2937;
    -webkit-font-smoothing: antialiased;
}

a {
    text-underline-offset: .15em;
}

h1:focus {
    outline: none;
}

h1.h3, .page-title {
    font-weight: 650;
    letter-spacing: -.015em;
    color: #111827;
}

.text-body-secondary {
    color: var(--lg-text-muted) !important;
}

/* ===== App shell ================================================================================================== */
.shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    flex: none;
    width: var(--lg-sidebar-width);
    height: 100vh;
    position: sticky;
    top: 0;
    background: var(--lg-sidebar-bg);
    border-right: 1px solid var(--lg-sidebar-border);
    z-index: 1040;
}

.main-column {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.content {
    flex: 1;
    width: 100%;
    max-width: 1440px;
    padding: 1.75rem 2rem 3rem;
}

.nav-root {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: var(--lg-sidebar-text);
    --icon-fill: var(--lg-sidebar-bg);
}

.brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1.1rem 1.1rem 1rem;
    text-decoration: none;
    color: #fff;
    border-bottom: 1px solid var(--lg-sidebar-border);
}

    .brand:hover {
        color: #fff;
    }

.brand-mark {
    flex: none;
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--lg-radius);
    background: var(--lg-accent);
    color: var(--lg-accent-ink);
    box-shadow: 0 2px 8px rgba(245, 165, 36, .25);
}

.brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
}

.brand-name {
    font-weight: 600;
    font-size: .95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-product {
    font-size: .72rem;
    letter-spacing: .04em;
    color: var(--lg-sidebar-muted);
}

.nav-scrollable {
    flex: 1;
    overflow-y: auto;
    padding: .5rem .75rem 1rem;
}

.nav-section {
    margin: 1.1rem .65rem .35rem;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--lg-sidebar-muted);
}

    .nav-section:first-child {
        margin-top: .5rem;
    }

.sidebar .nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1px 0;
    padding: .55rem .65rem;
    border-radius: var(--lg-radius-sm);
    font-size: .9rem;
    font-weight: 500;
    color: var(--lg-sidebar-text);
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}

    .sidebar .nav-link .nav-icon {
        flex: none;
        opacity: .8;
    }

    .sidebar .nav-link:hover {
        background: rgba(255, 255, 255, .06);
        color: #fff;
    }

    .sidebar .nav-link.active {
        background: rgba(245, 165, 36, .14);
        color: #fff;
    }

        .sidebar .nav-link.active .nav-icon {
            color: var(--lg-accent);
            opacity: 1;
        }

        .sidebar .nav-link.active::before {
            content: "";
            position: absolute;
            left: -.75rem;
            top: .45rem;
            bottom: .45rem;
            width: 3px;
            border-radius: 0 3px 3px 0;
            background: var(--lg-accent);
        }

    .sidebar .nav-link:focus-visible {
        outline: 2px solid var(--lg-accent);
        outline-offset: 1px;
    }

.user-card {
    display: flex;
    align-items: center;
    gap: .25rem;
    margin: .75rem;
    padding: .5rem;
    border-radius: var(--lg-radius);
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--lg-sidebar-border);
}

.user-identity {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .2rem;
    border-radius: var(--lg-radius-sm);
    color: inherit;
    text-decoration: none;
}

    .user-identity:hover {
        background: rgba(255, 255, 255, .06);
        color: inherit;
    }

.avatar {
    flex: none;
    display: grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b4a6b, #283349);
    color: #fff;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .03em;
}

.user-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}

.user-name {
    color: #fff;
    font-size: .85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    color: var(--lg-sidebar-muted);
    font-size: .75rem;
}

.icon-button {
    display: grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    border: 0;
    border-radius: var(--lg-radius-sm);
    background: transparent;
    color: var(--lg-sidebar-muted);
}

    .icon-button:hover {
        background: rgba(255, 255, 255, .08);
        color: #fff;
    }

.topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    gap: .75rem;
    height: 3.75rem;
    padding: 0 2rem;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--lg-border);
}

.topbar-title {
    font-weight: 600;
    color: #111827;
}

.topbar-search {
    position: relative;
    flex: 1;
    max-width: 32rem;
    display: flex;
    align-items: center;
    color: var(--lg-text-muted);
}

    .topbar-search .nav-icon {
        position: absolute;
        left: .75rem;
        pointer-events: none;
    }

    .topbar-search input {
        width: 100%;
        height: 2.4rem;
        padding: 0 .9rem 0 2.4rem;
        border: 1px solid var(--lg-border);
        border-radius: var(--lg-radius);
        background: var(--lg-page-bg);
        font-size: .9rem;
        transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
    }

        .topbar-search input:focus {
            outline: none;
            background: #fff;
            border-color: #93b4f8;
            box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .15);
        }

.topbar-action {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    height: 2.4rem;
    padding: 0 1rem;
    white-space: nowrap;
}

.menu-button {
    display: none;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    margin: 0 0 0 -.5rem;
    border-radius: var(--lg-radius-sm);
    color: #1f2937;
    cursor: pointer;
}

    .menu-button:hover {
        background: var(--lg-page-bg);
    }

.nav-toggle {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.backdrop {
    display: none;
}

@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        transform: translateX(-100%);
        transition: transform .2s ease;
    }

    .nav-toggle:checked ~ .shell .sidebar {
        transform: none;
        box-shadow: 0 0 40px rgba(0, 0, 0, .25);
    }

    .nav-toggle:checked ~ .shell .backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1030;
        background: rgba(15, 23, 42, .45);
    }

    .menu-button {
        display: grid;
    }

    .topbar {
        padding: 0 1rem;
    }

    .content {
        padding: 1.25rem 1rem 2.5rem;
    }
}

@media (max-width: 575.98px) {
    .topbar-action-label {
        display: none;
    }

    .topbar-action {
        padding: 0 .7rem;
    }
}

/* ===== Sign-in pages ============================================================================================== */
.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(245, 165, 36, .16), transparent 60%),
        radial-gradient(900px 500px at 110% 110%, rgba(37, 99, 235, .14), transparent 60%),
        var(--lg-sidebar-bg);
}

.auth-panel {
    width: 100%;
    max-width: 26rem;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.25rem;
    color: #fff;
}

    .auth-brand .brand-mark {
        width: 2.6rem;
        height: 2.6rem;
    }

.auth-brand-name {
    font-weight: 650;
    font-size: 1.1rem;
    line-height: 1.2;
}

.auth-brand-sub {
    font-size: .78rem;
    color: var(--lg-sidebar-muted);
    letter-spacing: .04em;
}

.auth-card {
    background: var(--lg-surface);
    border-radius: .9rem;
    padding: 2rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}

    .auth-card h1 {
        font-size: 1.4rem;
        font-weight: 650;
        letter-spacing: -.015em;
        margin-bottom: .35rem;
    }

    /* Identity template pages: make their multi-column layout a single column and tidy the headings. */
    .auth-card h2, .auth-card h3, .auth-card .auth-lead {
        font-size: .92rem;
        font-weight: 400;
        color: var(--lg-text-muted);
        margin-bottom: 1.25rem;
    }

    .auth-card hr {
        display: none;
    }

    .auth-card .row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .auth-card .btn-lg {
        font-size: 1rem;
        padding: .65rem 1rem;
    }

.auth-links {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 1.25rem;
    font-size: .875rem;
}

.auth-footer {
    margin-top: 1.25rem;
    text-align: center;
    font-size: .78rem;
    color: var(--lg-sidebar-muted);
}

/* ===== Technician portal top bar ================================================================================== */
.tech-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem 1rem;
    background: var(--lg-sidebar-bg);
    color: var(--lg-sidebar-text);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .15);
}

    .tech-topbar .brand-mark {
        width: 2rem;
        height: 2rem;
    }

    .tech-topbar .tech-title {
        display: flex;
        flex-direction: column;
        line-height: 1.15;
        min-width: 0;
        text-decoration: none;
        color: #fff;
    }

        .tech-topbar .tech-title small {
            color: var(--lg-sidebar-muted);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

    .tech-topbar .tech-actions {
        margin-left: auto;
        display: flex;
        align-items: center;
        gap: .35rem;
    }

    .tech-topbar .btn-outline-light {
        --bs-btn-border-color: rgba(255, 255, 255, .25);
    }

.tech-content {
    max-width: 60rem;
    margin: 0 auto;
    padding: 1rem;
}

/* ===== Components ================================================================================================= */

/* Buttons */
.btn {
    --bs-btn-font-weight: 500;
    --bs-btn-border-radius: var(--lg-radius-sm);
    --bs-btn-focus-box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .25);
}

.btn-primary {
    --bs-btn-bg: #2563eb;
    --bs-btn-border-color: #2563eb;
    --bs-btn-hover-bg: #1d4ed8;
    --bs-btn-hover-border-color: #1d4ed8;
    --bs-btn-active-bg: #1e40af;
    --bs-btn-active-border-color: #1e40af;
    --bs-btn-disabled-bg: #2563eb;
    --bs-btn-disabled-border-color: #2563eb;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .08);
}

.btn-outline-primary {
    --bs-btn-color: #1d4ed8;
    --bs-btn-border-color: #bfd0f6;
    --bs-btn-hover-bg: #eef3fe;
    --bs-btn-hover-color: #1d4ed8;
    --bs-btn-hover-border-color: #93b4f8;
    --bs-btn-active-bg: #e0e9fd;
    --bs-btn-active-color: #1d4ed8;
}

.btn-outline-secondary {
    --bs-btn-color: #344054;
    --bs-btn-border-color: #d0d5dd;
    --bs-btn-hover-bg: #f2f4f7;
    --bs-btn-hover-color: #1f2937;
    --bs-btn-hover-border-color: #c3c9d2;
    --bs-btn-active-bg: #e8ebf0;
    --bs-btn-active-color: #1f2937;
    background: #fff;
}

.btn-secondary {
    --bs-btn-bg: #344054;
    --bs-btn-border-color: #344054;
    --bs-btn-hover-bg: #1f2937;
    --bs-btn-hover-border-color: #1f2937;
}

.btn-warning {
    --bs-btn-bg: var(--lg-accent);
    --bs-btn-border-color: var(--lg-accent);
    --bs-btn-hover-bg: #e8961a;
    --bs-btn-hover-border-color: #e8961a;
    --bs-btn-color: var(--lg-accent-ink);
    --bs-btn-hover-color: var(--lg-accent-ink);
}

/* Filter button rows (Active / Today / All ...) read as a segmented control when the selected one is dark. */
.btn-sm {
    --bs-btn-border-radius: .4rem;
}

/* Forms */
.form-control, .form-select {
    border-color: #d0d5dd;
    border-radius: var(--lg-radius-sm);
}

    .form-control:focus, .form-select:focus {
        border-color: #93b4f8;
        box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .15);
    }

.form-label {
    font-weight: 500;
    color: #344054;
}

.form-check-input:checked {
    background-color: #2563eb;
    border-color: #2563eb;
}

/* Cards: white panels with a hairline edge and a clean header. */
.card {
    --bs-card-border-color: var(--lg-border);
    --bs-card-border-radius: var(--lg-radius);
    --bs-card-inner-border-radius: calc(var(--lg-radius) - 1px);
    --bs-card-cap-bg: #fff;
    box-shadow: var(--lg-shadow-sm);
}

.card-header {
    padding: .8rem 1.1rem;
    font-weight: 600;
    color: #111827;
}

    .card-header .small, .card-header small {
        font-weight: 400;
    }

.card-body {
    padding: 1.1rem;
}

/* Tables: quiet headers, roomy rows. A table placed straight on the page gets the same white panel as a card. */
.table {
    --bs-table-hover-bg: #f7f9fc;
    margin-bottom: 0;
    font-size: .925rem;
}

    .table > thead > tr > th {
        background: #f8fafc;
        color: var(--lg-text-muted);
        font-size: .72rem;
        font-weight: 600;
        letter-spacing: .06em;
        text-transform: uppercase;
        white-space: nowrap;
        border-bottom-color: var(--lg-border);
    }

    .table > :not(caption) > * > * {
        padding: .7rem 1rem;
        border-bottom-color: #eef1f5;
    }

    .table > tbody > tr:last-child > * {
        border-bottom: 0;
    }

    .table-sm > :not(caption) > * > * {
        padding: .45rem .75rem;
    }

.content > .table-responsive,
.content > div > .table-responsive:only-child {
    background: #fff;
    border: 1px solid var(--lg-border);
    border-radius: var(--lg-radius);
    box-shadow: var(--lg-shadow-sm);
    margin-bottom: 1rem;
}

.card > .table-responsive:last-child, .card > .table:last-child {
    border-bottom-left-radius: var(--bs-card-inner-border-radius);
    border-bottom-right-radius: var(--bs-card-inner-border-radius);
}

/* List groups inside cards */
.list-group {
    --bs-list-group-border-color: #eef1f5;
}

/* Badges: slightly softer, consistent weight. */
.badge {
    font-weight: 600;
    letter-spacing: .01em;
    border-radius: .4rem;
    padding: .38em .6em;
}

/* Number plates (registration badges) look like real UK plates. */
.badge.text-bg-warning.font-monospace {
    background: #ffd400 !important;
    color: #111 !important;
    border: 1px solid rgba(0, 0, 0, .25);
    font-family: "Segoe UI", "Arial Narrow", Arial, sans-serif !important;
    font-weight: 700;
    letter-spacing: .06em;
}

/* Alerts */
.alert {
    border-radius: var(--lg-radius);
    border-width: 1px;
}

/* Breadcrumbs */
.breadcrumb {
    --bs-breadcrumb-divider-color: #98a2b3;
    font-size: .85rem;
    margin-bottom: .75rem;
}

    .breadcrumb a {
        color: var(--lg-text-muted);
        text-decoration: none;
    }

        .breadcrumb a:hover {
            color: #1d4ed8;
            text-decoration: underline;
        }

/* Pills (account settings menu) */
.nav-pills {
    --bs-nav-pills-border-radius: var(--lg-radius-sm);
    --bs-nav-pills-link-active-bg: #eef3fe;
    --bs-nav-pills-link-active-color: #1d4ed8;
    gap: 2px;
}

    .nav-pills .nav-link {
        color: #344054;
        font-weight: 500;
    }

        .nav-pills .nav-link:hover {
            background: #f2f4f7;
        }

/* Pagination */
.pagination {
    --bs-pagination-border-radius: var(--lg-radius-sm);
    --bs-pagination-active-bg: #2563eb;
    --bs-pagination-active-border-color: #2563eb;
}

/* Modal dialogs */
.modal-content {
    border: 0;
    border-radius: .9rem;
    box-shadow: 0 24px 60px rgba(16, 24, 40, .25);
}

/* Blazor reconnect / error bar */
#blazor-error-ui {
    color-scheme: light only;
    background: #fff7e0;
    border-top: 1px solid #f5d48a;
    bottom: 0;
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: .7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1100;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: .75rem;
        top: .5rem;
    }

/* ===== Refinements from the visual review ========================================================================= */
:root {
    --bs-font-monospace: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

/* Links inside tables and lists: bold, no underline until hovered (rows full of underlines are hard to scan). */
.table a:not(.btn), .list-group a:not(.btn), .breadcrumb a {
    text-decoration: none;
}

.table a:not(.btn):not(.badge) {
    font-weight: 600;
}

.table a:not(.btn):hover, .list-group a:not(.btn):hover {
    text-decoration: underline;
}

/* A status badge next to a page title stays badge-sized. */
h1 .badge, .h1 .badge, .h3 .badge {
    font-size: .8rem;
    vertical-align: middle;
    position: relative;
    top: -.15em;
}

/* Section headings inside cards (account pages and the like). */
.card-body > h3:first-child, .card-body > h4:first-child, .card-body > h2:first-child {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Phones: tables scroll sideways rather than breaking numbers and dates over several lines. */
@media (max-width: 767.98px) {
    .table-responsive > .table td, .table-responsive > .table th {
        white-space: nowrap;
    }
}

/* Authenticator enrolment QR code */
.qr-code { width: 200px; max-width: 100%; padding: .5rem; background: #fff; border: 1px solid var(--lg-border); border-radius: .5rem; margin: .5rem 0 1rem; }
.qr-code svg { display: block; width: 100%; height: auto; }
/* Printing (e.g. the driver's run sheet): only the page content, on white. */
@media print {
    .sidebar,
    .topbar,
    .menu-button,
    .backdrop,
    .nav-toggle,
    #blazor-error-ui {
        display: none !important;
    }

    body,
    .shell,
    .content {
        background: #fff !important;
    }

    .content {
        padding: 0 !important;
    }

    a {
        color: inherit !important;
        text-decoration: none !important;
    }
}
/* Customer pages (personal links): wider than the sign-in card. */
.public-panel {
    max-width: 36rem;
}

.portal-thread {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin: 1rem 0;
}

.portal-message {
    max-width: 85%;
    padding: .5rem .75rem;
    border-radius: .75rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.portal-message.from-customer {
    align-self: flex-end;
    background: #dbeafe;
}

.portal-message.from-garage {
    align-self: flex-start;
    background: #f1f3f6;
}

.portal-message .meta {
    display: block;
    font-size: .72rem;
    color: var(--bs-secondary-color);
    margin-top: .2rem;
}
/* Online booking page */
.book-days {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(4.2rem, 1fr));
    gap: .4rem;
}

.book-days .btn {
    line-height: 1.15;
    padding: .35rem .25rem;
}

/* Off-screen trap field for bots (not display:none, which some bots skip). */
.book-trap {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
/* Running total on the booking page */
.quote-summary {
    background: #f8f9fb;
    border: 1px solid var(--lg-border, #e3e7ed);
    border-radius: .6rem;
    padding: .75rem .9rem;
}

.quote-summary .table {
    --bs-table-bg: transparent;
}