:root {
    --bg-color: #F7F8FA;
    /* Light clean gray */
    --surface-color: #FFFFFF;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --border-color: #E5E7EB;

    --brand-color: #9C8E7D;
    /* Taupe / Warm Beige matching the wedding */
    --brand-hover: #8A7A68;

    --status-confirmed: #10B981;
    /* Emerald Green */
    --status-pending: #F59E0B;
    /* Amber */
    --status-declined: #EF4444;
    /* Red */

    --font-heading: 'Cormorant Garamond', serif;
    --font-body: 'Montserrat', sans-serif;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-card: 0 10px 15px -3px rgba(0, 0, 0, 0.03);
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
}

h1,
h2,
h3 {
    font-family: var(--font-heading);
    color: var(--text-primary);
}

/* Layout */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--surface-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-header {
    text-align: center;
    margin-bottom: 3rem;
}

.sidebar-header h2 {
    font-size: 2rem;
    line-height: 1.2;
}

.sidebar-header span {
    color: var(--brand-color);
    font-size: 1.5rem;
}

.nav-links {
    list-style: none;
    flex-grow: 1;
}

.nav-links li {
    margin-bottom: 0.5rem;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-links a:hover,
.nav-links li.active a {
    background-color: #f3f4f6;
    color: var(--brand-color);
}

.sidebar-footer {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Main Content */
.main-content {
    flex-grow: 1;
    padding: 2.5rem 3rem;
    max-width: 1400px;
}

/* Header */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.nav-title h1 {
    font-size: 2.5rem;
    margin-bottom: 0.2rem;
}

.nav-title p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: var(--brand-color);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
    letter-spacing: 1px;
    box-shadow: var(--shadow-md);
}

/* KPIs */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.kpi-card {
    background-color: var(--surface-color);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-3px);
}

.kpi-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
}

.kpi-icon.total {
    background: #E5E7EB;
    color: #4B5563;
}

.kpi-icon.confirmed {
    background: #D1FAE5;
    color: var(--status-confirmed);
}

.kpi-icon.pending {
    background: #FEF3C7;
    color: var(--status-pending);
}

.kpi-icon.declined {
    background: #FEE2E2;
    color: var(--status-declined);
}

