/*
 * The platform administration console, drawn with the ResortManager.Hotspot operator
 * console's own stylesheet: the same tokens, shell, side menu, cards, field grid, table
 * and pills (Hotspot src/ConsoleUI/ResortManager.Hotspot.Shared.ConsoleUI/wwwroot/console.css).
 * The class names are that file's, so a rule here can be checked against it line for
 * line. Hotspot's inputs and buttons are Syncfusion fluent2 skinned by that file; this
 * page has no Syncfusion, so the skinned result is written out under the same names.
 */

:root {
    --blue: #0A73B9;
    --blue-deep: #075E97;
    --ink: #0A2540;
    --ink-soft: #334A63;
    --accent: #EF8D20;

    --bg: #F5F8FC;
    --bg-tint-2: #EDF3FA;
    --surface: #FFFFFF;
    --border: #E3EAF2;
    --muted: #5B6B7B;

    --text: var(--ink);
    --primary: var(--blue);
    --danger: #A2191F;
    --ok: #0E6027;

    --ok-tint: #E5F4ED;
    --warn: #B5630E;
    --warn-tint: #FBEFD9;
    --danger-tint: #FBE7E5;
    --info-ink: #075E97;
    --info-tint: #EDF3FA;
    --muted-tint: #E2E8F0;
    --muted-ink: #475569;

    --header: #0A2540;
    --header-text: #FFFFFF;
    --header-muted: #B9C6D6;
    --band-operator: #FBF1E4;
    --band-operator-ink: #6B4408;
    --notice-bg: #E7F3EC;
    --notice-border: #C6E3D2;
    --error-bg: #FBEAEA;
    --error-border: #F0CBCC;

    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(10, 37, 64, .06), 0 1px 3px rgba(10, 37, 64, .05);
    --shadow: 0 10px 30px -12px rgba(10, 37, 64, .18);

    --side-width: 248px;
    --header-height: 60px;

    --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color-scheme: light dark;
}

/* The Helpdesk runs light and dark; the same tokens with their night values. */
@media (prefers-color-scheme: dark) {
    :root {
        --blue: #176EA6;
        --blue-deep: #1B7FC0;
        --ink: #ECF3FA;
        --ink-soft: #D2DEEA;
        --accent: #F2A94F;
        --bg: #0B1624;
        --bg-tint-2: #16283D;
        --surface: #122338;
        --border: #2C4057;
        --muted: #B0C0D0;
        --primary: #55B5F2;
        --danger: #FF9B91;
        --ok: #7FD6A0;
        --ok-tint: #173A2A;
        --warn: #F2C27A;
        --warn-tint: #3A2C15;
        --danger-tint: #3F1D1D;
        --info-ink: #8FCBF2;
        --info-tint: #16304A;
        --muted-tint: #243449;
        --muted-ink: #C3D0DD;
        --header: #07111D;
        --band-operator: #3A2A14;
        --band-operator-ink: #F6D5A8;
        --notice-bg: #173A2A;
        --notice-border: #245C40;
        --error-bg: #3F1D1D;
        --error-border: #6B2B2B;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    }
}

* { box-sizing: border-box; }

html { scroll-padding-top: calc(var(--header-height) + 1rem); }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0; }

a { color: var(--primary); }

.hidden { display: none !important; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 45%, transparent); outline-offset: 2px; }

/* ---- shell ---- */

.console-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--header);
    color: var(--header-text);
    padding: 0 20px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
}

/* The lockup the helpdesk console carries: the conversation D, then RM in semibold and Desk in regular. */
.console-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--header-text); text-decoration: none; letter-spacing: -.01em; }
.console-brand-mark { width: 28px; height: 28px; display: block; }
.console-brand-name { font-size: 1.05rem; font-weight: 400; }
.console-brand strong { font-weight: 600; }

.console-header-right { display: flex; align-items: center; gap: 18px; }

.console-signout {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    font: inherit;
    color: var(--header-muted);
    font-size: .9rem;
    font-weight: 500;
}

.console-signout:hover { color: var(--header-text); }

.console-language {
    background: transparent;
    color: var(--header-muted);
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font: inherit;
    font-size: .85rem;
}

