/* RailCAD design tokens + AdminLTE overrides (light industrial) */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Source+Sans+3:wght@400;500;600;700&display=swap');

:root {
  --rc-primary: #0F5C6C;
  --rc-primary-hover: #0C4A57;
  --rc-primary-subtle: #E6F2F4;
  --rc-sidebar: #1A2332;
  --rc-sidebar-hover: #243044;
  --rc-sidebar-text: #C5CDD8;
  --rc-success: #1F7A4D;
  --rc-success-subtle: #E8F6EE;
  --rc-warning: #B7791F;
  --rc-warning-subtle: #FBF0DC;
  --rc-danger: #B42318;
  --rc-danger-subtle: #FCEBEA;
  --rc-info: #2A6F97;
  --rc-info-subtle: #E8F2F8;
  --rc-bg-app: #F3F5F7;
  --rc-bg-surface: #FFFFFF;
  --rc-border: #D7DEE5;
  --rc-text: #1A2332;
  --rc-text-secondary: #5B6B7C;
  --rc-text-muted: #8492A6;
  --rc-radius: 6px;
  --rc-font: 'Source Sans 3', 'Segoe UI', system-ui, sans-serif;
  --rc-mono: 'IBM Plex Mono', Consolas, monospace;
  --bs-primary: #0F5C6C;
  --bs-primary-rgb: 15, 92, 108;
  --bs-success: #1F7A4D;
  --bs-warning: #B7791F;
  --bs-danger: #B42318;
  --bs-info: #2A6F97;
  --bs-body-font-family: var(--rc-font);
  --bs-body-color: var(--rc-text);
  --bs-border-radius: var(--rc-radius);
}

html, body { font-family: var(--rc-font); background: var(--rc-bg-app); color: var(--rc-text); }
.mono, .rc-mono { font-family: var(--rc-mono); font-size: 0.92em; }

/* Sidebar brand */
.app-sidebar { background: var(--rc-sidebar) !important; }
.sidebar-brand {
  color: #fff !important;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
}
.sidebar-brand .brand-link {
  display: flex !important;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  color: #fff !important;
  text-decoration: none;
  width: 100%;
}
.sidebar-brand .brand-image,
.sidebar-brand img.brand-image {
  width: 32px !important;
  height: 32px !important;
  max-height: 32px !important;
  object-fit: contain;
  border-radius: 8px;
  margin: 0 !important;
  float: none !important;
  opacity: 1 !important;
  box-shadow: none !important;
}
.sidebar-brand .brand-text {
  font-size: 1.05rem;
  line-height: 1.2;
  margin: 0;
}

/* Nav icons: left-aligned column, text beside — fix AdminLTE/FA drift */
.app-sidebar .sidebar-menu .nav-link,
.app-sidebar .nav-sidebar .nav-link {
  display: flex !important;
  align-items: center !important;
  gap: 0.75rem;
  color: var(--rc-sidebar-text) !important;
  padding: 0.55rem 1rem !important;
}
.app-sidebar .sidebar-menu .nav-link:hover,
.app-sidebar .nav-sidebar .nav-link:hover {
  background: var(--rc-sidebar-hover) !important;
  color: #fff !important;
}
.app-sidebar .sidebar-menu .nav-link.active,
.app-sidebar .nav-sidebar .nav-link.active {
  background: var(--rc-primary) !important;
  color: #fff !important;
}
.app-sidebar .nav-icon {
  width: 1.35rem !important;
  min-width: 1.35rem;
  height: 1.35rem;
  margin: 0 !important;
  padding: 0 !important;
  flex-shrink: 0;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1 !important;
  position: static !important;
  float: none !important;
}
.app-sidebar .nav-link p {
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.3;
  white-space: nowrap;
}
/* Keep badge left of arrow; AdminLTE absolute-positions .nav-arrow at right:1rem */
.app-sidebar .nav-link p .badge {
  flex-shrink: 0;
  margin-left: 0 !important;
  margin-right: 0.15rem;
}
.app-sidebar .nav-arrow {
  position: static !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  transform: none;
  margin-left: auto;
  flex-shrink: 0;
  font-size: 0.75rem;
  transition: transform ease-in-out 0.3s;
}
.app-sidebar .menu-open > .nav-link .nav-arrow {
  transform: rotate(90deg) !important;
}
.app-sidebar .nav-header,
.app-sidebar .nav-sidebar .nav-header {
  color: #7A8799 !important;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 0.75rem;
  padding: 0.5rem 1rem 0.25rem !important;
}
/* Treeview indent */
.app-sidebar .nav-treeview {
  padding-left: 0;
}
.app-sidebar .nav-treeview .nav-link {
  padding-left: 2.75rem !important;
}
.app-sidebar .nav-treeview .nav-icon {
  font-size: 0.55rem;
  width: 0.85rem !important;
  min-width: 0.85rem;
}

