/* ==========================================================================
   StayAca - Estilos base
   ========================================================================== */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* ==========================================================================
   Header / Navegación
   ========================================================================== */

header {
    background-color: #1a237e;
    color: #fff;
    padding: 0 1.5rem;
}

header nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 0;
}

header nav > a {
    color: #fff;
    font-size: 1.4rem;
    font-weight: bold;
    text-decoration: none;
}

header nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

header nav a {
    color: #e8eaf6;
    text-decoration: none;
}

header nav a:hover {
    color: #fff;
    text-decoration: underline;
}

header nav form button {
    background: none;
    border: none;
    color: #e8eaf6;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
}

header nav form button:hover {
    color: #fff;
    text-decoration: underline;
}

/* ==========================================================================
   Contenido principal
   ========================================================================== */

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

main h1 {
    margin-bottom: 1rem;
    color: #1a237e;
}

main p {
    margin-bottom: 1rem;
}

main ul {
    list-style: none;
    margin: 1rem 0;
}

main ul li {
    padding: 0.6rem 0;
    border-bottom: 1px solid #e0e0e0;
}

main a {
    color: #1a237e;
}

/* ==========================================================================
   Formularios
   ========================================================================== */

form p {
    margin-bottom: 1rem;
}

form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="number"],
form input[type="date"],
form input[type="time"],
form select,
form textarea {
    width: 100%;
    max-width: 500px;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

form button,
button[type="submit"] {
    background-color: #1a237e;
    color: #fff;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
}

form button:hover {
    background-color: #283593;
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer {
    background-color: #1a237e;
    color: #e8eaf6;
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
}

/* ==========================================================================
   ESTILOS DEL PANEL DE DUEÑO (owner_base.html - Barra Horizontal Superior)
   ========================================================================== */

.owner-body {
    min-height: 100vh;
    margin: 0;
    background-color: #f8f9fa;
    color: #333;
    display: flex;
    flex-direction: column;
}

.owner-header {
    background-color: #eef3ff;
    color: #003366;
    border-bottom: 1px solid #cdd6e8;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 51, 102, 0.05);
}

.owner-header-inner {
    max-width: 1350px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.owner-brand-section {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-shrink: 0;
}

.owner-site-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #003366;
    font-weight: 700;
    font-size: 1.35rem;
    background: transparent;
}

.owner-site-brand img.brand-logo {
    height: 60px;
    width: auto;
    display: block;
}

.owner-brand-section .hotel-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    background-color: #dbe8fb;
    border: 1px solid #c5d7f2;
    border-radius: 20px;
    color: #003366;
    font-size: 0.85rem;
    font-weight: 600;
}

.owner-brand-section .hotel-badge .badge-icon {
    font-size: 1.1rem;
    color: #003366;
}

.owner-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-grow: 1;
    gap: 1.5rem;
}

.owner-nav-list {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.owner-nav-list li {
    margin: 0;
    padding: 0;
    border-bottom: none;
}

.owner-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.85rem;
    color: #003366;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border-radius: 6px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.owner-nav-link .material-icons {
    font-size: 1.2rem;
}

.owner-nav-link:hover {
    background-color: rgba(0, 51, 102, 0.08);
    color: #002244;
    text-decoration: none;
}

.owner-nav-link.active {
    background-color: #003366;
    color: #ffffff;
}

.owner-nav-link.active .material-icons {
    color: #ffffff;
}

.admin-divider {
    width: 1px;
    height: 24px;
    background-color: #cdd6e8;
    margin: 0 0.5rem;
}

.owner-user-section {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-left: auto;
    flex-shrink: 0;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-profile .user-avatar {
    font-size: 2rem;
    color: #003366;
}

.user-profile .user-details {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-profile .user-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #003366;
}

.user-profile .user-role {
    font-size: 0.75rem;
    color: #4b6584;
}

.owner-user-section .logout-form {
    margin: 0;
}

.owner-user-section .logout-button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.8rem;
    background-color: transparent;
    border: 1px solid #cdd6e8;
    border-radius: 6px;
    color: #b91c1c;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.owner-user-section .logout-button .material-icons {
    font-size: 1.1rem;
}

