body { font-family: Inter, Arial, sans-serif; margin: 0; background: #f4f6fb; color: #1f2937; }
body.modal-open { overflow: hidden; }
.hidden { display: none !important; }
header { background: linear-gradient(135deg, #0b132a 0%, #111827 55%, #1d4ed8 100%); color: #fff; padding: 14px 20px; }
header h1 { margin: 0 0 4px; font-size: 20px; }
header .hint { color: #cbd5e1; font-size: 13px; }
main { padding: 16px; display: grid; gap: 14px; }
.card { background: #fff; border-radius: 10px; padding: 14px; box-shadow: 0 2px 12px rgba(0,0,0,.06); border: 1px solid rgba(148, 163, 184, 0.2); }
h2 { margin: 0 0 10px; }
h3 { margin: 16px 0 8px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(120px, 1fr)); gap: 10px; }
.grid3.report-compact { grid-template-columns: 120px 170px 150px; gap: 8px; align-items: end; }
.grid3.report-compact label { font-size: 12px; gap: 4px; }
.grid3.report-compact input { padding: 6px 8px; font-size: 13px; }
#op-point-name { max-width: 170px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.mt { margin-top: 10px; }
label { font-size: 13px; display: flex; flex-direction: column; gap: 5px; }
input, select, button { font-size: 14px; padding: 8px; border-radius: 8px; border: 1px solid #c7d2fe; }
button { background: #2563eb; color: #fff; border: none; cursor: pointer; transition: transform .08s ease, box-shadow .15s ease, background .2s ease; }
button:hover { background: #1d4ed8; box-shadow: 0 4px 12px rgba(29, 78, 216, 0.32); }
button:active { transform: translateY(1px); }
a { color: #1d4ed8; text-decoration: none; font-weight: 600; }
.as-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #334155;
  color: #e2e8f0;
  background: transparent;
  line-height: 1.2;
}
.as-btn:hover { background: rgba(148, 163, 184, 0.1); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px; border-bottom: 1px solid #e5e7eb; text-align: left; }
tr:hover { background: #f9fafb; }
#mx-reports-table.compact th,
#mx-reports-table.compact td {
  padding: 5px 6px;
  font-size: 12px;
}
#mx-reports-table.compact .mx-actions-cell {
  gap: 4px;
}
#mx-reports-table.compact .mx-actions-cell .ghost {
  padding: 5px 6px;
  font-size: 12px;
}
pre { background: #0b1020; color: #bef264; padding: 12px; border-radius: 8px; max-height: 240px; overflow: auto; font-size: 12px; }
.inline-check { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; }
.inline-check input { margin: 0; }
.selected-row { outline: 2px solid rgba(37, 99, 235, 0.35); }

.workflow-steps { display:flex; gap:8px; flex-wrap:wrap; }
.wf-step { font-size:12px; padding:4px 8px; border-radius:999px; border:1px solid #cbd5e1; color:#475569; background:#f8fafc; }
.wf-step.current { border-color:#93c5fd; background:#eff6ff; color:#1d4ed8; }
.wf-step.done { border-color:#86efac; background:#f0fdf4; color:#166534; }
.wf-step.ready { border-color:#fcd34d; background:#fefce8; color:#92400e; }

.mx-row-new {
  background: rgba(34, 197, 94, 0.12);
}

.mx-row-viewed {
  opacity: 0.92;
}

.mx-new-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: 6px;
  background: rgba(34, 197, 94, 0.25);
  color: #86efac;
  font-size: 10px;
  font-weight: 700;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #e5e7eb;
  color: #111827;
}

.status-chip.status-in_review_maxim { background: rgba(59, 130, 246, 0.22); color: #dbeafe; }
.status-chip.status-returned { background: rgba(245, 158, 11, 0.24); color: #fef3c7; }
.status-chip.status-qc_passed { background: rgba(16, 185, 129, 0.24); color: #d1fae5; }
.status-chip.status-qc_failed { background: rgba(239, 68, 68, 0.24); color: #fee2e2; }
.status-chip.status-approved,
.status-chip.status-sent { background: rgba(34, 197, 94, 0.24); color: #dcfce7; }
.status-chip.status-ok { background: rgba(34, 197, 94, 0.24); color: #dcfce7; }
.status-chip.status-risk { background: rgba(245, 158, 11, 0.24); color: #fef3c7; }
.status-chip.status-breach { background: rgba(239, 68, 68, 0.24); color: #fee2e2; }

.mx-actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.mx-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 8px;
}

.mx-kpi-card {
  border: 1px solid #2a3f68;
  border-radius: 10px;
  background: #0c1730;
  padding: 8px 10px;
  display: grid;
  gap: 3px;
}

.mx-kpi-label {
  color: #93c5fd;
  font-size: 11px;
  letter-spacing: .2px;
}

.mx-kpi-card b {
  color: #e2e8f0;
  font-size: 18px;
  line-height: 1.1;
}

.report-details {
  margin-top: 12px;
  border: 1px solid #253963;
  border-radius: 10px;
  padding: 10px;
  background: #0c1730;
}

.report-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 8px;
}

.report-list {
  margin: 8px 0 0;
  padding-left: 16px;
  display: grid;
  gap: 6px;
}

.report-list li { font-size: 13px; }
.report-list li.qc-ok { color: #86efac; }
.report-list li.qc-bad { color: #fca5a5; }

.mx-ops-card { display: grid; gap: 12px; }
.mx-ops-group {
  border: 1px solid #d7e3ff;
  border-radius: 10px;
  background: #f7faff;
  padding: 10px;
}
.mx-ops-group h3 { margin: 0 0 10px; font-size: 14px; }
.mx-ops-row-tight { margin-top: 6px; }
.mx-inline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.mx-pass-field { min-width: 320px; flex: 1; }
.mx-pass-field input[readonly] {
  background: #0a1328;
  border-color: #334155;
  color: #bfdbfe;
}
.mx-check-dropdown {
  position: relative;
  min-width: 260px;
}
.mx-check-dropdown > summary {
  list-style: none;
  cursor: pointer;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 8px 10px;
  color: #e2e8f0;
  background: transparent;
  user-select: none;
}
.mx-check-dropdown > summary::-webkit-details-marker { display: none; }
.mx-check-dropdown > summary::after {
  content: '▾';
  float: right;
  opacity: .8;
}
.mx-check-dropdown[open] > summary::after { content: '▴'; }
.mx-check-dropdown-body {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  width: min(560px, 88vw);
  border: 1px solid #2a3f68;
  border-radius: 10px;
  background: #0c1730;
  padding: 8px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.35);
}
.mx-bulk-list {
  margin-top: 6px;
  max-height: 140px;
  overflow: auto;
  border: 1px solid #2a3f68;
  border-radius: 8px;
  padding: 6px 8px;
  display: grid;
  gap: 4px;
  background: #0a1328;
}

.mx-finance-panel {
  border: 1px solid #2a3f68;
  border-radius: 10px;
  padding: 10px;
  background: #0c1730;
}

.mx-finance-title {
  font-size: 13px;
  font-weight: 700;
  color: #bfdbfe;
  margin-bottom: 8px;
}

.mx-finance-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
  align-items: end;
}

.mx-finance-actions {
  margin-top: 0;
  justify-content: flex-start;
}

.mx-reg-flow {
  border: 1px dashed #365a96;
  border-radius: 10px;
  padding: 10px;
  background: rgba(37, 99, 235, 0.08);
}

.mx-reg-step {
  font-size: 13px;
  color: #dbeafe;
}
.mx-bulk-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 2px 2px;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.25);
}
.mx-bulk-item:last-child { border-bottom: none; }
.mx-bulk-item input[type="checkbox"] { margin: 0; }
.mx-doc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.mx-doc-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #93c5fd;
  border: 1px solid #334155;
  border-radius: 999px;
  padding: 2px 8px;
}
.mx-doc-link.missing {
  color: #94a3b8;
  border-style: dashed;
}
.mx-launch-grid { flex-wrap: wrap; gap: 10px; }
.mx-launch-grid .ghost {
  min-width: 220px;
  justify-content: flex-start;
  text-align: left;
  padding: 10px 12px;
}
.mx-dashboard-modal { z-index: 95; }
.mx-dashboard-modal .modal-content.large { max-width: min(1400px, 96vw); }
.mx-dashboard-modal .modal-header {
  position: sticky;
  top: 0;
  background: #101b33;
  padding: 6px 0;
  z-index: 7;
}
.mx-dashboard-modal table thead th {
  position: sticky;
  top: 44px;
  background: #101b33;
  z-index: 6;
}
.mx-dashboard-modal .report-details {
  max-height: 58vh;
  overflow: auto;
}

@media (max-width: 900px) {
  .report-summary-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .grid3 { grid-template-columns: 1fr; }
  .mx-kpi-grid { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .mx-finance-grid { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
}

body.dark { background: #1c2538; color: #eaf1ff; }
body.dark header { background: linear-gradient(135deg, #1f2b44 0%, #2a3653 60%, #3a4b72 100%); }
body.dark .card { background: #2a3653; color: #eaf1ff; box-shadow: 0 2px 12px rgba(0,0,0,.18); }
body.dark input, body.dark select { background: #e9eef8; color: #111827; border: 1px solid #a8b6d6; }
body.dark input[type="date"],
body.dark input[type="time"] { color-scheme: dark; }
body.dark input[type="date"]::-webkit-calendar-picker-indicator,
body.dark input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(1) brightness(1.9); opacity: 1; }
body.dark input[type="date"]::-webkit-clear-button,
body.dark input[type="time"]::-webkit-clear-button { filter: invert(1) brightness(1.9); }
body.dark input[type="date"]::-webkit-inner-spin-button,
body.dark input[type="time"]::-webkit-inner-spin-button { filter: invert(1) brightness(1.9); }


body.dark select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 28px;
  background-image:
    linear-gradient(45deg, transparent 50%, #111827 50%),
    linear-gradient(135deg, #111827 50%, transparent 50%);
  background-position:
    calc(100% - 14px) calc(50% - 2px),
    calc(100% - 9px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* Keep native dropdown behavior for operator number selector */
body.dark #mx-operator-number {
  appearance: auto;
  -webkit-appearance: menulist;
  -moz-appearance: menulist;
  padding-right: 10px;
  background-image: none;
}

body.dark details > summary {
  color: #eaf1ff;
}
body.dark details > summary::marker,
body.dark details > summary::-webkit-details-marker {
  color: #eaf1ff;
}
body.dark button { background: #e11d48; }
body.dark button:hover { background: #be123c; }
body.dark th, body.dark td { border-bottom: 1px solid #3f4f74; }
body.dark tr:hover { background: #33456a; }
body.dark pre { background: #081022; color: #93c5fd; }
body.dark .mx-ops-group { border-color: #4a5e8d; background: #314366; }

.dropzone {
  border: 1px dashed #3b82f6;
  border-radius: 10px;
  padding: 14px;
  color: #93c5fd;
  background: rgba(30, 64, 175, 0.12);
  min-height: 56px;
  display: flex;
  align-items: center;
}

.shots-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.shot-item {
  background: #0b1830;
  border: 1px solid #233a66;
  border-radius: 8px;
  overflow: hidden;
}

.shot-item img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.shot-item .caption {
  font-size: 12px;
  padding: 6px 8px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal.hidden { display: none; }

.modal-content {
  width: min(900px, 94vw);
  background: #101b33;
  border: 1px solid #2a3f68;
  border-radius: 12px;
  padding: 14px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

.modal-content.large {
  width: min(980px, 96vw);
}

.preview-modal-content {
  width: min(1400px, 96vw);
}

.preview-wrap {
  border: 1px solid #2a3f68;
  border-radius: 10px;
  background: #0a1328;
  padding: 8px;
  max-height: 82vh;
  overflow: auto;
}

.preview-wrap img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.help-modal-content {
  width: min(1200px, 96vw);
  max-height: 92vh;
}

.help-frame {
  width: 100%;
  height: 78vh;
  border: 1px solid #2a3f68;
  border-radius: 8px;
  background: #ffffff;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.modal-header.sticky {
  position: sticky;
  top: 0;
  background: #101b33;
  padding: 6px 0;
  z-index: 5;
}

.modal-close {
  min-width: 42px;
  font-size: 20px;
  line-height: 1;
}

.date-time-row {
  margin-bottom: 8px;
}

.ghost {
  background: transparent !important;
  border: 1px solid #334155 !important;
  color: #e2e8f0 !important;
}

.grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
}

#m-vtype-wrap select,
#m-offender-wrap select {
  width: auto;
  min-width: 160px;
  max-width: 240px;
}

.compact-pair-row {
  grid-template-columns: max-content max-content;
  justify-content: start;
  align-items: end;
  gap: 10px;
}

.compact-pair-row label {
  width: auto;
}

/* Incident modal: keep blocks sized by content, not stretched */
#incident-modal .grid2 {
  grid-template-columns: repeat(2, max-content);
  justify-content: start;
}

#incident-modal .grid2 label,
#incident-modal .date-time-row label,
#incident-modal #m-vtype-wrap,
#incident-modal #m-offender-wrap {
  width: auto;
}

#incident-modal #m-vtype-wrap select,
#incident-modal #m-offender-wrap select,
#incident-modal .date-time-row input[type="date"],
#incident-modal .date-time-row input[type="time"] {
  width: max-content;
  min-width: 150px;
  max-width: 260px;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(100px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.tool-group {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.episode-input-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 10px;
}

.episode-input-grid .dropzone {
  min-height: 52px;
  margin-top: 0;
}

#m-episode-paste {
  min-height: 64px;
}

#m-overlay-drop {
  min-height: 50px;
}

.episode-tools-row {
  align-items: center;
}

.text-tool-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.text-size-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 32px;
  border: 1px solid #334c76;
  border-radius: 8px;
  background: #0b1830;
  color: #bfdbfe;
  font-weight: 700;
}

.text-bold-check {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  margin-left: 2px;
}

.tool-btn {
  background: #0b1830 !important;
  border: 1px solid #334c76 !important;
  color: #cbd5e1 !important;
  min-width: 42px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.tool-btn.active {
  border-color: #22c55e !important;
  box-shadow: 0 0 0 1px #22c55e inset;
  color: #86efac !important;
}

.canvas-wrap {
  margin-top: 10px;
  border: 1px solid #2a3f68;
  border-radius: 10px;
  padding: 8px;
  background: #0a1328;
  overflow: auto;
}

.canvas-wrap canvas {
  display: block;
  max-width: 100%;
  height: auto;
  cursor: crosshair;
}

.episode-list {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.episode-list::-webkit-scrollbar {
  height: 8px;
}

.episode-list::-webkit-scrollbar-thumb {
  background: #314266;
  border-radius: 999px;
}

.episode-item {
  flex: 0 0 150px;
  background: #0b1830;
  border: 1px solid #2a3f68;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
}

.episode-item img {
  width: 100%;
  height: 84px;
  object-fit: cover;
  display: block;
}

.episode-caption {
  font-size: 12px;
  color: #bfdbfe;
  text-align: center;
  padding: 5px 6px;
}

.episode-item:hover {
  border-color: #60a5fa;
}

.episode-item:active {
  transform: translateY(1px);
}

.dropzone.dragover {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.12);
}

.tmc-quick-wrap {
  margin-bottom: 8px;
}

.tmc-quick {
  background: #7f1d1d !important;
  border: 1px solid #fca5a5 !important;
  color: #fecaca !important;
  font-weight: 700;
}

.tmc-quick:hover {
  background: #991b1b !important;
}

.face-grid {
  display: grid;
  grid-template-columns: repeat(4, 64px);
  gap: 8px;
  justify-content: start;
}

.face-slot {
  border: 1px solid #2a3f68;
  border-radius: 10px;
  padding: 6px;
  background: #0d1a33;
}

.face-slot.active {
  border-color: #f59e0b;
  box-shadow: 0 0 0 1px #f59e0b inset;
}

.face-drop {
  width: 52px;
  min-height: 60px;
  border: 1px dashed #334c76;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 64, 175, 0.08);
}

.face-drop.dragover {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.12);
}

.face-preview {
  width: 100%;
  height: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #93c5fd;
  font-size: 13px;
  text-align: center;
  padding: 4px;
}

.face-preview img {
  width: 100%;
  height: 100%;
  min-height: 52px;
  object-fit: cover;
  border-radius: 4px;
}

.face-file-name {
  display: none;
}

#m-vtype-wrap select {
  border-color: #7c2d12;
  box-shadow: 0 0 0 1px rgba(251, 146, 60, 0.28) inset;
}

.priority-case td {
  border-left: 4px solid #f59e0b;
  background: rgba(245, 158, 11, 0.08);
}

.case-thumb {
  width: 76px;
  height: 46px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #2a3f68;
  display: block;
}

.case-thumb-empty {
  width: 76px;
  height: 46px;
  border-radius: 6px;
  border: 1px dashed #334155;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.folder-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.folder-item {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid #2a3f68;
  border-radius: 8px;
  padding: 8px;
  background: #0b1830;
}

.folder-thumb {
  width: 130px;
  height: 78px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #2a3f68;
}

.folder-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.folder-thumb-empty {
  width: 100%;
  height: 100%;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.folder-title {
  font-weight: 600;
}

.folder-sub {
  color: #94a3b8;
  font-size: 12px;
  margin-top: 2px;
}

.folder-main {
  min-width: 0;
}

.folder-shots-title {
  margin-top: 6px;
  font-size: 11px;
  color: #93c5fd;
}

.folder-shot-strip {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.folder-shot-btn {
  width: 56px;
  height: 36px;
  border: 1px solid #2a3f68;
  border-radius: 6px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  background: #0b1830;
}

.folder-shot-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.folder-shot-empty {
  margin-top: 6px;
  color: #94a3b8;
  font-size: 11px;
}

.folder-actions {
  display: flex;
  gap: 6px;
}

.folder-file {
  font-size: 12px;
  color: #93c5fd;
  margin-bottom: 2px;
}

.folder-item.finalized {
  border-color: #16a34a;
  background: rgba(22, 163, 74, 0.08);
}

.operator-row {
  grid-template-columns: 1fr auto;
  padding: 6px 8px;
}

.operator-row .folder-title {
  font-size: 14px;
  line-height: 1.2;
}

.operator-row .folder-actions .ghost {
  padding: 6px 8px;
}

.folder-ready-banner {
  border: 1px solid #16a34a;
  border-radius: 8px;
  padding: 8px 10px;
  color: #bbf7d0;
  background: rgba(22, 163, 74, 0.08);
  font-size: 13px;
}

.folder-guidance-banner {
  border: 1px solid #2563eb;
  border-radius: 8px;
  padding: 8px 10px;
  color: #bfdbfe;
  background: rgba(37, 99, 235, 0.14);
  font-size: 13px;
  margin-top: 8px;
}

.folder-qc-progress {
  border: 1px solid #155e75;
  border-radius: 8px;
  padding: 8px 10px;
  color: #cffafe;
  background: rgba(8, 145, 178, 0.14);
  font-size: 13px;
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.qc-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.qc-progress-row {
  display: grid;
  gap: 6px;
}

.qc-progress-label {
  font-size: 12px;
  color: #dbeafe;
}

.qc-progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(30, 64, 175, 0.25);
  overflow: hidden;
}

.qc-progress-track > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8 0%, #22c55e 100%);
}

.folder-fail-banner {
  border: 1px solid #dc2626;
  border-radius: 8px;
  padding: 8px 10px;
  color: #fecaca;
  background: rgba(220, 38, 38, 0.12);
  font-size: 13px;
  margin-top: 8px;
}

.folder-empty {
  border: 1px dashed #334155;
  border-radius: 8px;
  padding: 10px;
  color: #94a3b8;
  font-size: 13px;
}

.existing-image-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
}

.existing-image-item {
  border: 1px solid #334155;
  border-radius: 8px;
  overflow: hidden;
  background: #0b1830;
}

.existing-image-item.marked-delete {
  opacity: 0.45;
  border-color: #ef4444;
}

.existing-image-item img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

.existing-image-item .row {
  justify-content: space-between;
  padding: 6px;
  margin-top: 0;
}

.toast-container {
  position: fixed;
  right: 14px;
  bottom: 14px;
  display: grid;
  gap: 8px;
  z-index: 2000;
}

.toast {
  min-width: 260px;
  max-width: 420px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #0b1830;
  color: #e5e7eb;
  opacity: 0;
  transform: translateY(6px);
  transition: all .18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error { border-color: #ef4444; }
.toast.success { border-color: #22c55e; }
.toast.info { border-color: #60a5fa; }

.opt-btn {
  background: #0b1830 !important;
  border: 1px solid #334c76 !important;
  color: #cbd5e1 !important;
}

.opt-btn.active {
  border-color: #f59e0b !important;
  box-shadow: 0 0 0 1px #f59e0b inset;
  color: #fbbf24 !important;
}

.primary {
  background: #ef4444 !important;
}

textarea {
  resize: vertical;
  min-height: 72px;
  font-size: 14px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #233a66;
  background: #0b1830;
  color: #e5e7eb;
}

body.op-compact .card:first-of-type { padding: 10px; }
body.op-compact .card:first-of-type .mt { margin-top: 6px; }
body.op-compact .card:first-of-type label { font-size: 12px; gap: 3px; }
body.op-compact .card:first-of-type input,
body.op-compact .card:first-of-type select,
body.op-compact .card:first-of-type button,
body.op-compact .card:first-of-type textarea { padding: 6px; font-size: 13px; }

.trainee-auth {
  border-top: 1px dashed #334155;
  padding-top: 10px;
}
.trainee-auth h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

@media (max-width: 900px) {
  .grid2 { grid-template-columns: 1fr; }
  .grid3.report-compact { grid-template-columns: 1fr; }
  .mx-finance-grid { grid-template-columns: 1fr; }
  .option-grid { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .face-grid { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .episode-input-grid { grid-template-columns: 1fr; }
  .folder-item { grid-template-columns: 1fr; }
  .folder-thumb { width: 100%; height: 140px; }
}
