/* ================================================================
   DOMINUS M0 — Ficha de Proyecto v4.0.0
   Dark theme. Todos los selectores prefixados con #dm0
   ================================================================ */

#dm0 {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 14px;
  color: #e2e8f0;
  max-width: 900px;
  margin: 0 auto !important;
  box-sizing: border-box;
}
#dm0 * { box-sizing: border-box; }

/* ── WRAPPER ─────────────────────────────────────────────────── */
#dm0 .dm0-wrapper {
  background: #0d1829;
  border: 1px solid #1e3a5f;
  border-radius: 12px;
  overflow: hidden;
}

/* ── LOADING ─────────────────────────────────────────────────── */
#dm0 .dominus-m0-loading {
  display: flex; align-items: center; gap: 10px;
  padding: 40px; justify-content: center;
  color: #64748b; font-size: 15px;
}
#dm0 .dominus-spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2.5px solid #1e3a5f; border-top-color: #3b82f6;
  border-radius: 50%;
  animation: dm0spin 0.7s linear infinite;
}
@keyframes dm0spin { to { transform: rotate(360deg); } }

/* ── HEADER ──────────────────────────────────────────────────── */
#dm0 .dm0-header {
  background: linear-gradient(135deg, #091525 0%, #0f2040 100%);
  padding: 18px 20px 14px;
  border-bottom: 1px solid #1e3a5f;
}
#dm0 .dm0-hdr-top {
  display: flex; justify-content: space-between;
  align-items: flex-start; flex-wrap: wrap; gap: 8px;
  margin-bottom: 12px;
}
#dm0 .dm0-titulo {
  margin: 0 0 2px; font-size: 18px; font-weight: 700;
  color: #e2e8f0 !important;
  -webkit-text-fill-color: #e2e8f0 !important; opacity: 1 !important;
  border: none; padding: 0;
}
#dm0 .dm0-sub {
  margin: 0; font-size: 12px; color: #94a3b8;
  -webkit-text-fill-color: #94a3b8 !important; opacity: 1 !important;
}

/* Badge zona */
#dm0 .dm0-badge-zona {
  display: inline-block; padding: 3px 10px;
  border-radius: 20px; font-size: 12px; font-weight: 700;
  background: #1e3a5f; color: #60a5fa;
  -webkit-text-fill-color: #60a5fa !important; opacity: 1 !important;
}

/* Barra de progreso */
#dm0 .dm0-prog-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}
#dm0 .dm0-prog-lbl {
  font-size: 11px; color: #94a3b8; white-space: nowrap;
  -webkit-text-fill-color: #94a3b8 !important; opacity: 1 !important;
}
#dm0 .dm0-prog-bar {
  flex: 1; height: 5px; background: #1e3a5f; border-radius: 3px; overflow: hidden;
}
#dm0 .dm0-prog-fill {
  height: 100%; background: #3b82f6; border-radius: 3px; transition: width 0.3s;
}
#dm0 .dm0-prog-pct {
  font-size: 11px; font-weight: 700; color: #94a3b8; min-width: 32px; text-align: right;
  -webkit-text-fill-color: #94a3b8 !important; opacity: 1 !important;
}

/* U normativos */
#dm0 .dm0-u-row {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px;
}
#dm0 .dm0-u-item {
  background: #0d1f36; border: 1px solid #1e3a5f;
  border-radius: 6px; padding: 3px 8px;
  display: flex; gap: 5px; align-items: center;
}
#dm0 .dm0-u-lbl {
  font-size: 10px; color: #64748b; text-transform: uppercase; letter-spacing: 0.04em;
  -webkit-text-fill-color: #64748b !important; opacity: 1 !important;
}
#dm0 .dm0-u-val {
  font-size: 12px; font-weight: 700; color: #60a5fa;
  -webkit-text-fill-color: #60a5fa !important; opacity: 1 !important;
}

/* ── MENSAJES ─────────────────────────────────────────────────── */
#dm0 .dm0-msg {
  margin: 0; padding: 10px 16px; font-size: 13px; font-weight: 500;
}
#dm0 .dm0-msg--ok  { background: #052e16; color: #4ade80; border-left: 4px solid #22c55e;
  -webkit-text-fill-color: #4ade80 !important; opacity: 1 !important; }
#dm0 .dm0-msg--err { background: #2d0a0a; color: #fca5a5; border-left: 4px solid #ef4444;
  -webkit-text-fill-color: #fca5a5 !important; opacity: 1 !important; }
#dm0 .dm0-msg--info { background: #0c1f36; color: #94a3b8; display: flex; align-items: center; gap: 8px;
  -webkit-text-fill-color: #94a3b8 !important; opacity: 1 !important; }

/* ── TABS ─────────────────────────────────────────────────────── */
#dm0 .dm0-tabs {
  display: flex; background: #091220; border-bottom: 1px solid #1e3a5f; overflow-x: auto;
}
#dm0 .dm0-tab {
  flex: 1; min-width: 110px; padding: 12px 10px;
  border: none; background: transparent; cursor: pointer;
  font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 500;
  color: #475569; border-bottom: 3px solid transparent; transition: all 0.15s;
  -webkit-text-fill-color: #475569 !important; opacity: 1 !important;
}
#dm0 .dm0-tab:hover { color: #94a3b8; -webkit-text-fill-color: #94a3b8 !important; }
#dm0 .dm0-tab--on {
  color: #3b82f6 !important; border-bottom-color: #3b82f6; background: #0d1829;
  -webkit-text-fill-color: #3b82f6 !important; opacity: 1 !important;
}

/* ── BODY / BLOQUE ────────────────────────────────────────────── */
#dm0 .dm0-body { padding: 20px; }
#dm0 .dm0-bloque { /* contenedor limpio */ }

