* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17202a;
  background: #f6f7f9;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 32px;
  background: #ffffff;
  border-bottom: 1px solid #e5e8ee;
}

h1 {
  margin: 0 0 6px;
  font-size: 24px;
}

p {
  margin: 0;
  color: #667085;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.actions form {
  margin: 0;
}

select,
input,
button,
.button {
  height: 38px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  background: #ffffff;
  color: #17202a;
  padding: 0 12px;
  text-decoration: none;
  line-height: 36px;
  font-size: 14px;
}

.admin-panel {
  padding: 32px;
}

.admin-form {
  display: flex;
  align-items: end;
  gap: 12px;
  max-width: 560px;
  padding: 20px 0;
}

.admin-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #475467;
  font-size: 13px;
}

.admin-form input {
  width: 320px;
}

button,
.button {
  cursor: pointer;
}

.primary-button {
  border-color: #fe2062;
  background: #fe2062;
  color: #ffffff;
  font-weight: 700;
}

.primary-button:hover {
  background: #e61b58;
}

.danger-button {
  border-color: #fda29b;
  color: #b42318;
}

.danger-button:hover {
  background: #fff1f0;
}

.filter-panel {
  margin: 16px 32px;
  padding: 18px 24px;
  background: #ffffff;
  border: 1px solid #edf0f5;
  border-radius: 8px;
}

.filter-hint {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 6px;
  background: #fff7fa;
  color: #8a2443;
  font-size: 13px;
  line-height: 1.5;
}

.tenant-form {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 12px;
}

.tenant-form label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #475467;
  font-size: 13px;
  font-weight: 700;
}

.tenant-form select {
  min-width: 180px;
}

.ops-panel {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(280px, 1fr);
  gap: 16px;
  margin: 0 32px 16px;
}

.single-column {
  grid-template-columns: minmax(0, 1fr);
}

.dashboard-grid {
  margin-top: 16px;
}

.ops-card {
  padding: 16px;
  background: #ffffff;
  border: 1px solid #e5e8ee;
  border-radius: 8px;
}

.module-list {
  display: grid;
  gap: 8px;
}

.module-row {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 8px;
  background: #f8fafc;
  color: #17202a;
  text-decoration: none;
}

.module-row span {
  color: #667085;
  font-size: 13px;
}

.wide-card {
  grid-column: 1 / -1;
}

.panel-title {
  margin: 0 0 12px;
  color: #17202a;
  font-size: 16px;
  font-weight: 800;
}

.panel-actions {
  display: flex;
  justify-content: flex-end;
  margin: -4px 0 10px;
}

.status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.inline-form input {
  min-width: 150px;
  flex: 1;
}

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

.status-grid div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 6px;
  background: #f8fafc;
}

.status-grid span,
.status-note {
  color: #667085;
  font-size: 13px;
}

.status-grid strong {
  font-size: 18px;
}

.status-note {
  margin-top: 10px;
  padding: 10px;
  border-radius: 6px;
  background: #fbfcfe;
}

.bookmarklet-box {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 12px;
}

.bookmarklet-link {
  cursor: grab;
}

.bookmarklet-steps {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
}

.bookmarklet-steps div {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 10px;
  border: 1px solid #edf0f5;
  border-radius: 8px;
  background: #fbfcfe;
}

.bookmarklet-steps strong {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #fe2062;
  color: #ffffff;
  font-size: 12px;
}

.bookmarklet-steps span {
  color: #475467;
  font-size: 13px;
  line-height: 1.55;
}

.hint-text {
  color: #667085;
  font-size: 12px;
}

.notice-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin: 16px 24px 0;
  padding: 12px 14px;
  border: 1px solid #fed7e2;
  border-radius: 8px;
  background: #fff7fa;
  color: #475467;
  font-size: 13px;
}

.notice-panel strong {
  color: #8a2443;
}

.mini-table,
.task-table,
.review-table,
.failure-table {
  display: grid;
  gap: 6px;
}

.mini-row,
.task-head,
.task-row,
.review-head,
.review-row,
.failure-head,
.failure-row {
  display: grid;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #f8fafc;
  color: #475467;
  font-size: 13px;
}

.mini-row {
  grid-template-columns: minmax(120px, 1fr) 54px 70px 70px 52px;
}

.backup-row {
  grid-template-columns: minmax(160px, 1fr) 80px minmax(180px, 1fr);
}

.browser-row {
  grid-template-columns: 120px 90px minmax(0, 1fr);
}

.browser-row a,
.task-row span,
.mini-row a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.active-link {
  color: #fe2062;
  font-weight: 800;
}

