/* ==========================================================================
   hud.css  —  TV display
   Dark, high-contrast, tuned for a 1080p wall screen at viewing distance.
   In/Out is never conveyed by color alone (label + icon + shape) so it
   reads correctly for colorblind viewers.
   ========================================================================== */

:root {
    --bg:        #0e1116;
    --panel:     #161b22;
    --panel-2:   #1c232d;
    --line:      #2a323d;
    --ink:       #f2f5f8;
    --ink-dim:   #9aa7b4;
    --blue:      #1c6fe0;
    --orange:    #ff8a3d;
    --in:        #1f9d55;   /* paired with a check icon + "IN" text */
    --out:       #8a94a0;   /* paired with a dash icon + "OUT" text */
    --urgent:    #e23b3b;
    --high:      #e0a91c;
}

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

html, body {
    height: 100%;
    background: var(--bg);
    color: var(--ink);
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    overflow: hidden;
}

body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 18px 22px;
    gap: 14px;
}

/* ---- Header ---- */
.hud-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid var(--blue);
    padding-bottom: 10px;
}
.hud-title {
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: .5px;
}
.hud-clock { text-align: right; line-height: 1.1; }
.clock-time { font-size: 2.2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.clock-date { font-size: 1.05rem; color: var(--ink-dim); font-variant-numeric: tabular-nums; }

/* ---- Grid ---- */
.hud-grid {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: 1fr 30%;
    gap: 16px;
    min-height: 0;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
.panel-h {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--blue);
    color: #fff;
    font-size: 1.35rem;
    font-weight: 700;
    padding: 10px 16px;
}
.panel-badge {
    background: rgba(255,255,255,.18);
    border-radius: 20px;
    font-size: .95rem;
    font-weight: 600;
    padding: 3px 12px;
}

/* ---- Cards ---- */
.cards-wrap {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 14px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    grid-auto-rows: min-content;
    gap: 14px;
    align-content: start;
}
.card {
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-left: 8px solid var(--blue);
    border-radius: 10px;
    padding: 14px 16px;
}
.card.p-high   { border-left-color: var(--high); }
.card.p-urgent { border-left-color: var(--urgent); }

.card-flag {
    display: inline-block;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 5px;
    margin-bottom: 6px;
}
.card.p-high   .card-flag { background: var(--high);   color: #1a1a1a; }
.card.p-urgent .card-flag { background: var(--urgent); color: #fff;
                            animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.55} }

.card-headline {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 6px;
    word-break: break-word;
}
.card-notes {
    font-size: 1.1rem;
    color: var(--ink);
    line-height: 1.35;
    white-space: pre-wrap;
    word-break: break-word;
}
.card-meta {
    margin-top: 10px;
    font-size: .85rem;
    color: var(--ink-dim);
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

/* ---- People / In-Out ---- */
.people-wrap {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.person {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 10px 12px;
}
.person.is-in  { border-left: 6px solid var(--in); }
.person.is-out { border-left: 6px solid var(--out); opacity: .82; }

.person-body { flex: 1 1 auto; min-width: 0; }
.person-name { font-size: 1.2rem; font-weight: 700; line-height: 1.15;
               white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-title { font-size: .9rem; color: var(--ink-dim);
                white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-note { font-size: .9rem; color: var(--orange); margin-top: 2px; }

/* Status pill — color + icon + text (colorblind-safe) */
.status-pill {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: .5px;
    padding: 6px 12px;
    border-radius: 8px;
    min-width: 84px;
    justify-content: center;
}
.status-pill.in  { background: var(--in);  color: #fff; }
.status-pill.out { background: var(--out); color: #10151b; }
.status-pill .ic { font-size: 1.1rem; line-height: 1; }

/* ---- Footer ---- */
.hud-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--ink-dim);
    font-size: .9rem;
    border-top: 1px solid var(--line);
    padding-top: 8px;
}
.conn.ok   { color: var(--in); }
.conn.bad  { color: var(--urgent); }

.empty { color: var(--ink-dim); font-size: 1.1rem; padding: 20px; text-align: center; }

/* Scrollbars kept subtle for a wall screen */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2f3a47; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }
