html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Request pop-up windows: hide the site chrome so only the request editor shows (class added per-window by
   mspPopup.init — each popup is its own document, so this never affects the main app window). */
html.msp-popup nav.topnav,
html.msp-popup .impersonation-banner {
    display: none !important;
}

html.msp-popup .content {
    padding-top: 0.75rem;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.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 #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgO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z4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Admin impersonation ("log in as") banner — always visible while acting as another user. */
.impersonation-banner {
    position: sticky;
    top: 0;
    z-index: 1080;
    background: #b35900;
    color: #fff;
    padding: 0.4rem 0.75rem;
    text-align: center;
    font-size: 0.9rem;
}

    .impersonation-banner a.btn {
        vertical-align: baseline;
    }
/* Blazor unhandled-error / lost-circuit banner. GLOBAL (not layout-scoped) so it is hidden by default on
   BOTH the internal app and the customer portal; the framework sets display:block only when a circuit error
   occurs. (Previously this lived in MainLayout.razor.css and so was never hidden on CustomerLayout, leaving a
   permanent "Reconnecting…" banner on the customer portal.) */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

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

/* --------------------------------------------------------------------------
   Shared inline "dot" action buttons — a compact copy/reveal/change vocabulary
   used across the customer info lists (IT Admin Info, Vendors, Shared Links,
   Wifi, Network, VPN, SSLVPN, Users) to match the Master Devices list.
   Round C = copy a value · U = copy username · P = copy password (audited) ·
   R = reveal/hide a secret on screen · triangle = change/set a secret.
   -------------------------------------------------------------------------- */
.copy-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15rem;
    height: 1.15rem;
    margin-left: 0.25rem;
    padding: 0;
    font-size: 0.62rem;
    font-weight: 600;
    line-height: 1;
    color: #556;
    background: #fff;
    border: 1px solid #b7b7c2;
    border-radius: 50%;
    cursor: pointer;
    vertical-align: middle;
}

.copy-dot:hover {
    background: #eef1ff;
    border-color: #8a8ad0;
    color: #223;
}

.copy-dot:disabled {
    opacity: 0.5;
    cursor: default;
}

/* Password copy/reveal reads as a credential action. */
.copy-dot-pw {
    color: #a11550;
    border-color: #d79ab6;
}

.copy-dot-pw:hover {
    background: #fdeef4;
    border-color: #b3557f;
    color: #7a0f3c;
}

/* Change/set-secret triangle. */
.change-tri {
    margin-left: 0.3rem;
    padding: 0 0.15rem;
    font-size: 0.8rem;
    line-height: 1;
    color: #333;
    background: transparent;
    border: none;
    cursor: pointer;
    vertical-align: middle;
}

.change-tri:hover {
    color: #0d6efd;
}

.change-tri:disabled {
    opacity: 0.5;
    cursor: default;
}

/* Tighter, denser rows for the customer info lists (matches the Master Devices list). */
.tight-list table.table > :not(caption) > * > * {
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
}

/* Dense single-row edit grid for the customer info panels' "detailed" (open-row) editor — keeps every field
   on one row on wide screens instead of Bootstrap rows that wrap and stretch. A panel sets the wide-screen
   column count with an inline `style="--cols: N"` (defaults to 8) so all its fields fit on one row; on
   narrower screens it steps down to 4 then 2 columns so it never overflows horizontally. */
.tight-edit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.3rem 0.6rem;
    align-items: start;
}

@media (min-width: 768px) {
    .tight-edit-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1200px) {
    .tight-edit-grid { grid-template-columns: repeat(var(--cols, 8), minmax(0, 1fr)); }
}

/* Let a field span more than one column (e.g. a multi-select or a wider text box). */
.tight-edit-cell-2 { grid-column: span 2; }
.tight-edit-cell-3 { grid-column: span 3; }

