/* LactisOne brand overrides on Metronic v9.4.7 (Tailwind) */
/* Primary brand = Spruce (design system v1.0). Canonical palette
   and the full token system live in css/lactis-enterprise.css and
   css/lactisone-theme.css. Values here kept in sync for clarity. */

:root {
    --primary: #136150;        /* Spruce 600 */
    --primary-foreground: #ffffff;
    --color-green-500: #2E9E5B;
    --color-green-600: #1E6B3D;
}

.dark {
    --primary: #3FA890;        /* Spruce, lightened for dark */
    --primary-foreground: #06231D;
}

.lactis-brand-mark {
    height: 42px;
    width: auto;
}

.lactis-brand-mark--compact {
    height: 30px;
    width: auto;
}

.lactis-login-branded-bg {
    background-image: url('../metronic-v9/media/images/2600x1600/1.png');
    background-size: cover;
    background-position: center;
}

.dark .lactis-login-branded-bg {
    background-image: url('../metronic-v9/media/images/2600x1600/1-dark.png');
}

.lactis-nav-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

#blazor-error-ui {
    background: #fff3cd;
    color: #181C32;
    bottom: 0;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.15);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ---------- Collection map (Leaflet) ---------- */
.lactis-map-container {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--lactis-line, #DCE3E1);
    background: var(--lactis-surface, #fff);
    /* Leaflet panes must stay below dropdowns/modals */
    position: relative;
    z-index: 0;
}

.lactis-map-popup {
    font-size: 12px;
    line-height: 1.45;
    min-width: 200px;
}

.lactis-map-popup-title {
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 6px;
}

.lactis-map-popup-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.lactis-map-popup-row span {
    color: #64748B;
}

.lactis-map-popup-flag {
    margin-top: 6px;
    color: #DC2626;
    font-weight: 600;
}

.lactis-map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 11.5px;
    color: var(--lactis-muted, #5C6B67);
    margin-top: 10px;
}

.lactis-map-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.lactis-map-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
    flex: none;
}

/* Keep the (light) map tiles readable in dark mode without inverting them. */
.dark .lactis-map-container .leaflet-tile-pane {
    filter: brightness(0.92) contrast(1.02);
}

.dark .lactis-map-container .leaflet-control-attribution,
.dark .lactis-map-container .leaflet-popup-content-wrapper,
.dark .lactis-map-container .leaflet-popup-tip {
    background: #fff;
    color: #161D1B;
}

/* ---------- Branded Blazor reconnect toast ----------
   blazor.web.js toggles components-reconnect-show / -hide /
   -failed / -rejected classes on #components-reconnect-modal.
   Visibility is fully CSS-driven, so the default modal never renders. */
#components-reconnect-modal.lactis-reconnect-toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9999;
    max-width: 360px;
    background: var(--lactis-surface, #fff);
    border: 1px solid var(--lactis-line, #DCE3E1);
    border-left: 4px solid var(--lactis-quality-gold, #B5842A);
    border-radius: 12px;
    box-shadow: var(--lactis-shadow-card, 0 4px 16px rgba(0, 0, 0, 0.12));
    padding: 14px 16px;
    color: var(--lactis-ink, #161D1B);
    display: none;
    font-size: 13px;
}

#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: block;
}

#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    border-left-color: #C0392B;
}

#components-reconnect-modal .lactis-reconnect-state {
    display: none;
    align-items: center;
    gap: 12px;
}

#components-reconnect-modal.components-reconnect-show .lactis-reconnect-state--reconnecting {
    display: flex;
}

#components-reconnect-modal.components-reconnect-failed .lactis-reconnect-state--failed,
#components-reconnect-modal.components-reconnect-rejected .lactis-reconnect-state--failed {
    display: flex;
}

#components-reconnect-modal .lactis-reconnect-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

#components-reconnect-modal .lactis-reconnect-title {
    font-weight: 700;
    line-height: 1.3;
}

#components-reconnect-modal .lactis-reconnect-text {
    color: var(--lactis-muted, #5C6B67);
    line-height: 1.35;
}

#components-reconnect-modal .lactis-reconnect-spinner {
    width: 18px;
    height: 18px;
    flex: none;
    border-radius: 50%;
    border: 2px solid var(--lactis-line, #DCE3E1);
    border-top-color: var(--lactis-quality-gold, #B5842A);
    animation: lactis-reconnect-spin 0.8s linear infinite;
}

@keyframes lactis-reconnect-spin {
    to {
        transform: rotate(360deg);
    }
}

#components-reconnect-modal .lactis-reconnect-reload {
    flex: none;
    border: 1px solid var(--lactis-line, #DCE3E1);
    background: transparent;
    color: var(--lactis-ink, #161D1B);
    font-weight: 600;
    font-size: 12px;
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
}

#components-reconnect-modal .lactis-reconnect-reload:hover {
    background: rgba(0, 0, 0, 0.05);
}
