/* Cool Logic client portal - brand colours taken from the coollogic.com.au logo */
:root {
  --navy: #00386c; --navy-2: #0b4a85; --green: #9bcc52; --green-dark: #5f8f22;
  --metro-blue: #0072ce; --ink: #1b2430; --muted: #5d6b7a; --line: #dfe5ec; --bg: #f4f7fa;
  --normal: #2e8b57; --normal-bg: #e6f4ec; --warning: #b7791f; --warning-bg: #fdf1dc;
  --alarm: #c53030; --alarm-bg: #fde8e8; --offline: #6b7280; --offline-bg: #eef0f3;
  --radius: 10px; font-family: "Segoe UI", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.45; }
a { color: var(--navy-2); }
h1 { font-size: 1.6rem; margin: .4rem 0 .8rem; color: var(--navy); }
h2 { font-size: 1.15rem; margin: 0 0 .6rem; color: var(--navy); }
h3 { font-size: 1rem; margin: 1.2rem 0 .5rem; color: var(--navy); }
code { background: #eef2f6; padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .nowrap { white-space: nowrap; }
.container { max-width: 1280px; margin: 0 auto; padding: 18px 22px 40px; }

.topbar { display: flex; align-items: center; gap: 18px; padding: 10px 26px; background: #fff;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1000; }
.brand img { height: 46px; display: block; }
.spacer { flex: 1; }
.mainnav a, .sitenav a { margin-right: 18px; text-decoration: none; font-weight: 600; color: var(--navy);
  text-transform: uppercase; font-size: .8rem; letter-spacing: .06em; }
.mainnav a:hover { color: var(--green-dark); }
.sitenav a { border-right: 1px solid var(--line); padding-right: 18px; color: var(--navy); cursor: default; }
.who { display: flex; flex-direction: column; text-align: right; font-size: .85rem; }
.who span { color: var(--muted); }
.sample-banner { background: #fff6d6; border-bottom: 1px solid #f0d98a; color: #7a5b00; text-align: center;
  padding: 6px 12px; font-size: .85rem; font-weight: 600; letter-spacing: .02em; }
.footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 18px; }

.btn { display: inline-block; border: 1px solid var(--navy); background: var(--navy); color: #fff; border-radius: 6px;
  padding: 8px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--navy-2); }
