/* ==========================================================================
   NHM QuoteLogic - Global Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties (Design Tokens)
   -------------------------------------------------------------------------- */
:root {
    /* NHM Brand Colours */
    --nhm-navy: #15346D;
    --nhm-navy-dark: #122E60;
    --nhm-navy-light: #1d4080;
    --nhm-orange: #FF8200;
    --nhm-orange-hover: #e67500;
    --nhm-light-blue: #EEF9FF;

    /* Semantic Colours */
    --color-success: #28a745;
    --color-warning: #ffc107;
    --color-error: #dc3545;
    --color-info: #17a2b8;

    /* Neutral Colours */
    --color-white: #FFFFFF;
    --color-background: #EEF9FF;
    --color-text: #333333;
    --color-text-muted: #6c757d;
    --color-border: #dee2e6;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-xxl: 3rem;

    /* Typography - Inter for digital content */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-size-xs: 0.8125rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.25rem;
    --font-size-xl: 1.5rem;
    --font-size-xxl: 2rem;
    --font-size-stat: 2.5rem;

    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

    /* Layout */
    --header-height: 60px;
    --sidebar-width: 200px;
}

/* --------------------------------------------------------------------------
   Base Styles
   -------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
}

th {
    text-align: left;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.5;
    color: var(--color-text);
    background-color: var(--color-background);
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 var(--spacing-md) 0;
    font-weight: 600;
    line-height: 1.2;
}

h1 { font-size: var(--font-size-xxl); }
h2 { font-size: var(--font-size-xl); }
h3 { font-size: var(--font-size-lg); }

h1:focus {
    outline: none;
}

a {
    color: var(--nhm-orange);
    text-decoration: none;
}

a:hover {
    color: var(--nhm-orange-hover);
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: var(--font-size-base);
    font-weight: 700;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    /* Transparent 3px border so all button variants have the same total height.
       Outline variants (.btn-outline, .btn-secondary) override border-color to
       a visible value; solid variants (.btn-primary, .btn-danger) keep the
       transparent border so they don't visually grow but still match the
       outline buttons in height. Without this, .btn-primary buttons would be
       6px shorter than .btn-outline buttons sitting next to them in the same row. */
    border: 3px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background-color: var(--nhm-orange);
    color: var(--color-white);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--nhm-orange-hover);
    color: var(--color-white);
}

.btn-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: transparent;
    color: var(--nhm-navy);
    border: 3px solid var(--nhm-navy);
}

.btn-secondary:hover {
    background-color: var(--nhm-navy);
    color: var(--color-white);
}

.btn-outline {
    background-color: transparent;
    border: 3px solid var(--nhm-orange);
    color: var(--nhm-orange);
}

.btn-outline:hover:not(:disabled) {
    background-color: var(--nhm-orange);
    color: var(--color-white);
}

.btn-outline:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    border-color: var(--color-text-muted);
    color: var(--color-text-muted);
}

.btn-outline-secondary {
    background-color: transparent;
    border: 3px solid var(--nhm-navy);
    color: var(--nhm-navy);
}

.btn-outline-secondary:hover {
    background-color: var(--nhm-navy);
    color: var(--color-white);
}

.btn-outline-primary {
    background-color: transparent;
    border: 3px solid var(--nhm-navy);
    color: var(--nhm-navy);
}

.btn-outline-primary:hover {
    background-color: var(--nhm-navy);
    color: var(--color-white);
}

.btn-danger {
    background-color: var(--color-error);
    color: #ffffff;
}

.btn-danger:hover:not(:disabled) {
    background-color: #c82333;
    color: #ffffff;
}

.btn-lg {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: var(--font-size-lg);
    min-width: 200px;
}

.btn-sm {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: var(--font-size-sm);
}

.joblogic-icon {
    display: inline-block;
    width: 1.2em;
    height: 1em;
    vertical-align: -0.1em;
    margin-left: 0.5rem;
    background-color: currentColor;
    -webkit-mask-image: url('/images/joblogic-icon.svg');
    mask-image: url('/images/joblogic-icon.svg');
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

.joblogic-icon-sm {
    display: inline-block;
    width: 1em;
    height: 0.85em;
    vertical-align: -0.1em;
    margin-left: 2px;
    background-color: currentColor;
    -webkit-mask-image: url('/images/joblogic-icon.svg');
    mask-image: url('/images/joblogic-icon.svg');
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

.btn-link {
    background: none;
    border: none;
    color: var(--nhm-orange);
    padding: 0;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.btn-link:hover {
    color: var(--nhm-orange-hover);
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card {
    background-color: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-lg);
}

/* Generic content card — white background with a 1px border and fully rounded
   corners. Used as a wrapper around tables, accordions, or other content areas
   that sit inside a .ro-page layout below a .split-toolbar. Differs from .card
   in that it has a border instead of a shadow and provides no padding (the
   inner content controls its own padding). */
.content-card {
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.stat-card {
    background-color: var(--nhm-navy-light);
    color: var(--color-white);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    text-align: center;
    min-width: 180px;
}

.stat-card.highlight {
    background-color: var(--nhm-orange);
}

.stat-card .stat-value {
    font-size: var(--font-size-stat);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-xs);
}

.stat-card .stat-label {
    font-size: var(--font-size-sm);
    opacity: 0.9;
}

a > .stat-card {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

a > .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
.table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--color-white);
}

.table th,
.table td {
    padding: var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.table th {
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: normal;
}

.table tbody tr:hover {
    background-color: var(--color-background);
}

/* --------------------------------------------------------------------------
   Status Badges
   -------------------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--font-size-xs);
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.badge-success {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--color-success);
}

.badge-warning {
    background-color: rgba(255, 140, 0, 0.1);
    color: var(--nhm-orange);
}

.badge-error {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--color-error);
}

.badge-info {
    background-color: rgba(23, 162, 184, 0.1);
    color: var(--color-info);
}

.badge-link {
    text-decoration: none;
    cursor: pointer;
    gap: 0.375rem;
    white-space: nowrap;
}

.badge-link:hover {
    filter: brightness(0.85);
    text-decoration: none;
}

.badge-link .joblogic-icon-sm {
    height: 1em;
    width: 1.2em;
}

/* Deleted-reference badge — inline marker on orphaned entity references */
.deleted-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-left: 0.5rem;
    padding: 0.15rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #ffffff;
    background-color: var(--color-error);
    border-radius: 0.25rem;
    white-space: nowrap;
    vertical-align: middle;
    line-height: 1.2;
}

.deleted-badge i {
    font-size: 0.8rem;
}

[data-theme="dark"] .deleted-badge {
    background-color: #dc3545;
    color: #ffffff;
}

.asset-class-orphan-hint {
    margin: 0.5rem 0 0 0;
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    color: var(--color-warning, #b26a00);
    background-color: rgba(255, 193, 7, 0.1);
    border-left: 3px solid var(--color-warning, #ffc107);
    border-radius: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.form-hint-warning {
    display: block;
    margin-top: 0.3rem;
    color: var(--color-warning, #b26a00);
    font-size: 0.8rem;
}

.quote-orphan-icon {
    margin-left: 0.4rem;
    color: var(--color-warning, #b26a00);
    font-size: 0.9em;
    cursor: help;
}

/* Sync status indicators */
.sync-status {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-sm);
}

.sync-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.sync-status.synced {
    color: var(--color-success);
}

.sync-status.synced::before {
    background-color: var(--color-success);
}

.sync-status.errors {
    color: var(--color-error);
}

.sync-status.errors::before {
    background-color: var(--color-error);
}

.sync-status.pending {
    color: var(--nhm-orange);
}

.sync-status.pending::before {
    background-color: var(--nhm-orange);
}

/* Response time indicators */
.response-time {
    display: inline-block;
    font-size: var(--font-size-sm);
    font-weight: 500;
    white-space: nowrap;
}

.response-time-pending {
    color: var(--nhm-orange);
}

.response-time-sent {
    color: var(--color-success);
}

/* Notification badge */
.notification-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 var(--spacing-xs);
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-white);
    background-color: var(--nhm-orange);
    border-radius: var(--radius-full);
}

/* --------------------------------------------------------------------------
   Layout Components
   -------------------------------------------------------------------------- */

/* Header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 var(--spacing-lg);
    background-color: var(--nhm-navy);
    color: var(--color-white);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.app-header .logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.app-header .logo img {
    height: 40px;
    width: auto;
}

.app-header .logo-text {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--color-white);
}

.app-header .user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.app-header .user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: var(--color-background);
    color: var(--nhm-navy);
    border-radius: 50%;
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.app-header .user-avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

/* Sidebar */
.app-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background-color: var(--nhm-navy);
    color: var(--color-white);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-nav {
    flex: 1;
    padding: var(--spacing-md) 0;
}

.nav-section {
    margin-bottom: var(--spacing-md);
}

.nav-section-title {
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.5);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s;
}

.nav-item:hover {
    background-color: var(--nhm-navy-light);
    color: var(--color-white);
    text-decoration: none;
}

.nav-item.active {
    background-color: var(--nhm-navy-light);
    color: var(--color-white);
    border-left: 3px solid var(--nhm-orange);
}

.nav-item .nav-icon {
    width: 20px;
    text-align: center;
}

.nav-item .nav-badge {
    margin-left: auto;
}

/* Sidebar user profile */
.sidebar-footer {
    padding: var(--spacing-md) var(--spacing-lg);
}

.sidebar-attribution {
    width: 100%;
    max-width: 140px;
    opacity: 0.4;
    transition: opacity 0.2s;
}

.sidebar-attribution:hover {
    opacity: 0.7;
}

/* Main content area */
.app-main {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: var(--spacing-xl);
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
    background-color: var(--color-background);
}

.app-main:has(.ro-page),
.app-main:has(.quotes-page-layout),
.app-main:has(.repair-config-layout) {
    overflow: hidden;
}

/* Without sidebar (splash layout) */
.app-main.full-width {
    margin-left: 0;
}

/* --------------------------------------------------------------------------
   Splash Screen
   -------------------------------------------------------------------------- */
.splash-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.splash-layout .app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.splash-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

/* --------------------------------------------------------------------------
   Dashboard
   -------------------------------------------------------------------------- */
.dashboard-header {
    margin-bottom: var(--spacing-xl);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.dashboard-chart-card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-xl);
}

.dashboard-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.dashboard-chart-header h2 {
    margin: 0;
    font-size: var(--font-size-lg);
}

.recent-quotes {
    background-color: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-lg);
}

.quotes-page-layout {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height) - var(--spacing-xl) * 2);
}

.quotes-table-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    background-color: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.quotes-table-scroll thead th {
    position: sticky;
    top: 0;
    background: var(--color-white);
    z-index: 2;
    box-shadow: 0 1px 0 var(--color-border);
}

[data-theme="dark"] .quotes-table-scroll thead th {
    background: var(--color-white);
}