/* ── GRID ─────────────────────────────────────────────────────── */
#dm0 .dm0-grid { display: grid; gap: 14px; }
#dm0 .dm0-grid--2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 600px) { #dm0 .dm0-grid--2 { grid-template-columns: 1fr; } }
#dm0 .dm0-span2 { grid-column: 1 / -1; }

/* ── CAMPOS ───────────────────────────────────────────────────── */
#dm0 .dm0-campo { display: flex; flex-direction: column; gap: 5px; }
#dm0 .dm0-label {
  font-size: 11px; font-weight: 600; color: #64748b;
  text-transform: uppercase; letter-spacing: 0.05em;
  -webkit-text-fill-color: #64748b !important; opacity: 1 !important;
}
#dm0 .dm0-input,
#dm0 .dm0-select {
  width: 100%; padding: 9px 12px;
  background: #060e1a; border: 1.5px solid #1e3a5f; border-radius: 7px;
  color: #e2e8f0; font-size: 14px; font-family: 'Inter', sans-serif;
  transition: border-color 0.15s;
  -webkit-text-fill-color: #e2e8f0 !important; opacity: 1 !important;
}
#dm0 .dm0-input:focus,
#dm0 .dm0-select:focus {
  outline: none; border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
#dm0 .dm0-readonly {
  background: #091220; color: #60a5fa; cursor: default;
  -webkit-text-fill-color: #60a5fa !important;
}
#dm0 .dm0-select option { background: #0d1829; color: #e2e8f0; }

/* ── SECCIÓN TÍTULOS ──────────────────────────────────────────── */
#dm0 .dm0-sec-title {
  font-size: 13px; font-weight: 700; color: #8b5cf6;
  margin: 16px 0 10px; padding-bottom: 6px; border-bottom: 1px solid #2d1f63;
  -webkit-text-fill-color: #8b5cf6 !important; opacity: 1 !important;
}
#dm0 .dm0-sec-title:first-child { margin-top: 0; }

/* ── TOGGLE PROPIETARIO ───────────────────────────────────────── */
#dm0 .dm0-toggle-tipo {
  display: flex; gap: 8px; margin-bottom: 16px;
  padding: 4px; background: #060e1a; border-radius: 8px; width: fit-content;
}
#dm0 .dm0-btn-tipo {
  padding: 7px 16px; border: 1.5px solid transparent;
  border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 500;
  color: #64748b; background: transparent; font-family: 'Inter', sans-serif; transition: all 0.15s;
  -webkit-text-fill-color: #64748b !important; opacity: 1 !important;
}
#dm0 .dm0-btn-tipo.active {
  background: #0d1829; color: #3b82f6; border-color: #1e3a5f;
  -webkit-text-fill-color: #3b82f6 !important; font-weight: 600;
}

/* ── CHECKBOXES ───────────────────────────────────────────────── */
#dm0 .dm0-checkbox-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px; margin-top: 6px;
}
#dm0 .dm0-check-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; cursor: pointer; padding: 7px 10px;
  border-radius: 6px; border: 1px solid transparent; transition: all 0.12s;
  color: #94a3b8;
  -webkit-text-fill-color: #94a3b8 !important; opacity: 1 !important;
}
#dm0 .dm0-check-label:hover { background: #0d1829; border-color: #1e3a5f; }
#dm0 .dm0-check-label input[type="checkbox"] {
  width: 14px; height: 14px; accent-color: #3b82f6; flex-shrink: 0;
}

/* ── FOOTER ───────────────────────────────────────────────────── */
#dm0 .dm0-footer {
  padding: 14px 20px; border-top: 1px solid #1e3a5f; background: #091220;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
}
#dm0 .dm0-footer-nav { display: flex; gap: 8px; }

/* ── BOTONES ──────────────────────────────────────────────────── */
#dm0 .dm0-btn {
  padding: 9px 20px; border-radius: 7px; font-size: 13px; font-weight: 600;
  border: 2px solid transparent; cursor: pointer; font-family: 'Inter', sans-serif;
  transition: all 0.15s;
}
#dm0 .dm0-btn:disabled { opacity: 0.45; cursor: not-allowed; }
#dm0 .dm0-btn--sec {
  background: #0d1829; color: #94a3b8; border-color: #1e3a5f;
  -webkit-text-fill-color: #94a3b8 !important; opacity: 1 !important;
}
#dm0 .dm0-btn--sec:hover:not(:disabled) { background: #1e3a5f; }
#dm0 .dm0-btn--save {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: #fff; border-color: transparent;
  -webkit-text-fill-color: #fff !important; opacity: 1 !important;
}
#dm0 .dm0-btn--save:hover:not(:disabled) { opacity: 0.85; transform: translateY(-1px); }

/* ── SIN PROYECTO ─────────────────────────────────────────────── */
#dm0 .dm0-nopid {
  text-align: center; padding: 3rem 2rem; color: #64748b;
}
#dm0 .dm0-nopid p {
  margin-bottom: 1.5rem; font-size: 1rem;
  -webkit-text-fill-color: #64748b !important; opacity: 1 !important;
}

/* ── MENSAJE GUARDADO CON BOTÓN DASHBOARD ─────────────────────── */
#dm0 .dm0-msg--saved {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
}
#dm0 .dm0-btn-dashboard {
  display: inline-block;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  opacity: 1 !important;
  padding: 8px 18px; border-radius: 7px;
  font-size: 13px; font-weight: 600;
  text-decoration: none; transition: opacity 0.15s;
  white-space: nowrap;
}
#dm0 .dm0-btn-dashboard:hover { opacity: 0.85; }