/* Topbar / auth brand mark */
.rc-brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
}
.auth-brand .logo-mark {
  width: 56px;
  height: 56px;
  padding: 0;
  background: transparent;
  border-radius: 12px;
  overflow: hidden;
}
.auth-brand .logo-mark img {
  width: 100%;
  height: 100%;
  display: block;
}

.app-header { border-bottom: 1px solid var(--rc-border); background: #fff; }
.app-main { background: var(--rc-bg-app); }
.app-content-header h3 { font-weight: 600; font-size: 1.35rem; }

.card { border: 1px solid var(--rc-border); border-radius: var(--rc-radius); box-shadow: 0 1px 2px rgba(26,35,50,0.06); }
.card-header { background: #fff; border-bottom: 1px solid var(--rc-border); font-weight: 600; }

.btn-primary { background: var(--rc-primary); border-color: var(--rc-primary); }
.btn-primary:hover, .btn-primary:focus { background: var(--rc-primary-hover); border-color: var(--rc-primary-hover); }

/* Status badges — override Bootstrap .badge white text (--bs-badge-color) */
.badge.rc-status {
  --bs-badge-color: var(--rc-text);
  color: var(--bs-badge-color);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  padding: 0.35em 0.65em;
  border-radius: 999px;
  border: 1px solid transparent;
  line-height: 1.25;
}
.badge.rc-status.rc-status-pending {
  background-color: #EEF1F4;
  border-color: #D7DEE5;
  --bs-badge-color: #3D4F61;
  color: #3D4F61;
}
.badge.rc-status.rc-status-processing {
  background-color: var(--rc-info-subtle);
  border-color: #b7d4e6;
  --bs-badge-color: #1A5678;
  color: #1A5678;
}
.badge.rc-status.rc-status-done,
.badge.rc-status.rc-status-active,
.badge.rc-status.rc-status-paid {
  background-color: var(--rc-success-subtle);
  border-color: #b8dfc8;
  --bs-badge-color: #145C38;
  color: #145C38;
}
.badge.rc-status.rc-status-validation_fail,
.badge.rc-status.rc-status-expired,
.badge.rc-status.rc-status-locked {
  background-color: var(--rc-warning-subtle);
  border-color: #ebd4a2;
  --bs-badge-color: #8A5A12;
  color: #8A5A12;
}
.badge.rc-status.rc-status-failed,
.badge.rc-status.rc-status-suspended,
.badge.rc-status.rc-status-void {
  background-color: var(--rc-danger-subtle);
  border-color: #f0b4af;
  --bs-badge-color: #8F1C14;
  color: #8F1C14;
}
.badge.rc-status.rc-status-canceled,
.badge.rc-status.rc-status-draft {
  background-color: #EEF1F4;
  border-color: #D7DEE5;
  --bs-badge-color: #3D4F61;
  color: #3D4F61;
}
.badge.rc-status.rc-status-sent {
  background-color: var(--rc-info-subtle);
  border-color: #b7d4e6;
  --bs-badge-color: #1A5678;
  color: #1A5678;
}

.rc-dropzone {
  border: 2px dashed var(--rc-border);
  border-radius: 8px;
  background: #fafbfc;
  padding: 2.5rem 1.5rem;
  text-align: center;
  transition: border-color .15s, background .15s;
  cursor: pointer;
}
.rc-dropzone:hover, .rc-dropzone.is-dragover {
  border-color: var(--rc-primary);
  background: var(--rc-primary-subtle);
}
.rc-dropzone .rc-dropzone-icon { font-size: 2rem; color: var(--rc-primary); margin-bottom: 0.5rem; }

.rc-empty { text-align: center; padding: 3rem 1.5rem; color: var(--rc-text-muted); }
.rc-empty i { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.55; }
.rc-empty h4 { color: var(--rc-text); font-size: 1.1rem; }

.rc-sticky-actions {
  position: sticky; top: 0; z-index: 20;
  background: rgba(243,245,247,0.92); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rc-border); padding: 0.75rem 0; margin: -0.25rem 0 1rem;
}
.rc-jump-nav a { color: var(--rc-text-secondary); text-decoration: none; margin-right: 1rem; font-size: 0.875rem; font-weight: 500; }
.rc-jump-nav a:hover { color: var(--rc-primary); }

.rc-template-chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: var(--rc-bg-app); border: 1px solid var(--rc-border);
  border-radius: 4px; padding: 0.25rem 0.55rem; font-size: 0.8rem; margin: 0.15rem;
}
.rc-template-chip .badge { font-size: 0.65rem; }

