/* ============================================
   MÓDULO: Directorio
   Archivo: css/modules/directorio.css

   Estilos propios del módulo Directorio:
   página principal, propiedades, inquilinos
   y propietarios locales.
   Responsive en: css/responsive/directorio/
   ============================================ */

/* --------------------------------------------
   CONTENEDOR DE PÁGINA
   -------------------------------------------- */

/* Wrapper con padding y ancho máximo */
.dir-page-container {
    padding: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

/* Variante más ancha para la página principal */
.dir-page-container--wide {
    max-width: 900px;
}

/* --------------------------------------------
   CABECERA DE SECCIÓN
   -------------------------------------------- */

/* Fila: título + botón acción */
.dir-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

/* Grupo izquierdo: botón volver + título */
.dir-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Botón volver (flecha) */
.dir-btn-back {
    padding: 6px 10px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    color: #374151;
    font-size: 12px;
    transition: background 0.15s;
}

.dir-btn-back:hover {
    background: #e5e7eb;
}

/* Título de sección (h2) */
.dir-section-title {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
}

/* Íconos de título por color de módulo */
.dir-icon--indigo { color: #6366f1; margin-right: 8px; }
.dir-icon--green  { color: #10b981; margin-right: 8px; }
.dir-icon--amber  { color: #f59e0b; margin-right: 8px; }

/* --------------------------------------------
   BOTONES DE ACCIÓN PRINCIPAL
   -------------------------------------------- */

/* Base del botón primario */
.dir-btn-primary {
    padding: 8px 16px;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}

.dir-btn-primary:hover { opacity: 0.9; }

/* Variantes de color */
.dir-btn-primary--indigo { background: #6366f1; }
.dir-btn-primary--green  { background: #10b981; }
.dir-btn-primary--amber  { background: #f59e0b; }

/* --------------------------------------------
   TARJETAS DE REGISTRO (lista)
   -------------------------------------------- */

/* Card base de cada registro */
.dir-record-card {
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Fila interna: info + botones */
.dir-record-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Nombre del registro */
.dir-record-name {
    color: #1e293b;
    font-size: 15px;
}

/* Edificio/propiedad asociada — variantes por módulo */
.dir-record-building--indigo {
    color: #6366f1;
    font-size: 12px;
    margin-left: 8px;
}

.dir-record-building--amber {
    color: #f59e0b;
    font-size: 12px;
    margin-left: 8px;
}

/* Datos secundarios del registro */
.dir-record-meta {
    color: #94a3b8;
    font-size: 13px;
}

/* Grupo de botones de acción */
.dir-record-actions {
    display: flex;
    gap: 8px;
}

/* Botón editar */
.dir-btn-edit-rec {
    padding: 6px 10px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    cursor: pointer;
    color: #2563eb;
    font-size: 12px;
    transition: background 0.15s;
}

.dir-btn-edit-rec:hover { background: #dbeafe; }

/* Botón eliminar */
.dir-btn-delete-rec {
    padding: 6px 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    cursor: pointer;
    color: #dc2626;
    font-size: 12px;
    transition: background 0.15s;
}

.dir-btn-delete-rec:hover { background: #fee2e2; }

/* --------------------------------------------
   BADGE GENÉRICO DE TIPO (usado en representantes y otros)
   -------------------------------------------- */

/* Badge de tipo de persona o entidad (abogado, administrador, etc.) */
.dir-type-badge {
    background: #eef2ff;
    color: #6366f1;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

/* --------------------------------------------
   ESTADO VACÍO
   -------------------------------------------- */

/* Mensaje cuando no hay registros */
.dir-empty-state {
    text-align: center;
    color: #94a3b8;
    padding: 40px;
}

/* --------------------------------------------
   FORMULARIO DE CREACIÓN / EDICIÓN
   -------------------------------------------- */

/* Contenedor del formulario (toggle por JS via .style.display) */
.dir-form-container {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    margin-top: 16px;
}

/* Título del formulario */
.dir-form-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1e293b;
}

/* Grid de 2 columnas para campos */
.dir-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Etiqueta de campo */
.dir-form-label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

/* Input / Select / Textarea del formulario */
.dir-form-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 4px;
    box-sizing: border-box;
    font-family: inherit;
}

.dir-form-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Fila de acciones del formulario */
.dir-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    justify-content: flex-end;
}

/* Botón cancelar */
.dir-btn-cancel {
    padding: 8px 20px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s;
}

.dir-btn-cancel:hover { background: #f9fafb; }

/* Botón guardar — variantes de color */
.dir-btn-save {
    padding: 8px 20px;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: opacity 0.15s;
}

.dir-btn-save:hover { opacity: 0.9; }

.dir-btn-save--indigo { background: #6366f1; }
.dir-btn-save--green  { background: #10b981; }
.dir-btn-save--amber  { background: #f59e0b; }

/* --------------------------------------------
   PÁGINA PRINCIPAL DEL DIRECTORIO
   -------------------------------------------- */

/* Título principal */
.dir-main-heading {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
}

/* Subtítulo descriptivo */
.dir-main-subtitle {
    color: #64748b;
    font-size: 13px;
    margin-top: 4px;
}

/* Grid de tarjetas de navegación */
.dir-main-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

/* Enlace que envuelve la tarjeta */
.dir-main-link {
    text-decoration: none;
}

/* Tarjeta de navegación */
.dir-main-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.2s;
    border: 2px solid transparent;
    cursor: pointer;
}

/* Hover con color de borde según módulo */
.dir-main-card--indigo:hover { border-color: #6366f1; }
.dir-main-card--green:hover  { border-color: #10b981; }
.dir-main-card--amber:hover  { border-color: #f59e0b; }

/* Fila interna: ícono + texto */
.dir-main-card-inner {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Ícono cuadrado de la tarjeta */
.dir-main-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Variantes de color */
.dir-main-icon--indigo { background: #eef2ff; color: #6366f1; }
.dir-main-icon--green  { background: #ecfdf5; color: #10b981; }
.dir-main-icon--amber  { background: #fffbeb; color: #f59e0b; }

/* Tamaño del ícono */
.dir-main-icon i {
    font-size: 20px;
}

/* Título de la tarjeta */
.dir-main-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

/* Subtítulo de la tarjeta */
.dir-main-card-subtitle {
    font-size: 13px;
    color: #94a3b8;
}

/* --------------------------------------------
   UTILIDADES ADICIONALES
   -------------------------------------------- */

/* Cabecera de módulo en la página principal */
.dir-module-header {
    margin-bottom: 24px;
}

/* Wrapper del campo textarea con margen superior */
.dir-textarea-wrap {
    margin-top: 12px;
}

/* Modificador textarea — permite redimensionar verticalmente */
.dir-form-input--textarea {
    resize: vertical;
}

/* ============================================
   SUBVISTA: Propiedades (lista, formulario y ficha)
   Prefijo: prop-
   ============================================ */

/* ============================================================
   LISTA DE PROPIEDADES
   ============================================================ */

/* Cabecera de sección */
.prop-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.prop-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.prop-section-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Badge de tipo de propiedad */
.prop-type-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #eef2ff;
    color: #4338ca;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 6px;
    vertical-align: middle;
}

/* Tarjeta de propiedad en la lista */
.prop-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 12px;
    transition: box-shadow 0.15s;
}

.prop-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.prop-card-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.prop-card-info {
    flex: 1;
}

.prop-card-name {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
}

.prop-card-address {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.prop-card-units {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 2px;
}

/* Acciones de la tarjeta */
.prop-card-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

.prop-btn-ficha {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: #eef2ff;
    color: #4338ca;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s;
    border: none;
    cursor: pointer;
}

.prop-btn-ficha:hover { background: #e0e7ff; }

.prop-btn-edit {
    padding: 5px 8px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    color: #374151;
    font-size: 12px;
    transition: background 0.15s;
}

.prop-btn-edit:hover { background: #dbeafe; }

.prop-btn-delete {
    padding: 5px 8px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    color: #ef4444;
    font-size: 12px;
    transition: background 0.15s;
}

.prop-btn-delete:hover { background: #fee2e2; }

/* Lista de unidades */
.prop-units-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.prop-unit-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 11px;
    color: #374151;
}

/* Estado vacío */
.prop-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
    font-size: 14px;
}

/* ============================================================
   FORMULARIO DE PROPIEDAD
   ============================================================ */

.prop-form-container {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.prop-form-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #f3f4f6;
}

.prop-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.prop-form-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 4px;
}

.prop-form-input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    color: #1f2937;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.15s;
    font-family: inherit;
}

.prop-form-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.prop-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
}

/* Sección de unidades en el formulario */
.prop-units-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
}

/* Contenedor de filas de unidad generadas dinámicamente */
.prop-units-form-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
}

.prop-units-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.prop-btn-add-unit {
    padding: 4px 10px;
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
}

.prop-btn-add-unit:hover { background: #e0e7ff; }

.prop-unit-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}

.prop-unit-input {
    flex: 1;
    padding: 5px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 12px;
    font-family: inherit;
}

.prop-unit-level-input {
    width: 70px;
    padding: 5px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 12px;
    font-family: inherit;
}

.prop-btn-remove-unit {
    padding: 4px 8px;
    background: #fee2e2;
    color: #ef4444;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.15s;
}

.prop-btn-remove-unit:hover { background: #fecaca; }

/* ============================================================
   FICHA DE PROPIEDAD
   ============================================================ */

/* Grid de tarjetas */
.prop-ficha-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 20px;
}

/* Tarjeta individual */
.prop-ficha-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px 20px;
}

/* Tarjeta de ancho completo */
.prop-ficha-card--wide {
    grid-column: 1 / -1;
}

/* Título de tarjeta */
.prop-ficha-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 14px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Filas info clave-valor */
.prop-ficha-info-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.prop-ficha-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #374151;
}

.prop-ficha-info-label {
    color: #6b7280;
    font-weight: 500;
}

/* Fila de persona */
.prop-ficha-persona-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid #f9fafb;
    font-size: 13px;
}

.prop-ficha-persona-row:last-child { border-bottom: none; }

.prop-ficha-persona-row i {
    margin-top: 2px;
    font-size: 15px;
}

/* Fila de contrato */
.prop-ficha-contrato-row {
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
}

.prop-ficha-contrato-row:last-child { border-bottom: none; }

.prop-ficha-contrato-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.prop-ficha-monto {
    font-weight: 700;
    color: #10b981;
    font-size: 14px;
}

/* Estado vacío dentro de tarjeta */
.prop-ficha-empty {
    font-size: 12px;
    color: #9ca3af;
    margin: 0;
    padding: 6px 0;
}

/* Badge de ocupación */
.prop-ficha-ocupacion {
    text-align: center;
    padding: 10px 0;
}

.prop-ficha-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.prop-ficha-badge--full    { background: #d1fae5; color: #065f46; }
.prop-ficha-badge--partial { background: #fef3c7; color: #92400e; }
.prop-ficha-badge--empty   { background: #f3f4f6; color: #6b7280; }

/* Acciones rápidas */
.prop-ficha-acciones {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.prop-ficha-accion-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: opacity 0.15s;
}

.prop-ficha-accion-btn:hover { opacity: 0.85; }

.prop-ficha-accion-btn--indigo { background: #eef2ff; color: #4338ca; }
.prop-ficha-accion-btn--green  { background: #ecfdf5; color: #065f46; }
.prop-ficha-accion-btn--amber  { background: #fffbeb; color: #92400e; }

