/* Layout of the supervisor: sober and soft. One list, one detail with tabs (central-ui.md). */

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    background: var(--lp-bg);
    color: var(--lp-text);
    font-family: var(--lp-font);
    font-size: var(--lp-font-size);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1 { font-size: var(--lp-font-size-title); font-weight: 500; margin: 0; }
h2 { font-size: var(--lp-font-size-section); font-weight: 500; margin: 0 0 12px; }
h3 { font-size: var(--lp-font-size); font-weight: 500; margin: 18px 0 8px; color: var(--lp-text-muted); letter-spacing: .02em; }
a { color: var(--lp-secondary); transition: color var(--lp-transition); }
a:hover { color: var(--lp-secondary-dark); }
:focus-visible { outline: 2px solid var(--lp-secondary-light); outline-offset: 2px; border-radius: 4px; }

.lp-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lp-muted { color: var(--lp-text-muted); }
.lp-strong { font-weight: 500; }
.lp-mono { font-family: Consolas, 'Cascadia Mono', monospace; font-size: 11px; }
.lp-break { word-break: break-all; }
.lp-nowrap { white-space: nowrap; }
.lp-pad { padding: 12px 16px; margin: 0; }
.lp-danger { color: var(--lp-down) !important; }
.lp-push-end { margin-left: auto; }

/* Banner: petrol blue, logo, at most five entries, FR | EN then the account menu. */
.lp-banner {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 52px;
    padding: 0 20px;
    background: var(--lp-secondary);
    box-shadow: 0 2px 12px rgba(20, 47, 57, .18);
    color: #fff;
}

