 .fondo{
      background-image: url('../img/fondos/fondo3.webp');
       background-size: cover;
       background-position: center;
       background-repeat: no-repeat;
       display: block;
       width: 100%;
       height: 100%;
      /*  filter: blur(1px) contrast(40%);
*/

           
    }

/* ===== MODAL CUMPLE ===== */
.cumple-modal {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    background: linear-gradient(135deg, #5fee7e, #97f7e2);
    color: white;
}

/* Lista */
.cumple-list li {
    font-size: 1.2rem;
    margin: 8px 0;
    font-weight: 500;
}

/* ===== Globos ===== */
.balloon {
    position: absolute;
    bottom: -80px;
    width: 50px;
    height: 65px;
    border-radius: 50%;
    opacity: 0.8;
    animation: float 6s ease-in-out infinite;
}

.b1 { left: 10%; background: #fcc648; animation-delay: 0s; }
.b2 { left: 65%; background: #8d94f8; animation-delay: 1.5s; }
.b3 { left: 85%; background: #06d622; animation-delay: 3s; }

.balloon::after {
    content: '';
    position: absolute;
    top: 65px;
    left: 50%;
    width: 2px;
    height: 30px;
    background: rgba(255,255,255,0.7);
}

/* ===== Confeti ===== */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    opacity: 0.8;
    animation: fall 4s linear infinite;
}

.c1 { left: 15%; background: #ffd166; animation-delay: 0s; }
.c2 { left: 35%; background: #ef476f; animation-delay: 1s; }
.c3 { left: 60%; background: #06d6a0; animation-delay: 2s; }
.c4 { left: 80%; background: #118ab2; animation-delay: 3s; }

/* ===== Animaciones ===== */
@keyframes float {
    0%   { transform: translateY(0); }
    50%  { transform: translateY(-120px); }
    100% { transform: translateY(0); }
}

@keyframes fall {
    0%   { top: -10px; transform: rotate(0deg); }
    100% { top: 100%; transform: rotate(360deg); }
}



/* =====  NUEVO DISEÑO ===== */


/* ── Variables ─────────────────────────────── */
:root {
  --sb-bg:        #0f172a;
  --sb-hover:     rgba(255,255,255,0.04);
  --sb-active-bg: rgba(37,99,235,0.15);
  --sb-active-border: #2563eb;
  --sb-active-color:  #93c5fd;
  --sb-text:      #c5cbd4;
  --sb-border:    #1e293b;
  --sb-width:     240px;
  --sb-width-col: 64px;
  --sb-transition: width 0.25s ease;
}

/* ── Sidebar shell ─────────────────────────── */
.colorFondo{
    background: var(--sb-active-bg);
}
#sidebar {
  width: var(--sb-width);
  min-height: 100vh;
  background: var(--sb-bg);
  display: flex;
  flex-direction: column;
  transition: var(--sb-transition);
  overflow: hidden;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  font-family: 'Inter', sans-serif;
}
#sidebar.collapsed {
  width: var(--sb-width-col);
}

/* ── Logo area ─────────────────────────────── */
.sb-logo {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--sb-border);
  min-height: 64px;
  flex-shrink: 0;
}
#sidebar.collapsed .sb-logo {
  padding: 16px 14px;
  justify-content: center;
}
.sb-logo img.logo-full  { display: block; width: 130px; object-fit: contain;
                          filter: brightness(0) invert(1); }
.sb-logo img.logo-icon  { display: none;  width: 34px; height: 34px;
                          object-fit: contain; object-position: left center;
                          filter: brightness(0) invert(1); }
#sidebar.collapsed .sb-logo img.logo-full { display: none; }
#sidebar.collapsed .sb-logo img.logo-icon { display: block; }

/* ── Search / QR ───────────────────────────── */
.sb-search-wrap {
  padding: 10px 14px;
  border-bottom: 1px solid var(--sb-border);
  flex-shrink: 0;
}
.sb-search-wrap .livewire-qr-wrap { width: 100%; }
#sidebar.collapsed .sb-search-wrap { display: none; }

/* ── Nav list ──────────────────────────────── */
.sb-nav {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
}
.sb-nav::-webkit-scrollbar { width: 3px; }
.sb-nav::-webkit-scrollbar-thumb { background: #334155; border-radius: 2px; }

/* ── Nav item ──────────────────────────────── */
.sb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: var(--sb-text);
  text-decoration: none !important;
  font-size: 15px;
  font-weight: 400;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
  cursor: pointer;
  background: none;
  border-top: none;
  border-right: none;
  border-bottom: none;
  width: 100%;
  text-align: left;
  line-height: 1.4;
}
.sb-item:hover {
  background: var(--sb-hover);
  color: #cbd5e1;
  text-decoration: none !important;
}
.sb-item.active, .sb-item.active:hover {
  background: var(--sb-active-bg);
  border-left-color: var(--sb-active-border);
  color: var(--sb-active-color);
  font-weight: 500;
}
.sb-item svg, .sb-item i {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}
.sb-item .sb-label {
  flex: 1;
}
#sidebar.collapsed .sb-item { padding: 10px 0; justify-content: center; }
#sidebar.collapsed .sb-label { display: none; }

/* ── Badge ─────────────────────────────────── */
.sb-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  padding: 0 4px;
  flex-shrink: 0;
}
#sidebar.collapsed .sb-badge { display: none; }

/* ── Divider label ─────────────────────────── */
.sb-section-label {
  padding: 12px 16px 4px;
  font-size: 10px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  white-space: nowrap;
}
#sidebar.collapsed .sb-section-label { display: none; }

/* ── Bottom area ───────────────────────────── */
.sb-bottom {
  border-top: 1px solid var(--sb-border);
  padding: 8px 0;
  flex-shrink: 0;
}

/* ── Toggle button (outside sidebar) ──────── */
#sb-toggle {
  position: fixed;
  top: 14px;
  left: 248px;
  z-index: 200;
  background: var(--sb-bg);
  border: 1px solid var(--sb-border);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: left 0.25s ease;
  color: #64748b;
}
#sb-toggle:hover { color: #94a3b8; background: #1e293b; }
body.sb-collapsed #sb-toggle { left: 72px; }

/* ── Livewire component resets ─────────────── */
/* Los componentes Livewire heredan el estilo .sb-item si los envolvés */
.sb-livewire-wrap > * {
  /* Livewire renderiza sus propios elementos; este wrapper normaliza */
  display: block;
  width: 100%;
}

/* ──────────────────────────────────────────
   Vista protocolo / paciente
────────────────────────────────────────── */
.proto-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 5px;
  font-family: 'Inter', sans-serif;
}

