@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
    --luxury-gold: #c9a45d;
    --luxury-gold-dark: #a68549;
    --luxury-gold-light: #e0ca9e;
    --luxury-black: #050505;
    --luxury-bg: #0a0a0b;
    --card-bg: #141416;
    --text-main: #ffffff;
    --text-dim: #a0a0a0;
    --glass-bg: #141416;
    /* Eliminado transparencia/blur para velocidad */
    --glass-border: rgba(201, 164, 93, 0.15);
    --shadow-premium: 0 4px 15px rgba(0, 0, 0, 0.5);
    --radius-premium: 16px;
    --sidebar-bg: #050505;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    transition: none !important;
    /* ELIMINAR TODAS LAS TRANSICIONES */
    animation: none !important;
    /* ELIMINAR TODAS LAS ANIMACIONES */
}

body {
    background: var(--luxury-bg);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* === LAYOUT === */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* === SIDEBAR === */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: white;
    height: calc(100vh - 40px);
    margin: 20px;
    border-radius: var(--radius-premium);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    position: fixed;
    z-index: 1000;
    /* Aumentado para estar sobre todo */
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 50px;
    padding-left: 10px;
}

.sidebar-brand h2 {
    font-size: 1.5rem;
    letter-spacing: 1px;
    color: var(--luxury-gold);
}

.nav-menu {
    list-style: none;
    flex-grow: 1;
}

.nav-item {
    margin-bottom: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 18px;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    border-radius: 12px;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
}

.nav-link:hover {
    background: rgba(201, 164, 93, 0.1);
    color: var(--luxury-gold);
}

.nav-link.active {
    background: var(--luxury-gold);
    color: var(--luxury-black);
    font-weight: 600;
}

/* === MAIN CONTENT === */
.main-content {
    margin-left: 300px;
    flex-grow: 1;
    padding: 30px 40px;
    transition: margin-left 0.3s ease;
}

/* Modo Embebido (Odoo / Iframes) */
.is-embedded .main-content {
    margin-left: 0 !important;
    padding: 15px !important;
}

.is-embedded .sidebar,
.is-embedded .top-bar,
.is-embedded .mobile-nav-toggle {
    display: none !important;
}

/* Header para Modo Embebido */
.embedded-header {
    background: var(--card-bg);
    padding: 15px 25px;
    border-radius: 20px;
    margin-bottom: 25px;
    border: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* === TOP BAR === */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.page-info h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-main);
}

.page-info p {
    color: var(--text-dim);
    margin-top: 4px;
}

.user-profile {
    background: var(--card-bg);
    padding: 8px 16px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    flex-shrink: 0;
}

/* === SECTION HEADERS === */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
}

/* === PREMIUM CARDS === */
.premium-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 30px;
    margin-bottom: 30px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 25px;
}

.stat-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 20px;
    border-top: 2px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.3s ease !important;
    text-decoration: none;
    display: block;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-top-color: var(--luxury-gold);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.stat-card h3 {
    color: var(--text-dim);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.stat-card .value {
    font-size: 2.8rem;
    font-weight: 700;
    margin-top: 15px;
    color: var(--luxury-gold);
}

/* === PREMIUM TABLES === */
.table-responsive {
    width: 100%;
    margin-bottom: 20px;
    /* En desktop permitimos scroll si es necesario, en móvil lo transformamos */
}

.premium-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 12px;
}