.text-button {
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fe2062;
  font-weight: 700;
  line-height: 1.4;
}

.text-button:disabled {
  color: #98a2b3;
  cursor: not-allowed;
}

.task-head,
.task-row {
  grid-template-columns: minmax(120px, 0.85fr) minmax(190px, 1.25fr) 82px minmax(110px, 0.75fr) minmax(120px, 0.85fr) minmax(170px, 1fr) 72px 96px;
}

.task-head {
  background: #ffffff;
  color: #667085;
  font-weight: 800;
}

.task-row strong {
  grid-column: 1 / -1;
  color: #b42318;
  font-weight: 700;
}

.task-row em {
  grid-column: 1 / -1;
  color: #667085;
  font-size: 12px;
  font-style: normal;
}

.task-download {
  color: #fe2062;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.task-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.task-actions form {
  margin: 0;
}

.detail-actions {
  margin-top: 14px;
}

.review-table {
  margin: 0 0 14px;
}

.failure-table {
  margin: 0 0 14px;
  overflow-x: auto;
}

.failure-head,
.failure-row {
  grid-template-columns: minmax(180px, 1fr) 100px 80px minmax(220px, 1.4fr) 120px;
}

.history-table .failure-head,
.history-table .failure-row {
  grid-template-columns: minmax(180px, 1fr) 86px 70px 70px minmax(260px, 1.5fr) 150px 140px;
  min-width: 980px;
}

.failure-head {
  background: #ffffff;
  color: #667085;
  font-weight: 800;
}

.failure-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.active-task-card {
  display: grid;
  grid-template-columns: minmax(130px, 0.7fr) minmax(260px, 1.5fr) 80px 80px minmax(180px, 1fr);
  gap: 8px;
  align-items: center;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid #fed7e2;
  border-radius: 8px;
  background: #fff7fa;
}

.active-task-card div {
  display: grid;
  gap: 4px;
}

.active-task-card span {
  color: #8a2443;
  font-size: 12px;
  font-weight: 700;
}

.active-task-card strong {
  color: #17202a;
  font-size: 14px;
}

.active-task-message {
  grid-column: 1 / -1;
  color: #667085;
  font-size: 13px;
}

.review-head,
.review-row {
  grid-template-columns: minmax(180px, 1fr) 80px minmax(180px, 1fr) 140px;
}

.review-head {
  background: #ffffff;
  color: #667085;
  font-weight: 800;
}

.review-row button {
  width: 100%;
}

.status-pill {
  display: inline-flex;
  justify-content: center;
  width: fit-content;
  min-width: 68px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef4ff;
  color: #3538cd;
  font-weight: 800;
}

.status-pill.done {
  background: #ecfdf3;
  color: #027a48;
}

.status-pill.failed {
  background: #fff1f0;
  color: #b42318;
}

.status-pill.running {
  background: #fff7e6;
  color: #b54708;
}

.status-pill.pending {
  background: #f2f4f7;
  color: #475467;
}

.status-pill.cancelled {
  background: #f2f4f7;
  color: #667085;
}

.status-pill.ignored {
  background: #f8f9fc;
  color: #667085;
}

.task-progress {
  display: grid;
  gap: 5px;
}

.task-progress i {
  display: block;
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e8ee;
}

.task-progress b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #fe2062;
}

.empty-mini {
  min-height: 34px;
  padding: 8px 10px;
  color: #98a2b3;
  font-size: 13px;
}

.target-capture-form {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(360px, 1.2fr);
  gap: 14px;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid #edf0f5;
  border-radius: 8px;
  background: #fbfcfe;
}

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

.target-capture-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #475467;
  font-size: 13px;
  font-weight: 600;
}

.target-capture-form select {
  width: 100%;
}

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

.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  padding-left: 10px;
  border-left: 1px solid #e5e8ee;
}

.action-group:first-child {
  border-left: 0;
  padding-left: 0;
}

.action-label {
  width: 100%;
  color: #667085;
  font-size: 12px;
  font-weight: 700;
}

.compact-group {
  max-width: 88px;
}

.account-note {
  color: #667085;
  font-size: 13px;
}

.account-pill {
  height: 38px;
  padding: 0 12px;
  border: 1px solid #e5e8ee;
  border-radius: 999px;
  background: #f8fafc;
  color: #475467;
  font-size: 13px;
  line-height: 36px;
}

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

.login-panel {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid #e5e8ee;
  border-radius: 8px;
  background: #ffffff;
}

.login-panel h1 {
  margin-bottom: 8px;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: #475467;
  font-size: 13px;
  font-weight: 700;
}

