:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success: #15803d;
  --warning: #b45309;
  --danger: #b91c1c;
  --shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  --radius: 16px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { width: min(1200px, calc(100% - 32px)); margin: 0 auto; }
.topbar {
  background: #111827;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}
.topbar nav { display: flex; gap: 16px; }
.topbar nav a, .brand { color: #fff; font-weight: 700; }
.hero { padding: 28px 0 8px; }
.hero h1 { margin-bottom: 8px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin: 16px 0;
}
.nested-card { margin-top: 8px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gap-lg { gap: 24px; }
@media (max-width: 900px) {
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
}
label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 700; }
input, select, button, textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  font-size: 15px;
}
button {
  background: var(--primary);
  color: #fff;
  border: 0;
  cursor: pointer;
  font-weight: 700;
}
button:hover { background: var(--primary-hover); }
.btn-link, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
}
.btn-link { background: #eff6ff; }
.btn-secondary {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: var(--text);
  width: auto;
}
.actions-end { display: flex; align-items: end; }
.actions-inline { display: flex; gap: 10px; align-items: center; }
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.table-wrap { overflow-x: auto; }
.status {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  background: #e5e7eb;
}
.status-pending, .status-queued, .status-taken, .status-processing { background: #fef3c7; color: #92400e; }
.status-done { background: #dcfce7; color: #166534; }
.status-error { background: #fee2e2; color: #991b1b; }
.detail-header, .section-head, .admin-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.media-info-box {
    background:#0f172a;
    color:#e5e7eb;
    padding:18px;
    border-radius:12px;
    font-family:monospace;
    white-space:pre-wrap;
}
.meta-list { display: grid; gap: 10px; margin: 0; }
.meta-list div {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 8px;
}
.meta-list dt { font-weight: 700; }
.meta-list dd { margin: 0; }
.placeholder-box, .empty-note {
  padding: 16px;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  color: var(--muted);
}
.link-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
}
.break-all { word-break: break-all; }
.small-text, .muted { color: var(--muted); font-size: 14px; }
.job-box {
  margin-top: 16px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #f8fafc;
}
.hidden { display: none; }
.auth-wrap { min-height: calc(100vh - 140px); display: flex; align-items: center; justify-content: center; }
.auth-card { width: min(460px, 100%); }
.alert.error {
  background: #fee2e2;
  color: #991b1b;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 14px;
}
.stats-grid .stat { text-align: center; }
.stats-grid .stat strong { display: block; font-size: 32px; margin-bottom: 8px; }
.pagination { display: flex; gap: 8px; flex-wrap: wrap; }
.page-link { padding: 8px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--line); }
.page-link.active { background: var(--primary); color: #fff; }

.btn-action {
    display: inline-block;
    padding: 8px 12px;
    background: #2563eb;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}

.btn-action:hover {
    opacity: 0.92;
}

.pagination-wrap {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

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

.page-link,
.page-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid #d7dce5;
    border-radius: 10px;
    text-decoration: none;
    background: #fff;
    color: #2563eb;
    box-sizing: border-box;
}

.page-link:hover {
    background: #f8fbff;
}

.page-link.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.page-link.disabled {
    color: #9aa3af;
    background: #f3f4f6;
    border-color: #e5e7eb;
    pointer-events: none;
}

.nav-link {
    padding: 0 14px;
}

.page-dots {
    border: none;
    background: transparent;
    color: #6b7280;
    min-width: auto;
    padding: 0 4px;
}

.pagination-jump {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.pagination-jump label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.pagination-jump input[type="number"] {
    width: 80px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #d7dce5;
    border-radius: 10px;
    box-sizing: border-box;
    font-size: 14px;
}

.pagination-jump button {
    height: 36px;
    padding: 0 14px;
    border: 1px solid #d7dce5;
    border-radius: 10px;
    background: #fff;
    color: #2563eb;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
}

.pagination-jump button:hover {
    background: #f8fbff;
}

.queue-progress-box {
    width: 100%;
    margin: 10px 0 18px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #eef7ff;
    border: 1px solid #cfe2ff;
}

.queue-progress-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.queue-progress-title {
    font-size: 15px;
    color: #1f2937;
}

.queue-progress-percent {
    font-size: 14px;
    font-weight: 700;
    color: #2563eb;
}

.queue-progress-bar {
    width: 100%;
    height: 12px;
    background: #dbeafe;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 10px;
}

.queue-progress-bar-fill {
    height: 100%;
    min-width: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg,#3b82f6,#22c55e);
    transition: width .4s ease;
}

.queue-progress-stats {
    font-size: 13px;
    color: #475569;
}

.queue-progress-box strong {
    font-weight: 700;
}
