html,
body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a,
.btn-link {
    color: #006bb7;
}

.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;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

input[type="number"].erp-money-input {
    appearance: textfield;
    -moz-appearance: textfield;
}

input[type="number"].erp-money-input::-webkit-outer-spin-button,
input[type="number"].erp-money-input::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

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

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

#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+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC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zLjU3NiA5My41Mjk1IDI2Ni4xMTYgOTMuNTI5NSAyNjcuMzg3IDkyLjI4MzcgMjY3LjM4NyA4OS43OTIxIDI2Ny4zODcgODcuMzAwNSAyNjYuMTE2IDg2LjA1NDcgMjYzLjU3NiA4Ni4wNTQ3WiIgZmlsbD0iI0ZGRTUwMCIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9nPjwvc3ZnPg==) 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;
}

.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;
}

.status-bar-safe-area {
    display: none;
}

@supports (-webkit-touch-callout: none) {
    .status-bar-safe-area {
        display: flex;
        position: sticky;
        top: 0;
        height: env(safe-area-inset-top);
        background-color: #f7f7f7;
        width: 100%;
        z-index: 1;
    }

    .flex-column,
    .navbar-brand {
        padding-left: env(safe-area-inset-left);
    }
}

/* Global: Custom Scrollbar for a premium look instead of hiding it */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

.no-scrollbar::-webkit-scrollbar {
    display: none !important;
}

.no-scrollbar {
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}

:root {
    --ui-brand-50: #eff4ff;
    --ui-brand-100: #dbe8ff;
    --ui-brand-500: #3c50e0;
    --ui-brand-600: #3344c2;
}

html,
body {
    font-family: "Plus Jakarta Sans", "Inter", "Segoe UI", Roboto, Arial, sans-serif;
    background: #f1f5f9;
    color: #334155;
}

.ui-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.ui-label {
    display: block;
    margin-bottom: 0.375rem;
    color: #475569;
    font-size: 11px;
    font-weight: 600;
}

.ui-help {
    font-size: 12px;
    color: #64748b;
}

.ui-field {
    display: grid;
    gap: 0.375rem;
}

.ui-form-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 768px) {
    .ui-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.ui-input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    background: #fff;
    color: #334155;
    font-size: 14px;
    line-height: 1.25rem;
    padding: 0.625rem 0.875rem;
    outline: none;
    transition: border-color 120ms, box-shadow 120ms, background-color 120ms;
}

.ui-input::placeholder {
    color: #94a3b8;
}

.ui-input:hover {
    border-color: #94a3b8;
}

.ui-input:focus {
    border-color: var(--ui-brand-500);
    box-shadow: 0 0 0 4px rgba(60, 80, 224, 0.12);
}

.ui-input-error {
    border-color: #fb7185 !important;
    box-shadow: 0 0 0 4px rgba(251, 113, 133, 0.12) !important;
}

.ui-textarea {
    min-height: 6rem;
    resize: vertical;
}

.ui-checkbox,
.ui-radio {
    width: 1rem;
    height: 1rem;
    accent-color: var(--ui-brand-500);
}

.ui-btn-primary,
.ui-btn-secondary,
.ui-btn-danger,
.ui-btn-warning,
.ui-btn-ghost {
    border: 0;
    cursor: pointer;
}

.ui-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--ui-brand-500);
    color: #fff;
    border-radius: 0.75rem;
    font-size: 14px;
    font-weight: 600;
    padding: 0.625rem 1rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1);
    transition: background-color 120ms, transform 120ms, box-shadow 120ms;
}

.ui-btn-primary:hover {
    background: var(--ui-brand-600);
}

.ui-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #fff;
    color: #334155;
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    font-size: 14px;
    font-weight: 600;
    padding: 0.625rem 1rem;
    transition: background-color 120ms, transform 120ms;
}

.ui-btn-secondary:hover {
    background: #f8fafc;
}

.ui-btn-danger,
.ui-btn-warning {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    border-radius: 0.5rem;
    font-size: 12px;
    font-weight: 600;
    padding: 0.375rem 0.625rem;
}