.login-error {
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 6px;
  background: #fff1f0;
  color: #b42318;
  font-size: 13px;
}

.strong-button {
  border-color: #344054;
  background: #344054;
  color: #ffffff;
  font-weight: 700;
}

.strong-button:hover {
  background: #1d2939;
}

.filter-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 10px 0;
}

.filter-row + .filter-row {
  border-top: 1px solid #f1f3f7;
}

.filter-label {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: #57626f;
  font-size: 14px;
  font-weight: 600;
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.filter-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-form select,
.filter-form input[type="date"] {
  min-width: 180px;
}

.date-label {
  color: #667085;
  font-size: 13px;
}

.filter-chip {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 999px;
  color: #1f283c;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  border: 1px solid transparent;
  gap: 6px;
}

.filter-chip span {
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border-radius: 999px;
  background: #f1f3f7;
  color: #667085;
  font-size: 12px;
}

.filter-chip:hover {
  color: #fe2062;
  background: #fff2f5;
}

.filter-chip.active {
  color: #ffffff;
  background: #fe2062;
}

.filter-chip.active span {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.filter-chip.empty-chip {
  color: #98a2b3;
}

.filter-chip.empty-chip span {
  background: #f5f6f8;
  color: #98a2b3;
}

.status {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 14px 32px;
  color: #475467;
  font-size: 14px;
}

.status strong {
  color: #b42318;
}

.capture-panel {
  margin: 0 32px 16px;
  padding: 14px 18px;
  background: #ffffff;
  border: 1px solid #e5e8ee;
  border-radius: 8px;
}

.capture-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px 16px;
  color: #475467;
  font-size: 14px;
}

.capture-grid strong {
  color: #17202a;
}

.capture-error {
  margin-top: 10px;
  color: #b42318;
  font-size: 14px;
}

.reason-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.reason-list span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #f2f4f7;
  color: #475467;
  font-size: 12px;
}

.failure-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.failure-list span {
  padding: 7px 9px;
  border: 1px solid #fecdca;
  border-radius: 6px;
  background: #fff5f5;
  color: #912018;
  font-size: 12px;
  line-height: 1.4;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 32px 12px;
  color: #475467;
  font-size: 14px;
}

.pagination-actions {
  display: flex;
  gap: 8px;
}

.disabled-button {
  color: #98a2b3;
  background: #f2f4f7;
  cursor: default;
}

.table-wrap {
  padding: 0 32px 32px;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  background: #ffffff;
  border: 1px solid #e5e8ee;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid #e5e8ee;
  text-align: left;
  vertical-align: top;
}

th {
  color: #475467;
  font-size: 13px;
  font-weight: 600;
  background: #fbfcfe;
}

td {
  font-size: 14px;
}

img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #e5e8ee;
}

a {
  color: #175cd3;
  word-break: break-all;
}

.metrics {
  margin-top: 8px;
  color: #667085;
  font-size: 13px;
}

.links {
  max-width: 520px;
}

.links a {
  display: block;
  margin-bottom: 6px;
}

.video-count {
  margin-bottom: 8px;
  color: #17202a;
  font-size: 13px;
  font-weight: 700;
}

.video-detail {
  margin-bottom: 10px;
  padding: 8px;
  border: 1px solid #edf0f5;
  border-radius: 6px;
  background: #fbfcfe;
}

.video-detail a {
  margin-bottom: 6px;
}

.video-detail span {
  display: inline-block;
  margin: 0 8px 4px 0;
  color: #667085;
  font-size: 12px;
}

.metrics-cell {
  min-width: 120px;
  color: #475467;
  font-size: 13px;
  line-height: 1.7;
}

.empty {
  height: 120px;
  text-align: center;
  color: #667085;
}

@media (max-width: 760px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
    padding: 20px;
  }

  .status,
  .pagination-bar,
  .filter-panel,
  .table-wrap {
    padding-left: 20px;
    padding-right: 20px;
  }

  .pagination-bar {
    align-items: flex-start;
    flex-direction: column;
    margin-left: 20px;
    margin-right: 20px;
    padding-left: 0;
    padding-right: 0;
  }

  .filter-panel {
    margin-left: 20px;
    margin-right: 20px;
  }

  .target-capture-form {
    grid-template-columns: 1fr;
  }

  .capture-selects {
    grid-template-columns: 1fr;
  }

  .capture-actions {
    justify-content: flex-start;
  }

  .action-group {
    width: 100%;
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid #e5e8ee;
    padding-top: 10px;
  }

  .filter-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .filter-label {
    justify-content: flex-start;
  }
}
