/* ── portal-detalle.css — Modal detalle expediente (solo lectura) */

/* ── Overlay ──────────────────────────────────────────────────── */
.pd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.48);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity .22s ease;
}
.pd-overlay--visible { opacity: 1; }

/* ── Panel ────────────────────────────────────────────────────── */
.pd-panel {
  background: var(--p-card);
  border-radius: var(--p-r-lg);
  width: 100%;
  max-width: 700px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 72px rgba(0,0,0,.22);
  transform: translateY(12px) scale(.99);
  transition: transform .22s ease;
  overflow: hidden;
}
.pd-overlay--visible .pd-panel {
  transform: translateY(0) scale(1);
}

/* ── Header ───────────────────────────────────────────────────── */
.pd-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--p-border);
  flex-shrink: 0;
  background: var(--p-card);
}
.pd-hdr-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pd-hdr-titulo {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--p-text);
  letter-spacing: -.01em;
}
.pd-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--p-bg);
  color: var(--p-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.pd-close:hover { background: var(--p-danger); color: #fff; }

/* ── Body scrollable ──────────────────────────────────────────── */
.pd-body {
  overflow-y: auto;
  padding: 20px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

/* ── Cards ────────────────────────────────────────────────────── */
.pd-card {
  border: 1px solid var(--p-border);
  border-radius: var(--p-r-md);
  overflow: hidden;
}
.pd-card-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  font-family: 'Outfit', sans-serif;
  font-size: .84rem;
  font-weight: 700;
  color: var(--p-text);
  background: var(--p-bg);
  border-bottom: 1px solid var(--p-border);
}
.pd-card-hdr i { color: var(--p-primary); font-size: .85rem; }
.pd-card-body { padding: 16px 18px; }

/* ── Estado badge ─────────────────────────────────────────────── */
.pd-estado-row { margin-bottom: 14px; }
.pd-estado-badge {
  display: inline-block;
  padding: 4px 16px;
  border-radius: 999px;
  font-size: .73rem;
  font-weight: 700;
  letter-spacing: .05em;
}

/* ── Campos grid ──────────────────────────────────────────────── */
.pd-campos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}
.pd-campo {
  background: var(--p-bg);
  border-radius: var(--p-r-sm);
  padding: 10px 12px;
}
.pd-campo-lbl {
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--p-text-muted);
  margin-bottom: 4px;
}
.pd-campo-val {
  font-size: .87rem;
  font-weight: 600;
  color: var(--p-text);
  line-height: 1.4;
}

/* ── Partes tabla ─────────────────────────────────────────────── */
.pd-tabla {
  width: 100%;
  border-collapse: collapse;
  font-size: .86rem;
}
.pd-th {
  padding: 8px 14px;
  text-align: left;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--p-text-muted);
  background: var(--p-bg);
  border-bottom: 1px solid var(--p-border);
}
.pd-td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--p-border);
  vertical-align: middle;
}
.pd-tabla tbody tr:last-child .pd-td { border-bottom: none; }
.pd-td-nombre { font-weight: 600; color: var(--p-text); }
.pd-td-rol    { width: 130px; }
.pd-rol-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.pd-rol-sol { background: #dbeafe; color: #1d4ed8; }
.pd-rol-inv { background: #f3f4f6; color: #4b5563; }
[data-theme="dark"] .pd-rol-sol { background: #1e3a5f; color: #93c5fd; }
[data-theme="dark"] .pd-rol-inv { background: #2d3348; color: #9ca3af; }

/* ── Audiencias ───────────────────────────────────────────────── */
.pd-aud-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--p-r-sm);
  border-left: 3px solid transparent;
  margin-bottom: 8px;
  font-size: .86rem;
  flex-wrap: wrap;
}
.pd-aud-item:last-child { margin-bottom: 0; }
.pd-aud-item--proxima { background: #f0fdf4; border-left-color: #16a34a; }
.pd-aud-item--pasada  { background: var(--p-bg); border-left-color: var(--p-border); }
[data-theme="dark"] .pd-aud-item--proxima { background: #052e16; border-left-color: #16a34a; }
.pd-aud-lbl   { font-weight: 700; min-width: 90px; color: var(--p-text); }
.pd-aud-fecha { color: var(--p-text-muted); flex: 1; }
.pd-sin-fecha { color: var(--p-text-muted); font-style: italic; }
.pd-aud-badge {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
  white-space: nowrap;
}
.pd-aud-badge--proxima { background: #dcfce7; color: #15803d; }
.pd-aud-badge--pasada  { background: #f3f4f6; color: #6b7280; }
[data-theme="dark"] .pd-aud-badge--proxima { background: #052e16; color: #4ade80; }
[data-theme="dark"] .pd-aud-badge--pasada  { background: #2d3348; color: #9ca3af; }

.pd-meet-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #1a73e8;
  color: #fff !important;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: .72rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: background .15s;
  white-space: nowrap;
}
.pd-meet-btn:hover { background: #1557b0; }

/* ── Carpeta Drive ────────────────────────────────────────────── */
.pd-carpeta {
  border: 1px solid var(--p-border);
  border-radius: var(--p-r-md);
  padding: 14px 18px;
  background: var(--p-card);
}
.pd-carpeta-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #1a73e8;
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
  transition: color .15s;
}
.pd-carpeta-link:hover { color: #1557b0; text-decoration: underline; }
.pd-carpeta-link i { font-size: 1rem; }

/* ── Empty state ──────────────────────────────────────────────── */
.pd-empty-msg {
  font-size: .83rem;
  color: var(--p-text-muted);
  font-style: italic;
  padding: 4px 0;
}

/* ── Mobile bottom sheet ──────────────────────────────────────── */
@media (max-width: 600px) {
  .pd-overlay { align-items: flex-end; padding: 0; }
  .pd-panel {
    max-height: 92vh;
    border-radius: var(--p-r-lg) var(--p-r-lg) 0 0;
  }
  .pd-campos-grid { grid-template-columns: 1fr 1fr; }
}
