:root {
    --green: #63b32e;
    --green-dark: #3e7e1e;
    --bg: #f4f6f8;
    --white: #ffffff;
    --text: #1f2937;
  }
  
  * {
    box-sizing: border-box;
    font-family: system-ui, sans-serif;
  }
  
  body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
  }
  
  /* HEADER */
  .app-header {
    background: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,.08);
  }
  
  .logo {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  .logo img {
    height: 40px;
  }
  
  nav a {
    margin-left: 20px;
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
  }
  
  /* FOOTER */
  .app-footer {
    text-align: center;
    padding: 20px;
    font-size: 13px;
    color: #666;
  }

  /* LOGIN */
  /* Ocultar header y footer en página de login */
  body.page-template-page-login .app-header,
  body.page-template-page-login .app-footer,
  body.page-template-login .app-header,
  body.page-template-login .app-footer {
    display: none;
  }

  body.page-template-page-login,
  body.page-template-login {
    background: transparent;
  }
    
  /* DASHBOARD LAYOUT */
  body.page-template-page-dashboard {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  .dashboard-layout {
    display: flex;
    flex: 1;
    background: #f8fafc;
  }

  /* Dashboard Header */
  .dashboard-header {
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 50%, #f8fafc 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(99, 179, 46, 0.1);
    overflow: hidden;
  }

  .dashboard-header-decorative {
    position: relative;
    padding: 20px 32px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .header-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
      radial-gradient(circle at 20% 50%, rgba(99, 179, 46, 0.08) 0%, transparent 50%),
      radial-gradient(circle at 80% 80%, rgba(99, 179, 46, 0.06) 0%, transparent 50%),
      radial-gradient(circle at 40% 20%, rgba(99, 179, 46, 0.04) 0%, transparent 50%);
    pointer-events: none;
  }

  .header-content-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
  }

  .dashboard-logo-small {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: #ffffff;
    border: 3px solid var(--green);
    border-radius: 20px;
    padding: 12px;
    box-shadow: 0 4px 20px rgba(99, 179, 46, 0.25), 0 0 0 8px rgba(99, 179, 46, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
  }

  .dashboard-logo-small::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 179, 46, 0.1) 0%, transparent 70%);
    animation: shimmer 3s infinite;
  }

  @keyframes shimmer {
    0% {
      transform: rotate(0deg);
    }
    100% {
      transform: rotate(360deg);
    }
  }

  .dashboard-logo-small:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 24px rgba(99, 179, 46, 0.35), 0 0 0 10px rgba(99, 179, 46, 0.15);
    border-color: var(--green-dark);
  }

  .dashboard-logo-small img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: relative;
    z-index: 1;
    display: block;
  }

  .logo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
  }

  .logo-placeholder svg {
    width: 40px;
    height: 40px;
    color: var(--green);
  }

  .header-decoration {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 0;
  }

  .decoration-circle {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(99, 179, 46, 0.15) 0%, rgba(99, 179, 46, 0.05) 100%);
    animation: float 6s ease-in-out infinite;
  }

  .decoration-circle.circle-1 {
    width: 120px;
    height: 120px;
    top: -40px;
    left: 10%;
    animation-delay: 0s;
  }

  .decoration-circle.circle-2 {
    width: 80px;
    height: 80px;
    top: -20px;
    right: 15%;
    animation-delay: 2s;
  }

  .decoration-circle.circle-3 {
    width: 60px;
    height: 60px;
    bottom: -20px;
    left: 50%;
    animation-delay: 4s;
  }

  @keyframes float {
    0%, 100% {
      transform: translateY(0) scale(1);
      opacity: 0.6;
    }
    50% {
      transform: translateY(-20px) scale(1.1);
      opacity: 0.8;
    }
  }

  /* Dashboard Sidebar */
  .dashboard-sidebar {
    width: 280px;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    padding: 24px 0;
    flex-shrink: 0;
    height: calc(100vh - 70px);
    overflow-y: auto;
  }

  .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 16px;
  }

  .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #475569;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
  }

  .nav-item:hover {
    background: #e2e8f0;
    color: var(--green);
  }

  .nav-item.active {
    background: rgba(99, 179, 46, 0.1);
    color: var(--green);
    font-weight: 600;
  }

  .nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--green);
    border-radius: 0 2px 2px 0;
  }

  .nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }

  .nav-item-logout {
    margin-top: auto;
    color: #dc2626;
  }

  .nav-item-logout:hover {
    background: #fee2e2;
    color: #dc2626;
  }

  .nav-item-logout .nav-icon {
    color: #dc2626;
  }

  /* Dashboard Main Content */
  .dashboard-main {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    height: calc(100vh - 70px);
  }

  /* Estilos para páginas de formularios (Adopciones, Abandono, Donaciones) */
  .acta-visual {
    position: relative;
    padding: 28px;
    border-radius: 28px;
    overflow: hidden;
    background:
      radial-gradient(1200px 600px at 10% -20%, rgba(22, 163, 74, 0.25), transparent 60%),
      radial-gradient(900px 520px at 110% 0%, rgba(34, 197, 94, 0.18), transparent 55%),
      radial-gradient(700px 520px at 50% 120%, rgba(15, 23, 42, 0.08), transparent 55%),
      linear-gradient(135deg, #ffffff 0%, #f8fafc 35%, #ffffff 100%);
    border: 1px solid rgba(226, 232, 240, 0.85);
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
  }

  .acta-visual::before,
  .acta-visual::after {
    content: '';
    position: absolute;
    inset: -120px;
    background: conic-gradient(from 180deg, rgba(22, 163, 74, 0.12), rgba(34, 197, 94, 0.06), rgba(22, 163, 74, 0.12));
    filter: blur(30px);
    opacity: 0.75;
    pointer-events: none;
    transform: rotate(-8deg);
  }

  .acta-visual::after {
    inset: -160px;
    opacity: 0.45;
    transform: rotate(12deg);
  }

  .acta-visual > * {
    position: relative;
    z-index: 1;
  }

  .acta-visual .form-page-header {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 22px;
  }

  .acta-visual .form-page-title {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.03em;
    -webkit-text-fill-color: initial;
    background: none;
    color: #0f172a;
  }

  .acta-visual--abandono .form-page-title {
    background: linear-gradient(135deg, #dc2626 0%, #f97316 65%, #16a34a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .acta-visual--donaciones .form-page-title {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 40%, #0ea5e9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .acta-visual .form-page-description {
    font-size: 15px;
    color: #475569;
    max-width: 72ch;
  }

  .acta-visual .form-container {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(226, 232, 240, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 16px 50px rgba(15, 23, 42, 0.14);
  }

  .form-page-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid #e2e8f0;
  }

  .form-page-title {
    font-size: 32px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 12px 0;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .form-page-description {
    font-size: 16px;
    color: #64748b;
    margin: 0;
    line-height: 1.6;
  }

  .form-container {
    background: var(--white);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
  }

  .form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--green) 0%, var(--green-dark) 100%);
  }

  /* Aplicar estilos de eventos a formularios de páginas */
  .form-container .acf-form {
    margin: 0;
  }

  .form-container .acf-fields {
    border: none;
    background: transparent;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
  }

  /* Campos individuales en formularios de páginas */
  .form-container .acf-fields > .acf-field {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    border: 2px solid #f1f5f9;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
  }

  .form-container .acf-fields > .acf-field::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--green);
    transform: scaleY(0);
    transition: transform 0.3s ease;
  }

  .form-container .acf-fields > .acf-field:focus-within {
    border-color: var(--green);
    box-shadow: 0 4px 12px rgba(99, 179, 46, 0.15);
    transform: translateY(-2px);
  }

  .form-container .acf-fields > .acf-field:focus-within::before {
    transform: scaleY(1);
  }

  /* Campos de relación en formularios de páginas */
  .form-container .acf-fields > .acf-field[data-type="relationship"],
  .form-container .acf-fields > .acf-field[data-name="dueno_adoptante"],
  .form-container .acf-fields > .acf-field[data-name="mascota"],
  .form-container .acf-fields > .acf-field[data-name="persona_que_entrega"],
  .form-container .acf-fields > .acf-field[data-name="donante"] {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
    border: 2px solid rgba(99, 179, 46, 0.2);
    padding: 24px;
  }

  .form-container .acf-fields > .acf-field[data-type="relationship"]:focus-within,
  .form-container .acf-fields > .acf-field[data-name="dueno_adoptante"]:focus-within,
  .form-container .acf-fields > .acf-field[data-name="mascota"]:focus-within,
  .form-container .acf-fields > .acf-field[data-name="persona_que_entrega"]:focus-within,
  .form-container .acf-fields > .acf-field[data-name="donante"]:focus-within {
    border-color: var(--green);
    box-shadow: 0 8px 24px rgba(99, 179, 46, 0.2);
  }

  /* Grupos de campos en formularios de páginas */
  .form-container .acf-fields > .acf-field.acf-field-group {
    grid-column: 1 / -1;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    margin-bottom: 0;
  }

  .form-container .acf-fields > .acf-field.acf-field-group > .acf-label {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 3px solid var(--green);
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .form-container .acf-fields > .acf-field.acf-field-group > .acf-label::before {
    content: '';
    width: 6px;
    height: 24px;
    background: var(--green);
    border-radius: 3px;
  }

  /* Labels en formularios de páginas */
  .form-container .acf-label {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.01em;
  }

  .form-container .acf-label label {
    font-weight: 600;
  }

  .form-container .acf-label .acf-required {
    color: #ef4444;
    margin-left: 4px;
  }

  /* Inputs en formularios de páginas */
  .form-container .acf-input input[type="text"],
  .form-container .acf-input input[type="number"],
  .form-container .acf-input input[type="email"],
  .form-container .acf-input input[type="date"],
  .form-container .acf-input input[type="url"],
  .form-container .acf-input select,
  .form-container .acf-input textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    background: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #1e293b;
    font-family: inherit;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  }

  .form-container .acf-input input[type="text"]:focus,
  .form-container .acf-input input[type="number"]:focus,
  .form-container .acf-input input[type="email"]:focus,
  .form-container .acf-input input[type="date"]:focus,
  .form-container .acf-input select:focus,
  .form-container .acf-input textarea:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 4px rgba(99, 179, 46, 0.1), 0 4px 12px rgba(99, 179, 46, 0.15);
    transform: translateY(-1px);
  }

  .form-container .acf-input textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
  }

  /* Botón de submit en formularios de páginas */
  .form-container .acf-form-submit {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 2px solid #e2e8f0;
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
  }

  .form-container .acf-form-submit input[type="submit"] {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 16px 40px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(99, 179, 46, 0.3);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
  }

  .form-container .acf-form-submit input[type="submit"]::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
  }

  .form-container .acf-form-submit input[type="submit"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(99, 179, 46, 0.4);
  }

  .form-container .acf-form-submit input[type="submit"]:hover::before {
    width: 300px;
    height: 300px;
  }

  .form-container .acf-form-submit input[type="submit"]:active {
    transform: translateY(-1px);
  }

  /* Aplicar estilos de imagen de eventos a formularios de páginas */
  .form-container .acf-image-uploader {
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
  }

  .form-container .acf-image-uploader .acf-button {
    padding: 10px 18px !important;
    font-size: 14px !important;
  }

  .form-container .acf-image-uploader .acf-message,
  .form-container .acf-image-uploader p {
    color: #94a3b8 !important;
    font-size: 14px !important;
    margin: 0 0 12px 0 !important;
  }

  /* Responsive para formularios de páginas */
  @media (max-width: 768px) {
    .form-container {
      padding: 24px 20px;
    }

    .form-page-title {
      font-size: 24px;
    }

    .form-page-description {
      font-size: 14px;
    }

    .form-container .acf-fields {
      grid-template-columns: 1fr;
      gap: 20px;
    }

    .form-container .acf-form-submit {
      justify-content: stretch;
    }

    .form-container .acf-form-submit input[type="submit"] {
      width: 100%;
    }
  }

  .dashboard-content {
    max-width: 1200px;
    margin: 0 auto;
  }

  .dashboard-title {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 32px;
  }

  /* Quick Actions Grid */
  .quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
  }

  .quick-action-card {
    background: var(--white);
    padding: 32px;
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .quick-action-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    border-color: var(--green);
  }

  .card-icon {
    width: 56px;
    height: 56px;
    background: rgba(99, 179, 46, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green);
    flex-shrink: 0;
  }

  .card-icon svg {
    width: 28px;
    height: 28px;
  }

  .quick-action-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
  }

  .quick-action-card p {
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
    margin: 0;
  }

  /* Dashboard Footer */
  .dashboard-footer {
    background: var(--white);
    border-top: 1px solid #e2e8f0;
    padding: 16px 32px;
    text-align: center;
    font-size: 13px;
    color: #94a3b8;
    margin-top: 0;
  }

  /* Ocultar header y footer normales en dashboard y crear historia */
  body.page-template-page-dashboard .app-header,
  body.page-template-page-dashboard .app-footer,
  body.page-template-page-crear-historia-clinica .app-header,
  body.page-template-page-crear-historia-clinica .app-footer {
    display: none;
  }

  body.page-template-page-crear-historia-clinica {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  /* Responsive Dashboard */
  @media (max-width: 1024px) {
    .dashboard-sidebar {
      width: 240px;
    }

    .quick-actions-grid {
      grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
      gap: 20px;
    }
  }

  @media (max-width: 768px) {
    .dashboard-layout {
      flex-direction: column;
    }

    .dashboard-sidebar {
      width: 100%;
      border-right: none;
      border-bottom: 1px solid #e2e8f0;
      padding: 16px 0;
      height: auto;
    }

    .sidebar-nav {
      flex-direction: row;
      overflow-x: auto;
      padding: 0 16px;
      gap: 8px;
    }

    .nav-item {
      white-space: nowrap;
      min-width: fit-content;
    }

    .nav-item span {
      display: none;
    }

    .dashboard-main {
      padding: 24px 16px;
      height: auto;
    }

    .quick-actions-grid {
      grid-template-columns: 1fr;
    }

    .dashboard-header-decorative {
      padding: 16px 20px;
      min-height: 70px;
    }

    .dashboard-logo-small {
      width: 70px;
      height: 70px;
      padding: 10px;
      border-width: 2px;
      box-shadow: 0 3px 15px rgba(99, 179, 46, 0.2), 0 0 0 6px rgba(99, 179, 46, 0.08);
    }

    .decoration-circle {
      display: none;
    }
  }

  /* ESTILOS PARA FORMULARIO DE HISTORIA CLÍNICA */
  .historia-form-container {
    background: var(--white);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
    border: 1px solid #e2e8f0;
  }

  .historia-clinica-form {
    display: flex;
    flex-direction: column;
    gap: 32px;
  }

  /* Secciones del formulario */
  .form-section {
    background: #f8fafc;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e2e8f0;
  }

  .section-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--green);
  }

  .section-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
  }

  /* Grid de campos */
  .form-fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
  }

  /* Campos individuales */
  .form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .form-field label {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    display: block;
  }

  .form-field .required {
    color: #dc2626;
    margin-left: 2px;
  }

  .form-field input[type="text"],
  .form-field input[type="email"],
  .form-field input[type="tel"],
  .form-field input[type="number"],
  .form-field select {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #ffffff;
    color: #0f172a;
    transition: all 0.2s ease;
    box-sizing: border-box;
  }

  .form-field input:focus,
  .form-field select:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(99, 179, 46, 0.1);
  }

  .form-field .field-hint {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
  }

  /* Input de peso con unidad */
  .peso-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .peso-input-wrapper input {
    flex: 1;
  }

  .peso-unit {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    padding: 0 8px;
  }

