:root {
    --primary: #4a90e2;
    --primary-dark: #357abd;
    --secondary: #6c757d;
    --bg: #f4f7f6;
    --white: #ffffff;
    --danger: #e74c3c;
    --success: #2ecc71;
    --border: #ddd;
}

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

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Cabecera Superior (Logo y Volver) */
.main-header {
    background: var(--white);
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}


.logo {
    width: 163px;
    height: 42px;
    display: block;
    object-fit: contain;
}

.btn-back {
    text-decoration: none;
    color: var(--secondary);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-back:hover {
    background: #f8f9fa;
    color: var(--primary);
    border-color: var(--primary);
}

/* Sección de Título y Botones de la App */
.app-title-section {
    background: var(--primary);
    color: white;
    padding: 20px 0;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

main {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
}

@media (max-width: 768px) {
    main { grid-template-columns: 1fr; }
    
    .header-content, .title-bar {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .title-bar .actions {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .title-bar .actions button {
        width: 100%;
    }
}

.card {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

h2 { margin-bottom: 15px; font-size: 1.4rem; }

form input, form textarea, form select {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.btn-primary, .btn-secondary, .btn-block {
    cursor: pointer;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    font-weight: bold;
    transition: background 0.2s;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--secondary); color: white; }
.btn-block { width: 100%; background: var(--primary); color: white; }

.guest-rules {
    padding: 10px;
    background: #f9f9f9;
    border: 1px dashed #ccc;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.guest-container {
    margin-top: 20px;
    min-height: 200px;
    border: 2px dashed #ccc;
    padding: 10px;
}

.guest-item {
    background: white;
    padding: 10px;
    margin-bottom: 8px;
    border-left: 5px solid var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: grab;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.guest-item:active { cursor: grabbing; }

.guest-info h4 { margin: 0; font-size: 1rem; }
.guest-info span { font-size: 0.8rem; color: #666; }

.guest-actions button {
    background: transparent;
    border: none;
    color: var(--secondary);
    margin-left: 5px;
    cursor: pointer;
}

.guest-actions .btn-delete:hover { color: var(--danger); }

/* Grid de mesas */
.table-controls { margin-bottom: 20px; display: flex; align-items: center; gap: 20px; }
.table-controls form { display: flex; gap: 10px; flex-grow: 1; }
.table-controls input { margin-bottom: 0; }

.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.table-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-top: 4px solid var(--secondary);
    min-height: 150px;
}

.table-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.table-header h3 { font-size: 1.1rem; }

.capacity-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
}

.capacity-full { background: #fee2e2; color: #991b1b; }
.capacity-ok { background: #dcfce7; color: #166534; }

.table-slots {
    min-height: 100px;
    background: #fdfdfd;
    border: 1px dashed #eee;
    padding: 5px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 500px;
    margin: 100px auto;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
}

.share-url-container {
    display: flex;
    margin: 20px 0;
    gap: 10px;
}

.share-url-container input { flex-grow: 1; margin: 0; }

.btn-close {
    background: transparent;
    border: 1px solid #ccc;
    padding: 5px 15px;
    border-radius: 4px;
    cursor: pointer;
}