.ui-btn-danger {
    color: #be123c;
    background: #fff1f2;
}

.ui-btn-warning {
    color: #b45309;
    background: #fffbeb;
}

.ui-btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #fff;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    font-size: 14px;
    font-weight: 600;
    padding: 0.625rem 1rem;
}

.ui-btn-ghost:hover {
    background: #f8fafc;
    color: #0f172a;
}

.ui-btn-primary:disabled,
.ui-btn-secondary:disabled,
.ui-btn-ghost:disabled {
    cursor: not-allowed;
    opacity: .6;
}

.ui-toggle {
    position: relative;
    display: inline-flex;
    height: 1.5rem;
    width: 2.75rem;
    align-items: center;
    border-radius: 999px;
    transition: background-color 120ms;
}

.ui-toggle-on {
    background: #10b981;
}

.ui-toggle-off {
    background: #cbd5e1;
}

.ui-toggle-thumb {
    display: inline-block;
    height: 1rem;
    width: 1rem;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
    transition: transform 120ms;
}

.ui-toggle-thumb-on {
    transform: translateX(1.5rem);
}

.ui-toggle-thumb-off {
    transform: translateX(0.25rem);
}

.ui-table-wrap {
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    overflow: hidden;
    background: #fff;
}

.ui-table-head {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ui-dropdown {
    position: absolute;
    z-index: 50;
    margin-top: 0.5rem;
    width: 100%;
    max-height: 16rem;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    background: #fff;
    padding: 0.375rem;
    box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.12), 0 4px 6px -4px rgba(15, 23, 42, 0.12);
}

.ui-dropdown-fixed {
    position: fixed;
    margin-top: 0;
}

/* App-like density for small screens */
@media (max-width: 640px) {
    .app-content main {
        padding: 0.75rem !important;
    }

    .app-content main > div {
        max-width: 100% !important;
        width: 100% !important;
    }

    .app-content .mx-auto.max-w-7xl,
    .app-content .mx-auto.max-w-6xl,
    .app-content .mx-auto.max-w-5xl,
    .app-content .mx-auto.max-w-4xl,
    .app-content .mx-auto.max-w-3xl,
    .app-content .mx-auto.max-w-2xl {
        max-width: 100% !important;
    }

    .app-content .px-4 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    .app-content .pt-6 {
        padding-top: 1rem !important;
    }

    .app-content .pb-20 {
        padding-bottom: 2.5rem !important;
    }

    .app-content .space-y-6 > :not([hidden]) ~ :not([hidden]) {
        margin-top: 1rem !important;
    }
}

.ui-option {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    border: 0;
    background: transparent;
    border-radius: 0.5rem;
    color: #334155;
    font-size: 14px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: background-color 120ms, color 120ms;
}

.ui-option:hover {
    background: #f8fafc;
}

.ui-option-active {
    background: var(--ui-brand-50);
    color: var(--ui-brand-600);
}

.ui-dropdown-compact {
    max-height: 10rem !important;
}

.ui-option-compact {
    padding: 0.25rem 0.5rem !important;
    font-size: 12px !important;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
select,
textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    background: #fff;
    color: #334155;
    font-size: 14px;
    line-height: 1.25rem;
    padding: 0.625rem 0.875rem;
    outline: none;
    transition: border-color 120ms, box-shadow 120ms, background-color 120ms;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):focus,