.owner-user-section .logout-button:hover {
    background-color: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

.owner-mobile-toggle {
    display: none;
    background: transparent;
    border: 1px solid #cdd6e8;
    color: #003366;
    border-radius: 6px;
    padding: 0.4rem;
    cursor: pointer;
}

.owner-mobile-toggle .material-icons {
    font-size: 1.5rem;
}

main.owner-main {
    max-width: 1350px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    width: 100%;
    flex-grow: 1;
}

/* Responsividad para móviles y tablets */
@media (max-width: 992px) {
    .owner-header-inner {
        position: relative;
        height: auto;
        padding: 0.75rem 1.25rem;
        flex-wrap: wrap;
    }

    .owner-mobile-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .owner-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding-top: 1rem;
        border-top: 1px solid #cdd6e8;
        margin-top: 0.5rem;
    }

    .owner-nav.open {
        display: flex;
    }

    .owner-nav-list {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
    }

    .admin-divider {
        width: 100%;
        height: 1px;
        margin: 0.5rem 0;
    }

    .owner-user-section {
        margin-left: 0;
        padding-top: 0.75rem;
        border-top: 1px solid #cdd6e8;
        justify-content: space-between;
    }
}

/* ==========================================================================
   TIPOS DE UNIDAD — Cards (reducidas ~20%)
   ========================================================================== */

.tipo-unidad-container {
    width: 100%;
}

.tipo-unidad-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.4rem;
    flex-wrap: wrap;
}

.tipo-unidad-header h1 {
    margin: 0 0 0.2rem;
    font-size: 1.45rem;
    color: #003366;
}

.tipo-unidad-header .header-subtitle {
    margin: 0;
    color: #4b6584;
    font-size: 0.88rem;
}

.tipo-unidad-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
    gap: 1.2rem;
}

.tipo-unidad-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0, 51, 102, 0.06);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.tipo-unidad-card:hover {
    box-shadow: 0 4px 12px rgba(0, 51, 102, 0.1);
    transform: translateY(-2px);
}

.card-image-wrapper {
    height: 128px;
    background: #eef3ff;
    overflow: hidden;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-image-placeholder {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    color: #8ba3c7;
    font-size: 0.8rem;
}

.card-content {
    padding: 0.85rem 0.95rem 0.55rem;
    flex-grow: 1;
}

.card-title {
    margin: 0 0 0.55rem;
    font-size: 1rem;
    font-weight: 700;
    color: #003366;
    line-height: 1.3;
}

.hotel-title-btn {
    font-size: 1.45rem;
    font-weight: 700;
    padding: 0.5rem 1.1rem;
}

.card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}

.card-badges .badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    background: #eef3ff;
    color: #003366;
    border: 1px solid #d4e0f5;
}

.card-badges .badge-icon {
    font-size: 0.75rem;
}

.card-description {
    margin: 0;
    font-size: 0.8rem;
    color: #4b6584;
    line-height: 1.4;
}

.card-actions {
    padding: 0.65rem 0.95rem 0.85rem;
    border-top: 1px solid #edf2f7;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.action-menu {
    display: flex;
    gap: 0.65rem;
    margin-left: auto;
}

.action-link {
    font-size: 0.78rem;
    font-weight: 600;
    color: #4b6584;
    text-decoration: none;
}

.action-link:hover {
    color: #003366;
    text-decoration: underline;
}

.action-link.action-delete {
    color: #b91c1c;
}

.action-link.action-delete:hover {
    color: #991b1b;
}

.action-link.action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    vertical-align: middle;
}

.action-link.action-icon:hover {
    background: #eef3ff;
    text-decoration: none;
}

