/* === AVL Directiva - Estilos === */

:root {
    --primary: #2c5282;
    --primary-hover: #1a365d;
    --success: #48bb78;
    --danger: #e53e3e;
    --bg: #f7fafc;
    --card: #ffffff;
    --border: #e2e8f0;
    --text: #2d3748;
    --text-light: #718096;
    --A-color: #fbb6ce;
    --B-color: #f6e0a0;
    --C-color: #ed8936;
    --D-color: #e2e8f0;
    --E-color: #9ae6b4;
    --F-color: #fbb6ce;
    --G-color: #68d391;
    --H-color: #f6e05e;
    --J-color: #63b3ed;
    --K-color: #d6bcfa;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

/* === LOGIN === */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #2c5282 0%, #1a365d 100%);
}

.login-container {
    background: var(--card);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo h1 { font-size: 2.5rem; color: var(--primary); }
.login-logo p { color: var(--text-light); font-size: 0.9rem; }

.login-form h2 { text-align: center; margin-bottom: 1.5rem; font-size: 1.2rem; }

/* === TOPBAR === */
.topbar {
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
}
.topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}
.topbar h1 { font-size: 1.2rem; }
.topbar nav { display: flex; align-items: center; gap: 12px; }
.user-badge { font-size: 0.85rem; opacity: 0.9; }

/* === CONTAINER === */
.container {
    display: flex;
    gap: 1.5rem;
    max-width: 1400px;
    margin: 1.5rem auto;
    padding: 0 1.5rem;
}

/* === SIDEBAR === */
.sidebar {
    width: 220px;
    flex-shrink: 0;
}
.sidebar h3 { margin-bottom: 0.75rem; font-size: 0.95rem; color: var(--text-light); }
.resumen-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}
.resumen-detalle { display: flex; flex-direction: column; gap: 4px; }
.resumen-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    background: var(--card);
    padding: 4px 8px;
    border-radius: 4px;
}
.zona-badge {
    display: inline-block;
    width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.75rem;
}

/* === CONTENT === */
.content { flex: 1; min-width: 0; }

/* === FILTROS === */
.filtros {
    display: flex;
    gap: 8px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    align-items: center;
}
.filtros select, .filtros input {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    background: var(--card);
}
.filtros input[type="text"] { flex: 1; min-width: 150px; }

/* === TABLA === */
.table-wrapper {
    overflow-x: auto;
    background: var(--card);
    border-radius: 8px;
    border: 1px solid var(--border);
}
.lotes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.lotes-table th {
    background: #f8fafc;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
.lotes-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}
.lotes-table tr:hover { background: #f0f4ff; }
.lotes-table tr.tipo-condominio { background: #fffbeb; }
.lotes-table tr.tipo-condominio:hover { background: #fef3c7; }
.lotes-table tr.inactivo { opacity: 0.5; }
.empty { text-align: center; padding: 2rem !important; color: var(--text-light); }

/* === BOTONES === */
.btn-primary, .btn-secondary, .btn-small {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}
.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-small {
    padding: 4px 10px;
    font-size: 0.8rem;
    background: var(--primary);
    color: white;
}
.btn-small:hover { background: var(--primary-hover); }
.btn-secondary {
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: #f0f4ff; }

/* === FORMULARIOS === */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.form-grid h3 { grid-column: 1 / -1; margin: 0.5rem 0 0 0; padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.field { display: flex; flex-direction: column; gap: 4px; }
.field.full-width { grid-column: 1 / -1; }
.field label { font-size: 0.8rem; font-weight: 600; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; }
.field input, .field textarea, .field select {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    background: var(--card);
}
.field input:disabled { background: #f7fafc; color: var(--text-light); }
.field textarea { resize: vertical; font-family: inherit; }

/* === MENSAJES === */
.error-msg {
    background: #fed7d7;
    color: #9b2c2c;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.success-msg {
    background: #c6f6d5;
    color: #22543d;
    padding: 10px 16px;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 500;
}

/* === LOGIN FOOTER === */
.login-footer { text-align: center; margin-top: 1.5rem; }
.login-footer a { color: var(--primary); font-size: 0.85rem; }

/* === CREAR USUARIO === */
.crear-usuario {
    margin-bottom: 1.5rem;
}
.crear-usuario summary {
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 0.75rem;
}
.user-form { background: #f8fafc; padding: 1rem; border-radius: 8px; border: 1px solid var(--border); }

/* === INFO BAR === */
.info-bar {
    background: #f8fafc;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* === AFILIADO === */
.afiliado-cell { text-align: center; font-size: 1.1rem; }
tr.afiliado { border-left: 3px solid var(--success); }
tr.no-afiliado { border-left: 3px solid var(--danger); }

/* === TABLE COUNT === */
.table-count {
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .container { flex-direction: column; }
    .sidebar { width: 100%; }
    .form-grid { grid-template-columns: 1fr; }
}
