/* Global app styling. The console shell, pages and components are styled by MudBlazor
   (see AppTheme). The only hand-styled surface left is the account pages (login /
   access denied), which are plain SSR HTML so the auth cookie can be set on POST. */

:root {
    --brand-primary: #0054b3;
    --brand-foreground: #0a0a0a;
    --brand-muted-fg: #4b4b60;
    --brand-border: #ebebef;
    --brand-bg-gradient: #9ebbea;   /* light periwinkle top of the brand hero gradient */
    --brand-bg: #fafafa;
    --brand-destructive: #bb2d1b;
    --brand-success: #137333;
}

html, body {
    margin: 0;
    font-family: "Inter", "Helvetica", Arial, sans-serif;
}

/* Brand logo (login + home). Preserve aspect ratio (512x94). */
.account-logo {
    display: block;
    height: 44px;
    width: auto;
    margin: 0 0 1.25rem;
}

.appbar-logo {
    height: 30px;
    width: auto;
}

/* ---- Account pages (login / access denied) ---- */

.account-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Soft brand gradient like the reference hero. */
    background: linear-gradient(180deg, var(--brand-bg-gradient) 0%, var(--brand-bg) 55%);
}

.account-card {
    width: 360px;
    max-width: 90vw;
    padding: 1.75rem 1.9rem;
    background: #fff;
    border: 1px solid var(--brand-border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(31, 41, 51, .12);
    color: var(--brand-foreground);
}

.account-card h1 {
    margin: 0 0 .25rem;
    font-size: 1.35rem;
}

.account-card h2 {
    margin: 0 0 1.25rem;
    font-size: 1rem;
    color: var(--brand-muted-fg);
    font-weight: 500;
}

.account-card label {
    display: block;
    margin-bottom: .85rem;
    font-size: .85rem;
    color: var(--brand-muted-fg);
}

.account-card label.checkbox {
    display: flex;
    align-items: center;
    gap: .4rem;
}

.account-card input[type="text"],
.account-card input[type="email"],
.account-card input[type="password"] {
    display: block;
    width: 100%;
    margin-top: .3rem;
    padding: .55rem .65rem;
    border: 1px solid #cbd2d9;
    border-radius: 8px;
    font: inherit;
}

.account-card input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(0, 84, 179, .15);
}

.account-card .btn {
    display: inline-block;
    width: 100%;
    margin-top: .5rem;
    padding: .6rem .9rem;
    border: 1px solid var(--brand-primary);
    background: var(--brand-primary);
    color: #fff;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
}

.account-card .btn:hover {
    background: #00478f;
    border-color: #00478f;
}

.account-card .validation-message,
.status-down {
    color: var(--brand-destructive);
    font-size: .85rem;
}

.status-up {
    color: var(--brand-success);
    font-size: .85rem;
}

/* Muted "back to console" link below the account form. */
.account-card .account-back {
    display: inline-block;
    margin-top: 1rem;
    color: var(--brand-muted-fg);
    font-size: .85rem;
    text-decoration: none;
}

.account-card .account-back:hover {
    color: var(--brand-primary);
    text-decoration: underline;
}

/* -----------------------------------------------------------------------------
   Phase 8 data tables (incident console + retry queue)
   Header emphasis + soft alternating row background for easier row scanning.
   Applied via Class="... sm-data-table" on the MudTable.
   ----------------------------------------------------------------------------- */
.sm-data-table .mud-table-head th,
.sm-data-table.mud-table-sticky-header .mud-table-head th {
    font-weight: 600;
    color: var(--brand-primary);
    /* Opaque tint (≈ rgba(0,84,179,.16) flattened over white) so the sticky header
       does not let the scrolling rows show through underneath it. !important overrides
       MudBlazor's sticky-header rule, which sets the header to the surface color and
       loads after this sheet. */
    background-color: #d6e4f3 !important;
    border-bottom: 2px solid var(--brand-primary);
}

.sm-data-table tbody tr:nth-of-type(even) {
    background-color: rgba(0, 84, 179, .035);
}

/* Dark-mode overrides. `.sm-dark` is set on the MudLayout by MainLayout when dark mode is on,
   so the hardcoded light header tint / stripes above are re-skinned for dark surfaces. */
