/*
 * Estilos del plugin Pacientes Clínica v2.0
 * Diseño glassmorphism, responsive y accesible
 */

:root {
  --pc-primary: #30c7b4;
  --pc-primary-dark: #28a89a;
  --pc-bg: #f7faf9;
  --pc-text: #1b2b2d;
  --pc-muted: #6b7a7b;
  --pc-card-bg: rgba(255, 255, 255, 0.75);
  --pc-border: rgba(0, 0, 0, 0.08);
  --pc-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  --pc-radius: 16px;
  --pc-danger: #ef5350;
  --pc-warning: #fb8c00;
  --pc-info: #42a5f5;
  --pc-purple: #ab47bc;
}

* { box-sizing: border-box; }

.pc-app {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--pc-text);
  background: linear-gradient(135deg, #eaf7f4 0%, #f7fbff 100%);
  min-height: 100vh;
}

/* Topbar */
.pc-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 20px;
  background: var(--pc-card-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--pc-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.pc-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.pc-logo { font-size: 24px; }
.pc-title { font-size: 18px; }

.pc-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pc-user-name {
  font-size: 14px;
  color: var(--pc-muted);
}

/* Layout principal */
.pc-body {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  padding: 20px;
  max-width: 1600px;
  margin: 0 auto;
}

/* Sidebar */
.pc-sidebar {
  background: var(--pc-card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--pc-border);
  border-radius: var(--pc-radius);
  padding: 16px;
  box-shadow: var(--pc-shadow);
  height: fit-content;
  position: sticky;
  top: 80px;
}

.pc-side-section { margin-top: 16px; }
.pc-side-section:first-child { margin-top: 0; }
.pc-side-section h4 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--pc-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pc-side-section input,
.pc-side-section select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--pc-border);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  margin-bottom: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pc-side-section input:focus,
.pc-side-section select:focus {
  border-color: var(--pc-primary);
  box-shadow: 0 0 0 3px rgba(48, 199, 180, 0.15);
  outline: none;
}

.pc-filter-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.pc-filter-actions .pc-btn { flex: 1; }

/* Carpetas */
.pc-folder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px dashed var(--pc-border);
  border-radius: 10px;
  margin-bottom: 8px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
}

.pc-folder:hover {
  border-color: var(--pc-primary);
  background: rgba(48, 199, 180, 0.05);
}

.pc-folder.active {
  background: var(--pc-primary);
  color: #fff;
  border-color: var(--pc-primary);
}

.pc-folder .act { display: flex; gap: 4px; }
.pc-folder .act .pc-ico {
  border: none;
  background: transparent;
  cursor: pointer;
  opacity: 0.7;
}
.pc-folder .act .pc-ico:hover { opacity: 1; }
.pc-folder.active .act .pc-ico { color: #fff; }

/* Main area */
.pc-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pc-main-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--pc-card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--pc-border);
  border-radius: var(--pc-radius);
  padding: 12px 16px;
}

.pc-views select {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--pc-border);
  background: #fff;
  font-size: 14px;
}

.pc-actions-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Botones */
.pc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--pc-border);
  background: #fff;
  color: var(--pc-text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.pc-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.pc-btn-primary {
  background: linear-gradient(135deg, var(--pc-primary), #64e7d9);
  color: #073432;
  border: none;
}

.pc-btn-primary:hover {
  background: linear-gradient(135deg, var(--pc-primary-dark), var(--pc-primary));
}

.pc-btn-danger {
  background: var(--pc-danger);
  color: #fff;
  border: none;
}

.pc-btn-danger:hover {
  background: #d9534f;
}

.pc-w100 { width: 100%; }

/* Estadísticas / Gráficas */
.pc-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.pc-chart-card {
  background: var(--pc-card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--pc-border);
  border-radius: var(--pc-radius);
  padding: 16px;
  box-shadow: var(--pc-shadow);
}

.pc-chart-title {
  text-align: center;
  font-size: 12px;
  color: var(--pc-muted);
  margin-top: 10px;
  font-weight: 500;
}

/* Tabla */
.pc-table-wrap {
  background: var(--pc-card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--pc-border);
  border-radius: var(--pc-radius);
  padding: 16px;
  box-shadow: var(--pc-shadow);
  overflow-x: auto;
  max-width: 100%;
}

.pc-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  min-width: 600px;
}

.pc-table th:nth-child(1),
.pc-table td:nth-child(1) { width: 40px; min-width: 40px; }
.pc-table th:nth-child(5),
.pc-table td:nth-child(5) { width: 200px; min-width: 200px; }

.pc-table th,
.pc-table td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--pc-border);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pc-table th {
  font-weight: 600;
  color: var(--pc-muted);
  background: rgba(0, 0, 0, 0.02);
}

