/* public/assets/style.css */

.actions button,
.actions .btn {
  margin-left: 0;
}

.main {
  padding: 10px 14px 18px;
}

.media-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.media-tabs .tab {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elev-2);
  color: var(--text);
  cursor: pointer;
}

.media-tabs .tab.active {
  background: var(--bg-elev);
  border-color: var(--border);
}

.grid {
  width: 100%;
  border-collapse: collapse;
}

.grid th, .grid td {
  border-bottom: 1px solid var(--border);
  padding: 8px 8px;
  vertical-align: top;
  font-size: 12px;
}

.grid th {
  text-align: left;
  opacity: 0.85;
  font-size: 13px;
}

.queue-panel {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-left: 8px;
  border-left: 1px solid var(--border);
  flex-wrap: wrap;
}

.queue-status {
  font-weight: 600;
}

.queue-counts {
  font-size: 12px;
  opacity: 0.8;
}

.queue-active {
  font-size: 12px;
  opacity: 0.9;
}

.queue-tasks {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.queue-task-btn {
  font-size: 12px;
  padding: 4px 8px;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.expand-btn {
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--control-bg);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-weight: 600;
}

.detail-row td {
  background: var(--bg-elev-2);
}

.detail-meta {
  padding: 6px 0 10px;
}

.meta-box {
  display: grid;
  gap: 10px;
  margin: 8px 0 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elev);
}

.meta-current {
  display: grid;
  gap: 4px;
}

.meta-line {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
  font-size: 12px;
}

.meta-label {
  opacity: 0.75;
}

.meta-actions {
  display: grid;
  gap: 8px;
}

.meta-search {
  display: flex;
  gap: 8px;
}

.meta-search input {
  flex: 1;
}

.meta-results {
  display: grid;
  gap: 8px;
}

.meta-result {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 10px;
  align-items: center;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  background: var(--control-bg);
  color: var(--text);
  cursor: pointer;
}

.meta-result:hover {
  border-color: var(--text);
}

.meta-poster {
  width: 46px;
  height: 68px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg-elev-2);
}

.meta-result-title {
  font-weight: 600;
}

.meta-result-meta {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 2px;
}

.meta-manual {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-manual input {
  min-width: 160px;
}

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

.detail-table th, .detail-table td {
  border-bottom: 1px solid var(--border);
  padding: 6px 6px;
  font-size: 12px;
}

.small {
  font-size: 12px;
  opacity: 0.9;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  margin-right: 6px;
  margin-bottom: 4px;
  font-size: 12px;
  opacity: 0.9;
}

td.editable {
  cursor: text;
}

td.editable input {
  width: 100%;
  box-sizing: border-box;
}

dialog {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elev);
  color: var(--text);
  width: max-content;
  max-width: 92vw;
  justify-content: center;
}

.dialog {
  padding: 12px 12px 8px;
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.task-builder {
  display: grid;
  gap: 10px;
}

.builder-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.builder-row label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.builder-row .full {
  grid-column: 1 / -1;
}

.task-builder .checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
}

.task-builder .checks .row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.source-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
  font-size: 12px;
  opacity: 0.9;
}

.source-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.source-field {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  background: var(--bg-elev-2);
}

.source-field .lbl {
  margin-bottom: 4px;
}

.source-raw {
  margin-top: 10px;
}

.source-files {
  grid-column: 1 / -1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  background: var(--bg-elev-2);
}

.source-preview {
  grid-column: 1 / -1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  background: var(--bg-elev-2);
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.preview-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.file-tree {
  list-style: none;
  margin: 6px 0 0;
  padding-left: 16px;
  font-size: 12px;
}

.file-tree li {
  margin: 2px 0;
}

.file-folder {
  font-weight: 600;
}

.file-item {
  opacity: 0.9;
}

.file-meta {
  opacity: 0.7;
  margin-left: 6px;
}

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

@media (max-width: 820px) {
  .source-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .source-fields {
    grid-template-columns: 1fr;
  }
  .builder-row {
    grid-template-columns: 1fr;
  }
  .task-builder .checks {
    grid-template-columns: 1fr;
  }
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.menu {
  display: flex;
  justify-content: flex-end;
  padding-top: 10px;
}

/* -----------------------
  Global job indicator
----------------------- */

.job-indicator progress {
  width: 140px;
  height: 10px;
}