.rc-kpi { border-left: 3px solid var(--rc-primary); }
.rc-kpi .rc-kpi-value { font-size: 1.75rem; font-weight: 600; line-height: 1.2; }
.rc-kpi .rc-kpi-label { color: var(--rc-text-muted); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }

.rc-perm-key { font-family: var(--rc-mono); font-size: 0.72rem; color: var(--rc-text-muted); }
.rc-perm-group { border: 1px solid var(--rc-border); border-radius: var(--rc-radius); margin-bottom: 1rem; }
.rc-perm-group-header { background: #f8fafb; padding: 0.65rem 1rem; font-weight: 600; border-bottom: 1px solid var(--rc-border); }
.rc-perm-row { padding: 0.55rem 1rem; border-bottom: 1px solid #eef1f4; display: flex; align-items: flex-start; gap: 0.75rem; }
.rc-perm-row:last-child { border-bottom: 0; }

.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background:
    linear-gradient(160deg, #e8eef1 0%, #f3f5f7 40%, #dde8eb 100%);
}
.auth-card { width: 100%; max-width: 400px; border: 1px solid var(--rc-border); box-shadow: 0 2px 12px rgba(26,35,50,0.08); }
.auth-brand { text-align: center; margin-bottom: 1.25rem; }
.auth-brand .logo-mark {
  width: 48px; height: 48px; border-radius: 8px; background: var(--rc-primary);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.1rem; margin-bottom: 0.5rem;
}
.auth-brand h1 { font-size: 1.5rem; font-weight: 600; margin: 0; }

.tenant-switcher { min-width: 160px; font-size: 0.875rem; }

/* Annotation callouts in mockups */
.rc-anno {
  border-left: 3px solid #7C3AED; background: #F5F3FF; color: #4C1D95;
  font-size: 0.8rem; padding: 0.5rem 0.75rem; margin: 0.5rem 0 1rem; border-radius: 0 4px 4px 0;
}
.rc-anno strong { font-weight: 600; }

.table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--rc-text-secondary);
  font-weight: 700;
  white-space: nowrap;
  vertical-align: middle;
  background: #E8EEF2;
  border-bottom: 1px solid var(--rc-border) !important;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  box-shadow: inset 0 -1px 0 var(--rc-border);
}
.table thead th:first-child {
  padding-left: 1rem;
}
.table thead th:last-child {
  padding-right: 1rem;
}
.table tbody td:first-child {
  padding-left: 1rem;
}
.table tbody td:last-child {
  padding-right: 1rem;
}
.card > .card-body.p-0 > .table-responsive > .table,
.card > .card-body.p-0 > .table {
  margin-bottom: 0;
}
.card > .card-body.p-0 > .table-responsive > .table thead th:first-child,
.card > .card-body.p-0 > .table thead th:first-child {
  border-top-left-radius: calc(var(--rc-radius) - 1px);
}
.card > .card-body.p-0 > .table-responsive > .table thead th:last-child,
.card > .card-body.p-0 > .table thead th:last-child {
  border-top-right-radius: calc(var(--rc-radius) - 1px);
}
.table td { vertical-align: middle; font-size: 0.875rem; }

