/* --- Bray & Co brand tokens --- */
:root {
    --brand-primary: #f48847;
    --brand-primary-hover: #d37035;
    --brand-heading: #1e1e1e;
    --brand-body: #282d30;
    --brand-background: #ffffff;
    --brand-footer-bg: #282d30;
    --brand-footer-text: #ffffff;
    --brand-border: #f0f0f0;
}

/* --- Global typography & colors --- */
html, body {
    font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--brand-body);
    background: var(--brand-background);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--brand-heading);
    font-weight: 700;
}

/* Links */
a, .btn-link {
    color: var(--brand-primary);
}

a:hover, .btn-link:hover {
    color: var(--brand-primary-hover);
}

/* Buttons */
.btn-primary {
    color: #fff;
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    color: #fff;
    background-color: var(--brand-primary-hover);
    border-color: var(--brand-primary-hover);
}

.btn-outline-primary {
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
    color: #fff;
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
}

/* Focus states (override default Bootstrap blue) */
.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 var(--brand-primary);
}

/* Content spacing */
.content {
    padding-top: 1.1rem;
}

section {
    padding: 2rem 0;
}

/* Banners */
.aeo-banner {
    background: var(--brand-primary);
    color: #fff;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-weight: 600;
}

/* Tables & dividers */
hr, .aeo-divider {
    border-top: 1px solid var(--brand-border, #f0f0f0);
}

table thead th {
    border-bottom: 2px solid var(--brand-border, #f0f0f0);
}

table tbody tr + tr td {
    border-top: 1px solid var(--brand-border, #f0f0f0);
}

/* Validation */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

/* Error boundary */
.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* Footer */
.aeo-footer {
    background: var(--brand-footer-bg);
    color: var(--brand-footer-text);
}

.aeo-footer a {
    color: var(--brand-primary);
}

/* Progress bar (navigation) */
.aeo-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-primary) 0%, var(--brand-primary-hover) 50%, var(--brand-primary) 100%);
    animation: aeo-progress-sweep 1.2s linear infinite;
    z-index: 9999;
}

@keyframes aeo-progress-sweep {
    0% { background-position: -200vw 0; }
    100% { background-position: 200vw 0; }
}

@media (prefers-reduced-motion: reduce) {
    .aeo-progress { animation: none !important; }
}

/* --- AEO dashboard utility classes --- */
.aeo-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: flex-start;
}
.aeo-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}
.aeo-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
}
@media (max-width: 900px) {
    .aeo-grid, .aeo-grid-2, .aeo-grid-3 {
        flex-direction: column !important;
        grid-template-columns: 1fr !important;
        gap: 1.25rem;
    }
}
.aeo-card {
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    margin-bottom: 0.5rem;
}
.aeo-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #0A1045;
}
.text-muted {
    color: #3a3f5c !important;
}
.aeo-card-subtle {
    font-size: 1.05em;
    margin-bottom: 0.5rem;
}
.aeo-kpi {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}
.aeo-badge {
    display: inline-block;
    background: #e0e7ff;
    color: #3730a3;
    border-radius: 0.75em;
    padding: 0.2em 0.7em;
    font-size: 0.95em;
    font-weight: 500;
    margin-right: 0.5em;
    margin-bottom: 0.2em;
}
.aeo-badge--ok {
    background: #d1fae5;
    color: #065f46;
    border: 1.5px solid #10b981;
    outline: 2px solid #065f46;
}
.aeo-badge--warn {
    background: #fef3c7;
    color: #92400e;
    border: 1.5px solid #f59e42;
    outline: 2px solid #92400e;
}
.aeo-badge--bad {
    background: #fee2e2;
    color: #991b1b;
    border: 1.5px solid #ef4444;
    outline: 2px solid #991b1b;
}
.aeo-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: #e0e7ff;
    color: #3730a3;
    font-size: 1.3rem;
    font-weight: 700;
    margin-right: 1rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border: 1px solid var(--aeo-border, #e5e7eb);
}
.aeo-muted {
    font-size: 0.98em;
}
.aeo-placeholder {
    background: #f8fafc;
    color: #64748b;
    border-radius: 0.5em;
    padding: 0.75em 1em;
    font-size: 1em;
    margin-bottom: 0.5em;
}
.aeo-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.aeo-divider {
    border-top: 1px solid var(--aeo-border, #e5e7eb);
    margin: 1.5rem 0;
}
.aeo-breadcrumb {
    font-size: 1.05em;
    margin-bottom: 0.5rem;
}
.aeo-print-break {
    break-before: page;
    break-after: page;
}
.aeo-side-nav-section {
    font-size: 0.75rem; /* smaller than links */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    padding: 0.75rem 1rem 0.25rem 1rem;
    color: #0A1045;
    font-size: 14px;
    font-family: Helvetica;
    font-weight: 700;
    word-wrap: break-word
}

/* ── Inline section help ─────────────────────────────────── */
.client-card-info__inline-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    padding: 0;
    margin-left: 0.45rem;
    vertical-align: middle;
    border-radius: 999px;
    border: 1px solid rgba(10, 16, 69, 0.24);
    background: rgba(10, 16, 69, 0.05);
    color: #0A1045;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    top: -1px;
}

.client-card-info__inline-btn:hover,
.client-card-info__inline-btn:focus-visible,
.client-card-info__inline-btn[aria-expanded="true"] {
    background: #0A1045;
    color: #fff;
    border-color: #0A1045;
    box-shadow: 0 0 0 3px rgba(10, 16, 69, 0.12);
    outline: none;
}

.client-card-info__inline-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 0.8rem;
    line-height: 1;
    font-weight: 700;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.client-card-info__panel {
    margin-top: 0.6rem;
    margin-bottom: 0.85rem;
    padding: 0.8rem 0.95rem;
    border: 1px solid rgba(10, 16, 69, 0.12);
    border-left: 4px solid #0A1045;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(10, 16, 69, 0.05) 0%, rgba(10, 16, 69, 0.025) 100%);
    color: #2f3452;
}

.client-card-info__panel-title {
    margin-bottom: 0.35rem;
    color: #0A1045;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.client-card-info__panel-body {
    font-size: 0.9rem;
    line-height: 1.45;
}

@media print {
    .sidebar, .top-row, .nav-scrollable, .aeo-actions, .aeo-breadcrumb, #blazor-error-ui {
        display: none !important;
    }
    main, .content, .aeo-grid, .aeo-card, .aeo-card-title, .aeo-card-subtle, .aeo-kpi, .aeo-badge, .aeo-placeholder, .aeo-muted {
        color: #222 !important;
        box-shadow: none !important;
        border: 1px solid #bbb !important;
        outline: none !important;
    }
    .aeo-card {
        page-break-inside: avoid;
        margin-bottom: 1.5rem !important;
    }
    .aeo-print-break {
        break-before: page;
        break-after: page;
        page-break-before: always;
        page-break-after: always;
    }
    .aeo-badge--ok, .aeo-badge--warn, .aeo-badge--bad {
        outline: 2px solid #222 !important;
        border: 1.5px solid #222 !important;
        color: #222 !important;
        background: #fff !important;
    }
    body {
        background: #fff !important;
    }
}