.sm-dark .sm-data-table .mud-table-head th,
.sm-dark .sm-data-table.mud-table-sticky-header .mud-table-head th {
    color: #8ab4f8;
    background-color: #22304a !important;
    border-bottom-color: #3D8BE0;
}

.sm-dark .sm-data-table tbody tr:nth-of-type(even) {
    background-color: rgba(138, 180, 248, .08);
}

/* Problem-row highlight (live console): incidents in a failure state or stuck too long get a
   light-red background so issues stand out at a glance. Driven by IncidentDisplay.IsProblemRow
   via the table's RowClassFunc. !important to win over the alternating-stripe rule above. */
.sm-data-table tbody tr.sm-row-problem,
.sm-data-table tbody tr.sm-row-problem:nth-of-type(even) {
    background-color: #fdecea !important;
}

.sm-data-table tbody tr.sm-row-problem:hover {
    background-color: #fbdbd6 !important;
}

.sm-dark .sm-data-table tbody tr.sm-row-problem,
.sm-dark .sm-data-table tbody tr.sm-row-problem:nth-of-type(even) {
    background-color: rgba(197, 34, 31, .22) !important;
}

.sm-dark .sm-data-table tbody tr.sm-row-problem:hover {
    background-color: rgba(197, 34, 31, .32) !important;
}

/* The brand logo vanishes on the dark app bar. CSS filters are uniform (can't recolor by region),
   but invert() lifts the near-black word to near-white and turns the blue word orange; hue-rotate()
   then swings that orange back to a light blue, approximating: dark word -> white, blue -> light blue.
   For an exact result, swap in a purpose-made dark logo asset instead. */
.sm-dark .appbar-logo {
    filter: invert(1) hue-rotate(180deg);
}

/* -----------------------------------------------------------------------------
   Help section — typography for the Markdown-rendered user manual (Markdig output).
   Scoped to .help-content so it does not affect the rest of the console.
   ----------------------------------------------------------------------------- */
.help-content {
    line-height: 1.6;
    max-width: 70rem;
}

.help-content h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--brand-primary);
    margin: 0 0 1rem;
}

.help-content h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--brand-primary);
    margin: 2rem 0 .75rem;
    padding-bottom: .3rem;
    border-bottom: 1px solid var(--brand-border);
}

.help-content h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 1.4rem 0 .5rem;
}

.help-content p { margin: .6rem 0; }

.help-content ul,
.help-content ol { margin: .6rem 0 .6rem 1.4rem; }

.help-content li { margin: .25rem 0; }

.help-content code {
    background: rgba(0, 84, 179, .08);
    padding: .1rem .35rem;
    border-radius: 4px;
    font-size: .9em;
}

.help-content hr {
    border: none;
    border-top: 1px solid var(--brand-border);
    margin: 1.5rem 0;
}

/* Blockquotes — used in the manual for the "what is…" callouts. */
.help-content blockquote {
    margin: 1rem 0;
    padding: .6rem 1rem;
    border-left: 4px solid var(--brand-primary);
    background: rgba(0, 84, 179, .04);
    color: var(--brand-muted-fg);
}

.help-content blockquote p { margin: .3rem 0; }

/* Tables (roles/permissions matrices, glossary). */
.help-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
    font-size: .92rem;
}

.help-content th,
.help-content td {
    border: 1px solid var(--brand-border);
    padding: .45rem .6rem;
    text-align: left;
}

.help-content thead th {
    background: #d6e4f3;
    color: var(--brand-primary);
    font-weight: 600;
}

.help-content tbody tr:nth-of-type(even) { background: rgba(0, 84, 179, .03); }

/* Dark-mode overrides for the help content. */
.sm-dark .help-content h1,
.sm-dark .help-content h2,
.sm-dark .help-content h3 { color: #8ab4f8; }

.sm-dark .help-content code { background: rgba(138, 180, 248, .12); }

.sm-dark .help-content blockquote {
    border-left-color: #3D8BE0;
    background: rgba(138, 180, 248, .08);
}

.sm-dark .help-content thead th {
    background: #22304a;
    color: #8ab4f8;
}

.sm-dark .help-content tbody tr:nth-of-type(even) { background: rgba(138, 180, 248, .06); }
