:root {
  --bg: #f4efe5;
  --bg-strong: #eadfcb;
  --card: rgba(255, 251, 244, 0.93);
  --line: rgba(83, 61, 37, 0.12);
  --text: #23170f;
  --muted: #6d6155;
  --green: #2f7d4a;
  --amber: #b87723;
  --red: #b84c3e;
  --blue: #285dcb;
  --green-soft: rgba(47, 125, 74, 0.11);
  --amber-soft: rgba(184, 119, 35, 0.13);
  --blue-soft: rgba(40, 93, 203, 0.11);
  --neutral-soft: rgba(83, 61, 37, 0.08);
  --shadow: 0 18px 48px rgba(83, 61, 37, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.85), transparent 28%),
    linear-gradient(160deg, #efe1c7 0%, #f7f1e8 42%, #ece6da 100%);
}

.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 18px;
}

.login-card {
  width: min(430px, calc(100vw - 36px));
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(117, 92, 56, 0.12);
  border-radius: 28px;
  padding: 28px;
  box-shadow: 0 24px 90px rgba(83, 61, 37, 0.16);
}

.login-card h1 {
  margin: 0 0 18px;
  font-size: 34px;
}

.login-card label {
  display: block;
  margin: 14px 0;
}

.login-card input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: white;
}

.login-error {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 14px;
  color: #991b1b;
  background: #fee2e2;
  font-weight: 850;
}

.update-strip {
  margin-top: 16px;
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(47, 125, 74, 0.2);
  background: rgba(47, 125, 74, 0.09);
  color: #1f6b48;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 900;
}

.refresh-details {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  max-width: 100%;
}

.refresh-detail-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(83, 61, 37, 0.12);
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  font-size: 13px;
}

.refresh-detail-row span,
.refresh-detail-row b {
  color: var(--text);
}

.refresh-detail-row em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
}

body.is-busy button {
  cursor: wait;
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100vh;
}

.shell.shell-no-sidebar {
  display: block;
}