.progress { height: 0.5rem; }
.jq-toast-wrap { z-index: 1080 !important; }

/* ── In-app notifications ── */
.rc-notif-toggle {
  position: relative;
  padding: 0.5rem 0.75rem !important;
}
.rc-notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 4px;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.05rem;
  text-align: center;
  border-radius: 999px;
  background: var(--rc-danger);
  color: #fff;
}
.rc-notif-menu {
  width: 360px;
  max-width: calc(100vw - 1.5rem);
  padding: 0;
  border: 1px solid var(--rc-border);
  box-shadow: 0 8px 24px rgba(26, 35, 50, 0.12);
  overflow: hidden;
}
.rc-notif-menu .dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  margin: 0;
  background: #fff;
  border-bottom: 1px solid var(--rc-border);
  font-weight: 600;
  color: var(--rc-text);
}
.rc-notif-menu .dropdown-header .btn-link {
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0;
}
.rc-notif-list {
  max-height: 360px;
  overflow-y: auto;
}
.rc-notif-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #eef1f4;
  text-decoration: none;
  color: inherit;
  background: #fff;
  transition: background 0.12s;
}
.rc-notif-item:hover { background: var(--rc-bg-app); color: inherit; }
.rc-notif-item.unread { background: var(--rc-primary-subtle); }
.rc-notif-item.unread:hover { background: #d9ecef; }
.rc-notif-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
}
.rc-notif-icon.success { background: var(--rc-success-subtle); color: var(--rc-success); }
.rc-notif-icon.warning { background: var(--rc-warning-subtle); color: var(--rc-warning); }
.rc-notif-icon.danger { background: var(--rc-danger-subtle); color: var(--rc-danger); }
.rc-notif-icon.info { background: var(--rc-info-subtle); color: var(--rc-info); }
.rc-notif-icon.muted { background: #EEF1F4; color: var(--rc-text-muted); }
.rc-notif-body { flex: 1; min-width: 0; }
.rc-notif-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 0.15rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}
.rc-notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rc-primary);
  flex-shrink: 0;
  margin-top: 0.35rem;
}
.rc-notif-text {
  font-size: 0.78rem;
  color: var(--rc-text-secondary);
  margin: 0;
  line-height: 1.35;
}
.rc-notif-time {
  font-size: 0.7rem;
  color: var(--rc-text-muted);
  margin-top: 0.25rem;
}
.rc-notif-footer {
  display: block;
  text-align: center;
  padding: 0.65rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-top: 1px solid var(--rc-border);
  background: #fafbfc;
  color: var(--rc-primary);
  text-decoration: none;
}
.rc-notif-footer:hover { background: var(--rc-primary-subtle); color: var(--rc-primary-hover); }
.rc-notif-empty {
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--rc-text-muted);
  font-size: 0.85rem;
}
.rc-notif-empty i {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
  display: block;
}

/* Full notifications page rows */
.rc-notif-page-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--rc-border);
  align-items: flex-start;
}
.rc-notif-page-item.unread { background: var(--rc-primary-subtle); }
.rc-notif-page-item:last-child { border-bottom: 0; }