.action-link.action-icon.action-delete:hover {
    background: #fee2e2;
}

/* Botones genéricos del panel */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.45rem 0.9rem;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
    background-color: #003366;
    color: #fff;
    border-color: #003366;
}

.btn-primary:hover {
    background-color: #002244;
    color: #fff;
    text-decoration: none;
}

.btn-secondary {
    background-color: #fff;
    color: #003366;
    border-color: #c5d7f2;
}

.btn-secondary:hover {
    background-color: #eef3ff;
    color: #002244;
    text-decoration: none;
}

.btn-danger {
    background-color: #fff;
    color: #b91c1c;
    border-color: #fecaca;
}

.btn-danger:hover {
    background-color: #fee2e2;
    color: #991b1b;
    text-decoration: none;
}

.btn-sm {
    padding: 0.3rem 0.65rem;
    font-size: 0.78rem;
}

.btn-lg {
    padding: 0.55rem 1.1rem;
    font-size: 0.92rem;
}

.btn .icon {
    font-size: 1.1em;
    line-height: 1;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: #fff;
    border: 1px dashed #c5d7f2;
    border-radius: 10px;
    color: #4b6584;
}

.empty-state-icon {
    color: #8ba3c7;
    margin-bottom: 0.85rem;
}

.empty-state h2 {
    margin: 0 0 0.4rem;
    font-size: 1.15rem;
    color: #003366;
}

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

.unidad-mobile-list {
    display: none;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.unidad-mobile-btn {
    display: inline-block;
    padding: 0.55rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    background: #f1f5f9;
    color: #64748b;
}

.unidad-mobile-btn.estado-activo,
.unidad-mobile-btn.estado-disponible {
    background: #dcfce7;
    color: #15803d;
}

.unidad-mobile-btn.estado-inactivo,
.unidad-mobile-btn.estado-fuera_de_servicio {
    background: #f1f5f9;
    color: #64748b;
}

.unidad-mobile-btn.estado-mantenimiento {
    background: #fef3c7;
    color: #92400e;
}

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

    .tipo-unidad-header {
        flex-direction: column;
        align-items: stretch;
    }

    .card-image-wrapper {
        height: 144px;
    }

    .unidad-table-wrapper {
        display: none;
    }

    .unidad-mobile-list {
        display: flex;
    }
}

/* ==========================================================================
   Promociones — Cards
   ========================================================================== */

.promocion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.2rem;
}

.promocion-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.1rem 1.2rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0, 51, 102, 0.06);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.promocion-card:hover {
    box-shadow: 0 4px 12px rgba(0, 51, 102, 0.1);
    transform: translateY(-2px);
}

.promocion-card-inactiva {
    background: #fafbfc;
    opacity: 0.65;
}

.promocion-card-inactiva:hover {
    transform: none;
    box-shadow: 0 1px 3px rgba(0, 51, 102, 0.06);
}

.promocion-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.promocion-card-header .card-title {
    margin: 0;
}

.promocion-descuento {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    color: #15803d;
    line-height: 1.3;
}

.promocion-card .card-badges {
    margin-bottom: 0;
}

.promocion-card .card-actions {
    margin-top: 0.9rem;
    padding-top: 0.75rem;
    border-top: 1px solid #edf2f7;
}

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

/* ==========================================================================
   Tablas genéricas del panel (unidades físicas, promociones, etc.)
   ========================================================================== */

.unidad-table-wrapper {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 51, 102, 0.06);
    overflow: hidden;
    overflow-x: auto;
}

.unidad-table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.unidad-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    background: #eef3ff;
    color: #003366;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.unidad-table td {
    padding: 0.75rem 1rem;
    border-top: 1px solid #edf2f7;
    color: #33475b;
    vertical-align: middle;
}

.unidad-table tbody tr:hover {
    background: #f7faff;
}

.unidad-table tbody tr.fila-clickable {
    cursor: pointer;
}