.recent-quotes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.recent-quotes-header h2 {
    margin: 0;
    font-size: var(--font-size-lg);
}

.view-all-link {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--nhm-orange);
    border-radius: var(--radius-md);
    color: var(--nhm-orange);
    font-size: var(--font-size-sm);
    font-weight: 700;
    transition: all 0.2s;
}

.view-all-link:hover {
    background-color: var(--nhm-orange);
    color: var(--color-white);
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   Integration Dashboard
   -------------------------------------------------------------------------- */
.integration-tile {
    position: relative;
}

.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.integration-tile .status-dot {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
}

.status-dot-live {
    background-color: var(--color-success);
    box-shadow: 0 0 4px var(--color-success);
}

.status-dot-issues {
    background-color: var(--color-error);
    box-shadow: 0 0 4px var(--color-error);
}

.service-detail-card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-lg);
}

.service-detail-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    flex-wrap: wrap;
}

.service-detail-name {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin: 0;
}

.service-detail-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-left: auto;
}

.service-detail-description {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-md);
    line-height: 1.5;
}

.direction-badge-inbound,
.direction-badge-outbound {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.direction-badge-inbound {
    background-color: rgba(23, 162, 184, 0.15);
    color: var(--color-info);
}

.direction-badge-outbound {
    background-color: rgba(255, 130, 0, 0.15);
    color: var(--nhm-orange);
}

.auto-refresh-indicator {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.auto-refresh-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--color-success);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Action links in table */
.action-links {
    display: flex;
    gap: var(--spacing-sm);
}

.action-links a {
    color: var(--nhm-navy);
    font-weight: 500;
}

.action-links a:hover {
    color: var(--nhm-orange);
}

/* --------------------------------------------------------------------------
   Form Validation (Blazor defaults)
   -------------------------------------------------------------------------- */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--color-success);
}

.invalid {
    outline: 1px solid var(--color-error);
}

.validation-message {
    color: var(--color-error);
    font-size: var(--font-size-sm);
}

/* --------------------------------------------------------------------------
   Error Handling
   -------------------------------------------------------------------------- */
.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* --------------------------------------------------------------------------
   Utility Classes
   -------------------------------------------------------------------------- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--color-text-muted); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-error { color: var(--color-error); }

.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--spacing-sm); }
.gap-2 { gap: var(--spacing-md); }
.gap-3 { gap: var(--spacing-lg); }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    font-size: var(--font-size-sm);
    color: var(--color-text);
}

.form-label.required::after {
    content: '*';
    color: var(--color-error);
    margin-left: var(--spacing-xs);
}

.form-control {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    line-height: 1.5;
    color: var(--color-text);
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--nhm-orange);
    box-shadow: 0 0 0 3px rgba(255, 130, 0, 0.15);
}

.form-control::placeholder {
    color: var(--color-text-muted);
}

select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 36px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='3 5 6 8 9 5'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px;
}

.form-control:disabled {
    background-color: var(--color-background);
    cursor: not-allowed;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.form-check {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.form-check-input {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

.form-check-label {
    font-size: var(--font-size-sm);
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    padding: 16px 8px;
}

/* --------------------------------------------------------------------------
   Step 1: Customer & Site Selection Layout
   -------------------------------------------------------------------------- */
.step1-form-grid {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: var(--spacing-md);
    padding: 16px 8px;
}

.step1-main {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.step1-side {
    display: flex;
    flex-direction: column;
}

/* --------------------------------------------------------------------------
   Combobox Component
   -------------------------------------------------------------------------- */
.combobox {
    position: relative;
    width: 100%;
}

.combobox-input-wrapper {
    position: relative;
}

.combobox-input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    padding-right: 40px;
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    line-height: 1.5;
    color: var(--color-text);
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.combobox-input.has-clear {
    padding-right: 68px;
}

.combobox-input:focus {
    outline: none;
    border-color: var(--nhm-orange);
    box-shadow: 0 0 0 3px rgba(255, 130, 0, 0.15);
}

.combobox-clear {
    position: absolute;
    right: 34px;
    top: 0;
    height: 100%;
    width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    padding: 0;
}

.combobox-clear:hover {
    color: var(--color-error);
}

.combobox-toggle {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    padding: 0;
}

.combobox-toggle:hover {
    color: var(--color-text);
}

.combobox-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 1000;
}

.combobox-option {
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    transition: background-color 0.15s;
}

.combobox-option:hover,
.combobox-option.highlighted {
    background-color: var(--color-background);
}

.combobox-option.selected {
    background-color: rgba(255, 130, 0, 0.1);
    color: var(--nhm-orange);
}

.combobox-empty {
    padding: var(--spacing-md);
    text-align: center;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.combobox-loading {
    padding: var(--spacing-md);
    text-align: center;
    color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Progress Stepper Component
   -------------------------------------------------------------------------- */
.progress-stepper {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-xs);
}

.progress-step-top {
    display: flex;
    align-items: center;
    gap: 0;
}

.progress-step-circle {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--font-size-sm);
    transition: all 0.3s;
    border: 2px solid var(--color-border);
    background-color: var(--color-white);
    flex-shrink: 0;
}

.progress-step.pending .progress-step-circle {
    background-color: var(--color-white);
    color: var(--color-text-muted);
    border-color: var(--color-border);
}

.progress-step.active .progress-step-circle {
    background-color: var(--color-success);
    color: var(--color-white);
    border-color: var(--color-success);
}

.progress-step.completed .progress-step-circle {
    background-color: var(--color-success);
    color: var(--color-white);
    border-color: var(--color-success);
}

.progress-step-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    white-space: nowrap;
    font-weight: 600;
}

.progress-step.active .progress-step-label,
.progress-step.completed .progress-step-label {
    color: var(--color-text);
}

.progress-step-line {
    width: 100px;
    height: 2px;
    background-color: var(--color-border);
}

.progress-step-line.completed {
    background-color: var(--color-success);
}

/* --------------------------------------------------------------------------
   Quote Summary Component
   -------------------------------------------------------------------------- */
.quote-summary {
    background-color: transparent;
    padding: var(--spacing-sm);
    min-width: 150px;
}

.quote-summary-row {
    display: flex;
    justify-content: space-between;
    gap: var(--spacing-md);
    padding: 2px 0;
    font-size: var(--font-size-xs);
}

.quote-summary-row.total {
    margin-top: var(--spacing-xs);
    padding-top: var(--spacing-xs);
    font-size: var(--font-size-sm);
}

.quote-summary-label {
    color: var(--color-text);
    font-weight: 600;
}

.quote-summary-value {
    font-weight: 400;
}

.quote-summary-row.total .quote-summary-value {
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   Quote Wizard Styles
   -------------------------------------------------------------------------- */
.quote-wizard {
    max-width: 1200px;
}

.quote-wizard-header {
    margin-bottom: var(--spacing-md);
}

.quote-wizard-title {
    margin-top: 0;
    margin-left: 0;
    margin-right: 0;
}

.quote-progress-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-lg);
}

.quote-number-badge {
    padding: 8px;
    background-color: var(--nhm-light-blue);
    border: 1px solid var(--nhm-navy);
    border-radius: var(--radius-md);
    font-weight: 600;
    color: var(--nhm-navy-light);
}

.quote-info-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    background-color: var(--nhm-light-blue);
    border: 1px solid var(--nhm-navy);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
}

.quote-info-bar .customer-label {
    font-weight: 600;
    color: var(--nhm-navy-light);
}

.quote-info-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.quote-info-bar .vat-exempt-label {
    color: var(--nhm-orange);
    font-weight: 600;
}

.quote-info-bar .site-label {
    font-weight: 600;
    color: var(--nhm-navy-light);
}

.synced-info-bar {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background: #f0fdf4;
    border-radius: var(--radius-sm, 6px);
}

.sync-error-bar {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background: #fef2f2;
    border-radius: var(--radius-sm, 6px);
}

.sync-error-text {
    color: #991b1b;
}

.wizard-card {
    background-color: var(--color-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    padding: 8px;
    margin-bottom: var(--spacing-lg);
}

.wizard-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 8px;
    margin-bottom: var(--spacing-md);
}

.wizard-card-title {
    margin: 0;
    font-size: var(--font-size-lg);
}

.wizard-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--spacing-lg);
}

.wizard-actions-left {
    display: flex;
    gap: var(--spacing-sm);
}

.wizard-actions-right {
    display: flex;
    gap: var(--spacing-sm);
}

/* Step 3 Review Card */
.step3-card {
    padding: 0;
}

.step3-card .wizard-card-header {
    padding: 16px 8px;
    margin-bottom: 0;
}

.step3-table-wrapper {
    width: 100%;
}

.step3-table-wrapper .quote-preview-table {
    margin: 0;
}

.step3-summary {
    display: flex;
    justify-content: flex-end;
    padding: 8px;
}

/* Quote Preview Table */
.quote-preview {
    background-color: var(--color-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    margin-bottom: var(--spacing-lg);
}

.quote-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 8px;
    border-bottom: 1px solid var(--color-border);
}

.quote-preview-title {
    margin: 0;
    font-size: var(--font-size-lg);
}

.quote-preview-hint {
    color: var(--nhm-orange);
    font-size: var(--font-size-sm);
}

.quote-preview-table {
    width: 100%;
}

.quote-preview-table th {
    background-color: var(--color-border);
    color: var(--color-text);
    font-weight: 600;
    font-size: var(--font-size-sm);
    text-transform: none;
    letter-spacing: normal;
    padding: var(--spacing-md) var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
}

.quote-preview-table td {
    font-size: var(--font-size-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: none;
}

.quote-preview-table .empty-row td {
    border-bottom: none;
}

.quote-preview-footer {
    display: flex;
    justify-content: flex-end;
    padding: var(--spacing-md) var(--spacing-lg);
}

.quantity-input {
    width: 60px;
    padding: var(--spacing-xs) var(--spacing-sm);
    text-align: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}

.delete-line-btn {
    background: none;
    border: none;
    color: var(--color-error);
    cursor: pointer;
    padding: var(--spacing-xs);
    font-size: var(--font-size-lg);
}

.delete-line-btn:hover {
    color: #a52929;
}

/* --------------------------------------------------------------------------
   Repair Type Group Sections (Quote Preview)
   -------------------------------------------------------------------------- */
.repair-group-header {
    background: var(--nhm-light-blue, #EEF9FF);
}

.repair-group-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-xs) 0;
}

.repair-group-title {
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.repair-group-subheader th {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: var(--spacing-xs) var(--spacing-sm);
}

.repair-group-labour-row {
    font-style: italic;
    color: var(--color-text-muted);
}

.repair-group-subtotal {
    border-bottom: 2px solid var(--color-border);
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-xs);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-lg);
    line-height: 1;
    color: var(--nhm-navy);
}

.btn-icon:hover {
    background: var(--nhm-light-blue);
}

.btn-icon-danger:hover {
    color: var(--color-error);
    background: #fce7e7;
}