/* —— Job detail parity (frontend job.php) —— */
.job-page-nav.page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(243, 245, 247, 0.94);
  backdrop-filter: blur(6px);
  padding: 8px 0;
}
.job-page-nav a {
  text-decoration: none;
  color: var(--rc-text);
  background: #fff;
  border: 1px solid var(--rc-border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 500;
}
.job-page-nav a:hover {
  border-color: var(--rc-primary);
  color: var(--rc-primary);
  background: var(--rc-primary-subtle);
}

.job-hero-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}
.eyebrow {
  margin: 0 0 4px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rc-text-muted);
}
.job-title { margin: 0; color: var(--rc-text); }
.job-sub { margin: 6px 0 0; color: var(--rc-text-secondary); font-size: 0.9rem; }
.job-hero-status { flex-shrink: 0; }

.rc-metric-strip,
.metric-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 1.25rem;
}
.rc-metric-strip .metric,
.metric-strip .metric {
  background: #f8fafc;
  border: 1px solid var(--rc-border);
  border-radius: var(--rc-radius);
  padding: 12px;
  min-width: 0;
}
.metric-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--rc-text-muted);
  margin-bottom: 4px;
}
.rc-metric-strip .metric strong,
.metric-strip .metric strong {
  display: block;
  font-size: 0.95rem;
  word-break: break-word;
}
.metric-file { font-size: 0.8rem !important; }

