/* ===== STATS GRID ===== */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--grey-200); border: 1px solid var(--grey-200); }
.stat-card {
    background: linear-gradient(180deg, #ffffff 0%, #f6f6f8 100%);
    padding: 20px 22px; display: flex; flex-direction: column; gap: 6px;
    position: relative; overflow: hidden; transition: all 0.2s; cursor: default;
}
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: rgba(255,255,255,0.9); }
.stat-card:hover { background: linear-gradient(180deg, #ffffff 0%, #fdf5f8 100%); }
.stat-card:hover .stat-value { color: var(--accent); }
.stat-label { font-size: 9px; font-weight: 600; letter-spacing: 0.1em; color: var(--grey-400); }
.stat-row { display: flex; align-items: baseline; gap: 8px; }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; transition: color 0.2s; }
.stat-change { font-size: 10px; font-weight: 600; }
.stat-change.up { color: var(--green); }
.stat-change.down { color: var(--negative); }

/* ===== LIST TOOLBAR ===== */
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.search-box {
    display: flex; align-items: center; gap: 7px;
    padding: 7px 12px; background: var(--white);
    border: 1px solid var(--grey-200); color: var(--grey-400); transition: border-color 0.15s;
}
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-light); }
.search-box input { border: none; background: none; outline: none; font-family: var(--font); font-size: 11px; width: 200px; color: var(--black); }
.search-box input::placeholder { color: var(--grey-400); }
.filter-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filter-select { min-width: 120px; }
.filter-date { width: 130px; }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
table thead th { text-align: left; padding: 10px 16px; font-size: 9px; font-weight: 600; color: var(--grey-400); letter-spacing: 0.08em; border-bottom: 1px solid var(--grey-150); background: linear-gradient(180deg, var(--grey-50) 0%, var(--grey-100) 100%); }
table tbody td { padding: 12px 16px; font-size: 12px; border-bottom: 1px solid var(--grey-100); transition: background 0.1s; }
table tbody tr:last-child td { border-bottom: none; }
table tbody tr { transition: all 0.15s; cursor: pointer; }
table tbody tr:hover { background: var(--accent-light); }
table tbody tr:hover .td-name { color: var(--accent); }
.td-name { font-weight: 500; transition: color 0.15s; }
.td-num { font-weight: 500; font-size: 11px; }
.badge { display: inline-block; padding: 2px 7px; background: var(--grey-100); border: 1px solid var(--grey-150); font-size: 9px; font-weight: 600; letter-spacing: 0.04em; color: var(--grey-600); }
.status { display: inline-block; padding: 2px 8px; font-size: 9px; font-weight: 700; letter-spacing: 0.06em; }
.status.live { background: var(--accent); color: var(--white); }
.status.completed { background: var(--grey-100); border: 1px solid var(--grey-200); color: var(--grey-500); }
.status.draft { border: 1px solid var(--accent); color: var(--accent); }
.status.paused { background: var(--grey-100); border: 1px solid var(--grey-300); color: var(--grey-600); }

/* ===== TOPBAR RIGHT ===== */
.topbar-right { display: flex; align-items: center; gap: 8px; }
.btn-create {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 14px; background: var(--accent); color: var(--white);
    font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
    transition: all 0.15s; font-family: var(--font); cursor: pointer; border: none;
}
.btn-create:hover { background: #c4317d; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(230,60,148,0.2); }

/* ===== BACK BUTTON ===== */
.btn-back { font-size: 11px; font-weight: 500; color: var(--accent); cursor: pointer; border: none; background: none; font-family: var(--font); padding: 4px 8px; transition: color 0.12s; }
.btn-back:hover { color: var(--black); }

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.4);
    z-index: 6000; display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(2px); animation: fadeIn 0.15s;
}
.modal {
    background: var(--white); width: 480px; max-width: 92vw;
    box-shadow: 0 16px 48px rgba(0,0,0,0.15); animation: scaleIn 0.2s;
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 24px; border-bottom: 1px solid var(--grey-100);
}
.modal-header h3 { font-size: 14px; font-weight: 600; }
.modal-close { font-size: 22px; color: var(--grey-400); line-height: 1; cursor: pointer; background: none; border: none; }
.modal-close:hover { color: var(--black); }
.modal-body { padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 16px 24px; border-top: 1px solid var(--grey-100); }

