/* ==========================================================================
   Rockshield Operations Platform
   Palette taken from the Rockshield brand: navy carries authority, gold marks
   the hub and anything sanctioned, rust is reserved for live incidents only.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@500;600;700;800&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
    --ink:        #0A1B2E;
    --navy:       #12293F;
    --navy-soft:  #1C3A56;
    --gold:       #C9A227;
    --gold-dim:   #8F7318;
    --rust:       #B4471F;
    --rust-dim:   #7A2E13;
    --live:       #2E7D5B;
    --bone:       #F2EEE6;
    --paper:      #FBFAF7;
    --slate:      #6B7A8C;
    --hairline:   #DAD4C8;

    --display: 'Archivo', system-ui, sans-serif;
    --body:    'Inter', system-ui, sans-serif;
    --mono:    'IBM Plex Mono', ui-monospace, monospace;

    --gutter: 20px;
    --radius: 3px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--body);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--rust); }

:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

h1, h2, h3, h4 {
    font-family: var(--display);
    letter-spacing: -0.015em;
    margin: 0 0 .5em;
    line-height: 1.15;
}

h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 600; }

.eyebrow {
    font-family: var(--mono);
    font-size: .68rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--slate);
}

.mono { font-family: var(--mono); font-size: .82rem; }

/* --------------------------------------------------------- shell */

.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 244px;
    flex-shrink: 0;
    background: var(--ink);
    color: var(--bone);
    padding: 22px 0;
    display: flex;
    flex-direction: column;
}

.sidebar .brand {
    font-family: var(--display);
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: .04em;
    color: #fff;
    padding: 0 var(--gutter) 18px;
    border-bottom: 1px solid rgba(255,255,255,.09);
}

.sidebar .brand span { color: var(--gold); }

.nav-group { padding: 16px var(--gutter) 4px; }
.nav-group .eyebrow { color: rgba(242,238,230,.42); }

.sidebar nav a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 8px var(--gutter);
    color: rgba(242,238,230,.78);
    font-size: .9rem;
    border-left: 3px solid transparent;
}

.sidebar nav a:hover { background: rgba(255,255,255,.05); color: #fff; }

.sidebar nav a.is-active {
    background: rgba(201,162,39,.1);
    border-left-color: var(--gold);
    color: #fff;
    font-weight: 500;
}

.sidebar-foot {
    margin-top: auto;
    padding: 16px var(--gutter) 0;
    border-top: 1px solid rgba(255,255,255,.09);
    font-size: .82rem;
}

.sidebar-foot .who { color: #fff; font-weight: 500; }
.sidebar-foot .where { color: rgba(242,238,230,.5); font-family: var(--mono); font-size: .72rem; }

.main { flex: 1; min-width: 0; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 28px;
    background: #fff;
    border-bottom: 1px solid var(--hairline);
}

.content { padding: 26px 28px 60px; max-width: 1220px; }

/* --------------------------------------------------------- network rail
   The signature element. Lagos sits on the left as a filled node, the seven
   spokes run off it on a single line. Each node carries its own duty count,
   and a rust pip appears only when that node has a live incident. */

.rail {
    background: var(--navy);
    border-radius: var(--radius);
    padding: 18px 20px 14px;
    overflow-x: auto;
    color: var(--bone);
}

.rail-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 14px;
}

.rail-head .eyebrow { color: rgba(242,238,230,.5); }

.rail-track {
    display: flex;
    align-items: flex-start;
    gap: 0;
    min-width: max-content;
    position: relative;
}

.node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 0 14px;
    min-width: 92px;
    position: relative;
}

.node + .node::before {
    content: '';
    position: absolute;
    left: -1px;
    top: 13px;
    width: 100%;
    height: 1px;
    background: rgba(242,238,230,.22);
    z-index: 0;
}

.node .dot {
    width: 26px; height: 26px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-family: var(--mono);
    font-size: .58rem;
    font-weight: 500;
    background: var(--navy-soft);
    border: 1px solid rgba(242,238,230,.35);
    color: var(--bone);
    position: relative;
    z-index: 1;
}

.node.is-hub .dot {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--ink);
    width: 30px; height: 30px;
    box-shadow: 0 0 0 4px rgba(201,162,39,.18);
}