.options-column {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.override-labour-group {
    margin-top: var(--spacing-xs);
}

.input-with-prefix {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.input-prefix {
    font-weight: 600;
    color: var(--color-text-muted);
}

/* Parts header label */
.parts-header-label {
    display: grid;
    grid-template-columns: 40px 100px 1fr;
    gap: var(--spacing-sm);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-top: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
}

/* Parts selection area */
.parts-selection {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
}

.parts-list {
    max-height: 120px;
    overflow-y: auto;
}

.part-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) 0;
}

.part-item-qty {
    width: 50px;
    padding: var(--spacing-xs);
    text-align: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}

.add-item-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) 0;
    background: none;
    border: none;
    color: var(--nhm-orange);
    font-weight: 700;
    cursor: pointer;
    font-size: var(--font-size-base);
    margin-top: var(--spacing-md);
}

.add-item-btn:hover {
    color: var(--nhm-orange-hover);
}

.add-item-btn:disabled {
    color: var(--color-text-muted);
    cursor: not-allowed;
}

/* Row/Col grid system */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 calc(var(--spacing-md) * -0.5);
}

.col-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
    padding: 0 calc(var(--spacing-md) * 0.5);
}

/* Step 2 bottom section */
.step2-bottom-row {
    margin-top: 0;
    padding: 16px 8px;
}

.step2-bottom-row .col-4:first-child {
    display: flex;
    flex-direction: column;
}

.step2-bottom-row .col-4:last-child {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

textarea.service-description-textarea {
    flex: 1;
    height: 170px;
    min-height: 170px;
    max-height: 170px;
    resize: none;
}

/* Checkboxes in a row aligned to bottom */
.options-row-inline {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--spacing-md);
    align-items: center;
}

.options-row-inline .form-check {
    font-size: var(--font-size-xs);
}

.options-row-inline .form-check-label {
    font-size: var(--font-size-xs);
}



/* Quantity control with +/- buttons */
.qty-control {
    display: flex;
    align-items: center;
    gap: 2px;
}

.qty-btn {
    width: 20px;
    height: 20px;
    padding: 0;
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: var(--font-size-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    color: var(--color-text);
}

.qty-value {
    min-width: 20px;
    text-align: center;
    font-size: var(--font-size-sm);
}

.part-number {
    font-size: var(--font-size-sm);
}

/* Options column */
.options-column {
    display: flex;
    flex-direction: column;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.form-check-label.disabled {
    color: var(--color-text-muted);
}

/* Options checkboxes row - deprecated, keeping for compatibility */
.options-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--color-border);
}

/* --------------------------------------------------------------------------
   Quotes List Page
   -------------------------------------------------------------------------- */
.quotes-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
}

.quotes-filters {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.quotes-filters .search-input {
    min-width: 300px;
}

.quotes-filters select {
    min-width: 150px;
}

/* --------------------------------------------------------------------------
   Repair Types Pages
   -------------------------------------------------------------------------- */
.repair-types-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
}

.repair-types-filters {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.repair-types-filters .search-input {
    min-width: 300px;
}

.repair-types-filters select {
    min-width: 150px;
}

.repair-type-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.parts-management {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    background-color: var(--color-white);
}

/* --------------------------------------------------------------------------
   Repair Categories Pages
   -------------------------------------------------------------------------- */
.repair-categories-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
}

.repair-categories-filters {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.repair-categories-filters .search-input {
    min-width: 300px;
}

.repair-category-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    max-width: 800px;
}

.category-type-selector {
    display: flex;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.subcategory-indent {
    padding-left: var(--spacing-xl);
}

.subcategory-badge,
.category-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 500;
}

.category-badge {
    background-color: var(--nhm-navy);
    color: var(--color-white);
}

.subcategory-badge {
    background-color: var(--color-border);
    color: var(--color-text);
}

.category-warning {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    color: #856404;
    font-size: var(--font-size-sm);
}

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
}

.pagination-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--nhm-orange);
    color: var(--nhm-orange);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn.active {
    background-color: var(--nhm-orange);
    border-color: var(--nhm-orange);
    color: var(--color-white);
}

.pagination-info {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

/* --------------------------------------------------------------------------
   Loading Spinner
   -------------------------------------------------------------------------- */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border);
    border-top-color: var(--nhm-orange);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Inline button spinner — sized to sit inside button text */
.btn-spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: -0.15em;
    opacity: 0.8;
}

.loading-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Inline Alert (form-level error/success/warning messages)
   -------------------------------------------------------------------------- */
.inline-alert {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    margin-bottom: var(--spacing-md);
    font-size: var(--font-size-sm);
    line-height: 1.4;
}

.inline-alert-icon {
    flex-shrink: 0;
    font-size: 1.1em;
    margin-top: 0.1em;
}

.inline-alert-body {
    flex: 1;
}

.inline-alert-dismiss {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0 var(--spacing-xs);
    font-size: 1em;
    opacity: 0.7;
    line-height: 1;
}

.inline-alert-dismiss:hover {
    opacity: 1;
}

.inline-alert-error {
    background-color: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.3);
    color: var(--color-error);
}

.inline-alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    border-color: rgba(40, 167, 69, 0.3);
    color: var(--color-success);
}

.inline-alert-warning {
    background-color: rgba(255, 193, 7, 0.12);
    border-color: rgba(255, 193, 7, 0.35);
    color: #856404;
}

.inline-alert-info {
    background-color: rgba(23, 162, 184, 0.1);
    border-color: rgba(23, 162, 184, 0.3);
    color: var(--color-info);
}

/* --------------------------------------------------------------------------
   Empty State
   -------------------------------------------------------------------------- */
.empty-state {
    text-align: center;
    padding: var(--spacing-xxl);
    color: var(--color-text-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.empty-state-title {
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-sm);
    color: var(--color-text);
}

.empty-state-message {
    margin-bottom: var(--spacing-lg);
}

/* --------------------------------------------------------------------------
   Config Tabs
   -------------------------------------------------------------------------- */
.config-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: var(--spacing-lg);
}

.config-tab {
    padding: var(--spacing-sm) var(--spacing-lg);
    cursor: pointer;
    border: none;
    background: none;
    font-weight: 700;
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    color: var(--color-text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.config-tab.active {
    color: var(--nhm-orange);
    border-bottom-color: var(--nhm-orange);
    background: rgba(255, 130, 0, 0.08);
}

.config-tab:hover:not(.active) {
    color: var(--nhm-navy);
}

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-container {
    background: var(--color-white);
    border-radius: var(--radius-md);
    width: 90%;
    max-width: 1100px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--color-border);
}

.modal-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin: 0;
}

.modal-subtitle {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-top: var(--spacing-xs);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--color-text);
}

.modal-body {
    padding: var(--spacing-lg);
}

.modal-body .form-group {
    margin-bottom: var(--spacing-sm);
}

.modal-body .form-row {
    margin-bottom: var(--spacing-sm);
}

.labour-hours-input {
    width: 20%;
    min-width: 100px;
}

.modal-body .form-check {
    margin-top: 8px;
}

/* --------------------------------------------------------------------------
   Toggle Switch
   -------------------------------------------------------------------------- */
.toggle-switch {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: var(--spacing-sm);
    cursor: pointer;
    margin-top: 8px;
    position: relative;
    width: fit-content;
}

input.toggle-switch-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.toggle-switch-slider {
    display: inline-block;
    position: relative;
    width: 36px;
    height: 20px;
    background-color: #d1d5db;
    border-radius: 10px;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.toggle-switch-slider::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background-color: #ffffff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

input.toggle-switch-input:checked + .toggle-switch-slider {
    background-color: var(--nhm-navy);
}

input.toggle-switch-input:checked + .toggle-switch-slider::after {
    transform: translateX(16px);
}

.toggle-switch-label {
    font-size: var(--font-size-sm);
    user-select: none;
    white-space: nowrap;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    padding: var(--spacing-lg);
    border-top: 1px solid var(--color-border);
}

/* --------------------------------------------------------------------------
   Breadcrumb
   -------------------------------------------------------------------------- */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-sm);
}

.breadcrumb a {
    color: var(--nhm-navy);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb i.fad {
    font-size: 0.65em;
    opacity: 0.5;
}

.breadcrumb-separator {
    margin: 0 var(--spacing-xs);
}

/* --------------------------------------------------------------------------
   Category Accordion
   -------------------------------------------------------------------------- */
.category-accordion {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-md);
    overflow: hidden;
}

.category-accordion-header {
    display: flex;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-border);
    cursor: pointer;
    user-select: none;
}

.category-accordion-title {
    font-weight: 600;
    flex: 1;
}

.category-accordion-count {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-right: var(--spacing-sm);
}

.category-accordion-chevron {
    transition: transform 0.2s;
    font-size: var(--font-size-sm);
}

.category-accordion-chevron i {
    transition: transform 0.2s;
}

.category-accordion-header.collapsed .category-accordion-chevron {
    transform: rotate(-90deg);
}

.category-accordion .table,
.category-accordion .asset-detail-table {
    margin: 0;
    border-top: 1px solid var(--color-border);
}

/* --------------------------------------------------------------------------
   Count Badges
   -------------------------------------------------------------------------- */
.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: 600;
    padding: 0 var(--spacing-xs);
    background: var(--color-background);
    color: var(--nhm-navy);
}

/* --------------------------------------------------------------------------
   Status Badges (Asset Type / Repair)
   -------------------------------------------------------------------------- */
.status-all-active {
    background: #dcfce7;
    color: #166534;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 500;
}