.modal-option-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.modal-option {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 16px 20px; min-width: 100px;
    border: 1px solid var(--grey-200); background: var(--white);
    font-size: 11px; font-weight: 500; color: var(--grey-600);
    cursor: pointer; transition: all 0.12s; font-family: var(--font);
}
.modal-option:hover { border-color: var(--grey-300); color: var(--black); }
.modal-option.active { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }

/* ===== RESPONSIVE STATS ===== */
@media (max-width: 900px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .stats-grid { grid-template-columns: 1fr; } }

/* ===== STEP INDICATOR ===== */
.step-indicator { display: flex; align-items: center; justify-content: center; gap: 0; margin-bottom: 24px; }
.step { display: flex; align-items: center; gap: 8px; padding: 8px 16px; cursor: pointer; transition: all 0.15s; }
.step-number { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; border: 1.5px solid var(--grey-300); color: var(--grey-400); }
.step-label { font-size: 11px; font-weight: 500; color: var(--grey-400); }
.step.active .step-number { background: var(--accent); color: var(--white); border-color: var(--accent); }
.step.active .step-label { color: var(--black); font-weight: 600; }
.step.done .step-number { background: var(--black); color: var(--white); border-color: var(--black); }
.step.done .step-label { color: var(--black); }
.step-connector { width: 40px; height: 1px; background: var(--grey-200); }

.step-content { display: none; flex-direction: column; gap: 16px; animation: slideDown 0.2s ease; }
.step-content.active { display: flex !important; }

/* ===== CHANNEL SELECTOR ===== */
.channel-selector { display: flex; gap: 10px; padding: 16px 20px; }
.channel-btn { display: flex; align-items: center; gap: 8px; padding: 10px 20px; border: 1px solid var(--grey-200); font-size: 12px; font-weight: 500; color: var(--grey-600); background: var(--white); transition: all 0.12s; cursor: pointer; font-family: var(--font); }
.channel-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.channel-btn:hover:not(.active) { border-color: var(--grey-300); color: var(--black); }

/* ===== AUDIENCE ===== */
.audience-mode-row { display: flex; gap: 20px; padding: 16px 20px 12px; }
.audience-existing, .audience-new { padding: 0 20px 16px; }

.segment-preview { display: flex; gap: 16px; padding: 10px 14px; background: var(--grey-50); border: 1px solid var(--grey-100); margin-top: 8px; }
.segment-preview-count, .segment-preview-reach { font-size: 12px; font-weight: 600; }

