:root {
  --navy-dark: #0b2c4d;
  --navy: #0e3a63;
  --navy-light: #14497d;
  --blue-accent: #1e6fd9;
  --green-accent: #2e9e6c;
  --orange-accent: #e08a2e;
  --teal-accent: #2a9d9d;
  --text-muted: #6b7280;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background-color: #f4f6f9;
  color: #1f2a37;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--navy-dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 24px 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px 24px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.brand-title {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  display: block;
}

.brand-subtitle {
  font-size: 11px;
  letter-spacing: 0.5px;
  color: #b9c6d8;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  margin: 0 12px 16px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

.user-icon {
  font-size: 28px;
  color: #b9c6d8;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 600;
  font-size: 14px;
}

.user-role {
  font-size: 12px;
  color: #b9c6d8;
}

.user-cerrar-sesion {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-size: 11px;
  color: #b9c6d8;
  text-decoration: none;
}

.user-cerrar-sesion:hover {
  color: #fff;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0 12px;
}

.nav-section-title {
  font-size: 11px;
  letter-spacing: 0.5px;
  color: #8198b3;
  margin: 16px 8px 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  color: #dbe5f1;
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 2px;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-link.active {
  background: var(--blue-accent);
  color: #fff;
  font-weight: 600;
}

.sidebar-bottom {
  margin: 12px 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 8px;
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  color: #dbe5f1;
  text-decoration: none;
  font-size: 14px;
  border-radius: 6px;
}

.sidebar-logout:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-volver {
  color: #b9c6d8;
}

/* Main content */
.main-content {
  flex: 1;
  padding: 28px 40px;
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e2e6eb;
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.content-header h1 {
  font-size: 20px;
  color: var(--navy);
  margin: 0;
}

.content-date {
  color: var(--text-muted);
  font-size: 14px;
}

.welcome-banner {
  background: linear-gradient(120deg, var(--navy-dark), var(--navy-light));
  color: #fff;
  border-radius: 10px;
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.welcome-banner h2 {
  font-size: 18px;
  margin: 0 0 6px;
}

.welcome-banner p {
  margin: 0;
  font-size: 14px;
  color: #cdd9e8;
}

.welcome-clock {
  background: rgba(255, 255, 255, 0.12);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  white-space: nowrap;
}

.section-title {
  font-size: 12px;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.modules-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

@media (max-width: 1100px) {
  .modules-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .modules-grid {
    grid-template-columns: 1fr;
  }
}

.module-card {
  background: #fff;
  border-radius: 10px;
  padding: 22px;
  text-decoration: none;
  color: #1f2a37;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  border: 1px solid #eef1f5;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.module-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.module-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  font-size: 20px;
  margin-bottom: 14px;
}

.module-card--blue .module-icon {
  background: rgba(30, 111, 217, 0.12);
  color: var(--blue-accent);
}

.module-card--green .module-icon {
  background: rgba(46, 158, 108, 0.12);
  color: var(--green-accent);
}

.module-card--orange .module-icon {
  background: rgba(224, 138, 46, 0.12);
  color: var(--orange-accent);
}

.module-card--teal .module-icon {
  background: rgba(42, 157, 157, 0.12);
  color: var(--teal-accent);
}

.module-card h4 {
  font-size: 15px;
  margin: 0 0 8px;
  color: var(--navy);
}

.module-card p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

.content-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid #e2e6eb;
  font-size: 12px;
  color: var(--text-muted);
}

.footer-logo {
  height: 36px;
  object-fit: contain;
}

/* Buscador */
.buscador-form {
  margin-bottom: 20px;
}

.buscador-wrapper {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #d6dce3;
  border-radius: 10px;
  padding: 0 14px;
  max-width: 480px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

.buscador-icon {
  color: var(--text-muted);
  font-size: 15px;
  flex-shrink: 0;
}

.buscador-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 12px 10px;
  font-size: 14px;
  background: transparent;
}

.buscador-clear {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  padding: 4px;
}

.buscador-clear:hover {
  color: #1f2a37;
}

/* Celda email */
.celda-email {
  white-space: nowrap;
}

.email-texto {
  font-size: 13px;
  margin-right: 6px;
}

.email-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(30, 111, 217, 0.1);
  color: var(--blue-accent);
  text-decoration: none;
  font-size: 13px;
  vertical-align: middle;
}

.email-btn:hover {
  background: var(--blue-accent);
  color: #fff;
}

.btn-eliminar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
  border: none;
  cursor: pointer;
  font-size: 13px;
}

.btn-eliminar:hover {
  background: #dc3545;
  color: #fff;
}

/* Modal visor downloads */
.visor-download-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid #e2e6eb;
  text-decoration: none;
  color: #1f2a37;
  margin-bottom: 8px;
  font-size: 14px;
  transition: background .15s;
}

.visor-download-btn:hover {
  background: #f0f4ff;
  border-color: var(--blue-accent);
  color: var(--blue-accent);
}

.visor-download-btn .bi-file-pdf-fill {
  color: #dc3545;
  font-size: 20px;
  flex-shrink: 0;
}

.visor-download-btn .bi-file-zip-fill {
  color: #e08a2e;
  font-size: 20px;
  flex-shrink: 0;
}

/* Toast de feedback */
.toast-wrapper {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast-msg {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .3s, transform .3s;
}

.toast-msg--visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-msg--success { background: #198754; }
.toast-msg--danger  { background: #dc3545; }

.btn-eliminar-confirmar {
  background: #dc3545;
  color: #fff;
  border: none;
}

/* Tabla pacientes */
.pacientes-tabla {
  background: #fff;
  border-radius: 10px;
  border: 1px solid #eef1f5;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  overflow: hidden;
}

.tabla {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.tabla thead {
  background: var(--navy-dark);
  color: #fff;
}

.tabla th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
}

.tabla td {
  padding: 12px 16px;
  border-bottom: 1px solid #eef1f5;
  color: #1f2a37;
}

.tabla tbody tr:last-child td {
  border-bottom: none;
}

.tabla tbody tr:hover {
  background: #f8fafc;
}

.tabla-btn {
  padding: 6px 14px;
  font-size: 13px;
  text-decoration: none;
}

.volver-wrapper {
  margin-top: 32px;
  margin-bottom: 8px;
}

.volver-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
}

.volver-link:hover {
  color: var(--navy);
}

/* Carga de datos paciente */
.upload-card {
  background: #fff;
  border-radius: 10px;
  padding: 28px;
  border: 1px solid #eef1f5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  max-width: 480px;
}

.upload-field {
  margin-bottom: 18px;
}

.upload-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #1f2a37;
  margin-bottom: 6px;
}

.upload-input {
  width: 100%;
  border: 1px solid #d6dce3;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
}

.upload-input--uppercase {
  text-transform: uppercase;
}

.upload-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}

.upload-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
}

