body {
  font-family: "Inter", "Segoe UI", sans-serif;
  margin: 0;
  background: #f5f7fb;
  color: #1f2933;
}

header {
  background: #111827;
  color: #f9fafb;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

header a {
  color: #e5e7eb;
  text-decoration: none;
  font-weight: 500;
}

.current-time {
  font-size: 13px;
  color: #cbd5f5;
  font-weight: 500;
  padding-left: 12px;
  border-left: 1px solid rgba(148, 163, 184, 0.4);
}

.container {
  max-width: 1100px;
  margin: 24px auto;
  padding: 0 24px 40px;
}

.card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  padding: 24px;
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.file-manager-header {
  align-items: flex-start;
  flex-wrap: wrap;
}

.file-manager-header h2 {
  margin: 0 0 4px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 13px;
  margin-bottom: 6px;
}

.breadcrumb a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}

.breadcrumb-separator {
  color: #94a3b8;
}

.upload-form {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.upload-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px dashed #cbd5f5;
  background: #f8fafc;
  font-size: 13px;
  cursor: pointer;
}

.upload-label input[type="file"] {
  display: none;
}

.file-manager-parent {
  margin-bottom: 12px;
}

.file-manager-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.table-wrapper {
  overflow-x: auto;
}

.table-wrapper.scroll-table {
  max-height: 360px;
  overflow-y: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th,
.table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid #e2e8f0;
}

.last-seen-stale {
  color: #b91c1c;
  font-weight: 600;
}

.table td.last-seen-stale,
.table td.last-seen-stale * {
  color: #b91c1c;
  font-weight: 600;
}

.badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge.active {
  background: #dcfce7;
  color: #166534;
}

.badge.now {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge.completed {
  background: #dcfce7;
  color: #166534;
}

.badge.not-relevant {
  background: #e2e8f0;
  color: #475569;
}

.badge.available {
  background: #fef3c7;
  color: #b45309;
}

.badge.subscribed {
  background: #ecfdf3;
  color: #15803d;
}

.badge.not-subscribed {
  background: #fff1f2;
  color: #be123c;
}

.badge.video-status {
  text-transform: none;
}

.badge.not-played {
  background: #e2e8f0;
  color: #475569;
}

.badge.not-split {
  background: #ffedd5;
  color: #9a3412;
}

.badge.pending-worker,
.badge.awaiting-worker {
  background: #fef3c7;
  color: #b45309;
}

.badge.worker-working {
  background: #dcfce7;
  color: #166534;
}

.badge.failed {
  background: #fee2e2;
  color: #b91c1c;
}

.badge.splitting-now {
  background: #fef9c3;
  color: #854d0e;
}

.badge.pending-upload {
  background: #ede9fe;
  color: #5b21b6;
}


.badge.video-ready,
.badge.youtube-uploaded {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge.uploaded {
  background: #dcfce7;
  color: #166534;
}

.badge.error {
  background: #fee2e2;
  color: #b91c1c;
}

.badge.overridden {
  background: #dbeafe;
  color: #1d4ed8;
}

.chip-link {
  text-decoration: none;
}

.button {
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.button:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  opacity: 0.7;
}

.button.secondary {
  background: #64748b;
}


.button.success {
  background: #16a34a;
}

.button.danger {
  background: #dc2626;
}

.button.compact {
  padding: 8px 10px;
  min-width: 40px;
}

.button.mini {
  padding: 4px 8px;
  min-width: 30px;
  font-size: 11px;
}

.button.outline {
  background: transparent;
  border: 1px solid #2563eb;
  color: #2563eb;
}

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

.manual-actions {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
}

.action-stack {
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
}

.manual-actions form {
  margin: 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 20;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  background: #ffffff;
  border-radius: 12px;
  padding: 24px;
  width: min(420px, 100%);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
}

.modal-header h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.modal-body {
  font-size: 14px;
  color: #475569;
}

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

.form-row {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.form-row input {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #cbd5f5;
}

.form-row select,
.form-row textarea {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #cbd5f5;
  font-family: inherit;
  font-size: 14px;
}

.success {
  color: #166534;
  background: #dcfce7;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.notice {
  padding: 10px 12px;
  border-radius: 10px;
  margin: 12px 0 16px;
  font-size: 13px;
}

.notice.success {
  background: #dcfce7;
  color: #166534;
}

.notice.error {
  background: #fee2e2;
  color: #b91c1c;
}

.muted {
  color: #6b7280;
  font-size: 13px;
}


.status-filter-header {
  position: relative;
}

.status-filter-toggle {
  border: none;
  background: transparent;
  color: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.status-filter-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 190px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.15);
  padding: 10px;
  z-index: 12;
}

.status-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 6px;
}

.user-menu {
  position: relative;
}

.user-menu-toggle {
  border: 1px solid #334155;
  background: #1f2937;
  color: #f9fafb;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-weight: 600;
}

.user-menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 180px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.15);
  padding: 8px;
  z-index: 30;
}

.user-menu-dropdown a {
  display: block;
  color: #1e293b;
  padding: 8px;
  border-radius: 6px;
}

.user-menu-dropdown a:hover {
  background: #f1f5f9;
}

.form-row label {
  display: grid;
  gap: 6px;
  font-size: 14px;
}

.card-header-split {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.action-wrap {
  flex-wrap: wrap;
}

.modal-large {
  width: min(720px, 100%);
}

.event-checkbox-list {
  max-height: min(52vh, 420px);
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px;
}

.event-checkbox-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  column-gap: 10px;
  align-items: center;
  padding: 6px 4px;
  font-size: 14px;
}

.event-checkbox-row[hidden] {
  display: none;
}

.event-checkbox-row input {
  margin: 0;
}

.event-checkbox-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auto-setting-form {
  margin: 0;
}

.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #cbd5e1;
  transition: 0.2s;
  border-radius: 999px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background-color: #ffffff;
  transition: 0.2s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.3);
}

.switch input:checked + .slider {
  background-color: #16a34a;
}

.switch input:checked + .slider:before {
  transform: translateX(18px);
}

.switch input:disabled + .slider {
  cursor: not-allowed;
  opacity: 0.6;
}
