/* Catalog4All - Panel Administrativo */
/* Reset y Variables */
:root {
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --secondary-color: #764ba2;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-dark: #1e293b;
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    
    --border-color: #e2e8f0;
    /* Sombras modernas con tinte slate en vez de negro puro */
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 12px 24px -6px rgba(15, 23, 42, 0.12), 0 4px 8px -4px rgba(15, 23, 42, 0.08);
    
    --sidebar-width: 260px;
    --topbar-height: 70px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ==================== AUTENTICACIÓN ==================== */
.auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.auth-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    width: 100%;
    max-width: 450px;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-logo {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo i {
    font-size: 50px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.auth-logo h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.auth-logo p {
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--border-color);
}

.auth-tab {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: -2px;
}

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

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

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.form-group label i {
    margin-right: 5px;
    color: var(--primary-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 15px;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Grupos de opciones del platillo — no heredar width:100% del form-group padre */
#optionGroupsContainer .option-group-block .og-settings-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    margin-bottom: 10px;
}

#optionGroupsContainer .option-group-block .og-settings-row .checkbox-label {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    margin-bottom: 0 !important;
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    flex: 0 0 auto;
    width: auto;
}

#optionGroupsContainer .option-group-block .og-settings-row .checkbox-label input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    padding: 0 !important;
    margin: 0 !important;
    flex: 0 0 18px;
    cursor: pointer;
}

#optionGroupsContainer .option-group-block .og-min-max {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}

#optionGroupsContainer .option-group-block .og-min-max label {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    margin-bottom: 0 !important;
    font-weight: 500;
    white-space: nowrap;
    width: auto;
}

#optionGroupsContainer .option-group-block .og-min-max select {
    width: 64px !important;
    min-width: 64px;
    max-width: 64px;
    padding: 6px 8px !important;
    text-align: center;
    flex: 0 0 64px;
}

/* Alias para compatibilidad */
.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 15px;
    transition: var(--transition);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.auth-note {
    text-align: center;
    margin-top: 15px;
    color: var(--text-secondary);
    font-size: 13px;
}

.auth-note i {
    color: var(--success-color);
}

.auth-link-row {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
}

