:root {
    /* Diseño Claro para la cuadrícula */
    --ef-bg: #f8fafc; /* Fondo blanco/gris muy claro */
    --ef-border: #cbd5e1;
    --ef-grid-bg: #ffffff;
    --ef-grid-line: #e2e8f0;
    
    --ef-text: #1e293b;
    --ef-text-muted: #64748b;
    --ef-accent: #2563eb; 
    
    --ef-available: #10b981;
    --ef-reserved: #f59e0b;
    --ef-sold: #2563eb;
    
    --ef-pav-bio: #e11d48;
    --ef-pav-equipo: #eab308; /* Yellow */
    --ef-pav-tactico: #0ea5e9;
    --ef-pav-gobierno: #22c55e; /* Green */
    
    --ef-cell-size: 36px;
    --ef-font: 'Inter', 'Helvetica Neue', sans-serif;
}

.ef-app {
    font-family: var(--ef-font);
    background: var(--ef-bg);
    color: var(--ef-text);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--ef-border);
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    position: relative;
    width: max-content;
    max-width: 100%;
    margin: 0 auto;
}

/* Cabecera */
.ef-header {
    padding: 20px;
    background: #08133A;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ef-header-left h2 { margin: 0; font-size: 22px; color: #ffffff; font-weight: 700; }
.ef-header-left p { margin: 4px 0 0; font-size: 14px; color: #cbd5e1; }

.ef-header-right { display: flex; align-items: center; gap: 20px; }

.ef-btn {
    background: var(--ef-accent);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.ef-btn:hover { opacity: 0.9; }
.ef-btn-outline {
    background: transparent;
    color: var(--ef-accent);
    border: 1px solid var(--ef-accent);
}

/* Contenedor del Mapa */
.ef-map-area {
    flex: 1;
    overflow: auto;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--ef-border);
    padding: 20px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    display: flex;
    justify-content: center;
}

.ef-grid {
    position: relative;
    background-color: var(--ef-grid-bg);
    border: 1px solid var(--ef-border);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    width: calc(17 * var(--ef-cell-size));
    height: calc(19 * var(--ef-cell-size));
    background-image: 
        linear-gradient(var(--ef-grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--ef-grid-line) 1px, transparent 1px);
    background-size: var(--ef-cell-size) var(--ef-cell-size);
    background-position: 0 0;
    background-attachment: local;
    cursor: crosshair;
}

.ef-stand {
    opacity: 1;
    position: absolute;
    background: #ffffff;
    border: 2px solid;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
    box-sizing: border-box;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ef-stand.selected { opacity: 0.6; z-index: 20; box-shadow: 0 0 0 4px #08133A !important; }
.ef-stand:hover {
    z-index: 10;
    transform: scale(1.02);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.ef-stand.available { border-color: var(--ef-available); background-color: #ffffff; background-image: linear-gradient(135deg, rgba(16, 185, 129, 0.4) 0%, rgba(16, 185, 129, 0.05) 100%); }
.ef-stand.reserved { border-color: var(--ef-reserved); background-color: #ffffff; background-image: linear-gradient(135deg, rgba(245, 158, 11, 0.4) 0%, rgba(245, 158, 11, 0.05) 100%); }
.ef-stand.sold { border-color: var(--ef-sold); background-color: #ffffff; background-image: linear-gradient(135deg, rgba(37, 99, 235, 0.4) 0%, rgba(37, 99, 235, 0.05) 100%); }

.ef-stand.pav-bio { border-color: var(--ef-pav-bio) !important; border-width: 3px; }
.ef-stand.pav-equipo { border-color: var(--ef-pav-equipo) !important; border-width: 3px; }
.ef-stand.pav-tactico { border-color: var(--ef-pav-tactico) !important; border-width: 3px; }
.ef-stand.pav-gobierno { border-color: var(--ef-pav-gobierno) !important; border-width: 3px; }

.ef-stand-logo {
    max-width: 80%;
    max-height: 60%;
    object-fit: contain;
    margin-bottom: 4px;
}

.ef-stand-id {
    font-weight: 700;
    font-size: 14px;
    padding: 2px;
    text-shadow: 0 0 3px rgba(255,255,255,0.8);
}

.ef-stand-sm .ef-stand-logo {
    max-width: 90%;
    max-height: 55%;
    margin-bottom: 0px;
}

.ef-stand-sm .ef-stand-id {
    font-size: 11px;
    font-weight: 800;
    padding: 0;
    line-height: 1;
    margin-top: 1px;
}

/* Modal Background */
.ef-modal-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

/* Layout Principal */
.ef-main-layout {
    display: flex;
    gap: 30px;
    align-items: stretch;
    padding: 20px;
}

.ef-sidebar {
    width: 400px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #08133A 0%, rgba(8, 19, 58, 0.8) 100%);
    color: #ffffff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
    border: 1px solid var(--ef-border);
    display: flex;
    flex-direction: column;
    min-height: 100%;
    box-sizing: border-box;
}

@media (max-width: 992px) {
    .ef-main-layout { flex-direction: column; padding: 10px; }
    .ef-map-area { padding: 10px; }
    .ef-sidebar {
        width: 100%;
        flex-shrink: 0;
        background: linear-gradient(135deg, #08133A 0%, rgba(8, 19, 58, 0.8) 100%);
        color: #ffffff;
        border-radius: 12px;
        padding: 20px;
        box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
        border: 1px solid var(--ef-border);
    }
    .ef-grid { transform-origin: top left; }
}
@media (max-width: 768px) {
    .ef-header { flex-direction: column; align-items: flex-start; gap: 15px; }
    .ef-header-right { width: 100%; justify-content: flex-end; }
}

/* Modal legacy overrides (ahora en sidebar) */
.ef-close { display: none; } /* Ya no hay boton de cerrar modal, siempre esta en sidebar */

.ef-modal-top-section {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    align-items: flex-start;
}

.ef-modal-logo-wrap {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    background: #ffffff;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    box-sizing: border-box;
}

.ef-modal-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.ef-modal-header-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ef-modal-title { font-size: 22px; font-weight: 800; margin: 0 0 8px 0; color: #ffffff; line-height: 1.2; }
.ef-modal-category { color: var(--ef-reserved); font-weight: 700; font-size: 12px; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px;}
.ef-modal-desc { color: #cbd5e1; font-size: 14px; line-height: 1.6; margin-bottom: 24px; }

.ef-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    background: #f8fafc;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
}
.ef-spec-item { display: flex; flex-direction: column; flex: 1; min-width: 80px; }
.ef-spec-label { font-size: 11px; color: var(--ef-text-muted); text-transform: uppercase; }
.ef-spec-val { font-size: 15px; font-weight: 700; color: #0f172a; }

.ef-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.ef-badge.available { background: #d1fae5; color: #065f46; }
.ef-badge.reserved { background: #fef3c7; color: #92400e; }
.ef-badge.sold { background: #dbeafe; color: #1e40af; }

/* Auth Modal sigue siendo modal */
.ef-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.ef-auth-modal {
    background: #fff; padding: 30px; border-radius: 12px;
    width: 100%; max-width: 400px; position: relative;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.15);
    animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

/* Form Styles for Admin Edit panel in Sidebar */
.ef-admin-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.ef-form-group {
    display: flex;
    flex-direction: column;
}
.ef-form-group label {
    font-size: 12px;
    font-weight: 700;
    color: #cbd5e1;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.ef-row {
    display: flex;
    gap: 15px;
}
.ef-row .ef-form-group {
    flex: 1;
}
.ef-input {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-family: var(--ef-font);
    width: 100%;
    box-sizing: border-box;
    transition: all 0.2s;
}
.ef-input:focus {
    outline: none;
    border-color: var(--ef-accent);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}
.ef-input::placeholder {
    color: #94a3b8;
    opacity: 0.7;
}
select.ef-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23ffffff'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 36px;
}
select.ef-input option {
    background: #08133a;
    color: #ffffff;
}
textarea.ef-input {
    resize: vertical;
    min-height: 60px;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Spinner component for loading state */
.ef-loading-spinner-wrap {
    padding: 40px;
    text-align: center;
    font-family: var(--ef-font);
    color: var(--ef-text-muted);
}
