.rail-card {
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-xs);
}

.rail-summary {
  overflow: hidden;
  border-color: rgba(255, 255, 255, .08);
  border-top: 5px solid var(--role-accent);
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--role-accent) 22%, transparent), transparent 11rem),
    linear-gradient(150deg, #0f0e0c 0%, #211e1a 100%);
  box-shadow: 0 14px 34px rgba(20, 16, 12, .2);
}

.left-rail > .rail-card:not(.rail-summary) {
  border-top: 3px solid var(--ink-900);
}

.rail-summary .rail-heading h2 {
  color: var(--white);
}

.rail-summary .eyebrow {
  color: #ff8c91;
}

.rail-heading {
  position: relative;
  display: flex;
  margin-bottom: var(--space-3);
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
}

.rail-heading h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.15;
  letter-spacing: -.03em;
}

.rail-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.rail-stat {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 94px;
  padding: 12px;
  grid-template-rows: minmax(22px, auto) auto 1fr;
  align-content: start;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  color: var(--white);
  background: rgba(255, 255, 255, .07);
  text-align: left;
  box-shadow: none;
  transition: border-color var(--motion-fast) ease, background var(--motion-fast) ease, box-shadow var(--motion-fast) ease, transform var(--motion-fast) ease;
}

.rail-stat span,
.rail-extra span {
  display: block;
  color: rgba(255, 254, 250, .62);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: .075em;
  text-transform: uppercase;
}

.rail-stat strong {
  display: block;
  margin: 5px 0 4px;
  font-size: 29px;
  line-height: 1;
  letter-spacing: -.035em;
}

.rail-stat small {
  color: rgba(255, 254, 250, .58);
  font-size: 10px;
  line-height: 1.3;
}

.rail-stat.dark {
  color: var(--white);
  border-color: var(--ink-950);
  background: var(--ink-950);
}

.rail-stat.dark span,
.rail-stat.dark small {
  color: rgba(255, 255, 255, .66);
}

.rail-stat.success {
  border-left: 4px solid var(--success);
  background: rgba(32, 106, 75, .14);
}

.rail-stat.warning {
  border-left: 4px solid var(--warning);
  background: rgba(144, 104, 23, .14);
}

.rail-stat:hover,
.rail-extra button:hover {
  border-color: rgba(255, 255, 255, .35);
  box-shadow: 0 9px 20px rgba(0, 0, 0, .18);
  transform: translateY(-2px);
}