/* Formularios de eventos rápidos (consulta, cirugía, etc.) */
.evento-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.evento-form-grid .form-field.full {
  grid-column: 1 / -1;
}

.evento-form .form-field label {
  font-weight: 600;
  color: #0f172a;
  font-size: 14px;
}

.evento-form .form-field textarea,
.evento-form .form-field input,
.evento-form .form-field select {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  font-size: 14px;
  width: 100%;
  transition: all 0.2s ease;
}

.evento-form .form-field textarea:focus,
.evento-form .form-field input:focus,
.evento-form .form-field select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(99, 179, 46, 0.12);
}

.evento-form-footer {
  border-top: 1px solid #e2e8f0;
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.evento-form-meta {
  font-size: 13px;
  color: #64748b;
}

.evento-form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.consulta-farmacia-block {
  margin-top: 24px;
  padding: 20px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-radius: 14px;
  border: 1px solid #bae6fd;
}
.consulta-farmacia-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
}
.consulta-farmacia-title {
  font-weight: 700;
  color: #0369a1;
  font-size: 1rem;
}
.consulta-farmacia-toggle {
  padding: 8px 16px;
  background: #0ea5e9;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}
.consulta-farmacia-toggle:hover {
  background: #0284c7;
}
.consulta-farmacia-body {
  margin-top: 16px;
}
.consulta-farmacia-desc {
  font-size: 14px;
  color: #0c4a6e;
  margin-bottom: 12px;
}
.consulta-farmacia-body .form-field {
  margin-bottom: 12px;
}
.consulta-farmacia-body .btn-primary {
  margin-top: 8px;
}

/* Checklist */
.checklist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 12px;
  margin-top: 8px;
}

.checklist-horizontal {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: #475569;
}

.check-item input[type="checkbox"] {
  margin-top: 3px;
}

/* Checklist (píldoras grandes) */
.checklist-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.check-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.check-pill input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.check-pill span {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 999px;
  background: linear-gradient(160deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #cbd5e1;
  color: #334155;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.01em;
  transition: all 0.2s ease;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.check-pill span::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 7px;
  border: 2px solid #94a3b8;
  background: #ffffff;
  box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.08);
}

