* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base responsive: iOS y móviles */
html {
    -webkit-text-size-adjust: 100%;
    height: 100%;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: white;
    color: #333;
    line-height: 1.6;
    min-height: 100%;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    /* Safe area para iPhone con notch / barra home */
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
}
/* Tap highlight suave en iOS */
a, button, [role="button"], .nav-item, .btn-logout, .profile-trigger {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.08);
}

/* Header: respetar safe area en iOS (notch, isla) */
.header {
    background: white;
    color: #333;
    padding: 1.5rem 2rem;
    padding-top: max(1.5rem, env(safe-area-inset-top));
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
    overflow: visible;
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    font-size: 0.95rem;
    font-weight: 500;
}

.btn-logout {
    background: rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.1);
    color: #333;
    padding: 0.5rem 0.8rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: rgba(0,0,0,0.1);
    transform: scale(1.1);
}

/* Menú de perfil plegable - diseño premium */
.user-info {
    position: relative;
    overflow: visible;
    align-self: stretch;
    display: flex;
    align-items: center;
}
/* Wrapper para que el dropdown se posicione DEBAJO del botón, no a la par */
.profile-dropdown-wrapper {
    position: relative;
    display: inline-block;
    vertical-align: middle;
}
.profile-trigger {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.9rem 0.5rem 0.45rem;
    background: rgba(255,255,255,0.95);
    border: none;
    border-radius: 2.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a1a1a;
    transition: transform 0.2s ease, box-shadow 0.25s ease, background 0.2s ease;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.profile-trigger:hover {
    background: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    transform: translateY(-1px);
}
.profile-trigger.is-open {
    background: #fff;
    box-shadow: 0 6px 24px rgba(0,0,0,0.14);
}
.profile-trigger .profile-avatar {
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    max-width: 22px;
    max-height: 22px;
    border-radius: 50%;
    background: linear-gradient(145deg, #2c7a7b 0%, #234e52 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: -0.02em;
    box-shadow: 0 2px 8px rgba(44, 122, 123, 0.35);
    overflow: hidden;
    flex-shrink: 0;
}
.profile-trigger .profile-avatar img {
    width: 100% !important;
    height: 100% !important;
    max-width: 22px !important;
    max-height: 22px !important;
    object-fit: cover;
    object-position: center;
    display: block;
}
/* Si la imagen falla, no mostrar texto alternativo encima */
.profile-trigger .profile-avatar img[alt] {
    font-size: 0;
    color: transparent;
}
/* Imagen de perfil: nunca más grande que el avatar */
img[src*="perfil-removebg-preview.png"] {
    max-width: 22px !important;
    max-height: 22px !important;
    object-fit: cover;
}
.profile-trigger .user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.profile-trigger .profile-chevron {
    font-size: 0.6rem;
    color: #2c7a7b;
    opacity: 0.9;
    transition: transform 0.25s ease;
}
.profile-trigger.is-open .profile-chevron {
    transform: rotate(180deg);
}
/* Recuadro que se despliega DEBAJO del nombre (no a la par) */
.profile-dropdown {
    display: none !important;
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
    margin-top: 0.5rem !important;
    width: 320px !important;
    max-width: 320px !important;
    min-width: 280px !important;
    transform-origin: top right !important;
    background: #ffffff !important;
    border-radius: 10px !important;
    box-shadow: 0 10px 32px rgba(44, 122, 123, 0.2), 0 0 0 1px rgba(44, 122, 123, 0.12) !important;
    padding: 0 !important;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 99999 !important;
    overflow: visible !important;
    border: 1px solid rgba(44, 122, 123, 0.2) !important;
}
.profile-dropdown::before {
    content: '';
    position: absolute;
    top: -7px;
    right: 22px;
    left: auto;
    width: 12px;
    height: 12px;
    background: #fff;
    border-left: 1px solid rgba(44, 122, 123, 0.2);
    border-top: 1px solid rgba(44, 122, 123, 0.2);
    transform: rotate(45deg);
    z-index: 1;
}
.profile-dropdown.is-open {
    display: block !important;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.profile-dropdown[hidden] {
    display: none !important;
}
/* Cabecera del recuadro en tono teal (convina con el menú) */
.profile-dropdown .profile-dropdown-header {
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #2c7a7b 0%, #234e52 100%);
    border-bottom: none;
}
.profile-dropdown .profile-dropdown-name {
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    letter-spacing: -0.02em;
}
.profile-dropdown .profile-dropdown-email {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.85);
    margin-top: 0.2rem;
    font-weight: 500;
}
/* Cuadrícula de opciones dentro de la caja blanca - FORZAR COLUMNA VERTICAL */
.profile-dropdown .profile-dropdown-links {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
    padding: 0.75rem !important;
    width: 100% !important;
    background: #ffffff !important;
}
.profile-dropdown-link,
.profile-dropdown .profile-dropdown-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 0.75rem 1rem !important;
    color: #1a202c !important;
    text-decoration: none !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    border: 1px solid rgba(0,0,0,0.08) !important;
    background: #ffffff !important;
    width: 100% !important;
    max-width: 100% !important;
    text-align: left !important;
    transition: background 0.15s ease, border-color 0.15s ease;
    font-family: inherit;
    border-radius: 8px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}
.profile-dropdown-link:link,
.profile-dropdown-link:visited,
.profile-dropdown-link:hover,
.profile-dropdown-link:active {
    color: #1a202c !important;
    text-decoration: none !important;
}
.profile-dropdown .profile-dropdown-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(44, 122, 123, 0.1);
    color: #2c7a7b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.profile-dropdown-link:hover,
.profile-dropdown .profile-dropdown-item:not(.logout):hover {
    background: rgba(44, 122, 123, 0.08);
    border-color: rgba(44, 122, 123, 0.2);
    color: #234e52;
}
.profile-dropdown-link:hover .profile-dropdown-icon {
    background: rgba(44, 122, 123, 0.18);
}
.profile-dropdown .profile-dropdown-divider {
    height: 1px;
    background: rgba(0,0,0,0.06);
    margin: 0.4rem 1rem;
}
.profile-dropdown .profile-dropdown-item.logout {
    color: #b91c1c;
    font-weight: 600;
    margin: 0.25rem 0.75rem 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: #fff;
    border: 1px solid rgba(185, 28, 28, 0.2);
}
.profile-dropdown .profile-dropdown-item.logout .profile-dropdown-icon {
    background: rgba(185, 28, 28, 0.12);
    color: #b91c1c;
}
.profile-dropdown .profile-dropdown-item.logout:hover {
    background: rgba(185, 28, 28, 0.1);
}
.profile-dropdown .profile-dropdown-item.logout:hover .profile-dropdown-icon {
    background: rgba(185, 28, 28, 0.2);
}
/* Header teal (barra principal) */
.header.teal-header {
    background: linear-gradient(135deg, #2c7a7b 0%, #234e52 100%) !important;
    color: #fff;
    box-shadow: 0 2px 16px rgba(44, 122, 123, 0.25);
}
.header.teal-header h1,
.header.teal-header .nav-item {
    color: #fff;
}
.header.teal-header .nav-item:hover {
    background: rgba(255,255,255,0.15);
}
.header.teal-header .nav-item.active {
    border-bottom-color: rgba(255,255,255,0.9);
}
/* Si el header es oscuro/teal, adaptar el trigger */
.header[style*="background"] .profile-trigger,
.header.teal-header .profile-trigger {
    background: rgba(255,255,255,0.2);
    color: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.header[style*="background"] .profile-trigger .user-name,
.header.teal-header .profile-trigger .user-name { color: #fff; }
.header[style*="background"] .profile-trigger .profile-chevron,
.header.teal-header .profile-trigger .profile-chevron { color: rgba(255,255,255,0.9); }
.header[style*="background"] .profile-trigger:hover,
.header.teal-header .profile-trigger:hover {
    background: rgba(255,255,255,0.3);
}
.header[style*="background"] .profile-trigger .profile-avatar,
.header.teal-header .profile-trigger .profile-avatar {
    background: linear-gradient(145deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.8) 100%);
    color: #2c7a7b;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.header.teal-header .profile-trigger .profile-avatar img {
    max-width: 22px !important;
    max-height: 22px !important;
    object-fit: cover;
}

.nav-bar {
    display: flex;
    gap: 2rem;
}

.nav-item {
    color: #333;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.nav-item:hover {
    background-color: rgba(0,0,0,0.05);
}

.nav-item.active {
    border-bottom: 2px solid #2c7a7b;
    font-weight: 600;
}

.nav-item.admin-nav-item {
    background: rgba(255, 193, 7, 0.2);
    border: 1px solid rgba(255, 193, 7, 0.5);
    font-weight: 600;
}

.nav-item.admin-nav-item:hover {
    background: rgba(255, 193, 7, 0.3);
    border-color: rgba(255, 193, 7, 0.7);
}

.nav-icon {
    font-size: 1.2rem;
}

/* Search Bar Container */
.search-bar-container {
    background: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.search-wrapper {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 25px;
    padding: 0.5rem 1rem;
    width: 400px;
}

.search-icon {
    margin-right: 0.5rem;
    color: #666;
}

.search-input {
    border: none;
    background: transparent;
    outline: none;
    flex: 1;
    font-size: 1rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
}

.btn-filter, .btn-primary {
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.btn-filter {
    background: white;
    color: #333;
}

.btn-filter:hover {
    background: white;
}

.btn-primary {
    background: #ff6b35;
    color: white;
    font-weight: 600;
}

.btn-primary:hover {
    background: #e55a2b;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Main Content */
.main-content {
    padding: 0 2rem 2rem;
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
}

.records-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

/* Record Card */
.record-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.record-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    position: relative;
}

.card-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card-badge {
    display: inline-block;
    background: #2c7a7b;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.card-info {
    font-size: 0.9rem;
    color: #666;
    margin: 0.3rem 0;
}

.card-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
}

.action-icon {
    background: rgba(0,0,0,0.05);
    border: none;
    border-radius: 5px;
    padding: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

.action-icon:hover {
    background: rgba(0,0,0,0.1);
}

.card-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

/* Estilos para el carrusel de imágenes */
.card-image-container {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.carousel-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.carousel-item.active {
    opacity: 1;
    position: relative;
}

.carousel-item img,
.carousel-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.3s ease;
}

.carousel-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

.carousel-prev {
    left: 10px;
}

.carousel-next {
    right: 10px;
}

.carousel-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

.carousel-dot:hover {
    transform: scale(1.2);
}

.carousel-dot.active {
    background: white;
    transform: scale(1.3);
}

.card-location {
    padding: 1rem 1.5rem;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.location-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.location-coords {
    background: white;
    padding: 0.7rem;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #1976d2;
    font-size: 0.9rem;
}

.card-notes {
    padding: 1.5rem;
}

.notes-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.notes-text {
    color: #333;
    line-height: 1.6;
}

/* Form Container */
.form-container {
    max-width: 800px;
    margin: 2rem auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 2rem;
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #eee;
}

.form-header h2 {
    font-size: 1.8rem;
    color: #2c7a7b;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0.5rem;
    border-radius: 5px;
    transition: background 0.3s;
}

.close-btn:hover {
    background: white;
}

.record-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group textarea {
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2c7a7b;
}

.location-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.location-field {
    display: flex;
    flex-direction: column;
}

.btn-map, .btn-upload {
    padding: 0.8rem 1.5rem;
    background: #2c7a7b;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background 0.3s;
    margin-top: 0.5rem;
}

.btn-map:hover, .btn-upload:hover {
    background: #1a5f5f;
}

.media-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.media-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.media-item img, .media-item video {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.media-item .remove-media {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255,0,0,0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 0.8rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1.5rem;
    border-top: 2px solid #eee;
}

.btn-cancel {
    padding: 0.8rem 2rem;
    background: white;
    color: #333;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.btn-cancel:hover {
    background: white;
    border-color: #ccc;
}

.btn-save {
    padding: 0.8rem 2rem;
    background: #2c7a7b;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-save:hover {
    background: #1a5f5f;
}

.btn-auto-fill {
    padding: 0.7rem 1.5rem;
    background: #ff9800;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 auto;
    transition: all 0.3s;
}

.btn-auto-fill:hover {
    background: #f57c00;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-bottom: 1rem;
    color: #2c7a7b;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn-delete {
    padding: 0.7rem 1.5rem;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
}

.btn-delete:hover {
    background: #c82333;
}

/* Location Modal */
.location-modal {
    max-width: 800px;
    width: 95%;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #eee;
}

.modal-instructions {
    margin-bottom: 1rem;
    color: #666;
}

.location-obtained-banner {
    margin-bottom: 1rem;
    padding: 0.6rem 0.9rem;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 6px;
    font-size: 0.9rem;
    border-left: 4px solid #4caf50;
}

.map-container {
    position: relative;
    margin-bottom: 1.5rem;
}

.map-area {
    width: 100%;
    height: 400px;
    background: white;
    border: 2px solid #4caf50;
    border-radius: 8px;
    position: relative;
    cursor: crosshair;
    overflow: hidden;
}

.map-pin {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -100%);
    font-size: 2rem;
    cursor: move;
    user-select: none;
    transition: transform 0.2s;
}

.map-pin:hover {
    transform: translate(-50%, -100%) scale(1.1);
}

.map-coordinates-display {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-size: 0.9rem;
}

.offline-indicator {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #ffc107;
    color: #333;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.zoom-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.zoom-btn {
    width: 40px;
    height: 40px;
    background: white;
    border: 2px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.zoom-btn:hover {
    background: white;
    border-color: #999;
}

.coordinate-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.coordinate-field {
    display: flex;
    flex-direction: column;
}

.coordinate-field label {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.coordinate-field input {
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
}

.coordinate-field input:focus {
    outline: none;
    border-color: #2c7a7b;
}

.btn-confirm {
    padding: 0.8rem 2rem;
    background: #2196f3;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-confirm:hover {
    background: #1976d2;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 1.1rem;
}

/* Responsive - Tablet y Móvil */
@media (max-width: 1024px) {
    .header {
        padding: 1rem 1.5rem;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .nav-bar {
        gap: 1rem;
    }

    .nav-item {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    .records-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 1.5rem;
    }
}

/* Responsive - Móvil */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .header h1 {
        font-size: 1.3rem;
        text-align: center;
    }

    .user-info {
        width: 100%;
        justify-content: space-between;
    }

    .user-name {
        font-size: 0.85rem;
    }

    .nav-bar {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        width: 100%;
    }

    .nav-item {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
        flex: 1;
        min-width: calc(50% - 0.25rem);
        justify-content: center;
    }

    .nav-icon {
        font-size: 1rem;
    }

    .search-bar-container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .search-wrapper {
        width: 100%;
        max-width: 100%;
    }

    .action-buttons {
        width: 100%;
        flex-direction: column;
    }

    .btn-filter, .btn-primary {
        width: 100%;
        justify-content: center;
        padding: 0.8rem 1rem;
    }

    .main-content {
        padding: 0 1rem 1rem;
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }

    .records-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .record-card {
        margin-bottom: 0;
    }

    .card-header {
        padding: 1rem;
    }

    .card-title {
        font-size: 1.1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .location-inputs,
    .coordinate-inputs {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px; /* Previene zoom en iOS */
        padding: 0.8rem;
    }

    .btn-submit, .btn-cancel {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 1rem auto;
        padding: 1.5rem;
        max-height: 90vh;
        overflow-y: auto;
    }

    .filter-group {
        flex-direction: column;
        width: 100%;
    }

    .filter-group select {
        width: 100%;
    }

    /* Filtros responsivos - Sobrescribir estilos inline */
    .filter-container {
        padding: 1rem !important;
    }

    .filter-container > div {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem !important;
    }

    .filter-container label {
        width: 100% !important;
        text-align: left !important;
    }

    .filter-select {
        width: 100% !important;
        min-width: auto !important;
        max-width: 100% !important;
    }
}

/* Responsive - Móvil Pequeño */
@media (max-width: 480px) {
    .header {
        padding: 0.8rem;
    }

    .header h1 {
        font-size: 1.1rem;
    }

    .nav-item {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
    }

    .search-bar-container {
        padding: 0.8rem;
    }

    .main-content {
        padding: 0 0.8rem 0.8rem;
        padding-bottom: max(0.8rem, env(safe-area-inset-bottom));
    }

    .card-header {
        padding: 0.8rem;
    }

    .card-body {
        padding: 0.8rem;
    }

    .card-title {
        font-size: 1rem;
    }

    .btn-filter, .btn-primary {
        padding: 0.7rem 0.8rem;
        font-size: 0.9rem;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 0.7rem;
        font-size: 16px;
    }

    .modal-content {
        padding: 1rem;
    }
}

/* Mejoras para touch en móviles */
@media (max-width: 768px) {
    /* Asegurar que los botones sean fácilmente tocables */
    button, .btn-submit, .btn-cancel, .btn-primary, .btn-filter,
    a.nav-item, .btn-logout {
        min-height: 44px; /* Tamaño mínimo recomendado para touch */
        min-width: 44px;
    }

    /* Mejorar espaciado en formularios */
    .form-container {
        padding: 1rem;
    }

    /* Ajustar modales para móvil */
    .modal {
        padding: 0.5rem;
    }

    /* Mejorar scroll en móviles */
    body {
        -webkit-overflow-scrolling: touch;
    }

    /* Ajustar inputs para evitar zoom en iOS */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    input[type="time"],
    textarea,
    select {
        font-size: 16px !important;
    }

    /* Formularios responsivos */
    .form-container {
        margin: 1rem auto;
        padding: 1rem;
        max-width: 100%;
    }

    .form-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .form-header h2 {
        font-size: 1.3rem;
    }

    .close-btn {
        align-self: flex-end;
        font-size: 1.8rem;
        padding: 0.3rem 0.6rem;
    }

    .record-form {
        gap: 1rem;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .form-group input[type="text"],
    .form-group input[type="date"],
    .form-group input[type="time"],
    .form-group input[type="number"],
    .form-group textarea,
    .form-group select {
        width: 100%;
        padding: 0.8rem;
        font-size: 16px;
    }

    /* Grid de fecha y hora en móvil - Sobrescribir estilos inline */
    .form-group[style*="grid-template-columns"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
    }

    .form-group > div {
        width: 100% !important;
    }

    .form-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .btn-map, .btn-upload {
        width: 100%;
        padding: 1rem;
    }

    .media-preview {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.8rem;
    }

    /* Páginas de autenticación responsivas */
    .auth-container {
        padding: 1rem;
    }

    .auth-box {
        padding: 1.5rem;
        max-width: 100%;
    }

    .auth-title {
        font-size: 1.5rem;
    }

    .auth-subtitle {
        font-size: 0.9rem;
    }

    .auth-form {
        gap: 1rem;
    }

    .auth-link {
        font-size: 0.9rem;
    }

    /* Sobrescribir todos los grids inline en formularios */
    form .form-group[style*="grid"] {
        display: flex !important;
        flex-direction: column !important;
    }

    form .form-group[style*="grid"] > div {
        width: 100% !important;
    }
}

/* Estilos adicionales para móvil muy pequeño */
@media (max-width: 360px) {
    .header h1 {
        font-size: 1rem;
    }

    .nav-item {
        font-size: 0.7rem;
        padding: 0.3rem 0.5rem;
    }

    .search-bar-container {
        padding: 0.5rem;
    }

    .form-container {
        padding: 0.8rem;
    }

    .auth-box {
        padding: 1rem;
    }
}

/* Modal "¿Acceder a chats o nueva solicitud?" - fondo tipo cristal desenfocado */
#chatChoiceModal {
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
#chatChoiceModal .email-modal-content,
#chatChoiceModal .chat-choice-content {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 2rem 2.25rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    border: 1px solid rgba(255, 255, 255, 0.6);
}
#chatChoiceModal .email-modal-content h2,
#chatChoiceModal .chat-choice-content h2 {
    color: #2e7d32;
    font-weight: 600;
}
#chatChoiceModal .email-modal-content p,
#chatChoiceModal .chat-choice-content p {
    color: #444;
}