.status-has-obsolete {
    background: #fef3c7;
    color: #92400e;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   Asset Type Table Cells
   -------------------------------------------------------------------------- */
.asset-type-cell-model {
    font-weight: 600;
}

.asset-type-cell-class {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Parts Summary (inline in detail table)
   -------------------------------------------------------------------------- */
.parts-summary {
    font-size: var(--font-size-sm);
}

.parts-summary-empty {
    font-style: italic;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

/* --------------------------------------------------------------------------
   Repair Config Page Layout
   -------------------------------------------------------------------------- */
.repair-config-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.repair-config-filters {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
}

.repair-config-filters .search-input {
    min-width: 300px;
}

.repair-config-filters select {
    min-width: 150px;
}

.repair-config-layout {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height) - var(--spacing-xl) * 2);
}

.repair-config-card {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.repair-config-table-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.repair-config-table-scroll thead th {
    position: sticky;
    top: 0;
    background: var(--color-white);
    z-index: 1;
}

.repair-config-table-meta {
    padding: var(--spacing-sm) 0;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.repair-config-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: calc(100vh - 350px);
}

/* --------------------------------------------------------------------------
   Action Links (View | Edit style)
   -------------------------------------------------------------------------- */
.action-links {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.action-links a,
.action-links button {
    color: var(--nhm-navy);
    font-weight: 600;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-size: var(--font-size-sm);
}

.action-links a:hover,
.action-links button:hover {
    text-decoration: underline;
}

.action-links .btn-icon {
    font-size: var(--font-size-lg);
    padding: var(--spacing-xs);
    text-decoration: none;
}

.action-links .btn-icon:hover {
    text-decoration: none;
}

.action-separator {
    color: var(--color-text-muted);
}

tr.clickable-row {
    cursor: pointer;
}

tr.clickable-row:hover td {
    background-color: var(--nhm-light-blue);
}

/* --------------------------------------------------------------------------
   Action Icons (inline edit/delete)
   -------------------------------------------------------------------------- */
.action-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-xs);
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    font-size: var(--font-size-base);
}

.action-icon:hover {
    background: var(--color-background);
}

.action-icon-edit:hover {
    color: var(--nhm-navy);
}

.action-icon-delete:hover {
    color: var(--color-error);
}

/* --------------------------------------------------------------------------
   Danger Link Button
   -------------------------------------------------------------------------- */
.btn-link-danger {
    background: none;
    border: none;
    color: var(--color-error);
    padding: 0;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    font-size: var(--font-size-sm);
}

.btn-link-danger:hover {
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Notification Bell
   -------------------------------------------------------------------------- */
.notification-bell {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: var(--spacing-xs) var(--spacing-sm);
    transition: opacity 0.2s;
}

.notification-bell:hover {
    opacity: 0.8;
}

.notification-bell-icon {
    font-size: var(--font-size-lg);
    --fa-primary-color: #b0b8c4;
    --fa-primary-opacity: 0.8;
    --fa-secondary-color: #ffffff;
    --fa-secondary-opacity: 1;
}

.notification-bell + span {
    margin-left: var(--spacing-sm);
}

.notification-bell .notification-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    min-width: 18px;
    height: 18px;
}

/* Subtle pulse drawn when a new notification arrives — runs ~1s with two ease-in-out
   cycles via CSS keyframes. Only fires when the count goes UP, never on dismissals. */
.notification-bell-pulse {
    animation: notification-bell-pulse-keyframes 0.5s ease-in-out 2;
}

@keyframes notification-bell-pulse-keyframes {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1);
    }
}

/* --------------------------------------------------------------------------
   Notification Scroll Container
   Wraps the notifications table so the table is bounded by available page
   space rather than expanding indefinitely. Used by Pages/Notifications/Index.razor
   in conjunction with the JS infinite-scroll IntersectionObserver pattern.
   -------------------------------------------------------------------------- */
.notification-scroll-container {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    background: var(--color-white);
    border-radius: var(--radius-md);
}

.notification-scroll-loading {
    padding: var(--spacing-lg);
    text-align: center;
    opacity: 0.6;
}

/* --------------------------------------------------------------------------
   Custom Notification Toast (replaces Syncfusion SfToast)
   Pure CSS toast positioned top-right inside .app-main. Animated via
   CSS transitions (slide-in / slide-out) with a progress bar that shrinks
   over the auto-dismiss duration (6 seconds, set via inline animation-duration).
   -------------------------------------------------------------------------- */
.toast-host {
    position: fixed;
    top: calc(var(--header-height) + var(--spacing-md));
    right: var(--spacing-lg);
    z-index: 9000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    pointer-events: none;
    max-width: 420px;
    width: 100%;
}

.notification-toast {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-md) var(--spacing-md) var(--spacing-md);
    background: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.1);
    pointer-events: all;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    border-left: 4px solid var(--color-text-muted);
}

.notification-toast-show {
    transform: translateX(0);
    opacity: 1;
}

.notification-toast-hide {
    transform: translateX(120%);
    opacity: 0;
}

/* Severity accent colours on the left border */
.notification-toast-info {
    border-left-color: #17a2b8;
}
.notification-toast-warning {
    border-left-color: #FF8200;
}
.notification-toast-error {
    border-left-color: #dc3545;
}

.notification-toast-icon {
    flex-shrink: 0;
    font-size: 20px;
    margin-top: 1px;
}

.notification-toast-info .notification-toast-icon {
    color: #17a2b8;
}
.notification-toast-warning .notification-toast-icon {
    color: #FF8200;
}
.notification-toast-error .notification-toast-icon {
    color: #dc3545;
}

.notification-toast-content {
    flex: 1;
    min-width: 0;
}

.notification-toast-title {
    font-weight: 700;
    font-size: var(--font-size-base);
    color: var(--color-text);
    line-height: 1.3;
}

.notification-toast-message {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-top: 2px;
    line-height: 1.4;
}

.notification-toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 2px 4px;
    font-size: 14px;
    line-height: 1;
    border-radius: var(--radius-sm);
    transition: background 0.15s, color 0.15s;
}

.notification-toast-close:hover {
    background: var(--color-background);
    color: var(--color-text);
}

/* Progress bar that shrinks from 100% to 0% over the toast duration. The
   animation-duration is set inline (6s) so it stays in sync with the C# timer. */
.notification-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
}

.notification-toast-progress-bar {
    height: 100%;
    background: var(--nhm-orange);
    animation: toast-progress-shrink linear forwards;
    transform-origin: left;
}

@keyframes toast-progress-shrink {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

/* Dark mode adjustments */
[data-theme="dark"] .notification-toast {
    background: var(--color-background);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .notification-toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Severity icon shown next to the notification title in each row.
   Uses Font Awesome Pro Duo Tone — colours are set inline per severity. */
.notification-severity-icon {
    flex-shrink: 0;
    margin-top: 3px;
    font-size: 18px;
}

/* Empty-state icon override — large, centred Font Awesome glyph instead of an emoji.
   Inherits the .empty-state-icon font sizing but reverts the opacity slightly so the
   duotone secondary layer reads cleanly against both light and dark backgrounds. */
.notification-empty-icon {
    font-size: 64px;
    color: var(--color-text-muted);
}


/* --------------------------------------------------------------------------
   Notification Table Layout
   -------------------------------------------------------------------------- */
.notification-table {
    width: 100%;
    margin: 0;
}

table.notification-table th {
    vertical-align: baseline;
    padding: var(--spacing-sm) var(--spacing-md);
    white-space: nowrap;
    text-align: left !important;
}

table.notification-table td {
    vertical-align: middle;
    padding: var(--spacing-sm) var(--spacing-md);
    white-space: nowrap;
}

table.notification-table th {
    background-color: var(--color-border);
    color: var(--color-text);
    font-weight: 600;
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    /* Sticky inside the .notification-scroll-container so column headings stay
       visible while the body scrolls. */
    position: sticky;
    top: 0;
    z-index: 1;
}

table.notification-table td {
    border-bottom: 1px solid var(--color-border);
    font-weight: 600;
    color: var(--nhm-navy);
}

.notification-table td:last-child {
    padding-right: var(--spacing-md);
    white-space: nowrap;
}
.notification-title-cell {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-xs);
    white-space: normal;
}

.notification-title-text {
    font-weight: 600;
    color: var(--nhm-navy);
}

.notification-title-text a {
    color: var(--nhm-navy);
    text-decoration: none;
}

.notification-title-text a:hover {
    text-decoration: underline;
}

.notification-message-text {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-top: 2px;
    font-weight: normal;
}

.notification-date-relative {
    font-size: var(--font-size-sm);
    font-weight: normal;
    color: var(--color-text-muted);
}

.notification-status-active {
    color: var(--nhm-orange);
    font-weight: 600;
}

.notification-status-resolved {
    color: var(--color-success);
    font-weight: 600;
}

.resolved-row td {
    color: var(--color-text-muted);
}
.resolved-row .notification-title-text {
    color: var(--color-text-muted);
}
.resolved-row .notification-status-resolved {
    color: var(--color-success);
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   Notification Filter Bar
   -------------------------------------------------------------------------- */
.notification-filters {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    flex-wrap: wrap;
}

.notification-filters .search-input {
    flex: 1 1 auto;
    max-width: 500px;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-base);
}

.notification-filters .filter-dropdowns {
    display: flex;
    gap: var(--spacing-sm);
    margin-left: auto;
}

.notification-filters select {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    background: var(--color-white);
}

/* --------------------------------------------------------------------------
   Notification Filter Tabs
   -------------------------------------------------------------------------- */
.filter-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: var(--spacing-md);
    flex-shrink: 0;
}

.filter-tab {
    padding: 8px var(--spacing-xl) 10px;
    border: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    background: var(--color-border);
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.filter-tab:hover:not(.active) {
    background: var(--color-text-muted);
    color: var(--nhm-navy);
}

.filter-tab.active {
    background-color: var(--nhm-navy);
    color: var(--color-white);
}

.filter-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background-color: var(--nhm-orange);
}

.filter-tab .tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px 0 4px;
    margin-left: var(--spacing-xs);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 700;
    background-color: var(--nhm-orange);
    color: var(--color-white);
}

/* --------------------------------------------------------------------------
   Notification Action Buttons
   The action cells use proper .btn classes (btn-primary / btn-outline) so we
   only need a flex wrapper here — colour, border, padding etc. all come from
   the button styles themselves.
   -------------------------------------------------------------------------- */
.notification-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* --------------------------------------------------------------------------
   Notification Footer
   -------------------------------------------------------------------------- */
.notification-footer {
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Status Badges — Manufacturer & NHM (Repair Config)
   -------------------------------------------------------------------------- */
.status-badge-current {
    background: #dcfce7;
    color: #166534;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 500;
    white-space: nowrap;
}

.status-badge-obsolete {
    background: #fef3c7;
    color: #92400e;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 500;
    white-space: nowrap;
}

.status-badge-active {
    background: #dcfce7;
    color: #166534;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 500;
    white-space: nowrap;
}

.status-badge-inactive {
    background: #fce7e7;
    color: #991b1b;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 500;
    white-space: nowrap;
}

.status-badge-sm {
    padding: 1px 8px;
    font-size: 0.7rem;
}

/* Asset status badges */
.status-badge-warning {
    background: #fef3c7;
    color: #92400e;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 500;
    white-space: nowrap;
}

.status-badge-error {
    background: #fce7e7;
    color: #991b1b;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 500;
    white-space: nowrap;
}

.status-badge-success {
    background: #dcfce7;
    color: #166534;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
}

a.status-badge-success:hover {
    filter: brightness(0.95);
    text-decoration: none;
}

[data-theme="dark"] .status-badge-warning {
    background: rgba(240, 180, 41, 0.2);
    color: #f0b429;
}

[data-theme="dark"] .status-badge-error {
    background: rgba(248, 81, 73, 0.2);
    color: #f85149;
}

[data-theme="dark"] .status-badge-success {
    background: rgba(52, 208, 88, 0.2);
    color: #34d058;
}

[data-theme="dark"] .inline-alert-error {
    background-color: rgba(248, 81, 73, 0.15);
    border-color: rgba(248, 81, 73, 0.4);
    color: #f85149;
}

[data-theme="dark"] .inline-alert-success {
    background-color: rgba(52, 208, 88, 0.15);
    border-color: rgba(52, 208, 88, 0.4);
    color: #34d058;
}

[data-theme="dark"] .inline-alert-warning {
    background-color: rgba(240, 180, 41, 0.15);
    border-color: rgba(240, 180, 41, 0.4);
    color: #f0b429;
}

[data-theme="dark"] .inline-alert-info {
    background-color: rgba(88, 166, 255, 0.15);
    border-color: rgba(88, 166, 255, 0.4);
    color: #58a6ff;
}

/* Status dot for list items indicating the asset has a status issue (amber = warning, red = error) */
.asset-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f0b429;
    flex-shrink: 0;
}

