/* ==========================================================================
   HouseOps — global tokens and base styles.

   Component-specific rules live in the matching *.razor.css files — the
   layout, and one per page. Bootstrap supplies the grid, reset and utility
   classes; everything below is HouseOps chrome.
   ========================================================================== */

:root {
    /* Steel-blue navigation */
    --ho-steel-900: #26414f;
    --ho-steel-800: #2f5169;
    --ho-steel-700: #3b6382;
    --ho-steel-600: #4a7899;
    --ho-steel-500: #5d8dad;
    --ho-on-steel: #eef4f8;
    --ho-on-steel-muted: #d3e1ea;

    /* Light workspace */
    --ho-canvas: #f4f6f9;
    --ho-surface: #ffffff;
    --ho-surface-alt: #fafbfc;
    --ho-border: #dce2e9;
    --ho-border-strong: #c6d0da;

    /* Text. -muted is the default secondary tone; -strong-muted is for small labels and
       values that read as too faint at muted weight; -subtle is decorative only and must
       not be used for text that has to be read. */
    --ho-text: #1f2a33;
    --ho-text-strong-muted: #465563;
    --ho-text-muted: #55646f;
    --ho-text-subtle: #6f7e8b;

    /* Accents */
    --ho-blue: #1c6fd4;
    --ho-blue-dark: #14559f;
    --ho-blue-soft: #e8f1fc;
    --ho-amber: #c47a0c;
    --ho-amber-bright: #e8a020;
    --ho-amber-soft: #fdf4e3;
    --ho-amber-border: #eddcb8;

    /* Semantic status. Amber is only ever a warning; green is only ever healthy.
       The -text variants are darkened to clear 4.5:1 against white for small text. */
    --ho-amber-text: #8a5a08;
    --ho-green: #1f9d57;
    --ho-green-text: #14804a;
    --ho-green-soft: #e7f4ec;
    --ho-green-border: #bfe0cd;

    /* Red is reserved for genuinely overdue bills and for errors. Nothing else. */
    --ho-red: #c0392b;
    --ho-red-text: #a32b1f;
    --ho-red-soft: #fdeceb;
    --ho-red-border: #f2c9c4;

    /* Metrics */
    --ho-sidebar-width: 15.5rem;
    --ho-topbar-height: 3.25rem;
    --ho-radius: 0.5rem;
    --ho-radius-sm: 0.375rem;
    --ho-shadow-sm: 0 1px 2px rgba(31, 42, 51, 0.06);
    --ho-shadow-panel: 0 1px 3px rgba(31, 42, 51, 0.08);
}

html {
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    background-color: var(--ho-canvas);
    color: var(--ho-text);
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    font-size: 0.9375rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

/* Deliberately restrained heading scale — this is a dense operations tool,
   not a marketing page. */
h1 {
    font-size: 1.375rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
}

h2 {
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.35;
    margin: 0;
}

h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0;
}

h1:focus,
h1:focus-visible {
    outline: none;
}

a {
    color: var(--ho-blue);
    text-decoration: none;
}

a:hover,
a:focus-visible {
    color: var(--ho-blue-dark);
    text-decoration: underline;
}

:focus-visible {
    outline: 2px solid var(--ho-blue);
    outline-offset: 2px;
}

/* Base treatment for every NavIcon glyph, wherever it is used. Consumers override size,
   colour and opacity from their own stylesheet. */
.ho-icon {
    fill: none;
    flex: 0 0 auto;
    height: 1.125rem;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.6;
    width: 1.125rem;
}

code {
    background-color: var(--ho-surface-alt);
    border: 1px solid var(--ho-border);
    border-radius: 0.25rem;
    color: var(--ho-text);
    font-size: 0.85em;
    padding: 0.1rem 0.3rem;
}

/* --------------------------------------------------------------------------
   Bootstrap overrides — keep buttons and form controls on the HouseOps palette
   so interactive controls added later inherit the right look.
   -------------------------------------------------------------------------- */

.btn-primary {
    --bs-btn-bg: var(--ho-blue);
    --bs-btn-border-color: var(--ho-blue);
    --bs-btn-hover-bg: var(--ho-blue-dark);
    --bs-btn-hover-border-color: var(--ho-blue-dark);
    --bs-btn-active-bg: var(--ho-blue-dark);
    --bs-btn-active-border-color: var(--ho-blue-dark);
}

.btn-warning {
    --bs-btn-bg: var(--ho-amber-bright);
    --bs-btn-border-color: var(--ho-amber-bright);
    --bs-btn-color: #2b1f08;
    --bs-btn-hover-bg: var(--ho-amber);
    --bs-btn-hover-border-color: var(--ho-amber);
    --bs-btn-hover-color: #ffffff;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: var(--ho-blue);
    box-shadow: 0 0 0 0.2rem rgba(28, 111, 212, 0.18);
}

.form-check-input:checked {
    background-color: var(--ho-blue);
    border-color: var(--ho-blue);
}

/* --------------------------------------------------------------------------
   Validation and error surfaces (Blazor defaults, restyled)
   -------------------------------------------------------------------------- */

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #2f9e5b;
}

.invalid {
    outline: 1px solid #c0392b;
}

.validation-message {
    color: #c0392b;
}

.blazor-error-boundary {
    background: #8f2b21;
    border-radius: var(--ho-radius-sm);
    color: #ffffff;
    padding: 0.75rem 1rem;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

#blazor-error-ui {
    background: var(--ho-amber-soft);
    border-top: 2px solid var(--ho-amber);
    bottom: 0;
    box-shadow: 0 -1px 4px rgba(31, 42, 51, 0.18);
    color: var(--ho-text);
    display: none;
    left: 0;
    padding: 0.75rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1080;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}