.check-pill:hover span {
  transform: translateY(-1px);
  border-color: var(--green);
  box-shadow: 0 12px 30px rgba(22, 163, 74, 0.12);
}

.check-pill input[type="checkbox"]:checked + span {
  background: linear-gradient(135deg, var(--green) 0%, #15803d 100%);
  border-color: rgba(22, 163, 74, 0.9);
  color: #ffffff;
  box-shadow: 0 14px 34px rgba(22, 163, 74, 0.22);
}

.check-pill input[type="checkbox"]:checked + span::before {
  border-color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.18);
}

.check-pill input[type="checkbox"]:checked + span::after {
  content: "";
  position: absolute;
  left: 22px;
  width: 6px;
  height: 10px;
  border: solid rgba(255, 255, 255, 0.95);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Medicamentos en consulta */
.medicamentos-search {
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.medicamentos-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
  color: #475569;
}

.medicamentos-buscar {
  position: relative;
  margin-bottom: 8px;
}

.medicamentos-buscar-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.medicamentos-buscar-row input {
  flex: 1;
  min-width: 200px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 13px;
}

.btn-catalogo-meds {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #0d9488;
  background: #fff;
  color: #0f766e;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-catalogo-meds:hover {
  background: #ecfdf5;
}

.consulta-total-meds {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  font-size: 14px;
  color: #134e4a;
}

.consulta-total-atencion {
  margin-top: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  font-size: 14px;
  color: #1e3a5f;
}

.medicamentos-tabla .medicamentos-precio-cel,
.medicamentos-tabla .medicamentos-subtotal-cel {
  font-weight: 600;
  color: #15803d;
  white-space: nowrap;
}

/* Consulta: bloque medicamentos más amplio */
.consulta-medicamentos-featured {
  width: 100%;
  max-width: 100%;
}

.consulta-medicamentos-textarea {
  min-height: 140px;
  width: 100%;
  font-size: 14px;
  line-height: 1.45;
  padding: 12px 14px;
  border-radius: 12px;
}

.medicamentos-search-amplio {
  margin-top: 14px;
  padding: 16px 18px 18px;
  border-radius: 14px;
  border: 1px solid #bae6fd;
  background: linear-gradient(180deg, #f0f9ff 0%, #f8fafc 100%);
}

.medicamentos-search-amplio .medicamentos-header {
  font-size: 15px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #e0f2fe;
  border: 1px solid #7dd3fc;
}

.medicamentos-search-amplio .medicamentos-buscar-row input {
  min-height: 48px;
  font-size: 15px;
}

.medicamentos-search-amplio .btn-catalogo-meds {
  min-height: 48px;
  padding: 0 22px;
  font-size: 15px;
  border-width: 2px;
}

.medicamentos-search-amplio .medicamentos-tabla {
  font-size: 13px;
}

.medicamentos-search-amplio .medicamentos-tabla th,
.medicamentos-search-amplio .medicamentos-tabla td {
  padding: 8px 10px;
}

.medicamentos-search-amplio .medicamentos-tabla-wrapper {
  overflow-x: auto;
  margin-top: 12px;
  border-radius: 10px;
  border: 1px solid #d1fae5;
}

.hallazgos-peso-destacado {
  grid-column: 1 / -1;
}

.hallazgos-peso-destacado input {
  max-width: 200px;
  font-weight: 600;
  font-size: 15px;
}

/* Autorización hospitalización */
.autorizacion-hosp-body {
  max-width: 920px;
}

.autorizacion-hosp-intro {
  font-size: 14px;
  color: #334155;
  line-height: 1.5;
}

.autorizacion-hosp-resumen {
  margin: 16px 0;
  padding: 14px 16px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  font-size: 14px;
}

.autoriz-resumen-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.autorizacion-hosp-legal {
  font-size: 12px;
  line-height: 1.45;
  color: #1e293b;
  text-align: justify;
  margin-bottom: 16px;
}

.autorizacion-hosp-legal p {
  margin: 0 0 10px 0;
}

.autorizacion-hosp-firma-block {
  margin-top: 8px;
}

.autorizacion-hosp-canvas-label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 14px;
}

.autoriz-hosp-canvas {
  display: block;
  width: 100%;
  max-width: 720px;
  height: 200px;
  border: 2px dashed #94a3b8;
  border-radius: 12px;
  background: #fff;
  cursor: crosshair;
  touch-action: none;
}

.autorizacion-hosp-canvas-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.autorizacion-hosp-pdf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.autorizacion-hosp-pdf-actions a {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

.medicamentos-resultados {
  position: absolute;
  top: 110%;
  left: 0;
  right: 0;
  z-index: 10;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.15);
  max-height: 220px;
  overflow-y: auto;
  display: none;
}

.medicamentos-resultados-item {
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.medicamentos-resultados-item:hover {
  background: #f1f5f9;
}

.medicamentos-resultados-item span.precio {
  font-weight: 600;
  color: #16a34a;
}

.medicamentos-tabla-wrapper {
  overflow-x: auto;
  margin-top: 8px;
}

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

.medicamentos-tabla th,
.medicamentos-tabla td {
  border-bottom: 1px solid #e5e7eb;
  padding: 6px 8px;
  text-align: left;
}

.medicamentos-tabla th {
  background: #e5f5d9;
  font-weight: 600;
  color: #374151;
}

.medicamentos-tabla input[type="number"] {
  max-width: 90px;
}

.medicamentos-tabla .btn-remove {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 14px;
}

/* Hallazgos clínicos */
.hallazgos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 16px;
  margin-top: 8px;
}

.toggle-group {
  display: inline-flex;
  gap: 6px;
  border-radius: 999px;
  padding: 2px;
  background: #e5e7eb;
}

.toggle-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.15s ease;
}

.toggle-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-option input:checked + span,
.toggle-option input:checked ~ span {
  background: var(--green);
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.5);
}

.toggle-option span {
  padding: 2px 8px;
  border-radius: 999px;
}

/* Hallazgos: botones más grandes y atractivos */
.toggle-group-lg {
  padding: 4px;
  gap: 8px;
  background: linear-gradient(145deg, #e2e8f0 0%, #cbd5e1 100%);
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.8);
}

.toggle-group-lg .toggle-option {
  padding: 10px 18px;
  min-width: 90px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 12px;
  color: #475569;
  letter-spacing: 0.02em;
}

.toggle-group-lg .toggle-option span {
  padding: 6px 12px;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.toggle-group-lg .toggle-option:hover span {
  background: rgba(255,255,255,0.9);
  color: #1e293b;
}

.toggle-group-lg .toggle-option input:checked + span,
.toggle-group-lg .toggle-option input:checked ~ span {
  background: linear-gradient(135deg, var(--green) 0%, #15803d 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.4);
}

.hallazgos-grid .form-field {
  min-width: 0;
}

/* Sección evidencias y zonas de subida */
.evidencia-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
}

.evidencia-section-title {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}

/* Lienzo de firma en evidencias (consulta, cirugía, etc.) — coherente con zonas de subida */
.evidencia-firma-pad-wrap {
  min-height: 0;
}

.evidencia-firma-pad-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 160px;
  padding: 16px 14px;
  background: linear-gradient(160deg, #f8fafc 0%, #f1f5f9 100%);
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.upload-zone-required .evidencia-firma-pad-inner {
  border-color: #94a3b8;
}

.evidencia-firma-pad-inner:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.12);
}

.evidencia-firma-hint {
  display: block;
  font-size: 12px;
  color: #64748b;
  line-height: 1.35;
  margin: 0 0 10px 0;
}

.evidencia-firma-canvas {
  width: 100%;
  max-width: 100%;
  height: auto;
  min-height: 140px;
}

.upload-zones-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.upload-zone-wrap {
  min-height: 160px;
}

.upload-zone {
  display: block;
  height: 100%;
  min-height: 160px;
  cursor: pointer;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.25s ease;
}

.upload-zone .upload-input {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}

.upload-zone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 160px;
  padding: 20px 16px;
  background: linear-gradient(160deg, #f8fafc 0%, #f1f5f9 100%);
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
  color: #64748b;
  text-align: center;
  transition: all 0.25s ease;
}

.upload-zone:hover .upload-zone-inner {
  border-color: var(--green);
  background: linear-gradient(160deg, #f0fdf4 0%, #dcfce7 100%);
  color: var(--green);
  box-shadow: 0 8px 24px rgba(22, 163, 74, 0.12);
}

.upload-zone:focus-within .upload-zone-inner {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.15);
}

.upload-zone.has-file .upload-zone-inner {
  border-style: solid;
  border-color: var(--green);
  background: linear-gradient(160deg, #ecfdf5 0%, #d1fae5 100%);
  color: #065f46;
}

.upload-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  flex-shrink: 0;
  stroke-width: 1.8;
}

.upload-zone .upload-label {
  font-size: 15px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 4px;
  line-height: 1.3;
}

.upload-zone .upload-hint {
  font-size: 12px;
  color: #64748b;
  line-height: 1.35;
}

