﻿/* ================================================================
   THEME BASE - Ultra-Minimized Bootstrap Override System
   ================================================================ */

:root {
    /* Core Surface Variables */
    --primary-surface: var(--theme-light);
    --tertiary-surface: var(--theme-accent3);
    --surface-elevated: var(--theme-white);
    --surface-dark: var(--theme-dark);
    /* Border Variables */
    --border-medium: var(--theme-accent2);
    --border-strong: var(--theme-accent1);
    /* Text Variables */
    --text-primary: var(--theme-dark);
    --text-secondary: var(--theme-accent1);
    --text-muted: var(--theme-accent2);
    /* Link/accent text. Defaults to the button primary; dark themes override
       it with a lighter tone, because a colour dark enough to sit under white
       button labels can never also pass as text on a dark card surface. */
    --theme-link: var(--theme-primary);
    /* Ink on warning surfaces: amber is always light-mid, but --text-primary
       is near-white on dark themes and would be unreadable on it. */
    --warning-ink: #1c1c1c;
    /* Backdrop for hand-rolled modals and image overlays. */
    --scrim: color-mix(in srgb, var(--theme-dark) 50%, transparent 50%);
    /* Shadows */
    --shadow-md: 0 2px 4px var(--theme-accent1);
    --shadow-lg: 0 4px 8px var(--theme-accent1);
    --shadow-xl: 0 8px 16px var(--theme-dark);
    /* Transitions */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-quick: all 0.15s ease-out;
}

/* ================================================================
   GLOBAL STYLES
   ================================================================ */

