* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #f3f6fb;
    --surface: #ffffff;
    --surface-soft: #f8faff;
    --text: #0f172a;
    --muted: #5b6477;
    --line: #e2e8f0;
    --primary: #2563eb;
    --primary-strong: #1d4ed8;
    --success-bg: #dcfce7;
    --success-text: #166534;
    --warning-bg: #fef3c7;
    --warning-text: #92400e;
    --danger-bg: #fee2e2;
    --danger-text: #991b1b;
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: radial-gradient(circle at top left, #f8fbff, var(--bg) 45%);
    color: var(--text);
    min-height: 100vh;
}

.panel-container {
    max-width: 1240px;
    margin: 28px auto;
    padding: 0 18px 24px;
}

.panel-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #334155 100%);
    color: #fff;
    padding: 28px 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.panel-header h1 {
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.tabs-nav {
    margin-top: 14px;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tab-btn {
    flex: 1;
    min-width: 150px;
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.tab-btn:hover {
    background: #eef4ff;
    color: var(--primary-strong);
}

.tab-btn.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.28);
}

.tab-content {
    margin-top: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    min-height: 480px;
}

.tab-panel {
    display: none;
    padding: 28px;
    animation: panelIn 0.2s ease;
}

.tab-panel.active {
    display: block;
}

.panel-section h2,
.tab-panel h2 {
    color: var(--text);
    font-size: 1.4rem;
    margin-bottom: 22px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.tab-panel p,
.featured-desc,
.stat-desc {
    color: var(--muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface-soft);
    border: 1px solid #dbe7ff;
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-strong);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--muted);
    font-weight: 600;
}

.action-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.btn {
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.24);
}

.btn-primary:hover {
    background: var(--primary-strong);
}

.btn-secondary {
    background: #edf2f7;
    color: #334155;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.search-input,
.form-control {
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 0.95rem;
    background: #fff;
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input {
    min-width: 260px;
}

.search-input:focus,
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.data-table th,
.data-table td {
    padding: 13px 14px;
    text-align: left;
    border-bottom: 1px solid #e9eef6;
}

.data-table th {
    background: #f8fafc;
    color: #334155;
    font-size: 0.86rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: #f8fbff;
}

.btn-icon {
    background: #f1f5f9;
    border: 1px solid #dbe4ef;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    margin-right: 5px;
}

.btn-icon:hover {
    background: #e7eef8;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.76rem;
    font-weight: 700;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success-text);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.badge-primary {
    background: #dbeafe;
    color: #1d4ed8;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1e40af;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px;
    margin-top: 10px;
}

.product-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.product-card:hover {
    border-color: #bfdbfe;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.product-img {
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.product-card h4 {
    color: var(--text);
    margin-bottom: 6px;
}

.product-price,
.featured-price,
.stat-value {
    color: var(--primary-strong);
    font-weight: 700;
}

.product-price {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.featured-product {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 22px;
    margin-bottom: 28px;
}

.featured-img {
    font-size: 5rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 20px;
}

.featured-info h3 {
    color: var(--text);
    margin: 8px 0;
    font-size: 1.5rem;
}

.featured-price {
    font-size: 1.75rem;
    margin-bottom: 10px;
}

.featured-desc {
    max-width: 560px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.featured-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.featured-stat {
    min-width: 92px;
}

.stat-value {
    display: block;
    font-size: 1.25rem;
}

.stat-desc {
    font-size: 0.85rem;
}

.section-title {
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 14px;
}

.config-form {
    max-width: 560px;
    background: #fcfdff;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 18px;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-size: 0.9rem;
    color: #334155;
    font-weight: 600;
}

.usuarios-form-hidden {
    display: none;
    margin-bottom: 20px;
}

.usuarios-form-actions {
    margin-bottom: 0;
}

.flayer-form {
    margin-bottom: 20px;
}

.flayer-form-actions {
    margin-bottom: 0;
    align-items: center;
}

.flayer-status {
    font-size: 0.9rem;
    color: var(--muted);
    font-weight: 600;
}

.flayer-status-ok {
    color: var(--success-text);
}

.flayer-status-error {
    color: var(--danger-text);
}

.flayer-preview-wrapper {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 16px;
    background: #fcfdff;
}

.flayer-empty {
    color: var(--muted);
    font-size: 0.92rem;
}

.flayer-preview {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: #fff;
    display: none;
}

.flayer-meta {
    margin-top: 10px;
    color: #334155;
    font-size: 0.88rem;
    font-weight: 600;
}

.pp-thumb {
    width: 68px;
    height: 68px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
}

.pp-thumb-empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
    text-align: center;
    padding: 4px;
}

#form-producto-principal textarea.form-control {
    resize: vertical;
}

#form-catalogo textarea.form-control {
    resize: vertical;
}

#form-categoria textarea.form-control {
    resize: vertical;
}

.catalogo-categorias-table {
    margin-bottom: 20px;
}

@keyframes panelIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 900px) {
    .panel-header h1 {
        font-size: 1.55rem;
    }

    .tab-btn {
        min-width: 130px;
    }

    .featured-product {
        flex-direction: column;
        text-align: center;
    }

    .featured-stats {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .panel-container {
        margin-top: 14px;
        padding: 0 10px 16px;
    }

    .panel-header {
        padding: 20px;
        border-radius: var(--radius-md);
    }

    .tabs-nav {
        gap: 6px;
    }

    .tab-btn {
        min-width: 100%;
    }

    .tab-panel {
        padding: 18px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input {
        min-width: 100%;
    }

    .data-table {
        font-size: 0.86rem;
    }

    .data-table th,
    .data-table td {
        padding: 10px;
    }
}* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    min-height: 100vh;
}

.panel-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.panel-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 12px 12px 0 0;
    text-align: center;
}