.btn-primary { background: var(--navy); }
.btn-ghost { background: #fff; color: var(--navy); border-color: var(--line); }
.btn-ghost:hover { background: #f0f4f8; }
.btn-portal { background: var(--green); border-color: var(--green); color: var(--navy); }
.btn-portal:hover { background: #8bbd40; }
.btn-danger { background: var(--alarm); border-color: var(--alarm); }
.btn-small { padding: 4px 10px; font-size: .82rem; }
.btn-lg { padding: 12px 24px; font-size: 1.05rem; }
.linkbtn { background: none; border: 0; color: var(--navy-2); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
.right { float: right; }
form.inline { display: inline; }

.hero { min-height: 70vh; background: linear-gradient(120deg, rgba(0,56,108,.86), rgba(0,56,108,.55)),
  url("/static/img/hero.jpg") center/cover, var(--navy); color: #fff; display: flex; align-items: center; }
.hero-inner { max-width: 760px; margin: 0 auto; padding: 40px 24px; }
.hero h1 { color: #fff; font-size: 2.3rem; }
.hero code { background: rgba(255,255,255,.15); color: #fff; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 700; color: var(--green); margin: 0; }
.eyebrow.light { color: #cfe6ff; }

body.auth { background: #eceff2; }
.auth-card { max-width: 480px; margin: 40px auto; background: #fff; border-radius: var(--radius); padding: 34px 40px;
  box-shadow: 0 6px 24px rgba(0,30,60,.08); }
.auth-logo { width: 220px; display: block; margin: 0 auto 14px; }
.auth-card h1 { text-align: center; font-size: 1.3rem; }
.form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .9rem; margin-bottom: 14px; color: var(--navy); }
.form input, .form select, td input { font: inherit; padding: 9px 11px; border: 1px solid #c4ced8; border-radius: 6px; background: #fff; font-weight: 400; color: var(--ink); }
.form input:focus { outline: 2px solid var(--green); border-color: var(--green); }
.code-input { font-size: 1.4rem !important; letter-spacing: .3em; text-align: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.alt-mfa { margin-top: 14px; text-align: center; }
.steps { padding-left: 20px; }
.qr { text-align: center; margin: 10px 0 18px; } .qr img { display: block; margin: 0 auto 6px; }
.secret { display: inline-block; word-break: break-all; font-size: .85rem; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid; }
.flash-ok { background: var(--normal-bg); border-color: #b8dfc8; }
.flash-err { background: var(--alarm-bg); border-color: #f3b8b8; }
.flash-info { background: #e8f1fb; border-color: #c5dbf3; }
.flash-key { background: #fffbe8; border-color: #f0d98a; }

.client-band { background: var(--metro-blue); color: #fff; border-radius: var(--radius); padding: 18px 24px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 20px; }
.client-band h1 { color: #fff; margin: 2px 0 4px; } .client-band p { margin: 0; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.metric { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; border-top: 4px solid var(--navy); }
.metric .n { font-size: 1.7rem; font-weight: 700; } .metric .l { color: var(--muted); font-size: .85rem; }
.m-normal { border-top-color: var(--normal); } .m-warning { border-top-color: var(--warning); }
.m-alarm { border-top-color: var(--alarm); } .m-offline { border-top-color: var(--offline); }

.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 2px 10px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill-normal { color: var(--normal); background: var(--normal-bg); }
.pill-warning { color: var(--warning); background: var(--warning-bg); }
.pill-alarm { color: var(--alarm); background: var(--alarm-bg); }
.pill-offline, .pill-unknown { color: var(--offline); background: var(--offline-bg); }
.legend { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { display: inline-block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  background: #fff1c2; color: #7a5b00; border-radius: 4px; padding: 1px 6px; vertical-align: middle; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.panel-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.panel-head h2 { margin: 0; flex: 1; }
.map-layout { display: grid; grid-template-columns: 1fr 360px; gap: 16px; }
.map-panel { padding: 12px; } .map-panel .panel-head { justify-content: space-between; }
#map { height: 520px; border-radius: 8px; border: 1px solid var(--line); }
.list-panel input[type=search] { flex: 1; padding: 8px 10px; border: 1px solid #c4ced8; border-radius: 6px; font: inherit; }
.list-panel select { padding: 8px; border: 1px solid #c4ced8; border-radius: 6px; font: inherit; }
.site-list { max-height: 480px; overflow: auto; }
.site-row { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-bottom: 1px solid var(--line);
  text-decoration: none; color: var(--ink); }
.site-row:hover, .site-row.hl { background: #f0f6fd; }
.site-row .name { flex: 1; font-weight: 600; } .site-row small { display: block; color: var(--muted); font-weight: 400; }
.site-row .temp { font-variant-numeric: tabular-nums; font-weight: 600; }
.site-row .pill { min-width: 0; }

/* station markers styled like the Metro station tiles in the brief */
.stn-marker { background: var(--metro-blue); color: #fff; border-radius: 6px; padding: 5px 8px 4px; font-size: 11px; font-weight: 700;
  line-height: 1.15; text-align: center; box-shadow: 0 2px 6px rgba(0,0,0,.3); border-bottom: 5px solid var(--st);
  white-space: nowrap; transform: translate(-50%, -100%); position: absolute; cursor: pointer; }
.stn-marker.anchor-west { transform: translate(-100%, -110%); }
.stn-marker.anchor-east { transform: translate(8%, 8%); }
.stn-marker .t { display: block; font-weight: 400; font-size: 11px; }
.stn-marker.st-alarm { animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(197,48,48,.6); } 50% { box-shadow: 0 0 0 9px rgba(197,48,48,0); } }
.stn-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; background: var(--st); box-shadow: 0 0 0 1px rgba(0,0,0,.3); }
.cluster { background: var(--navy); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; border: 4px solid var(--st); box-shadow: 0 2px 6px rgba(0,0,0,.3); }

.crumbs { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; } .crumbs .right { margin-left: auto; }
.site-head { display: flex; gap: 22px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.station-tile { width: 120px; min-width: 120px; height: 120px; background: var(--metro-blue); color: #fff; border-radius: 6px; display: flex;
  flex-direction: column; align-items: center; justify-content: center; text-align: center; font-weight: 700; font-size: .85rem; padding: 8px; border-bottom: 5px solid #9cc7ef; }
.station-tile svg { width: 36px; height: 36px; background: #fff; color: var(--metro-blue); border-radius: 50%; padding: 6px; margin-bottom: 6px; }
.kv { border-collapse: collapse; min-width: 460px; } .kv th, .kv td { text-align: left; padding: 6px 14px 6px 0; border-bottom: 1px solid var(--line); }
.kv th { color: var(--muted); font-weight: 600; width: 150px; }
.shaft-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 18px; }
.shaft-card { background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--normal); border-radius: var(--radius); padding: 14px 16px; }
.shaft-card.st-warning { border-left-color: var(--warning); background: linear-gradient(90deg, var(--warning-bg), #fff 60%); }
.shaft-card.st-alarm { border-left-color: var(--alarm); background: linear-gradient(90deg, var(--alarm-bg), #fff 60%); }
.shaft-card.st-offline, .shaft-card.st-unknown { border-left-color: var(--offline); }
.shaft-name { font-weight: 700; color: var(--navy); } .shaft-temp { font-size: 2.2rem; font-weight: 700; margin: 4px 0; font-variant-numeric: tabular-nums; }
.shaft-card dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 10px 0 0; font-size: .82rem; }
.shaft-card dt { color: var(--muted); } .shaft-card dd { margin: 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 7px 14px; font: inherit; cursor: pointer; color: var(--navy); }
.seg button.on { background: var(--navy); color: #fff; }
.chart-wrap { height: 340px; position: relative; }

.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; color: var(--muted); font-weight: 600; border-bottom: 2px solid var(--line); padding: 8px 6px; background: #f8fafc; }
.table td { border-bottom: 1px solid var(--line); padding: 8px 6px; vertical-align: top; }
.table.compact td { padding: 4px 6px; font-size: .82rem; }
.table tr.inactive td { opacity: .5; }
td input { padding: 5px 7px; width: 100%; min-width: 90px; } td input.num { width: 70px; min-width: 60px; }
td input[type=checkbox] { width: auto; min-width: 0; }
.flags label { display: block; font-size: .82rem; white-space: nowrap; }
.subnav { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 2px solid var(--line); margin-bottom: 16px; }
.subnav a { padding: 8px 14px; text-decoration: none; color: var(--navy); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.subnav a.on { border-bottom-color: var(--green); }
.grid-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 16px; }
.grid-form .wide { grid-column: 1 / -1; }
.form label.check { flex-direction: row; align-items: center; font-weight: 400; }
.inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; } .inline-form label { margin: 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 960px) { .map-layout, .two-col { grid-template-columns: 1fr; } #map { height: 420px; } .site-head { flex-direction: column; } .kv { min-width: 0; } .topbar { flex-wrap: wrap; } }

/* Network diagram / street map toggle on the site map */
.map-mode { margin-left: auto; }
.schematic-legend { display: none; flex-wrap: wrap; gap: 8px 14px; align-items: center;
  margin: 0 0 8px; font-size: .78rem; color: var(--ink); }
.map-panel.is-schematic .schematic-legend { display: flex; }
.map-panel.is-schematic #street-note { display: none; }
.map-panel:not(.is-schematic) .schematic-legend { display: none; }
.line-swatch { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.line-swatch::before { content: ""; width: 18px; height: 5px; border-radius: 3px; background: var(--lc); }
#map.schematic-mode { background: #eef3f8; }
.map-panel.is-schematic #map { height: 620px; }
@media (max-width: 960px) { .map-panel.is-schematic #map { height: 480px; } }
@media (max-width: 960px) {
  .map-mode { margin-left: 0; }
}

/* v0.3 accounts: invites, my account */
.inv { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: .78rem; font-weight: 600; }
.inv-pending { color: var(--warning); background: var(--warning-bg); }
.inv-accepted { color: var(--normal); background: var(--normal-bg); }
.inv-expired, .inv-revoked { color: var(--offline); background: var(--offline-bg); }
.users-table td.actions { min-width: 260px; }
.users-table td.actions .btn, .users-table td.actions form { margin: 0 2px 4px 0; }
.kv-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 8px; }
.kv-list dt { color: var(--muted); font-size: .88rem; } .kv-list dd { margin: 0; font-weight: 600; }
.progress-steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 16px; counter-reset: st; }
.progress-steps li { flex: 1; text-align: center; font-size: .75rem; color: var(--muted); padding-top: 8px; border-top: 4px solid var(--line); counter-increment: st; }
.progress-steps li::before { content: counter(st) ". "; }
.progress-steps li.on { color: var(--navy); font-weight: 700; border-top-color: var(--green); }
.pw-hint { margin-top: -6px; }

/* v0.5 rail-transport backgrounds: original line-work in /static/img/rail-*.svg.
   Page background only — never painted over map tiles, charts or white panels. */
body.auth {
  background-color: #eceff2;
  background-image: url("/static/img/rail-auth-scene.svg");
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: cover;
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body.auth main { flex: 1; }
body.auth .footer { background: rgba(236, 239, 242, 0.94); }
@media (max-width: 700px) {
  body.auth {
    background-size: 170% auto;
    background-position: 12% calc(100% - 56px);
    background-attachment: scroll;
  }
}
body.app {
  background-color: var(--bg);
  background-image: url("/static/img/rail-page-pattern.svg");
  background-repeat: repeat;
  background-size: 640px 480px;
  background-position: center top;
}
body.auth .topbar,
body.app .topbar {
  background-color: #fff;
  background-image: url("/static/img/rail-header-band.svg");
  background-repeat: repeat-x;
  background-position: left bottom;
  background-size: 480px 8px;
}
/* Keep data surfaces opaque so the pattern stays in the margins and page gaps. */
.chart-wrap { background: #fff; }
@media print {
  body, body.auth, body.app,
  body.auth .topbar, body.app .topbar {
    background: #fff !important;
    background-image: none !important;
  }
}