.job-pipeline,
.pipeline {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.job-pipeline li,
.pipeline li {
  border: 1px solid var(--rc-border);
  border-radius: var(--rc-radius);
  padding: 12px;
  background: #fff;
  border-top: 3px solid #cbd5e1;
}
.job-pipeline .pipe-step,
.pipeline .pipe-step {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--rc-text-muted);
}
.job-pipeline .pipe-name,
.pipeline .pipe-name {
  display: block;
  font-weight: 600;
  margin: 4px 0;
  color: var(--rc-text);
}
.job-pipeline .pipe-state,
.pipeline .pipe-state {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.pipe-pass { border-top-color: #059669 !important; }
.pipe-pass .pipe-state { color: #065f46; }
.pipe-fail { border-top-color: #dc2626 !important; }
.pipe-fail .pipe-state { color: #991b1b; }
.pipe-active { border-top-color: #2563eb !important; }
.pipe-active .pipe-state { color: #1d4ed8; }
.pipe-pending .pipe-state { color: var(--rc-text-muted); }

.job-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.generate-hint { flex-basis: 100%; margin: 0; }

.processing-card { border-left: 4px solid var(--rc-info); }
.processing-spinner {
  margin: 0;
  padding-left: 28px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%232A6F97' stroke-width='2'%3E%3Cpath d='M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83'/%3E%3C/svg%3E") left center no-repeat;
  animation: rc-pulse 1.5s ease-in-out infinite;
}
@keyframes rc-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

.card-v1-fail { border-left: 4px solid var(--rc-danger); }
.issue-list { list-style: none; margin: 0; padding: 0; }
.issue-item {
  padding: 8px 0;
  border-bottom: 1px solid #eef1f4;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.issue-item:last-child { border-bottom: none; }

.template-panel {
  padding: 12px 16px;
  border-radius: var(--rc-radius);
  background: #f9fafb;
  border: 1px solid var(--rc-border);
  height: 100%;
}
.template-panel.template-missing {
  border-color: #fecaca;
  background: #fef2f2;
}
.template-panel code {
  font-size: 0.85rem;
  background: #e5e7eb;
  padding: 2px 6px;
  border-radius: 4px;
}
.meta-dl dt { font-weight: 600; color: var(--rc-text-muted); font-size: 0.8rem; }
.meta-dl dd { margin-bottom: 0.5rem; }

.validation-summary {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.validation-summary .stat {
  padding: 12px 20px;
  border-radius: var(--rc-radius);
  background: #f9fafb;
  border: 1px solid var(--rc-border);
  min-width: 160px;
}
.validation-summary .stat strong { display: block; font-size: 1.15rem; margin: 4px 0; }

.validation-filters .tab.active {
  background: var(--rc-primary) !important;
  border-color: var(--rc-primary) !important;
  color: #fff !important;
}
.row-green { background: #ecfdf5; }
.row-red { background: #fef2f2; }
.table-scroll { max-height: 400px; overflow: auto; }

.dl-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--rc-text-secondary);
}
.dl-legend-item { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dl-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}
.dl-pill-combined { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.dl-pill-holes { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.dl-pill-nuts { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }

.dl-packages {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}
.dl-package {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #fff;
  min-height: 168px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.dl-package:hover {
  border-color: #94a3b8;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}
.dl-package-combined { border-color: #6ee7b7; border-top: 3px solid #059669; }
.dl-package-holes { border-color: #93c5fd; border-top: 3px solid #2563eb; }
.dl-package-nuts { border-color: #fdba74; border-top: 3px solid #ea580c; }
.dl-package-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dl-package-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  color: var(--rc-text);
  line-height: 1.3;
}
.dl-package-desc {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--rc-text-secondary);
  min-height: 2.9em;
}
.dl-package-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: auto;
  min-height: 34px;
}
.dl-package-meta {
  margin: 0;
  font-size: 0.75rem;
  color: var(--rc-text-muted);
}

.download-group-title {
  margin: 0 0 8px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--rc-text-muted);
}
.download-list {
  border: 1px solid var(--rc-border);
  border-radius: var(--rc-radius);
  overflow: hidden;
}
.download-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rc-border);
  background: #fff;
}
.download-item:last-child { border-bottom: none; }
.download-item:hover { background: #f9fafb; }
.download-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.download-name { font-weight: 600; font-size: 0.9rem; }
.download-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--rc-text-muted);
}
.download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.detail-panel summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--rc-text);
}

/* Jobs list filters */
.jobs-filter-card .card-body { padding: 1rem 1.15rem; }
.jobs-filter-primary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
}
.jobs-filter-search { flex: 1 1 280px; min-width: 220px; }
.jobs-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.jobs-filter-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rc-text-muted);
  margin-bottom: 0.4rem;
}
.jobs-status-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.jobs-status-chip {
  display: inline-flex;
  align-items: center;
  margin: 0;
  cursor: pointer;
  user-select: none;
}
.jobs-status-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.jobs-status-chip span {
  display: inline-block;
  padding: 0.28rem 0.7rem;
  border: 1px solid var(--rc-border);
  border-radius: 999px;
  background: #fff;
  color: var(--rc-text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.jobs-status-chip:hover span {
  border-color: #94a3b8;
  color: var(--rc-text);
}
.jobs-status-chip.is-active span {
  background: var(--rc-primary-subtle);
  border-color: var(--rc-primary);
  color: var(--rc-primary);
}
.jobs-filter-advanced {
  display: none;
  border-top: 1px solid var(--rc-border);
  margin-top: 0.85rem;
  padding-top: 0.15rem;
}
.jobs-filter-advanced.is-open { display: block; }
.jobs-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  padding-top: 0.85rem;
  border-top: 1px solid #eef1f4;
}
.jobs-active-filters-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--rc-text-muted);
  margin-right: 0.25rem;
}
.jobs-chip-remove {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--rc-bg-app);
  border: 1px solid var(--rc-border);
  color: var(--rc-text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
}
.jobs-chip-remove:hover {
  background: var(--rc-danger-subtle);
  border-color: #f0b4af;
  color: var(--rc-danger);
}
.jobs-result-meta {
  font-size: 0.875rem;
  color: var(--rc-text-secondary);
}
.jobs-pagination {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.jobs-page-indicator {
  font-size: 0.8rem;
  color: var(--rc-text-muted);
  font-weight: 600;
}

/* Professional list pagination */
.list-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}
.list-pagination-meta {
  font-size: 0.875rem;
  color: var(--rc-text-secondary);
}
.list-pagination-sep {
  margin: 0 0.35rem;
  color: var(--rc-text-muted);
}
.list-pagination-nav {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}
.list-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.45rem;
  border: 1px solid var(--rc-border);
  border-radius: var(--rc-radius);
  background: #fff;
  color: var(--rc-text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
}
a.list-page-btn:hover {
  border-color: var(--rc-primary);
  color: var(--rc-primary);
  background: var(--rc-primary-subtle);
}
.list-page-btn.is-current {
  background: var(--rc-primary);
  border-color: var(--rc-primary);
  color: #fff;
  cursor: default;
}
.list-page-btn.is-disabled {
  opacity: 0.38;
  cursor: not-allowed;
  background: #f8fafb;
}
.list-page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  color: var(--rc-text-muted);
  font-weight: 600;
  user-select: none;
}
.list-pagination-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--rc-border);
  background: #fafbfc;
}
.list-pagination-inline {
  padding: 0;
}