/* Zebra striping: a light-gray tint on alternating data-table rows so rows are easier to follow across wide
   tables. Uses Bootstrap's own striped variable (--bs-table-bg-type) so per-row STATE backgrounds still win:
   the inline-edit highlight (table-active) and the mailbox status colors (table-warning/table-danger) set
   --bs-table-bg-state, which takes precedence over the stripe. */
.table:not(.table-striped) > tbody > tr:nth-of-type(even) > * {
    --bs-table-bg-type: var(--bs-table-striped-bg);
}

/* Personal-favorite star on the Customers list: a clickable ☆/★ toggle in "Choose favorites" mode, and a
   static gold ★ for an already-favorited customer. Kept distinct from the shared customer ★ shown in the name. */
.fav-toggle {
    border: 0;
    background: none;
    padding: 0;
    line-height: 1;
    font-size: 1.15rem;
    color: #b9b9b9;
    cursor: pointer;
}
.fav-toggle:hover,
.fav-toggle.on,
.fav-on {
    color: #e0a800;
}
.fav-on {
    line-height: 1;
    font-size: 1.05rem;
}

/* Calendar view-mode buttons: separated (not a joined button group) and all the same width as the widest
   label ("All Open Tasks"), so they read as an even row of distinct buttons. */
.view-btn {
    min-width: 7.5rem;
}

/* Request "pop-up" button: a small even square sitting right after the request # (before the company). */
.req-pop {
    width: 1.6rem;
    height: 1.6rem;
    padding: 0;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    font-size: 0.9rem;
    margin-left: 0.35rem;
}

/* Request-detail: equal-width button groups. */
.qi-btn { min-width: 7.5rem; }        /* Quick info buttons */
.req-actbtn { min-width: 8.5rem; }    /* Start timer / Add response */
.req-statusbtn { min-width: 8rem; }   /* Not completed / Hold / Completed / Invoiced / Personal / Future To-do */
.nr-actbtn { min-width: 10rem; }      /* New Request: Create request / Personal task / Cancel */

/* Rendered (sanitized) HTML email body in the conversation thread: keep images/tables within the box. */
.conv-html { overflow-x: auto; }
.conv-html img { max-width: 100%; height: auto; }
.conv-html table { max-width: 100%; }
.conv-html p:last-child { margin-bottom: 0; }

/* Dashboard stat cards double as links to the filtered History/Completed view — hover affordance. */
.stat-card { transition: background-color .1s, box-shadow .1s; }
.stat-card:hover { background-color: rgba(0, 0, 0, 0.03); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }

/* Dashboard team report: fixed layout so the weekly and monthly tables' columns align vertically; the spacer
   column between Finished Requests and Billed Hours is borderless so it reads as a gap. */
.report-table { table-layout: fixed; }
/* Keep every value (e.g. "22h 30m") on one line — no wrapping at the space. */
.report-table td, .report-table th { white-space: nowrap; }
.report-table td.report-gap,
.report-table th.report-gap {
    border: 0;
    background: transparent;
    padding: 0;
}