/* ===== A/B TESTING ===== */
.ab-test-section { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.ab-variants { display: flex; gap: 12px; flex-wrap: wrap; }
.ab-variant-card { border: 1px solid var(--grey-200); padding: 14px 18px; min-width: 180px; flex: 1; }
.variant-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.variant-badge { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; background: var(--black); color: var(--white); }
.variant-title { font-size: 11px; font-weight: 500; }
.variant-split { display: flex; align-items: center; gap: 8px; }
.variant-split-input { width: 60px; }

/* ===== HOLDOUT ===== */
.holdout-section { padding: 16px 20px; }
.holdout-input-row { display: flex; align-items: center; gap: 10px; }
.holdout-suffix { font-size: 11px; color: var(--grey-500); }

/* ===== STEP NAV ===== */
.step-nav { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; }
.step-nav-btn { padding: 10px 20px; font-size: 12px; font-weight: 600; font-family: var(--font); cursor: pointer; transition: all 0.12s; }
.step-nav-btn.next { background: var(--accent); color: var(--white); border: none; }
.step-nav-btn.next:hover { background: #c4317d; }
.step-nav-btn.prev { background: var(--white); color: var(--grey-600); border: 1px solid var(--grey-200); }
.step-nav-btn.prev:hover { color: var(--black); border-color: var(--grey-300); }
.step-nav-btn.launch { background: var(--black); color: var(--white); border: none; font-size: 13px; }
.step-nav-btn.launch:hover { background: var(--grey-800); }

/* ===== ADD FILTER BTN ===== */
.add-filter-row { display: flex; gap: 10px; }
.add-filter-btn {
    padding: 8px 16px; font-size: 11px; font-weight: 600;
    border: 1px solid var(--accent); color: var(--accent);
    background: var(--white); transition: all 0.12s; font-family: var(--font); cursor: pointer;
}
.add-filter-btn:hover { background: var(--accent-light); }

/* ===== EMAIL EDITOR ENHANCED ===== */
.email-meta-card { margin-bottom: 0; }
.email-meta-fields { padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.meta-field { display: flex; flex-direction: column; gap: 4px; position: relative; }
.meta-field label { font-size: 10px; font-weight: 600; letter-spacing: 0.06em; color: var(--grey-400); text-transform: uppercase; }
.meta-field .f-input { width: 100%; font-size: 12px; padding: 8px 10px; }
.meta-hint { position: absolute; right: 8px; bottom: 8px; font-size: 9px; color: var(--grey-400); }
.meta-field-row { display: flex; gap: 12px; }
.meta-field-row .meta-field { flex: 1; }

/* Editor Toolbar */
.editor-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: var(--white); border: 1px solid var(--grey-200); border-bottom: none; }
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 4px; }
.toolbar-btn { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; color: var(--grey-500); border: 1px solid transparent; transition: all 0.12s; background: none; cursor: pointer; }
.toolbar-btn:hover { color: var(--black); background: var(--grey-50); border-color: var(--grey-200); }
.toolbar-btn.active { color: var(--accent); background: var(--accent-light); border-color: var(--accent); }
.toolbar-btn.text-btn { width: auto; padding: 4px 10px; font-size: 10px; font-weight: 600; font-family: var(--font); }
.toolbar-divider { width: 1px; height: 18px; background: var(--grey-200); margin: 0 4px; }

/* Panel Tabs */
.panel-tabs { display: flex; border-bottom: 1px solid var(--grey-200); margin-bottom: 12px; }
.panel-tab { flex: 1; padding: 8px 4px; font-size: 9px; font-weight: 600; text-align: center; letter-spacing: 0.04em; color: var(--grey-500); border-bottom: 2px solid transparent; cursor: pointer; transition: all 0.12s; background: none; border-top: none; border-left: none; border-right: none; font-family: var(--font); }
.panel-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.panel-tab:hover:not(.active) { color: var(--black); }

/* Row Palette */
.row-palette { display: flex; flex-direction: column; gap: 8px; }
.row-option { display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--grey-200); cursor: pointer; transition: all 0.12s; }
.row-option:hover { border-color: var(--accent); background: var(--accent-light); }
.row-preview { display: flex; gap: 3px; flex: 1; height: 20px; }
.rp-col { flex: 1; background: var(--grey-200); }
.row-option span { font-size: 10px; color: var(--grey-600); white-space: nowrap; }

/* Settings Form */
.settings-form { display: flex; flex-direction: column; gap: 12px; }
.input-with-unit { display: flex; align-items: center; gap: 4px; }
.input-with-unit .f-input { width: 70px; }
.input-with-unit span { font-size: 10px; color: var(--grey-500); }

/* Editor Layout */
.editor-layout { display: grid; grid-template-columns: 200px 1fr 260px; gap: 0; border: 1px solid var(--grey-200); min-height: 560px; }
.editor-panel-left { background: var(--white); padding: 12px; border-right: 1px solid var(--grey-200); overflow-y: auto; max-height: 560px; }
.editor-panel-right { background: var(--white); padding: 14px; border-left: 1px solid var(--grey-200); overflow-y: auto; max-height: 560px; }
.editor-canvas-wrap { background: var(--grey-50); padding: 20px; display: flex; justify-content: center; align-items: flex-start; overflow-y: auto; max-height: 560px; }
.editor-canvas { width: 100%; max-width: 600px; background: var(--white); border: 1px solid var(--grey-200); min-height: 400px; display: flex; flex-direction: column; transition: max-width 0.3s; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.editor-canvas.phone-view { max-width: 375px; }

.panel-title { font-size: 10px; font-weight: 600; letter-spacing: 0.1em; color: var(--grey-400); margin-bottom: 12px; text-transform: uppercase; }

/* Block Palette */
.block-palette { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.palette-block { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border: 1px solid var(--grey-200); font-size: 9px; font-weight: 500; color: var(--grey-600); cursor: grab; transition: all 0.12s; background: var(--white); text-align: center; }
.palette-block:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.palette-block:active { cursor: grabbing; transform: scale(0.95); }

/* Canvas */
.canvas-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; color: var(--grey-300); font-size: 12px; padding: 60px 40px; text-align: center; border: 2px dashed var(--grey-200); margin: 16px; gap: 12px; }
.canvas-placeholder svg { opacity: 0.4; }

/* Canvas Blocks */
.canvas-block { position: relative; transition: all 0.12s; border: 2px solid transparent; }
.canvas-block:hover { border-color: var(--grey-200); }
.canvas-block.selected { border-color: var(--accent); }
.canvas-block-toolbar { position: absolute; top: -28px; right: 0; display: none; gap: 2px; background: var(--white); border: 1px solid var(--grey-200); padding: 2px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); z-index: 10; }
.canvas-block:hover .canvas-block-toolbar, .canvas-block.selected .canvas-block-toolbar { display: flex; }
.block-action-btn { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--grey-500); cursor: pointer; background: none; border: none; transition: all 0.1s; }
.block-action-btn:hover { color: var(--accent); background: var(--accent-light); }
.block-action-btn.delete:hover { color: var(--negative); background: var(--negative-subtle); }