body {
    background-color: var(--primary-surface) !important;
    color: var(--text-primary) !important;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Links */
a {
    color: var(--theme-link) !important;
}

    a:hover {
        color: color-mix(in srgb, var(--theme-link) 85%, black 15%) !important;
    }

/* ================================================================
   BUTTONS - CONSOLIDATED PATTERNS
   ================================================================ */

.btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-warning, .btn-info {
    color: white !important;
}

.btn-primary {
    background-color: var(--theme-primary) !important;
    border-color: var(--theme-primary) !important;
}

.btn-secondary {
    background-color: var(--theme-secondary) !important;
    border-color: var(--theme-secondary) !important;
}

.btn-success {
    background-color: var(--theme-success) !important;
    border-color: var(--theme-success) !important;
}

.btn-danger {
    background-color: var(--theme-danger) !important;
    border-color: var(--theme-danger) !important;
}

.btn-warning {
    background-color: var(--theme-warning) !important;
    border-color: var(--theme-warning) !important;
    color: var(--warning-ink) !important;
}

.btn-info {
    background-color: var(--theme-info) !important;
    border-color: var(--theme-info) !important;
}

.btn-primary:hover {
    background-color: color-mix(in srgb, var(--theme-primary) 85%, black 15%) !important;
    border-color: color-mix(in srgb, var(--theme-primary) 85%, black 15%) !important;
}

.btn-secondary:hover {
    background-color: color-mix(in srgb, var(--theme-secondary) 85%, black 15%) !important;
    border-color: color-mix(in srgb, var(--theme-secondary) 85%, black 15%) !important;
}

.btn-light {
    background-color: var(--theme-white) !important;
    border-color: var(--border-medium) !important;
    color: var(--text-primary) !important;
}

    .btn-light:hover {
        background-color: var(--tertiary-surface) !important;
        border-color: var(--border-strong) !important;
    }

/* Outline Buttons */
.btn-outline-primary {
    color: var(--theme-link) !important;
    border-color: var(--theme-link) !important;
}

    .btn-outline-primary:hover {
        background-color: var(--theme-primary) !important;
        color: white !important;
    }


.btn-outline-secondary {
    color: var(--theme-secondary) !important;
    border-color: var(--theme-secondary) !important;
}

    .btn-outline-secondary:hover {
        background-color: var(--theme-secondary) !important;
        color: white !important;
    }

.btn-outline-success {
    color: var(--theme-success) !important;
    border-color: var(--theme-success) !important;
}

    .btn-outline-success:hover {
        background-color: var(--theme-success) !important;
        color: white !important;
    }

.btn-outline-danger {
    color: var(--theme-danger) !important;
    border-color: var(--theme-danger) !important;
}

    .btn-outline-danger:hover {
        background-color: var(--theme-danger) !important;
        color: white !important;
    }

.btn-outline-warning {
    color: var(--theme-warning) !important;
    border-color: var(--theme-warning) !important;
}

    .btn-outline-warning:hover {
        background-color: var(--theme-warning) !important;
        color: var(--warning-ink) !important;
    }

.btn-outline-info {
    color: var(--theme-info) !important;
    border-color: var(--theme-info) !important;
}

    .btn-outline-info:hover {
        background-color: var(--theme-info) !important;
        color: white !important;
    }

/* ================================================================
   FORMS - CONSOLIDATED
   ================================================================ */

.form-control, .form-select {
    background-color: var(--theme-white) !important;
    border: 1px solid var(--border-medium) !important;
    color: var(--text-primary) !important;
}

    .form-control:focus, .form-select:focus {
        background-color: var(--theme-white) !important;
        border-color: var(--theme-primary) !important;
        box-shadow: 0 0 0 0.25rem color-mix(in srgb, var(--theme-primary) 10%, transparent 90%) !important;
        color: var(--text-primary) !important;
    }

    .form-control::placeholder {
        color: var(--text-muted) !important;
    }

    .form-control:disabled {
        background-color: var(--tertiary-surface) !important;
        color: var(--text-muted) !important;
    }

.input-group-text {
    background-color: var(--tertiary-surface) !important;
    border: 1px solid var(--border-medium) !important;
    color: var(--text-primary) !important;
}

/* ================================================================
   CARDS & COMPONENTS
   ================================================================ */

.card {
    background-color: var(--theme-white) !important;
    border: 1px solid var(--border-medium) !important;
    color: var(--text-primary) !important;
    /* Static elevation only — no hover. */
    box-shadow: var(--shadow-md);
}

.card-header, .card-footer {
    background-color: var(--tertiary-surface) !important;
    border-color: var(--border-medium) !important;
    color: var(--text-primary) !important;
}

.clickable-title {
    color: var(--text-primary) !important;
    cursor: pointer;
    text-decoration: none;
}

    .clickable-title:hover {
        color: var(--theme-link) !important;
        text-decoration: underline;
    }

.clickable-zone:hover {
    background-color: color-mix(in srgb, var(--theme-primary) 5%, transparent 95%) !important;
}

/* ================================================================
   LIST GROUPS
   ================================================================ */

/* Bootstrap hard-codes #fff / #212529 / rgba(0,0,0,.125) on list-group items,
   so every list rendered this way (the self-service console's organisations,
   security and device lists, the map details card's Recent Activity list, ...)
   stayed white-on-white regardless of theme. Map them onto the same surface
   roles the cards that contain them already use. */

.list-group {
    --bs-list-group-bg: var(--theme-white);
    --bs-list-group-color: var(--text-primary);
    --bs-list-group-border-color: var(--border-medium);
}

.list-group-item {
    background-color: var(--theme-white) !important;
    border-color: var(--border-medium) !important;
    color: var(--text-primary) !important;
}

/* list-group-flush sits directly on the card body, so it must not paint its
   own surface — otherwise it hides any tinted body behind it. */
.list-group-flush > .list-group-item {
    background-color: transparent !important;
}

.list-group-item-action {
    color: var(--text-primary) !important;
}

    .list-group-item-action:hover,
    .list-group-item-action:focus {
        background-color: var(--tertiary-surface) !important;
        color: var(--text-primary) !important;
    }

    .list-group-item-action:active {
        background-color: var(--border-medium) !important;
        color: var(--text-primary) !important;
    }

.list-group-item.active {
    background-color: var(--theme-primary) !important;
    border-color: var(--theme-primary) !important;
    color: white !important;
}

.list-group-item.disabled,
.list-group-item:disabled {
    background-color: var(--theme-white) !important;
    color: var(--text-muted) !important;
}

/* ================================================================
   TABLES
   ================================================================ */

.table {
    color: var(--text-primary) !important;
    --bs-table-bg: var(--theme-white);
}

    /* Compact, muted column headers — the dashboards' visual language,
       applied to every table so lists read consistently app-wide. */
    .table th {
        background-color: var(--tertiary-surface) !important;
        border-color: var(--border-medium) !important;
        color: var(--text-secondary) !important;
        font-size: 0.8125rem;
        font-weight: 600;
        padding: 0.5rem;
    }

    .table td {
        border-color: var(--border-medium) !important;
        color: var(--text-primary) !important;
        background-color: var(--theme-white) !important;
    }

.table-hover tbody tr:hover {
    background-color: color-mix(in srgb, var(--theme-primary) 5%, transparent 95%) !important;
}

/* Row/head state variants. The .table td/th backgrounds above would
   otherwise suppress Bootstrap's table-* classes entirely. */
.table tr.table-warning td {
    background-color: color-mix(in srgb, var(--theme-warning) 14%, var(--theme-white) 86%) !important;
}

.table tr.table-primary td {
    background-color: color-mix(in srgb, var(--theme-primary) 8%, var(--theme-white) 92%) !important;
}

.table-dark th {
    background-color: var(--theme-dark) !important;
    color: white !important;
}

/* ================================================================
   DROPDOWNS & MODALS
   ================================================================ */

.dropdown-menu {
    background-color: var(--theme-white) !important;
    border: 1px solid var(--border-medium) !important;
    box-shadow: var(--shadow-lg) !important;
}

.dropdown-item {
    color: var(--text-secondary) !important;
}

    .dropdown-item:hover, .dropdown-item:focus {
        background-color: color-mix(in srgb, var(--theme-primary) 10%, transparent 90%) !important;
        color: var(--theme-link) !important;
    }

.modal-content {
    background-color: var(--theme-white) !important;
    border: 1px solid var(--border-medium) !important;
    color: var(--text-primary) !important;
}

.modal-header, .modal-footer {
    border-color: var(--border-medium) !important;
    background-color: var(--tertiary-surface) !important;
}

/* Shared backdrop for hand-rolled Blazor modals (replaces per-component
   inline rgba(0,0,0,.5) scrims). Derived from the chrome colour so dark
   themes keep a coherent scrim. */
.modal-scrim {
    background-color: var(--scrim);
}

/* ================================================================
   ALERTS - CONSOLIDATED
   ================================================================ */

.alert-success {
    background-color: color-mix(in srgb, var(--theme-success) 10%, transparent 90%) !important;
    border-color: var(--theme-success) !important;
    color: var(--theme-success) !important;
}

.alert-danger {
    background-color: color-mix(in srgb, var(--theme-danger) 10%, transparent 90%) !important;
    border-color: var(--theme-danger) !important;
    color: var(--theme-danger) !important;
}

.alert-warning {
    background-color: color-mix(in srgb, var(--theme-warning) 10%, transparent 90%) !important;
    border-color: var(--theme-warning) !important;
    color: var(--theme-warning) !important;
}

.alert-info {
    background-color: color-mix(in srgb, var(--theme-info) 10%, transparent 90%) !important;
    border-color: var(--theme-info) !important;
    color: var(--theme-info) !important;
}

.alert-primary {
    background-color: color-mix(in srgb, var(--theme-primary) 10%, transparent 90%) !important;
    border-color: var(--theme-primary) !important;
    color: var(--theme-link) !important;
}

.alert-secondary {
    background-color: color-mix(in srgb, var(--theme-secondary) 10%, transparent 90%) !important;
    border-color: var(--theme-secondary) !important;
    color: var(--theme-secondary) !important;
}

.alert-light {
    background-color: var(--tertiary-surface) !important;
    border-color: var(--border-medium) !important;
    color: var(--text-primary) !important;
}

/* ================================================================
   MESSAGES - PageAlert, toasts, confirmation dialog
   One look for every error and result in the app (Components/Messages).
   ================================================================ */

.atlas-page-alert .atlas-message-icon {
    margin-top: 0.15rem;
}

.atlas-message-reference {
    margin-left: 0.35rem;
    opacity: 0.9;
}

.atlas-message-reference code {
    color: inherit;
    background-color: color-mix(in srgb, currentColor 10%, transparent 90%);
    border-radius: 0.25rem;
    padding: 0.05rem 0.3rem;
    font-size: 0.85em;
}

.atlas-copy {
    color: inherit !important;
    text-decoration: none;
}

.atlas-copy[data-copied]::after {
    content: " Copied";
    font-size: 0.8em;
}

.atlas-toast-host {
    z-index: 1090;
}

.atlas-toast {
    background-color: var(--primary-surface) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-medium) !important;
    border-left-width: 4px !important;
    box-shadow: var(--shadow-lg);
    min-width: 18rem;
    max-width: 26rem;
}