/* ── Franja superior ───────────────────── */
.proto-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(90deg, #14294d 0%, #17345f 100%);
  border-radius: 14px;
  padding: 14px 18px;
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.10);
}

.proto-hero__item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.proto-hero__item--icon {
  flex-direction: row;
  align-items: center;
}

.proto-hero__icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c7d2fe;
}

.proto-hero__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(226, 232, 240, 0.78);
  text-transform: uppercase;
  line-height: 1.1;
}

.proto-hero__value {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.15;
  color: #ffffff;
}
.proto-hero__value_protocolo {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
  color: #ffffff;
}
.proto-hero__value--warning {
  color: #fbbf24;
}

.proto-hero__divider {
  width: 1px;
  height: 30px;
  background: rgba(255,255,255,0.12);
  flex-shrink: 0;
}

.proto-hero__spacer {
  flex: 1;
}

.proto-hero__item--right {
  text-align: right;
}

/* ── Franja superior ───────────────────── */
.proto-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(90deg, #14294d 0%, #17345f 100%);
  border-radius: 14px;
  padding: 14px 18px;
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.10);
}

.proto-hero--extended {
  flex-wrap: nowrap;
}

.proto-hero__item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.proto-hero__item--icon {
  flex-direction: row;
  align-items: center;
}

.proto-hero__item--material {
  min-width: 280px;
  flex: 1 1 320px;
}

.proto-hero__icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c7d2fe;
}

.proto-hero__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(226, 232, 240, 0.78);
  text-transform: uppercase;
  line-height: 1.1;
}


.proto-hero__divider {
  width: 1px;
  height: 32px;
  background: rgba(255,255,255,0.12);
  flex-shrink: 0;
}

.proto-hero__item--right {
  text-align: right;
}

.proto-hero__editable-wrap {
  margin-top: 2px;
}

.proto-hero__input {
  width: 100%;
  min-height: 40px;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px;
  background: rgba(255,255,255,0.10);
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  outline: none;
}

.proto-hero__input::placeholder {
  color: rgba(226, 232, 240, 0.55);
}

.proto-hero__input:focus {
  border-color: rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.14);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.08);
}

