/* Variables */
:root {
    --color-primary: #b8860b;
    --color-primary-dark: #8b6508;
    --color-danger: #dc3545;
    --color-success: #28a745;
    --color-warning: #ffc107;
    --color-bg: #f5f5f5;
    --color-card: #ffffff;
    --color-border: #e0e0e0;
    --color-text: #333333;
    --color-text-muted: #666666;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --radius: 8px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
}

/* Utilities */
.hidden { display: none !important; }
.text-muted { color: var(--color-text-muted); font-size: 0.875rem; }

/* Loading Screen */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Login Screen */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-box {
    text-align: center;
    padding: 48px;
    background: var(--color-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.login-box h1 {
    margin-bottom: 8px;
    color: var(--color-primary);
}

.login-box p {
    margin-bottom: 24px;
    color: var(--color-text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--color-primary-dark);
}

.btn-secondary {
    background: white;
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

.btn-secondary:hover {
    background: var(--color-bg);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-muted);
}

.btn-ghost:hover {
    color: var(--color-text);
}

.btn-danger {
    background: var(--color-danger);
    color: white;
}

.btn-danger:hover {
    opacity: 0.9;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: white;
    border-bottom: 1px solid var(--color-border);
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-email {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    padding: 16px 24px 0;
    background: white;
    border-bottom: 1px solid var(--color-border);
}

.tab {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.tab:hover {
    color: var(--color-text);
}

.tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* Sub Tabs */
.sub-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.sub-tab {
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.sub-tab:hover {
    background: var(--color-bg);
}

.sub-tab.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

/* Main Content */
.main-content {
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}

.section-header h2 {
    font-size: 1.5rem;
    flex: 1;
}

/* Restaurantes Grid */
.restaurantes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.restaurante-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.restaurante-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

.restaurante-card h3 {
    margin-bottom: 8px;
}

.restaurante-card .meta {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* Card */
.card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.card h3 {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
}

.card h4 {
    margin: 20px 0 12px;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
}

.card-header h3 {
    margin: 0;
    padding: 0;
    border: none;
}

/* Form */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.875rem;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-actions {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

/* Color Input */
.color-input {
    display: flex;
    gap: 8px;
}

.color-input input[type="color"] {
    width: 48px;
    height: 38px;
    padding: 2px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    cursor: pointer;
}

.color-input input[type="text"] {
    flex: 1;
}

/* Radio Group */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

/* File Upload */
.file-upload {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-upload img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
}

/* Fondo Options */
.fondo-options {
    margin-top: 16px;
    padding: 16px;
    background: var(--color-bg);
    border-radius: var(--radius);
}

/* Menus List */
.menus-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--color-bg);
    border-radius: var(--radius);
    transition: all 0.2s;
}

.menu-item:hover {
    background: #eee;
}

.menu-item .drag-handle {
    cursor: grab;
    color: var(--color-text-muted);
    font-size: 1.2rem;
}

.menu-item .icon {
    font-size: 1.5rem;
}

.menu-item .info {
    flex: 1;
}

.menu-item .nombre {
    font-weight: 500;
}

.menu-item .archivo {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.menu-item .badges {
    display: flex;
    gap: 6px;
}

.badge {
    padding: 2px 8px;
    font-size: 0.7rem;
    border-radius: 10px;
    font-weight: 500;
}

.badge-destacado {
    background: #ffeeba;
    color: #856404;
}

.badge-procesando {
    background: #cce5ff;
    color: #004085;
}

.badge-error {
    background: #f8d7da;
    color: #721c24;
}

.badge-inactivo {
    background: #e2e3e5;
    color: #383d41;
}

.menu-item .actions {
    display: flex;
    gap: 8px;
}

.menu-item .toggle {
    width: 44px;
    height: 24px;
    background: #ccc;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
}

.menu-item .toggle.active {
    background: var(--color-success);
}

.menu-item .toggle::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
}

.menu-item .toggle.active::after {
    transform: translateX(20px);
}

/* Table */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.table th {
    background: var(--color-bg);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.table td {
    font-size: 0.875rem;
}

.table tr:last-child td {
    border-bottom: none;
}

/* Tags List */
.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    font-size: 0.875rem;
}

.tag .delete {
    cursor: pointer;
    color: var(--color-danger);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px;
    color: var(--color-text-muted);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}

.modal {
    background: white;
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-text-muted);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--color-border);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: #333;
    color: white;
    border-radius: var(--radius);
    font-size: 0.875rem;
    z-index: 1001;
    animation: slideUp 0.3s ease;
}

.toast.success {
    background: var(--color-success);
}

.toast.error {
    background: var(--color-danger);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .header-right {
        flex-direction: column;
    }

    .tabs {
        overflow-x: auto;
    }

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

    .form-row {
        grid-template-columns: 1fr;
    }
}