.unidad-table td.unidad-id {
    font-weight: 600;
    color: #003366;
}

.unidad-table td.nowrap {
    white-space: nowrap;
}

.unidad-table th:first-child,
.unidad-table td:first-child {
    width: 200px;
}

.unidad-table td.unidad-actions {
    white-space: nowrap;
    text-align: right;
}

.unidad-table td.unidad-actions .action-link + .action-link {
    margin-left: 0.75rem;
}

.unidad-table td.unidad-actions-icons .action-link + .action-link {
    margin-left: 0.35rem;
}

/* Reservas: usa su propia tabla responsiva (columnas que se ocultan, ver
   abajo) en vez del patrón "tabla desaparece + lista de botones mobile" que
   usan otras pantallas (.unidad-mobile-list) — acá no hay una lista
   alternativa, así que se pisa esa regla para que la tabla nunca desaparezca. */
.reservas-table-wrapper {
    display: block;
}

/* Reservas: columnas que se van ocultando a medida que se achica la pantalla,
   de menos a más importante (precio primero, tipo de unidad al final) para
   que Huésped, Check-in y Acciones queden siempre visibles. */
@media (max-width: 1100px) {
    .reservas-table .col-precio {
        display: none;
    }
}

@media (max-width: 950px) {
    .reservas-table .col-checkout {
        display: none;
    }
}

@media (max-width: 820px) {
    .reservas-table .col-estado {
        display: none;
    }
}

@media (max-width: 700px) {
    .reservas-table .col-origen {
        display: none;
    }
}

@media (max-width: 580px) {
    .reservas-table .col-tipo-unidad {
        display: none;
    }

    .reservas-table {
        min-width: 0;
    }
}

.estado-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.estado-badge.estado-activo,
.estado-badge.estado-disponible {
    background: #dcfce7;
    color: #15803d;
}

.estado-badge.estado-inactivo,
.estado-badge.estado-fuera_de_servicio {
    background: #f1f5f9;
    color: #64748b;
}

.estado-badge.estado-mantenimiento {
    background: #fef3c7;
    color: #92400e;
}

.estado-badge.estado-pendiente {
    background: #fef3c7;
    color: #92400e;
}

.estado-badge.estado-confirmada {
    background: #dcfce7;
    color: #15803d;
}

.estado-badge.estado-cancelada,
.estado-badge.estado-no_show {
    background: #fee2e2;
    color: #b91c1c;
}

.estado-badge.estado-finalizada {
    background: #e0e7ff;
    color: #3730a3;
}

.origen-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.origen-badge.origen-stayaca {
    background: #f1f5f9;
    color: #64748b;
}

.origen-badge.origen-google {
    background: #dbeafe;
    color: #1d4ed8;
}

.filtro-estados {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.reservas-filtros {
    background-color: #fff;
    border: 1px solid #e3e8f0;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 51, 102, 0.06);
}

.reservas-filtros-summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.25rem;
    font-weight: 600;
    color: #003366;
    cursor: pointer;
    list-style: none;
}

.reservas-filtros-summary::-webkit-details-marker {
    display: none;
}

.reservas-filtros-summary:hover {
    color: #1a237e;
}

.reservas-filtros-chevron {
    margin-left: auto;
    transition: transform 0.15s ease;
}

.reservas-filtros[open] .reservas-filtros-chevron {
    transform: rotate(180deg);
}

.filtros-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.3rem;
    height: 1.3rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: #1a237e;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
}

.reservas-filtros summary + form {
    padding: 1rem 1.25rem 1.15rem;
    border-top: 1px solid #edf2f7;
}

.reservas-filtros:not([open]) summary + form {
    display: none;
}

.reservas-filtros-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.85rem 1rem;
    align-items: end;
}

.reservas-filtros-grid .form-group {
    margin-bottom: 0;
}

