/* nh-stream console — 1772 Strategies
   Navy #093D65 / Orange #F98E54.
   Dark control-room surface: this is read at a glance while an event is live,
   often on a laptop next to a camera, so contrast and state legibility beat
   decoration. Sharp edges throughout, no shadows, no pills. */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700;800&family=Source+Sans+3:wght@400;600;700&display=swap');

:root {
    --navy:        #093D65;
    --navy-lift:   #0E4F80;
    --orange:      #F98E54;
    --orange-dim:  #C46F41;

    --bg:          #060E15;
    --panel:       #0B1822;
    --panel-lift:  #102434;
    --line:        #1B3348;
    --line-soft:   #142639;

    --ink:         #E8F0F6;
    --ink-mid:     #93A9BC;
    --ink-dim:     #5E7488;

    --live:        #F04438;
    --ok:          #17B26A;
    --warn:        #F79009;
    --idle:        #475D71;

    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* The [hidden] attribute is only `display: none` in the UA stylesheet, so any
   author rule that sets display beats it. `.gate` sets display:flex, which
   meant gate.hidden = true did nothing and the login card stayed on screen
   covering the console after a successful sign-in. Needs !important to also
   win over the element-level display rules below. */
[hidden] { display: none !important; }

body {
    background: var(--bg);
    color: var(--ink);
    font-family: "Source Sans 3", system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .display {
    font-family: Montserrat, system-ui, sans-serif;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.15;
}

a { color: var(--orange); text-decoration: none; }
a:hover { text-decoration: underline; }

.mono { font-family: var(--mono); font-size: 13px; }

/* ---------- masthead ---------- */

.masthead {
    background: var(--navy);
    border-bottom: 3px solid var(--orange);
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 24px;
    height: 62px;
    position: sticky;
    top: 0;
    z-index: 40;
}

.brand {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.brand .num {
    font-family: Montserrat, sans-serif;
    font-weight: 800;
    font-size: 21px;
    letter-spacing: 0.02em;
    color: #fff;
}

.brand .div {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, .28);
    align-self: center;
}

.brand .app {
    font-family: Montserrat, sans-serif;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--orange);
}

.masthead .spacer { flex: 1; }

.masthead .host {
    font-family: var(--mono);
    font-size: 12px;
    color: rgba(255, 255, 255, .55);
}

/* ---------- layout ---------- */

.shell {
    display: grid;
    grid-template-columns: 288px 1fr;
    min-height: calc(100vh - 62px);
}

.rail {
    background: var(--panel);
    border-right: 1px solid var(--line);
    padding: 20px 0 40px;
}

.rail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px 12px;
}

.rail-head h2 {
    font-size: 11px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--ink-dim);
    font-weight: 700;
}

.main { padding: 26px 30px 80px; max-width: 1180px; }

/* ---------- event list ---------- */

.evt {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    border-left: 3px solid transparent;
    padding: 11px 16px 11px 15px;
    cursor: pointer;
    color: var(--ink-mid);
    font-family: inherit;
    font-size: 14px;
    transition: background .12s, border-color .12s, color .12s;
}

.evt:hover { background: var(--panel-lift); color: var(--ink); }

.evt.on {
    background: var(--panel-lift);
    border-left-color: var(--orange);
    color: var(--ink);
}

.evt .nm { font-weight: 600; display: block; }

.evt .sub {
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--ink-dim);
    display: block;
    margin-top: 1px;
}

.evt.arch .nm { color: var(--ink-dim); }

/* ---------- panels ---------- */

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-left: 3px solid var(--line);
    margin-bottom: 20px;
    transition: border-left-color .15s;
}

.panel:hover { border-left-color: var(--navy-lift); }
.panel.accent { border-left-color: var(--orange); }

.panel-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line-soft);
}

.panel-head h3 {
    font-size: 12px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ink-mid);
    font-weight: 700;
}

.panel-head .spacer { flex: 1; }
.panel-body { padding: 18px; }
.panel-body.flush { padding: 0; }

/* ---------- event header ---------- */