/* AI Response panel on the service-request page — a soft tint to set it apart from the Problem card. */
.ai-resp { background-color: #eef6ff; }

/* ---- Draggable, persistent table column widths (see Directions/table-resize-spec.md) ----
   Applies to every Bootstrap data table (.table) app-wide; table-resize.js injects the drag
   handles (drag to resize, double-click a handle to auto-fit, widths persist per browser). Opt a
   table out with class "no-resize". Nothing changes visually until a column is actually dragged. */

/* header cells need position:relative so the handle can pin to their right edge */
.table thead th { position: relative; }

.col-resizer {
    position: absolute; top: 0; right: 0; width: 8px; height: 100%;
    cursor: col-resize; touch-action: none; user-select: none; z-index: 3;
}
.col-resizer:hover { background: rgba(27, 110, 194, .25); }

/* Only AFTER a resize (JS adds .rz-on) does the table go fixed-layout and clip cells.
   Scoped to header + normal body rows — never the full-width colspan panel rows (inline
   editor / row-detail), which carry .crud-panel-row (CrudSection) or .edit-row. */
.table.rz-on thead th,
.table.rz-on tbody tr:not(.crud-panel-row):not(.edit-row) td {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Segmented "button menu" for the customer section categories (customer portal + internal customer page). */
.portal-menu { display: flex; flex-wrap: wrap; gap: .4rem; }
.portal-menu .nav-link {
    border: 1px solid var(--bs-border-color); border-radius: .5rem; background: var(--bs-body-bg);
    color: var(--bs-link-color); padding: .4rem .8rem; font-weight: 500;
}
.portal-menu .nav-link:hover { background: var(--bs-primary-bg-subtle); border-color: var(--bs-primary); }
.portal-menu .nav-link.active { background: var(--bs-primary); border-color: var(--bs-primary); color: #fff; }
.portal-submenu .nav-link.active { font-weight: 600; }

/* ================= MYHOME dashboard + top info strip ================= */

/* Full-width strip at the very top: live clock/date on the left, weather + AQI on the right. Uses Bootstrap
   theme vars so it adapts to light/dark automatically. */
.top-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: .28rem 1rem;
    font-size: .82rem;
    background: var(--bs-tertiary-bg);
    border-bottom: 1px solid var(--bs-border-color);
    color: var(--bs-secondary-color);
}
.top-strip .ts-left { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.top-strip .ts-clock { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--bs-body-color); font-size: .95rem; }
.top-strip .ts-zone { display: inline-flex; align-items: baseline; gap: .3rem; }
.top-strip .ts-zone-label { color: var(--bs-secondary-color); }
.top-strip .ts-clock-tz { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--bs-body-color); }
.top-strip .ts-tools { display: inline-flex; align-items: center; gap: .35rem; }
.top-strip .ts-btn {
    border: 1px solid var(--bs-border-color); background: var(--bs-body-bg); color: var(--bs-body-color);
    border-radius: .35rem; padding: .05rem .4rem; font-size: .78rem; line-height: 1.4; cursor: pointer;
}
.top-strip .ts-btn:hover { border-color: var(--bs-primary); color: var(--bs-primary); }
.top-strip .ts-tool-out { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--bs-body-color); }

/* Ringing timer/alarm dialog — stays up (and beeping) until OK or 30s. */
.ts-alarm-overlay {
    position: fixed; inset: 0; z-index: 20000;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, .45);
}
.ts-alarm-box {
    background: var(--bs-body-bg); color: var(--bs-body-color);
    border: 1px solid var(--bs-border-color); border-radius: .6rem;
    padding: 1.25rem 1.5rem; min-width: 16rem; text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
}
.ts-alarm-msg { font-size: 1.15rem; font-weight: 600; margin-bottom: 1rem; }
.ts-alarm-box.ts-alarm-manage { min-width: 22rem; text-align: left; }
.ts-modal-form { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1rem; }
.ts-field { display: flex; flex-direction: column; gap: .2rem; font-size: .82rem; color: var(--bs-secondary-color); }
.ts-field-row { display: flex; gap: .6rem; align-items: flex-end; margin-bottom: .6rem; }
.ts-modal-actions { display: flex; gap: .5rem; justify-content: flex-end; }
.ts-alarm-list { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.ts-alarm-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; border: 1px solid var(--bs-border-color); border-radius: .4rem; padding: .3rem .6rem; }