.rail-stat.active,
.rail-stat[aria-pressed="true"] {
  color: var(--white);
  border-color: #f0444a;
  background: linear-gradient(145deg, #ec2a31, var(--brand));
  box-shadow: 0 10px 22px rgba(169, 14, 21, .3);
}

.rail-stat.active span,
.rail-stat.active small,
.rail-stat[aria-pressed="true"] span,
.rail-stat[aria-pressed="true"] small {
  color: rgba(255, 255, 255, .7);
}

.rail-extra {
  display: grid;
  margin-top: var(--space-2);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.rail-extra button {
  display: grid;
  min-width: 0;
  min-height: 72px;
  padding: 10px;
  align-content: start;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 10px;
  color: var(--white);
  background: rgba(255, 255, 255, .055);
  text-align: left;
  transition: border-color var(--motion-fast) ease, background var(--motion-fast) ease, box-shadow var(--motion-fast) ease, transform var(--motion-fast) ease;
}

.rail-extra strong {
  display: block;
  margin-top: 4px;
  font-size: 17px;
  line-height: 1;
}

.rail-extra small {
  display: block;
  margin-top: 4px;
  color: rgba(255, 254, 250, .52);
  font-size: 9px;
  line-height: 1.2;
}

.rail-extra button.active,
.rail-extra button[aria-pressed="true"] {
  color: var(--white);
  border-color: var(--brand);
  background: var(--brand);
  box-shadow: 0 8px 18px rgba(169, 14, 21, .25);
}

.rail-extra button[data-summary-filter="WALK_IN"].active,
.rail-extra button[data-summary-filter="WALK_IN"][aria-pressed="true"] {
  border-color: var(--walkin);
  background: var(--walkin);
}

.rail-extra button.active span,
.rail-extra button.active small,
.rail-extra button[aria-pressed="true"] span,
.rail-extra button[aria-pressed="true"] small {
  color: rgba(255, 255, 255, .72);
}

.activity-list,
.issue-list,
.operator-overview {
  display: grid;
  gap: 0;
}

.activity-item,
.issue-item,
.operator-overview-item {
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child,
.issue-item:last-child,
.operator-overview-item:last-child {
  border-bottom: 0;
}

.activity-item {
  position: relative;
  display: grid;
  padding: 10px 0 10px 12px;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: var(--space-2);
}

.activity-item::before {
  position: absolute;
  top: 14px;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(22, 115, 71, .1);
  content: "";
}

.activity-item.tone-represented::before {
  background: var(--warning);
  box-shadow: 0 0 0 3px rgba(138, 98, 0, .11);
}

.activity-item.tone-walkin::before {
  background: var(--walkin);
  box-shadow: 0 0 0 3px rgba(148, 82, 58, .12);
}

.activity-item.tone-danger::before {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(142, 29, 43, .11);
}

.activity-time {
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 850;
}

.activity-copy strong {
  display: block;
  margin-bottom: 2px;
  font-size: 11.5px;
  line-height: 1.35;
}

.activity-copy p {
  margin: 0;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.4;
}

.issue-item {
  width: 100%;
  padding: 9px var(--space-2);
  border: 0;
  border-bottom: 1px solid var(--border);
  border-left: 4px solid var(--warning);
  color: var(--ink-950);
  background: var(--warning-soft);
  text-align: left;
  cursor: pointer;
}

.issue-item:last-child {
  border-bottom: 0;
}

.issue-item:hover {
  background: #f2e2b8;
}

.issue-item strong,
.issue-item span {
  display: block;
}

.issue-item strong {
  margin-bottom: 2px;
  font-size: 11px;
}

.issue-item span {
  color: var(--warning);
  font-size: 9px;
}

.operator-overview-item {
  display: flex;
  padding: var(--space-2) 0;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.operator-overview-item strong,
.operator-overview-item small {
  display: block;
}

.operator-overview-item strong {
  font-size: 10px;
}

.operator-overview-item small {
  color: var(--text-muted);
  font-size: 9px;
}

.account-status {
  display: inline-flex;
  min-height: 24px;
  padding: var(--space-1) 7px;
  align-items: center;
  border-radius: 999px;
  color: var(--success);
  background: var(--success-soft);
  font-size: 8px;
  font-weight: 950;
  letter-spacing: .06em;
  white-space: nowrap;
}

.operator-modal-card {
  width: min(100%, 1040px);
}

.operator-modal-header {
  display: flex;
  margin-bottom: var(--space-4);
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.operator-table {
  display: grid;
  gap: var(--space-2);
}

.operator-row {
  display: grid;
  padding: var(--space-3);
  grid-template-columns: minmax(150px, 1.2fr) minmax(120px, .8fr) minmax(180px, 1fr) minmax(250px, auto);
  align-items: center;
  gap: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.operator-row.inactive {
  opacity: .6;
  background: var(--surface-muted);
}

.operator-identity strong,
.operator-identity small,
.operator-role small,
.operator-meta small {
  display: block;
}

.operator-identity strong {
  font-size: 13px;
}

.operator-identity small,
.operator-role small,
.operator-meta small {
  margin-top: var(--space-1);
  color: var(--text-muted);
  font-size: 9px;
}

.operator-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.operator-actions .button {
  min-height: 36px;
  padding: var(--space-2) 10px;
  font-size: 10px;
}