.lp-brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-size: var(--lp-font-size-section); font-weight: 500; white-space: nowrap; }
.lp-brand:hover { color: #fff; }
.lp-nav { display: flex; gap: 4px; }
.lp-nav a { color: #DFF6FF; text-decoration: none; white-space: nowrap; padding: 6px 12px; border-radius: var(--lp-radius-pill); transition: background var(--lp-transition), color var(--lp-transition); }
.lp-nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.lp-nav a.active { color: #fff; background: rgba(255, 255, 255, .14); box-shadow: inset 0 -2px 0 var(--lp-primary); }
.lp-banner-end { margin-left: auto; display: flex; align-items: center; gap: 16px; }

.lp-lang { display: flex; align-items: center; gap: 6px; }
.lp-lang strong { color: #fff; }
.lp-lang a { color: #B9DCEA; text-decoration: none; }
.lp-lang a:hover { color: #fff; text-decoration: underline; }
.lp-lang-sep { color: #5A94AA; }

.lp-account { position: relative; }
.lp-account summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.lp-account summary::-webkit-details-marker { display: none; }
.lp-account .material-icons { font-size: 22px; }
.lp-account-menu {
    position: absolute; right: 0; top: 34px; z-index: 10; min-width: 180px; padding: 6px;
    background: var(--lp-surface); color: var(--lp-text); border-radius: var(--lp-radius); box-shadow: var(--lp-shadow-raised);
}
.lp-account-menu form { margin: 0; }

.lp-main { padding: 20px 24px; max-width: 1600px; margin: 0 auto; }
.lp-main-narrow { max-width: 420px; padding-top: 48px; }

/* Keep the banner, instance summary and tabs in view. Only the active panel scrolls. */
.lp-main:has(> .lp-instance-header) {
    height: calc(100dvh - 52px);
    display: flex;
    flex-direction: column;
}
.lp-main > .lp-instance-header, .lp-main > .lp-tabs { flex: none; }
.lp-main > .lp-tab-panel { overflow: auto; min-height: 0; margin-bottom: 0; }
.lp-tab-panel > .lp-table:first-child thead, .lp-source-filters {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--lp-surface);
}
@media (max-width: 720px), (max-height: 600px) {
    .lp-main > .lp-instance-header { max-height: 32dvh; overflow: auto; }
    .lp-main > .lp-tabs { flex-wrap: nowrap; overflow-x: auto; }
    .lp-source-filters { position: static; }
}

.lp-subnav { display: flex; gap: 16px; margin-bottom: 12px; }
.lp-subnav a { text-decoration: none; color: var(--lp-text-muted); padding: 4px 12px; border-radius: var(--lp-radius-pill); transition: background var(--lp-transition); }
.lp-subnav a:hover { background: var(--lp-surface); }
.lp-subnav a.active { color: var(--lp-primary-text); background: var(--lp-primary-light); }

.lp-page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }

.lp-card { background: var(--lp-surface); border-radius: var(--lp-radius); box-shadow: var(--lp-shadow); padding: 20px; margin-bottom: 16px; }
.lp-card-flush { padding: 0; overflow: hidden; }
.lp-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.lp-stack > .lp-card { margin-bottom: 16px; }

/* Buttons: one coral primary action per screen at most. */
.lp-button {
    display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 16px;
    border: 1px solid transparent; border-radius: var(--lp-radius-pill);
    font: inherit; cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background var(--lp-transition), color var(--lp-transition), box-shadow var(--lp-transition);
}
.lp-button:disabled { opacity: .5; cursor: not-allowed; }
.lp-button-primary { background: var(--lp-primary); color: #1C1B1F; }
.lp-button-primary:hover:not(:disabled) { background: var(--lp-primary-hover); color: #fff; box-shadow: 0 4px 12px rgba(252, 111, 94, .3); }
.lp-button-secondary { background: var(--lp-surface); color: var(--lp-secondary); border-color: #C9DCE4; }
.lp-button-secondary:hover:not(:disabled) { background: var(--lp-secondary-bg); }
.lp-button-danger { background: var(--lp-down); color: #fff; }
.lp-button-link { background: none; color: var(--lp-secondary); padding: 0 6px; }
.lp-button-link:hover { text-decoration: underline; }
.lp-button-block { width: 100%; justify-content: center; height: 40px; }

.lp-input, .lp-field input, .lp-field select, .lp-field textarea, textarea.lp-input {
    height: 34px; padding: 4px 12px; border: 1px solid var(--lp-border); border-radius: var(--lp-radius-small);
    font: inherit; color: var(--lp-text); background: var(--lp-surface);
    transition: border-color var(--lp-transition), box-shadow var(--lp-transition);
}
.lp-input:focus, .lp-field input:focus, .lp-field select:focus, .lp-field textarea:focus, textarea.lp-input:focus {
    outline: none; border-color: var(--lp-secondary-light); box-shadow: 0 0 0 3px rgba(60, 117, 138, .15);
}
textarea.lp-input, .lp-field textarea { height: auto; width: 100%; }
.lp-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.lp-field > span { font-weight: 500; }
.lp-field small { color: var(--lp-text-muted); }
.lp-field-error { color: var(--lp-down); }
.lp-form-actions { display: flex; gap: 8px; margin-top: 8px; }

/* States: colour + icon + label, never the colour alone. */
.lp-status { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px 2px 7px; border-radius: var(--lp-radius-pill); font-weight: 500; white-space: nowrap; }
.lp-status .material-icons { font-size: 15px; }
.lp-status-ok { color: var(--lp-ok-strong); background: var(--lp-ok-soft); }
.lp-status-warn { color: var(--lp-warn-strong); background: var(--lp-warn-soft); }
.lp-status-down { color: var(--lp-down-strong); background: var(--lp-down-soft); }
.lp-status-unknown { color: var(--lp-unknown-strong); background: var(--lp-unknown-soft); }
.lp-status-maintenance { color: var(--lp-maintenance-strong); background: var(--lp-maintenance-soft); }

.lp-env { display: inline-block; padding: 1px 8px; border-radius: var(--lp-radius-pill); border: 1px solid var(--lp-border); color: var(--lp-text-muted); font-size: 11px; white-space: nowrap; }
.lp-env-prod { background: var(--lp-secondary); border-color: var(--lp-secondary); color: #fff; font-weight: 500; }

.lp-tag { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: var(--lp-radius-pill); background: var(--lp-secondary-bg); color: var(--lp-secondary); font-size: 11px; }
.lp-tag-product { background: var(--lp-primary-light); color: var(--lp-primary-text); font-weight: 500; }
.lp-tag-warn { background: var(--lp-warn-soft); color: var(--lp-warn-strong); }

/* Overview */
.lp-summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.lp-summary-counts { display: flex; flex-wrap: wrap; gap: 6px; }
.lp-summary-item {
    display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 14px;
    border: 1px solid transparent; border-radius: var(--lp-radius-pill); background: var(--lp-surface); box-shadow: var(--lp-shadow);
    font: inherit; font-weight: 500; cursor: pointer; transition: box-shadow var(--lp-transition);
}
.lp-summary-item:hover { box-shadow: var(--lp-shadow-raised); }
.lp-summary-active { border-color: currentColor; }
.lp-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lp-filters input[type=search] { width: 200px; }

/* Dense tables: 1366 px without horizontal scroll; secondary columns hidden under 1024 px (FR-052). */
.lp-table { width: 100%; border-collapse: collapse; }
.lp-table th, .lp-table td { padding: 9px 14px; text-align: left; border-bottom: 1px solid var(--lp-line); vertical-align: middle; }
.lp-table tbody tr:last-child td { border-bottom: none; }
.lp-table th { font-weight: 500; color: var(--lp-text-muted); background: #FBF9FC; white-space: nowrap; }
.lp-table tbody tr { transition: background var(--lp-transition); }
.lp-table tbody tr:hover { background: #FAF7FB; }
.lp-table .lp-col-cause { max-width: 420px; }
.lp-table .lp-col-actions { text-align: right; white-space: nowrap; }
.lp-row-stale td { color: var(--lp-text-muted); }
.lp-sort { border: none; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 2px; }
.lp-sort .material-icons { font-size: 14px; opacity: .6; }

.lp-empty { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 32px 16px; color: var(--lp-text-muted); }
.lp-empty .material-icons { font-size: 22px; }

/* Detail */
.lp-instance-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lp-instance-cause { margin: 8px 0 0; font-weight: 500; }
.lp-facts { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 12px 0 0; }
.lp-facts dt { color: var(--lp-text-muted); }
.lp-facts dd { margin: 0; }

.lp-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; margin-bottom: 12px; background: var(--lp-surface); border-radius: var(--lp-radius); box-shadow: var(--lp-shadow); }
.lp-tab { border: none; background: none; padding: 7px 14px; font: inherit; color: var(--lp-text-muted); cursor: pointer; border-radius: var(--lp-radius-pill); transition: background var(--lp-transition), color var(--lp-transition); }
.lp-tab:hover { color: var(--lp-text); background: var(--lp-bg); }
.lp-tab-active, .lp-tab-active:hover { color: var(--lp-primary-text); background: var(--lp-primary-light); font-weight: 500; }
.lp-tab-toolbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--lp-line); }
.lp-sources { display: inline-flex; gap: 8px; font-variant-numeric: tabular-nums; }
.lp-sources-warn { color: #8A5A12; font-weight: 500; }
.lp-probe-detail { color: var(--lp-text-muted); font-size: 11px; max-width: 320px; }
.lp-flush { padding: 0 0 8px; border-bottom: none; }
.lp-arrow { font-size: 14px; color: var(--lp-text-muted); margin: 0 4px; }

/* Notices: what is wrong and what to do, details folded (FR-053). */
.lp-notice { display: flex; gap: 10px; padding: 12px 14px; margin: 10px 0; border-radius: var(--lp-radius); background: var(--lp-surface); }
.lp-notice-error { background: var(--lp-down-soft); }
.lp-notice-warn { background: var(--lp-warn-soft); }
.lp-notice-ok { background: var(--lp-ok-soft); }
.lp-notice-info { background: var(--lp-secondary-bg); }
.lp-notice > .material-icons { font-size: 18px; }
.lp-notice-error > .material-icons { color: var(--lp-down-strong); }
.lp-notice-warn > .material-icons { color: var(--lp-warn-strong); }
.lp-notice-ok > .material-icons { color: var(--lp-ok-strong); }
.lp-details summary { cursor: pointer; color: var(--lp-secondary); margin-top: 4px; }
.lp-details pre { white-space: pre-wrap; margin: 4px 0 0; font-size: 11px; }

/* Confirmation dialog: LogePal name and environment stand out (FR-035). */
.lp-dialog-backdrop { position: fixed; inset: 0; background: rgba(20, 47, 57, .32); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; z-index: 100; }
.lp-dialog { width: min(520px, 92vw); background: var(--lp-surface); border-radius: 14px; padding: 24px; box-shadow: var(--lp-shadow-raised); }
.lp-dialog-target { display: flex; align-items: center; gap: 8px; font-size: var(--lp-font-size-section); }
.lp-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* Charts: one colour per series, no gradient. */
.lp-chart { margin: 0; }
.lp-chart figcaption { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-weight: 500; }
.lp-chart svg { width: 100%; height: 160px; }
.lp-chart-line { fill: none; stroke: var(--lp-secondary-light); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.lp-chart-band { fill: var(--lp-secondary-bg); stroke: none; }
.lp-chart-axis { stroke: var(--lp-line); }
.lp-chart-label { font-size: 9px; fill: var(--lp-text-muted); }
.lp-chip { border: 1px solid var(--lp-border); background: var(--lp-surface); border-radius: var(--lp-radius-pill); padding: 2px 10px; font: inherit; cursor: pointer; margin-left: 4px; }
.lp-chip-active { border-color: transparent; background: var(--lp-primary-light); color: var(--lp-primary-text); }

.lp-login h1 { margin-bottom: 4px; }

#blazor-error-ui {
    display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;
    padding: 10px 16px; background: var(--lp-down-soft); box-shadow: var(--lp-shadow-raised);
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 12px; top: 8px; }

@media (max-width: 1024px) {
    .lp-col-secondary { display: none; }
    .lp-columns { grid-template-columns: minmax(0, 1fr); }
    .lp-nav a { padding: 6px 8px; }
}

/* Logs */
.lp-log {
    max-height: 520px; overflow: auto; margin: 8px 0 0; padding: 12px 14px;
    background: #23262B; color: #E8E3EA; border-radius: var(--lp-radius);
    font-family: Consolas, 'Cascadia Mono', monospace; font-size: 11px; line-height: 1.45; white-space: pre;
}
.lp-row-selected td { background: var(--lp-primary-light); }
.lp-wrap { flex-wrap: wrap; }
.lp-grow { flex: 1 1 320px; }
.lp-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.lp-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; margin-top: 8px; }

.lp-indicator { margin-left: 6px; color: var(--lp-warn-text); text-decoration: none; }
.lp-indicator .material-icons { font-size: 15px; }

/* Counters */
.lp-kpis { display: flex; flex-wrap: wrap; gap: 12px; }
.lp-kpi { display: flex; flex-direction: column; gap: 2px; min-width: 130px; padding: 12px 16px; background: var(--lp-bg); border-radius: var(--lp-radius); }
.lp-kpi span { color: var(--lp-text-muted); }
.lp-kpi strong { font-size: var(--lp-font-size-title); font-weight: 500; }
.lp-kpi small { color: var(--lp-text-muted); }

.lp-facts-stack { flex-direction: column; gap: 6px; }
progress { width: 120px; height: 8px; vertical-align: middle; accent-color: var(--lp-secondary-light); }

.lp-or { text-align: center; color: var(--lp-text-muted); margin: 10px 0; }
.lp-account-menu .lp-button { width: 100%; justify-content: flex-start; height: 30px; }

/* Alerts: one card per channel (e-mail, Webex, Jira), ticked to use it. */
.lp-alert-channels { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-top: 8px; }
.lp-alert-channel { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--lp-bg); border-radius: var(--lp-radius); min-width: 0; }
.lp-alert-channel-head { margin-bottom: 8px; font-weight: 500; }
.lp-alert-channel-head .material-icons { color: var(--lp-secondary-light); }
.lp-alert-channel .lp-field { margin-bottom: 8px; }
.lp-alert-channel .lp-field input, .lp-alert-channel .lp-field select, .lp-alert-channel textarea { width: 100%; }
.lp-alert-channel :disabled { opacity: .55; }
