/* WasteWhere Company Portal — product-specific overrides */

:root {
    --cds-font-family-base: Barlow, Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
    --ww-green: #3e9555;
    --ww-wordmark-gray: #56685f;
}

html,
body {
    height: 100%;
    margin: 0;
}

/* Public auth shell: fill the viewport edge-to-edge and keep the language label readable. */
.core-portal-auth-root {
    min-height: 100%;
}

.core-portal-auth-root .portal-public-shell {
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
}

.core-portal-auth-root .portal-public-brand-field {
    align-self: stretch;
    height: auto;
    min-height: 100%;
    width: 100%;
}

.core-portal-auth-root .portal-auth-masthead {
    flex-wrap: wrap;
    row-gap: 12px;
}

.core-portal-auth-root .portal-auth-language-form {
    flex: 0 0 auto;
}

.core-portal-auth-root .portal-auth-language-select {
    max-width: none;
    min-width: 13.5rem;
    width: max-content;
}

/* Match Transform / design-system eyebrow + page-title treatment on public auth. */
.core-portal-auth-root .eyebrow,
.core-portal-auth-root .portal-eyebrow {
    color: var(--portal-accent, var(--portal-primary));
    font-size: var(--portal-type-overline-size, 0.6875rem);
    font-weight: var(--portal-type-weight-semibold, 600);
    letter-spacing: 0.05em;
    line-height: var(--portal-type-overline-line-height, 1rem);
    text-transform: uppercase;
}

.core-portal-auth-root .login-shell h1 {
    font-size: var(--portal-type-h1-size, 1.75rem);
    font-weight: var(--portal-type-weight-semibold, 600);
    line-height: var(--portal-type-h1-line-height, 1.25);
    margin: 2px 0 4px;
}

.core-portal-auth-root .checkbox-row input[type="checkbox"] {
    accent-color: var(--portal-accent, var(--portal-primary));
    height: 1rem;
    width: 1rem;
}

.wastewhere-portal-root .portal-brand-wordmark {
    color: var(--ww-wordmark-gray);
}

.wastewhere-portal-root .portal-brand-wordmark strong {
    color: var(--ww-green);
}

html[data-theme="dark"].wastewhere-portal-root .portal-brand-wordmark {
    color: #a1b4aa;
}

html[data-theme="dark"].wastewhere-portal-root .portal-brand-wordmark strong {
    color: #7ecb8e;
}

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

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

.wastewhere-grid {
    display: grid;
    gap: 0.75rem;
}

.wastewhere-grid__toolbar {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
}

.wastewhere-grid__toolbar-summary {
    display: grid;
    gap: 0.1rem;
}

