/* RigOps Intelligence — product shell (dashboard + shared chrome) */

.ri-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  color: #04201c;
  background: var(--accent, #3dd6c6);
  border-radius: 999px;
  padding: 4px 10px;
  margin-bottom: 10px;
}

.ri-header .mark {
  background: linear-gradient(145deg, #1a2a44, #0f172a) !important;
  color: #3dd6c6 !important;
}

.hdr-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.hdr-actions .btn {
  padding: 8px 10px;
  font-size: 12px;
  min-height: 36px;
}
.hdr-actions a.active-nav {
  border-color: var(--accent, #3dd6c6);
  color: var(--accent, #3dd6c6);
}

/* Dashboard */
.ri-dash {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

.ri-hero {
  background: linear-gradient(145deg, #121a2b 0%, #0f1c30 50%, #0b1524 100%);
  border: 1px solid var(--border, #243049);
  border-radius: 18px;
  padding: 20px 18px;
  margin-bottom: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.28);
}
.ri-hero h1 {
  margin: 0 0 6px;
  font-size: 1.45rem;
  letter-spacing: .01em;
}
.ri-hero .lead {
  margin: 0;
  color: var(--muted, #93a0b8);
  font-size: 14px;
  line-height: 1.45;
  max-width: 40rem;
}
.ri-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.ri-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted, #93a0b8);
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border, #243049);
  border-radius: 999px;
  padding: 6px 10px;
}
.ri-chip strong { color: var(--text, #e8eefc); }

.ri-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
@media (min-width: 700px) {
  .ri-stats { grid-template-columns: repeat(4, 1fr); }
}
.ri-stat {
  background: var(--panel, #121a2b);
  border: 1px solid var(--border, #243049);
  border-radius: 14px;
  padding: 14px;
}
.ri-stat .n {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--accent, #3dd6c6);
  line-height: 1.1;
}
.ri-stat .l {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted, #93a0b8);
  font-weight: 600;
}

.ri-section-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted, #93a0b8);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin: 8px 0 10px;
}

.ri-modules {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}
@media (min-width: 700px) {
  .ri-modules { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1000px) {
  .ri-modules { grid-template-columns: 1fr 1fr 1fr; }
}

a.ri-mod {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: var(--panel, #121a2b);
  border: 1px solid var(--border, #243049);
  border-radius: 16px;
  padding: 16px;
  min-height: 150px;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  transition: border-color .15s, transform .1s;
}
a.ri-mod:active { transform: scale(0.99); }
a.ri-mod.map { --mod: #38bdf8; }
a.ri-mod.pb { --mod: #7dd3fc; }
a.ri-mod.ops { --mod: #3dd6c6; }
a.ri-mod.fleet { --mod: #f5b942; }
a.ri-mod.field { --mod: #5eead4; }
a.ri-mod.fc { --mod: #c4b5fd; }
a.ri-mod:hover, a.ri-mod:focus {
  border-color: var(--mod);
  outline: none;
}
.ri-mod .badge {
  align-self: flex-start;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .07em;
  border-radius: 999px;
  padding: 4px 9px;
  margin-bottom: 10px;
  color: var(--mod);
  background: color-mix(in srgb, var(--mod) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--mod) 28%, transparent);
}
.ri-mod h2 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}
.ri-mod p {
  margin: 0;
  color: var(--muted, #93a0b8);
  font-size: 13px;
  line-height: 1.4;
  flex: 1;
}
.ri-mod .go {
  margin-top: 12px;
  font-weight: 800;
  font-size: 13px;
  color: var(--mod);
}

.ri-columns {
  display: grid;
  gap: 14px;
}
@media (min-width: 900px) {
  .ri-columns { grid-template-columns: 1.1fr 1fr; }
}

.ri-panel {
  background: var(--panel, #121a2b);
  border: 1px solid var(--border, #243049);
  border-radius: 16px;
  padding: 14px;
}
.ri-panel h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.ri-panel h3 a {
  font-size: 12px;
  color: var(--accent, #3dd6c6);
  text-decoration: none;
  font-weight: 700;
}

.ri-person {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(36,48,73,.55);
}
.ri-person:last-child { border-bottom: 0; }
.ri-person .name { font-weight: 800; font-size: 14px; }
.ri-person .sub { color: var(--muted, #93a0b8); font-size: 12px; margin-top: 2px; }
.ri-person .acts { display: flex; gap: 6px; flex-shrink: 0; }
.ri-person .acts a {
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border, #243049);
  background: #0f172a;
  color: var(--text, #e8eefc);
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}
.ri-person .acts a.call { color: #86efac; border-color: rgba(74,222,128,.35); }

.ri-site-row {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid rgba(36,48,73,.55);
  text-decoration: none;
  color: inherit;
}
.ri-site-row:last-child { border-bottom: 0; }
.ri-site-row .swatch {
  width: 10px; height: 10px; border-radius: 50%; margin-top: 5px;
}
.ri-site-row .name { font-weight: 800; font-size: 13px; }
.ri-site-row .sub { color: var(--muted, #93a0b8); font-size: 11px; margin-top: 2px; }
.ri-site-row .n {
  font-size: 11px; font-weight: 800; color: var(--accent, #3dd6c6);
  background: rgba(61,214,198,.1);
  border: 1px solid rgba(61,214,198,.25);
  border-radius: 999px;
  padding: 3px 8px;
}

.ri-foot {
  margin-top: 18px;
  text-align: center;
  color: #64748b;
  font-size: 11px;
}

.login-card .err.show { display: block; }
.login-card .err {
  display: none;
  background: #3b1515;
  color: #ffb4b4;
  border: 1px solid #5c2424;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 13px;
}


/* TODAY sitrep — morning ops brief */
.ri-today {
  background: var(--panel, #121a2b);
  border: 1px solid var(--border, #243049);
  border-radius: 16px;
  padding: 14px 16px 16px;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.ri-today-head h2 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  letter-spacing: .01em;
}
.ri-today-fresh {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted, #93a0b8);
}
.ri-today-fresh strong { color: var(--accent, #3dd6c6); }
.ri-today-source {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted, #93a0b8);
}

.ri-today-counts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 12px 0 14px;
}
@media (min-width: 700px) {
  .ri-today-counts { grid-template-columns: repeat(4, 1fr); }
}
.ri-today-count {
  background: #0b1220;
  border: 1px solid var(--border, #243049);
  border-radius: 12px;
  padding: 10px 12px;
  border-left-width: 3px;
}
.ri-today-count .n {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--accent, #3dd6c6);
  line-height: 1.1;
}
.ri-today-count .l {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted, #93a0b8);
}
.ri-today-count.st-working { border-left-color: #4ade80; }
.ri-today-count.st-working .n { color: #4ade80; }
.ri-today-count.st-idle { border-left-color: #64748b; }
.ri-today-count.st-idle .n { color: #94a3b8; }
.ri-today-count.st-maintenance { border-left-color: #94a3b8; }
.ri-today-count.st-maintenance .n { color: #cbd5e1; }
.ri-today-count.st-hold { border-left-color: #fb7185; }
.ri-today-count.st-hold .n { color: #fb7185; }

.ri-today h3 {
  margin: 4px 0 8px;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.ri-today h3 a {
  font-size: 12px;
  color: var(--accent, #3dd6c6);
  text-decoration: none;
  font-weight: 700;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 4px;
}

.ri-today-empty {
  margin: 0;
  color: var(--muted, #93a0b8);
  font-size: 13px;
}

.ri-today-todo {
  padding: 10px 0;
  border-bottom: 1px solid rgba(36,48,73,.55);
}
.ri-today-todo:last-child { border-bottom: 0; }
.ri-today-todo .id {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted, #93a0b8);
}
.ri-today-todo.p0 .id { color: var(--accent2, #f5b942); }
.ri-today-todo .action {
  margin-top: 3px;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.4;
}
.ri-today-todo .owner {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted, #93a0b8);
}

.ri-today-fleet { margin-top: 12px; }
.ri-today-strip {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
@media (min-width: 700px) {
  .ri-today-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 14px;
  }
}
.ri-today-rig {
  display: grid;
  grid-template-columns: 10px 72px 1fr;
  gap: 8px;
  align-items: center;
  min-height: 28px;
  font-size: 13px;
}
.ri-today-rig .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.ri-today-rig .id {
  font-weight: 900;
  letter-spacing: .02em;
}
.ri-today-rig .loc {
  color: var(--muted, #93a0b8);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* Metres strip on Today sitrep — posted project / remaining calc / last shift */
.ri-today-metres { margin-top: 14px; }
.ri-today-metres h3 {
  margin: 4px 0 8px;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.ri-metres-asof {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted, #93a0b8);
  text-transform: none;
  letter-spacing: 0;
}
.ri-metres-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
@media (min-width: 800px) {
  .ri-metres-strip { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1100px) {
  .ri-metres-strip { grid-template-columns: repeat(6, 1fr); }
}
.ri-metres-site {
  background: #0b1220;
  border: 1px solid var(--border, #243049);
  border-radius: 12px;
  padding: 10px 11px;
  min-height: 88px;
}
.ri-metres-site.stale { border-left: 3px solid #fbbf24; }
.ri-metres-site.none { border-left: 3px solid #64748b; }
.ri-metres-site .name {
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .01em;
}
.ri-metres-site .proj {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text, #e8eefc);
}
.ri-metres-site .rem {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted, #93a0b8);
}
.ri-metres-site .last {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted, #93a0b8);
}
.ri-metres-unknown {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--muted, #93a0b8);
}


/* Today todo Call / WA — stack then 44px actions */
.ri-today-todo .acts {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.ri-today-todo .acts a {
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  padding: 10px 14px;
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--border, #243049);
  background: #0f172a;
  color: var(--text, #e8eefc);
}
.ri-today-todo .acts a.call { color: #86efac; border-color: rgba(74,222,128,.35); }
.ri-today-todo .acts a.wa { color: var(--accent, #3dd6c6); border-color: rgba(61,214,198,.35); }
a.ri-mod { min-height: 150px; }

/* Metres: 1 column under 600px (override 2-col) */
.ri-metres-strip { grid-template-columns: 1fr; }
@media (min-width: 600px) {
  .ri-metres-strip { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 800px) {
  .ri-metres-strip { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1100px) {
  .ri-metres-strip { grid-template-columns: repeat(6, 1fr); }
}

/* Stale radar */
.ri-stale-radar { margin-top: 12px; }
.ri-stale-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ri-stale-list li {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted, #93a0b8);
  padding: 6px 0;
  border-bottom: 1px solid rgba(36,48,73,.45);
}
.ri-stale-list li:last-child { border-bottom: 0; }
.ri-stale-list li.stale { color: #fbbf24; }
.ri-stale-list li.park { color: #fdba74; }
.ri-stale-list li.unk { color: #94a3b8; }

/* Forecast strip + page */
.ri-today-forecast { margin-top: 14px; }
.ri-today-forecast h3 {
  margin: 4px 0 8px;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.ri-fc-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.ri-fc-strip .ri-fc-card { min-width: 168px; flex: 0 0 168px; }
@media (min-width: 700px) {
  .ri-fc-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    overflow: visible;
  }
  .ri-fc-strip .ri-fc-card { min-width: 0; flex: none; }
}
@media (min-width: 1100px) {
  .ri-fc-strip { grid-template-columns: repeat(6, 1fr); }
}

.ri-fc-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}
.ri-fc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
@media (min-width: 700px) {
  .ri-fc-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1100px) {
  .ri-fc-grid { grid-template-columns: 1fr 1fr 1fr; }
}

.ri-fc-card {
  background: #0b1220;
  border: 1px solid var(--border, #243049);
  border-radius: 12px;
  padding: 10px 11px;
}
.ri-fc-card.stale { border-left: 3px solid #fbbf24; }
.ri-fc-card.unknown { border-left: 3px solid #64748b; }
.ri-fc-card.lags { border-left: 3px solid #fb7185; }
.ri-fc-card .name { font-weight: 800; font-size: 13px; }
.ri-fc-card .etc, .ri-fc-card .pred {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
}
.ri-fc-card .rem {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted, #93a0b8);
  font-weight: 600;
}
.ri-fc-card .flags {
  margin-top: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #fbbf24;
}
.ri-fc-card .note {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted, #93a0b8);
}
.ri-fc-card .dvs { display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 800; }
.ri-fc-card .dvs.ahead { color: #4ade80; }
.ri-fc-card .dvs.behind { color: #fb7185; }
.ri-fc-card .dvs.muted { color: #64748b; }

.ri-fc-stale-note {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--muted, #93a0b8);
}
.ri-fc-banner {
  margin: 8px 0 10px;
  background: rgba(251,191,36,.08);
  border: 1px solid rgba(251,191,36,.28);
  color: #fde68a;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
}
.ri-fc-scen {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
@media (min-width: 700px) {
  .ri-fc-scen { grid-template-columns: repeat(4, 1fr); }
}
.ri-fc-scen-card {
  background: #0b1220;
  border: 1px solid var(--border, #243049);
  border-radius: 12px;
  padding: 10px 11px;
}
.ri-fc-scen-card .sid {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .05em;
  color: var(--accent2, #f5b942);
}
.ri-fc-scen-card .lab { margin-top: 4px; font-weight: 700; font-size: 12px; }
.ri-fc-scen-card .line { margin-top: 4px; font-size: 12px; }
.ri-fc-scen-card .vs { margin-top: 4px; font-size: 11px; color: var(--muted, #93a0b8); }
.ri-fc-callouts {
  background: var(--panel, #121a2b);
  border: 1px solid var(--border, #243049);
  border-radius: 12px;
  padding: 12px 14px;
}
.ri-fc-callouts h3 { margin: 0 0 8px; font-size: 0.9rem; }
.ri-fc-callouts ul { margin: 0; padding-left: 18px; color: var(--muted, #93a0b8); font-size: 13px; }
.ri-fc-callouts li { margin: 4px 0; }