.asset-status-dot.error {
    background: #f85149;
}

/* --------------------------------------------------------------------------
   Parts Search & Drop Zone (Add Repair Modal)
   -------------------------------------------------------------------------- */
.parts-search-area {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
}

.parts-drop-zone {
    min-height: 100px;
    border-top: 1px solid var(--color-border);
    padding: var(--spacing-sm);
}

.parts-drop-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--font-size-sm);
    border-bottom: 1px solid var(--color-border);
}

.parts-drop-item:last-child {
    border-bottom: none;
}

/* --------------------------------------------------------------------------
   Parts Line Display (Asset Type Detail)
   -------------------------------------------------------------------------- */
.part-line {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-bottom: 2px;
}

.part-number-badge {
    background: #dbeafe;
    color: #1e40af;
    padding: 1px 8px;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: 600;
    font-family: monospace;
}

a.part-number-badge-link {
    display: inline-block;
    text-decoration: none;
    cursor: pointer;
}

a.part-number-badge-link:hover {
    text-decoration: underline;
    filter: brightness(0.9);
}

.part-detail {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.repair-id-cell {
    font-weight: 600;
    font-family: monospace;
    color: var(--nhm-navy);
}

/* --------------------------------------------------------------------------
   Modal — Part Added Section (blue)
   -------------------------------------------------------------------------- */
.parts-added-section {
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    margin-top: var(--spacing-md);
    padding-bottom: 24px;
}

.parts-added-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--color-text);
    padding: 8px 8px 16px;
    text-transform: uppercase;
}

.parts-added-section .table {
    margin: 0;
    background: transparent;
    font-size: var(--font-size-sm);
}

.parts-added-section .table td,
.parts-added-section .table th {
    padding: var(--spacing-xs) var(--spacing-sm);
    border-bottom: 1px solid var(--color-border);
}

.part-no-link {
    color: #1e40af;
    font-weight: 600;
    font-family: monospace;
}

.parts-empty-hint {
    color: var(--color-text-muted);
    padding: var(--spacing-md) 0;
}

/* --------------------------------------------------------------------------
   Numbered Pagination
   -------------------------------------------------------------------------- */
.pagination-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
}

.pagination-info-text {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.pagination-numbers {
    display: flex;
    gap: 4px;
}

.pagination-number {
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-white);
    color: var(--color-text);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-number:hover {
    background: var(--color-background);
    border-color: var(--nhm-navy);
}

.pagination-number.active {
    background: var(--nhm-navy);
    color: var(--color-white);
    border-color: var(--nhm-navy);
}

.pagination-ellipsis {
    display: flex;
    align-items: center;
    padding: 0 4px;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

/* --------------------------------------------------------------------------
   Category Accordion — Color Dots
   -------------------------------------------------------------------------- */
.category-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-right: var(--spacing-xs);
}

.category-dot-ok {
    background-color: #3b82f6;
}

.category-dot-warning {
    background-color: var(--nhm-orange);
}

/* --------------------------------------------------------------------------
   Asset Detail — Header Row (info card + Add Repair button)
   -------------------------------------------------------------------------- */
.asset-detail-header-row {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.asset-detail-info-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 8px var(--spacing-lg);
    width: fit-content;
    min-width: 280px;
}

.asset-detail-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15rem;
    margin-bottom: var(--spacing-xs);
}

.asset-detail-title-row h1 {
    margin: 0;
    font-size: var(--font-size-xl);
    color: var(--nhm-navy);
    font-weight: 700;
}

.asset-detail-meta-grid {
    display: grid;
    grid-template-columns: auto auto auto auto;
    column-gap: 2rem;
    row-gap: 2px;
    width: fit-content;
}

.asset-detail-meta-grid .meta-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.asset-detail-meta-grid .meta-value {
    font-size: var(--font-size-sm);
    color: var(--color-text);
    font-weight: 500;
}

.asset-detail-header-row > .btn-primary {
    margin-left: auto;
    white-space: nowrap;
}

.asset-detail-accordion-area {
    padding: 0;
}

.asset-detail-accordion-area .category-accordion {
    border: none;
    border-radius: 0;
    margin-bottom: 0;
    border-bottom: 1px solid var(--color-border);
}

.asset-detail-accordion-area .category-accordion:last-child {
    border-bottom: none;
}

/* --------------------------------------------------------------------------
   Asset Detail — Column Header Table (light blue headers)
   -------------------------------------------------------------------------- */
.asset-detail-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

.asset-detail-table th {
    background-color: var(--nhm-light-blue);
    color: var(--nhm-navy);
    font-weight: 600;
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    padding: var(--spacing-sm) var(--spacing-md);
    white-space: nowrap;
}

.asset-detail-table td {
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
    font-size: var(--font-size-sm);
}

.asset-detail-table td:last-child {
    padding-right: var(--spacing-lg);
}

.asset-detail-table .part-continuation-row td {
    border-bottom: 1px solid color-mix(in srgb, var(--color-border) 50%, transparent);
}

.text-truncate-cell {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Asset Detail — Action Buttons (blue, larger)
   -------------------------------------------------------------------------- */
.asset-detail-actions {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.asset-detail-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-xs);
    border-radius: var(--radius-sm);
    color: var(--nhm-navy);
    font-size: var(--font-size-lg);
    line-height: 1;
}

.asset-detail-action-btn:hover {
    background: var(--nhm-light-blue);
}

.asset-detail-action-delete:hover {
    color: var(--color-error);
    background: #fce7e7;
}

/* --------------------------------------------------------------------------
   Repair Footer Info
   -------------------------------------------------------------------------- */
.repair-footer-info {
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Parts Selection Modal
   -------------------------------------------------------------------------- */
.parts-modal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.parts-modal-table thead th {
    text-align: left;
    padding: var(--spacing-sm) var(--spacing-sm);
    border-bottom: 2px solid var(--color-border);
    font-weight: 600;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
}

.parts-modal-table tbody td {
    padding: var(--spacing-sm) var(--spacing-sm);
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.parts-modal-col-check {
    width: 40px;
}

.parts-modal-col-qty {
    width: 70px;
}

.parts-modal-col-price {
    width: 90px;
    text-align: right;
}

.parts-modal-part-number {
    font-weight: 600;
}

.parts-modal-part-desc {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.parts-modal-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    white-space: nowrap;
}

.parts-modal-badge.mandatory {
    background-color: var(--nhm-navy);
    color: var(--color-white);
}

.parts-modal-badge.optional {
    background-color: var(--color-border);
    color: var(--color-text-muted);
}

.parts-modal-qty-input {
    width: 60px;
    padding: var(--spacing-xs);
    text-align: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
}

.parts-modal-qty-input:disabled {
    background: var(--color-background);
    color: var(--color-text-muted);
}

.parts-modal-row-deselected {
    opacity: 0.5;
}

.parts-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.parts-modal-footer-summary {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    font-weight: 500;
}

.parts-modal-footer-actions {
    display: flex;
    gap: var(--spacing-sm);
}

/* Inline parts description in Step 2 */
.part-desc-inline {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modify-parts-btn {
    margin-top: var(--spacing-sm);
}

/* --------------------------------------------------------------------------
   Blazor Reconnection Modal — branded custom UI
   --------------------------------------------------------------------------
   The framework toggles CSS classes on #components-reconnect-modal when the
   SignalR circuit changes state:
     components-reconnect-show     → connection lost, attempting reconnect
     components-reconnect-retrying → mid-retry attempt
     components-reconnect-hide     → connection re-established, hide modal
     components-reconnect-failed   → all retries exhausted, manual reload needed
     components-reconnect-rejected → server lost the circuit (e.g. redeployment)
                                      js/reconnect.js auto-reloads on this state
   We provide our own markup in App.razor and style it here to match the NHM
   brand. The default state is hidden; the framework makes it visible by
   adding the components-reconnect-show class. */

#components-reconnect-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background-color: rgba(15, 23, 42, 0.65);
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    font-family: var(--font-family);
}

/* Show the modal whenever the framework toggles us into any active state.
   The framework swaps these classes — we just need to react to them. */
#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-retrying,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex;
}

/* Grace period: js/reconnect.js adds this class for ~1s whenever we enter a
   show/retrying state. Suppresses the modal for very short disconnects so the
   user isn't flashed a "Connection issue" message when the reconnect completes
   within the grace window. Cleared automatically by the script. */
#components-reconnect-modal.reconnect-grace {
    display: none !important;
}

.reconnect-modal-card {
    background-color: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    max-width: 480px;
    width: 100%;
    overflow: hidden;
}

.reconnect-modal-header {
    background-color: var(--nhm-navy);
    /* Literal white — NOT var(--color-white) which resolves to dark grey in dark
       mode. The navy header background is the same in both modes so the text must
       always be white for contrast. */
    color: #ffffff;
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.reconnect-modal-header i {
    font-size: 20px;
    --fa-primary-color: var(--nhm-orange);
    --fa-secondary-color: #ffffff;
    --fa-secondary-opacity: 0.85;
}

.reconnect-modal-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    margin: 0;
}

.reconnect-modal-body {
    padding: var(--spacing-lg);
    color: var(--color-text);
    font-size: var(--font-size-base);
    line-height: 1.5;
}

.reconnect-modal-body p {
    margin: 0 0 var(--spacing-sm) 0;
}

.reconnect-modal-body p:last-child {
    margin-bottom: 0;
}

.reconnect-modal-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--color-border);
    border-top-color: var(--nhm-orange);
    border-radius: 50%;
    animation: reconnect-spin 0.8s linear infinite;
    vertical-align: -3px;
    margin-right: var(--spacing-sm);
}

@keyframes reconnect-spin {
    to { transform: rotate(360deg); }
}

.reconnect-modal-footer {
    padding: 0 var(--spacing-lg) var(--spacing-lg);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
}

/* Show only the message blocks relevant to the current state. The framework
   adds the state class to the modal itself; we use descendant selectors to
   reveal/hide the matching block. */
.reconnect-modal-message {
    display: none;
}

#components-reconnect-modal.components-reconnect-show .reconnect-modal-message[data-state="show"],
#components-reconnect-modal.components-reconnect-retrying .reconnect-modal-message[data-state="show"] {
    display: block;
}

#components-reconnect-modal.components-reconnect-failed .reconnect-modal-message[data-state="failed"] {
    display: block;
}