.pc-table tbody tr:hover {
  background: rgba(48, 199, 180, 0.05);
}

.pc-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.01);
}

.pc-actions {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: center;
}

.pc-actions-col { width: 200px; min-width: 200px; }

/* Iconos de acción */
.pc-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  border: 1px solid rgba(48, 199, 180, 0.3);
  background: rgba(48, 199, 180, 0.12);
  border-radius: 8px;
  cursor: pointer;
  color: var(--pc-primary);
  transition: all 0.2s;
  padding: 0;
}

.pc-ico:hover {
  background: rgba(48, 199, 180, 0.25);
  transform: scale(1.08);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.pc-ico svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  display: block;
}

.pc-ico.pc-edit { 
  color: var(--pc-warning); 
  background: rgba(251, 140, 0, 0.12);
  border-color: rgba(251, 140, 0, 0.3);
}
.pc-ico.pc-evol { 
  color: var(--pc-info); 
  background: rgba(66, 165, 245, 0.12);
  border-color: rgba(66, 165, 245, 0.3);
}
.pc-ico.pc-add-folder { 
  color: var(--pc-purple); 
  background: rgba(171, 71, 188, 0.12);
  border-color: rgba(171, 71, 188, 0.3);
}
.pc-ico.pc-word { 
  color: #6d4c41; 
  background: rgba(109, 76, 65, 0.12);
  border-color: rgba(109, 76, 65, 0.3);
}
.pc-ico.pc-del { 
  color: var(--pc-danger); 
  background: rgba(239, 83, 80, 0.12);
  border-color: rgba(239, 83, 80, 0.3);
}

.pc-ico.pc-edit:hover { background: rgba(251, 140, 0, 0.25); }
.pc-ico.pc-evol:hover { background: rgba(66, 165, 245, 0.25); }
.pc-ico.pc-add-folder:hover { background: rgba(171, 71, 188, 0.25); }
.pc-ico.pc-word:hover { background: rgba(109, 76, 65, 0.25); }
.pc-ico.pc-del:hover { background: rgba(239, 83, 80, 0.25); }

/* Tarjetas */
.pc-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.pc-card {
  background: #fff;
  border: 1px solid var(--pc-border);
  border-radius: var(--pc-radius);
  padding: 16px;
  box-shadow: var(--pc-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.pc-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.pc-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.pc-card-title {
  font-weight: 600;
  font-size: 16px;
}

.pc-card p {
  margin: 6px 0;
  font-size: 14px;
  color: var(--pc-muted);
}

.pc-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--pc-border);
}

/* Modal */
.pc-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.pc-modal[hidden] { display: none; }

.pc-modal-content {
  background: #fff;
  border-radius: var(--pc-radius);
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.pc-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border: 2px solid var(--pc-border);
  background: #fff;
  border-radius: 50%;
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pc-muted);
  transition: all 0.2s;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.pc-modal-close:hover {
  background: var(--pc-danger);
  border-color: var(--pc-danger);
  color: #fff;
}

/* Formularios */
.pc-form-header {
  /* Aire extra y evitar solape con la X de cierre */
  margin: 0 0 24px;
  padding: 6px 56px 0 0;
  border-bottom: 0;
}

.pc-form-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--pc-text);
}

.pc-form h3 {
  margin: 20px 0 16px;
  font-size: 16px;
  color: var(--pc-primary);
  border-bottom: 2px solid var(--pc-primary);
  padding-bottom: 8px;
}

.pc-form h3:first-child { margin-top: 0; }

/* Secciones plegables (ficha del paciente) */
.pc-section { margin-top: 0; }
.pc-section-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--pc-primary);
  font-size: 16px;
  font-weight: 600;
  border-bottom: 2px solid var(--pc-primary);
}
.pc-section-toggle:focus { outline: none; box-shadow: 0 0 0 3px rgba(48, 199, 180, 0.18); border-radius: 10px; }
.pc-section-toggle-icon {
  color: var(--pc-muted);
  font-size: 20px;
  transform: rotate(0deg);
  transition: transform 0.2s ease;
}
.pc-section.is-open .pc-section-toggle-icon { transform: rotate(90deg); }
.pc-section-body { padding-top: 14px; }

