* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  background: #f4f5f7;
  color: #1f2328;
}

header {
  padding: 20px 32px;
  background: #fff;
  border-bottom: 1px solid #e1e4e8;
}

header h1 { margin: 0; font-size: 20px; }
header .sub { font-size: 13px; color: #6a737d; margin-top: 2px; }

.card {
  background: #fff;
  margin: 16px 32px;
  padding: 20px;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
}

.parse-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 16px 32px;
  padding: 16px 22px;
  background: linear-gradient(135deg, #eef5ff 0%, #f5f9ff 100%);
  border: 1px solid #b6d4fe;
  border-left: 4px solid #1f6feb;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(31, 111, 235, 0.08);
}

.parse-banner-left { min-width: 0; }

.parse-banner-title {
  font-size: 15px;
  font-weight: 600;
  color: #0a3069;
}

.parse-banner-sub {
  font-size: 12.5px;
  color: #4d5566;
  margin-top: 2px;
}

.parse-banner-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.parse-banner .inline-label { color: #0a3069; font-weight: 500; }
.parse-banner .inline-label select { background: #fff; }

.btn-primary-large {
  padding: 9px 22px;
  font-size: 14px;
  font-weight: 600;
  background: #1f6feb;
  color: #fff;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(31, 111, 235, 0.25);
}

.btn-primary-large:hover { background: #1858c4; }
.btn-primary-large:disabled {
  background: #c1c7cd;
  cursor: not-allowed;
  box-shadow: none;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.row h2 { margin: 0; font-size: 16px; }
.row-right { display: flex; gap: 8px; align-items: center; }

.dropzone {
  border: 2px dashed #c1c7cd;
  border-radius: 8px;
  padding: 32px;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
}

.dropzone.dragover {
  background: #eef5ff;
  border-color: #2f81f7;
}

.dropzone p { margin: 6px 0; }
.dropzone .hint { color: #6a737d; font-size: 13px; }
.dropzone .hint.small { font-size: 12px; margin-top: 12px; }

.dropzone .hint code {
  background: #f6f8fa;
  border: 1px solid #e1e4e8;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11.5px;
  color: #1f2328;
}

.skip-notice {
  margin: 12px 32px -4px;
  padding: 8px 14px;
  background: #fff8c5;
  border: 1px solid #d4a72c;
  border-radius: 6px;
  font-size: 13px;
  color: #57430a;
}

.actions { display: inline-flex; gap: 8px; margin: 8px 0; }

.btn {
  display: inline-block;
  padding: 6px 14px;
  background: #1f6feb;
  color: #fff;
  border: 0;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover { background: #1858c4; }

.btn-secondary {
  background: #f6f8fa;
  color: #1f2328;
  border: 1px solid #d0d7de;
}

.btn-secondary:hover { background: #eaeef2; }

.btn-small {
  padding: 3px 10px;
  font-size: 12px;
}

.inline-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #57606a;
}

.inline-label select {
  padding: 5px 8px;
  border: 1px solid #c1c7cd;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
}

.btn-link {
  background: none;
  border: 0;
  color: #1f6feb;
  cursor: pointer;
  font-size: 13px;
  padding: 0;
}

.btn-danger {
  background: none;
  border: 1px solid #d1242f;
  color: #d1242f;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}

.btn-danger:hover { background: #ffeaea; }

input[type="search"] {
  padding: 6px 10px;
  border: 1px solid #c1c7cd;
  border-radius: 6px;
  font-size: 13px;
  min-width: 240px;
}

.queue { margin-top: 20px; }
.queue-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.queue-header h2 { margin: 0; font-size: 15px; }

#queue-list { list-style: none; padding: 0; margin: 0; max-height: 280px; overflow-y: auto; }

.queue-item {
  display: grid;
  grid-template-columns: 1fr 100px 200px 28px;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid #f0f1f3;
  font-size: 13px;
}

.queue-item .name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-item .state { font-size: 12px; color: #6a737d; }

.progress {
  height: 6px;
  background: #eaeef2;
  border-radius: 3px;
  overflow: hidden;
}

.progress > div {
  height: 100%;
  background: #1f6feb;
  width: 0%;
  transition: width 0.2s;
}

.progress.error > div { background: #d1242f; }
.progress.ready > div { background: #1a7f37; }

.progress.parsing > div {
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.3) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0.3) 75%,
    transparent 75%,
    transparent
  );
  background-color: #1f6feb;
  background-size: 16px 16px;
  animation: progress-stripe 1s linear infinite;
}

@keyframes progress-stripe {
  from { background-position: 0 0; }
  to { background-position: 16px 0; }
}

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

th, td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #f0f1f3;
}

th { color: #6a737d; font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  text-transform: capitalize;
}

.badge.uploaded { background: #eaeef2; color: #57606a; }
.badge.parsed   { background: #dbeafe; color: #1f6feb; }
.badge.processed { background: #dbeafe; color: #1f6feb; }
.badge.ready    { background: #dafbe1; color: #1a7f37; }
.badge.error    { background: #ffebe9; color: #d1242f; }

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

.row-end { text-align: right; }

.actions-cell {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}