.evt-title {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.evt-title h1 { font-size: 30px; }

.evt-meta {
    color: var(--ink-dim);
    font-family: var(--mono);
    font-size: 12.5px;
    margin-bottom: 22px;
}

/* ---------- status chips ---------- */

.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: Montserrat, sans-serif;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    padding: 5px 10px;
    border: 1px solid;
    white-space: nowrap;
}

.chip .dot { width: 7px; height: 7px; flex: none; }

.chip.live   { color: #FF8079; border-color: #6B2723; background: #24100F; }
.chip.live .dot   { background: var(--live); animation: pulse 1.6s infinite; }
.chip.ok     { color: #4ADE9A; border-color: #14503A; background: #08201A; }
.chip.ok .dot     { background: var(--ok); }
.chip.warn   { color: #FBBF5E; border-color: #5C4116; background: #1F1708; }
.chip.warn .dot   { background: var(--warn); animation: pulse 1.2s infinite; }
.chip.fail   { color: #FF8079; border-color: #6B2723; background: #24100F; }
.chip.fail .dot   { background: var(--live); }
.chip.idle   { color: var(--ink-dim); border-color: var(--line); background: transparent; }
.chip.idle .dot   { background: var(--idle); }

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

/* ---------- buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: Montserrat, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    padding: 9px 15px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink-mid);
    cursor: pointer;
    transition: all .13s;
    white-space: nowrap;
}

.btn:hover {
    border-color: var(--navy-lift);
    color: var(--ink);
    background: var(--panel-lift);
}

.btn.primary {
    background: var(--orange);
    border-color: var(--orange);
    color: #1A0E06;
}

.btn.primary:hover { background: #FFA470; border-color: #FFA470; }

.btn.solid {
    background: var(--navy);
    border-color: var(--navy-lift);
    color: #fff;
}

.btn.solid:hover { background: var(--navy-lift); }

.btn.danger:hover {
    border-color: #6B2723;
    color: #FF8079;
    background: #1A0B0A;
}

.btn.sm { padding: 6px 11px; font-size: 10px; }
.btn:disabled { opacity: .38; cursor: not-allowed; }
.btn svg { width: 13px; height: 13px; flex: none; }

/* ---------- ingest strings ---------- */

.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }

.field label {
    display: block;
    font-family: Montserrat, sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--ink-dim);
    margin-bottom: 6px;
}

.copyline {
    display: flex;
    border: 1px solid var(--line);
    background: var(--bg);
}

.copyline code {
    flex: 1;
    font-family: var(--mono);
    font-size: 12.5px;
    color: var(--ink);
    padding: 9px 12px;
    overflow-x: auto;
    white-space: nowrap;
    user-select: all;
}

.copyline button {
    border: 0;
    border-left: 1px solid var(--line);
    background: var(--panel-lift);
    color: var(--ink-mid);
    padding: 0 13px;
    cursor: pointer;
    font-family: Montserrat, sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    transition: all .13s;
}

.copyline button:hover { background: var(--navy); color: #fff; }
.copyline button.done { background: var(--ok); color: #04150E; }

.masked { color: var(--ink-dim); }

/* ---------- destination rows ---------- */

.dest {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 15px 18px;
    border-bottom: 1px solid var(--line-soft);
    border-left: 3px solid transparent;
    transition: border-left-color .15s, background .15s;
}

.dest:last-child { border-bottom: 0; }
.dest:hover { background: var(--panel-lift); }
.dest.on   { border-left-color: var(--ok); }
.dest.bad  { border-left-color: var(--live); }
.dest.off  { opacity: .55; }

.dest-id {
    display: flex;
    align-items: center;
    gap: 11px;
    flex-wrap: wrap;
    margin-bottom: 5px;
}

.dest-id .nm { font-weight: 700; font-size: 15.5px; }

.plat {
    font-family: Montserrat, sans-serif;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: var(--ink-dim);
    border: 1px solid var(--line);
    padding: 2px 7px;
}

.dest-sub {
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--ink-dim);
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.dest-actions { display: flex; gap: 7px; align-items: center; }

/* ---------- forms ---------- */

input[type=text], input[type=password], input[type=number], select {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--line);
    color: var(--ink);
    font-family: "Source Sans 3", sans-serif;
    font-size: 14.5px;
    padding: 9px 11px;
    border-radius: 0;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--orange);
}

input.mono-in { font-family: var(--mono); font-size: 13px; }

select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--ink-dim) 50%),
                      linear-gradient(135deg, var(--ink-dim) 50%, transparent 50%);
    background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 32px;
}

