/* GuestEvision dashboard — shared styles. GuestEvision brand: navy #131A2D, teal #21C6B8, deep teal #0E8F85, white; Montserrat.
   Status colors come from the IBM color-blind-safe palette and are always paired with a symbol and a word. */
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("/fonts/montserrat-latin.woff2") format("woff2"); }

:root {
  --navy: #131A2D; --navy-2: #0C1120; --navy-3: #26314D; --green: #21C6B8; --green-ink: #0B7A71;
  --ink: #1d2733; --muted: #5b6877; --line: #e1e6eb; --mist: #eef1f4; --bg: #f5f7f9; --white: #fff;
  --ok-bg: #e3f4e7; --ok-ink: #1f6b31; --warn-bg: #fff1cc; --warn-ink: #7a4f00; --bad-bg: #fbe3ee; --bad-ink: #9b1b5a; --info-bg: #e5ecff; --info-ink: #2f4fb3;
  --radius: 12px; --shadow: 0 1px 2px rgba(23, 34, 48, .06), 0 2px 8px rgba(23, 34, 48, .04);
  --font: "Montserrat", "Gotham", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--bg); }
a { color: var(--navy); }
h1, h2, h3 { line-height: 1.2; margin: 0; color: var(--navy); }
h1 { font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: .92em; }
code { background: var(--mist); padding: 1px 6px; border-radius: 4px; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; top: 0; background: var(--white); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }

