:root {
    --global-bottom-menu-height: 82px;
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: #ffffff !important;
    box-shadow: none !important;
}

body {
    /* padding-bottom moved to MainLayout to avoid double scrollbars */
    margin: 0;
    background: #ffffff !important;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}


.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

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

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

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxN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LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

/* Global Loading Screen Styles */
.global-loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff; /* Pure white */
    z-index: 9999;
    overflow: hidden;
}

.geometric-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    z-index: 0;
}

.loading-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.loading-logo {
    width: 80px;
    height: 80px;
    animation: logo-spin 2.5s infinite cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 8px 16px rgba(0, 91, 148, 0.15));
    padding: 10px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.loading-message {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 1.25rem;
    color: #005B94;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-align: center;
    min-height: 1.5em;
    text-shadow: 0 1px 2px rgba(255,255,255,0.8);
}

@keyframes logo-spin {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

/* Hide default Blazor loading progress */
.loading-progress { display: none; }
.loading-progress-text { display: none; }
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

/* Override Bootstrap btn-warning color globally */
.btn-warning {
    background-color: rgba(246, 141, 46, 0.9) !important;
    border-color: rgba(246, 141, 46, 0.9) !important;
    color: #fff !important;
}

/* Override Bootstrap btn-primary to match brand color */
.btn-primary {
    background-color: rgba(0, 91, 148, 0.7) !important;
    border-color: rgba(0, 91, 148, 0.7) !important;
    color: #fff !important;
}

/* Override Bootstrap btn-success with a more professional green */
.btn-success {
    background-color: #7DBA84 !important;
    border-color: #7DBA84 !important;
    color: #fff !important;
}

/* Hamburger menu visibility: only show on mobile (<=600px) */
@media (min-width: 601px) {
    .top-row .btn[data-bs-toggle="offcanvas"] {
        display: none !important;
    }
    /* Also ensure offcanvas nav is hidden on desktop */
    #mobileNav {
        display: none !important;
    }
}

/* Center hamburger menu icon on mobile */
@media (max-width: 600px) {
    .top-row .btn[data-bs-toggle="offcanvas"] {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 48px !important;
        height: 48px !important;
        padding: 0 !important;
    }

    .top-row .btn[data-bs-toggle="offcanvas"] i {
        margin: 0 !important;
        line-height: 1 !important;
    }
}

/* Hide elements on mobile */
.hide-on-mobile {
    display: block;
}

/* Mobile Utilities - Consistent 600px breakpoint */
@media (max-width: 600px) {
    .hide-on-mobile {
        display: none !important;
    }
    .show-on-mobile { display: block !important; }
    
    /* Ensure proper mobile spacing for forms and content */
    .container, .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Improve button spacing on mobile */
    .btn {
        margin-bottom: 0.5rem;
    }
    
    /* Better form control sizing */
    .form-control, .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Form header layout (replaces Bootstrap row for this section) */
.form-header {
    display: grid;
    grid-template-columns: 1fr auto auto; /* user card grows, date group auto, button auto */
    align-items: center;
    gap: 0.75rem 1rem;
    width: 100%;
    margin-bottom: 1rem;
}

.form-header .date-group {
    display: grid;
    grid-template-columns: auto 220px; /* label + wider input width */
    align-items: center;
    gap: 0.5rem;
}

.form-header .date-input {
    width: 220px;
}

.form-header .btn-clear {
    justify-self: start; /* keep near date on wide screens */
}

/* Responsive: stack nicely on small screens */
@media (max-width: 600px) {
    .form-header {
        grid-template-columns: 1fr; /* stack */
    }
    .form-header .date-group {
        grid-template-columns: auto 1fr; /* full width input on mobile */
    }
    .form-header .date-input {
        width: 100%;
        min-width: 0;
    }
    .form-header .btn-clear {
        justify-self: start; /* button below, left-aligned */
    }
}

/* Mobile fixed footer for DriverForm actions */
.mobile-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: none; /* default hidden on desktop */
    background: rgba(255,255,255,0.95);
    border-top: 1px solid rgba(0,0,0,0.1);
    padding: 0.5rem 0.75rem;
    z-index: 1050; /* above content and offcanvas */
    box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
}

.mobile-footer .footer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.mobile-footer .left-actions { display: flex; gap: 0.5rem; }
.mobile-footer .right-actions { display: flex; gap: 0.5rem; margin-left: auto; }

@media (max-width: 600px) {
    .mobile-footer { display: flex; align-items: center; flex-wrap: nowrap; }
    .mobile-footer .btn { flex: 0 0 auto; }
    .mobile-footer .footer-actions { white-space: nowrap; }
}