/* Calendar appointment marker — distinct from the Open/Completed/Invoiced status badges. */
.cal-appt { background-color: #6b3fa0; color: #fff; }
.cal-appt:hover { background-color: #5a3488; color: #fff; }

/* Request page: appointment-reminders popup. */
.rd-modal-overlay { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.45); }
.rd-modal { background: var(--bs-body-bg); color: var(--bs-body-color); border: 1px solid var(--bs-border-color); border-radius: .6rem; padding: 1.1rem 1.25rem; width: min(34rem, 92vw); max-height: 85vh; overflow: auto; box-shadow: 0 10px 40px rgba(0,0,0,.35); }

/* Request page: resizable Responses | AI Response split. */
.rd-split { display: flex; align-items: stretch; gap: 0; margin-top: .75rem; min-height: 320px; }
.rd-pane { min-width: 0; }
.rd-pane-l { flex: 0 0 55%; overflow: auto; }
.rd-pane-r { flex: 1 1 0; overflow: auto; padding-left: .25rem; }
.rd-divider { flex: 0 0 14px; cursor: col-resize; position: relative; align-self: stretch; }
.rd-divider::before { content: ""; position: absolute; top: 10px; bottom: 10px; left: 6px; width: 2px; border-radius: 2px; background: var(--bs-border-color); }
.rd-divider::after { content: "⋮"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: var(--bs-secondary-color); font-size: .85rem; }
.rd-divider:hover::before, .rd-divider.drag::before { background: var(--bs-primary); }
@media (max-width: 800px) {
    .rd-split { flex-direction: column; }
    .rd-divider { flex-basis: 14px; cursor: row-resize; }
    .rd-pane-l, .rd-pane-r { flex: none !important; width: 100%; }
}
.top-strip .ts-right { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.top-strip .ts-loc { font-weight: 600; color: var(--bs-body-color); }
.top-strip .ts-temp { font-weight: 700; color: var(--bs-body-color); }
.top-strip .ts-aqi { padding: .02rem .4rem; border-radius: 1rem; font-weight: 600; color: #fff; }
.top-strip .aqi-good { background: #2e9b57; }
.top-strip .aqi-mod  { background: #c9a227; color: #1a1a1a; }
.top-strip .aqi-usg  { background: #e8730c; }
.top-strip .aqi-bad  { background: #d0342c; }
.top-strip .aqi-vbad { background: #7a3ca8; }

.myhome { max-width: 1100px; }

/* Ask box answer */
.mh-answer-text { white-space: pre-wrap; }

/* Current-summary stat pills */
.mh-stat {
    display: inline-flex; align-items: baseline; gap: .35rem;
    padding: .3rem .7rem; border: 1px solid var(--bs-border-color); border-radius: .5rem;
    background: var(--bs-body-bg);
}
.mh-stat .mh-num { font-size: 1.25rem; font-weight: 700; line-height: 1; }

/* Monthly-check pills */
.mh-check {
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .35rem .6rem; border-radius: .5rem; border: 1px solid var(--bs-border-color);
    cursor: pointer; background: var(--bs-body-bg);
}
.mh-check:hover { border-color: var(--bs-primary); }
.mh-check .mh-check-icon { font-weight: 700; }
.mh-check .mh-check-name { font-weight: 600; }
.mh-check .mh-check-when { font-size: .78rem; color: var(--bs-secondary-color); }
.mh-check.done { background: color-mix(in srgb, #2e9b57 12%, var(--bs-body-bg)); border-color: #2e9b57; }
.mh-check.done .mh-check-icon { color: #2e9b57; }
.mh-check.todo { background: color-mix(in srgb, #d0342c 8%, var(--bs-body-bg)); border-color: color-mix(in srgb, #d0342c 45%, var(--bs-border-color)); }
.mh-check.todo .mh-check-icon { color: #d0342c; }

/* News scroller — fills the bottom of the page, scroll for more */
.mh-news {
    height: 320px; overflow-y: auto;
    border: 1px solid var(--bs-border-color); border-radius: .5rem;
    background: var(--bs-body-bg);
}
.mh-news-item {
    display: block; padding: .5rem .75rem; border-bottom: 1px solid var(--bs-border-color);
    text-decoration: none; color: inherit;
}
.mh-news-item:last-child { border-bottom: 0; }
.mh-news-item:hover { background: var(--bs-tertiary-bg); }
.mh-news-title { font-weight: 600; color: var(--bs-body-color); }
.mh-news-meta { font-size: .75rem; color: var(--bs-secondary-color); }
.mh-news-src { font-weight: 600; }
.mh-news-sum { font-size: .82rem; color: var(--bs-secondary-color); margin-top: .1rem; }