.upload-zone .upload-filename {
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
  margin-top: 8px;
  word-break: break-all;
  max-height: 2.4em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-zone.has-file .upload-filename {
  display: block;
}

.upload-zone:not(.has-file) .upload-filename {
  display: none;
}

/* Foto mascota (crear/editar historia) */
.pet-photo-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  align-items: stretch;
}

.pet-photo-preview {
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  overflow: hidden;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.pet-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.pet-photo-placeholder {
  color: #94a3b8;
  font-weight: 700;
}

.pet-photo-actions .upload-zone-inner {
  min-height: 160px;
}

@media (max-width: 768px) {
  .pet-photo-grid {
    grid-template-columns: 1fr;
  }
  .pet-photo-preview {
    min-height: 200px;
  }
  .pet-photo-actions .upload-zone-inner {
    min-height: 150px;
  }
}

.upload-zone-required .upload-zone-inner {
  border-color: #94a3b8;
}

.upload-zone-required .upload-zone:hover .upload-zone-inner {
  border-color: var(--green);
}

.cirugia-peso-msg {
  font-size: 14px;
  color: #475569;
  margin-bottom: 10px;
  padding: 8px 12px;
  background: #f1f5f9;
  border-radius: 8px;
  border-left: 3px solid var(--green);
}

@media (max-width: 640px) {
  .upload-zones-grid {
    grid-template-columns: 1fr;
  }
  .upload-zone-wrap {
    min-height: 140px;
  }
  .upload-zone-inner {
    min-height: 140px;
    padding: 16px;
  }
  .toggle-group-lg .toggle-option {
    min-width: 72px;
    padding: 8px 14px;
    font-size: 13px;
  }
}

  /* Botón de guardar */
  .form-submit-wrapper {
    margin-top: 8px;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
  }

  .btn-guardar {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(99, 179, 46, 0.3);
  }

  .btn-guardar:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 179, 46, 0.4);
  }

  .btn-guardar:active {
    transform: translateY(0);
  }

  /* Estilos para campos ACF */
  .acf-fields-wrapper {
    display: flex;
    flex-direction: column;
    gap: 32px;
  }

  /* Secciones de campos agrupados */
  .acf-fields-wrapper .acf-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
  }

  /* Agrupar campos relacionados visualmente */
  .acf-fields-wrapper .acf-field-group,
  .acf-fields-wrapper .acf-field[data-type="group"] {
    background: #f8fafc;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    grid-column: 1 / -1;
  }

  .acf-fields-wrapper .acf-field-group > .acf-label,
  .acf-fields-wrapper .acf-field[data-type="group"] > .acf-label {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--green);
    display: block;
  }

  /* Campos individuales en grid */
  .acf-fields-wrapper .acf-field:not([data-type="group"]) {
    display: flex;
    flex-direction: column;
  }

  /* Campos individuales */
  .acf-field {
    margin-bottom: 20px;
  }

  .acf-label label {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
    display: block;
  }

  .acf-label label .acf-required {
    color: #dc2626;
    margin-left: 4px;
  }

  /* Inputs, selects y textareas */
  .acf-input input[type="text"],
  .acf-input input[type="email"],
  .acf-input input[type="tel"],
  .acf-input input[type="number"],
  .acf-input select,
  .acf-input textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #ffffff;
    color: #0f172a;
    transition: all 0.2s ease;
    box-sizing: border-box;
  }

  .acf-input input[type="text"]:focus,
  .acf-input input[type="email"]:focus,
  .acf-input input[type="tel"]:focus,
  .acf-input input[type="number"]:focus,
  .acf-input select:focus,
  .acf-input textarea:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(99, 179, 46, 0.1);
  }

  .acf-input textarea {
    min-height: 100px;
    resize: vertical;
  }

  /* Radio buttons */
  .acf-radio-list {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
  }

  .acf-radio-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #475569;
  }

  .acf-radio-list input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--green);
    cursor: pointer;
  }

  .acf-radio-list input[type="radio"]:checked + span {
    color: var(--green);
    font-weight: 600;
  }

  /* Botón de submit */
  .acf-form-submit {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid #e2e8f0;
  }

  .acf-form-submit input[type="submit"] {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(99, 179, 46, 0.3);
  }

  .acf-form-submit input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 179, 46, 0.4);
  }

  .acf-form-submit input[type="submit"]:active {
    transform: translateY(0);
  }

  /* Eventos Rápidos */
  .eventos-rapidos {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 2px solid #e2e8f0;
  }

  .eventos-rapidos h2 {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 24px;
  }

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

  .evento-btn {
    background: var(--green);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(99, 179, 46, 0.3);
    position: relative;
    overflow: hidden;
  }

  .evento-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
  }

  .evento-btn:hover::before {
    width: 300px;
    height: 300px;
  }

  .evento-btn svg {
    width: 24px;
    height: 24px;
    position: relative;
    z-index: 1;
  }

  .evento-btn span {
    position: relative;
    z-index: 1;
  }

  .evento-btn:hover {
    background: var(--green-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 179, 46, 0.4);
  }

  .evento-btn:active {
    transform: translateY(0);
  }

  .evento-btn.active {
    background: var(--green-dark);
    box-shadow: 0 6px 20px rgba(99, 179, 46, 0.5);
  }

  .evento-btn-full {
    grid-column: 1 / -1;
  }

  /* Contenedores de formularios de eventos */
  .eventos-formularios {
    margin-top: 32px;
  }

  .evento-form-container {
    background: var(--white);
    border-radius: 20px;
    padding: 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    margin-top: 32px;
    overflow: hidden;
    animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
  }

  .evento-form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--green) 0%, var(--green-dark) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .evento-form-container[aria-hidden="false"]::before {
    opacity: 1;
  }

  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .evento-form-header {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ffffff;
    position: relative;
    overflow: hidden;
  }

  .evento-form-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: shimmer 3s infinite;
  }

  @keyframes shimmer {
    0% {
      transform: rotate(0deg);
    }
    100% {
      transform: rotate(360deg);
    }
  }

  .evento-form-header h3 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    color: #ffffff;
    position: relative;
    z-index: 1;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }

  .cerrar-formulario {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #ffffff;
    padding: 0;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
  }

  .cerrar-formulario:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: rotate(90deg) scale(1.1);
  }

  .cerrar-formulario svg {
    width: 20px;
    height: 20px;
  }

  .cerrar-formulario:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
  }

  .evento-form-content {
    padding: 40px;
    background: linear-gradient(to bottom, #f8fafc 0%, #ffffff 100%);
  }

  /* Estilos para formularios ACF dentro de eventos */
  .evento-form-content .acf-form {
    margin: 0;
  }

  .evento-form-content .acf-fields {
    border: none;
    background: transparent;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
  }

  /* Campos individuales - diseño moderno */
  .evento-form-content .acf-fields > .acf-field {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    border: 2px solid #f1f5f9;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
  }

  .evento-form-content .acf-fields > .acf-field::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--green);
    transform: scaleY(0);
    transition: transform 0.3s ease;
  }

  .evento-form-content .acf-fields > .acf-field:focus-within {
    border-color: var(--green);
    box-shadow: 0 4px 12px rgba(99, 179, 46, 0.15);
    transform: translateY(-2px);
  }

  .evento-form-content .acf-fields > .acf-field:focus-within::before {
    transform: scaleY(1);
  }

  /* Campos de relación (Dueño, Mascota) - diseño especial */
  .evento-form-content .acf-fields > .acf-field[data-type="relationship"],
  .evento-form-content .acf-fields > .acf-field[data-name="dueno"],
  .evento-form-content .acf-fields > .acf-field[data-name="mascota"] {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
    border: 2px solid rgba(99, 179, 46, 0.2);
    padding: 24px;
  }

  .evento-form-content .acf-fields > .acf-field[data-type="relationship"]:focus-within,
  .evento-form-content .acf-fields > .acf-field[data-name="dueno"]:focus-within,
  .evento-form-content .acf-fields > .acf-field[data-name="mascota"]:focus-within {
    border-color: var(--green);
    box-shadow: 0 8px 24px rgba(99, 179, 46, 0.2);
  }

  /* Grupos de campos - diseño expandido */
  .evento-form-content .acf-fields > .acf-field.acf-field-group {
    grid-column: 1 / -1;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    margin-bottom: 0;
  }

  .evento-form-content .acf-fields > .acf-field.acf-field-group > .acf-label {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 3px solid var(--green);
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .evento-form-content .acf-fields > .acf-field.acf-field-group > .acf-label::before {
    content: '';
    width: 6px;
    height: 24px;
    background: var(--green);
    border-radius: 3px;
  }

  /* Campos dentro de grupos */
  .evento-form-content .acf-field-group .acf-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
  }

  .evento-form-content .acf-field-group .acf-field {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 18px;
  }

  /* Labels mejorados */
  .evento-form-content .acf-label {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.01em;
  }

  .evento-form-content .acf-label label {
    font-weight: 600;
  }

  .evento-form-content .acf-label .acf-required {
    color: #ef4444;
    margin-left: 4px;
  }

  /* Inputs, selects y textareas - diseño premium */
  .evento-form-content .acf-input input[type="text"],
  .evento-form-content .acf-input input[type="number"],
  .evento-form-content .acf-input input[type="email"],
  .evento-form-content .acf-input input[type="date"],
  .evento-form-content .acf-input input[type="url"],
  .evento-form-content .acf-input select,
  .evento-form-content .acf-input textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    background: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #1e293b;
    font-family: inherit;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  }

  .evento-form-content .acf-input input[type="text"]:hover,
  .evento-form-content .acf-input input[type="number"]:hover,
  .evento-form-content .acf-input input[type="email"]:hover,
  .evento-form-content .acf-input input[type="date"]:hover,
  .evento-form-content .acf-input select:hover,
  .evento-form-content .acf-input textarea:hover {
    border-color: #cbd5e1;
  }

  .evento-form-content .acf-input input[type="text"]:focus,
  .evento-form-content .acf-input input[type="number"]:focus,
  .evento-form-content .acf-input input[type="email"]:focus,
  .evento-form-content .acf-input input[type="date"]:focus,
  .evento-form-content .acf-input input[type="url"]:focus,
  .evento-form-content .acf-input select:focus,
  .evento-form-content .acf-input textarea:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 4px rgba(99, 179, 46, 0.1), 0 4px 12px rgba(99, 179, 46, 0.15);
    transform: translateY(-1px);
  }

  .evento-form-content .acf-input textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
  }

  /* Campos de relación - diseño especial */
  .evento-form-content .acf-relationship {
    position: relative;
  }

  .evento-form-content .acf-relationship .acf-relationship-search {
    margin-bottom: 16px;
  }

  .evento-form-content .acf-relationship .acf-relationship-search input {
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    background: #ffffff;
    transition: all 0.3s ease;
  }

  .evento-form-content .acf-relationship .acf-relationship-search input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 4px rgba(99, 179, 46, 0.1);
  }

  .evento-form-content .acf-relationship .acf-relationship-list {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
    max-height: 300px;
    overflow-y: auto;
  }

  .evento-form-content .acf-relationship .acf-relationship-item {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    cursor: pointer;
  }

  .evento-form-content .acf-relationship .acf-relationship-item:hover {
    background: rgba(99, 179, 46, 0.1);
    border-color: var(--green);
    transform: translateX(4px);
  }

  /* Campos de imagen - diseño moderno y atractivo */
  .evento-form-content .acf-image-uploader {
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
  }

  .evento-form-content .acf-image-uploader::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 179, 46, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
  }

  .evento-form-content .acf-image-uploader:hover {
    border-color: var(--green);
    background: linear-gradient(135deg, rgba(99, 179, 46, 0.05) 0%, #ffffff 100%);
    box-shadow: 0 8px 24px rgba(99, 179, 46, 0.15);
    transform: translateY(-2px);
  }

  .evento-form-content .acf-image-uploader:hover::before {
    opacity: 1;
  }

  .evento-form-content .acf-image-uploader .acf-button {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(99, 179, 46, 0.3);
    position: relative;
    z-index: 1;
    letter-spacing: 0.2px;
    display: inline-block;
    white-space: nowrap;
    line-height: 1.4;
  }

  .evento-form-content .acf-image-uploader .acf-button:hover {
    background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 179, 46, 0.4);
  }

  .evento-form-content .acf-image-uploader .acf-button:active {
    transform: translateY(0);
  }

  /* Imagen previsualizada */
  .evento-form-content .acf-image-uploader .acf-image-wrap {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
  }

  .evento-form-content .acf-image-uploader .acf-image-wrap:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  }

  /* Texto dentro del área de carga de imágenes - consolidado */
  .evento-form-content .acf-image-uploader .acf-message,
  .evento-form-content .acf-image-uploader p,
  .evento-form-content .acf-field[data-type="image"] .acf-message,
  .evento-form-content .acf-field[data-type="image"] p,
  .evento-form-content .acf-field[data-type="image"] .acf-input p {
    color: #64748b !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    margin: 0 0 12px 0 !important;
    padding: 0 !important;
    line-height: 1.5 !important;
    text-align: center !important;
    display: block !important;
    width: 100% !important;
    position: relative;
    z-index: 2;
  }

  /* Mensaje específico cuando no hay imagen seleccionada */
  .evento-form-content .acf-image-uploader:not(.has-value) .acf-message,
  .evento-form-content .acf-image-uploader:not(.has-value) p,
  .evento-form-content .acf-field[data-type="image"]:not(.has-value) .acf-message,
  .evento-form-content .acf-field[data-type="image"]:not(.has-value) p {
    color: #94a3b8 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    margin: 0 0 12px 0 !important;
    padding: 8px 0 !important;
    line-height: 1.5 !important;
    text-align: center !important;
    display: block !important;
    width: 100% !important;
  }

  /* Contenedor del botón de añadir imagen */
  .evento-form-content .acf-image-uploader .acf-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
  }

  /* Botones dentro del área de imagen */
  .evento-form-content .acf-image-uploader .acf-button-group {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
  }

  /* Botones específicos de ACF para imágenes - tamaño reducido */
  .evento-form-content .acf-image-uploader a.acf-button,
  .evento-form-content .acf-image-uploader button.acf-button,
  .evento-form-content .acf-image-uploader input.acf-button,
  .evento-form-content .acf-image-uploader .acf-button.button,
  .evento-form-content .acf-image-uploader .button,
  .evento-form-content .acf-field[data-type="image"] a.acf-button,
  .evento-form-content .acf-field[data-type="image"] button.acf-button,
  .evento-form-content .acf-field[data-type="image"] .acf-button {
    padding: 10px 18px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    min-height: auto !important;
    height: auto !important;
    line-height: 1.4 !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(99, 179, 46, 0.3) !important;
    margin: 0 4px !important;
    display: inline-block !important;
    white-space: nowrap !important;
  }

  /* Botón "Añadir imagen" específico */
  .evento-form-content .acf-image-uploader .acf-button[data-name="add"],
  .evento-form-content .acf-image-uploader .acf-button.button,
  .evento-form-content .acf-image-uploader a.button {
    padding: 10px 18px !important;
    font-size: 14px !important;
    margin: 0 4px !important;
  }

  /* Asegurar que los botones no se superpongan */
  .evento-form-content .acf-image-uploader .acf-actions > *,
  .evento-form-content .acf-image-uploader .acf-button-group > * {
    margin: 0 4px !important;
  }

  /* Texto dentro de los botones */
  .evento-form-content .acf-image-uploader .acf-button span,
  .evento-form-content .acf-image-uploader .acf-button {
    font-size: 14px !important;
    line-height: 1.4 !important;
  }

  /* Asegurar que el texto y botones estén bien posicionados */
  .evento-form-content .acf-field[data-type="image"] .acf-input {
    width: 100%;
  }

  .evento-form-content .acf-field[data-type="image"] .acf-image-uploader {
    width: 100%;
  }

  /* Estilos adicionales para texto en campos de imagen ACF */
  .evento-form-content .acf-image-uploader .acf-error-message,
  .evento-form-content .acf-image-uploader .acf-notice {
    color: #64748b !important;
    font-size: 14px !important;
    margin: 12px 0 !important;
    text-align: center !important;
  }

  /* Cuando hay imagen seleccionada, ocultar el mensaje de "no hay imagen" */
  .evento-form-content .acf-image-uploader.has-value .acf-message,
  .evento-form-content .acf-image-uploader.has-value p {
    display: none !important;
  }

  /* Mejorar el layout del contenedor de imagen */
  .evento-form-content .acf-image-uploader .acf-image-wrap {
    margin: 0 auto;
    max-width: 100%;
  }

  /* Asegurar que el contenido esté centrado verticalmente */
  .evento-form-content .acf-field[data-type="image"] {
    display: flex;
    flex-direction: column;
  }

  .evento-form-content .acf-field[data-type="image"] .acf-label {
    margin-bottom: 12px;
  }


  /* Radio buttons y checkboxes - diseño premium */
  .evento-form-content .acf-radio-list,
  .evento-form-content .acf-checkbox-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 8px;
  }

  .evento-form-content .acf-radio-list label,
  .evento-form-content .acf-checkbox-list label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    color: #475569;
    position: relative;
    overflow: hidden;
  }

  .evento-form-content .acf-radio-list label::before,
  .evento-form-content .acf-checkbox-list label::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
  }

  .evento-form-content .acf-radio-list label:hover,
  .evento-form-content .acf-checkbox-list label:hover {
    border-color: var(--green);
    background: rgba(99, 179, 46, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 179, 46, 0.15);
  }

  .evento-form-content .acf-radio-list label:hover::before,
  .evento-form-content .acf-checkbox-list label:hover::before {
    left: 100%;
  }

  .evento-form-content .acf-radio-list input[type="radio"]:checked + label,
  .evento-form-content .acf-checkbox-list input[type="checkbox"]:checked + label {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    color: #ffffff;
    border-color: var(--green);
    box-shadow: 0 4px 16px rgba(99, 179, 46, 0.3);
    font-weight: 600;
  }

  .evento-form-content .acf-radio-list input[type="radio"],
  .evento-form-content .acf-checkbox-list input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--green);
    cursor: pointer;
    flex-shrink: 0;
  }

  /* Botón de submit mejorado */
  .evento-form-content .acf-form-submit {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 2px solid #e2e8f0;
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
  }

  .evento-form-content .acf-form-submit input[type="submit"] {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 16px 40px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(99, 179, 46, 0.3);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
  }

  .evento-form-content .acf-form-submit input[type="submit"]::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
  }

  .evento-form-content .acf-form-submit input[type="submit"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(99, 179, 46, 0.4);
  }

  .evento-form-content .acf-form-submit input[type="submit"]:hover::before {
    width: 300px;
    height: 300px;
  }

  .evento-form-content .acf-form-submit input[type="submit"]:active {
    transform: translateY(-1px);
  }

  .acf-no-fields-message {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #fbbf24;
    border-radius: 12px;
    padding: 24px;
    color: #78350f;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.2);
  }

  /* Mejoras visuales adicionales */
  .evento-form-container[aria-hidden="false"] {
    display: block !important;
  }

  .evento-form-container[aria-hidden="true"] {
    display: none !important;
  }

  /* Campos de usuario (Médico) - diseño especial */
  .evento-form-content .acf-field[data-type="user"] {
    grid-column: span 1;
  }

  .evento-form-content .acf-field[data-type="user"] .acf-user {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  /* Campos de fecha mejorados */
  .evento-form-content .acf-field[data-type="date_picker"] input {
    cursor: pointer;
  }

  /* Scrollbar personalizado para áreas de relación */
  .evento-form-content .acf-relationship .acf-relationship-list::-webkit-scrollbar {
    width: 8px;
  }

  .evento-form-content .acf-relationship .acf-relationship-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
  }

  .evento-form-content .acf-relationship .acf-relationship-list::-webkit-scrollbar-thumb {
    background: var(--green);
    border-radius: 4px;
  }

  .evento-form-content .acf-relationship .acf-relationship-list::-webkit-scrollbar-thumb:hover {
    background: var(--green-dark);
  }

  /* Animación de carga para campos */
  @keyframes pulse {
    0%, 100% {
      opacity: 1;
    }
    50% {
      opacity: 0.5;
    }
  }

  .evento-form-content .acf-field.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  }

  /* Mejoras para campos de texto largo */
  .evento-form-content .acf-field[data-type="textarea"] {
    grid-column: 1 / -1;
  }

  .evento-form-content .acf-field[data-type="wysiwyg"] {
    grid-column: 1 / -1;
  }

  /* Responsive para formularios de eventos */
  @media (max-width: 1200px) {
    .evento-form-content .acf-fields {
      grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
      gap: 20px;
    }
  }

  @media (max-width: 768px) {
    .eventos-buttons {
      grid-template-columns: 1fr;
    }

    .evento-form-header {
      padding: 18px 20px;
    }

    .evento-form-header h3 {
      font-size: 18px;
    }

    .evento-form-content {
      padding: 24px 20px;
    }

    .evento-form-content .acf-fields {
      grid-template-columns: 1fr;
      gap: 20px;
    }

    .evento-form-content .acf-fields > .acf-field {
      padding: 18px;
    }

    .evento-form-content .acf-fields > .acf-field.acf-field-group {
      padding: 20px;
    }

    .evento-form-content .acf-field-group .acf-fields {
      grid-template-columns: 1fr;
      gap: 16px;
    }

    .evento-form-content .acf-radio-list,
    .evento-form-content .acf-checkbox-list {
      grid-template-columns: 1fr;
    }

    .evento-form-content .acf-form-submit {
      justify-content: stretch;
    }

    .evento-form-content .acf-form-submit input[type="submit"] {
      width: 100%;
    }
  }

  @media (max-width: 480px) {
    .evento-form-content {
      padding: 20px 16px;
    }

    .evento-form-content .acf-fields > .acf-field {
      padding: 16px;
    }

    .evento-form-content .acf-input input[type="text"],
    .evento-form-content .acf-input input[type="number"],
    .evento-form-content .acf-input input[type="email"],
    .evento-form-content .acf-input input[type="date"],
    .evento-form-content .acf-input select,
    .evento-form-content .acf-input textarea {
      padding: 12px 16px;
      font-size: 14px;
    }
  }

  /* Mensaje cuando no hay campos ACF */
  .acf-no-fields {
    background: #fef3c7;
    border: 2px solid #fbbf24;
    border-radius: 12px;
    padding: 32px;
    margin: 20px 0;
  }

  .acf-instructions h3 {
    color: #92400e;
    margin-bottom: 16px;
    font-size: 20px;
  }

  .acf-instructions p {
    color: #78350f;
    margin-bottom: 12px;
    line-height: 1.6;
  }

  .acf-instructions ol,
  .acf-instructions ul {
    color: #78350f;
    margin: 16px 0;
    padding-left: 24px;
    line-height: 1.8;
  }

  .acf-instructions li {
    margin-bottom: 8px;
  }

  .acf-instructions code {
    background: #fde68a;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
  }

  /* Mejorar visualización de campos ACF */
  .acf-form .acf-fields {
    border: none;
    background: transparent;
  }

  .acf-form .acf-field {
    border: none;
    padding: 0;
  }

  /* Organizar campos en dos columnas cuando sea posible */
  .acf-fields-wrapper .acf-field:not([data-type="group"]):not([data-type="textarea"]):not([data-type="wysiwyg"]) {
    max-width: 100%;
  }

  /* Responsive para formulario */
  @media (max-width: 768px) {
    .historia-form-container {
      padding: 24px 16px;
    }

    .acf-fields-wrapper .acf-field-group,
    .acf-fields-wrapper .acf-field[data-type="group"] {
      padding: 20px 16px;
    }

    .acf-fields-wrapper .acf-fields {
      grid-template-columns: 1fr;
    }

    .eventos-buttons {
      grid-template-columns: 1fr;
    }

    .acf-radio-list {
      flex-direction: column;
      gap: 12px;
    }
  }

  /* ============================================
     ESTILOS PARA BÚSQUEDA DE HISTORIA CLÍNICA
     ============================================ */

  /* Vista de Búsqueda */
  .busqueda-vista {
    animation: fadeIn 0.3s ease;
  }

  @keyframes fadeIn {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .busqueda-header {
    margin-bottom: 32px;
  }

  .busqueda-title {
    font-size: 32px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .busqueda-card {
    background: var(--white);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    margin-bottom: 24px;
  }

  .busqueda-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
  }

  .busqueda-icon {
    position: absolute;
    left: 18px;
    width: 24px;
    height: 24px;
    color: #94a3b8;
    pointer-events: none;
    z-index: 1;
  }

  .busqueda-input {
    width: 100%;
    padding: 16px 18px 16px 56px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    background: #ffffff;
    color: #1e293b;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  }

  .busqueda-input:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 4px rgba(99, 179, 46, 0.1), 0 4px 12px rgba(99, 179, 46, 0.15);
  }

  .busqueda-input::placeholder {
    color: #94a3b8;
  }

  /* Resultados */
  .resultados-card {
    background: var(--white);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
  }

  .resultados-title {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 24px 0;
  }

  .resultados-table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
  }

  .resultados-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
  }

  .resultados-table thead {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  }

  .resultados-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
    background: #ffffff;
    position: relative;
  }

  .resultados-table th.col-checkbox {
    width: 40px;
    text-align: center;
    padding: 12px 8px;
  }

  .resultados-table th.col-numero {
    width: 100px;
  }

  .resultados-table th.col-mascota {
    width: 180px;
  }

  .resultados-table th.col-dueno {
    width: 220px;
  }

  .resultados-table th.col-medico {
    width: 120px;
  }

  .resultados-table th.col-fecha {
    width: 200px;
  }

  .resultados-table th.col-acciones {
    width: 120px;
    text-align: center;
  }

  .resultados-table th.sortable {
    cursor: pointer;
    user-select: none;
    color: #2563eb;
  }

  .resultados-table th.sortable:hover {
    background: #f8fafc;
  }

  .resultados-table th.sortable .sort-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 6px;
    vertical-align: middle;
    opacity: 0.6;
    transition: opacity 0.2s ease;
  }

  .resultados-table th.sortable:hover .sort-icon {
    opacity: 1;
  }

  .resultados-table th.sortable.sort-asc .sort-icon,
  .resultados-table th.sortable.sort-desc .sort-icon {
    opacity: 1;
    color: #2563eb;
  }

  .resultados-table td {
    padding: 12px 16px;
    font-size: 13px;
    color: #1e293b;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
  }

  .resultados-table tbody tr {
    transition: all 0.2s ease;
  }

  .resultados-table tbody tr:nth-child(even) {
    background: #f8fafc;
  }

  .resultados-table tbody tr:nth-child(odd) {
    background: #ffffff;
  }

  .resultados-table tbody tr:hover {
    background: #f1f5f9 !important;
  }

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

  .resultados-table tbody tr[data-id] {
    cursor: pointer;
  }

  /* Checkboxes */
  .checkbox-select-all,
  .checkbox-row {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--green);
    margin: 0;
  }

  .resultados-table td.col-checkbox {
    text-align: center;
    padding: 12px 8px;
  }

  .resultados-table td.col-numero {
    font-weight: 600;
    color: #0f172a;
  }

  .resultados-table td.col-mascota {
    color: #1e293b;
  }

  .resultados-table td.col-dueno {
    color: #475569;
  }

  .resultados-table td.col-medico {
    color: #64748b;
  }

  .resultados-table td.col-fecha {
    color: #64748b;
    font-size: 12px;
  }

  .resultados-table td.col-acciones {
    text-align: center;
    padding: 12px 8px;
  }

  .resultados-empty,
  .resultados-loading {
    text-align: center;
    color: #94a3b8;
    padding: 48px 20px !important;
  }

  .resultados-empty p,
  .resultados-loading p {
    margin: 0;
    font-size: 15px;
  }

  .btn-ver {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(99, 179, 46, 0.3);
  }

  .btn-ver:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 179, 46, 0.4);
  }

  /* Vista de Detalle */
  .detalle-vista {
    animation: fadeIn 0.3s ease;
  }

  .detalle-header {
    margin-bottom: 24px;
  }

  .btn-volver {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.3s ease;
  }

  .btn-volver svg {
    width: 20px;
    height: 20px;
  }

  .btn-volver:hover {
    border-color: var(--green);
    color: var(--green);
    background: rgba(99, 179, 46, 0.05);
  }

  .detalle-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
  }

  /* Cards de Detalle */
  .detalle-card {
    background: var(--white);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
  }

  .detalle-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--green) 0%, var(--green-dark) 100%);
  }

  .detalle-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f1f5f9;
  }

  .detalle-card-title {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
  }

  .btn-editar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: var(--green);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
  }

  .btn-editar svg {
    width: 16px;
    height: 16px;
  }

  .btn-editar:hover {
    background: rgba(99, 179, 46, 0.1);
  }

  .detalle-card-body {
    display: flex;
    gap: 24px;
  }

  /* Card Mascota */
  .mascota-card .detalle-card-body {
    flex-direction: row;
  }

  .mascota-imagen {
    flex-shrink: 0;
  }

  .mascota-imagen img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #f1f5f9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }

  .mascota-datos {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .dato-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .dato-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .dato-item.full-width {
    grid-column: 1 / -1;
  }

  .dato-label {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .dato-value {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
  }

  /* Card Dueño */
  .dueno-card {
    grid-column: 1 / -1;
  }

  .dueno-datos {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  /* Card Historial */
  .historial-card {
    grid-column: 1 / -1;
  }

  /* Acordeón */
  .historial-acordeon {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .acordeon-item {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
  }

  .acordeon-item.active {
    border-color: var(--green);
    box-shadow: 0 4px 12px rgba(99, 179, 46, 0.15);
  }

  .acordeon-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
  }

  .acordeon-header:hover {
    background: #f8fafc;
  }

  .acordeon-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
  }

  .acordeon-icon {
    width: 24px;
    height: 24px;
    color: var(--green);
    flex-shrink: 0;
  }

  .acordeon-count {
    color: #64748b;
    font-weight: 500;
  }

  .acordeon-arrow {
    width: 20px;
    height: 20px;
    color: #94a3b8;
    transition: transform 0.3s ease;
    flex-shrink: 0;
  }

  .acordeon-item.active .acordeon-arrow {
    transform: rotate(180deg);
  }

  .acordeon-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .acordeon-body {
    padding: 0 24px 24px 24px;
  }

  /* Historial: items + botón PDF */
  .hist-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    justify-content: space-between;
    padding: 14px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    margin-bottom: 12px;
  }

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

  .hist-item-title {
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 4px;
  }

  .hist-item-meta {
    font-size: 12px;
    color: #64748b;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
  }

  .hist-item-dot { opacity: 0.7; }

  .hist-item-motivo {
    margin-top: 8px;
    font-size: 12px;
    color: #334155;
    line-height: 1.45;
    padding: 10px 12px;
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
  }

  .hist-item-actions {
    flex: 0 0 auto;
  }

  .btn-hist-pdf {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(22, 163, 74, 0.35);
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.12) 0%, rgba(34, 197, 94, 0.18) 100%);
    color: #065f46;
    font-weight: 800;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 12px 30px rgba(22, 163, 74, 0.14);
    white-space: nowrap;
  }

  .btn-hist-pdf:hover {
    transform: translateY(-1px);
    border-color: rgba(22, 163, 74, 0.7);
    box-shadow: 0 16px 40px rgba(22, 163, 74, 0.22);
  }

  .btn-hist-pdf-icon {
    width: 18px;
    height: 18px;
  }

  @media (max-width: 640px) {
    .hist-item { flex-direction: column; }
    .hist-item-actions { width: 100%; }
    .btn-hist-pdf { width: 100%; justify-content: center; }
  }

  .acordeon-empty {
    color: #94a3b8;
    font-size: 14px;
    text-align: center;
    padding: 24px;
    margin: 0;
  }

  /* Botones de Acción */
  .detalle-acciones {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 24px;
  }

  .accion-btn {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(99, 179, 46, 0.3);
    position: relative;
    overflow: hidden;
  }

  .accion-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
  }

  .accion-btn:hover::before {
    width: 300px;
    height: 300px;
  }

  .accion-btn svg {
    width: 24px;
    height: 24px;
    position: relative;
    z-index: 1;
  }

  .accion-btn span {
    position: relative;
    z-index: 1;
  }

  .accion-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 179, 46, 0.4);
  }

  .accion-btn:active {
    transform: translateY(0);
  }

  /* Responsive para búsqueda */
  @media (max-width: 1024px) {
    .detalle-content {
      grid-template-columns: 1fr;
    }

    .mascota-card .detalle-card-body {
      flex-direction: column;
      align-items: center;
    }

    .mascota-imagen {
      align-self: center;
    }
  }

  @media (max-width: 768px) {
    .busqueda-title {
      font-size: 24px;
    }

    .resultados-table-wrapper {
      overflow-x: scroll;
    }

    .resultados-table {
      min-width: 800px;
    }

    .detalle-acciones {
      grid-template-columns: 1fr;
    }

    .dato-row {
      grid-template-columns: 1fr;
    }
  }

  /* Estilos para formulario de evento en página de buscar historia */
  #form-evento-container {
    margin-top: 32px;
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    animation: slideDown 0.4s ease-out;
  }

  #form-evento-container .evento-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-bottom: 2px solid #e0f2fe;
  }

  #form-evento-container .evento-form-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
  }

  #form-evento-container .cerrar-formulario {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
  }

  #form-evento-container .cerrar-formulario:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text);
  }

  #form-evento-container .cerrar-formulario svg {
    width: 20px;
    height: 20px;
  }

  #form-evento-container .evento-form-content {
    padding: 32px;
  }

  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Estilos para mensaje de no resultados */
  .no-results-container {
    padding: 60px 32px;
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
  }

  .no-results-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 32px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #bae6fd 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.15);
    animation: pulse 2s ease-in-out infinite;
  }

  .no-results-icon svg {
    width: 64px;
    height: 64px;
    color: #0ea5e9;
  }

  .no-results-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 16px 0;
    line-height: 1.3;
  }

  .no-results-message {
    font-size: 16px;
    color: #64748b;
    margin: 0 0 32px 0;
    line-height: 1.6;
  }

  .btn-crear-historia {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 36px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    border-radius: 16px;
    background: linear-gradient(135deg, #63b32e 0%, #4a9e1f 50%, #3e7e1e 100%);
    box-shadow: 0 8px 24px rgba(99, 179, 46, 0.3),
                0 4px 12px rgba(99, 179, 46, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: none;
    cursor: pointer;
  }

  .btn-crear-historia::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
  }

  .btn-crear-historia:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(99, 179, 46, 0.4),
                0 6px 16px rgba(99, 179, 46, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #6fc039 0%, #55b028 50%, #4a9e1f 100%);
  }

  .btn-crear-historia:hover::before {
    left: 100%;
  }

  .btn-crear-historia:active {
    transform: translateY(0);
    box-shadow: 0 4px 16px rgba(99, 179, 46, 0.3),
                inset 0 2px 4px rgba(0, 0, 0, 0.1);
  }

  .btn-crear-historia svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
    transition: transform 0.3s ease;
  }

  .btn-crear-historia:hover svg {
    transform: rotate(90deg) scale(1.1);
  }

  .btn-crear-historia span {
    position: relative;
    z-index: 1;
    letter-spacing: 0.3px;
  }

  @keyframes pulse {
    0%, 100% {
      transform: scale(1);
      box-shadow: 0 8px 24px rgba(14, 165, 233, 0.15);
    }
    50% {
      transform: scale(1.05);
      box-shadow: 0 12px 32px rgba(14, 165, 233, 0.25);
    }
  }

  /* Responsive para no resultados */
  @media (max-width: 768px) {
    .no-results-container {
      padding: 40px 24px;
    }

    .no-results-icon {
      width: 100px;
      height: 100px;
      margin-bottom: 24px;
    }

    .no-results-icon svg {
      width: 52px;
      height: 52px;
    }

    .no-results-title {
      font-size: 20px;
    }

    .no-results-message {
      font-size: 14px;
      margin-bottom: 24px;
    }

    .btn-crear-historia {
      padding: 16px 28px;
      font-size: 15px;
    }
  }

  /* ============================================
     ESTILOS PARA EDICIÓN DE DATOS
     ============================================ */

  /* Formularios de edición */
  .form-editar-mascota,
  .form-editar-dueno {
    display: flex;
    flex-direction: column;
    gap: 24px;
  }

  /* Ocultar formulario cuando no está en modo edición */
  .mascota-card:not(.editing) .form-editar-mascota,
  .dueno-card:not(.editing) .form-editar-dueno {
    display: none;
  }

  /* Ocultar vista de lectura cuando está en modo edición */
  .mascota-card.editing .detalle-card-body:not(.form-editar-mascota),
  .dueno-card.editing .detalle-card-body:not(.form-editar-dueno) {
    display: none;
  }

  .dato-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    background: #ffffff;
    color: #1e293b;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
  }

  .dato-input:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 4px rgba(99, 179, 46, 0.1), 0 4px 12px rgba(99, 179, 46, 0.15);
  }

  .dato-input:required:invalid {
    border-color: #ef4444;
  }

  .form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 24px;
    border-top: 2px solid #f1f5f9;
    margin-top: 24px;
  }

  .btn-cancelar {
    background: #ffffff;
    color: #64748b;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
  }

  .btn-cancelar:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
  }

  /* Estilos para imagen de mascota */
  .mascota-imagen-placeholder {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 3px dashed #cbd5e1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #94a3b8;
  }

  .mascota-imagen-placeholder svg {
    width: 48px;
    height: 48px;
  }

  .mascota-imagen-placeholder span {
    font-size: 13px;
    font-weight: 500;
  }

  .mascota-imagen-uploader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  .mascota-imagen-uploader img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #f1f5f9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }

  .mascota-imagen-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 300px;
  }

  .btn-cargar-imagen,
  .btn-capturar-imagen,
  .btn-eliminar-imagen {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 2px solid var(--green);
    border-radius: 10px;
    background: #ffffff;
    color: var(--green);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
  }

  .btn-cargar-imagen:hover,
  .btn-capturar-imagen:hover {
    background: var(--green);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 179, 46, 0.3);
  }

  .btn-eliminar-imagen {
    border-color: #ef4444;
    color: #ef4444;
  }

  .btn-eliminar-imagen:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
  }

  .btn-cargar-imagen svg,
  .btn-capturar-imagen svg,
  .btn-eliminar-imagen svg {
    width: 18px;
    height: 18px;
  }

  /* Modal de cámara */
  .camera-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
  }

  .camera-modal-content {
    background: #ffffff;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
  }

  .camera-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 2px solid #f1f5f9;
  }

  .camera-modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
  }

  .camera-modal-close {
    background: transparent;
    border: none;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s ease;
  }

  .camera-modal-close:hover {
    background: #f1f5f9;
    color: #0f172a;
  }

  .camera-modal-close svg {
    width: 24px;
    height: 24px;
  }

  .camera-modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    flex: 1;
    overflow: auto;
  }

  #camera-video {
    width: 100%;
    max-width: 100%;
    border-radius: 12px;
    background: #000000;
    border: 2px solid #e2e8f0;
  }

  #camera-canvas {
    width: 100%;
    max-width: 100%;
    border-radius: 12px;
    display: none;
  }

  .camera-modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 24px 32px;
    border-top: 2px solid #f1f5f9;
  }

  .btn-capturar {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(99, 179, 46, 0.3);
  }

  .btn-capturar:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 179, 46, 0.4);
  }

  /* Responsive para edición */
  @media (max-width: 768px) {
    .mascota-imagen-actions {
      max-width: 100%;
    }

    .form-actions {
      flex-direction: column;
    }

    .form-actions .btn-guardar,
    .form-actions .btn-cancelar {
      width: 100%;
    }

    .camera-modal-content {
      width: 95%;
      max-height: 95vh;
    }

    .camera-modal-header,
    .camera-modal-footer {
      padding: 20px;
    }
  }

  /* Mensajes flotantes */
  .mensaje-flotante {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    z-index: 10001;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 400px;
  }

  .mensaje-flotante.show {
    transform: translateX(0);
    opacity: 1;
  }

  .mensaje-flotante.mensaje-success {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    color: #ffffff;
  }

  .mensaje-flotante.mensaje-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
  }

  @media (max-width: 768px) {
    .mensaje-flotante {
      right: 10px;
      left: 10px;
      max-width: none;
      transform: translateY(-100px);
    }

    .mensaje-flotante.show {
      transform: translateY(0);
    }
  }

  /* =========================================
     Autocompletado de Dueños
     ========================================= */
  .form-field-autocomplete {
    position: relative;
  }

  .autocomplete-wrapper {
    position: relative;
  }

  .autocomplete-wrapper input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s ease;
    background: #ffffff;
  }

  .autocomplete-wrapper input:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(99, 179, 46, 0.1);
  }

  .autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    margin-top: -2px;
  }

  .autocomplete-suggestions.show {
    display: block;
  }

  .suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .suggestion-item:last-child {
    border-bottom: none;
  }

  .suggestion-item:hover {
    background: #f0fdf4;
    border-left: 3px solid var(--green);
    padding-left: 13px;
  }

  .suggestion-item strong {
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
  }

  .suggestion-item small {
    color: #6b7280;
    font-size: 13px;
  }

  .suggestion-item.no-results {
    color: #6b7280;
    font-style: italic;
    cursor: default;
  }

  .suggestion-item.no-results:hover {
    background: #ffffff;
    border-left: none;
    padding-left: 16px;
  }

  /* =========================================
     Mensajes del Formulario
     ========================================= */
  .form-message {
    margin-top: 16px;
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    animation: slideDown 0.3s ease;
  }

  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .form-message-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 1px solid #10b981;
  }

  .form-message-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 1px solid #ef4444;
  }

  /* =========================================
     Botón de Guardar Mejorado
     ========================================= */
  .btn-guardar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 180px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(99, 179, 46, 0.3);
  }

  .btn-guardar:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 179, 46, 0.4);
  }

  .btn-guardar:active:not(:disabled) {
    transform: translateY(0);
  }

  .btn-guardar:disabled {
    opacity: 0.7;
    cursor: not-allowed;
  }

  .btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  .spinner {
    animation: spin 1s linear infinite;
  }

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

  /* =========================================
     Mejoras Visuales del Formulario
     ========================================= */
  .form-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
  }

  .form-section:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  }

  .section-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 3px solid var(--green);
  }

  .section-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .section-header h2::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--green);
    border-radius: 2px;
  }

  .form-field {
    margin-bottom: 20px;
  }

  .form-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
  }

  .form-field input[type="text"],
  .form-field input[type="email"],
  .form-field input[type="tel"],
  .form-field input[type="number"],
  .form-field select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s ease;
    background: #ffffff;
  }

  .form-field input:focus,
  .form-field select:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(99, 179, 46, 0.1);
  }

  .form-field .required {
    color: #ef4444;
  }

  .field-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #6b7280;
    font-style: italic;
  }

  .form-submit-wrapper {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  @media (max-width: 768px) {
    .form-section {
      padding: 20px;
    }

    .section-header h2 {
      font-size: 20px;
    }

    .autocomplete-suggestions {
      max-height: 200px;
    }
  }

  .peso-sugerencias-box {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
  }

  .peso-sugerencias-box .peso-sugerencias-title {
    margin: 0 0 6px 0;
    font-weight: 700;
    color: #1d4ed8;
    font-size: 13px;
  }

  .peso-sugerencias-box p {
    margin: 3px 0;
    color: #1e3a8a;
    font-size: 13px;
  }

  .costo-items-box {
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    background: #f0fdf4;
  }

  .costo-items-title {
    margin: 0 0 10px 0;
    font-size: 13px;
    font-weight: 700;
    color: #166534;
  }

  .costo-items-list {
    display: grid;
    gap: 8px;
  }

  .costo-item-row {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr auto;
    gap: 8px;
  }

  .costo-item-row input {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 10px;
  }

  .costo-items-actions {
    margin-top: 10px;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    font-size: 13px;
    color: #166534;
  }
  