select:focus,
textarea:focus {
    border-color: var(--ui-brand-500);
    box-shadow: 0 0 0 4px rgba(60, 80, 224, 0.12);
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m19.5 8.25-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

/* Item List Page */
.items-page {
    max-width: 1120px;
    margin: 0 auto;
    padding: 28px 18px 72px;
    display: grid;
    gap: 16px;
}

.items-hero {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    border-radius: 16px;
    padding: 24px 26px;
    border: 1px solid #1e293b;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.24);
}

.items-hero-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.items-title {
    margin: 0;
    color: #f8fafc;
    font-size: 40px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.items-subtitle {
    margin: 8px 0 0;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 500;
}

.items-primary-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 12px;
    border: 0;
    background: linear-gradient(135deg, #3c50e0, #5668e8);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(60, 80, 224, 0.28);
    cursor: pointer;
}

.items-primary-btn:hover {
    filter: brightness(1.03);
}

.items-filters-card,
.items-table-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.items-filters-card {
    padding: 16px;
}

.items-filter-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.items-field {
    display: grid;
    gap: 6px;
}

.items-label {
    margin: 0;
    font-size: 11px;
    color: #475569;
    font-weight: 700;
}

.items-input-wrap {
    position: relative;
}

.items-input-icon {
    position: absolute;
    left: 10px;
    top: 10px;
    color: #94a3b8;
    font-size: 18px;
    pointer-events: none;
}

.items-input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    color: #1e293b;
    font-size: 14px;
    line-height: 1.2;
    padding: 10px 12px;
    outline: none;
    transition: border-color 120ms, box-shadow 120ms;
}

.items-input-with-icon {
    padding-left: 36px;
}

.items-input:focus {
    border-color: #3c50e0;
    box-shadow: 0 0 0 4px rgba(60, 80, 224, 0.12);
}

.items-table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 14px;
    background: #f8fafc;
}

.items-table-title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #334155;
}

.items-count-pill {
    border-radius: 999px;
    background: #e0e7ff;
    color: #3730a3;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 700;
}

.items-table {
    width: 100%;
    min-width: 920px;
    border-collapse: collapse;
}

.items-table thead th {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 700;
}

.items-table-row {
    transition: background-color 120ms;
}

.items-table-row:hover {
    background: #f8fafc;
}

.items-action-btn {
    display: inline-flex;
    align-items: center;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #334155;
    border-radius: 10px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.items-action-btn:hover {
    border-color: #3c50e0;
    color: #3c50e0;
}

.items-empty-cell {
    padding: 56px 16px;
    text-align: center;
}

.items-empty-state {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
}

.items-empty-icon {
    font-size: 42px;
    color: #cbd5e1;
}

@media (min-width: 900px) {
    .items-filter-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .items-hero-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .items-title {
        font-size: 30px;
    }
}
/* Hide built-in password reveal icons (use custom toggle instead) */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
  display: none;
}

input[type="password"]::-webkit-credentials-auto-fill-button,
input[type="password"]::-webkit-contacts-auto-fill-button {
  visibility: hidden;
  display: none !important;
  pointer-events: none;
}

/* Google Maps Reusable Marker Component */
.map-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    /* Precise anchoring: Center the icon (not the entire div) on the coordinate.
       The dot center is at ~7px from the top of the container. 
       We use transform to shift the container so (50%, 7px) is at (0,0). */
    transform: translate(-50%, -7px); 
    cursor: pointer;
    transition: z-index 0.2s;
}

.map-marker:hover {
    z-index: 9999 !important;
}

.marker-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2;
}

.marker-label {
    margin-top: 4px; /* Exact spacing requirement */
    background: white;
    color: #1e293b;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 900;
    white-space: nowrap;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1.5px solid currentColor;
    text-transform: uppercase;
    pointer-events: none;
    z-index: 1;
    line-height: 1;
}

/* Specific Marker Types */
.live-marker .marker-icon {
    width: 14px;
    height: 14px;
    background: #10b981; /* Live green */
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.live-marker.inactive .marker-icon {
    background: #f43f5e; /* Inactive red */
    box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.2);
}

.live-marker .marker-label {
    color: #10b981;
    border-color: #10b981;
}

.live-marker.inactive .marker-label {
    color: #f43f5e;
    border-color: #f43f5e;
}

.building-marker {
    /* For buildings, the icon is larger (22px), so adjust vertical anchor to ~11px */
    transform: translate(-50%, -11px);
}

.building-marker .marker-icon {
    font-size: 22px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.building-marker .marker-label {
    color: #3b82f6;
    border-color: #3b82f6;
    margin-top: 2px;
}

.building-marker.branch-main .marker-label {
    color: #4f46e5;
    border-color: #4f46e5;
}

.map-marker:hover .marker-icon {
    transform: scale(1.2);
}

.map-marker:hover .marker-label {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