.top-nav,
.nav {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-link {
  border: 0;
  border-radius: 16px;
  padding: 12px 16px;
  text-align: center;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  background: rgba(255, 251, 244, 0.72);
  border: 1px solid var(--line);
}

.nav-link.is-active {
  background: linear-gradient(135deg, #f1ca76, #eeab5a);
  color: #2d1b10;
  font-weight: 700;
}

.content {
  padding: 24px;
  max-width: 100%;
  overflow-x: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}

.topbar[hidden] {
  display: none !important;
}

.topbar h1 {
  margin: 0 0 6px;
  font-size: 34px;
  line-height: 1;
}

.topbar p {
  margin: 0;
  color: var(--muted);
}

.topbar-actions,
.hero-actions,
.panel-actions,
.inline-actions,
.client-header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.panel-actions,
.hero-actions {
  padding: 8px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(83, 61, 37, 0.09);
}

.primary-button,
.success-button,
.info-button,
.neutral-button,
.ghost-button,
.danger-button {
  border: 0;
  border-radius: 16px;
  min-height: 48px;
  padding: 13px 18px;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.primary-button:hover,
.success-button:hover,
.info-button:hover,
.neutral-button:hover,
.ghost-button:hover,
.danger-button:hover,
.nav-link:hover {
  transform: translateY(-1px);
}

.primary-button,
.success-button {
  color: #fff;
  background: linear-gradient(135deg, #2f8b54, #256d43);
  box-shadow: 0 12px 24px rgba(47, 125, 74, 0.22);
}

.info-button {
  color: #fff;
  background: linear-gradient(135deg, #346fda, #285dcb);
  box-shadow: 0 12px 24px rgba(40, 93, 203, 0.22);
}

.neutral-button {
  color: var(--text);
  background: linear-gradient(135deg, #f1ece4, #ddd5c9);
  border: 1px solid var(--line);
  box-shadow: 0 12px 24px rgba(83, 61, 37, 0.08);
}

.ghost-button {
  color: var(--text);
  background: rgba(255, 251, 244, 0.72);
  border: 1px solid var(--line);
}

.danger-button {
  color: #fff;
  background: linear-gradient(135deg, #c14e40, #9f3427);
}

.top-logout {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.hero-grid,
.stats-row,
.client-top-grid,
.client-middle-grid,
.split-panel,
.queue-hero,
.queue-meta,
.queue-stack,
.queue-mini-grid,
.form-grid {
  display: grid;
  gap: 16px;
}

.hero-grid {
  grid-template-columns: 1.45fr 0.85fr;
  margin-bottom: 18px;
}

.master-progress-card {
  grid-column: 1 / -1;
}

.stats-row {
  grid-template-columns: repeat(5, 1fr);
  margin-bottom: 18px;
}

.client-top-grid {
  grid-template-columns: 1fr 1fr;
  align-items: start;
  margin-bottom: 18px;
}

.client-middle-grid {
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  margin-bottom: 18px;
}

.client-middle-grid > .panel {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.client-middle-grid > .panel .form-actions {
  margin-top: auto;
}

.schedule-panel {
  background: rgba(255, 251, 244, 0.76);
}

.schedule-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.guard-panel {
  margin-bottom: 18px;
}

.client-middle-grid .guard-panel {
  margin-bottom: 0;
}

.client-errors-wide {
  margin-top: 18px;
  margin-bottom: 18px;
}

.guard-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.client-middle-grid .error-panel {
  margin: 0;
}

.split-panel {
  grid-template-columns: 1fr 0.92fr;
}

.queue-hero {
  grid-template-columns: 1.2fr 0.8fr;
}

.hero-card,
.panel,
.stat-card {
  border-radius: 26px;
  background: var(--card);
  border: 1px solid rgba(83, 61, 37, 0.13);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.block-accent-green,
.block-accent-blue,
.block-accent-amber,
.block-accent-red,
.block-accent-neutral {
  position: relative;
  overflow: hidden;
}

.block-accent-green {
  border-color: rgba(47, 125, 74, 0.24);
  box-shadow: inset 5px 0 0 rgba(47, 125, 74, 0.72), var(--shadow);
}

.block-accent-blue {
  border-color: rgba(40, 93, 203, 0.24);
  box-shadow: inset 5px 0 0 rgba(40, 93, 203, 0.72), var(--shadow);
}

.block-accent-amber {
  border-color: rgba(184, 119, 35, 0.25);
  box-shadow: inset 5px 0 0 rgba(184, 119, 35, 0.72), var(--shadow);
}

.block-accent-red {
  border-color: rgba(184, 76, 62, 0.24);
  box-shadow: inset 5px 0 0 rgba(184, 76, 62, 0.72), var(--shadow);
}

.block-accent-neutral {
  border-color: rgba(83, 61, 37, 0.18);
  box-shadow: inset 5px 0 0 rgba(83, 61, 37, 0.22), var(--shadow);
}

.hero-card {
  padding: 22px;
}

.hero-card-main {
  background:
    radial-gradient(circle at top right, rgba(255, 212, 138, 0.42), transparent 30%),
    linear-gradient(135deg, rgba(255, 249, 236, 0.97), rgba(250, 243, 232, 0.92));
}

.hero-card-main h2 {
  margin-bottom: 0;
}

.eyebrow {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(40, 93, 203, 0.1);
  color: var(--blue);
}

.hero-card h2,
.client-header h2 {
  margin: 14px 0 10px;
  font-size: 28px;
  line-height: 1.05;
}

.hero-card p,
.client-header p,
.panel-head p,
.small-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.metric-lg {
  margin-top: 16px;
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
}

.metric-label {
  margin-top: 6px;
  color: var(--muted);
}

.stat-card {
  padding: 18px;
}

.stat-card span {
  color: var(--muted);
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

.queue-stack div,
.queue-mini-grid article {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.74), rgba(255, 251, 244, 0.52));
  border: 1px solid rgba(83, 61, 37, 0.1);
  box-shadow: 0 8px 18px rgba(83, 61, 37, 0.05);
}

.queue-stack span,
.queue-mini-grid span,
.queue-meta span {
  color: var(--muted);
}

.queue-stack strong,
.queue-mini-grid strong {
  font-size: 22px;
}

.queue-stack div:nth-child(1),
.queue-mini-grid article:nth-child(1) {
  border-left: 4px solid rgba(184, 119, 35, 0.72);
}

.queue-stack div:nth-child(2),
.queue-mini-grid article:nth-child(2) {
  border-left: 4px solid rgba(40, 93, 203, 0.72);
}

.queue-stack div:nth-child(3),
.queue-mini-grid article:nth-child(3) {
  border-left: 4px solid rgba(184, 76, 62, 0.72);
}

.panel {
  margin-bottom: 18px;
  padding: 20px;
}

.panel.soft {
  background: rgba(255, 249, 240, 0.88);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 16px;
}

.block-accent-green .eyebrow,
.block-accent-green .panel-head h3 {
  color: var(--green);
}

.block-accent-blue .eyebrow,
.block-accent-blue .panel-head h3 {
  color: var(--blue);
}

.block-accent-amber .eyebrow,
.block-accent-amber .panel-head h3 {
  color: var(--amber);
}

.block-accent-green .queue-progress-card,
.block-accent-green .selection-builder {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.68), var(--green-soft));
}

.block-accent-blue .selection-builder,
.block-accent-blue .queue-progress-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.68), var(--blue-soft));
}

.block-accent-amber .selection-builder {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.68), var(--amber-soft));
}

.panel-head.compact {
  margin-bottom: 14px;
}

.panel-head h3 {
  margin: 0 0 4px;
  font-size: 24px;
}

.period-switch {
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(83, 61, 37, 0.15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.period-button {
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.period-button.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 18px rgba(83, 61, 37, 0.1);
}

.search-input,
.form-grid input,
.input-like,
.bid-textarea,
.compact-input {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(83, 61, 37, 0.18);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.input-like {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-weight: 800;
  color: var(--muted);
}

.search-input:focus,
.form-grid input:focus,
.bid-textarea:focus,
.compact-input:focus {
  outline: 2px solid rgba(40, 93, 203, 0.22);
  border-color: rgba(40, 93, 203, 0.38);
  background: rgba(255, 255, 255, 0.96);
}

.search-input,
.form-grid input,
.compact-input {
  padding: 12px 14px;
}

.failed-bids-textarea {
  min-height: 180px;
  max-height: 360px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  line-height: 1.45;
}

.second-step-status {
  margin-top: 16px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(184, 119, 35, 0.24);
  background:
    radial-gradient(circle at top left, rgba(246, 181, 91, 0.18), transparent 34%),
    rgba(255, 255, 255, 0.66);
}

.second-step-status .progress-bar-fill {
  background: linear-gradient(135deg, #b87723, #2b61cf);
}

.second-step-errors {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.second-step-error-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(184, 76, 62, 0.18);
  background: rgba(255, 247, 243, 0.78);
  color: #7f2e24;
  font-weight: 800;
}

.second-step-error-item code {
  color: inherit;
  font-weight: 950;
}

.guard-snapshot-meta {
  margin: 8px 0 14px;
  color: var(--muted);
  font-weight: 800;
}

.compact-data-table th,
.compact-data-table td {
  white-space: nowrap;
}

.selection-builder {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(83, 61, 37, 0.13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.selection-builder-under-table-tools {
  margin-top: -4px;
  margin-bottom: 16px;
}

.selection-chip {
  color: var(--muted);
  font-size: 14px;
}

.selection-chip strong {
  color: var(--text);
  font-size: 20px;
  margin-left: 6px;
}

.selection-controls {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) repeat(5, minmax(150px, auto));
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.46);
  border: 1px solid rgba(83, 61, 37, 0.08);
}

.selection-controls > button {
  align-self: center;
}

.compact-field {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(40, 93, 203, 0.1), rgba(255, 255, 255, 0.72));
  border: 1px solid rgba(40, 93, 203, 0.22);
  box-shadow: inset 4px 0 0 rgba(40, 93, 203, 0.7);
}

.compact-field span {
  color: var(--blue);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.2;
}

.compact-field .compact-input {
  min-height: 48px;
  border-color: rgba(40, 93, 203, 0.28);
  background: rgba(255, 255, 255, 0.96);
  font-size: 18px;
  font-weight: 900;
}

.form-actions {
  margin-top: 18px;
}

.action-hint,
.run-summary {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.run-summary {
  padding-top: 12px;
  border-top: 1px solid rgba(83, 61, 37, 0.08);
}

.empty-cell {
  padding: 28px !important;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.58);
}

.status-toolbar {
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(83, 61, 37, 0.08);
  background: rgba(255, 255, 255, 0.64);
}

.status-toolbar-title {
  margin-bottom: 10px;
  font-weight: 800;
}

.status-toolbar-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 12px;
  align-items: start;
}

.status-toolbar label,
.status-reason-group {
  display: grid;
  gap: 8px;
}

.status-toolbar span,
.status-reason-group > span {
  font-weight: 700;
  color: var(--text);
}

.status-toolbar select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
}

.status-reason-group label {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}

.table-wrap {
  position: relative;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.42);
}

.table-wrap.tall {
  max-height: 560px;
}

.data-table {
  width: 100%;
  min-width: 1260px;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th,
.data-table td {
  padding: 14px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid rgba(83, 61, 37, 0.08);
  background: rgba(255, 252, 246, 0.85);
}

.checkbox-col {
  width: 56px;
  min-width: 56px;
  text-align: center !important;
}

.row-check {
  width: 18px;
  height: 18px;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #f7ecdc;
  color: #4c3b2b;
  cursor: grab;
}

.data-table th.dragging {
  opacity: 0.4;
}

.header-filter-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.header-sort-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sort-buttons {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sort-button {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(83, 61, 37, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.sort-button.is-active {
  background: rgba(40, 93, 203, 0.14);
  color: var(--blue);
  border-color: rgba(40, 93, 203, 0.32);
}

.header-filter-button {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  border: 1px solid rgba(83, 61, 37, 0.12);
  background: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  font-weight: 800;
  color: var(--text);
}

.sticky-col {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #fff8ef !important;
  box-shadow: 8px 0 20px rgba(83, 61, 37, 0.05);
}

.data-table thead .sticky-col {
  z-index: 8;
  background: #f7ecdc !important;
}

.sticky-col-2 {
  position: sticky;
  z-index: 4;
  background: #fff8ef !important;
  box-shadow: 8px 0 20px rgba(83, 61, 37, 0.05);
}

.data-table thead .sticky-col-2 {
  z-index: 9;
  background: #f7ecdc !important;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
}

.badge.green {
  color: var(--green);
  background: rgba(47, 125, 74, 0.12);
}

.badge.amber {
  color: var(--amber);
  background: rgba(184, 119, 35, 0.14);
}

.badge.blue {
  color: var(--blue);
  background: rgba(40, 93, 203, 0.14);
}

.badge.red {
  color: var(--red);
  background: rgba(184, 76, 62, 0.12);
}

.badge.muted {
  color: #675f54;
  background: rgba(103, 95, 84, 0.12);
}

.schedule-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  border-radius: 999px;
  padding: 0 14px;
  color: #675f54;
  background: rgba(103, 95, 84, 0.12);
  font-size: 14px;
  font-weight: 800;
}

.schedule-status-pill.is-on {
  color: var(--green);
  background: rgba(47, 125, 74, 0.14);
}

.schedule-status-pill.is-danger {
  color: var(--red);
  background: rgba(181, 59, 47, 0.14);
}

.status-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 300px;
}

.status-text {
  color: var(--text);
  white-space: normal;
  line-height: 1.35;
}

.paused-bid {
  color: var(--blue);
  font-weight: 800;
}

.legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
}

.link-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 700;
  cursor: pointer;
}

.table-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 12px;
  color: var(--blue);
  background: rgba(40, 93, 203, 0.1);
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}

.table-link:hover {
  background: rgba(40, 93, 203, 0.16);
}

.table-row-check {
  display: grid;
  place-items: center;
}

.activity-feed {
  display: grid;
  gap: 12px;
}

.activity-item {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(83, 61, 37, 0.08);
}

.activity-item strong {
  display: block;
  margin-bottom: 6px;
}

.activity-item span {
  color: var(--muted);
  font-size: 14px;
}

.run-history-list {
  display: grid;
  gap: 10px;
}

.run-history-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(43, 97, 207, 0.14);
}