/* Badge de asistencia (reutilizable en evolutivo y ficha) */
.pc-evol-item-asistencia-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75em;
  font-weight: 700;
  margin-left: 8px;
  vertical-align: middle;
  line-height: 1.2;
}
.pc-evol-item-asistencia-badge.acudio {
  background: #10b981;
  color: #fff;
}
.pc-evol-item-asistencia-badge.no-acude {
  background: #f59e0b;
  color: #fff;
}

.pc-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.pc-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pc-form-group.pc-form-full {
  grid-column: 1 / -1;
}

.pc-form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--pc-muted);
}

.pc-form input,
.pc-form select,
.pc-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--pc-border);
  border-radius: 8px;
  background: #fafafa;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pc-form input:focus,
.pc-form select:focus,
.pc-form textarea:focus {
  border-color: var(--pc-primary);
  box-shadow: 0 0 0 3px rgba(48, 199, 180, 0.15);
  outline: none;
  background: #fff;
}

.pc-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--pc-border);
}

.pc-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 500;
  color: var(--pc-text);
  font-size: 14px;
}

.pc-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--pc-primary);
}

/* Filtros labels */
.pc-filter-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--pc-muted);
  margin-bottom: 4px;
}

.pc-perinatal-section {
  background: rgba(48, 199, 180, 0.05);
  border: 1px solid rgba(48, 199, 180, 0.2);
  border-radius: var(--pc-radius);
  padding: 16px;
  margin-top: 16px;
}

.pc-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--pc-muted);
  font-size: 14px;
}

/* Responsive */
@media (max-width: 900px) {
  .pc-body {
    grid-template-columns: 1fr;
  }

  .pc-sidebar {
    position: static;
  }

  .pc-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .pc-top-actions {
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .pc-body { padding: 12px; }

  .pc-main-head {
    flex-direction: column;
    align-items: stretch;
  }

  .pc-actions-btns {
    justify-content: center;
  }

  /* Tabla a tarjetas en móvil */
  .pc-table thead { display: none; }

  .pc-table,
  .pc-table tbody,
  .pc-table tr,
  .pc-table td {
    display: block;
    width: 100%;
  }

  .pc-table tr {
    margin-bottom: 16px;
    border: 1px solid var(--pc-border);
    border-radius: var(--pc-radius);
    padding: 12px;
    background: #fff;
  }

  .pc-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border: none;
  }

  .pc-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--pc-muted);
    font-size: 12px;
  }

  .pc-table td.pc-actions {
    justify-content: flex-start;
    padding-top: 12px;
    margin-top: 8px;
    border-top: 1px solid var(--pc-border);
  }

  .pc-table td.pc-actions::before { display: none; }

  .pc-modal-content {
    padding: 16px;
    border-radius: 12px;
  }

  .pc-form-grid {
    grid-template-columns: 1fr;
  }
}

/* Print */
@media print {
  .pc-topbar,
  .pc-sidebar,
  .pc-main-head,
  .pc-modal { display: none !important; }

  .pc-body {
    grid-template-columns: 1fr;
    padding: 0;
  }
}

/* FullCalendar overrides */
.fc .fc-button {
  background: var(--pc-primary) !important;
  border-color: var(--pc-primary) !important;
  color: #fff !important;
  padding: 8px 14px !important;
  border-radius: 8px !important;
  margin: 0 4px !important;
}

.fc .fc-button:hover {
  background: var(--pc-primary-dark) !important;
  border-color: var(--pc-primary-dark) !important;
}

.fc .fc-button-primary:not(:disabled).fc-button-active {
  background: var(--pc-primary-dark) !important;
  border-color: var(--pc-primary-dark) !important;
}

.fc .fc-prev-button,
.fc .fc-next-button {
  padding: 6px 10px !important;
  margin: 0 2px !important;
}

.fc .fc-icon {
  font-size: 1.2em;
}

.fc .fc-icon-chevron-left::before {
  content: '‹';
  font-size: 20px;
  font-weight: bold;
}

.fc .fc-icon-chevron-right::before {
  content: '›';
  font-size: 20px;
  font-weight: bold;
}

.fc .fc-toolbar-title {
  font-size: 1.25rem !important;
  font-weight: 600;
  color: var(--pc-text);
}

.fc .fc-daygrid-day:hover {
  background: rgba(48, 199, 180, 0.05);
}

.fc-event {
  background: var(--pc-primary) !important;
  border: none !important;
  border-radius: 4px !important;
  padding: 4px 8px !important;
  cursor: pointer;
  color: #fff !important;
}