.atlas-toast-error { border-left-color: var(--theme-danger) !important; }
.atlas-toast-warning { border-left-color: var(--theme-warning) !important; }
.atlas-toast-success { border-left-color: var(--theme-success) !important; }
.atlas-toast-info { border-left-color: var(--theme-info) !important; }

.atlas-toast-error .atlas-toast-icon { color: var(--theme-danger); }
.atlas-toast-warning .atlas-toast-icon { color: var(--theme-warning); }
.atlas-toast-success .atlas-toast-icon { color: var(--theme-success); }
.atlas-toast-info .atlas-toast-icon { color: var(--theme-info); }

.atlas-confirm-message {
    white-space: pre-line;
}

/* ================================================================
   UTILITY COLORS - ULTRA-CONDENSED
   ================================================================ */

.text-primary {
    color: var(--theme-link) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-success {
    color: var(--theme-success) !important;
}

.text-danger {
    color: var(--theme-danger) !important;
}

.text-warning {
    color: var(--theme-warning) !important;
}

.text-info {
    color: var(--theme-info) !important;
}

.text-dark {
    color: var(--text-primary) !important;
}

.bg-primary {
    background-color: var(--theme-primary) !important;
    color: white !important;
}

.bg-secondary {
    background-color: var(--theme-secondary) !important;
    color: white !important;
}

.bg-success {
    background-color: var(--theme-success) !important;
}

.bg-danger {
    background-color: var(--theme-danger) !important;
}

.bg-warning {
    background-color: var(--theme-warning) !important;
    color: var(--warning-ink) !important;
}

.bg-info {
    background-color: var(--theme-info) !important;
    color: white !important;
}

.bg-light, .bg-white {
    background-color: var(--theme-white) !important;
    color: var(--text-primary) !important;
}

.bg-dark {
    background-color: var(--theme-dark) !important;
    color: white !important;
}

/* ================================================================
   LAYOUT STRUCTURE
   ================================================================ */

:root {
    /* Vertical viewport space consumed by shell chrome above page content. With the
       sidebar shell this is page padding only on desktop; on mobile it also clears
       the floating nav toggle. Full-height page shells size themselves with
       calc(100vh - var(--shell-chrome-offset)) instead of hard-coding the old
       top-navbar height. */
    --shell-chrome-offset: 1.5rem;
}

@media (max-width: 1199.98px) {
    :root {
        --shell-chrome-offset: 4.75rem;
    }
}

main {
    flex: 1;
}

/* Content column beside the sidebar */
.app-main {
    padding-top: 0.75rem;
}

@media (max-width: 1199.98px) {
    /* Clear the floating nav toggle (fixed top-left) */
    .app-main {
        padding-top: 4rem;
    }
}

#blazor-error-ui {
    background: var(--theme-warning) !important;
    bottom: 0;
    box-shadow: var(--shadow-lg);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: var(--warning-ink) !important;
    border-top: 1px solid var(--border-medium);
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
        color: var(--warning-ink) !important;
        text-decoration: none;
        font-weight: bold;
    }