.run-history-item span {
  color: var(--muted);
}

.steps-list {
  display: grid;
  gap: 14px;
}

.step-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  align-items: start;
}

.step-item span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  font-weight: 800;
  background: linear-gradient(135deg, #f1ca76, #e7a35a);
}

.step-item strong {
  display: block;
  margin-bottom: 4px;
}

.step-item p {
  margin: 0;
  color: var(--muted);
}

.client-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 20px;
  margin-bottom: 18px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(24, 18, 13, 0.38);
  backdrop-filter: blur(10px);
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-card {
  width: min(860px, 100%);
  max-height: min(90vh, 920px);
  overflow: auto;
  padding: 24px;
  border-radius: 28px;
  background: rgba(255, 251, 244, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 28px 90px rgba(38, 24, 14, 0.22);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 18px;
}

.modal-head h3 {
  margin: 12px 0 0;
  font-size: 28px;
}

.modal-close {
  min-width: 52px;
  padding-inline: 0;
}

.modal-form-grid {
  margin-bottom: 18px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.form-grid {
  grid-template-columns: repeat(2, 1fr);
}

.form-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.form-grid span {
  color: var(--text);
  font-weight: 700;
}

.bid-textarea {
  min-height: 280px;
  margin-bottom: 12px;
  padding: 16px;
  line-height: 1.5;
  resize: vertical;
}

.queue-progress-card {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(83, 61, 37, 0.08);
}

.queue-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.progress-bar {
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(83, 61, 37, 0.08);
}

.progress-bar-fill {
  height: 100%;
  width: 62%;
  border-radius: 999px;
  background: linear-gradient(135deg, #2d8e55, #2b61cf);
}

.queue-meta {
  grid-template-columns: repeat(4, 1fr);
  margin-top: 14px;
}

.error-panel {
  margin: 18px 0;
  background:
    radial-gradient(circle at top right, rgba(184, 76, 62, 0.10), transparent 28%),
    var(--card);
}

.error-list {
  display: grid;
  gap: 10px;
}

.error-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(184, 76, 62, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
}

.error-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 7px;
  font-weight: 900;
}

.error-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.error-message {
  max-width: 100%;
  color: #6f241b;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.error-empty {
  padding: 14px;
  border-radius: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.52);
  font-weight: 800;
}

@media (max-width: 1220px) {
  .hero-grid,
  .stats-row,
  .client-top-grid,
  .client-middle-grid,
  .split-panel,
  .queue-hero {
    grid-template-columns: 1fr 1fr;
  }

  .hero-card-main,
  .queue-progress-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .content {
    padding: 16px;
  }

  .topbar {
    display: grid;
    gap: 14px;
    align-items: start;
  }

  .topbar h1 {
    font-size: 30px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: stretch;
  }

  .topbar-actions > * {
    flex: 1 1 100%;
  }

  .panel-head,
  .client-header {
    display: grid;
    gap: 12px;
    align-items: start;
  }

  .panel-actions,
  .client-header-actions,
  .modal-actions,
  .hero-actions,
  .inline-actions {
    margin-top: 0;
    width: 100%;
  }

  .panel-actions > *,
  .client-header-actions > *,
  .modal-actions > *,
  .hero-actions > *,
  .inline-actions > * {
    flex: 1 1 calc(50% - 8px);
  }

  .selection-controls {
    grid-template-columns: 1fr;
  }

  .status-toolbar-grid {
    grid-template-columns: 1fr;
  }

  .hero-grid,
  .stats-row,
  .client-top-grid,
  .client-middle-grid,
  .split-panel,
  .queue-hero,
  .queue-meta,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .data-table {
    min-width: 1040px;
  }

  .status-cell {
    min-width: 220px;
  }

  .queue-progress-card,
  .hero-card,
  .panel,
  .stat-card,
  .modal-card {
    border-radius: 22px;
  }
}

@media (max-width: 640px) {
  .content {
    padding: 12px;
  }

  .topbar {
    margin-bottom: 16px;
  }

  .topbar h1 {
    font-size: 24px;
    line-height: 1.05;
  }

  .topbar p,
  .panel-head p,
  .client-header p,
  .small-note {
    font-size: 14px;
    line-height: 1.45;
  }

  .panel,
  .hero-card,
  .stat-card {
    padding: 16px;
    margin-bottom: 14px;
  }

  .hero-card h2,
  .client-header h2 {
    margin: 10px 0 8px;
    font-size: 22px;
  }

  .panel-head h3 {
    font-size: 20px;
  }

  .metric-lg {
    font-size: 38px;
  }

  .stat-card strong {
    font-size: 24px;
  }

  .period-switch {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .period-button {
    width: 100%;
    padding: 11px 8px;
    text-align: center;
  }

  .search-input,
  .form-grid input,
  .compact-input,
  .bid-textarea {
    font-size: 16px;
  }

  .selection-builder {
    padding: 12px;
  }

  .panel-actions,
  .hero-actions,
  .selection-controls {
    padding: 8px;
    border-radius: 16px;
  }

  .selection-controls,
  .status-toolbar-grid,
  .form-grid,
  .queue-meta {
    grid-template-columns: 1fr;
  }

  .panel-actions > *,
  .client-header-actions > *,
  .modal-actions > *,
  .hero-actions > *,
  .inline-actions > * {
    flex: 1 1 100%;
  }

  .modal-backdrop {
    padding: 10px;
    align-items: end;
  }

  .modal-card {
    width: 100%;
    max-height: 92vh;
    padding: 18px;
    border-radius: 22px 22px 0 0;
  }

  .modal-head h3 {
    font-size: 24px;
  }

  .queue-progress-head {
    align-items: center;
  }

  .queue-meta span,
  .legend,
  .activity-item span,
  .step-item p,
  .action-hint,
  .run-summary {
    font-size: 13px;
  }

  .legend {
    gap: 10px;
  }

  .data-table {
    min-width: 940px;
  }

  .data-table th,
  .data-table td {
    padding: 12px 10px;
    font-size: 14px;
  }

  .checkbox-col {
    width: 48px;
    min-width: 48px;
  }

  .sticky-col,
  .sticky-col-2 {
    box-shadow: 6px 0 14px rgba(83, 61, 37, 0.05);
  }

  .step-item {
    grid-template-columns: 34px 1fr;
    gap: 10px;
  }

  .step-item span {
    width: 34px;
    height: 34px;
    border-radius: 12px;
  }
}