.console-language option { color: #0A2540; background: #FFFFFF; }

/* The band that says whose console this is, as Hotspot's operator band. */
.console-context {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem 20px;
    font-size: .87rem;
    border-bottom: 1px solid var(--border);
}

.console-context-badge {
    font-weight: 700;
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: .15rem .55rem;
    border-radius: 999px;
    white-space: nowrap;
}

.console-context.is-operator { background: var(--band-operator); color: var(--band-operator-ink); }
.console-context.is-operator .console-context-badge { background: var(--accent); color: #fff; }

.console-body { display: flex; align-items: flex-start; }

.console-side {
    width: var(--side-width);
    flex: 0 0 var(--side-width);
    padding: 18px 12px 40px;
    border-right: 1px solid var(--border);
    background: var(--surface);
    min-height: calc(100vh - var(--header-height));
    position: sticky;
    top: var(--header-height);
    align-self: stretch;
}

.console-main { flex: 1 1 auto; padding: 24px 28px 60px; min-width: 0; }

/* ---- side menu ---- */

.console-nav-group { margin-bottom: 1.1rem; }

.console-nav-heading {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    padding: 0 .65rem .3rem;
}

.console-nav-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .4rem .65rem;
    border-radius: var(--radius-sm);
    color: var(--ink-soft);
    text-decoration: none;
    font-size: .91rem;
    font-weight: 500;
}

.console-nav-link:hover { background: var(--bg-tint-2); color: var(--ink); }

.console-nav-link.active { background: var(--blue); color: #fff; font-weight: 600; }

.console-nav-icon { width: 1.1rem; text-align: center; opacity: .85; font-size: .95rem; }

/* ---- content ---- */

.page-title { font-size: 1.4rem; font-weight: 800; margin-bottom: .2rem; user-select: none; }
.page-title:focus { outline: none; }
.page-lede { color: var(--muted); margin: 0 0 1.4rem; max-width: 62ch; }

/* The title and the page's one action on a line, the action at the far end. */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 22px;
    margin-bottom: 20px;
}

.card h2 { margin: 0 0 .25rem; font-size: 1.05rem; font-weight: 800; }
.card .hint { color: var(--muted); font-size: .87rem; margin: 0 0 1rem; max-width: 68ch; }

/* A card whose content is a table: the table runs to the card's edges. */
.card-flush { padding: 0; overflow: hidden; }
.card-flush .empty { padding: 22px; margin: 0; }

/* A list in a card and, beside it, the panel for the row chosen from it. */
.rm-split { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); gap: 20px; align-items: start; }
.rm-check { display: flex; align-items: center; gap: .5rem; font-size: .9rem; margin: 4px 0 14px; cursor: pointer; }
.rm-check input { width: 16px; height: 16px; accent-color: var(--blue); }

.notice, .error {
    border-radius: var(--radius-sm);
    padding: .7rem .9rem;
    margin-bottom: 1rem;
    font-size: .9rem;
}

.notice { background: var(--notice-bg); color: var(--ok); border: 1px solid var(--notice-border); }
.error { background: var(--error-bg); color: var(--danger); border: 1px solid var(--error-border); }

.empty { color: var(--muted); font-size: .9rem; padding: .6rem 0; }
.muted { color: var(--muted); font-size: .87rem; }

/* ---- the form system (Hotspot's, ported there from ResortManager.Web) ---- */

.rm-field { margin-bottom: 14px; min-width: 0; }

.rm-field-label {
    display: flex;
    align-items: center;
    gap: .2rem;
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
    margin-bottom: 6px;
    letter-spacing: .02em;
    min-height: 18px;
}

.rm-field-required { color: var(--danger); margin-left: .2rem; font-weight: 600; }

.rm-field-hint-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 13px;
    height: 13px;
    margin-left: .3rem;
    border-radius: 50%;
    background: var(--muted-tint);
    color: var(--muted-ink);
    font-size: 9px;
    font-weight: 700;
    cursor: help;
}

.rm-field-control { width: 100%; }

.rm-field-control input,
.rm-field-control select {
    width: 100%;
    height: 36px;
    padding: 0 10px;
    font: inherit;
    font-size: .95rem;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color .15s ease, box-shadow .15s ease;
}

/* A key pasted whole, such as a service account's JSON: several lines, in a fixed-width face. */
.rm-field-control textarea {
    width: 100%;
    min-height: 140px;
    padding: 8px 10px;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: .85rem;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    resize: vertical;
}

.rm-field-control textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(10, 115, 185, .12);
}

.rm-field-control input:hover { border-color: var(--blue); }

.rm-field-control input:focus,
.rm-field-control select:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(10, 115, 185, .12);
}

.rm-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 18px; }
.rm-form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rm-form-grid .rm-field { margin-bottom: 12px; }

.rm-form-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.rm-form-bar h2 { margin: 0; font-size: 1.05rem; font-weight: 800; }

.rm-section-title {
    margin: 18px 0 8px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    border-top: 1px solid var(--border);
    padding-top: 14px;
}

.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* ---- buttons: Syncfusion fluent2 as the Hotspot stylesheet skins it ---- */

.e-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    height: 36px;
    padding: 0 14px;
    font: inherit;
    font-size: .9rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.e-btn:hover { background: var(--bg-tint-2); }