/* Avoid content hiding behind the fixed footer on mobile */
@media (max-width: 600px) {
    main, .content { padding-bottom: var(--global-bottom-menu-height); }
}

/* Mobile Cards: compact layout + floating delete button */
@media (max-width: 600px) {
    .mobile-cards-container { display: grid; gap: 0.75rem; }

    .mobile-card {
        position: relative; /* enable floating controls */
        background: #fff;
        border: 1px solid rgba(0,0,0,0.08);
        border-radius: 0.5rem;
    padding: 0.85rem;
        box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    }

    /* Keep inputs clear of the floating button */
    .mobile-card .card-header { display:grid; grid-template-columns: 1fr 120px; gap: 0.75rem; }

    .mobile-card .card-fields-grid { display:grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 0.5rem; }

    /* Field groups with label above rounded input */
    .mobile-card .form-field { display:flex; flex-direction: column; gap: 0.25rem; }
    .mobile-card .field-label { font-size: 0.85rem; color:#495965; font-weight: 600; }
    .mobile-card .field-input {
        appearance: none;
        -webkit-appearance: none;
        background: #fff;
        border: 1px solid rgba(0,0,0,0.15);
        border-radius: var(--bs-border-radius, 0.375rem);
        padding: 0.55rem 0.75rem;
        font-size: 0.95rem;
        line-height: 1.2;
    }
    .mobile-card .field-input:focus {
        outline: none;
        border-color: rgba(0, 123, 255, 0.5);
        box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
    }

    .mobile-card .delete-card-btn {
        position: absolute;
        top: 0.35rem;
        right: 0.35rem;
        width: 36px;
        height: 36px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: transparent; /* remove circle */
        border: none;            /* remove border */
        border-radius: 0;        /* remove rounding */
        box-shadow: none;        /* remove shadow */
        cursor: pointer;
    }

    .mobile-card .delete-card-btn i {
        font-size: 1.1rem !important;
        color: #F68D2E !important; /* match btn-warning orange */
        line-height: 1;
    }

    /* Alternate card backgrounds for clearer separation (very subtle) */
    .mobile-cards-container > .mobile-card:nth-child(odd) { background: #F1F1F1; }
    .mobile-cards-container > .mobile-card:nth-child(even) { background: #ffffff; }
}

/* Simple spin animation for sync icon */
.spin {
    animation: spin 1s linear infinite;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Pulse animation for updates available indicator */
.pulse {
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* FAB with updates indicator */
.fab-sync.has-updates {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.4), 0 4px 14px rgba(0, 0, 0, 0.25);
}

/* Muted, italic, smaller placeholders for Bootstrap controls */
.form-control::placeholder {
    color: var(--bs-secondary-color, #6c757d);
    font-style: italic;
    opacity: 0.85; /* ensure visible but muted */
    font-size: 0.9em;
}
.form-control::-webkit-input-placeholder { /* Chrome/Edge/Safari */
    color: var(--bs-secondary-color, #6c757d);
    font-style: italic;
    opacity: 0.85;
    font-size: 0.9em;
}
.form-control::-moz-placeholder { /* Firefox */
    color: var(--bs-secondary-color, #6c757d);
    font-style: italic;
    opacity: 0.85;
    font-size: 0.9em;
}
.form-control:-ms-input-placeholder { /* Legacy Edge/IE */
    color: var(--bs-secondary-color, #6c757d);
    font-style: italic;
    opacity: 0.85;
    font-size: 0.9em;
}

/* Make select with an empty (placeholder) option appear muted/italic */
.form-select:has(option[value=""]:checked),
select:has(option[value=""]:checked) {
    color: var(--bs-secondary-color, #6c757d);
    font-style: italic;
    font-size: 0.95em;
}
/* Also style the empty option itself in the dropdown */
.form-select option[value=""],
select option[value=""] {
    color: var(--bs-secondary-color, #6c757d);
    font-style: italic;
}

/* Tighter vertical spacing for form labels (override Bootstrap default 0.5rem) */
.form-label { margin-bottom: 0.3rem !important; }

/* Required field indicator - red asterisk */
.form-label.required::after {
    content: " *";
    color: #dc3545;
    font-weight: bold;
}

/* Tag/Pill styling for multi-value displays */
.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.tag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Location tags - Blue */
.tag-location {
    background-color: #e7f3ff;
    color: #005B94;
}

/* Vehicle tags - Green */
.tag-vehicle {
    background-color: #d4f4dd;
    color: #0d6832;
}

/* SKU tags - Orange */
.tag-sku {
    background-color: #fff3e0;
    color: #e65100;
}

/* User tags - Purple */
.tag-user {
    background-color: #f3e5f5;
    color: #6a1b9a;
}

/* Configuration Tables - FORCE COLUMN SPACING */
.table-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 0.5rem !important;
    flex-wrap: nowrap !important;
    gap: 0.5rem !important;
}

.table-header h3 {
    margin: 0 !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: #333 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.table-header .btn {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.875rem !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.table-header-controls {
    display: flex !important;
    gap: 0.5rem !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
}

.table-search {
    width: 200px !important;
    min-width: 150px !important;
    padding: 0.25rem 0.5rem !important;
    font-size: 0.875rem !important;
}

/* Sortable column headers */
.data-table th.sortable {
    cursor: pointer !important;
    user-select: none !important;
}

.data-table th.sortable:hover {
    background-color: #e9ecef !important;
}

.data-table {
    width: 100% !important;
    border-collapse: collapse !important;
    background: white !important;
    table-layout: auto !important;
}

.table-responsive {
    overflow-x: visible !important;
    margin-top: 0.5rem !important;
}

.data-table th {
    background-color: #f8f9fa !important;
    padding: 0.2rem 1.5rem !important;
    text-align: left !important;
    font-weight: 600 !important;
    border: 1px solid #ddd !important;
    color: #495057 !important;
    font-size: 0.9rem !important;
    line-height: 1.2 !important;
}

/* Center the Actions header text */
.data-table th:last-child {
    text-align: center !important;
    padding: 0.2rem 0.25rem !important;
}

.data-table td {
    padding: 0.2rem 1.5rem !important;
    border: 1px solid #ddd !important;
    font-size: 0.95rem !important;
    line-height: 1.2 !important;
    vertical-align: middle !important;
}

/* Actions column - fixed width */
.data-table th:last-child,
.data-table td.action-buttons {
    width: 75px !important;
    max-width: 75px !important;
    min-width: 75px !important;
    text-align: center !important;
}

/* Action button styling */
.data-table td.action-buttons {
    padding: 0.2rem 0.25rem !important;
    white-space: nowrap !important;
}

.action-buttons .btn {
    display: inline-block !important;
    min-width: 20px !important;
    padding: 0.1rem !important;
    font-size: 1.2rem !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    margin: 0 0.1rem !important;
}

/* Icon-only buttons - no borders */
.action-buttons .btn-primary {
    background-color: transparent !important;
    border: none !important;
    color: #005B94 !important;
}

.action-buttons .btn-primary:hover:not(:disabled) {
    background-color: transparent !important;
    color: #003d6b !important;
}

.action-buttons .btn-danger {
    background-color: transparent !important;
    border: none !important;
    color: #005B94 !important;
}

.action-buttons .btn-danger:hover:not(:disabled) {
    background-color: transparent !important;
    color: #003d6b !important;
}

/* ========================================
   Desktop Header Navigation (>= 768px)
   Styles for nav links embedded in page headers
   ======================================== */
@media (min-width: 768px) {
    /* Remove bottom padding reserved for bottom nav on desktop */
    .layout-main .content {
        padding-bottom: 1rem;
    }

    /* Desktop header nav links - inserted between logo and profile */
    .header-nav {
        display: flex;
        align-items: center;
        gap: 0.25rem;
        flex: 1;
        justify-content: center;
        padding: 0 1rem;
    }

    .header-nav-link {
        display: flex;
        align-items: center;
        gap: 0.35rem;
        padding: 0.4rem 0.75rem;
        color: #64748b;
        font-size: 0.8rem;
        font-weight: 500;
        text-decoration: none;
        border-radius: 6px;
        transition: all 0.15s;
        white-space: nowrap;
    }

    .header-nav-link i {
        font-size: 0.95rem;
    }

    .header-nav-link:hover {
        color: #005B94;
        background: rgba(0, 91, 148, 0.08);
        text-decoration: none;
    }

    .header-nav-link.active {
        color: #005B94;
        background: rgba(0, 91, 148, 0.12);
        font-weight: 600;
    }

    /* Keep header-left from shrinking */
    .persistent-header .header-left,
    .header-container .header-left-group,
    .profile-header .header-left,
    .settings-header .header-left,
    .calendar-view-header .header-left {
        flex-shrink: 0;
    }

    /* Keep header-right from shrinking */
    .persistent-header .header-right,
    .header-container .header-right-group,
    .calendar-view-header .header-right {
        flex-shrink: 0;
    }
}

/* Hide desktop nav on mobile */
@media (max-width: 767px) {
    .header-nav {
        display: none !important;
    }
}