/* Floor Navigation */
.floor-navigation {
    background: var(--theme-accent3) !important;
    border: 1px solid var(--theme-accent1) !important;
}

.floor-button {
    background: var(--theme-white) !important;
    color: var(--theme-primary) !important;
    border: 1px solid var(--border-medium) !important;
}

    .floor-button:hover {
        background: var(--theme-accent3) !important;
    }

    .floor-button.active {
        background: var(--theme-primary) !important;
        color: var(--theme-white) !important;
    }

/* ================================================================
   SHARED STRUCTURAL PATTERNS
   Layout/sizing hoisted from per-component <style> blocks. No
   colour values here — colours live in the sections above and the
   Theme-{Name}.css variable files. The shell (App.razor) links the
   Default theme statically, so these rules reach every page,
   including the anonymous auth pages.
   ================================================================ */

/* Manager list pages (Tickets / Assets / Tags): responsive
   desktop-table vs mobile-cards switcher and shared list chrome. */
.sortable { cursor: pointer; user-select: none; }
.clickable-row { cursor: pointer; }
/* Bootstrap 5.1 ships no min-width utility; flex-item text truncation depends on
   overriding the min-width:auto default, so supply the utility the markup uses. */
.min-w-0 { min-width: 0 !important; }
.mobile-touch-target { min-height: 44px; min-width: 44px; }
/* (.clickable-title lives with its themed colours in the CARDS section above.) */
.clickable-zone { cursor: pointer; transition: background-color 0.2s ease; border-radius: 0.375rem; padding: 0.5rem; margin: -0.5rem -0.5rem 0.75rem -0.5rem; }
.priority-info { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.priority-info > div { flex: 1; min-width: 120px; }
.secondary-info { display: flex; gap: 1rem; flex-wrap: wrap; }
.asset-section, .tag-section, .assignment-section { margin-top: 0.75rem; }
.toolbar-search { flex: 1; min-width: 160px; max-width: 280px; }

/* Manager list tables render as a bounded panel: visible edge, rounded
   corners, header strip flush to the frame. Row padding kept roomier
   than table-sm's default for scan-ability. */
.desktop-table {
    border: 1px solid var(--border-strong);
    border-radius: 0.5rem;
    overflow: hidden;
}

    .desktop-table .table { margin-bottom: 0; }
    .desktop-table .table td { padding: 0.5rem; }

@media (max-width: 1023px) {
    .desktop-table { display: none; }
    .mobile-cards { display: block; }
    .desktop-pagination { display: none; }
    .priority-info { flex-direction: column; gap: 0.75rem; }
    .priority-info > div { min-width: auto; }
    .secondary-info { flex-direction: column; gap: 0.5rem; }
    .toolbar-search { max-width: none; }
}

@media (min-width: 1024px) {
    .mobile-cards { display: none; }
    .desktop-table { display: block; }
}

@media (max-width: 575px) {
    .clickable-zone { padding: 0.25rem; margin: -0.25rem -0.25rem 0.5rem -0.25rem; }
}

/* Detail pages: the page's root element carries .detail-page.
   Scoped because the mobile paddings/button widths must not leak
   into other pages (e.g. manager toolbars use p-0 and icon btns). */
@media (max-width: 576px) {
    .detail-page .card-body { padding: 1rem !important; }
    .detail-page .card-header { padding: 0.75rem 1rem !important; }
    .detail-page .btn { min-width: 80px; }
}

@media (max-width: 375px) {
    .container-fluid.detail-page { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
}

/* Azure Map embeds: container fill, placeholder height, loading overlay.
   Component style blocks declare .map-container geometry per page but leave
   'border: 1px solid' colourless — supply the themed border colour here. */
#mapDiv { height: 100%; width: 100%; }
.min-vh-25 { min-height: 25vh; }
.map-container { border-color: var(--border-medium); }
.map-loading { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; z-index: 1000; }

/* Map console header: live-status chip + consolidated filters panel
   (geometry lives in MapConsole.razor's style block; colours only here) */
.map-live-chip {
    background: var(--theme-accent3);
    border: 1px solid var(--theme-accent2);
    color: var(--text-secondary) !important;
}

    .map-live-chip .map-live-ring-track {
        stroke: var(--theme-accent2);
    }

    .map-live-chip .map-live-ring-progress {
        stroke: var(--theme-success);
    }

    .map-live-chip .map-live-chip-spinner {
        color: var(--theme-primary);
    }

    .map-live-chip.delayed {
        border-color: var(--theme-warning);
    }

        .map-live-chip.delayed .map-live-chip-spinner {
            color: var(--theme-warning);
        }

.map-filters-section-title {
    color: var(--text-muted) !important;
}

/* Map details overlay: themed divider between status rows, neutral status chip with
   a state-coloured dot (geometry in MapDetailsView) */
.map-details-meta-row + .map-details-meta-row {
    border-top-color: var(--border-medium) !important;
}

.map-details-status-chip {
    background: var(--theme-accent3) !important;
    border: 1px solid var(--theme-accent2);
    color: var(--text-primary) !important;
}

.map-details-status-dot.moving {
    background: var(--theme-success);
}

.map-details-status-dot.fixing {
    background: var(--theme-warning);
}

.map-details-status-dot.settled {
    background: var(--theme-secondary);
}

.map-details-status-dot.away,
.map-details-status-dot.unknown {
    background: var(--theme-accent1);
}

/* Map tag markers (HtmlMarker content built by map.js createMarkerContent). The
   neutral disc fills stay fixed across themes — they must read on any floorplan —
   so only structure and shadow live here. */
.map-tag-marker-simple {
    position: relative;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.45));
}

    .map-tag-marker-simple.stale {
        opacity: 0.8;
        filter: none;
    }