.e-btn:disabled { opacity: .5; cursor: not-allowed; }
.e-btn.e-small { height: 30px; padding: 0 10px; font-size: 12.5px; }
.e-btn.e-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.e-btn.e-primary:hover { background: var(--blue-deep); border-color: var(--blue-deep); }
.e-btn.e-outline { background: transparent; border-color: var(--blue); color: var(--primary); }
.e-btn.e-outline:hover { background: var(--bg-tint-2); }
.e-btn.e-danger { background: var(--danger-tint); border-color: var(--danger-tint); color: var(--danger); }
.e-btn.e-danger:hover:not(:disabled) { background: #A2191F; border-color: #A2191F; color: #fff; }

.link,
button.link {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    font-size: .87rem;
    color: var(--primary);
    cursor: pointer;
    text-decoration: none;
}

.link:hover { text-decoration: underline; }

/* ---- signing in: Hotspot's operator sign-in card ---- */

.auth-card { max-width: 420px; margin: 3rem auto; }
.auth-submit { width: 100%; margin-top: .25rem; height: 40px; }
.auth-link { margin: 1rem 0 0; }
.auth-card .notice, .auth-card .error { margin: 1rem 0 0; }

/* ---- the table ---- */

.table-scroll { overflow-x: auto; }

.console-table { width: 100%; border-collapse: collapse; }

.console-table th,
.console-table td {
    text-align: left;
    padding: .7rem .75rem;
    border-bottom: 1px solid var(--border);
    line-height: 1.45;
    font-size: 13px;
    vertical-align: middle;
}

.console-table th {
    background: var(--bg-tint-2);
    height: 44px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    font-weight: 700;
    white-space: nowrap;
}

.console-table td { height: 44px; }
.console-table th:first-child, .console-table td:first-child { padding-left: 22px; }
.console-table th:last-child, .console-table td:last-child { padding-right: 22px; }
.console-table tbody tr:last-child td { border-bottom: 0; }
.console-table tbody tr:hover { background: var(--bg-tint-2); }
.console-table code { font-size: .85em; color: var(--muted); }
.console-table .name { font-weight: 600; }
.console-table .actions-col { width: 1%; }
.console-table .number { text-align: right; font-variant-numeric: tabular-nums; }
.console-table tbody tr.selected { background: var(--bg-tint-2); }

.actions { display: flex; flex-wrap: nowrap; gap: 6px; justify-content: flex-end; }

/* ---- status pills ---- */

.rm-status-pill {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1.5;
    font-weight: 600;
    letter-spacing: .02em;
    background: var(--muted-tint);
    color: var(--muted-ink);
    white-space: nowrap;
}

.rm-status-pill.rm-status-ok { background: var(--ok-tint); color: var(--ok); }
.rm-status-pill.rm-status-pending { background: var(--info-tint); color: var(--info-ink); }
.rm-status-pill.rm-status-warn { background: var(--warn-tint); color: var(--warn); }
.rm-status-pill.rm-status-danger { background: var(--danger-tint); color: var(--danger); }

/* ---- the confirmation, as Hotspot's RmConfirmDialog ---- */

.rm-confirm {
    width: min(440px, calc(100vw - 32px));
    padding: 22px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.rm-confirm::backdrop { background: rgba(10, 37, 64, .45); }
.rm-confirm h2 { font-size: 1.05rem; font-weight: 800; margin-bottom: .5rem; }
.rm-confirm p { margin: 0 0 .75rem; font-size: .9rem; }
.rm-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

/* ---- how it narrows ---- */

@media (max-width: 1100px) {
    .rm-form-grid--3 { grid-template-columns: 1fr 1fr; }
    .rm-split { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .console-body { display: block; }
    .console-side {
        width: auto;
        position: static;
        min-height: 0;
        border-right: 0;
        border-bottom: 1px solid var(--border);
        padding: 10px 12px;
    }
    .console-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
    .console-nav-group { margin-bottom: .4rem; }
    .console-main { padding: 18px 16px 48px; }
}

@media (max-width: 720px) {
    .rm-form-grid, .rm-form-grid--3 { grid-template-columns: 1fr; }
    .page-head { flex-direction: column; }
    .console-header { padding: 0 14px; }
    .auth-card { margin: 1.5rem auto; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* A tenant's identifier under its name, and its registry ID behind a pill. */
.console-table td.name small { display: block; color: var(--muted); font-weight: 400; font-size: .8rem; }
.rm-id { margin-left: 8px; }
.rm-id-pill { border: 0; cursor: pointer; font-family: inherit; vertical-align: middle; }
.rm-id-pill:hover, .rm-id-pill:focus-visible { background: var(--info-tint); color: var(--info-ink); }
.rm-id-popover {
    position: absolute;
    inset: auto;
    margin: 0;
    padding: 10px 12px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    font-weight: 400;
}
.rm-id-label { display: block; color: var(--muted); font-size: .75rem; margin-bottom: 4px; }
.rm-id-popover code { user-select: all; }
