:root{
  --brand-red: #C8102E;
  --brand-dark: #222222;
  --bg-base: #F5F6F7;
  --card-bg: #ffffff;
  --accent-green: #2E7D32;
  --accent-yellow: #FFD600;
  --muted: #6c757d;
}

/* Base typography */
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--brand-dark);
  background-color: var(--bg-base);
  font-size: 15px;
}

.navbar-brand { font-weight: 600; color: var(--brand-red) !important; display:flex; align-items:center; gap:8px }
.navbar { border-bottom: 1px solid rgba(0,0,0,0.05); }

.card { background: var(--card-bg); border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
h1, h2, h3, h4 { font-weight: 600; color: var(--brand-dark); }

.btn-primary { background-color: var(--brand-red); border-color: var(--brand-red); }
.btn-primary:hover, .btn-primary:focus { background-color: #9d0b23; border-color: #9d0b23; }

.badge-signal { background: var(--accent-green); color: #fff; }
.badge-warning { background: var(--accent-yellow); color: #222; }

.table th { background: #fff; font-weight: 600; }
.table td { vertical-align: middle; }

.page-header { padding: 0.75rem 0; border-bottom: 1px solid rgba(0,0,0,0.04); margin-bottom: 1rem; }

a:focus, button:focus, .btn:focus { outline: 3px solid rgba(200,16,46,0.18); outline-offset: 2px; box-shadow: none; }

.station-code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, 'Roboto Mono', monospace; background: rgba(0,0,0,0.03); padding: 0.12rem 0.4rem; border-radius: 4px; font-weight: 600; }

/* Small responsive tweaks */
@media (max-width: 767px) {
  .navbar-brand { gap:6px; }
  .page-header { padding: .5rem 0; }
}

/* Dashboard railway schematic background */
.rail-network-bg {
  position: relative;
  background-color: var(--bg-base);
}
.rail-network-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='1600' height='900' viewBox='0 0 1600 900' preserveAspectRatio='xMidYMid slice'>%3Cdefs%3E%3ClinearGradient id='g' x1='0' x2='1'%3E%3Cstop offset='0' stop-color='%23ffffff' stop-opacity='0'/%3E%3Cstop offset='1' stop-color='%23ffffff' stop-opacity='0'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='100%25' height='100%25' fill='transparent'/%3E%3Cg stroke='%23222222' stroke-opacity='0.06' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' fill='none'%3E%3Cpath d='M80 160 C220 120 380 120 520 160 L680 200 C820 240 980 240 1120 200 L1280 160'/%3E%3Cpath d='M120 260 C260 220 420 220 560 260 L720 300 C860 340 1020 340 1160 300 L1320 260'/%3E%3Cpath d='M40 360 C200 320 360 320 520 360 L680 400 C840 440 1000 440 1160 400 L1320 360'/%3E%3C/g%3E%3Cg stroke='%23C8102E' stroke-opacity='0.08' stroke-width='3' stroke-linecap='round' fill='none'%3E%3Cpath d='M200 120 L200 760'/%3E%3Cpath d='M600 80 L600 820'/%3E%3Cpath d='M1000 120 L1000 760'/%3E%3C/g%3E%3Ccircle cx='200' cy='160' r='6' fill='%23C8102E' fill-opacity='0.12'/%3E%3Ccircle cx='600' cy='200' r='6' fill='%23222222' fill-opacity='0.08'/%3E%3Ccircle cx='1000' cy='160' r='6' fill='%23C8102E' fill-opacity='0.12'/%3E%3C/svg>");
  background-repeat: repeat;
  background-position: center;
  background-size: 60%;
  opacity: 0.70;
  pointer-events: none;
  z-index: 0;
}

/* Ensure dashboard content sits above the SVG background */
.rail-network-bg .container,
.rail-network-bg header,
.rail-network-bg main { position: relative; z-index: 1; }

/* Reduce card contrast over the patterned background */
.rail-network-bg .card { background: rgba(255,255,255,0.92); }
