/* NagaCloud Lookout. Full viewport width, read from across a room.
   Brand source: nagacloud-docs/docs/design-projects/nagacloud/theme.md */

/* Arboria is the brand primary but is licensed and unavailable on the
   web stack; theme.md L1 §3.2 names Poppins as the sanctioned
   substitute. Self-hosted deliberately: a monitoring board must not need
   an external CDN to render. Weights stop at SemiBold 600 per the brand
   weight cap (Bold 700 is the brand maximum; 800/900 are off-brand). */
@font-face {
    font-family: 'Poppins';
    src: url('font/Poppins-Regular.ttf') format('truetype');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Poppins';
    src: url('font/Poppins-Medium.ttf') format('truetype');
    font-weight: 500;
    font-display: swap;
}
@font-face {
    font-family: 'Poppins';
    src: url('font/Poppins-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-display: swap;
}

:root {
    /* Charcoal #25282A is the brand's sanctioned dark ground. The page
       sits one step below it so panels read as raised rather than flat. */
    --bg:      #16181A;
    --panel:   #25282A;
    --line:    #3A3E41;
    --text:    #FFFFFF;

    /* Carbon #636569 is the brand's secondary text colour, lifted here
       because Carbon on a dark ground fails legibility at a distance. */
    --muted:   #9DA1A4;

    --green:   #70D44B;   /* Pistachio Mint, brand */
    --amber:   #F5A800;   /* Selective Yellow, brand */

    /* Functional, NOT from the palette: the brand defines no error
       colour. Orange #EA6852 is the brand CTA, and using it here would
       both misread as a call-to-action and sit too close to amber to be
       distinguishable at a glance across a room. */
    --red:     #E5484D;

    --blue:    #00416B;   /* NagaCloud Blue, primary */
}

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

body {
    /* Full viewport width. The layout was originally pinned to 1440px,
       which wasted most of a larger wall display. Everything below scales
       instead of assuming a width. */
    width: 100%;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: 'Poppins', system-ui, -apple-system, "Segoe UI", sans-serif;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
}

/* Whole-screen state. Red is meant to be visible peripherally, without
   reading anything. */
body.state-red    { box-shadow: inset 0 0 0 6px var(--red); animation: breathe 2s ease-in-out infinite; }
body.state-amber  { box-shadow: inset 0 0 0 6px var(--amber); }

@keyframes breathe {
    0%, 100% { box-shadow: inset 0 0 0 6px var(--red); }
    50%      { box-shadow: inset 0 0 0 14px var(--red); }
}

/* ---- status bar ---------------------------------------------------- */

.bar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 22px 34px 18px;
}

.bar-brand {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 2px;
}