.premium-table th {
    padding: 10px 20px;
    text-align: left;
    color: var(--text-dim);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.premium-table tr {
    background: var(--card-bg);
}

.premium-table td {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.premium-table td:first-child {
    border-left: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 16px 0 0 16px;
}

.premium-table td:last-child {
    border-right: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 0 16px 16px 0;
}

/* Transformación Radical a Bloques Estáticos en Móvil */
@media (max-width: 600px) {

    /* Forzar que NADA se salga de la pantalla */
    body,
    html {
        overflow-x: hidden !important;
        width: 100% !important;
    }

    .main-content {
        padding: 15px !important;
        overflow-x: hidden !important;
    }

    .table-responsive {
        overflow: hidden !important;
        /* Matamos el scroll lateral */
    }

    .premium-table,
    .premium-table thead,
    .premium-table tbody,
    .premium-table th,
    .premium-table td,
    .premium-table tr {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .premium-table thead {
        display: none !important;
    }

    .premium-table tr {
        margin-bottom: 25px;
        border: 1px solid var(--glass-border);
        border-radius: 20px !important;
        background: var(--card-bg);
        overflow: hidden;
    }

    .premium-table td {
        border: none !important;
        padding: 12px 20px !important;
        text-align: left !important;
    }

    .premium-table td:not(:last-child) {
        border-bottom: 1px solid rgba(255, 255, 255, 0.03) !important;
    }

    .premium-table td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.65rem;
        text-transform: uppercase;
        color: var(--luxury-gold);
        font-weight: 700;
        margin-bottom: 4px;
        opacity: 0.8;
    }

    .premium-table td[data-label="ACCIONES"]::before {
        display: none !important;
        /* Quitar label de acciones en móvil */
    }

    /* Acciones a la Izquierda en Móvil */
    .premium-table td[data-label="ACCIONES"] {
        background: rgba(255, 255, 255, 0.02);
        padding: 20px !important;
        display: flex !important;
        justify-content: flex-start !important;
        align-items: center !important;
    }

    .actions-group {
        justify-content: flex-start !important;
        width: 100% !important;
        gap: 20px !important;
    }
}

/* === ACTIONS BUTTONS === */
.actions-group {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-end;
}

.btn-action {
    background: rgba(201, 164, 93, 0.15);
    border: 1px solid var(--luxury-gold);
    color: var(--luxury-gold);
    width: 48px;
    /* Mas grandes para fácil toque */
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.2rem;
    text-decoration: none;
}

.btn-action:hover {
    background: var(--luxury-gold);
    color: var(--luxury-black);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(201, 164, 93, 0.4);
}

.btn-action.delete {
    color: #ff4d4d;
    background: rgba(255, 77, 77, 0.1);
    border-color: #ff4d4d;
}

.btn-action.delete:hover {
    background: #ff4d4d;
    color: white;
    border-color: #ff4d4d;
    box-shadow: 0 8px 20px rgba(255, 77, 77, 0.4);
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .sidebar {
        left: -320px;
        margin: 0;
        height: 100vh;
        border-radius: 0;
        z-index: 2100;
        transition: left 0.3s ease !important;
    }

    .sidebar.open {
        left: 0;
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
    }

    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        margin-top: 70px;
        /* Mas espacio para el boton menu */
        margin-bottom: 30px;
        padding-bottom: 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .page-info h1 {
        font-size: 1.8rem;
    }

    .mobile-nav-toggle {
        display: block !important;
        position: fixed;
        top: 20px;
        left: 20px;
        z-index: 2050;
        background: var(--luxury-gold);
        color: var(--luxury-black);
        border: none;
        padding: 10px 15px;
        border-radius: 8px;
        font-size: 1.2rem;
        cursor: pointer;
        box-shadow: 0 4px 15px rgba(201, 164, 93, 0.3);
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.7);
        z-index: 2000;
        backdrop-filter: blur(4px);
    }

    .sidebar-overlay.active {
        display: block;
    }

    /* Tablas responsivas */
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 20px;
    }

    .premium-table {
        min-width: 700px;
        /* Forzar scroll en lugar de colapso feo */
    }
}

@media (max-width: 600px) {
    .stat-grid {
        grid-template-columns: 1fr;
    }

    .luxury-modal {
        padding: 25px 20px;
        border-radius: 20px;
    }

    .btn-gold {
        padding: 12px 20px;
        width: 100%;
        justify-content: center;
    }

    .user-profile {
        width: 100%;
        justify-content: space-between;
    }

    .page-info h1 {
        font-size: 1.5rem;
    }

    .premium-card {
        padding: 20px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .section-header h3 {
        font-size: 1.4rem !important;
    }
}

.mobile-nav-toggle {
    display: none;
}

.property-thumb {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

/* === BUTTONS === */
.btn-gold {
    background: var(--luxury-gold);
    color: var(--luxury-black);
    padding: 14px 28px;
    border: none;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
}

.btn-gold:active {
    background: var(--luxury-gold-dark);
}

/* === FORMS === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.luxury-modal {
    background: #121214;
    border-radius: 28px;
    padding: 45px;
    max-width: 800px;
    width: 100%;
    border: 1px solid var(--glass-border);
    color: white;
    max-height: 90vh;
    overflow-y: auto;
}

.form-label {
    font-weight: 500;
    margin-bottom: 10px;
    display: block;
    color: var(--text-dim);
}

.form-control {
    width: 100%;
    padding: 16px 20px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #0a0a0b;
    color: white;
    font-size: 1rem;
}

.form-control:focus {
    border-color: var(--luxury-gold);
    background: #121214;
    outline: none;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 12px 16px;
    background: rgba(201, 164, 93, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(201, 164, 93, 0.1);
    transition: all 0.3s ease;
}

.form-check:hover {
    background: rgba(201, 164, 93, 0.1);
}

.form-check input {
    width: 20px;
    height: 20px;
    accent-color: var(--luxury-gold);
    cursor: pointer;
}

.featured-badge {
    background: linear-gradient(135deg, var(--luxury-gold), #e0b66a);
    color: var(--luxury-black);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 5px;
}

.form-control[readonly] {
    background: rgba(255, 255, 255, 0.05);
    color: white !important;
    cursor: default;
}

/* === UTILS === */
.hidden {
    display: none !important;
}

.badge {
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(201, 164, 93, 0.1);
    color: var(--luxury-gold);
    border: 1px solid var(--glass-border);
}

/* === COUNTER CONTROL === */
.counter-control {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: fit-content;
    overflow: hidden;
}

.counter-control button {
    background: var(--luxury-gold);
    color: var(--luxury-black);
    border: none;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.counter-control button:hover {
    background: #e0b66a;
    transform: scale(1.05);
}

.counter-control input {
    width: 50px;
    background: transparent;
    border: none;
    color: white !important;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    outline: none;
    padding: 0;
}

/* === FOOTER === */
.system-footer {
    padding: 30px;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 50px;
    width: 100%;
}

.system-footer a {
    color: var(--luxury-gold);
    text-decoration: none;
    font-weight: 600;
}

.system-footer a:hover {
    text-decoration: underline;
}