.wastewhere-grid__toolbar-summary span {
    color: var(--core-color-text-muted, #60707a);
    font-size: 0.85rem;
}

.wastewhere-grid__toolbar-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.wastewhere-grid__search {
    min-width: min(16rem, 100%);
}

.wastewhere-grid__alert {
    background: #fff3e8;
    border: 1px solid #f0c29c;
    border-radius: 6px;
    color: #8a3b12;
    padding: 0.75rem 0.875rem;
}

.wastewhere-grid__loading {
    display: grid;
    gap: 0.5rem;
}

.wastewhere-grid__loading-bar {
    animation: wastewhere-grid-pulse 1.2s ease-in-out infinite;
    background: linear-gradient(90deg, color-mix(in srgb, var(--portal-border) 55%, var(--portal-canvas)), var(--portal-border), color-mix(in srgb, var(--portal-border) 55%, var(--portal-canvas)));
    border-radius: 6px;
    display: block;
    height: 2.5rem;
}

.wastewhere-grid__empty {
    color: var(--core-color-text-muted, #60707a);
    padding: 1rem;
    text-align: center;
}

.wastewhere-grid__row-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.wastewhere-kpi-row {
    display: grid;
    gap: 0.625rem;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}

.wastewhere-kpi {
    background: var(--portal-card-soft);
    border: 1px solid var(--portal-border);
    border-radius: 6px;
    padding: 0.75rem;
}

.wastewhere-kpi strong {
    display: block;
    font-size: 1.75rem;
    line-height: 1.1;
}

.wastewhere-kpi span {
    color: var(--portal-muted);
    display: block;
    font-size: 0.85rem;
}

.wastewhere-definition-list {
    display: grid;
    gap: 0.35rem 0.85rem;
    grid-template-columns: max-content 1fr;
    margin: 0;
}

.wastewhere-definition-list dt {
    color: var(--core-color-text-muted, #60707a);
    font-weight: 700;
}

.wastewhere-definition-list dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.wastewhere-chart {
    display: grid;
    gap: 0.625rem;
}

.wastewhere-chart__row {
    display: grid;
    gap: 0.35rem;
}

.wastewhere-chart__label {
    align-items: center;
    display: flex;
    font-size: 0.9rem;
    justify-content: space-between;
}

.wastewhere-chart__track {
    background: color-mix(in srgb, var(--portal-border) 70%, var(--portal-canvas));
    border-radius: 999px;
    height: 0.65rem;
    overflow: hidden;
}

.wastewhere-chart__bar {
    background: var(--core-brand-primary, var(--brand-primary));
    border-radius: inherit;
    display: block;
    height: 100%;
    min-width: 0.25rem;
}

.ww-sample-badge {
    background: var(--portal-warning-surface, #fff9e9);
    border: 1px solid var(--portal-warning, #d5b35f);
    border-radius: 4px;
    color: var(--portal-warning-strong, #5f4600);
    display: inline-block;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1;
    margin-left: 0.35rem;
    padding: 0.15rem 0.35rem;
    vertical-align: middle;
}

.ww-dashboard-sample-banner {
    background: var(--portal-warning-surface, #fff9e9);
    border: 1px solid var(--portal-warning, #d5b35f);
    border-radius: 6px;
    color: var(--portal-warning-strong, #5f4600);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    padding: 0.65rem 0.85rem;
}

.ww-dashboard-exception-list {
    display: grid;
    gap: 0.45rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ww-dashboard-exception-list a {
    color: var(--core-brand-primary, var(--brand-primary));
    font-weight: 600;
    text-decoration: none;
}

.ww-dashboard-exception-list a:hover {
    text-decoration: underline;
}

@keyframes wastewhere-grid-pulse {
    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

@media (max-width: 720px) {
    .wastewhere-grid__toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .wastewhere-grid__toolbar-actions {
        justify-content: flex-start;
    }

    .d-flex.flex-wrap.gap-2.align-items-end {
        align-items: stretch !important;
        flex-direction: column;
    }

    .d-flex.flex-wrap.gap-2.align-items-end > label {
        width: 100%;
    }
}

/* Lean Bootstrap-class bridge until Company migrates to Core form primitives. */
.d-flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.align-items-end { align-items: flex-end; }
.align-items-center { align-items: center; }
.gap-2 { gap: 0.5rem; }
.mb-0 { margin-bottom: 0; }
.text-muted { color: var(--portal-muted); }
.text-danger { color: var(--portal-danger, #b42318); }
.visually-hidden {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

label:has(> .form-control),
label:has(> .form-select) {
    display: grid;
    gap: 0.3rem;
    font-size: 0.8125rem;
    font-weight: 600;
}

.form-control,
.form-select {
    background: var(--portal-canvas);
    border: 1px solid var(--portal-border);
    border-radius: 0.35rem;
    color: var(--portal-ink);
    font: inherit;
    min-height: 2.35rem;
    padding: 0.4rem 0.65rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--portal-primary);
    outline: 2px solid color-mix(in srgb, var(--portal-primary) 35%, transparent);
    outline-offset: 1px;
}

.form-select-sm {
    min-height: 2rem;
    padding: 0.25rem 0.5rem;
}

.btn {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 0.35rem;
    cursor: pointer;
    display: inline-flex;
    font: 600 0.875rem/1.2 Barlow, Inter, sans-serif;
    gap: 0.35rem;
    justify-content: center;
    min-height: 2.35rem;
    padding: 0.4rem 0.85rem;
    text-decoration: none;
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.btn:focus-visible {
    outline: 2px solid var(--portal-primary);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--portal-primary);
    border-color: var(--portal-primary);
    color: var(--portal-on-primary, #fff);
}

.btn-primary:hover:not(:disabled) {
    background: var(--portal-primary-strong, var(--portal-primary));
}

.btn-outline-primary,
.btn-outline-secondary {
    background: transparent;
    border-color: var(--portal-border);
    color: var(--portal-ink);
}

.btn-outline-primary:hover:not(:disabled),
.btn-outline-secondary:hover:not(:disabled) {
    border-color: var(--portal-primary);
    color: var(--portal-primary-strong, var(--portal-primary));
}

.btn-sm {
    font-size: 0.8125rem;
    min-height: 2rem;
    padding: 0.25rem 0.65rem;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--portal-muted);
    content: "/";
    margin-right: 0.75rem;
}

.breadcrumb-item.active {
    color: var(--portal-muted);
}

.field-access-form {
    display: grid;
    gap: 0.9rem 1rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}

.field-access-form label {
    color: var(--portal-muted);
    display: grid;
    font-size: 0.8125rem;
    font-weight: 600;
    gap: 0.35rem;
}

.btn-outline-danger {
    background: transparent;
    border-color: color-mix(in srgb, #b42318 48%, var(--portal-border));
    color: #b42318;
}

.btn-outline-danger:hover:not(:disabled) {
    background: color-mix(in srgb, #b42318 8%, transparent);
    border-color: #b42318;
}