.panel-header h1 {
    font-size: 2rem;
    font-weight: 600;
}

.tabs-nav {
    display: flex;
    background-color: #fff;
    border-bottom: 2px solid #e1e5eb;
    flex-wrap: wrap;
}

.tab-btn {
    flex: 1;
    min-width: 150px;
    padding: 15px 25px;
    border: none;
    background-color: transparent;
    font-size: 1rem;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.tab-btn:hover {
    background-color: #f8f9fa;
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    background-color: #fff;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.tab-content {
    background-color: #fff;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-height: 400px;
}

.tab-panel {
    display: none;
    padding: 30px;
    animation: fadeIn 0.3s ease;
}

.tab-panel.active {
    display: block;
}

.tab-panel h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
    display: inline-block;
}

.tab-panel p {
    color: #6c757d;
    line-height: 1.6;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .panel-header h1 {
        font-size: 1.5rem;
    }
    
    .tabs-nav {
        flex-direction: column;
    }
    
    .tab-btn {
        min-width: 100%;
        text-align: left;
        padding-left: 20px;
    }
    
    .tab-btn.active::after {
        width: 4px;
        height: 100%;
        top: 0;
        bottom: auto;
        left: 0;
    }
}

/* Panel Section */
.panel-section h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 1.5rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
    display: inline-block;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Action Bar */
.action-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    align-items: center;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e9ecef;
    color: #495057;
}

.btn-secondary:hover {
    background: #dee2e6;
}

.search-input {
    padding: 12px 20px;
    border: 2px solid #e1e5eb;
    border-radius: 8px;
    font-size: 0.95rem;
    min-width: 250px;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.data-table th,
.data-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e1e5eb;
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.data-table tr:hover {
    background-color: #f8f9fa;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.2s ease;
}

.btn-icon:hover {
    transform: scale(1.2);
}

/* Badges */
.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-success {
    background-color: #d4edda;
    color: #155724;
}

.badge-warning {
    background-color: #fff3cd;
    color: #856404;
}

.badge-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.badge-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Avatar */
.avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.product-card {
    background: #fff;
    border: 2px solid #e1e5eb;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.product-card:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.product-img {
    font-size: 3rem;
    margin-bottom: 15px;
}

.product-card h4 {
    color: #333;
    margin-bottom: 10px;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 10px;
}

/* Featured Product */
.featured-product {
    display: flex;
    gap: 40px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 40px;
    align-items: center;
    flex-wrap: wrap;
}

.featured-img {
    font-size: 8rem;
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.featured-info h3 {
    font-size: 1.8rem;
    color: #333;
    margin: 10px 0;
}

.featured-price {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 15px;
}

.featured-desc {
    color: #6c757d;
    max-width: 400px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.featured-stats {
    display: flex;
    gap: 30px;
}

.featured-stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}

.stat-desc {
    font-size: 0.85rem;
    color: #6c757d;
}

/* Section Title */
.section-title {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e1e5eb;
}

/* Config Form */
.config-form {
    max-width: 500px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .featured-product {
        flex-direction: column;
        text-align: center;
    }
    
    .featured-stats {
        justify-content: center;
    }
    
    .action-bar {
        flex-direction: column;
    }
    
    .search-input {
        min-width: 100%;
    }
    
    .data-table {
        font-size: 0.85rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px;
    }
}