/* Bulk select */
.bulk-action-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  margin-bottom: 0.75rem;
}
.bulk-action-bar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.9rem;
  background: #fff;
  border: 1px solid var(--rc-border);
  border-left: 3px solid var(--rc-danger);
  border-radius: var(--rc-radius);
  box-shadow: 0 2px 8px rgba(26, 35, 50, 0.06);
}
.bulk-action-count {
  font-size: 0.875rem;
  color: var(--rc-text-secondary);
  margin-right: auto;
}
.table .bulk-col {
  width: 2.25rem;
  vertical-align: middle;
}
.table .bulk-check,
.table .bulk-check-all {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

/* Usage quick period chips */
.usage-range-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.usage-range-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--rc-border);
  border-radius: var(--rc-radius);
  background: #fff;
  color: var(--rc-text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
}
.usage-range-chip:hover {
  border-color: var(--rc-primary);
  color: var(--rc-primary);
  background: var(--rc-primary-subtle);
}
.usage-range-chip.is-active {
  background: var(--rc-primary);
  border-color: var(--rc-primary);
  color: #fff;
}

@media (max-width: 960px) {
  .rc-metric-strip,
  .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .job-pipeline,
  .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dl-packages { grid-template-columns: 1fr; }
  .dl-package { min-height: 0; }
  .dl-package-desc { min-height: 0; }
}
@media (max-width: 560px) {
  .job-hero-top { flex-direction: column; }
  .download-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .download-actions { width: 100%; }
}

/* Upload dropzone */
.rc-dropzone {
  position: relative;
  border: 2px dashed var(--rc-border);
  border-radius: var(--rc-radius);
  background: var(--rc-bg-surface);
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.rc-dropzone:hover,
.rc-dropzone:focus {
  border-color: var(--rc-primary);
  background: var(--rc-primary-subtle);
  outline: none;
}
.rc-dropzone.is-dragover {
  border-color: var(--rc-primary);
  background: var(--rc-primary-subtle);
}
.rc-dropzone.has-file {
  border-style: solid;
  border-color: var(--rc-primary);
}
.rc-dropzone-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.rc-dropzone-file {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--rc-text);
}
.job-status-banner.sticky-top {
  top: 0.5rem;
  z-index: 1020;
}

/* Shared empty / loading states */
.rc-empty-state {
  text-align: center;
  padding: 2.5rem 1.25rem;
  color: var(--rc-text-muted);
}
.rc-empty-state .rc-empty-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  opacity: 0.7;
}
.rc-empty-state h4 {
  color: var(--rc-text);
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}
.rc-table-loading td {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--rc-text-muted);
}
.rc-table-loading .spinner-border {
  width: 1.5rem;
  height: 1.5rem;
}
