﻿/* ============================================
   CONFIG PANEL — Club PETROMAYAB
   Desktop-first admin layout, same branding
   ============================================ */

/* ---- Layout Shell ---- */
body.cfg-body {
    display: flex;
    flex-direction: row;
    height: 100vh;
    overflow: hidden;
    background: #f4f4f5;
}

/* ---- Sidebar ---- */
.cfg-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #1a1a1a;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s;
}

.sidebar-logo {
    padding: 18px 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-badge {
    font-size: 0.5rem;
    font-weight: 800;
    background: var(--brand-red, #EA7600);
    color: #fff;
    padding: 1px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: none;
    background: none;
    color: rgba(255, 255, 255, 0.55);
    font-family: var(--font, 'Inter', sans-serif);
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    width: 100%;
}

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.85);
}

.sidebar-item.active {
    background: var(--brand-red, #EA7600);
    color: #fff;
}

.sidebar-item svg {
    flex-shrink: 0;
    opacity: 0.8;
}

.sidebar-item.active svg {
    opacity: 1;
}

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-link-back {
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    transition: color 0.2s;
}

.sidebar-link-back:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* ---- Main Area ---- */
.cfg-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: auto;
    min-width: 0;
}

/* ---- Header ---- */
.cfg-header {
    display: flex;
    align-items: center;
    padding: 0 24px;
    height: 52px;
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    flex-shrink: 0;
    gap: 16px;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
    background: none;
    border: none;
    cursor: pointer;
}

.hamburger span {
    width: 18px;
    height: 2px;
    background: #333;
    border-radius: 1px;
    transition: 0.2s;
}

.cfg-context {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
}

.ctx-item {
    font-size: 0.68rem;
    font-weight: 600;
    color: #888;
    white-space: nowrap;
}

.ctx-item strong {
    color: #333;
    font-weight: 800;
}

.ctx-sep {
    font-size: 0.7rem;
    color: #ccc;
    font-weight: 600;
}

.cfg-user {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.cfg-role-badge {
    font-size: 0.55rem;
    font-weight: 800;
    background: #EDE7F6;
    color: #5E35B1;
    padding: 3px 10px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.cfg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--brand-red, #EA7600);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 900;
    font-family: var(--font, 'Inter', sans-serif);
}

/* ---- Content Area ---- */
.cfg-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* ---- Modules ---- */
.cfg-module {
    display: none;
}

.cfg-module.active {
    display: block;
    animation: fadeIn 0.3s;
}

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

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

/* Module Header */
.module-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.module-title {
    font-size: 1.15rem;
    font-weight: 900;
    color: #1a1a1a;
    font-family: var(--font, 'Inter', sans-serif);
}

.module-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ---- Status Badges ---- */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 12px;
    border-radius: 10px;
    font-size: 0.58rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-draft {
    background: #F3E5F5;
    color: #7B1FA2;
}

.status-configurado {
    background: #FFF3E0;
    color: #E65100;
}

.status-activo {
    background: #E8F5E9;
    color: #2E7D32;
}

.status-pausado {
    background: #FFF8E1;
    color: #F57F17;
}

.status-finalizado {
    background: #E3F2FD;
    color: #1565C0;
}

.status-archivado {
    background: #ECEFF1;
    color: #546E7A;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: none;
    border-radius: 8px;
    font-family: var(--font, 'Inter', sans-serif);
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.65rem;
}

.btn-primary {
    background: var(--brand-red, #EA7600);
    color: #fff;
}

.btn-primary:hover {
    background: #b51e00;
    transform: translateY(-1px);
}

.btn-primary:disabled {
    background: #ccc;
    color: #888;
    cursor: not-allowed;
    transform: none;
}

.btn-ghost {
    background: #f0f0f0;
    color: #555;
}

.btn-ghost:hover {
    background: #e0e0e0;
}

.btn-ghost:disabled {
    color: #bbb;
    cursor: not-allowed;
}

.btn-success {
    background: #2E7D32;
    color: #fff;
}

.btn-success:hover {
    background: #256d28;
    transform: translateY(-1px);
}

.btn-success:disabled {
    background: #ccc;
    color: #888;
    cursor: not-allowed;
    transform: none;
}

.btn-danger {
    background: #C96500;
    color: #fff;
}

.btn-danger:hover {
    background: #a52121;
    transform: translateY(-1px);
}

.hidden {
    display: none !important;
}

/* ============================================
   WIZARD
   ============================================ */
.wizard-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 28px;
    padding: 16px 0;
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
}

.wz-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 900;
    font-family: var(--font, 'Inter', sans-serif);
    transition: all 0.3s;
}