.kpi-data h3 {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.kpi-data p {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Charts */
.charts-section {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.chart-card {
    background-color: var(--surface-color);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
}

.chart-card h3 {
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.canvas-container {
    position: relative;
    width: 100%;
}

.donut-container {
    height: 260px;
}

.bar-container {
    height: 260px;
}

/* Table */
.table-section {
    background-color: var(--surface-color);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.table-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.table-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-box input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    outline: none;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: var(--brand-color);
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    background-color: #F9FAFB;
    padding: 1rem 1.5rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    font-weight: 600;
}

td {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    vertical-align: middle;
}

.guest-name {
    font-weight: 500;
    color: var(--text-primary);
}

.guest-id {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-badge.confirmado {
    background-color: #D1FAE5;
    color: var(--status-confirmed);
}

.status-badge.pendiente {
    background-color: #FEF3C7;
    color: var(--status-pending);
}

.status-badge.declinado {
    background-color: #FEE2E2;
    color: var(--status-declined);
}

/* Actions */
.actions-cell {
    display: flex;
    gap: 0.5rem;
}

.btn-action {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.1rem;
}

.btn-copy {
    background-color: #F3F4F6;
    color: var(--text-primary);
}

.btn-copy:hover {
    background-color: #E5E7EB;
}

.btn-whatsapp {
    background-color: #D1FAE5;
    color: #059669;
    /* Verde Whatsapp */
}

.btn-whatsapp:hover {
    background-color: #A7F3D0;
}

/* Toast */
.toast {
    position: fixed;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: #111827;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: bottom 0.3s ease;
    z-index: 1000;
}

.toast.show {
    bottom: 30px;
}

/* Responsive UI */
@media (max-width: 1024px) {
    .charts-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        padding: 1rem;
        /* Cambiamos a column para que el logo quede arriba y los botones abajo */
        flex-direction: column;
        align-items: center;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        position: static;
        gap: 1rem;
        /* Espacio entre logo y menú */
    }

    .sidebar-header {
        margin-bottom: 0;
        text-align: center;
        /* Centramos el logo en móvil */
    }

    .sidebar-header h2 {
        font-size: 1.5rem;
    }

    /* ¡AQUÍ ESTÁ LA MAGIA! Mostramos el menú en forma de botones horizontales */
    .nav-links {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        width: 100%;
    }

    .nav-links li {
        margin-bottom: 0;
    }

    .nav-links a {
        padding: 0.5rem 0.8rem;
        font-size: 0.9rem;
    }

    /* Mantenemos el footer oculto para ahorrar espacio en la pantalla */
    .sidebar-footer {
        display: none;
    }

    .main-content {
        padding: 1.5rem;
    }

    .table-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-box {
        width: 100%;
    }

    .grid-2-col {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* =========================================
   Sistema de Pestañas (Tabs)
   ========================================= */
.tab-view {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   Formulario: Datos del Evento
   ========================================= */
.form-section {
    background-color: var(--surface-color);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    padding: 1.8rem;
    margin-bottom: 1.5rem;
}

.form-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--brand-color);
}

.sub-heading {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    margin: 1.5rem 0 1rem 0;
    color: var(--text-primary);
}

.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-primary);
    background-color: #F9FAFB;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--brand-color);
    background-color: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(156, 142, 125, 0.1);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-bottom: 2rem;
}

.btn-save {
    background-color: var(--brand-color);
    color: white;
    border: none;
    padding: 0.9rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-body);
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-save:hover {
    background-color: var(--brand-hover);
}

/* Responsividad extra para el formulario */
@media (max-width: 768px) {
    .grid-2-col {
        grid-template-columns: 1fr;
        /* Colapsa a 1 columna en móviles */
        gap: 1rem;
}
}

/* =========================================
   Modal (Agregar Invitado)
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}
.modal-overlay.show {
    display: flex;
}
.modal-content {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-card);
    animation: fadeIn 0.3s ease;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}
.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}
.btn-cancel {
    background-color: #F3F4F6;
    color: var(--text-primary);
    border: none;
    padding: 0.9rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-body);
    transition: background-color 0.2s;
}
.btn-cancel:hover {
    background-color: #E5E7EB;
}
.btn-primary {
    background-color: var(--brand-color);
    color: white;
    border: none;
    padding: 0.75rem 1.2rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-body);
    transition: background-color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-primary:hover {
    background-color: var(--brand-hover);
}

.table-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

/* =========================================
   Plano del Salón
   ========================================= */
.plano-layout {
    display: flex;
    gap: 1.5rem;
    height: calc(100vh - 150px);
    background-color: var(--surface-color);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.plano-sidebar {
    width: 300px;
    background-color: #F9FAFB;
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
}

.plano-sidebar h3 {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.sidebar-header-mobile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.2rem;
}

.mobile-tools-fab {
    display: none;
}

.btn-close-sidebar {
    display: none;
}

.tool-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.kpi-mini {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kpi-mini span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.kpi-mini strong {
    font-size: 1.25rem;
    color: var(--brand-color);
}

.tool-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.tool-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-body);
}

.btn-tool {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    font-family: var(--font-body);
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.btn-tool:hover {
    border-color: var(--brand-color);
    color: var(--brand-color);
    background-color: #FDFDFD;
}

/* =========================================
   Variantes de botones del Plano
   ========================================= */
.btn-guardar-plano {
    width: 100%;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.btn-tool--danger {
    border-color: #EF4444;
    color: #EF4444;
    width: 100%;
    justify-content: center;
    margin-bottom: 1rem;
}

.btn-tool--danger:hover {
    background-color: #FEF2F2;
    border-color: #DC2626;
    color: #DC2626;
}

.btn-tool--accent {
    border-color: #6366f1;
    color: #6366f1;
    width: 100%;
    justify-content: center;
    margin-bottom: 1rem;
}

.btn-tool--accent:hover {
    background-color: #EEF2FF;
    border-color: #4F46E5;
    color: #4F46E5;
}

.lienzo-wrapper {
    flex-grow: 1;
    overflow: auto;
    position: relative;
    background-color: #E5E7EB;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem;
}

.zoom-controls {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    padding: 0.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    z-index: 1050;
}

.btn-zoom {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
}

.btn-zoom:hover {
    background: var(--brand-color);
    color: white;
    border-color: var(--brand-color);
}

#zoom-level {
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 45px;
    text-align: center;
    color: var(--text-primary);
}

.lienzo-container {
    width: 1056px; /* Tamaño carta horizontal (11in x 8.5in) */
    min-width: 1056px;
    min-height: 816px;
    flex-shrink: 0;
    position: relative;
    background-color: var(--surface-color);
    background-size: 40px 40px;
    background-image:
        linear-gradient(to right, #e5e7eb 1px, transparent 1px),
        linear-gradient(to bottom, #e5e7eb 1px, transparent 1px);
    padding: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
    align-items: flex-start;
    align-content: flex-start;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transform-origin: top center;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* SVG Table Styles */
.svg-mesa {
    cursor: pointer;
    transition: transform 0.2s;
}

.svg-mesa:hover {
    transform: scale(1.05);
}

.mesa-shape {
    fill: #F3F4F6;
    stroke: #D1D5DB;
    stroke-width: 2;
    transition: fill 0.3s;
}

.mesa-shape.full {
    fill: var(--brand-color);
    stroke: var(--brand-hover);
}

.mesa-tablon .mesa-shape {
    fill: #EFEFEF; /* Ligeramente distinto */
    stroke: #9CA3AF;
    stroke-width: 3;
}

.silla-shape {
    fill: #E5E7EB;
    stroke: #9CA3AF;
    stroke-width: 1.5;
    transition: fill 0.2s, transform 0.2s;
    cursor: pointer;
}

.silla-shape.occupied {
    fill: var(--brand-color);
    stroke: var(--brand-hover);
    opacity: 1;
}

.silla-shape.selected-seat {
    fill: #3B82F6;
    stroke: #2563EB;
}

/* Elevación sutil al interactuar para elegir */
.silla-shape:hover:not(.occupied) {
    fill: #D1D5DB;
}

.mesa-text {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    fill: var(--text-primary);
    text-anchor: middle;
    pointer-events: none;
}

.mesa-text.full-text {
    fill: white;
    font-size: 12px;
}

/* =========================================
   Drag & Drop y Amenidades
   ========================================= */
.draggable-item {
    position: absolute;
    cursor: move;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    /* remove transition on transform to avoid lag during drag */
    transition: none;
    pointer-events: none; /* Permitir click-through en el padding transparente */
}

/* Restaurar interacciones solo en elementos visuales */
.draggable-item > svg, 
.draggable-item .controls-container .action-btn, 
.draggable-item .controls-container .resize-handle-se {
    pointer-events: auto;
}

.draggable-item:hover {
    transform: scale(1.02);
}

.draggable-item.is-dragging {
    opacity: 0.7;
    z-index: 1000;
    transform: scale(1.05); /* Slight lift effect */
}

/* Mesa de Novios */
.amenity-sweetheart .mesa-shape {
    fill: #FFFBEB;
    stroke: #D97706; /* Dorado */
    stroke-width: 3;
    filter: drop-shadow(0 0 4px rgba(217, 119, 6, 0.4));
}

/* Pista de Baile */
.amenity-dancefloor .mesa-shape {
    fill: #F9FAFB;
    stroke: #9CA3AF;
    stroke-width: 2;
}
/* Patrón simulando cuadrícula en la pista */
.amenity-dancefloor rect.mesa-shape {
    fill: url(#dancefloor-pattern);
}

/* Escenario */
.amenity-stage .mesa-shape {
    fill: #1F2937;
    stroke: #111827;
}
.amenity-stage .mesa-text {
    fill: #FFFFFF;
}

/* Baños y Salidas */
.amenity-restrooms .mesa-shape,
.amenity-exits .mesa-shape {
    fill: #E5E7EB;
    stroke: #9CA3AF;
}

/* =========================================
   Controles Interactivos y Toast Persistencia
   ========================================= */

.toast-save {
    background: rgba(156, 142, 125, 0.9);
    font-family: var(--font-body);
    font-size: 1rem;
    backdrop-filter: blur(5px);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

.controls-container {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    /* border: 1px dashed var(--brand-color); Eliminado para evitar recuadros excesivamente grandes */
}

.draggable-item:hover .controls-container,
.draggable-item.is-selected .controls-container {
    opacity: 1;
}

.resize-handle-se {
    position: absolute;
    bottom: -6px; right: -6px;
    width: 14px; height: 14px;
    background: var(--brand-color);
    border-radius: 50%;
    cursor: se-resize;
    pointer-events: all;
    z-index: 10;
    border: 2px solid white;
}

.action-btn {
    position: absolute;
    width: 24px; height: 24px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 12px;
    cursor: pointer;
    pointer-events: all;
    z-index: 10;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.rotate-btn {
    top: -12px; left: 50%;
    transform: translateX(-50%);
    background: #3B82F6;
}

.delete-btn {
    top: -12px; right: -12px;
    background: #EF4444;
}

/* =========================================
   Sistema de Bloqueo del Plano
   ========================================= */
.canvas-locked .draggable-item {
    cursor: default;
}
.canvas-locked .draggable-item:hover {
    transform: none; /* remove hover scale effect */
}
/* =========================================
   PDF Export Overrides & HTML2PDF Resets
   ========================================= */

.is-exporting {
    background: #ffffff !important;
    color: #1a1a1a !important;
}

.is-exporting body, .is-exporting html, .is-exporting #lienzo-comensales {
    background: #ffffff !important;
    background-image: none !important;
    color: #1a1a1a !important;
}

.is-exporting .lienzo-wrapper {
    overflow: visible !important;
    padding: 0 !important;
    height: auto !important;
    min-height: auto !important;
    background: none !important;
}

.is-exporting .lienzo-container {
    width: 100% !important; /* Para que ocupe todo al exportar */
    height: auto !important;
    min-height: auto !important;
    border: none !important;
    overflow: visible !important;
    transform: scale(1) !important;
    box-shadow: none !important;
}

/* Forzar que el lienzo de mesas ocupe máximo una página */
.is-exporting #pdf-header {
    display: block !important;
    color: #000 !important;
}

.is-exporting #pdf-guest-list {
    display: block !important;
    page-break-before: always; /* Obliga a html2pdf a mandar esta sección a la Pagina 2 */
    margin-top: 50px;
    padding-top: 20px;
    color: #1a1a1a !important;
}

.pdf-mesa-block {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #e5e7eb;
}

.pdf-mesa-block strong {
    color: var(--brand-color);
    font-size: 16px;
}

/* =========================================
   Sistema de Exportación PDF
   ========================================= */

.is-exporting .plano-sidebar {
    display: none !important;
}

.is-exporting .plano-layout {
    flex-direction: column !important;
}

.is-exporting #pdf-header,
.is-exporting #pdf-guest-list {
    display: block !important;
}

.is-exporting .controls-container,
.is-exporting .resize-handle-se,
.is-exporting .btn-close,
.is-exporting .action-btn {
    display: none !important;
}

.is-exporting .lienzo-container {
    background-image: none !important;
    background-color: white !important;
}

.pdf-guest-list {
    width: 100%;
    padding: 2rem;
    background: white;
    page-break-before: always;
}

.pdf-guest-list h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 24px;
    margin-bottom: 20px;
    border-bottom: 1px solid #CCC;
    padding-bottom: 5px;
}

.pdf-mesa-block {
    margin-bottom: 15px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
}

.pdf-mesa-block strong {
    color: var(--brand-color);
    font-size: 16px;
}

/* =========================================
   Seat Selection Mode (Cinepolis)
   ========================================= */

.seat-selection-bar {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(150%);
    background: #111827;
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 1000;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    font-family: 'Montserrat', sans-serif;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.seat-selection-bar.show {
    transform: translateX(-50%) translateY(0);
}

#btn-save-seats:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #6B7280;
}

.btn-cancel-bar {
    background: transparent;
    color: #F87171;
    border: none;
    font-family: var(--font-body);
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    padding: 8px 12px;
}

.btn-cancel-bar:hover {
    text-decoration: underline;
}

/* Modal Family Unseat List */
.assigned-families-list {
    padding: 0;
    margin: 0;
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
}

.assigned-family-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #F9FAFB;
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.assigned-family-item small {
    color: var(--text-secondary);
}

.btn-remove-tiny {
    background: transparent;
    color: #EF4444;
    border: 1px solid #EF4444;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-remove-tiny:hover {
    background: #EF4444;
    color: white;
}

/* =========================================
   Mobile Responsiveness (Plano)
   ========================================= */
@media (max-width: 768px) {
    .plano-layout {
        flex-direction: column;
        height: calc(100vh - 120px);
        overflow: hidden;
        border-radius: 8px;
    }
    
    .mobile-tools-fab {
        display: flex;
        position: fixed;
        bottom: 2rem;
        right: 1.5rem;
        background-color: var(--brand-color);
        color: white;
        border: none;
        padding: 1rem 1.5rem;
        border-radius: 50px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.3);
        z-index: 1000;
        font-family: var(--font-body);
        font-weight: 600;
        gap: 0.5rem;
        align-items: center;
        cursor: pointer;
        transition: transform 0.2s;
    }
    
    .mobile-tools-fab:active {
        transform: scale(0.95);
    }
    
    .btn-close-sidebar {
        display: flex;
        background: transparent;
        border: none;
        font-size: 1.5rem;
        color: var(--text-primary);
        cursor: pointer;
    }
    
    .plano-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 350px;
        height: 100vh;
        z-index: 1001;
        border-right: 1px solid var(--border-color);
        box-shadow: 5px 0 20px rgba(0,0,0,0.3);
        padding: 1.5rem;
        overflow-y: auto;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        gap: 1.2rem;
    }
    
    .plano-sidebar.show {
        left: 0;
    }
    
    .lienzo-wrapper {
        padding: 0.5rem;
    }
    
    .zoom-controls {
        bottom: 1.5rem;
        top: auto;
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        position: fixed;
    }
    
    .lienzo-container {
        /* Permite que crezca hacia los lados si no cabe, 
           pero con transform origen en left top en móviles para no cortar de la izquierda */
        transform-origin: top left;
    }
}

/* =========================================
   Mejoras Mobile — Demo Comercial
   ========================================= */

/* Botones de acción en tabla: área táctil mínima 44x44 */
@media (max-width: 768px) {
    .btn-action {
        width: 44px;
        height: 44px;
    }
}

/* Ocultar FAB cuando la barra de selección de asientos está activa */
@media (max-width: 768px) {
    body.seat-selection-active .mobile-tools-fab {
        display: none;
    }
}

/* Labels en formularios: más legibles sin mayúsculas forzadas en móvil */
@media (max-width: 768px) {
    .form-group label {
        text-transform: none;
        font-size: 0.9rem;
        letter-spacing: 0;
    }
}

/* KPI cards: 2 columnas para evitar compresión en pantallas pequeñas */
@media (max-width: 768px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}