.auth-link-row a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-link-row a:hover {
    text-decoration: underline;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* ==================== BOTONES ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

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

.btn-success:hover:not(:disabled) {
    background: #059669;
    transform: translateY(-2px);
}

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

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

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

.btn-info:hover:not(:disabled) {
    background: #2563eb;
}

.btn-secondary {
    background: var(--text-light);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: var(--text-secondary);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* ==================== PANEL ADMINISTRATIVO ==================== */
.admin-panel {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-dark);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header i {
    font-size: 28px;
    color: var(--primary-color);
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-link.active {
    background: rgba(102, 126, 234, 0.2);
    color: white;
    border-left-color: var(--primary-color);
}

.nav-link i {
    width: 20px;
    text-align: center;
    font-size: 18px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.btn-logout {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    cursor: pointer;
    transition: var(--transition);
}

.btn-logout:hover {
    background: #ef4444;
    color: white;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: var(--transition);
}

.top-bar {
    height: var(--topbar-height);
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: var(--bg-primary);
    font-size: 18px;
    cursor: pointer;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.tenant-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-primary);
    border-radius: 10px;
    font-weight: 500;
    color: var(--text-primary);
}

.tenant-info i {
    color: var(--primary-color);
}

.content-wrapper {
    padding: 30px;
}

/* ==================== PÁGINAS ==================== */
.page-content {
    display: none;
}

.page-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-header h1 i {
    color: var(--primary-color);
}

/* Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
}

.stat-details {
    flex: 1;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 5px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 14px;
}

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

.action-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.action-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.action-card i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.action-card h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.action-card p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 14px;
}

/* Productos */
.filters-bar {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    box-shadow: var(--shadow);
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 15px;
    color: var(--text-light);
}

.search-box input {
    width: 100%;
    padding: 12px 15px 12px 40px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 15px;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.filter-select {
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 15px;
    background: white;
    cursor: pointer;
    transition: var(--transition);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

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

.product-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--bg-primary);
}

.product-body {
    padding: 20px;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
}

.product-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.product-sku {
    font-size: 12px;
    color: var(--text-secondary);
}

.product-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-active {
    background: #d1fae5;
    color: #065f46;
}

.badge-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.product-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.product-actions {
    display: flex;
    gap: 10px;
}

.product-actions .btn {
    flex: 1;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 30px;
}

.pagination button {
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.pagination button:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination button.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 300px;
    padding: 15px 20px;
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-success {
    border-left: 4px solid var(--success-color);
}

.toast-error {
    border-left: 4px solid var(--danger-color);
}

.toast-info {
    border-left: 4px solid var(--info-color);
}

.toast i {
    font-size: 20px;
}

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

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

.toast-info i {
    color: var(--info-color);
}

.toast-message {
    flex: 1;
    font-size: 14px;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-btn {
        display: block;
    }
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .filters-bar {
        flex-direction: column;
    }
    
    .search-box {
        width: 100%;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .page-header .btn {
        width: 100%;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 64px;
    color: var(--text-light);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Tables */
.categories-table {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.categories-table table {
    width: 100%;
    border-collapse: collapse;
}

.categories-table thead {
    background: var(--bg-primary);
}

.categories-table th {
    padding: 15px 20px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.categories-table td {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.categories-table tbody tr:hover {
    background: var(--bg-primary);
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Promotions Grid */
.promotions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.promo-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
}

.promo-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.promo-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 8px 15px;
    border-radius: 8px;
    color: white;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    z-index: 1;
}

.promo-banner-thumb {
    width: 100%;
    aspect-ratio: 3 / 1;
    overflow: hidden;
    background: #f1f5f9;
}

.promo-banner-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.promo-body {
    padding: 25px;
}

.promo-body h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.promo-body p {
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 14px;
}

.promo-discount {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: 10px;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.promo-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 13px;
    color: var(--text-secondary);
}

.promo-products {
    margin-bottom: 15px;
    color: var(--text-secondary);
    font-size: 14px;
}

.promo-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
}

/* Settings */
.settings-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.settings-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: var(--shadow);
}

.settings-card h2 {
    font-size: 20px;
    margin-bottom: 25px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.settings-card h2 i {
    color: var(--primary-color);
}

/* Product Selection (for promotions) */
.products-selection {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.product-checkbox {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.product-checkbox:hover {
    border-color: var(--primary-color);
    background: var(--bg-primary);
}

.product-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 15px;
    cursor: pointer;
}

.product-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.product-info img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.product-info strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.product-info div {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ==================== MENÚS Y PLATILLOS ==================== */
/* Menús Grid */
.menus-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.menu-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.menu-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.2);
}

.menu-card-header {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.menu-card-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.menu-card:hover .menu-card-header img {
    transform: scale(1.1);
}

.menu-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.menu-card-placeholder i {
    font-size: 64px;
    color: var(--primary-color);
    opacity: 0.3;
}

.menu-card-badges {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-card-badges .badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.badge-featured {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

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

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

.menu-card-body {
    padding: 25px;
}

.menu-card-body h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.3;
}

.menu-card-description {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.menu-card-info {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-primary);
    border-radius: 10px;
}

.menu-card-info span {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.menu-card-info i {
    color: var(--primary-color);
    font-size: 16px;
}

.menu-card-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.menu-card-actions .btn {
    padding: 10px;
    font-size: 13px;
}

/* Dishes Grid (Admin) */
.dishes-grid-admin {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.dish-card-admin {
    background: white;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
}

.dish-card-admin:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.18);
}

.dish-card-image {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.dish-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.dish-card-admin:hover .dish-card-image img {
    transform: scale(1.12);
}

.dish-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

.dish-placeholder i {
    font-size: 56px;
    color: var(--text-light);
}

.dish-badge-signature {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.4);
    display: flex;
    align-items: center;
    gap: 5px;
}

.dish-card-content {
    padding: 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.dish-card-content h4 {
    font-size: 19px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.4;
}

.dish-description {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.dish-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: 10px;
}

.dish-price {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-color);
}

.dish-category {
    padding: 5px 12px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color);
}

.dish-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 15px;
}

.dish-badges .badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.dish-badges .badge-success {
    background: #d1fae5;
    color: #065f46;
}

.dish-badges .badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.dish-badges .badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.dish-card-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.dish-card-actions .btn {
    flex: 1;
    padding: 10px;
    font-size: 13px;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.section-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h2 i {
    color: var(--primary-color);
}

/* Page Header Actions */
.page-header-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Mejoras visuales adicionales */
.btn i {
    font-size: 14px;
}

.btn-sm i {
    font-size: 12px;
}

/* Loading State */
.card-loading {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 15px;
}

.card-loading .loading-spinner {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

/* Responsive para menús y platillos */
@media (max-width: 768px) {
    .menus-grid,
    .dishes-grid-admin {
        grid-template-columns: 1fr;
    }
    
    .menu-card-actions {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .page-header-actions {
        width: 100%;
    }
    
    .page-header-actions .btn {
        flex: 1;
    }
}

/* ==================== MODALES ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.modal-dialog {
    background: white;
    border-radius: 15px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

.modal-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: none;
    background: var(--bg-primary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--danger-color);
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    padding: 25px;
}

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Vista unificada Mi menú / Mi catálogo */
.menu-page-header {
    margin-bottom: 0;
}

.menu-status-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-radius: 14px;
    color: #e2e8f0;
}

.menu-status-url {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    min-width: 0;
    flex: 1;
}

.menu-status-url span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menu-status-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #e2e8f0;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
}

.menu-section {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    overflow: hidden;
}

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

.menu-section-header h2 {
    margin: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-section-body {
    padding: 20px;
    min-height: 120px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.menu-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.menu-empty-state.compact {
    padding: 28px 16px;
}

.menu-empty-state i {
    font-size: 2rem;
    opacity: 0.35;
    margin-bottom: 12px;
    display: block;
}

.menu-empty-state p {
    margin: 0;
}

.menu-category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
}

.menu-category-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: var(--text-primary);
    flex-shrink: 0;
    max-width: 100%;
}

.menu-category-chip.is-child {
    margin-left: calc(var(--chip-depth, 1) * 18px);
    border-style: dashed;
    background: rgba(102, 126, 234, 0.03);
}

.menu-category-chip .chip-indent {
    color: var(--text-secondary);
    opacity: 0.55;
    font-size: 11px;
    flex-shrink: 0;
}

.menu-category-chip:hover {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
}

.menu-category-chip.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(118, 75, 162, 0.08) 100%);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.menu-category-chip .chip-count {
    background: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.menu-category-chip.active .chip-count {
    background: var(--primary-color);
    color: white;
}

.chip-actions {
    display: inline-flex;
    gap: 4px;
    margin-left: 4px;
    flex-shrink: 0;
}

.menu-category-chip .chip-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.chip-actions button {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.chip-actions button:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--primary-color);
}

.menu-products-toolbar {
    margin-bottom: 16px;
}

.menu-products-grid {
    margin-top: 0;
}

@media (max-width: 768px) {
    .menu-status-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .menu-status-actions {
        justify-content: stretch;
    }

    .menu-status-actions .btn {
        flex: 1;
        justify-content: center;
    }
}

/* Publicar menú + horarios admin */
.menu-status-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.menu-publish-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-publish-label {
    font-weight: 600;
    font-size: 14px;
}

.menu-status-bar.unpublished {
    background: linear-gradient(135deg, #451a03 0%, #7c2d12 100%);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(255,255,255,0.25);
    border-radius: 26px;
    transition: 0.2s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
    background: #22c55e;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

.business-hours-form .toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    cursor: pointer;
}

.hours-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hours-row {
    display: grid;
    grid-template-columns: 140px 1fr auto 1fr;
    gap: 10px;
    align-items: center;
}

.hours-day-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.hours-row input[type="time"] {
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

@media (max-width: 768px) {
    .hours-row {
        grid-template-columns: 1fr;
    }
}

/* ==================== ETIQUETAS PERSONALIZADAS ==================== */
.menu-section-subtitle {
    margin: 4px 0 0;
    font-size: 0.85rem;
    color: var(--text-muted, #64748b);
    max-width: 640px;
}

.dish-tags-manager-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.dish-tags-group {
    margin-bottom: 22px;
}
.dish-tags-group-title {
    margin: 0 0 10px;
    font-size: 0.95rem;
    color: #475569;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dish-tags-group-title::before {
    content: '';
    width: 4px;
    height: 16px;
    border-radius: 4px;
    background: #667eea;
}
.dish-tag-badge-sys {
    background: #eef2ff;
    color: #4338ca;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.72rem;
}

.dish-tag-card {
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #fff;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.dish-tag-card:hover {
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.dish-tag-card.is-inactive {
    opacity: 0.6;
    background: #f8fafc;
}

.dish-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    width: fit-content;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dish-tag-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
}

.dish-tag-badge-off {
    background: #e2e8f0;
    color: #475569;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
}

.dish-tag-card-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.btn-danger-outline {
    background: transparent;
    border: 1px solid #ef4444;
    color: #ef4444;
}
.btn-danger-outline:hover {
    background: #ef4444;
    color: #fff;
}

/* Selector de color / ícono en el modal */
.dish-tag-color-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.dish-tag-color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
}
.dish-tag-color-swatch.selected {
    border-color: #0f172a;
    box-shadow: 0 0 0 2px #fff inset;
}
.dish-tag-color-picker input[type="color"] {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    cursor: pointer;
}

.dish-tag-icon-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
    gap: 6px;
    margin-top: 10px;
    max-height: 150px;
    overflow-y: auto;
    padding: 4px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
}
.dish-tag-icon-option {
    aspect-ratio: 1;
    border: 1px solid transparent;
    border-radius: 8px;
    background: #f8fafc;
    cursor: pointer;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dish-tag-icon-option:hover {
    background: #eef2ff;
}
.dish-tag-icon-option.selected {
    border-color: #667eea;
    background: #eef2ff;
    color: #667eea;
}

.dish-tag-preview-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 10px;
}
.dish-tag-preview-label {
    font-size: 0.85rem;
    color: var(--text-muted, #64748b);
    font-weight: 600;
}

/* Sección "Mis etiquetas" dentro del modal de platillo */
.dish-custom-tags-panel {
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px dashed var(--border-color, #e2e8f0);
}
.dish-custom-tags-panel .dish-tags-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    color: #667eea;
}
.dish-custom-tags-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
    margin-top: 10px;
}
.dish-custom-tags-empty {
    font-size: 0.85rem;
    color: var(--text-muted, #64748b);
    background: #f8fafc;
    padding: 10px 12px;
    border-radius: 8px;
    margin-top: 8px;
}
.dish-custom-tags-empty a {
    color: #667eea;
    font-weight: 600;
    cursor: pointer;
}

/* ========================================
   PROMOCIONES: TABS Y BANNERS
======================================== */
.promo-tabs {
    display: flex;
    gap: 6px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.promo-tab {
    background: none;
    border: none;
    padding: 12px 18px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
}

.promo-tab:hover {
    color: #4f46e5;
}

.promo-tab.active {
    color: #4f46e5;
    border-bottom-color: #4f46e5;
}

.promo-tab-panel {
    display: none;
}

.promo-tab-panel.active {
    display: block;
}

.promo-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.promo-panel-header p {
    margin: 0;
}

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

.banner-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
}

.banner-card-image {
    position: relative;
    aspect-ratio: 3 / 1;
    background: #f1f5f9;
}

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

.banner-card-image .badge {
    position: absolute;
    top: 8px;
    right: 8px;
}

.banner-card-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.banner-card-body h3 {
    margin: 0;
    font-size: 1.05rem;
}

.banner-card-body p {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
}

.banner-card-meta {
    font-size: 0.85rem;
    color: #64748b;
}

.banner-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