.wizard-step.active .wz-dot {
    background: var(--brand-red, #EA7600);
    color: #fff;
    box-shadow: 0 2px 8px rgba(234, 118, 0, 0.3);
}

.wizard-step.completed .wz-dot {
    background: #2E7D32;
    color: #fff;
}

.wz-label {
    font-size: 0.55rem;
    font-weight: 700;
    color: #999;
    text-align: center;
    white-space: nowrap;
}

.wizard-step.active .wz-label {
    color: var(--brand-red, #EA7600);
}

.wizard-step.completed .wz-label {
    color: #2E7D32;
}

.wz-connector {
    width: 48px;
    height: 2px;
    background: #e0e0e0;
    margin: 0 4px;
    margin-bottom: 20px;
    transition: background 0.3s;
}

.wz-connector.completed {
    background: #2E7D32;
}

.wizard-panel {
    display: none;
}

.wizard-panel.active {
    display: block;
    animation: fadeIn 0.3s;
}

.wizard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

/* ============================================
   FORMS
   ============================================ */
.form-section {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.form-section-title {
    font-size: 0.85rem;
    font-weight: 900;
    color: #1a1a1a;
    font-family: var(--font, 'Inter', sans-serif);
    margin-bottom: 4px;
}

.form-section-help {
    font-size: 0.65rem;
    color: #888;
    margin-bottom: 18px;
    line-height: 1.5;
}

.form-section-sub {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px dashed #e0e0e0;
}

.form-subsection-title {
    font-size: 0.75rem;
    font-weight: 800;
    color: #555;
    margin-bottom: 14px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.form-label {
    font-size: 0.65rem;
    font-weight: 800;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.req {
    color: var(--brand-red, #EA7600);
}

.form-input,
.form-select,
.form-textarea {
    padding: 8px 12px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-family: var(--font, 'Inter', sans-serif);
    font-size: 0.75rem;
    font-weight: 600;
    color: #333;
    transition: border-color 0.2s;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--brand-red, #EA7600);
    box-shadow: 0 0 0 3px rgba(234, 118, 0, 0.08);
}

.form-input.error {
    border-color: #C96500;
}

.form-textarea {
    resize: vertical;
}

.form-hint {
    font-size: 0.58rem;
    color: #aaa;
    font-weight: 600;
}

.form-count {
    font-size: 0.6rem;
    font-weight: 800;
    color: var(--brand-red, #EA7600);
}

/* Toggle */
.toggle-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.toggle-input {
    display: none;
}

.toggle-slider {
    width: 38px;
    height: 20px;
    background: #ccc;
    border-radius: 10px;
    position: relative;
    transition: background 0.3s;
}

.toggle-slider::after {
    content: '';
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-input:checked+.toggle-slider {
    background: #2E7D32;
}

.toggle-input:checked+.toggle-slider::after {
    transform: translateX(18px);
}

.toggle-text {
    font-size: 0.65rem;
    font-weight: 700;
    color: #666;
}

/* Slider */
.slider-wrap {
    width: 100%;
}

.form-range {
    width: 100%;
    accent-color: var(--brand-red, #EA7600);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.55rem;
    color: #999;
    font-weight: 600;
    margin-top: 2px;
}

/* Image Upload */
.img-upload {
    position: relative;
}

.img-upload-placeholder {
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: border-color 0.2s;
    color: #999;
    font-size: 0.65rem;
    font-weight: 700;
}

.img-upload-placeholder:hover {
    border-color: var(--brand-red, #EA7600);
}

.upload-hint {
    font-size: 0.52rem;
    color: #bbb;
}

.file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.logo-preview-img {
    max-width: 120px;
    max-height: 120px;
    border-radius: 10px;
    object-fit: cover;
}

/* Chip Selector */
.chip-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    min-height: 40px;
    background: #fafafa;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.6rem;
    font-weight: 700;
    border: 1.5px solid #ddd;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.chip:hover {
    border-color: #aaa;
}

.chip.selected {
    background: var(--brand-red, #EA7600);
    color: #fff;
    border-color: var(--brand-red, #EA7600);
}

/* Estimator */
.estimator-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #EDE7F6;
    border-radius: 10px;
    padding: 16px;
    margin-top: 16px;
}

.estimator-icon {
    font-size: 1.5rem;
}

.estimator-content {
    font-size: 0.7rem;
    color: #333;
    line-height: 1.5;
}

.estimator-content strong {
    color: #5E35B1;
}

.estimator-sub {
    font-size: 0.62rem;
    color: #777;
    margin-top: 4px;
}

/* Review Grid */
.review-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.review-item {
    background: #fafafa;
    border-radius: 8px;
    padding: 12px;
}

.review-item-label {
    font-size: 0.55rem;
    font-weight: 800;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.review-item-value {
    font-size: 0.8rem;
    font-weight: 800;
    color: #333;
}

.review-item.error {
    border: 1.5px solid #C96500;
}

/* Review Checklist */
.review-checklist {
    background: #fafafa;
    border-radius: 10px;
    padding: 16px;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 0.68rem;
    font-weight: 700;
    color: #555;
}

.check-icon {
    font-size: 0.85rem;
}

.check-item.pass .check-icon {
    color: #2E7D32;
}

.check-item.fail .check-icon {
    color: #C96500;
}

.check-item.fail {
    color: #C96500;
}

/* ============================================
   TABLES
   ============================================ */
.table-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.toolbar-search {
    flex: 1;
    min-width: 180px;
}

.toolbar-filter {
    min-width: 140px;
}

.cfg-table-wrap {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.cfg-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font, 'Inter', sans-serif);
    font-size: 0.7rem;
}

.cfg-table th {
    background: #fafafa;
    font-weight: 800;
    font-size: 0.58rem;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 0.4px;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 2px solid #eee;
    white-space: nowrap;
}

.cfg-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    color: #444;
    font-weight: 600;
    vertical-align: middle;
}

.cfg-table tr:hover td {
    background: #fafafa;
}

.cfg-table .row-actions {
    display: flex;
    gap: 4px;
}

.row-action-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: #f0f0f0;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.row-action-btn:hover {
    background: #e0e0e0;
    transform: scale(1.05);
}

.row-action-btn.danger:hover {
    background: #FFEBEE;
}

/* Mini Status Badge in tables */
.mini-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 0.52rem;
    font-weight: 800;
    text-transform: uppercase;
}

.mini-badge.activo {
    background: #E8F5E9;
    color: #2E7D32;
}

.mini-badge.inactivo {
    background: #ECEFF1;
    color: #78909C;
}

.mini-badge.bloqueado {
    background: #FFEBEE;
    color: #C96500;
}

.mini-badge.campaign {
    background: #FFF3E0;
    color: #E65100;
}

/* ============================================
   PREMIOS GRID
   ============================================ */
.premio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.premio-card {
    background: #fff;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    position: relative;
    transition: transform 0.2s;
    border-left: 4px solid;
}

.premio-card:hover {
    transform: translateY(-2px);
}

.pc-emoji {
    font-size: 1.8rem;
    margin-bottom: 6px;
}

.pc-name {
    font-size: 0.82rem;
    font-weight: 900;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.pc-desc {
    font-size: 0.6rem;
    color: #888;
    margin-bottom: 10px;
    line-height: 1.4;
}

.pc-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.pc-points {
    font-size: 0.7rem;
    font-weight: 900;
    color: var(--brand-red, #EA7600);
}


/* Inventory Bar */
.inventory-bar-wrap {
    margin-top: 8px;
}

.inventory-label {
    font-size: 0.52rem;
    font-weight: 700;
    color: #999;
    margin-bottom: 3px;
    display: flex;
    justify-content: space-between;
}

.inventory-bar {
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
}

.inventory-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s ease-out;
}

.inventory-fill.high {
    background: #2E7D32;
}

.inventory-fill.med {
    background: #F57F17;
}

.inventory-fill.low {
    background: #C96500;
}

.pc-actions {
    display: flex;
    gap: 4px;
    margin-top: 10px;
}

/* ============================================
   BOT EDITOR
   ============================================ */
.bot-variables-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 10px 14px;
    background: #f8f8f8;
    border-radius: 8px;
}

.var-label {
    font-size: 0.6rem;
    font-weight: 800;
    color: #888;
    margin-right: 4px;
}

.var-chip {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.58rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    background: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #C8E6C9;
    cursor: pointer;
    transition: all 0.2s;
}

.var-chip:hover {
    background: #C8E6C9;
    transform: scale(1.05);
}

.bot-editor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.bot-textarea {
    font-size: 0.72rem;
    line-height: 1.6;
}

.var-status {
    font-size: 0.52rem;
    font-weight: 700;
    min-height: 14px;
}

/* Bot Preview */
.bot-preview {
    background: #E8F5E9;
    border-radius: 12px;
    padding: 16px;
}

.bot-msg-bubble {
    background: #fff;
    border-radius: 12px 12px 12px 4px;
    padding: 12px 16px;
    max-width: 400px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.bot-msg-sender {
    font-size: 0.55rem;
    font-weight: 800;
    color: #2E7D32;
    display: block;
    margin-bottom: 4px;
}

.bot-msg-bubble p {
    font-size: 0.72rem;
    line-height: 1.6;
    color: #333;
    margin: 0;
}

/* ============================================
   BOLETOS
   ============================================ */
.boletos-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.boleto-kpi {
    background: #fff;
    border-radius: 12px;
    padding: 18px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.bk-value {
    font-size: 1.3rem;
    font-weight: 900;
    color: #1a1a1a;
    font-family: var(--font, 'Inter', sans-serif);
    display: block;
    margin-bottom: 2px;
}

.bk-label {
    font-size: 0.55rem;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
}

.sorteo-winner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border-left: 4px solid #FFB300;
}

.sorteo-winner .sw-pos {
    font-size: 1.2rem;
    font-weight: 900;
    color: #FFB300;
    min-width: 30px;
}

.sorteo-winner .sw-name {
    font-size: 0.8rem;
    font-weight: 800;
    color: #333;
}

.sorteo-winner .sw-phone {
    font-size: 0.62rem;
    color: #888;
    font-weight: 600;
}

/* ============================================
   LOGS TIMELINE
   ============================================ */
.log-timeline {
    position: relative;
    padding-left: 28px;
}

.log-timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e0e0e0;
}

.log-entry {
    position: relative;
    background: #fff;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.log-entry::before {
    content: '';
    position: absolute;
    left: -22px;
    top: 18px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #e0e0e0;
}

.log-entry.type-campaign::before {
    background: #5E35B1;
    box-shadow: 0 0 0 2px #EDE7F6;
}

.log-entry.type-prize::before {
    background: #FFB300;
    box-shadow: 0 0 0 2px #FFF8E1;
}

.log-entry.type-user::before {
    background: #1565C0;
    box-shadow: 0 0 0 2px #E3F2FD;
}

.log-entry.type-store::before {
    background: #2E7D32;
    box-shadow: 0 0 0 2px #E8F5E9;
}

.log-entry.type-bot::before {
    background: #00838F;
    box-shadow: 0 0 0 2px #E0F7FA;
}

.log-entry.type-sorteo::before {
    background: #C96500;
    box-shadow: 0 0 0 2px #FFEBEE;
}

.log-action {
    font-size: 0.72rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

.log-meta {
    font-size: 0.55rem;
    font-weight: 600;
    color: #999;
    display: flex;
    gap: 12px;
}

.log-type-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 8px;
    font-size: 0.5rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-right: 6px;
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 500;
    display: none;
    animation: fadeIn 0.2s;
}

.modal-overlay.visible {
    display: block;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: #fff;
    border-radius: 14px;
    padding: 0;
    width: 90%;
    max-width: 500px;
    z-index: 501;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    display: none;
    animation: modalIn 0.3s forwards;
}

.modal.visible {
    display: block;
}

@keyframes modalIn {
    from {
        transform: translate(-50%, -50%) scale(0.95);
        opacity: 0;
    }

    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

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

.modal-title {
    font-size: 0.85rem;
    font-weight: 900;
    color: #1a1a1a;
}

.modal-close {
    width: 28px;
    height: 28px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.modal-close:hover {
    background: #e0e0e0;
}

.modal-body {
    padding: 20px;
    max-height: 50vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid #eee;
}

/* ============================================
   TOAST
   ============================================ */
.cfg-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: #1a1a1a;
    color: #fff;
    padding: 10px 22px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 800;
    font-family: var(--font, 'Inter', sans-serif);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 600;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.cfg-toast.visible {
    transform: translateX(-50%) translateY(0);
}

/* ============================================
   CONTEXT DROPDOWN (Header Breadcrumb)
   ============================================ */
.ctx-dropdown {
    position: relative;
}

.ctx-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: 1.5px solid transparent;
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    font-family: var(--font, 'Inter', sans-serif);
    transition: all 0.2s;
}

.ctx-btn:hover {
    background: #f5f5f5;
    border-color: #e0e0e0;
}

.ctx-btn .ctx-label {
    font-size: 0.55rem;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-right: 2px;
}

.ctx-btn strong {
    font-size: 0.68rem;
    font-weight: 800;
    color: #333;
    white-space: nowrap;
}

.ctx-btn svg {
    opacity: 0.4;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.ctx-dropdown.open .ctx-btn svg {
    transform: rotate(180deg);
}

.ctx-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 180px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    z-index: 200;
    padding: 4px;
    max-height: 220px;
    overflow-y: auto;
}

.ctx-dropdown.open .ctx-menu {
    display: block;
    animation: fadeIn 0.15s;
}

.ctx-menu-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    text-align: left;
    font-family: var(--font, 'Inter', sans-serif);
    font-size: 0.7rem;
    font-weight: 600;
    color: #444;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.ctx-menu-item:hover {
    background: #f5f5f5;
}

.ctx-menu-item.active {
    background: var(--brand-red, #EA7600);
    color: #fff;
    font-weight: 800;
}

/* ============================================
   ORGANIZATION MODULE
   ============================================ */

/* Layout: tree left + detail right */
.org-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
}

/* ---- Tree ---- */
.org-tree {
    padding: 8px 0;
}

.org-tree-node {
    user-select: none;
}

.org-node-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}

.org-node-row:hover {
    background: #f5f5f5;
}

.org-node-row.selected {
    background: rgba(234, 118, 0, 0.08);
    box-shadow: inset 3px 0 0 var(--brand-red, #EA7600);
}

.org-toggle {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    color: #999;
    flex-shrink: 0;
    transition: transform 0.2s;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    border-radius: 4px;
}

.org-toggle:hover {
    background: #e0e0e0;
    color: #555;
}

.org-toggle.expanded {
    transform: rotate(90deg);
}

.org-toggle-placeholder {
    width: 18px;
    flex-shrink: 0;
}

.org-node-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.org-node-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #333;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.org-node-code {
    font-size: 0.55rem;
    font-weight: 800;
    color: #999;
    background: #f0f0f0;
    padding: 1px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.org-node-count {
    font-size: 0.55rem;
    font-weight: 700;
    color: #aaa;
    flex-shrink: 0;
}

.org-tree-children {
    padding-left: 20px;
    border-left: 1.5px dashed #e0e0e0;
    margin-left: 18px;
}

.org-tree-children.collapsed {
    display: none;
}

/* ---- Detail Panel ---- */
.org-detail-panel .form-section {
    min-height: 300px;
    display: flex;
    flex-direction: column;
}

.org-detail-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
}

.org-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.org-detail-icon {
    font-size: 2rem;
}

.org-detail-type {
    font-size: 0.58rem;
    font-weight: 800;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.org-detail-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.org-field {
    background: #fafafa;
    border-radius: 8px;
    padding: 10px 12px;
}

.org-field-label {
    font-size: 0.55rem;
    font-weight: 800;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 3px;
}

.org-field-value {
    font-size: 0.78rem;
    font-weight: 800;
    color: #333;
}

.org-detail-actions {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #eee;
    margin-top: auto;
}

/* ---- Role Badges ---- */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.55rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.role-super_admin {
    background: #FFEBEE;
    color: #C96500;
}

.role-admin_franquicia {
    background: #FFF8E1;
    color: #F57F17;
}

.role-gerente_tienda {
    background: #E8F5E9;
    color: #2E7D32;
}

/* ============================================
   RESPONSIVE (< 900px)
   ============================================ */
@media (max-width: 900px) {

    .cfg-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        transform: translateX(-100%);
        z-index: 200;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
    }

    .cfg-sidebar.open {
        transform: translateX(0);
    }

    .hamburger {
        display: flex;
    }

    .cfg-content {
        padding: 16px;
    }

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

    .bot-editor-grid {
        grid-template-columns: 1fr;
    }

    .review-grid {
        grid-template-columns: 1fr;
    }

    .boletos-kpis {
        grid-template-columns: 1fr 1fr;
    }

    .ctx-sep:last-of-type,
    .ctx-item:last-child {
        display: none;
    }

    .wz-connector {
        width: 24px;
    }

    .wz-dot {
        width: 26px;
        height: 26px;
        font-size: 0.6rem;
    }

    .wz-label {
        font-size: 0.48rem;
    }
}

@media (max-width: 600px) {

    .module-title {
        font-size: 0.95rem;
    }

    .cfg-header {
        padding: 0 12px;
        gap: 8px;
    }

    .boletos-kpis {
        grid-template-columns: 1fr;
    }

    .premio-grid {
        grid-template-columns: 1fr;
    }

    .wizard-progress {
        flex-wrap: wrap;
        gap: 4px;
    }

    .wz-connector {
        width: 16px;
    }
}

/* ============================================
   BANNERS MODULE
   ============================================ */
.banner-specs {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
}

.spec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.spec-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #fff;
    border-radius: 10px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
}

.spec-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.spec-item strong {
    display: block;
    font-size: 0.7rem;
    font-weight: 800;
    color: #333;
    margin-bottom: 2px;
}

.spec-item span {
    font-size: 0.65rem;
    color: #666;
}

.spec-note {
    font-size: 0.68rem;
    color: #888;
    margin: 0;
    line-height: 1.5;
}

.spec-note code {
    background: #e5e7eb;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.62rem;
}

.banner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

.banner-card {
    position: relative;
    aspect-ratio: 9 / 17;
    border-radius: 14px;
    overflow: hidden;
    border: 2px solid #e0e0e0;
    background: #111;
    transition: border-color 0.2s, box-shadow 0.2s;
    cursor: default;
}

.banner-card:hover {
    border-color: var(--brand-red, #EA7600);
    box-shadow: 0 4px 16px rgba(234, 118, 0, 0.15);
}

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

.banner-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s;
}

.banner-card:hover .banner-card-overlay {
    opacity: 1;
}

.banner-card-overlay .banner-order {
    font-size: 0.6rem;
    font-weight: 800;
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 6px;
}

.banner-card-overlay button {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
}

.banner-card-overlay button:hover {
    background: #ff5252;
    color: #fff;
}

.banner-validation-ok {
    color: #2E7D32;
    font-size: 0.65rem;
    font-weight: 700;
    margin-top: 6px;
}

.banner-validation-err {
    color: #C96500;
    font-size: 0.65rem;
    font-weight: 700;
    margin-top: 6px;
}