/* SurePage by GazelleTel - management interface */
:root {
  --ink: #16222e;
  --ink-2: #51606f;
  --ink-3: #8593a1;
  --line: #dde3e9;
  --bg: #f3f5f7;
  --card: #ffffff;
  --navy: #0e2233;
  --navy-2: #173449;
  --mint: #1fbf9c;
  --mint-ink: #0b7a63;
  --online: #1a9a56;
  --busy: #d9a200;
  --offline: #d23c3c;
  --never: #8a94a3;
  --radius: 8px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body {
  margin: 0; color: var(--ink); background: var(--bg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.45;
}
a { color: #0b6f8f; text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 1rem; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 1.02rem; margin: 0 0 .7rem; font-weight: 650; }
[hidden] { display: none !important; }

header.top {
  background: var(--navy); color: #fff; display: flex; align-items: center; gap: 1.1rem;
  padding: 0 1.25rem; min-height: 54px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: .6rem; color: #fff; }
.brand:hover { text-decoration: none; }
.mark {
  width: 32px; height: 32px; border-radius: 7px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--mint), #1487a8); font-weight: 800; font-size: .82rem; letter-spacing: .02em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text b { font-size: 1.02rem; }
.brand-text small { color: var(--mint); font-size: .66rem; letter-spacing: .09em; text-transform: uppercase; }
.site { color: #a9bccb; border-left: 1px solid #2c4a60; padding-left: 1rem; font-size: .9rem; }
nav.main { display: flex; gap: .15rem; flex: 1; flex-wrap: wrap; }
nav.main a { color: #c5d3de; padding: .95rem .7rem; font-size: .92rem; border-bottom: 3px solid transparent; }
nav.main a:hover { color: #fff; text-decoration: none; }
nav.main a.on { color: #fff; border-bottom-color: var(--mint); }
.count { background: var(--busy); color: #201800; border-radius: 9px; padding: 0 .4rem; font-size: .72rem; font-weight: 700; }
.who { display: flex; align-items: center; gap: .6rem; font-size: .86rem; color: #c5d3de; }
.who a { color: #fff; }
.who form { margin: 0; }
.role { background: var(--navy-2); border-radius: 4px; padding: .05rem .4rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
button.link { background: none; border: 0; color: #c5d3de; cursor: pointer; font: inherit; padding: 0; }
button.link:hover { color: #fff; text-decoration: underline; }

main { max-width: 1180px; margin: 1.5rem auto 2rem; padding: 0 1.25rem; }
/* Sign-in and invitation pages: one narrow column in the middle of the window */
body.signed-out main { max-width: 28rem; margin-top: 3rem; }
body.signed-out .card.narrow { max-width: none; }
footer { text-align: center; color: var(--ink-3); font-size: .8rem; padding: 1rem 0 2rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-bottom: 1.1rem; }
.card.narrow { max-width: 26rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .6rem; }
.card-head h2 { margin: 0; }
.lead { color: var(--ink-2); margin: -.4rem 0 1rem; max-width: 60rem; }
.hint { color: var(--ink-3); font-size: .85rem; }
.empty { color: var(--ink-3); margin: .4rem 0; }
.mono, code, pre { font-family: var(--mono); font-size: .86rem; }
code { background: #eef1f4; border-radius: 4px; padding: .05rem .3rem; white-space: nowrap; }
pre { background: #f4f6f8; border: 1px solid var(--line); border-radius: 6px; padding: .7rem .8rem; overflow-x: auto; margin: .5rem 0; }

.toolbar { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; flex-wrap: wrap; }
.grow { flex: 1; }
.inline { display: inline; margin: 0; }

.btn {
  display: inline-block; border: 1px solid #c3ccd5; background: #fff; color: var(--ink); border-radius: 6px;
  padding: .45rem .85rem; font: inherit; font-size: .9rem; font-weight: 550; cursor: pointer; line-height: 1.2;
}
.btn:hover { background: #f1f4f7; text-decoration: none; }
.btn.primary { background: var(--mint-ink); border-color: var(--mint-ink); color: #fff; }
.btn.primary:hover { background: #096652; }
.btn.danger { color: #a82424; border-color: #e3b5b5; }
.btn.danger:hover { background: #fdf1f1; }
.btn.small { padding: .22rem .55rem; font-size: .8rem; }
:focus-visible { outline: 2px solid #1487a8; outline-offset: 2px; }

.flash { border-radius: 6px; padding: .65rem .9rem; margin-bottom: 1rem; border: 1px solid; }
.flash ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.flash.ok { background: #eaf7f0; border-color: #a9dcc0; color: #12583a; }
.flash.info { background: #eaf3f9; border-color: #b4d2e6; color: #1b4b68; }
.flash.warn { background: #fdf6e2; border-color: #ecd58c; color: #6b5200; }
.flash.error { background: #fdeeee; border-color: #eab5b5; color: #8a1f1f; }

table.grid { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.grid th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; padding: .45rem .6rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.grid td { padding: .5rem .6rem; border-bottom: 1px solid #edf0f3; vertical-align: middle; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid tbody tr:hover { background: #f8fafb; }
td.right { text-align: right; white-space: nowrap; }
td.warn { color: #9a5b00; font-weight: 600; }
.card > table.grid, .card > .scroll { margin: 0 -.2rem; }
@media (max-width: 800px) { .card { overflow-x: auto; } }

.badge { display: inline-block; border-radius: 999px; padding: .12rem .6rem; font-size: .78rem; font-weight: 650; color: #fff; white-space: nowrap; }
.st-online { background: var(--online); }
.st-busy { background: var(--busy); color: #231a00; }
.st-offline { background: var(--offline); }
.st-never { background: var(--never); }
.st-disabled { background: #e5e9ed; color: var(--ink-2); }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: .9rem; margin-bottom: 1.1rem; }
.tile { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--never); border-radius: var(--radius); padding: .8rem 1rem; display: flex; flex-direction: column; }
.tile b { font-size: 1.9rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile span { color: var(--ink-2); font-size: .86rem; }
.tile.st-online, .tile.st-busy, .tile.st-offline, .tile.st-never { background: var(--card); color: var(--ink); }
.tile.st-online { border-left-color: var(--online); }
.tile.st-busy { border-left-color: var(--busy); }
.tile.st-offline { border-left-color: var(--offline); }
@media (max-width: 700px) { .tiles { grid-template-columns: repeat(2, 1fr); } }

form.stack > * + * { margin-top: .9rem; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset > * + * { margin-top: .9rem; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: .9rem 1.2rem; }
.field { display: flex; flex-direction: column; gap: .25rem; }
.lbl { font-weight: 600; font-size: .88rem; }
input, select, textarea {
  font: inherit; color: var(--ink); border: 1px solid #c3ccd5; border-radius: 6px; padding: .42rem .6rem; background: #fff; max-width: 100%;
}
input:disabled, select:disabled { background: #f1f4f7; color: var(--ink-3); }
textarea { width: 100%; resize: vertical; }
input[type=search] { min-width: 15rem; }
input[type=checkbox], input[type=radio] { width: auto; }
.checks { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; align-items: center; }
.check { display: inline-flex; align-items: center; gap: .4rem; }
.check small { color: var(--ink-3); }
.actions { display: flex; gap: .5rem; }
.member-tools { display: flex; align-items: center; gap: .6rem; font-size: .88rem; }
.members { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .25rem 1rem; max-height: 22rem; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; padding: .6rem .8rem; }

dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.2rem; margin: .4rem 0; }
dl.kv dt { color: var(--ink-2); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ---- Status views: tabs, board, floorplan ---- */
.views { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 1.1rem; }
.tabs { display: flex; gap: .2rem; flex-wrap: wrap; }
.tabs a { padding: .5rem .9rem; color: var(--ink-2); font-weight: 600; font-size: .92rem; border-bottom: 3px solid transparent; margin-bottom: -1px; border-radius: 6px 6px 0 0; }
.tabs a:hover { color: var(--ink); background: #e9edf1; text-decoration: none; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--mint-ink); }
.tabs a.add { color: var(--ink-3); font-weight: 500; }
.view-tools { display: flex; align-items: center; gap: .5rem; padding-bottom: .45rem; flex-wrap: wrap; }
.small-check { font-size: .86rem; color: var(--ink-2); }
.nowrap { white-space: nowrap; }
img.thumb { height: 44px; max-width: 90px; object-fit: cover; border: 1px solid var(--line); border-radius: 4px; display: block; background: #fff; }
form.rename input { width: 15rem; }

.dot { display: inline-grid; place-items: center; width: .85rem; height: .85rem; border-radius: 50%; margin-right: .35rem; vertical-align: -.1rem; color: #fff; font-style: normal; font-size: .62rem; font-weight: 800; line-height: 1; }

.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: .9rem; align-items: start; }
.col { background: #e9edf1; border-radius: var(--radius); padding: .55rem; min-width: 0; }
.col header { display: flex; align-items: center; gap: .4rem; padding: .15rem .25rem .5rem; flex-wrap: wrap; }
.col-name, .col-title { font-weight: 650; font-size: .95rem; flex: 1; min-width: 0; }
input.col-name { border-color: transparent; background: transparent; padding: .1rem .2rem; color: var(--ink); }
input.col-name:disabled { background: transparent; color: var(--ink); opacity: 1; -webkit-text-fill-color: var(--ink); }
.col-sum { color: var(--ink-2); font-size: .8rem; white-space: nowrap; }
.col-sum b { font-weight: 650; margin-left: .35rem; }
.sum-off { color: #b02a2a; }
.sum-busy { color: #8a6500; }
.col-tools { display: none; gap: .2rem; width: 100%; justify-content: flex-end; }
.col-body { display: flex; flex-direction: column; gap: .4rem; min-height: 2.2rem; }
.col-fixed { background: transparent; border: 1px dashed #c3ccd5; }
.ep { display: grid; grid-template-columns: 1fr auto; gap: 0 .5rem; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-left: 5px solid var(--never); border-radius: 6px; padding: .4rem .6rem; }
.ep:hover { text-decoration: none; border-color: #b9c3cd; border-left-color: inherit; }
.ep-name { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-sub { grid-column: 1 / -1; color: var(--ink-3); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-state { grid-row: 1; grid-column: 2; font-size: .72rem; font-weight: 650; color: var(--ink-2); white-space: nowrap; align-self: center; }
.ep.st-online, .ep.st-busy, .ep.st-offline, .ep.st-never, .ep.st-disabled { background: var(--card); color: var(--ink); }
.ep.st-online { border-left-color: var(--online); }
.ep.st-online .ep-state { color: #13733f; }
.ep.st-busy { border-left-color: var(--busy); background: #fff8df; }
.ep.st-busy .ep-state { color: #8a6500; }
.ep.st-offline { border-left-color: var(--offline); background: #fdeeee; }
.ep.st-offline .ep-state { color: #b02a2a; }
.ep.st-never { border-left-color: var(--never); }
.ep.st-disabled { border-left-color: #cfd6dd; opacity: .7; }
.board.editing .col-tools { display: flex; }
.board.editing input.col-name { background: #fff; border-color: #c3ccd5; }
.board.editing .ep { cursor: grab; }
.ep.dragging { opacity: .35; }

.plan-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; }
.plan-wrap.editing { grid-template-columns: minmax(0, 1fr) 250px; }
.plan-card { padding: .7rem; margin-bottom: 0; }
.plan { position: relative; line-height: 0; user-select: none; -webkit-user-select: none; }
.plan img { width: 100%; height: auto; display: block; border-radius: 4px; }
.pin { position: absolute; transform: translate(-50%, -50%); display: block; line-height: 1.2; color: var(--ink); z-index: 1; background: none; }
.pin:hover, .pin:focus-visible { z-index: 5; text-decoration: none; }
.pin.st-online, .pin.st-busy, .pin.st-offline, .pin.st-never, .pin.st-disabled { background: none; color: var(--ink); }
.pin-dot { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(14, 34, 51, .35), 0 2px 5px rgba(14, 34, 51, .35); background: var(--never); color: #fff; font-style: normal; font-weight: 800; font-size: 11px; line-height: 1; }
.pin.st-online .pin-dot { background: var(--online); }
.pin.st-busy .pin-dot { background: var(--busy); animation: sp-pulse 1.4s ease-out infinite; }
.pin.st-offline .pin-dot { background: var(--offline); width: 24px; height: 24px; font-size: 13px; }
.pin.st-disabled .pin-dot { background: #cfd6dd; }
.dot.st-online { background: var(--online); }
.dot.st-busy { background: var(--busy); }
.dot.st-offline { background: var(--offline); }
.dot.st-never, .dot.st-disabled { background: var(--never); }
@keyframes sp-pulse { 0% { box-shadow: 0 0 0 1px rgba(14, 34, 51, .35), 0 0 0 0 rgba(217, 162, 0, .65); } 100% { box-shadow: 0 0 0 1px rgba(14, 34, 51, .35), 0 0 0 14px rgba(217, 162, 0, 0); } }
@media (prefers-reduced-motion: reduce) { .pin.st-busy .pin-dot { animation: none; box-shadow: 0 0 0 1px rgba(14, 34, 51, .35), 0 0 0 5px rgba(217, 162, 0, .4); } }
.pin-name { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 2px; white-space: nowrap; font-size: 11px; font-weight: 600; background: rgba(255, 255, 255, .92); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; pointer-events: none; }
.pin.st-offline .pin-name { border-color: #e3a3a3; color: #8a1f1f; }
.pin.st-busy .pin-name { border-color: #e2c766; }
.plan.no-names .pin-name { display: none; }
.pin-tip { display: none; position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; border-radius: 6px; padding: .45rem .65rem; font-size: 12px; white-space: nowrap; box-shadow: 0 4px 14px rgba(14, 34, 51, .3); pointer-events: none; }
.pin-tip b, .pin-tip span { display: block; }
.pin-tip span { color: #c5d3de; margin-top: 2px; }
.pin:hover .pin-tip, .pin:focus-visible .pin-tip { display: block; }
.pin.flip .pin-tip { left: auto; right: -10px; transform: none; }
.pin.low .pin-tip { bottom: auto; top: calc(100% + 22px); }
.legend { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; align-items: center; padding: .6rem .3rem .1rem; font-size: .84rem; color: var(--ink-2); line-height: 1.4; }
.plan-wrap.editing .pin { cursor: grab; touch-action: none; }
.plan-wrap.editing .pin-tip { display: none !important; }
.plan-wrap.editing .plan img { outline: 2px dashed #1487a8; outline-offset: 2px; }
.pin.dragging { cursor: grabbing; z-index: 9; }
.pin.leaving { opacity: .4; }
.tray { position: sticky; top: 1rem; margin-bottom: 0; padding: .9rem; }
.tray input { width: 100%; min-width: 0; margin-bottom: .5rem; }
.tray-list { display: flex; flex-direction: column; gap: .3rem; max-height: 60vh; overflow-y: auto; margin-bottom: .6rem; }
.tray-item { display: flex; align-items: center; gap: .2rem; border: 1px solid var(--line); border-radius: 6px; padding: .3rem .5rem; cursor: grab; background: #fff; touch-action: none; user-select: none; -webkit-user-select: none; }
.tray-item:hover { border-color: #1487a8; }
.tray-item b { display: block; font-size: .86rem; font-weight: 600; }
.tray-item small { display: block; color: var(--ink-3); font-size: .74rem; }
@media (max-width: 800px) { .plan-wrap.editing { grid-template-columns: minmax(0, 1fr); } .tray { position: static; } }

/* ---- Bells ---- */
tr.dim td { color: var(--ink-3); }
tr.dim td b { font-weight: 500; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .7rem; }
.week select { width: 100%; }
@media (max-width: 900px) { .week { grid-template-columns: repeat(2, 1fr); } }
audio { height: 32px; max-width: 260px; vertical-align: middle; }
.card-head .hint { font-weight: 400; }

/* ---- Setup menu ---- */
details.menu { position: relative; }
details.menu summary { list-style: none; cursor: pointer; color: #c5d3de; padding: .95rem .7rem; font-size: .92rem; border-bottom: 3px solid transparent; user-select: none; }
details.menu summary::-webkit-details-marker { display: none; }
details.menu summary::after { content: " \25BE"; font-size: .75rem; }
details.menu summary:hover, details.menu[open] summary { color: #fff; }
details.menu.on summary { color: #fff; border-bottom-color: var(--mint); }
.menu-items { position: absolute; right: 0; top: 100%; z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: 0 0 8px 8px; box-shadow: 0 8px 24px rgba(14, 34, 51, .18); min-width: 15rem; padding: .3rem 0; }
.menu-items a { display: block; padding: .5rem 1rem; color: var(--ink) !important; border: 0 !important; font-size: .92rem; }
.menu-items a:hover { background: #f1f4f7; text-decoration: none; }
.menu-items a.on { font-weight: 650; background: #eef7f4; }

/* ---- Emergency ---- */
.emg-banner { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .7rem 1.25rem; color: #fff; background: #b3261e; font-size: 1rem; }
.emg-banner b { font-size: 1.1rem; letter-spacing: .04em; }
.emg-banner form { margin: 0; }
.emg-red { background: #b3261e; } .emg-amber { background: #b06a00; } .emg-blue { background: #1c5fa8; } .emg-green { background: #1c7a43; } .emg-purple { background: #6b3fa0; }
.dot.emg-red, .dot.emg-amber, .dot.emg-blue, .dot.emg-green, .dot.emg-purple { width: .8rem; height: .8rem; }
.emg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .9rem; }
.emg-grid form { margin: 0; }
.emg-btn { position: relative; overflow: hidden; width: 100%; min-height: 6.2rem; border: 0; border-radius: 10px; color: #fff; cursor: pointer; font: inherit; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: .2rem; padding: .9rem 1.1rem; text-align: left; touch-action: none; user-select: none; -webkit-user-select: none; }
.emg-btn b { font-size: 1.25rem; letter-spacing: .02em; position: relative; z-index: 1; }
.emg-btn small { opacity: .9; position: relative; z-index: 1; }
.emg-btn i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(255, 255, 255, .3); }
.emg-btn.holding i { width: 100%; transition: width var(--hold, 2s) linear; }
.slider { display: flex; align-items: center; gap: .6rem; }
.slider input { flex: 1; padding: 0; }
.slider output { min-width: 2.2rem; font-variant-numeric: tabular-nums; font-weight: 600; }
pre.plain { background: none; border: 0; padding: .4rem 0 0; white-space: pre-wrap; font-family: inherit; }
details summary { cursor: pointer; }
.lic-banner { padding: .55rem 1.25rem; font-size: .92rem; border-bottom: 1px solid; }
.lic-banner.warn { background: #fdf6e2; border-color: #ecd58c; color: #6b5200; }
.lic-banner.bad { background: #fdeeee; border-color: #eab5b5; color: #8a1f1f; }

/* Wall display: one status view, full screen, nothing to click */
body.wall main { max-width: none; padding: 1rem 1.5rem 2rem; }
body.wall h1, body.wall .views, body.wall footer, body.wall .view-tools { display: none; }
body.wall .top .clock { margin-left: auto; color: #fff; font-size: 1.35rem; font-weight: 600; font-variant-numeric: tabular-nums; }
body.wall .top .brand { pointer-events: none; }
body.wall a { pointer-events: none; }