.map-tag-marker-detailed {
    position: relative;
    width: 32px;
    height: 32px;
    cursor: pointer;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

    .map-tag-marker-detailed.stale {
        opacity: 0.85;
    }

.map-tag-marker-detailed-icon {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Map popups (Azure Maps popup content built by map.js) — translucent glass cards
   tinted the marker's own colour: the SDK paints the bubble (and arrow) from a
   semi-transparent version of the entity colour, the card carries a half-bright
   border in the same colour (inline, per entity), and the content is white — a
   deliberate fixed treatment over the coloured tint, the same across themes (like
   the marker discs). No drop shadow, matching the zone-overlay look. */
div.popup-content-container {
    box-shadow: none !important;
    /* Match .map-popup's radius below. The SDK ignores its own borderRadius option
       here and leaves the bubble at 4px, so the 10px card cut across the tinted
       bubble's square-ish corners — the corner mismatch in #1264. */
    border-radius: 10px !important;
}

/* The popup appears and disappears as ONE object. Only the inner card used to
   animate, so the SDK-painted bubble AND its arrow snapped in at full opacity
   while their content faded — that mismatch is what read as a flicker (#1264).
   Opacity only: the SDK owns .popup-container's transform for positioning, and
   animating transform here would fight it. */
.popup-container:not(.hidden-accessible-element) {
    animation: map-popup-fade-in 0.18s ease-out;
}

/* Closing a popup does not remove it from the DOM — the SDK collapses it to a
   clipped 1px box (.hidden-accessible-element, with !important), which is why it
   vanished instantly instead of fading. map.js closes the popup FIRST and then
   adds .map-popup-closing, which re-expands that already-dead node just long
   enough to fade it. Nothing defers popup.close(), so no popup can be stranded
   (cf. #1256), and the class comes off on animationend — never on a timer.
   The fade must be an ANIMATION, not a transition: maplibre writes opacity:1 as
   an inline style on the marker element, which a plain declaration would lose to. */
.popup-container.hidden-accessible-element.map-popup-closing {
    clip: auto !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    pointer-events: none !important;
    animation: map-popup-fade-out 0.18s ease-in forwards;
}

@keyframes map-popup-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes map-popup-fade-out {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

.map-popup {
    min-width: 225px;
    max-width: 280px;
    color: #ffffff;
    border: 1.5px solid rgba(255, 255, 255, 0.6); /* overridden inline per entity */
    border-radius: 10px;
    overflow: hidden;
    animation: map-popup-in 0.18s ease-out;
}

/* The card's own motion is the slight rise only — the container above owns the
   fade. Two overlapping opacity ramps were half the flicker. */
@keyframes map-popup-in {
    from {
        transform: translateY(3px);
    }

    to {
        transform: none;
    }
}

    .map-popup .map-popup-body {
        padding: 11px 13px;
    }

    .map-popup .map-popup-header {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .map-popup .map-popup-icon {
        flex-shrink: 0;
        opacity: 0.95;
    }

    .map-popup .map-popup-titles {
        min-width: 0;
    }

    .map-popup .map-popup-title {
        font-weight: 650;
        font-size: 0.88rem;
        line-height: 1.25;
        color: #ffffff;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .map-popup .map-popup-subtitle {
        font-size: 0.68rem;
        font-weight: 600;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: rgba(255, 255, 255, 0.75);
        margin-top: 1px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .map-popup .map-popup-meta {
        display: flex;
        flex-direction: column;
        gap: 5px;
        border-top: 1px solid rgba(255, 255, 255, 0.3);
        margin-top: 9px;
        padding-top: 8px;
    }

    .map-popup .map-popup-meta-row {
        display: flex;
        align-items: center;
        gap: 6px;
        min-width: 0;
    }

    .map-popup .map-popup-meta-icon {
        color: rgba(255, 255, 255, 0.75);
        flex-shrink: 0;
    }

    .map-popup .map-popup-meta-label {
        font-size: 0.72rem;
        color: rgba(255, 255, 255, 0.75);
        flex-shrink: 0;
    }

    .map-popup .map-popup-meta-value {
        font-size: 0.75rem;
        font-weight: 550;
        color: #ffffff;
        margin-left: auto;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .map-popup .map-popup-actions {
        display: flex;
        gap: 6px;
        justify-content: center;
        align-items: center;
        border-top: 1px solid rgba(255, 255, 255, 0.3);
        margin-top: 9px;
        padding-top: 9px;
    }

        /* Frosted buttons over the tint — white outline style, any theme */
        .map-popup .map-popup-actions .btn {
            padding: 4px 8px;
            font-size: 11px;
            background: rgba(255, 255, 255, 0.16) !important;
            border: 1px solid rgba(255, 255, 255, 0.45) !important;
            color: #ffffff !important;
        }

            .map-popup .map-popup-actions .btn:hover {
                background: rgba(255, 255, 255, 0.3) !important;
            }

        .map-popup .map-popup-actions a {
            text-decoration: none;
        }

/* Anonymous auth pages (login / 2FA / recovery): full-viewport brand
   background with a fixed scrim. Reaches these pages because the shell
   statically links the Default theme; the image and scrim are fixed
   brand assets, deliberately not theme variables. */
.login-main {
    min-height: 100vh;
    background-image: url('../GAT_ATLAS_Fusion_LoginBG.jpg');
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    padding: 2rem 1rem;
    position: relative;
}

    .login-main::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.4);
    }

    .login-main .container {
        position: relative;
        z-index: 1;
    }

/* ================================================================
   VALIDATION & ERROR HANDLING
   ================================================================ */

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--theme-success);
}

.invalid {
    outline: 1px solid var(--theme-danger);
}

.validation-message {
    color: var(--theme-danger);
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI9MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, var(--theme-danger);
    padding: 1rem 1rem 1rem 3.7rem;
    color: var(--theme-white);
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

/* ================================================================
   KIOSK SHELL AND BADGE ALLOCATION — the KioskLayout shell (kept for
   future kiosk pages) and the Badge Allocation page's step strip, action
   tiles, facts, progress and result blocks
   (Components/Layout/KioskLayout.razor, Components/Infrafon/BadgeAllocation.razor).
   Structure and sizing only; every colour comes from the theme variables.
   ================================================================ */
.kiosk-main {
    min-height: 100vh;
    padding: 1rem;
}

.kiosk-loading {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-surface);
}


/* Step strip: pending / active / done */
.station-steps {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}

    .station-steps li {
        flex: 1 1 0;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
        border-radius: 0.5rem;
        font-size: 0.9rem;
        background: var(--tertiary-surface);
        color: var(--text-secondary);
    }

        /* White on the solid semantic colours, as .bg-primary and the solid
           buttons above: --theme-white is a surface tint, not text-on-colour. */
        .station-steps li.active {
            background: var(--theme-primary);
            color: white;
        }

        .station-steps li.done {
            background: var(--theme-success);
            color: white;
        }

.station-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    font-weight: 600;
    flex: 0 0 auto;
    background: color-mix(in srgb, currentColor 18%, transparent);
}

/* Home actions */
.station-action {
    min-height: 9.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 1rem;
    white-space: normal;
}

.station-action-icon {
    font-size: 2.5rem;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.station-scanner .qr-scanner-container {
    margin: 0 auto;
}

.station-facts dt {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.station-progress {
    height: 1.25rem;
    max-width: 28rem;
    margin: 0 auto;
}

.station-log {
    max-width: 28rem;
    margin: 0 auto;
    text-align: left;
}

.station-result-icon {
    display: block;
    font-size: 4rem;
    line-height: 1;
}

@media (max-width: 575.98px) {
    .station-action {
        min-height: 7rem;
    }

    .station-steps li {
        justify-content: center;
    }

    .station-step-label {
        display: none;
    }
}
