* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f6f7f9;
  color: #1f2933;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.45;
}

a {
  color: #0f5e9c;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.shell {
  min-height: 100vh;
}

.topbar {
  align-items: center;
  background: #17324d;
  color: #fff;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 14px 24px;
}

.brand {
  color: #fff;
  font-weight: 700;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.nav a {
  color: #dce9f5;
}

.nav a.active {
  color: #fff;
  border-bottom: 2px solid #fff;
  padding-bottom: 2px;
}

.user-menu {
  position: relative;
  flex-shrink: 0;
}

.user-chip {
  appearance: none;
  background: none;
  border: none;
  color: #dce9f5;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
}

.user-chip:hover {
  color: #fff;
}

.user-dropdown {
  background: #fff;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.13);
  min-width: 180px;
  padding: 4px 0;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 200;
}

.user-dropdown-item {
  appearance: none;
  background: none;
  border: none;
  color: #1f2933;
  cursor: pointer;
  display: block;
  font-size: 14px;
  padding: 9px 16px;
  text-align: left;
  text-decoration: none;
  width: 100%;
}

.user-dropdown-item:hover {
  background: #f0f5fa;
  text-decoration: none;
}

.user-dropdown-logout {
  color: #b91c1c;
}

.user-dropdown-divider {
  border-top: 1px solid #e5eaf0;
  margin: 4px 0;
}

.content {
  margin: 0 auto;
  max-width: 1180px;
  padding: 28px 24px 48px;
}

.page-title {
  margin: 0 0 18px;
}

.grid {
  display: grid;
  gap: 16px;
}

.stats {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.card {
  background: #fff;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  padding: 16px;
}

.stat-value {
  display: block;
  font-size: 32px;
  font-weight: 700;
}

.stat-label {
  color: #5f6f7f;
}

.table-wrap {
  background: #fff;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
}

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

th {
  background: #f0f4f8;
  color: #435364;
  font-size: 13px;
}

.status {
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 9px;
  text-transform: uppercase;
}

.status.completed,
.status.completed_with_cancellations,
.status.running,
.status.updating_visibility,
.status.downloading,
.status.packaging,
.status.uploading {
  background: #dff4e8;
  color: #17663a;
}

.status.failed {
  background: #fde2e2;
  color: #9f1d1d;
}

.status.cancelled {
  background: #eee;
  color: #435364;
}

.status.pending,
.status.held,
.status.retry_pending {
  background: #fff1cc;
  color: #7b5300;
}

.muted {
  color: #687789;
}

.stack {
  display: grid;
  gap: 16px;
}

.detail-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

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

.log-event {
  border-left: 4px solid #91b6d9;
  padding: 8px 12px;
}

.log-event.error-event {
  border-left-color: #9f1d1d;
}

.log-meta {
  color: #687789;
  font-size: 13px;
}

.error-text {
  color: #9f1d1d;
  font-weight: 700;
}

pre {
  background: #f3f6f9;
  border-radius: 6px;
  overflow-x: auto;
  padding: 10px;
}

.login-panel {
  margin: 80px auto;
  max-width: 440px;
}

.button {
  background: #0f5e9c;
  border-radius: 6px;
  color: #fff;
  display: inline-block;
  font-weight: 700;
  padding: 10px 14px;
}

.button:hover {
  text-decoration: none;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button.secondary {
  background: #435364;
}

.button.danger {
  background: #9f1d1d;
}

.button.compact {
  font-size: 13px;
  padding: 7px 10px;
}

.button-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.queue-toolbar {
  margin-bottom: 14px;
}

.queue-actions-cell {
  min-width: 360px;
}

.queue-inline-actions {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.queue-inline-actions label {
  min-width: 150px;
}

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

.source-action {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.source-action input[type="file"] {
  max-width: 260px;
}

.compact-list {
  color: #435364;
  margin: 10px 0 0;
  padding-left: 22px;
}

.compact-list li + li {
  margin-top: 4px;
}

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

.job-pill {
  background: #dff4e8;
  border: 1px solid #8fd1aa;
  border-radius: 999px;
  color: #17663a;
  display: inline-flex;
  font-weight: 700;
  padding: 5px 10px;
}

.form-grid {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

label {
  color: #435364;
  display: grid;
  font-size: 13px;
  font-weight: 700;
  gap: 5px;
}

.field-label {
  color: #435364;
  display: block;
  font-size: 13px;
  font-weight: 700;
}

.checkbox-label {
  align-items: center;
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

input,
select {
  border: 1px solid #c9d3dd;
  border-radius: 6px;
  font: inherit;
  padding: 9px 10px;
}

.visibility-action-group {
  display: grid;
  gap: 5px;
}

.target-visibility-row {
  align-items: center;
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 6px;
}

.target-visibility-row select {
  min-width: 180px;
}

.visibility-menu {
  position: relative;
}

.visibility-menu summary {
  border: 1px solid #c9d3dd;
  border-radius: 6px;
  cursor: pointer;
  display: block;
  min-width: 112px;
  padding: 8px 10px;
}

.visibility-menu-panel {
  background: #fff;
  border: 1px solid #c9d3dd;
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(31, 41, 51, 0.15);
  display: grid;
  gap: 6px;
  left: 0;
  min-width: 150px;
  padding: 8px;
  position: absolute;
  top: calc(100% + 4px);
  z-index: 5;
}

.notice {
  background: #fff1cc;
  margin-bottom: 16px;
}