/* Drop Zone */
.canvas-drop-zone { height: 4px; transition: all 0.15s; position: relative; }
.canvas-drop-zone.drag-over { height: 40px; background: var(--accent-light); border: 2px dashed var(--accent); margin: 4px 0; }

/* Inline Text Toolbar */
.inline-toolbar { position: absolute; top: -36px; left: 50%; transform: translateX(-50%); display: none; gap: 1px; background: var(--black); padding: 4px 6px; box-shadow: 0 4px 16px rgba(0,0,0,0.2); z-index: 20; }
.canvas-block.editing .inline-toolbar { display: flex; }
.inline-toolbar button { width: 26px; height: 24px; display: flex; align-items: center; justify-content: center; color: var(--white); background: none; border: none; cursor: pointer; font-size: 11px; font-weight: 700; transition: all 0.1s; font-family: var(--font); }
.inline-toolbar button:hover { background: rgba(255,255,255,0.15); }
.inline-toolbar button.active { color: var(--accent); }
.inline-toolbar .tb-divider { width: 1px; height: 16px; background: rgba(255,255,255,0.2); margin: 4px 3px; }

/* Properties Panel Enhanced */
.properties-empty { color: var(--grey-400); font-size: 11px; text-align: center; padding: 40px 12px; }
.properties-content { display: flex; flex-direction: column; gap: 12px; }
.properties-content .form-group { padding: 0; }
.properties-content .form-label { font-size: 9px; }
.properties-content .f-input, .properties-content .f-select { font-size: 11px; padding: 6px 8px; }
.prop-section-title { font-size: 9px; font-weight: 700; letter-spacing: 0.08em; color: var(--grey-400); text-transform: uppercase; padding: 8px 0 4px; border-top: 1px solid var(--grey-100); margin-top: 4px; }
.color-input { width: 100%; height: 30px; padding: 2px; cursor: pointer; }
.alignment-btns { display: flex; gap: 4px; }
.alignment-btns button { width: 28px; height: 26px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--grey-200); background: var(--white); cursor: pointer; font-size: 11px; color: var(--grey-500); transition: all 0.12s; }
.alignment-btns button:hover { border-color: var(--grey-300); color: var(--black); }
.alignment-btns button.active { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

/* ===== SMS & WA EDITORS ===== */
.sms-template-section, .whatsapp-template-section { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.char-counter { font-size: 10px; color: var(--grey-400); margin-top: 4px; }

/* ===== SCHEDULING ===== */
.timing-options { display: flex; gap: 20px; padding: 16px 20px; }
.schedule-picker { display: flex; gap: 12px; padding: 0 20px 16px; }
.campaign-summary { padding: 16px 20px; display: flex; flex-direction: column; gap: 8px; }
.summary-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--grey-100); }
.summary-row:last-child { border-bottom: none; }
.summary-label { font-size: 11px; color: var(--grey-500); }
.summary-value { font-size: 12px; font-weight: 500; }

/* ===== INLINE SEGMENT BUILDER ===== */
.inline-segment-builder { display: flex; flex-direction: column; gap: 12px; padding: 12px 0; }
.filter-block-inline { border: 1px solid var(--grey-200); padding: 10px 12px; animation: slideDown 0.2s ease; }
.filter-inline-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-inline-row .f-select, .filter-inline-row .f-input { font-size: 11px; padding: 6px 8px; }
.filter-remove-btn { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; font-size: 14px; color: var(--grey-400); border: 1px solid var(--grey-200); background: var(--white); cursor: pointer; transition: all 0.12s; }
.filter-remove-btn:hover { color: var(--negative); border-color: var(--negative); }