.fc .fc-toolbar-chunk {
  display: flex;
  align-items: center;
  gap: 6px;
}

.fc-event .fc-event-title,
.fc-event .fc-event-time {
  color: #fff !important;
  font-weight: 500;
}

.fc-daygrid-event-dot {
  border-color: #fff !important;
}

/* Calendar modal - special close button position */
#pc-cal .pc-modal-content {
  position: relative;
  padding-top: 50px;
}

#pc-cal .pc-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1000;
  background: #fff;
  border: 2px solid var(--pc-border);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

#pc-cal .pc-modal-close:hover {
  background: #f5f5f5;
  border-color: var(--pc-primary);
}

/* Calendar header spacing */
.fc .fc-toolbar {
  flex-wrap: wrap;
  padding-right: 50px;
  gap: 12px;
  margin-bottom: 16px !important;
}

/* Folder action icons - always visible */
.pc-folder .act {
  display: flex;
  gap: 6px;
  opacity: 1;
}

.pc-folder .act .pc-ico {
  width: 28px;
  height: 28px;
  min-width: 28px;
  background: rgba(48, 199, 180, 0.15);
  border: 1px solid rgba(48, 199, 180, 0.3);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--pc-primary);
}

.pc-folder .act .pc-ico svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.pc-folder .act .pc-ico.pc-del {
  color: var(--pc-danger);
  background: rgba(239, 83, 80, 0.15);
  border-color: rgba(239, 83, 80, 0.3);
}

.pc-folder.active .act .pc-ico {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.4);
  color: #fff;
}

.pc-folder.active .act .pc-ico.pc-del {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.4);
  color: #fff;
}

/* Event detail modal */
.pc-event-detail h3 {
  border-bottom: 2px solid var(--pc-primary);
  padding-bottom: 12px;
}

.pc-event-detail p {
  margin: 4px 0;
  color: var(--pc-text);
}

/* Card actions layout */
.pc-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--pc-border);
}

/* Citas section in patient form */
.pc-citas-section {
  margin-top: 20px;
  padding: 16px;
  background: rgba(66, 165, 245, 0.05);
  border: 1px solid rgba(66, 165, 245, 0.2);
  border-radius: var(--pc-radius);
}

.pc-citas-list {
  margin-top: 12px;
}

.pc-cita-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--pc-border);
  border-radius: 8px;
  margin-bottom: 8px;
}

.pc-cita-item:last-child {
  margin-bottom: 0;
}

.pc-cita-info strong {
  color: var(--pc-primary);
}

.pc-cita-date {
  font-size: 13px;
  color: var(--pc-muted);
}

/* Multi-select dropdowns */
.pc-multi-select {
  position: relative;
  width: 100%;
}

.pc-multi-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: linear-gradient(180deg, #ffffff 0%, rgba(247, 250, 249, 0.9) 100%);
  border: 1px solid var(--pc-border);
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: 48px;
}

.pc-multi-select-trigger:hover {
  border-color: var(--pc-primary);
}

.pc-multi-select.open .pc-multi-select-trigger {
  border-color: var(--pc-primary);
  box-shadow: 0 0 0 3px rgba(48, 199, 180, 0.15);
}

.pc-multi-select-text {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-height: 20px;
  color: var(--pc-text);
}

.pc-multi-select-text.placeholder {
  color: var(--pc-muted);
}

.pc-multi-select-arrow {
  flex-shrink: 0;
  color: var(--pc-muted);
  transition: transform 0.2s;
}

.pc-multi-select.open .pc-multi-select-arrow {
  transform: rotate(180deg);
}

.pc-multi-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: #fff;
  border: 1px solid var(--pc-border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  max-height: 220px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

.pc-multi-select.open .pc-multi-select-dropdown {
  display: block;
}

.pc-multi-select-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.15s;
}

.pc-multi-select-option:hover {
  background: var(--pc-bg);
}

.pc-multi-select-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--pc-primary);
  cursor: pointer;
}

.pc-multi-select-option label {
  flex: 1;
  cursor: pointer;
  margin: 0;
}

.pc-multi-select-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: calc(100% - 24px);
}

.pc-multi-select-tag {
  display: inline-flex;
  align-items: center;
  background: rgba(48, 199, 180, 0.14);
  color: var(--pc-text);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(48, 199, 180, 0.22);
}

/* Radio group para perinatal */
.pc-radio-group {
    display: flex;
    gap: 24px;
    padding: 8px 0;
}

.pc-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
}