.upload-button--primary {
  background: var(--blue-accent);
  color: #fff;
}

.upload-button--primary:hover {
  background: var(--navy-light);
}

.upload-button--outline {
  background: transparent;
  border: 1px solid var(--blue-accent);
  color: var(--blue-accent);
}

.upload-button--outline:hover {
  background: rgba(30, 111, 217, 0.08);
}

.upload-button--icon {
  background: var(--navy-dark);
  color: #fff;
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  flex-shrink: 0;
}

.upload-button--icon:hover {
  background: var(--navy-light);
}

.upload-input-group {
  display: flex;
}

.upload-input-group .upload-input {
  border-radius: 8px 0 0 8px;
  flex: 1;
}

/* Modal enviar */
.envio-opcion {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid #e2e6eb;
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
}

.envio-opcion:has(input:checked) {
  border-color: var(--blue-accent);
  background: rgba(30, 111, 217, 0.05);
}

.envio-opcion label {
  display: flex;
  flex-direction: column;
  margin: 0;
  cursor: pointer;
}

.envio-nombre {
  font-weight: 600;
  font-size: 14px;
}

.envio-email {
  font-size: 12px;
  color: var(--text-muted);
}

/* Login */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy-dark), var(--navy-light));
}

.login-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: #fff;
  border-radius: 12px;
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.login-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin-bottom: 16px;
}

.login-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: 4px 0 28px;
  letter-spacing: 0.5px;
}

.login-form {
  text-align: left;
}

.login-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #1f2a37;
  margin-bottom: 6px;
}

.login-input {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #d6dce3;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 18px;
}

.login-input i {
  color: var(--text-muted);
}

.login-input input {
  border: none;
  outline: none;
  flex: 1;
  font-size: 14px;
}

.login-button {
  width: 100%;
  background: var(--blue-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
}

.login-button:hover {
  background: var(--navy-light);
}

.login-forgot {
  display: block;
  margin-top: 18px;
  font-size: 13px;
  color: var(--blue-accent);
  text-decoration: none;
}

.login-forgot:hover {
  text-decoration: underline;
}

/* Landing (public index) */
.landing-body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, var(--navy-dark), var(--navy-light));
  color: #fff;
}

.landing-body .modal-content {
  color: #1f2a37;
}

.landing-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 40px;
}

.landing-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.landing-brand {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.5px;
  flex: 1;
}

.landing-login-btn {
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  padding: 8px 18px;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.landing-login-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.landing-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
}

.landing-hero h1 {
  font-size: 36px;
  font-weight: 700;
  margin: 0 0 12px;
}

.landing-hero p {
  font-size: 16px;
  color: #cdd9e8;
  max-width: 480px;
  margin: 0 0 28px;
}

.landing-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--blue-accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 26px;
  border-radius: 8px;
}

.landing-cta:hover {
  background: #fff;
  color: var(--navy);
}

button.landing-cta {
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.landing-cta-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.landing-cta--red {
  background: #dc3545;
  color: #fff;
}

.landing-cta--red:hover {
  background: #b02a37;
  color: #fff;
}

.landing-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 40px;
  font-size: 12px;
  color: #b9c6d8;
}
