/* =========================================================
 * Doc Panel — Panel de Documentación del Pedido
 * v3.1 — Con clasificación doc_type
 *         Fix: especificidad CSS sin !important
 * ========================================================= */

/* Button active state */
#btnDocPanel.doc-btn-active,
.doc-btn-active {
  background: rgba(240, 136, 62, 0.15);
}

/* Panel container */
.doc-panel {
  display: none;
  background: #1c2128;
  border: 1px solid rgba(240, 136, 62, 0.25);
  border-radius: 10px;
  margin: 8px 0 16px;
  overflow: hidden;
}
.doc-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.doc-panel-header h3 {
  font-size: 13px;
  color: #f0883e;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.doc-panel-close {
  color: var(--muted);
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  background: none;
  border: none;
}
.doc-panel-close:hover {
  background: var(--border);
}
.doc-panel-body {
  padding: 16px;
}

/* Subsections */
.doc-sub {
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
}
.doc-sub:last-child {
  margin-bottom: 0;
}
.doc-sub-title {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.doc-sub-title .doc-section-count {
  font-size: 11px;
  color: #8b949e;
  font-weight: 400;
}

/* Albaran fields row */
.doc-albaran-row {
  display: flex;
  gap: 10px;
  align-items: end;
}
.doc-albaran-field {
  flex: 1;
}
.doc-albaran-field.narrow {
  flex: 0.5;
}
.doc-albaran-field label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}
.doc-albaran-field input {
  width: 100%;
  background: #161b22;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--fg);
  font-size: 13px;
}
.doc-albaran-field input::placeholder {
  color: #484f58;
}

/* Status badges */
.doc-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
}
.doc-badge-ok {
  background: rgba(63, 185, 80, 0.15);
  color: #3fb950;
}
.doc-badge-pending {
  background: rgba(248, 81, 73, 0.15);
  color: #f85149;
}

/* Doc type badges */
.doc-dtype-albaran {
  background: rgba(88, 166, 255, 0.15);
  color: #58a6ff;
}
.doc-dtype-transporte {
  background: rgba(210, 153, 34, 0.15);
  color: #d29922;
}
.doc-dtype-otro {
  background: rgba(139, 148, 158, 0.15);
  color: #8b949e;
}

/*
 * Doc type inline select for reclassification
 * Specificity: .doc-panel .doc-file-item .doc-dtype-select (0-3-0)
 * beats .form-row select (0-1-1) from styles.css — no !important needed
 */
.doc-panel .doc-file-item .doc-dtype-select {
  background: #161b22;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--fg);
  font-size: 10px;
  padding: 2px 2px;
  cursor: pointer;
  width: 100px;
  min-width: 100px;
  max-width: 100px;
  flex-shrink: 0;
}
.doc-panel .doc-file-item .doc-dtype-select:hover {
  border-color: #58a6ff;
}
.doc-panel .doc-file-item .doc-dtype-select:focus {
  outline: none;
  border-color: #58a6ff;
  box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

/* Drop zones */
.doc-drop-zone {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  color: #484f58;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.doc-drop-zone:hover,
.doc-drop-active {
  border-color: var(--blue);
  color: var(--blue);
}
.doc-drop-icon {
  font-size: 20px;
  margin-bottom: 4px;
}
.doc-drop-link {
  color: var(--blue);
  text-decoration: underline;
}
.doc-drop-hint {
  font-size: 10px;
  color: #484f58;
}

/* File items */
.doc-file-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  background: #161b22;
  border-radius: 6px;
  border: 1px solid var(--border);
  margin-bottom: 6px;
}
.doc-file-icon {
  font-size: 16px;
  flex-shrink: 0;
}
.doc-file-name {
  flex: 1 1 auto;
  font-size: 11px;
  color: var(--blue);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 80px;
}
.doc-file-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.doc-file-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
  border-radius: 4px;
  text-decoration: none;
}
.doc-file-btn:hover {
  background: var(--border);
}

/* Transporte section accent */
.doc-sub-transporte {
  border-color: rgba(210, 153, 34, 0.3);
}
.doc-sub-transporte .doc-sub-title {
  color: #d29922;
}