#components-reconnect-modal.components-reconnect-rejected .reconnect-modal-message[data-state="rejected"] {
    display: block;
}

/* The Reload footer button is only relevant in failed/rejected states. */
.reconnect-modal-footer-failed,
.reconnect-modal-footer-rejected {
    display: none;
}

#components-reconnect-modal.components-reconnect-failed .reconnect-modal-footer-failed,
#components-reconnect-modal.components-reconnect-rejected .reconnect-modal-footer-rejected {
    display: flex;
}

/* Dark-mode contrast */
[data-theme="dark"] #components-reconnect-modal {
    background-color: rgba(0, 0, 0, 0.75);
}

[data-theme="dark"] .reconnect-modal-card {
    background-color: var(--color-background);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .reconnect-modal-body {
    color: var(--color-text);
}

/* Keep the legacy framework-injected error banner hidden — we surface our
   own errors via InlineAlert and the toast host instead. The reconnect modal
   above replaces this banner for connection issues. */
#blazor-error-ui {
    display: none;
}

/* --------------------------------------------------------------------------
   Split layout (Customers / Parts / Assets pages)
   -------------------------------------------------------------------------- */
.ro-page {
    position: fixed;
    top: var(--header-height);
    left: var(--sidebar-width);
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: var(--spacing-xl);
    background-color: var(--color-background);
}

.ro-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
    flex-shrink: 0;
}

.ro-page-title {
    color: var(--nhm-navy);
    margin: 0 0 var(--spacing-xs) 0;
}

.ro-page-subtitle {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin: 0;
}

.split-toolbar {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--color-white);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
}

.split-toolbar-search {
    flex: 1;
    min-width: 0;
}

.split-toolbar-sort {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-shrink: 0;
}

.split-toolbar-sort select {
    min-width: 180px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 36px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='3 5 6 8 9 5'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px;
}

.split-toolbar-sort-btn {
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 6px 10px;
    font-size: var(--font-size-base);
    color: var(--color-text);
    line-height: 1;
}

.split-toolbar-sort-btn:hover {
    background: var(--nhm-light-blue);
}

.split-toolbar-meta {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.split-toolbar-divider {
    width: 0;
    min-width: 0;
    height: 24px;
    border-left: 1px solid var(--color-border);
    flex-shrink: 0;
    flex-grow: 0;
}

.split-toolbar-reset {
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 6px 10px;
    font-size: var(--font-size-base);
    color: var(--color-text-muted);
    line-height: 1;
    flex-shrink: 0;
}

.split-toolbar-reset:hover:not(:disabled) {
    color: var(--color-text);
    background: var(--nhm-light-blue);
}

.split-toolbar-reset:disabled {
    opacity: 0.4;
    cursor: default;
}

[data-theme="dark"] .split-toolbar-divider {
    border-left-color: #4a5260;
}

[data-theme="dark"] .split-toolbar-reset {
    color: var(--color-text);
    border-color: #4a5260;
}

[data-theme="dark"] .split-toolbar-reset:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
}

.split-layout {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    gap: var(--spacing-lg);
}

.split-list-panel {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-md);
    background: var(--color-white);
    overflow: hidden;
}

.split-list-header {
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--color-border);
}

.split-list-search {
    margin-bottom: var(--spacing-sm);
}

.split-list-meta {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.split-list-items {
    flex: 1;
    overflow-y: auto;
}

.split-list-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background-color 0.15s;
}

.split-list-item:hover {
    background-color: var(--color-background);
}

.split-list-item.selected {
    background-color: #fff5ee;
    border-left-color: var(--nhm-orange);
}

.split-list-item-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background-color: var(--color-background);
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xs);
    font-weight: 600;
    flex-shrink: 0;
}

.split-list-item-body {
    flex: 1;
    min-width: 0;
}

.split-list-item-name {
    font-weight: 600;
    font-size: var(--font-size-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.split-list-item-sub {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.split-list-item-badge {
    background-color: var(--nhm-navy);
    color: var(--color-white);
    border-radius: 12px;
    padding: 2px 8px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    flex-shrink: 0;
}

.split-detail-panel {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-xl);
    background-color: var(--color-white);
    border-radius: var(--radius-md);
}

.split-detail-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

/* --------------------------------------------------------------------------
   Customer detail card
   -------------------------------------------------------------------------- */
.customer-detail-card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    padding: var(--spacing-lg);
}

.customer-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding-bottom: var(--spacing-lg);
}

.customer-detail-name {
    color: var(--nhm-navy);
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin: 0 0 var(--spacing-xs) 0;
}

.detail-sync-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    flex-wrap: wrap;
}

.detail-sync-sep {
    opacity: 0.5;
}

.badge-muted {
    background-color: var(--color-background);
    color: var(--color-text-muted);
}

.detail-section {
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--color-border);
}

.detail-section-label {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-md);
}

.detail-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}


.contact-columns {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--spacing-md);
    margin-bottom: 24px;
}

.contact-col-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-xs);
}

.key-contacts-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
}

.key-contact-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.key-contact-name {
    font-weight: 600;
    color: var(--nhm-navy);
    font-size: var(--font-size-sm);
}

.key-contact-title {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.table.table-plain td {
    border-bottom: none;
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: calc(var(--font-size-xs) * 1.1);
    font-weight: 400;
    color: var(--color-text);
}

.table.table-plain th {
    padding: var(--spacing-xs) var(--spacing-md);
    background-color: var(--color-background);
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.detail-section--no-border {
    border-top: none;
    padding-top: var(--spacing-sm);
}

.detail-section--first {
    border-top: none;
    padding-top: 0;
}


/* --------------------------------------------------------------------------
   Read-only banner
   -------------------------------------------------------------------------- */
.readonly-banner {
    background-color: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: var(--border-radius-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* --------------------------------------------------------------------------
   Synced badge
   -------------------------------------------------------------------------- */
.synced-badge {
    color: var(--color-success, #16a34a);
    font-size: var(--font-size-xs);
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   Contact chip (Key Contacts section)
   -------------------------------------------------------------------------- */
.contact-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--font-size-sm);
    margin-right: var(--spacing-xs);
    margin-bottom: var(--spacing-xs);
}

.contact-chip-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--nhm-navy);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Detail grid
   -------------------------------------------------------------------------- */
.detail-grid {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: var(--spacing-xs) var(--spacing-md);
    margin-bottom: 24px;
}

.detail-grid-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    padding: var(--spacing-xs) 0;
}

.detail-grid-value {
    font-size: var(--font-size-sm);
    padding: var(--spacing-xs) 0;
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   Clickable user — header & sidebar
   -------------------------------------------------------------------------- */
.user-info-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: inherit;
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    transition: background-color 0.2s;
}

.user-info-link:hover {
    background-color: var(--nhm-navy-light);
    color: inherit;
    text-decoration: none;
}

.user-menu-wrapper {
    position: relative;
}

.user-menu-trigger {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
}

.user-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: var(--spacing-xs);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    min-width: 180px;
    z-index: 1000;
    overflow: hidden;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--color-text);
    text-decoration: none;
    font-size: var(--font-size-sm);
    white-space: nowrap;
}

.user-menu-item:hover {
    background: var(--nhm-light-blue);
    color: var(--color-text);
    text-decoration: none;
}

.user-menu-item i {
    width: 16px;
    text-align: center;
    color: var(--color-text-muted);
}