.pc-radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Sección de documentos adjuntos */
.pc-documents-section {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.pc-upload-area {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.pc-btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.pc-btn-secondary:hover {
    background: #e5e7eb;
}

.pc-upload-hint {
    font-size: 13px;
    color: #6b7280;
}

.pc-documents-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pc-document-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    gap: 12px;
}

.pc-document-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.pc-document-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #dbeafe;
    color: #2563eb;
    border-radius: 6px;
    flex-shrink: 0;
}

.pc-document-icon.pdf {
    background: #fee2e2;
    color: #dc2626;
}

.pc-document-icon.excel {
    background: #dcfce7;
    color: #16a34a;
}

.pc-document-details {
    flex: 1;
    min-width: 0;
}

.pc-document-name {
    font-weight: 500;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pc-document-meta {
    font-size: 12px;
    color: #6b7280;
}

.pc-document-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.pc-doc-btn {
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
}

.pc-doc-btn-download {
    background: #2563eb;
    color: white;
}

.pc-doc-btn-download:hover {
    background: #1d4ed8;
}

.pc-doc-btn-delete {
    background: #fee2e2;
    color: #dc2626;
}

.pc-doc-btn-delete:hover {
    background: #fecaca;
}

.pc-documents-empty {
    text-align: center;
    padding: 24px;
    color: #6b7280;
    font-size: 14px;
}

.pc-upload-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #eff6ff;
    border-radius: 6px;
    font-size: 13px;
    color: #2563eb;
}

.pc-upload-progress .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #bfdbfe;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive documents */
@media (max-width: 600px) {
    .pc-document-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .pc-document-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ===== CITAS CLICKEABLES EN FICHA ===== */
.pc-citas-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.pc-citas-section h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    color: var(--pc-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pc-citas-count {
    font-size: 13px;
    font-weight: normal;
    color: var(--pc-muted);
}

.pc-citas-hint {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: var(--pc-muted);
}

.pc-citas-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.pc-cita-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
}

.pc-cita-clickable {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: all 0.2s ease;
}

.pc-cita-clickable:hover {
    border-color: var(--pc-primary);
    background: #f0fdf4;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.pc-cita-clickable.no-acude {
    border-left: 4px solid #f59e0b;
    background: #fffbeb;
}

.pc-cita-clickable.no-acude:hover {
    background: #fef3c7;
    border-color: #f59e0b;
}

.pc-cita-info {
    flex: 1;
    min-width: 0;
}

.pc-cita-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.pc-cita-header strong {
    font-size: 14px;
    color: var(--pc-text);
}

.pc-cita-tipo {
    background: var(--pc-primary);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.pc-cita-badge-no-acude {
    background: #f59e0b;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.pc-cita-resumen {
    display: block;
    color: var(--pc-muted);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pc-cita-arrow {
    color: #9ca3af;
    font-size: 20px;
    font-weight: bold;
    flex-shrink: 0;
}

.pc-cita-clickable:hover .pc-cita-arrow {
    color: var(--pc-primary);
}

/* ===== SECCIÓN PRIMERA CONSULTA ===== */
.pc-primera-consulta-section {
    background: linear-gradient(135deg, rgba(171, 71, 188, 0.08) 0%, rgba(171, 71, 188, 0.03) 100%);
    border: 2px solid rgba(171, 71, 188, 0.3);
    border-radius: var(--pc-radius);
    padding: 20px;
    margin: 20px 0;
}

.pc-primera-consulta-section h3 {
    margin: 0 0 8px;
    color: var(--pc-purple);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pc-primera-consulta-section h3::before {
    content: '🩺';
    font-size: 18px;
}

.pc-primera-consulta-section .pc-hint {
    font-size: 13px;
    color: var(--pc-muted);
    margin: 0 0 16px;
    font-style: italic;
}

.pc-primera-consulta-section textarea {
    min-height: 80px;
}

.pc-evol-asistencia-inline {
    display: flex;
    gap: 12px;
}

.pc-asistencia-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    font-weight: 500;
}

.pc-asistencia-label.acude {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: #16a34a;
}

.pc-asistencia-label.acude:has(input:checked) {
    background: rgba(34, 197, 94, 0.2);
    border-color: #22c55e;
}

.pc-asistencia-label.no-acude {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #d97706;
}

.pc-asistencia-label.no-acude:has(input:checked) {
    background: rgba(245, 158, 11, 0.2);
    border-color: #f59e0b;
}

.pc-asistencia-label input[type="radio"] {
    margin: 0;
}