/* Top bar */
.topbar { background: var(--navy); color: var(--white); }
.topbar-inner { max-width: 1120px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 28px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--white); text-decoration: none; padding: 10px 0; }
.brand img { height: 30px; width: auto; display: block; }
.brand span { font-weight: 700; font-size: 15px; letter-spacing: .02em; padding-left: 12px; border-left: 1px solid rgba(255, 255, 255, .25); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.nav a { color: rgba(255, 255, 255, .82); text-decoration: none; font-weight: 600; font-size: 14px; padding: 8px 12px; border-radius: 8px; display: inline-flex; align-items: center; gap: 6px; }
.nav a:hover { color: var(--white); background: rgba(255, 255, 255, .08); }
.nav a[aria-current="page"] { color: var(--white); background: var(--navy-3); box-shadow: inset 0 -2px 0 var(--green); }
.nav .count { background: var(--green); color: var(--navy-2); border-radius: 999px; font-size: 12px; font-weight: 800; padding: 0 7px; min-width: 20px; text-align: center; }

/* Page */
main { max-width: 1120px; margin: 0 auto; padding: 32px 24px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head .lede { color: var(--muted); margin-top: 6px; max-width: 680px; }
.stack > * + * { margin-top: 20px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } .nav { margin-left: 0; } }

.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head p { color: var(--muted); font-size: 14px; margin-top: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.meta { color: var(--muted); font-size: 13px; }

/* Stat tiles */
.stat { display: block; text-decoration: none; color: inherit; }
.stat .num { font-size: 32px; font-weight: 800; color: var(--navy); line-height: 1.1; }
.stat .label { font-weight: 600; margin-top: 4px; }
.stat .hint { color: var(--muted); font-size: 13px; margin-top: 2px; }
a.stat:hover { border-color: #c6d0da; }
.stat.attention { border-left: 4px solid #FFB000; }

/* Status pills: symbol + word, never color alone */
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 2px 10px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.pill::before { font-weight: 800; }
.pill.ok { background: var(--ok-bg); color: var(--ok-ink); } .pill.ok::before { content: "\2713"; }
.pill.warn { background: var(--warn-bg); color: var(--warn-ink); } .pill.warn::before { content: "!"; }
.pill.bad { background: var(--bad-bg); color: var(--bad-ink); } .pill.bad::before { content: "\2715"; }
.pill.info { background: var(--info-bg); color: var(--info-ink); } .pill.info::before { content: "\2022"; }
.pill.off { background: var(--mist); color: var(--muted); } .pill.off::before { content: "\2013"; }

/* Check list */
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.checks li:first-child { border-top: 0; padding-top: 0; }
.checks .fix { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* Buttons and inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-size: 14px; font-weight: 700; border-radius: 8px; padding: 9px 16px; cursor: pointer; border: 1px solid transparent; text-decoration: none; line-height: 1.2; white-space: nowrap; }
.btn-primary { background: var(--navy); color: var(--white); } .btn-primary:hover { background: var(--navy-2); }
.btn-go { background: var(--green); color: var(--navy-2); } .btn-go:hover { filter: brightness(.95); }
.btn-ghost { background: var(--white); color: var(--navy); border-color: #c6d0da; } .btn-ghost:hover { background: var(--mist); }
.btn-danger { background: var(--white); color: var(--bad-ink); border-color: #e7b9cf; } .btn-danger:hover { background: var(--bad-bg); }
.btn-link { background: none; border: 0; padding: 4px 0; color: var(--navy); text-decoration: underline; font-weight: 600; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
input[type="text"], input[type="search"], input:not([type]) { font: inherit; font-size: 15px; padding: 9px 12px; border: 1px solid #c6d0da; border-radius: 8px; background: var(--white); color: var(--ink); min-width: 0; }
input:focus { border-color: var(--navy); outline: 3px solid rgba(33, 198, 184, .35); outline-offset: 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 13px; color: var(--navy); }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.inline-form .field { flex: 1; min-width: 220px; }
.code-input { font-family: var(--mono) !important; text-transform: uppercase; letter-spacing: .12em; width: 150px; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 10px; border-top: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; border-top: 0; padding-top: 0; }
td:first-child, th:first-child { padding-left: 0; } td:last-child, th:last-child { padding-right: 0; }
td.num, th.num { text-align: right; }
tr.sel td { background: #f3f8f4; }
.t-sub { display: block; color: var(--muted); font-size: 12.5px; }

/* Notices */
.notice { border-radius: var(--radius); padding: 14px 18px; border: 1px solid; display: flex; gap: 12px; align-items: flex-start; }
.notice::before { font-weight: 800; flex: none; }
.notice.warn { background: var(--warn-bg); border-color: #f2d27a; color: var(--warn-ink); } .notice.warn::before { content: "!"; }
.notice.bad { background: var(--bad-bg); border-color: #e7b9cf; color: var(--bad-ink); } .notice.bad::before { content: "\2715"; }
.notice.ok { background: var(--ok-bg); border-color: #b6dfc0; color: var(--ok-ink); } .notice.ok::before { content: "\2713"; }
.notice b { color: inherit; }
.msg { min-height: 1.4em; font-size: 13px; margin-top: 6px; }
.msg.err { color: var(--bad-ink); } .msg.ok { color: var(--ok-ink); }

.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty h3 { color: var(--navy); margin-bottom: 6px; }
.skeleton { background: linear-gradient(90deg, var(--mist), #f7f9fa, var(--mist)); background-size: 200% 100%; animation: sk 1.2s ease-in-out infinite; border-radius: 6px; height: 14px; margin: 10px 0; }
@keyframes sk { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

details.help { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; }
details.help summary { cursor: pointer; font-weight: 700; color: var(--navy); }
details.help ol, details.help ul { padding-left: 20px; margin: 10px 0 0; }
details.help li + li { margin-top: 4px; }

/* TV rows */
.tv-list { list-style: none; margin: 0; padding: 0; }
.tv { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.tv:first-child { border-top: 0; padding-top: 0; }
.tv .name { font-weight: 700; color: var(--navy); }
.tv .facts { color: var(--muted); font-size: 13px; }
@media (max-width: 760px) { .tv { grid-template-columns: 1fr; } }
.pending-tv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px 0; border-top: 1px solid var(--line); }
.pending-tv:first-child { border-top: 0; padding-top: 0; }
@media (max-width: 760px) { .pending-tv { grid-template-columns: 1fr; } }

/* Updates */
details.tv-apps { border-top: 1px solid var(--line); }
details.tv-apps:first-of-type { border-top: 0; }
details.tv-apps > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 14px 0; }
details.tv-apps > summary::-webkit-details-marker { display: none; }
details.tv-apps > summary::after { content: "\25BE"; color: var(--muted); transition: transform .15s; }
details.tv-apps[open] > summary::after { transform: rotate(180deg); }
details.tv-apps .table-wrap { padding-bottom: 16px; }

/* Stays preview */
.preview-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; margin-bottom: 10px; }

/* Dialog */
dialog { border: 0; border-radius: var(--radius); padding: 0; max-width: 440px; width: calc(100% - 32px); box-shadow: 0 20px 50px rgba(23, 34, 48, .3); color: var(--ink); }
dialog::backdrop { background: rgba(23, 34, 48, .5); }
dialog .dlg { padding: 22px; }
dialog h2 { margin-bottom: 8px; }
dialog .actions { justify-content: flex-end; margin-top: 20px; }

footer.foot { max-width: 1120px; margin: 0 auto; padding: 0 24px 32px; color: var(--muted); font-size: 12.5px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
footer.foot a { color: var(--muted); }

@media (max-width: 560px) { main { padding: 24px 16px 48px; } .topbar-inner { padding: 0 16px; gap: 8px; } .card { padding: 18px 16px; } .table-wrap { margin: 0 -16px; padding: 0 16px; } h1 { font-size: 22px; } }
main > * + * { margin-top: 20px; }
main > .page-head + * { margin-top: 0; }
#attention:empty, #notice:empty { display: none; }
#look-out:not(:empty) { margin-top: 20px; }
td { white-space: normal; }
.tv > .msg, .pending-tv > .msg { grid-column: 1 / -1; margin-top: -8px; }
.msg:empty { display: none; }
.card > details.help:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.btn-link { font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.warn-text { color: var(--warn-ink); font-weight: 600; }
.tv .pill + .pill { margin-left: 6px; }

/* Brands */
select { font: inherit; font-size: 15px; padding: 9px 34px 9px 12px; border: 1px solid #c6d0da; border-radius: 8px; background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23131A2D' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center; color: var(--ink); appearance: none; min-width: 0; max-width: 100%; }
select:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
.brand-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; font-size: 12.5px; font-weight: 600; color: var(--navy); background: var(--white); white-space: nowrap; }
.brand-chip::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--navy); }
.brand-chip[data-kind="hotel"]::before { background: transparent; border: 2px solid var(--navy); width: 6px; height: 6px; border-radius: 50%; }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filter-bar label.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.chk { width: 36px; }
.chk input { width: 18px; height: 18px; accent-color: var(--navy); }
.brand-cell { white-space: nowrap; }
.brand-cell select { font-size: 13.5px; padding: 6px 30px 6px 10px; margin-right: 6px; max-width: 220px; }
.bulk { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--mist); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.bulk #bulk-n { font-weight: 700; color: var(--navy); }
.bulk select { font-size: 14px; padding: 7px 30px 7px 10px; }
.bulk .msg { margin: 0; flex-basis: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

input.zip { width: 92px; font-size: 13.5px; padding: 6px 10px; font-variant-numeric: tabular-nums; }
input.zip::placeholder { color: var(--muted); }

.props-grid { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .props-grid { grid-template-columns: 1fr; } }
.props-grid > * { min-width: 0; }
.brand-cell .needs { margin-top: 6px; }
.brand-cell select { margin-right: 0; }
td.ids { white-space: nowrap; font-size: 13px; line-height: 1.6; }
td.ids .t-sub { display: inline; color: var(--muted); font-size: 12px; }
.brand-cell select { max-width: 190px; }
.props-grid td:nth-child(2) { min-width: 150px; }

/* Simple TV app updates (App updates page) */
.stv-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin: 18px 0; }
@media (max-width: 860px) { .stv-cols { grid-template-columns: 1fr; } }
.stv-col h3 { font-size: 15px; color: var(--navy); margin: 0 0 6px; }
.stv-col h3 ~ h3 { margin-top: 20px; }
.stv-col .field { margin-top: 12px; }
.stv-col fieldset.field { border: 0; padding: 0; }
.stv-col legend { font-weight: 600; font-size: 13px; color: var(--navy); margin-bottom: 4px; }
.radio { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 4px 0; }
.stv-upload { margin: 10px 0 4px; }
.stv-upload input[type="file"] { font: inherit; font-size: 14px; max-width: 100%; }
.stv-tvpick { max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-top: 6px; }
.stv-rel { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.stv-rel:first-child { border-top: 0; }
#stv-queue .notice { margin-bottom: 4px; }
#stv-form .actions { margin-top: 14px; }
/* Owner PIN (dashboard 0.7.0) */
.owner-pin { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.owner-pin h3 { margin: 0 0 4px; font-size: 15px; }
.owner-pin .t-sub { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.owner-pin .row-gap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.owner-pin .msg:empty { display: none; }
.props-grid td:nth-child(3) select { max-width: 150px; }
.props-grid td:nth-child(2) { min-width: 120px; }

/* Streaming apps (0.8.0) */
.sa-list { border: 1px solid var(--line); border-radius: 8px; margin: 10px 0 12px; }
.sa-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 14px; }
.sa-row:first-child { border-top: 0; }
.sa-row .sa-name { flex: 1; min-width: 0; }
.sa-row .sa-name .t-sub { overflow-wrap: anywhere; }
.sa-row .sa-move { display: flex; gap: 4px; }
.sa-row .sa-move .btn { padding: 2px 8px; }
.sa-add { display: grid; gap: 10px; }
.sa-add input { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.sa-cell-actions { white-space: nowrap; }
#sa-notice .notice { margin-bottom: 10px; }
.trace { white-space: pre-wrap; font-size: 11.5px; max-height: 240px; overflow: auto; background: var(--mist); padding: 8px; border-radius: 6px; margin-top: 6px; }

/* Signed-in user, customer switcher (0.9.0) */
.ctxbar { background: var(--navy-2, #1f2b3a); border-top: 1px solid rgba(255, 255, 255, .08); }
.ctxbar-inner { max-width: 1120px; margin: 0 auto; padding: 6px 24px; }
.who { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ctx-tenant { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ctx-label { color: rgba(255, 255, 255, .62); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.tenant-name { color: var(--white); font-size: 14px; font-weight: 700; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tenant-switch { font-size: 13px; padding: 5px 30px 5px 10px; max-width: 260px; }
.user-menu { position: relative; }
.user-menu summary { list-style: none; cursor: pointer; color: var(--white); font-weight: 700; font-size: 13px; padding: 7px 12px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .28); }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu[open] summary { background: var(--navy-3); }
.user-pop { position: absolute; right: 0; top: calc(100% + 6px); background: var(--white); color: var(--ink); border-radius: 10px; box-shadow: 0 8px 28px rgba(23, 34, 48, .22); padding: 14px 16px; min-width: 240px; z-index: 20; display: flex; flex-direction: column; gap: 8px; }
.user-pop p { overflow-wrap: anywhere; }
.viewing { background: var(--info-bg); color: var(--info-ink); border: 1px solid #c3d1fb; border-radius: var(--radius); padding: 10px 16px; font-size: 14px; }
input[type="email"], input[type="password"], input[type="url"], input[type="time"], input[type="number"] { font: inherit; font-size: 15px; padding: 9px 12px; border: 1px solid #c6d0da; border-radius: 8px; background: var(--white); color: var(--ink); min-width: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.once { background: var(--mist); border: 1px dashed #b5c1cd; border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.once code { background: var(--white); padding: 8px 10px; font-size: 14px; overflow-wrap: anywhere; user-select: all; }
.hint-text { color: var(--muted); font-size: 13px; }
.cal-row { display: grid; grid-template-columns: 110px minmax(140px, 1fr) 90px minmax(200px, 2fr) auto auto; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.cal-row:first-child { border-top: 0; }
@media (max-width: 900px) { .cal-row { grid-template-columns: 1fr 1fr; } }
.cal-row input { width: 100%; }
.cal-row label.inline { display: flex; gap: 6px; align-items: center; font-size: 13px; white-space: nowrap; }
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
.type-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.type-pick label { border: 1px solid #c6d0da; border-radius: 10px; padding: 10px 12px; display: flex; gap: 8px; align-items: center; cursor: pointer; font-weight: 600; font-size: 14px; }
.type-pick label:has(input:checked) { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); background: #f6f8fa; }

/* Sign-in page */
body.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--navy); padding: 24px; }
.auth-card { background: var(--white); border-radius: 16px; padding: 32px 30px; width: 100%; max-width: 420px; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); }
.auth-card .mark { height: 40px; display: block; margin-bottom: 18px; }
.auth-card h1 { font-size: 22px; margin-bottom: 6px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.auth-card .btn { width: 100%; padding: 11px 16px; }
.auth-card .foot-links { margin-top: 18px; font-size: 12.5px; color: var(--muted); }
.auth-card .foot-links a { color: var(--muted); }
#sa-add, [data-perm="apps.manage"] > h3 { margin-top: 16px; }

.diag{margin-top:10px}
.diag pre{white-space:pre-wrap;word-break:break-word;font-size:12px;background:#f4f6f8;border-radius:8px;padding:10px;max-height:320px;overflow:auto}
.danger-zone { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px 16px; border: 1px solid #e7b9cf; border-radius: 10px; background: var(--bad-bg); }
.danger-zone p { margin: 0; color: var(--bad-ink); }
.danger-zone .actions { display: flex; gap: 8px; justify-content: flex-end; }
