/* ── Tasks Page ──────────────────────────────────────────────── */

.tasks-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.tasks-table th, .tasks-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  font-size: 13px;
  white-space: nowrap;
}
.tasks-table th {
  background: var(--bg);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: sticky;
  top: 0;
  white-space: nowrap;
  z-index: 1;
}
.tasks-table tbody tr { transition: background 0.1s; }
.tasks-table tbody tr:hover { background: rgba(88,166,255,.04); }
.tasks-table tbody tr:last-child td { border-bottom: none; }

/* Allow result/error column to wrap */
.tasks-table td:last-child { white-space: normal; }

.col-uid { width: 140px; }

.page-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: .5;
}
.empty-state p { margin: 4px 0; font-size: 14px; }
.empty-state .text-muted { font-size: 13px; }
.empty-row:hover { background: transparent !important; }

/* ── GPKG name cell ─────────────────────────────────────────── */
.gpkg-name-cell {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Map Modal ──────────────────────────────────────────────── */

.btn-map { margin-left: 4px; }

.map-modal-dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 92vw;
  height: 88vh;
  max-width: 1600px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.map-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.map-modal-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
}
.map-modal-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}
.layer-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}
.layer-toggle input { accent-color: var(--accent); cursor: pointer; }
.map-modal-body {
  flex: 1;
  position: relative;
  min-height: 0;
}
#map-container {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  background: #0e1117;
}
.map-loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(14,17,23,.85);
  color: var(--text-muted);
  font-size: 14px;
  z-index: 1000;
}

/* ── New Task Modal ─────────────────────────────────────────── */

.new-task-dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 520px;
  max-width: 95vw;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.new-task-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.new-task-header .modal-close {
  position: static;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s;
}
.new-task-header .modal-close:hover { color: var(--text); }
.new-task-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}
.new-task-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.new-task-body .form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.new-task-body .form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.new-task-body .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.new-task-body .form-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text);
  font-size: 13px;
  font-family: var(--mono);
  outline: none;
  transition: border-color 0.15s;
}
.new-task-body .form-input:focus {
  border-color: var(--accent);
}
.new-task-body select.form-input {
  cursor: pointer;
  appearance: auto;
}
.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.7;
}
.new-task-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 6px;
}

/* ── Restart button ─────────────────────────────────────────── */
.btn-restart, .btn-input {
  margin-left: 4px;
  padding: 2px 6px !important;
  font-size: 13px;
  min-width: auto;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.btn-restart:hover, .btn-input:hover { opacity: 1; }

/* -- Quality preset slider -- */
.quality-slider-wrap {
  margin-bottom: 20px;
  padding: 14px 16px 10px;
  border: 1px solid var(--border, #333);
  border-radius: 8px;
  background: rgba(74, 158, 255, 0.04);
  transition: border-color 0.3s, background 0.3s;
}
.quality-slider-wrap.custom {
  border-color: var(--text-muted, #555);
  background: rgba(128, 128, 128, 0.06);
}
.quality-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.quality-slider-header .qs-label {
  font-size: 11px;
  color: var(--text-muted, #888);
  user-select: none;
}
.qs-preset-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent, #4a9eff);
  transition: color 0.3s;
}
.quality-slider-wrap.custom .qs-preset-name {
  color: var(--text-muted, #666);
}
.qs-track {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, #4a9eff 0%, #ffd700 100%);
  outline: none;
  cursor: pointer;
  transition: background 0.3s;
}
.quality-slider-wrap.custom .qs-track {
  background: linear-gradient(90deg, #444 0%, #666 100%);
}
.qs-track::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent, #4a9eff);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: background 0.3s;
}
.quality-slider-wrap.custom .qs-track::-webkit-slider-thumb {
  background: #666;
}
.qs-track::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent, #4a9eff);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: background 0.3s;
}
.quality-slider-wrap.custom .qs-track::-moz-range-thumb {
  background: #666;
}