.row { display: grid; gap: 13px; }
.row.two { grid-template-columns: 1fr 1fr; }
.row.three { grid-template-columns: 1fr 1fr 1fr; }

.check {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    font-size: 14px;
    color: var(--ink-mid);
}

.check input { width: 15px; height: 15px; accent-color: var(--orange); }

.hint {
    font-size: 12.5px;
    color: var(--ink-dim);
    margin-top: 6px;
    line-height: 1.5;
}

/* ---------- tables ---------- */

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

th {
    text-align: left;
    font-family: Montserrat, sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: var(--ink-dim);
    padding: 10px 18px;
    border-bottom: 1px solid var(--line);
}

td {
    padding: 11px 18px;
    border-bottom: 1px solid var(--line-soft);
    font-size: 14px;
}

tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--panel-lift); }

/* ---------- login ---------- */

.gate {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.gate-box {
    width: 100%;
    max-width: 390px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-top: 3px solid var(--orange);
    padding: 34px;
}

.gate-box h1 { font-size: 22px; margin-bottom: 6px; }

.gate-box p {
    color: var(--ink-dim);
    font-size: 13.5px;
    margin-bottom: 22px;
}

/* ---------- misc ---------- */

/* Mode banner. Deliberately loud in both states — the entire value of
   rehearsal mode is that you can never be unsure which one you are in. */
.mode {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 13px 17px;
    margin-bottom: 20px;
    border-left: 4px solid;
    font-size: 14.5px;
}

.mode .lbl {
    font-family: Montserrat, sans-serif;
    font-weight: 800;
    font-size: 11px;
    letter-spacing: .16em;
    text-transform: uppercase;
    white-space: nowrap;
}

.mode .txt { color: var(--ink-mid); }
.mode .spacer { flex: 1; }

.mode.rehearsing {
    border-left-color: var(--warn);
    background: #1C1508;
}

.mode.rehearsing .lbl { color: #FBBF5E; }

.mode.armed {
    border-left-color: var(--live);
    background: #1E0D0C;
}

.mode.armed .lbl { color: #FF8079; }

.empty {
    padding: 38px 18px;
    text-align: center;
    color: var(--ink-dim);
    font-size: 14px;
}

.err {
    border-left: 3px solid var(--live);
    background: #1A0B0A;
    color: #FF9A94;
    padding: 11px 14px;
    font-size: 13.5px;
    margin-bottom: 15px;
}

.logbox {
    font-family: var(--mono);
    font-size: 11.5px;
    line-height: 1.65;
    background: var(--bg);
    border: 1px solid var(--line);
    color: var(--ink-mid);
    padding: 13px;
    max-height: 280px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.modal-bg {
    position: fixed;
    inset: 0;
    background: rgba(3, 8, 12, .82);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 60px 20px;
    z-index: 60;
    overflow-y: auto;
}

.modal {
    width: 100%;
    max-width: 560px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-top: 3px solid var(--orange);
}

.modal-head {
    padding: 17px 20px;
    border-bottom: 1px solid var(--line-soft);
    display: flex;
    align-items: center;
}

.modal-head h3 { font-size: 15px; letter-spacing: 0; text-transform: none; }
.modal-body { padding: 20px; }

.modal-foot {
    padding: 15px 20px;
    border-top: 1px solid var(--line-soft);
    display: flex;
    gap: 9px;
    justify-content: flex-end;
}

.icon-btn {
    background: none;
    border: 0;
    color: var(--ink-dim);
    cursor: pointer;
    padding: 4px;
    display: flex;
}

.icon-btn:hover { color: var(--ink); }
.icon-btn svg { width: 16px; height: 16px; }

@media (max-width: 900px) {
    .shell { grid-template-columns: 1fr; }
    .rail { border-right: 0; border-bottom: 1px solid var(--line); }
    .main { padding: 20px 16px 60px; }
    .row.two, .row.three { grid-template-columns: 1fr; }
    .dest { grid-template-columns: 1fr; }
}