.node.has-incident .dot::after {
    content: '';
    position: absolute;
    top: -2px; right: -2px;
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--rust);
    border: 1.5px solid var(--navy);
}

.node .label { font-size: .74rem; font-weight: 500; white-space: nowrap; }
.node .count { font-family: var(--mono); font-size: .68rem; color: rgba(242,238,230,.55); }
.node.is-offline { opacity: .45; }

/* --------------------------------------------------------- cards & grid */

.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: 2fr 1fr; }

.card {
    background: #fff;
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    padding: 18px 20px;
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--hairline);
}

.card-head h3 { margin: 0; }

.stat { font-family: var(--display); font-size: 2rem; font-weight: 800; line-height: 1; }
.stat.is-alert { color: var(--rust); }
.stat-label { font-size: .8rem; color: var(--slate); margin-top: 4px; }

/* --------------------------------------------------------- tags */

.tag {
    display: inline-block;
    font-family: var(--mono);
    font-size: .66rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 2px;
    border: 1px solid var(--hairline);
    color: var(--slate);
    background: var(--bone);
}

.tag-critical { background: var(--rust); border-color: var(--rust); color: #fff; }
.tag-high     { background: #F3E0D8; border-color: var(--rust); color: var(--rust-dim); }
.tag-medium   { background: #FAF1D9; border-color: var(--gold); color: var(--gold-dim); }
.tag-low      { background: var(--bone); }
.tag-live     { background: #E1F0E8; border-color: var(--live); color: var(--live); }
.tag-hub      { background: var(--gold); border-color: var(--gold); color: var(--ink); }

/* --------------------------------------------------------- tables & lists */

table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th {
    text-align: left;
    font-family: var(--mono);
    font-size: .68rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--slate);
    font-weight: 500;
    padding: 8px 10px;
    border-bottom: 1px solid var(--hairline);
}
td { padding: 11px 10px; border-bottom: 1px solid var(--bone); vertical-align: top; }
tr:hover td { background: #FDFCFA; }

.stack { list-style: none; margin: 0; padding: 0; }
.stack li { padding: 11px 0; border-bottom: 1px solid var(--bone); }
.stack li:last-child { border-bottom: 0; }

.empty {
    padding: 26px 20px;
    text-align: center;
    color: var(--slate);
    font-size: .88rem;
    border: 1px dashed var(--hairline);
    border-radius: var(--radius);
}

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

label { display: block; font-size: .8rem; font-weight: 500; margin-bottom: 5px; }

input[type=text], input[type=email], input[type=password], input[type=tel],
input[type=datetime-local], input[type=search], select, textarea {
    width: 100%;
    padding: 9px 11px;
    font-family: var(--body);
    font-size: .92rem;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
}

input:focus, select:focus, textarea:focus {
    border-color: var(--navy);
    outline: 2px solid rgba(18,41,63,.12);
    outline-offset: 0;
}

.field { margin-bottom: 15px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hint { font-size: .78rem; color: var(--slate); margin-top: 4px; }
.error { font-size: .8rem; color: var(--rust); margin-top: 4px; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--display);
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .01em;
    padding: 9px 16px;
    border: 1px solid var(--ink);
    border-radius: var(--radius);
    background: var(--ink);
    color: #fff;
    cursor: pointer;
}
.btn:hover { background: var(--navy-soft); border-color: var(--navy-soft); color: #fff; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.btn-gold:hover { background: var(--gold-dim); border-color: var(--gold-dim); color: #fff; }
.btn-rust { background: var(--rust); border-color: var(--rust); }
.btn-rust:hover { background: var(--rust-dim); border-color: var(--rust-dim); }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--hairline); }
.btn-quiet:hover { background: var(--bone); color: var(--ink); }
.btn-sm { padding: 5px 11px; font-size: .78rem; }

.flash {
    padding: 11px 15px;
    border-left: 3px solid var(--live);
    background: #E9F3EE;
    border-radius: var(--radius);
    font-size: .88rem;
    margin-bottom: 18px;
}
.flash-error { border-left-color: var(--rust); background: #F7E9E4; }

/* --------------------------------------------------------- messaging */

.room { display: grid; grid-template-columns: 240px 1fr; height: calc(100vh - 58px); }

.room-list { border-right: 1px solid var(--hairline); overflow-y: auto; background: #fff; }
.room-list a {
    display: block;
    padding: 11px 16px;
    border-bottom: 1px solid var(--bone);
    font-size: .86rem;
}
.room-list a.is-active { background: var(--bone); border-left: 3px solid var(--gold); }
.room-list .room-meta { font-family: var(--mono); font-size: .66rem; color: var(--slate); }
.unread {
    float: right;
    font-family: var(--mono);
    font-size: .64rem;
    background: var(--rust);
    color: #fff;
    padding: 1px 6px;
    border-radius: 9px;
}

.room-body { display: flex; flex-direction: column; min-width: 0; }
.room-head { padding: 13px 22px; border-bottom: 1px solid var(--hairline); background: #fff; }
.room-scroll { flex: 1; overflow-y: auto; padding: 20px 22px; }
.room-compose { border-top: 1px solid var(--hairline); padding: 13px 22px; background: #fff; }

.msg { display: flex; gap: 11px; margin-bottom: 17px; }
.avatar {
    width: 32px; height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--navy);
    color: var(--bone);
    display: grid;
    place-items: center;
    font-family: var(--mono);
    font-size: .68rem;
}
.msg-meta { font-size: .78rem; color: var(--slate); margin-bottom: 2px; }
.msg-meta strong { color: var(--ink); font-size: .86rem; }
.msg-body { font-size: .92rem; white-space: pre-wrap; word-break: break-word; }
.msg.is-urgent .msg-body {
    border-left: 3px solid var(--rust);
    padding-left: 10px;
}

.presence { display: flex; gap: 5px; align-items: center; font-size: .76rem; color: var(--slate); }
.presence .pip { width: 7px; height: 7px; border-radius: 50%; background: var(--live); }

/* --------------------------------------------------------- public site */

.public-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 40px;
    background: var(--ink);
    color: var(--bone);
}
.public-nav a { color: rgba(242,238,230,.8); margin-left: 26px; font-size: .9rem; }
.public-nav a:hover { color: var(--gold); }
.public-nav .brand { font-family: var(--display); font-weight: 800; color: #fff; margin: 0; }
.public-nav .brand span { color: var(--gold); }

.hero {
    background: var(--ink);
    color: var(--bone);
    padding: 70px 40px 90px;
}
.hero h1 { color: #fff; max-width: 15ch; font-size: clamp(2.2rem, 6vw, 3.6rem); }
.hero p { max-width: 56ch; color: rgba(242,238,230,.72); font-size: 1.05rem; }

.section { padding: 60px 40px; max-width: 1100px; margin: 0 auto; }
.section-dark { background: var(--navy); color: var(--bone); max-width: none; }
.section-dark h2 { color: #fff; }

.arm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--hairline); border: 1px solid var(--hairline); }
.arm { background: #fff; padding: 22px; }
.arm .bar { width: 34px; height: 3px; margin-bottom: 12px; }
.arm h3 { margin-bottom: 6px; }
.arm p { font-size: .88rem; color: var(--slate); margin: 0; }

.site-foot { background: var(--ink); color: rgba(242,238,230,.6); padding: 34px 40px; font-size: .84rem; }

/* --------------------------------------------------------- auth */

.auth-wrap { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.auth-side { background: var(--ink); color: var(--bone); padding: 54px 46px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side h1 { color: #fff; }
.auth-form { display: grid; place-items: center; padding: 40px; }
.auth-form .inner { width: 100%; max-width: 360px; }

/* --------------------------------------------------------- responsive */

@media (max-width: 980px) {
    .grid-3, .grid-2, .arm-grid { grid-template-columns: 1fr; }
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-side { display: none; }
}

@media (max-width: 760px) {
    .shell { flex-direction: column; }
    .sidebar { width: 100%; padding: 14px 0; }
    .sidebar nav { display: flex; overflow-x: auto; }
    .sidebar nav a { border-left: 0; border-bottom: 3px solid transparent; white-space: nowrap; }
    .sidebar nav a.is-active { border-left: 0; border-bottom-color: var(--gold); }
    .nav-group, .sidebar-foot { display: none; }
    .content, .topbar { padding-left: 16px; padding-right: 16px; }
    .room { grid-template-columns: 1fr; height: auto; }
    .room-list { display: none; }
    .field-row { grid-template-columns: 1fr; }
    .section, .hero, .public-nav, .site-foot { padding-left: 20px; padding-right: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}