[data-theme="dark"] .user-menu-dropdown {
    background: var(--color-card-bg);
    border-color: var(--color-border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .user-menu-item:hover {
    background: var(--nhm-navy-light);
}

.sidebar-footer .sidebar-user-link {
    display: block;
    color: var(--color-white);
    text-decoration: none;
    margin-bottom: var(--spacing-sm);
    border-radius: var(--border-radius-sm);
    padding: var(--spacing-xs);
    transition: background-color 0.2s;
}

.sidebar-footer .sidebar-user-link:hover {
    background-color: var(--nhm-navy-light);
    color: var(--color-white);
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   Profile page
   -------------------------------------------------------------------------- */
.profile-card {
    background: var(--color-white);
    border-radius: var(--border-radius);
    padding: var(--spacing-xl);
    max-width: 560px;
    box-shadow: var(--shadow-sm);
}

.profile-avatar-block {
    margin-bottom: var(--spacing-lg);
}

.profile-avatar-img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-avatar-initials {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background-color: var(--nhm-navy-light);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xl);
    font-weight: 600;
}

.profile-details {
    margin-bottom: var(--spacing-xl);
}

.profile-field {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--color-border);
}

.profile-field:last-child {
    border-bottom: none;
}

.profile-label {
    width: 80px;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.profile-value {
    font-weight: 500;
}

.profile-manage-hint {
    margin-top: var(--spacing-sm);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.profile-cards-row {
    display: flex;
    gap: var(--spacing-xl);
    align-items: flex-start;
}

.profile-cards-row .profile-card:first-child {
    flex: 1;
}

/* --------------------------------------------------------------------------
   Theme Option Buttons (Profile page)
   -------------------------------------------------------------------------- */
.theme-options {
    display: flex;
    gap: var(--spacing-md);
}

.theme-option-btn {
    border: 2px solid var(--color-border);
    background: transparent;
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    min-width: 100px;
    color: var(--color-text);
}

.theme-option-btn:hover {
    border-color: var(--nhm-orange);
}

.theme-option-btn.active {
    border-color: var(--nhm-orange);
    background-color: rgba(255, 130, 0, 0.1);
}

.theme-option-btn i {
    font-size: var(--font-size-xl);
    display: block;
    margin-bottom: var(--spacing-xs);
}

.theme-option-btn span {
    font-size: var(--font-size-sm);
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   Quote ↔ Repair Config Navigation
   -------------------------------------------------------------------------- */
.repair-config-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) 8px;
}

.add-repair-btn {
    margin-top: var(--spacing-md);
}

.quote-return-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    font-weight: 500;
    color: #856404;
}

.repair-highlighted {
    background-color: rgba(255, 130, 0, 0.1);
    outline: 2px solid var(--nhm-orange);
    outline-offset: -2px;
}

/* ==========================================================================
   Dark Theme Overrides
   ========================================================================== */
[data-theme="dark"] {
    /* NHM Brand Colours — adjusted for dark mode */
    --nhm-navy: #1a3a6e;
    --nhm-navy-dark: #0f2548;
    --nhm-navy-light: #264a85;
    --nhm-light-blue: #1a2332;

    /* Semantic Colours */
    --color-success: #34d058;
    --color-warning: #f0b429;
    --color-error: #f85149;
    --color-info: #58a6ff;

    /* Neutral Colours — inverted */
    --color-white: #343a40;
    --color-background: #161a1f;
    --color-text: #e1e4e8;
    --color-text-muted: #8b949e;
    --color-border: #30363d;

    /* Shadows — stronger for dark */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] body {
    color-scheme: dark;
}

[data-theme="dark"] .app-header {
    background-color: var(--nhm-navy-dark);
}

[data-theme="dark"] .app-header,
[data-theme="dark"] .app-header .logo-text,
[data-theme="dark"] .app-header .user-info,
[data-theme="dark"] .app-header .user-info span {
    color: #ffffff;
}

[data-theme="dark"] .app-header .user-avatar {
    color: #ffffff;
    background-color: var(--nhm-navy-light);
}

[data-theme="dark"] .app-sidebar {
    background-color: #0d1117;
}

[data-theme="dark"] .app-sidebar,
[data-theme="dark"] .sidebar-footer {
    color: #ffffff;
}

[data-theme="dark"] .app-main {
    background-color: var(--color-background);
}

[data-theme="dark"] .ro-page {
    background-color: var(--color-background);
}

[data-theme="dark"] .stat-card {
    background-color: #264a85;
    color: #ffffff;
}

[data-theme="dark"] .stat-card.highlight {
    background-color: var(--nhm-orange);
}

[data-theme="dark"] .stat-card .stat-value,
[data-theme="dark"] .stat-card .stat-label {
    color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .dashboard-chart-card {
    background-color: #1c2128;
}

[data-theme="dark"] .service-detail-card {
    background-color: #1c2128;
}

[data-theme="dark"] .direction-badge-inbound {
    background-color: rgba(88, 166, 255, 0.15);
    color: #58a6ff;
}

[data-theme="dark"] .direction-badge-outbound {
    background-color: rgba(255, 130, 0, 0.15);
    color: #ff9d3d;
}

[data-theme="dark"] .category-accordion-header {
    background: var(--color-border);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background-color: #21262d;
    color: var(--color-text);
    border-color: var(--color-border);
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: var(--color-text-muted);
}

[data-theme="dark"] .modal-container {
    background: var(--color-white);
}

[data-theme="dark"] .splash-container {
    background-color: var(--color-background);
}

[data-theme="dark"] .toggle-switch-slider {
    background-color: var(--color-text-muted);
}

[data-theme="dark"] .toggle-switch-slider::after {
    background-color: #c9d1d9;
}

[data-theme="dark"] input.toggle-switch-input:checked + .toggle-switch-slider {
    background-color: var(--nhm-navy-light);
}

[data-theme="dark"] .repair-group-header {
    background: rgba(46, 125, 163, 0.15);
}

[data-theme="dark"] .btn-icon {
    color: var(--color-text);
}

[data-theme="dark"] .btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .btn-icon-danger:hover {
    color: var(--color-error);
    background: rgba(248, 81, 73, 0.15);
}

[data-theme="dark"] .category-warning {
    background-color: rgba(240, 180, 41, 0.15);
    border-color: #f0b429;
    color: #f0b429;
}

[data-theme="dark"] .status-all-active,
[data-theme="dark"] .status-badge-active,
[data-theme="dark"] .status-badge-current {
    background: rgba(52, 208, 88, 0.15);
    color: #34d058;
}

[data-theme="dark"] .status-has-obsolete,
[data-theme="dark"] .status-badge-obsolete {
    background: rgba(240, 180, 41, 0.15);
    color: #f0b429;
}

[data-theme="dark"] .status-badge-inactive {
    background: rgba(248, 81, 73, 0.15);
    color: #f85149;
}

[data-theme="dark"] .part-number-badge {
    background: rgba(88, 166, 255, 0.15);
    color: #58a6ff;
}

[data-theme="dark"] .parts-modal-badge.mandatory {
    background-color: var(--nhm-navy-light);
    color: #ffffff;
}

[data-theme="dark"] .part-no-link {
    color: #58a6ff;
}

[data-theme="dark"] .readonly-banner {
    background-color: rgba(240, 180, 41, 0.15);
    border-color: #f0b429;
    color: #f0b429;
}

[data-theme="dark"] .quote-number-badge,
[data-theme="dark"] .quote-info-bar {
    background-color: var(--nhm-light-blue);
    border-color: var(--nhm-navy-light);
    color: var(--color-text);
}

[data-theme="dark"] .quote-info-bar .customer-label,
[data-theme="dark"] .quote-info-bar .site-label {
    color: var(--color-text);
}

[data-theme="dark"] .quote-info-bar .vat-exempt-label {
    color: var(--nhm-orange);
}

[data-theme="dark"] .synced-info-bar {
    background: #0d2818;
}

[data-theme="dark"] .sync-error-bar {
    background: #2d1215;
}

[data-theme="dark"] .sync-error-text {
    color: #f85149;
}

[data-theme="dark"] .quote-return-banner {
    background-color: #2d2a1e;
    border-color: #f0b429;
    color: #f0b429;
}

[data-theme="dark"] .repair-highlighted {
    background-color: rgba(255, 130, 0, 0.15);
}

[data-theme="dark"] .asset-detail-table th {
    background-color: var(--color-background);
    color: var(--color-text-muted);
}

[data-theme="dark"] .asset-detail-action-btn {
    color: #ffffff;
}

[data-theme="dark"] .asset-detail-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

[data-theme="dark"] .asset-detail-action-delete:hover {
    background: rgba(248, 81, 73, 0.15);
    color: var(--color-error);
}

[data-theme="dark"] .split-list-item.selected {
    background-color: rgba(255, 130, 0, 0.1);
}

[data-theme="dark"] .blazor-error-boundary {
    background-color: #6e1919;
}

[data-theme="dark"] .darker-border-checkbox.form-check-input {
    border-color: #484f58;
}

[data-theme="dark"] .notification-table th {
    background-color: var(--color-border);
}

[data-theme="dark"] .action-links a,
[data-theme="dark"] .action-links button {
    color: var(--color-text-muted);
}

[data-theme="dark"] .action-links a:hover,
[data-theme="dark"] .action-links button:hover {
    color: var(--color-text);
}

[data-theme="dark"] .action-links .btn-icon {
    color: var(--color-text);
}

[data-theme="dark"] .action-links .btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text);
}

[data-theme="dark"] .action-links .btn-icon-danger:hover {
    color: var(--color-error);
    background: rgba(248, 81, 73, 0.15);
}

[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-primary:hover:not(:disabled) {
    color: var(--color-background);
}

[data-theme="dark"] .btn-secondary {
    color: #58a6ff;
    border-color: #58a6ff;
}

[data-theme="dark"] .btn-secondary:hover:not(:disabled) {
    background-color: #58a6ff;
    color: var(--color-background);
}

[data-theme="dark"] .btn-danger {
    background-color: var(--color-error);
    color: var(--color-background);
}

[data-theme="dark"] .btn-danger:hover:not(:disabled) {
    background-color: #c82333;
    color: var(--color-background);
}

[data-theme="dark"] .btn-outline-secondary {
    background-color: #58a6ff;
    border-color: #58a6ff;
    color: var(--color-background);
}

[data-theme="dark"] .btn-outline-secondary:hover {
    background-color: #79b8ff;
    border-color: #79b8ff;
    color: var(--color-background);
}

[data-theme="dark"] .btn-outline-primary {
    background-color: transparent;
    border-color: #58a6ff;
    color: #58a6ff;
}

[data-theme="dark"] .btn-outline-primary:hover {
    background-color: #58a6ff;
    border-color: #58a6ff;
    color: var(--color-background);
}

[data-theme="dark"] .btn-outline {
    background-color: transparent;
    border-color: var(--nhm-orange);
    color: var(--nhm-orange);
}

[data-theme="dark"] .btn-outline:hover {
    background-color: var(--nhm-orange);
    border-color: var(--nhm-orange);
    color: var(--color-background);
}

[data-theme="dark"] .nav-item:hover,
[data-theme="dark"] .nav-item.active {
    color: #ffffff;
}

[data-theme="dark"] .ro-page-title {
    color: var(--color-text);
}

[data-theme="dark"] .filter-tab.active {
    color: #ffffff;
}

[data-theme="dark"] .split-list-item-badge {
    color: #ffffff;
    background-color: var(--color-border);
}

[data-theme="dark"] .customer-detail-name {
    color: var(--color-text);
}

[data-theme="dark"] .split-list-item-avatar {
    background-color: var(--color-text-muted);
    color: #ffffff;
}

[data-theme="dark"] .split-list-item-badge {
    background-color: var(--color-text-muted);
}

[data-theme="dark"] .repair-id-cell {
    color: var(--color-text);
}

[data-theme="dark"] .notification-title-text,
[data-theme="dark"] .notification-title-text a,
[data-theme="dark"] .notification-table td {
    color: var(--color-text);
}

[data-theme="dark"] .config-tab:hover:not(.active) {
    color: var(--color-text);
}

[data-theme="dark"] .count-badge {
    background-color: var(--color-text-muted);
    color: #ffffff;
}

[data-theme="dark"] .category-accordion-title {
    color: var(--color-text);
}

[data-theme="dark"] .category-badge {
    background-color: var(--color-text-muted);
    color: #ffffff;
}

[data-theme="dark"] .breadcrumb,
[data-theme="dark"] .breadcrumb a {
    color: var(--color-text);
}

[data-theme="dark"] .asset-detail-title-row h1 {
    color: var(--color-text);
}

[data-theme="dark"] .profile-avatar-initials {
    color: #ffffff;
}

/* --------------------------------------------------------------------------
   Theme Dropdown
   -------------------------------------------------------------------------- */
.theme-dropdown-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
}

.theme-dropdown {
    position: relative;
    z-index: 1050;
}

.theme-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    cursor: pointer;
    padding: 0.375rem 0.75rem;
    font-size: var(--font-size-sm);
    border-radius: var(--radius-sm);
    transition: background-color 0.2s, border-color 0.2s;
}

.theme-dropdown-toggle:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.theme-dropdown-toggle i {
    --fa-primary-color: #ffffff;
    --fa-secondary-color: #b0b8c4;
    --fa-secondary-opacity: 0.8;
}

.theme-dropdown-caret {
    font-size: 0.6rem;
    opacity: 0.7;
}

.theme-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1050;
    min-width: 10rem;
    margin-top: var(--spacing-xs);
    padding: var(--spacing-xs) 0;
    list-style: none;
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.theme-dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    background: none;
    color: var(--color-text);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: background-color 0.15s;
}

.theme-dropdown-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.theme-dropdown-item.active {
    background-color: var(--nhm-orange);
    color: #ffffff;
}

.theme-dropdown-item.active:hover {
    opacity: 0.9;
}

/* --------------------------------------------------------------------------
   FontAwesome Duotone — Sidebar Icon Colours
   -------------------------------------------------------------------------- */
.nav-item .nav-icon i {
    --fa-primary-color: #ffffff;
    --fa-secondary-color: #b0b8c4;
    --fa-secondary-opacity: 0.7;
}

.nav-item.active .nav-icon i {
    --fa-secondary-opacity: 1;
}

/* --------------------------------------------------------------------------
   Confirm Dialog
   -------------------------------------------------------------------------- */
