/*
 * "Workshop logbook" look. Colours come from the MudBlazor palette (AppTheme.cs);
 * the few fixed colours below are the always-dark "blueprint" panels and the amber accent.
 */
:root {
    --cl-ink: #143D2E;
    --cl-ink-deep: #0E2B20;
    --cl-amber: #E8893A;
    --cl-grid: rgba(255, 253, 248, .07);
    --cl-font-heading: "Space Grotesk", "IBM Plex Sans", "Segoe UI", sans-serif;
}

html, body {
    font-family: "IBM Plex Sans", "Segoe UI", Roboto, sans-serif;
}

h1:focus {
    outline: none;
}

.cursor-pointer { cursor: pointer; }

/* Blueprint panel: dark green with a faint engineering grid. */
.blueprint {
    color: #F4F1EA;
    background-color: var(--cl-ink);
    background-image:
        linear-gradient(var(--cl-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--cl-grid) 1px, transparent 1px),
        radial-gradient(circle at 85% 15%, rgba(232, 137, 58, .22), transparent 45%),
        linear-gradient(160deg, var(--cl-ink) 0%, var(--cl-ink-deep) 100%);
    background-size: 24px 24px, 24px 24px, auto, auto;
}

/* App bar */
.app-bar {
    backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
    margin-left: 4px;
}

.brand-logo {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: var(--cl-amber);
    background: var(--cl-ink);
    box-shadow: inset 0 -3px 0 var(--cl-amber);
}

.brand-name {
    font-family: var(--cl-font-heading);
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: -0.03em;
}

.app-drawer {
    border-right: 1px solid var(--mud-palette-lines-default);
}

.drawer-footer {
    position: absolute;
    bottom: 16px;
    left: 16px;
    right: 16px;
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 12px;
    border-radius: 10px;
    border-left: 3px solid var(--mud-palette-secondary);
    background: var(--mud-palette-background-gray);
}

/* Cards */
.surface-card {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 14px !important;
}

.vehicle-card {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 14px !important;
    overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
    cursor: pointer;
    height: 100%;
}

.vehicle-card:hover {
    transform: translateY(-2px);
    border-color: var(--mud-palette-secondary);
    box-shadow: 0 12px 28px rgba(20, 61, 46, .14);
}

.vehicle-photo {
    height: 190px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.vehicle-photo.placeholder,
.hero-photo.placeholder {
    display: grid;
    place-items: center;
}

.vehicle-photo.placeholder .mud-icon-root,
.hero-photo.placeholder .mud-icon-root {
    color: var(--cl-amber);
    opacity: .9;
}

.vehicle-photo .type-chip {
    position: absolute;
    top: 12px;
    left: 12px;
}

.hero-photo {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
}

.stat-card {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 12px !important;
    padding: 16px;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 16px;
    bottom: 16px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--mud-palette-secondary);
}

.stat-card .stat-value {
    font-family: var(--cl-font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.drop-zone {
    border: 2px dashed var(--mud-palette-lines-inputs);
    border-radius: 14px;
    padding: 28px;
    text-align: center;
    transition: border-color .15s ease, background-color .15s ease;
}

.drop-zone:hover,
.drop-zone.dragging {
    border-color: var(--mud-palette-secondary);
    background: var(--mud-palette-background-gray);
}

.drop-zone .mud-icon-root {
    color: var(--mud-palette-secondary);
}

.empty-state {
    text-align: center;
    padding: 64px 24px;
}

.empty-state .empty-icon {
    width: 88px;
    height: 88px;
    margin: 0 auto 16px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    background: var(--mud-palette-background-gray);
    color: var(--mud-palette-primary);
    border: 1px solid var(--mud-palette-lines-default);
}

.invoice-preview {
    width: 100%;
    height: 78vh;
    border: 0;
    border-radius: 10px;
    background: var(--mud-palette-background-gray);
}

.invoice-preview-img {
    width: 100%;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 10px;
    background: var(--mud-palette-background-gray);
}

.lines-table .mud-input-control {
    margin-top: 0 !important;
}

.lines-table td {
    padding: 2px 6px !important;
}

/* Landing page */
.landing-hero {
    border-radius: 20px;
    padding: 64px 40px;
    position: relative;
    overflow: hidden;
}

.landing-hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 6px;
    background: repeating-linear-gradient(90deg, var(--cl-amber) 0 48px, transparent 48px 64px);
}

.landing-eyebrow {
    font-family: var(--cl-font-heading);
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: .78rem;
    font-weight: 600;
    color: var(--cl-amber);
}

.hero-cta {
    background: var(--cl-amber) !important;
    color: #1A120A !important;
}

.hero-cta-outline {
    color: #F4F1EA !important;
    border-color: rgba(244, 241, 234, .5) !important;
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--mud-palette-background-gray);
    color: var(--mud-palette-secondary);
    border: 1px solid var(--mud-palette-lines-default);
}

.ad-text {
    white-space: pre-wrap;
}

.avatar-button {
    border: 0;
    padding: 0;
    background: none;
    border-radius: 50%;
    cursor: pointer;
}

.avatar-button:focus-visible {
    outline: 2px solid var(--mud-palette-secondary);
    outline-offset: 2px;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 2000;
}

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

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

/* Search hits (MudHighlighter renders <mark>) */
mark {
    color: inherit;
    background: color-mix(in srgb, var(--mud-palette-secondary) 30%, transparent);
    border-radius: 3px;
    padding: 0 1px;
}