/* ── Tarjetas ───────────────────────────── */
.proto-card {
  background: #f8fafc;
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

.proto-card--compact {
  padding: 14px 18px;
}

/* ── Grids ─────────────────────────────── */
.proto-grid {
  display: grid;
  gap: 10px;
}

.proto-grid--protocol-top {
  grid-template-columns: 1.2fr 1fr;
}

.proto-grid--patient-top {
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
}

.proto-grid--patient-mid {
  grid-template-columns: 1fr 1fr 1fr;
}

.proto-grid--2 {
  grid-template-columns: 2fr 1.1fr;
}

.proto-grid--mt {
  margin-top: 12px;
}

/* ── Campos ────────────────────────────── */
.proto-field {
  min-width: 0;
}

.proto-field--span-2 {
  grid-column: span 2;
}

.proto-field__label {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.proto-field__label--empty {
  opacity: 0;
  user-select: none;
}

.proto-field__box {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  background: #eef2f7;
  color: #0f172a;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
}

.proto-field__box--with-meta {
  justify-content: space-between;
}

.proto-field__box--strong {
  font-weight: 700;
  color: #2563eb;
}

.proto-field__box--muted {
  color: #94a3b8;
}

.proto-field__box--placeholder {
  color: #64748b;
}

/* ── Texto interno ─────────────────────── */
.proto-link-wrap {
  min-width: 0;
  text-decoration: none;
}

.proto-link {
  color: #2563eb;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  max-width: 100%;
}

.proto-meta {
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Botón revisado ────────────────────── */
.proto-btn {
  min-height: 32px;
  width: 100%;
  border-radius: 8px;
  border: 1px solid #d5dce5;
  background: #eef2f7;
  color: #64748b;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.proto-btn:hover:not(:disabled) {
  background: #e2e8f0;
}

.proto-btn:disabled {
  opacity: 0.9;
  cursor: default;
}

.proto-btn__dot {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #d1d5db;
  display: inline-block;
}

.proto-btn--soft {
  min-height: 32px;
  width: 100%;
  border-radius: 8px;
  border: 1px solid #d5dce5;
  background: #eef2f7;
  color: #64748b;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.proto-btn--soft:hover:not(:disabled) {
  background: #e2e8f0;
}

.proto-btn--soft:disabled {
  opacity: 0.8;
  cursor: default;
}

.proto-btn--revisado {
  min-height: 32px;
  width: 100%;
  border-radius: 8px;
  border: 1px solid #15803d;
  background: #dcfce7;
  color: #166534;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 10px;
  box-sizing: border-box;
}

.proto-btn__check {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #15803d;
  flex-shrink: 0;
}
.proto-hero__value--sm {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}
.proto-hero__item .proto-hero__value {
  word-break: break-word;
}
/* ── Responsive ────────────────────────── */
@media (max-width: 1200px) {
  .proto-hero {
    flex-wrap: wrap;
  }

  .proto-hero__item--material {
    min-width: 100%;
  }
}

@media (max-width: 992px) {
  .proto-grid--protocol-top,
  .proto-grid--patient-top,
  .proto-grid--patient-mid,
  .proto-grid--2 {
    grid-template-columns: 1fr 1fr;
  }

  .proto-field--span-2 {
    grid-column: span 2;
  }

  .proto-hero__item--right {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .proto-view {
    padding: 10px;
  }

  .proto-card {
    padding: 14px;
  }

  .proto-grid--protocol-top,
  .proto-grid--patient-top,
  .proto-grid--patient-mid,
  .proto-grid--2 {
    grid-template-columns: 1fr;
  }

  .proto-field--span-2 {
    grid-column: span 1;
  }

  .proto-field__box--with-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .proto-hero__value {
    font-size: 18px;
  }

  .proto-hero__input {
    font-size: 16px;
  }
}

/* ─────────────────────────────
   Panel grande estudios previos
───────────────────────────── */
.proto-history-panel {
  max-height: 260px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  background: #f8fafc;
}

.proto-history-row {
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
}

.proto-history-row + .proto-history-row {
  margin-top: 8px;
}

.proto-history-row__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.proto-history-row__left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.proto-history-row__code {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #dbeafe;
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none !important;
}

.proto-history-row__code:hover {
  background: #bfdbfe;
  color: #1d4ed8;
}

.proto-history-row__more_text {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  white-space: pre-line;
  word-break: break-word;
}

.proto-history-row__diagnosis {
  margin-top: 8px;
}

.proto-history-row__preview {
  color: #475569;
  font-size: 13px;
  line-height: 1.5;
}

.proto-history-row__toggle {
  display: inline-flex;
  align-items: center;
  margin-top: 6px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none !important;
}

.proto-history-row__toggle:hover {
  color: #1d4ed8;
}



.proto-history-row__toggle--less {
  margin-top: 8px;
}

.proto-history-panel__separator {
  margin: 14px 2px 10px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.proto-history-row--legacy {
  background: #f8fafc;
  border-style: dashed;
}

.proto-history-row__legacy {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: #64748b;
  font-size: 12px;
}

.proto-history-row__legacy-code {
  font-weight: 700;
  color: #475569;
}

.proto-empty-list {
  color: #94a3b8;
  font-size: 13px;
  padding: 8px 4px;
}

/* ─────────────────────────────
   Tabs lineales estilo liviano
───────────────────────────── */

.proto-tabs-line {
  border-bottom: 1px solid #dbe3ee;
  margin-top: 8px;
  margin-bottom: 14px;
}

.proto-tabs-line__list {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.proto-tabs-line__item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  position: relative;

  padding: 10px 14px 11px;
  margin-bottom: -1px;

  color: #64748b;
  text-decoration: none !important;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;

  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}

.proto-tabs-line__item:hover {
  color: #334155;
  text-decoration: none !important;
  background: rgba(148, 163, 184, 0.06);
}

.proto-tabs-line__item.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
  font-weight: 600;
}

.proto-tabs-line__item.disabled {
  color: #94a3b8;
  opacity: .55;
  cursor: not-allowed;
  pointer-events: none;
}

.proto-tabs-line__icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: .9;
}

.proto-tabs-line__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;

  background: #94a3b8;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.proto-tabs-line__item.active .proto-tabs-line__badge {
  background: #2563eb;
}

@media (max-width: 768px) {
  .proto-tabs-line__list {
    gap: 2px;
  }

  .proto-tabs-line__item {
    padding: 9px 10px 10px;
    font-size: 13px;
  }

  .proto-tabs-line__icon {
    width: 14px;
    height: 14px;
  }
}

/* ═══════════════════════════════════════════
     _estudiosPrevios.blade.php
     ═══════════════════════════════════════════ */


.ep-panel {
    background: #fff;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    overflow: hidden;
}
.ep-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border, #e2e8f0);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.ep-count {
    background: #f1f5f9;
    color: var(--text-muted, #64748b);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
}
.ep-list {
    max-height: 260px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
.ep-list::-webkit-scrollbar { width: 3px; }
.ep-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }

.ep-item {
    padding: 9px 14px;
    border-bottom: 1px solid #f1f5f9;
    transition: background .1s;
}
.ep-item:last-child { border-bottom: none; }
.ep-item:hover { background: #fafafa; }

.ep-item__top {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}
.ep-item__code {
    font-size: 12px;
    font-weight: 700;
    color: var(--blue, #2563eb);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}
.ep-item__code:hover { text-decoration: underline; }

.ep-item__diag {
    font-size: 12px;
    color: var(--text-muted, #64748b);
    line-height: 1.4;
    flex: 1;
    min-width: 0;
    /* Trunca en 2 líneas */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ep-toggle {
    font-size: 11px;
    font-weight: 600;
    color: var(--blue, #2563eb);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-top: 2px;
    display: block;
    text-decoration: none;
}
.ep-toggle:hover { text-decoration: underline; }

.ep-more {
    font-size: 12px;
    color: var(--text-muted, #64748b);
    line-height: 1.4;
    padding-top: 4px;
}

/* Sistema anterior */
.ep-separator {
    padding: 6px 14px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    background: #f8fafc;
    border-top: 1px solid var(--border, #e2e8f0);
    border-bottom: 1px solid var(--border, #e2e8f0);
}
.ep-item--legacy { opacity: 0.65; }
.ep-item--legacy .ep-item__top {
    font-size: 12px;
    color: var(--text-muted, #64748b);
    gap: 6px;
}
.ep-item--legacy span { white-space: nowrap; }
.ep-item--legacy span + span::before {
    content: "·";
    margin-right: 6px;
    color: #cbd5e1;
}

.ep-empty {
    padding: 28px 16px;
    text-align: center;
    font-size: 13px;
    color: #94a3b8;
}