.confirm-dialog {
    max-width: 420px;
    text-align: center;
    padding: var(--spacing-xl);
}

.confirm-dialog-icon {
    font-size: 2.5rem;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-md);
}

.confirm-dialog-icon i {
    --fa-primary-color: var(--nhm-navy);
    --fa-secondary-color: var(--color-text-muted);
    --fa-secondary-opacity: 0.7;
}

.confirm-dialog-title {
    margin: 0 0 var(--spacing-sm);
    font-size: var(--font-size-lg);
}

.confirm-dialog-message {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    margin: 0 0 var(--spacing-lg);
    line-height: 1.5;
}

.confirm-dialog-actions {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
}

/* Email recipient pill (SendQuoteEmailModal) */
.email-recipient-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 13px;
    color: var(--color-text);
}

/* ==========================================================================
   Email Contact Selection (Send Quote Email Modal)
   ========================================================================== */

.email-contact-section-label {
    font-weight: 600;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-sm);
}

.email-contact-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-bottom: 4px;
    background: var(--color-background);
    border: 1px solid var(--color-border);
}

.email-contact-row.disabled {
    cursor: default;
    opacity: 0.5;
}

.email-contact-row:hover:not(.disabled) {
    background: var(--nhm-light-blue);
}

.email-contact-name {
    font-weight: 500;
    font-size: var(--font-size-sm);
    color: var(--color-text);
}

.email-contact-detail {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* ==========================================================================
   Contact Picker
   ========================================================================== */

.contact-picker-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.contact-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 13px;
    color: var(--color-text);
}

.contact-pill-remove {
    display: inline-flex;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 0;
    font-size: 11px;
    line-height: 1;
}

.contact-pill-remove:hover {
    color: var(--color-danger);
}

.contact-option-name {
    font-weight: 600;
}

.contact-option-detail {
    color: var(--color-text-muted);
    font-size: 12px;
    margin-left: 4px;
}

.contact-option-source {
    color: var(--color-text-muted);
    font-size: 11px;
    margin-left: auto;
    opacity: 0.7;
}

.combobox-option:has(.contact-option-name) {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ==========================================================================
   Help Guides
   ========================================================================== */

/* --------------------------------------------------------------------------
   Help Index Page
   -------------------------------------------------------------------------- */
.help-index {
    max-width: 1280px;
}

.help-header {
    margin-bottom: var(--spacing-lg);
}

.help-header h1 {
    margin-bottom: 2px;
}

.help-subtitle {
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-md);
    font-size: var(--font-size-sm);
}

.help-search-wrapper {
    position: relative;
    max-width: 480px;
}

.help-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    pointer-events: none;
}

.help-search-input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    background: var(--color-white);
    color: var(--color-text);
    transition: border-color 0.2s;
}

.help-search-input:focus {
    outline: none;
    border-color: var(--nhm-orange);
}

/* Getting Started Banner */
.help-banner {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    background: linear-gradient(135deg, var(--nhm-navy), var(--nhm-navy-light));
    color: #fff;
    padding: 14px var(--spacing-lg);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-lg);
}

.help-banner-content {
    flex: 1;
    min-width: 0;
}

.help-banner-content h2 {
    margin: 0 0 2px;
    font-size: var(--font-size-base);
    font-weight: 600;
}

.help-banner-content p {
    margin: 0;
    opacity: 0.8;
    font-size: var(--font-size-sm);
    line-height: 1.4;
}

.help-banner-cta {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    background: var(--nhm-orange);
    color: #fff;
    padding: 8px 18px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    transition: background 0.15s;
}

.help-banner-cta:hover {
    background: #e07400;
}

.help-banner-cta i {
    font-size: 0.75rem;
}

/* Sections */
.help-section {
    margin-bottom: var(--spacing-lg);
}

.help-section-title {
    font-size: var(--font-size-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    padding: 8px 0;
    margin-bottom: var(--spacing-sm);
}

/* Popular Guide Cards */
.help-cards-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
}

.help-card {
    display: flex;
    flex-direction: column;
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    text-decoration: none;
    color: var(--color-text);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    transition: transform 0.15s, box-shadow 0.15s;
}

.help-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.help-card:hover h3 {
    text-decoration: underline;
}

.help-card-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-background);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-size-base);
    color: var(--color-text);
}

.help-card-icon i {
    --fa-primary-color: var(--nhm-navy);
    --fa-secondary-color: var(--color-text-muted);
}

.help-card-body h3 {
    margin: 0 0 var(--spacing-xs);
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.help-card-body p {
    margin: 0;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    line-height: 1.45;
}

.help-card-meta {
    margin-top: auto;
    padding-top: var(--spacing-sm);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* All Guides Grid */
.help-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
}

.help-grid-item {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    text-decoration: none;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.help-grid-item:hover {
    border-color: var(--nhm-orange);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
}

.help-grid-item:hover h3 {
    text-decoration: underline;
}

.help-grid-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-background);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    color: var(--color-text);
    flex-shrink: 0;
}

.help-grid-icon i {
    --fa-primary-color: var(--nhm-navy);
    --fa-secondary-color: var(--color-text-muted);
}

.help-grid-body h3 {
    margin: 0 0 2px;
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.help-grid-body p {
    margin: 0 0 var(--spacing-xs);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    line-height: 1.4;
}

/* Article count badge — blue on light blue (matches Draft badge) */
.help-article-badge {
    display: inline-block;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-info);
    background: rgba(23, 162, 184, 0.1);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.help-empty {
    text-align: center;
    padding: var(--spacing-xxl);
    color: var(--color-text-muted);
}

.help-empty i {
    font-size: 2rem;
    margin-bottom: var(--spacing-md);
    display: block;
}

/* --------------------------------------------------------------------------
   Guide Detail Page
   -------------------------------------------------------------------------- */
.help-guide {
    max-width: 1100px;
}

.help-breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-lg);
}

.help-breadcrumb a {
    color: var(--nhm-orange);
    text-decoration: none;
}

.help-breadcrumb a:hover {
    text-decoration: underline;
}

.help-breadcrumb i {
    font-size: 0.6rem;
}

.help-guide-header {
    margin-bottom: var(--spacing-xl);
}

.help-guide-header h1 {
    margin-bottom: var(--spacing-xs);
}

.help-guide-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.help-guide-tag {
    background: rgba(255, 130, 0, 0.1);
    color: var(--nhm-orange);
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: var(--font-size-xs);
}

/* Back link */
.help-back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--nhm-orange);
    text-decoration: none;
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-md);
}

.help-back-link:hover {
    text-decoration: underline;
}

/* Layout: content + sidebar (sidebar on right) */
.help-guide-layout {
    display: flex;
    gap: var(--spacing-xl);
    align-items: flex-start;
}

.help-sidebar {
    width: 220px;
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--header-height) + var(--spacing-lg));
    order: 2;
}

.help-content {
    order: 1;
}

.help-sidebar-section {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    border: 1px solid var(--color-border);
    margin-bottom: var(--spacing-md);
}

.help-sidebar-section h4 {
    margin: 0 0 var(--spacing-sm);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.help-sidebar-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.help-sidebar-nav li {
    margin-bottom: 2px;
}

.help-sidebar-nav a {
    display: block;
    padding: 6px 10px;
    font-size: var(--font-size-sm);
    color: var(--color-text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}

.help-sidebar-nav a:hover {
    background: var(--color-background);
}

.help-sidebar-nav a.active {
    background: rgba(255, 130, 0, 0.1);
    color: var(--nhm-orange);
    font-weight: 600;
}

/* Content area */
.help-content {
    flex: 1;
    min-width: 0;
    order: 1;
}

.help-article {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: var(--spacing-xl);
    border: 1px solid var(--color-border);
    margin-bottom: var(--spacing-lg);
}

.help-article h2 {
    margin: 0 0 var(--spacing-lg);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--color-border);
    font-size: var(--font-size-xl);
}

.help-article h3 {
    margin: var(--spacing-lg) 0 var(--spacing-sm);
    font-size: var(--font-size-lg);
    color: var(--nhm-navy);
}

.help-article h3:first-of-type {
    margin-top: 0;
}

.help-article p {
    margin: 0 0 var(--spacing-md);
    line-height: 1.65;
}

.help-article ul,
.help-article ol {
    margin: 0 0 var(--spacing-md);
    padding-left: var(--spacing-lg);
    line-height: 1.65;
}

.help-article li {
    margin-bottom: var(--spacing-xs);
}

/* Screenshots */
.help-screenshot {
    margin: var(--spacing-md) 0;
    text-align: center;
}

.help-screenshot img {
    max-width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.help-screenshot figcaption {
    margin-top: var(--spacing-sm);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    font-style: italic;
}

/* Tables */
.help-table-wrapper {
    margin: var(--spacing-md) 0;
    overflow-x: auto;
}

.help-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.help-table th,
.help-table td {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid var(--color-border);
}

.help-table th {
    background: var(--color-background);
    font-weight: 600;
    color: var(--nhm-navy);
}

.help-table tr:last-child td {
    border-bottom: none;
}

/* Code blocks */
.help-code {
    background: #1e293b;
    color: #e2e8f0;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    overflow-x: auto;
    font-size: var(--font-size-sm);
    line-height: 1.6;
    margin: var(--spacing-md) 0;
}

/* Blockquote */
.help-blockquote {
    border-left: 4px solid var(--nhm-orange);
    padding: var(--spacing-sm) var(--spacing-md);
    margin: var(--spacing-md) 0;
    background: rgba(255, 130, 0, 0.05);
    color: var(--color-text);
    font-style: italic;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Scroll to top button */
.help-scroll-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--nhm-navy);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-base);
    box-shadow: var(--shadow-md);
    transition: background 0.15s, transform 0.15s;
    z-index: 50;
}

.help-scroll-top:hover {
    background: var(--nhm-navy-light);
    transform: translateY(-2px);
}

/* Not found */
.help-not-found {
    text-align: center;
    padding: var(--spacing-xxl);
}

.help-not-found h1 {
    margin-bottom: var(--spacing-md);
}

.help-not-found a {
    color: var(--nhm-orange);
}

/* --------------------------------------------------------------------------
   Help Guides — Dark theme overrides
   -------------------------------------------------------------------------- */
[data-theme="dark"] .help-banner {
    background: linear-gradient(135deg, #1a2744, #243a5e);
}

[data-theme="dark"] .help-article h3 {
    color: #93b4e0;
}

[data-theme="dark"] .help-table th {
    color: #93b4e0;
}

[data-theme="dark"] .help-card-icon,
[data-theme="dark"] .help-grid-icon {
    background-color: var(--nhm-navy-light);
    color: #ffffff;
}

[data-theme="dark"] .help-card-icon i,
[data-theme="dark"] .help-grid-icon i {
    --fa-primary-color: #ffffff;
    --fa-secondary-color: rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .help-code {
    background: #0f172a;
}