.bar-status {
    font-size: 44px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

body.state-green .bar-status   { color: var(--green); }
body.state-amber .bar-status   { color: var(--amber); }
body.state-red   .bar-status   { color: var(--red); }

.bar-meta {
    display: flex;
    gap: 26px;
    font-size: 17px;
    color: var(--muted);
}

.bar-meta .stale {
    color: var(--red);
    font-weight: 600;
}

.clock { font-variant-numeric: tabular-nums; }

/* ---- living architecture graph ------------------------------------- */

.graph { padding: 0 34px; }

/* Scales with the viewport while keeping the hand-placed node positions
   in proportion. Capped so the graph cannot swallow a tall screen and
   push the incident cards below the fold. */
.graph svg {
    display: block;
    width: 100%;
    height: auto;
    max-height: 40vh;
    /* When max-height caps it, the element shrinks below 100% width, so
       it needs centring or it drifts to the left of a wide screen. */
    margin: 0 auto;
}

.edge {
    stroke: var(--line);
    stroke-width: 3;
}

/* An edge carries the health of the FLOW, not of either end. These are
   the reconciliation and callback signals, invisible at both endpoints. */
.edge.sev-amber   { stroke: var(--amber); stroke-width: 5; }
.edge.sev-red,
.edge.sev-unknown { stroke: var(--red);   stroke-width: 6; }

.node rect {
    fill: var(--panel);
    stroke: var(--line);
    stroke-width: 2;
}

.node text {
    fill: var(--text);
    font-size: 17px;
    font-weight: 500;
}

.node.kind-vendor rect { stroke-dasharray: 5 4; }

.node.sev-amber rect   { fill: #2A2310; stroke: var(--amber); stroke-width: 3; }
.node.sev-red rect,
.node.sev-unknown rect { fill: #2B1417; stroke: var(--red); stroke-width: 3; }

.node.sev-red text,
.node.sev-unknown text { fill: #FFD9DB; }

/* ---- incidents ------------------------------------------------------ */

/* Two columns on a 1440 screen, three or more on anything wider, without
   hardcoding a breakpoint. */
.incidents {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(540px, 1fr));
    gap: 14px;
    padding: 20px 34px 0;
}

.card {
    background: var(--panel);
    border-left: 6px solid var(--line);
    border-radius: 6px;
    padding: 16px 20px;
}

.card.sev-amber            { border-left-color: var(--amber); }
.card.sev-red,
.card.sev-unknown          { border-left-color: var(--red); background: #1C1418; }

.card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}

.card-head h2 {
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.card.sev-red .card-head h2,
.card.sev-unknown .card-head h2 { color: #FF9BA0; }

.age {
    font-size: 17px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.card-detail {
    margin-top: 6px;
    font-size: 18px;
    color: #C2C8D0;
}

.card-foot {
    margin-top: 12px;
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 17px;
}

.owner {
    background: #222833;
    border-radius: 4px;
    padding: 3px 10px;
    font-weight: 500;
}

.action { color: var(--muted); }

.card.sev-red .action,
.card.sev-unknown .action { color: var(--red); font-weight: 600; }

.all-clear {
    grid-column: 1 / -1;
    text-align: center;
    padding: 44px 0;
    font-size: 30px;
    color: var(--green);
    font-weight: 500;
}

/* ---- lane strip ----------------------------------------------------- */

.lanes {
    display: flex;
    gap: 10px;
    padding: 20px 34px 28px;
}

.lane {
    flex: 1;
    background: var(--panel);
    border-top: 4px solid var(--green);
    border-radius: 5px;
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.lane.sev-amber            { border-top-color: var(--amber); }
.lane.sev-red,
.lane.sev-unknown          { border-top-color: var(--red); }

.lane-name {
    font-size: 17px;
    text-transform: capitalize;
}

.lane-count {
    font-size: 17px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.empty {
    padding: 80px 34px;
    font-size: 22px;
    color: var(--muted);
}

code {
    background: var(--panel);
    padding: 2px 8px;
    border-radius: 4px;
}

/* ---- lock screen (wall, unpaired) ----------------------------------- */

.lock-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.lock { text-align: center; }

.lock h1 {
    font-size: 30px;
    font-weight: 600;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--muted);
}

.lock-lead {
    margin-top: 10px;
    font-size: 26px;
    font-weight: 500;
}

/* White plate behind the QR: phone cameras read dark-on-light far more
   reliably than an inverted code. */
.lock-qr {
    display: inline-block;
    margin: 30px 0 20px;
    padding: 18px;
    background: #FFFFFF;
    border-radius: 12px;
}

.lock-qr svg { display: block; width: 300px; height: 300px; }

.lock-note { font-size: 16px; color: var(--muted); }

/* ---- approver (phone) ----------------------------------------------- */

.approve-body { padding: 0; }

.approve {
    max-width: 460px;
    margin: 0 auto;
    padding: 48px 24px;
}

.approve h1 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--muted);
}

.approve-lead { margin-top: 14px; font-size: 21px; font-weight: 500; }
.approve-error { margin-top: 14px; font-size: 17px; color: var(--red); }
.approve-ok    { margin-top: 14px; font-size: 21px; font-weight: 500; color: var(--green); }

.approve-warn {
    margin-top: 16px;
    font-size: 15px;
    color: var(--amber);
}

.approve-detail {
    margin-top: 20px;
    background: var(--panel);
    border-radius: 6px;
    padding: 14px 16px;
    font-size: 15px;
}

.approve-detail dt { color: var(--muted); margin-top: 8px; }
.approve-detail dt:first-child { margin-top: 0; }
.approve-detail dd { margin: 2px 0 0; word-break: break-word; }

.approve input,
.approve button {
    width: 100%;
    margin-top: 16px;
    padding: 15px 16px;
    font-size: 17px;
    font-family: inherit;
    border-radius: 6px;
    border: 1px solid var(--line);
}

.approve input {
    background: var(--panel);
    color: var(--text);
}

.approve button {
    background: var(--green);
    color: #06210A;
    font-weight: 600;
    border: 0;
    cursor: pointer;
}

/* Secondary action (resend), visually subordinate to the primary unlock
   button so the two are never confused under time pressure. */
.approve-secondary {
    background: transparent !important;
    color: var(--muted) !important;
    border: 1px solid var(--line) !important;
    font-weight: 400 !important;
}

/* Person picker: the number is shown so the reader can confirm the code
   is going to their own phone, masked so the page is not a directory. */
.approve-msisdn {
    display: block;
    margin-top: 2px;
    font-size: 14px;
    font-weight: 400;
    opacity: 0.75;
}

/* Picking a name is navigation, not the commit action, so these are
   neutral. Three identical primary buttons would give the reader no
   hierarchy and make the real Unlock button look like a fourth option. */
.approve-pick {
    background: var(--panel) !important;
    color: var(--text) !important;
    border: 1px solid var(--line) !important;
    font-weight: 500 !important;
    text-align: left !important;
}

.approve-pick:hover { border-color: var(--muted) !important; }
