/* ============================================================
   Doctores — lo propio del panel, encima de las ds-*.
   ------------------------------------------------------------
   Prefijo `dc-` (doctores / consultorios). Lo que ya resuelven
   .ds-card, .ds-person, .ds-badge, .ds-stat o .ds-note NO se
   repite aquí. Esto es sólo la ficha de un consultorio:

     · dc-cases   — la lista
     · dc-case    — la ficha, con franja de color por etapa
     · dc-facts   — los datos de la cédula
     · dc-checks  — lo que le falta para salir y para citas

   Los colores salen de los tokens del tema; el modo oscuro
   (negro neutro) no necesita reglas extra.
   ============================================================ */

.dc-cases {
  display: flex;
  flex-direction: column;
  gap: var(--ds-4);
}

.dc-cases .ds-card + .ds-card { margin-top: 0; }

/* Búsqueda en la barra de pestañas: angosta para no empujarlas. */
.dc-search {
  width: 240px;
  max-width: 100%;
  height: 32px;
  font-size: 12.5px;
}

/* ── Ficha ───────────────────────────────────────────────────
   La franja dice la etapa sin leer nada: ámbar por revisar,
   verde en la app, gris fuera de la app, rojo rechazado. */
.dc-case {
  position: relative;
  overflow: hidden;
  --dc-accent: var(--orange);
}

.dc-case::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--dc-accent);
}

.dc-case--live { --dc-accent: var(--green); }
.dc-case--off { --dc-accent: var(--border); }
.dc-case--rejected { --dc-accent: var(--rose); }

.dc-case__body { padding: var(--ds-5) var(--ds-5) var(--ds-5) var(--ds-6); }

.dc-case__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--ds-4);
}

.dc-case__top .ds-person { min-width: 0; flex: 1; }

/* La cuenta dueña, a la derecha: con quién hablar si algo no cuadra. */
.dc-owner {
  text-align: right;
  flex: none;
  max-width: 45%;
  min-width: 0;
}

.dc-owner__name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-top: 2px;
}

.dc-owner__mail {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dc-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--ds-3);
}

/* ── Datos de la cédula ──────────────────────────────────── */
.dc-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--ds-3) var(--ds-4);
  margin-top: var(--ds-4);
  padding-top: var(--ds-4);
  border-top: 1px solid var(--border);
}

.dc-fact__k {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.dc-fact__v {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text);
  margin-top: 2px;
}

.dc-cedula {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

/* Botoncitos junto a la cédula: copiar y buscar en la SEP. */
.dc-mini {
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--ds-sunken);
  border: 1px solid var(--border);
  border-radius: var(--ds-r-sm);
  padding: 2px 8px;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.5;
}

.dc-mini:hover { color: var(--text); border-color: var(--text-muted); }

/* ── Lo que le falta ─────────────────────────────────────────
   Tres columnas: salir en la app, recibir citas, ficha. En
   verde lo que ya tiene; apagado lo que falta. */
.dc-checks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--ds-4);
  margin-top: var(--ds-4);
  padding-top: var(--ds-4);
  border-top: 1px solid var(--border);
}

.dc-checks__t {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.dc-checks ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dc-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.dc-check.is-ok { color: var(--text); }
.dc-check.is-ok .ds-i { color: var(--green); }
.dc-check:not(.is-ok) .ds-i { color: var(--rose); opacity: .75; }

/* ── Pie: nota y acciones ────────────────────────────────── */
.dc-case__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-3);
  flex-wrap: wrap;
  padding: var(--ds-3) var(--ds-5);
  border-top: 1px solid var(--border);
  background: var(--ds-sunken);
}

.dc-when {
  font-size: 11.5px;
  color: var(--text-muted);
  flex: 1;
  min-width: 200px;
}

.dc-when--warn { color: var(--orange); font-weight: 650; }

.dc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ds-2);
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .dc-case__top {
    flex-direction: column;
    gap: var(--ds-3);
  }

  .dc-owner { text-align: left; max-width: 100%; }
  .dc-search { width: 100%; }

  .dc-case__foot { align-items: stretch; }
  .dc-actions { width: 100%; }
  .dc-actions .ds-btn { flex: 1; justify-content: center; }
}