.reservas-filtros-grid label {
    font-size: 0.82rem;
}

.reservas-filtros-acciones {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* ==========================================================================
   Enlace "volver" genérico
   ========================================================================== */

.back-link {
    display: inline-block;
    color: #003366;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Detalle de tipo de unidad
   ========================================================================== */

.detail-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.detail-header {
    display: flex;
    gap: 1.75rem;
    background-color: #fff;
    border: 1px solid #e3e8f0;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 51, 102, 0.06);
}

.detail-image-section {
    flex: 0 0 280px;
    aspect-ratio: 4 / 3;
    border-radius: 8px;
    overflow: hidden;
    background-color: #eef3ff;
}

.detail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.detail-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #9fb3d1;
    font-size: 0.85rem;
}

.detail-info-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.detail-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.detail-title-row h1 {
    margin: 0;
    color: #003366;
    font-size: 1.5rem;
}

.detail-title-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.detail-hotel-name {
    margin: 0;
    color: #5b6b82;
    font-size: 0.9rem;
}

.info-badges .badge-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.info-badges .badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.7rem;
    background-color: #eef3ff;
    border: 1px solid #dbe8fb;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #003366;
}

.description-section h3,
.services-section h3,
.unidades-section h3 {
    margin: 0 0 0.5rem;
    color: #003366;
    font-size: 1.05rem;
}

.description-section p {
    margin: 0;
    color: #333;
    line-height: 1.6;
}

.services-section,
.unidades-section {
    background-color: #fff;
    border: 1px solid #e3e8f0;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 51, 102, 0.06);
}

.services-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.service-tag {
    padding: 0.3rem 0.75rem;
    background-color: #f8f9fa;
    border: 1px solid #e3e8f0;
    border-radius: 20px;
    font-size: 0.82rem;
    color: #333;
}

.unidades-empty {
    margin: 0;
    color: #5b6b82;
    font-size: 0.9rem;
}

.unidad-actions {
    text-align: right;
}

.detail-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
}

@media (max-width: 700px) {
    .detail-header {
        flex-direction: column;
    }

    .detail-image-section {
        flex: 1;
        width: 100%;
    }
}

/* ==========================================================================
   Formularios en contenedor (crear / editar)
   ========================================================================== */

.form-container {
    max-width: 640px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-container h1 {
    margin: 0;
    color: #003366;
    font-size: 1.4rem;
}

.form-section {
    background-color: #fff;
    border: 1px solid #e3e8f0;
    border-radius: 10px;
    padding: 1.25rem 1.5rem 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 51, 102, 0.06);
}

.form-section legend {
    padding: 0 0.4rem;
    font-weight: 600;
    color: #003366;
    font-size: 0.95rem;
}

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

.form-group:last-child {
    margin-bottom: 0;
}

.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 160px;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
}

.error {
    display: block;
    color: #b91c1c;
    font-size: 0.82rem;
    margin-top: 0.25rem;
}

.current-image-preview {
    margin-bottom: 0.75rem;
}

.current-image-preview img {
    border-radius: 8px;
    border: 1px solid #e3e8f0;
}

/* ==========================================================================
   Mensajes de Django (messages framework)
   ========================================================================== */

.messages-list {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.message-item {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.88rem;
    border: 1px solid transparent;
}

.message-success {
    background-color: #e6f4ea;
    color: #1e7e34;
    border-color: #c3e6cb;
}

.message-warning {
    background-color: #fff4e0;
    color: #8a5c00;
    border-color: #ffe3a3;
}

.message-error {
    background-color: #fdeaea;
    color: #b91c1c;
    border-color: #f3c5c5;
}

.message-info {
    background-color: #eef3ff;
    color: #003366;
    border-color: #dbe8fb;
}

/* ==========================================================================
   Encabezado de la sección de unidades (botón agregar)
   ========================================================================== */

.unidades-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.unidades-section-header h3 {
    margin: 0;
}