:root { --cyber: #15803d; --cyber-dark: #0f5132; --soft: #f5fbf7; }
body { background: #f4f7f6; color: #1f2937; }
.bg-cyber { background: linear-gradient(90deg, var(--cyber-dark), var(--cyber)); }
.brand-circle { width:70px;height:70px;border-radius:50%;background:#e8f7ee;color:var(--cyber);display:flex;align-items:center;justify-content:center;font-size:34px; }
.card { border-radius: 1rem !important; }
.stat-icon { width:54px;height:54px;border-radius:16px;display:flex;align-items:center;justify-content:center;font-size:26px; }
.stat-card:hover { transform: translateY(-2px); transition:.15s; }
.wysiwyg { min-height: 460px; background:#fff; border:1px solid #ced4da; border-radius:.75rem; padding:22px; overflow:auto; line-height:1.6; font-family:Arial,sans-serif; }
.wysiwyg:focus { outline: 3px solid rgba(25,135,84,.15); border-color:#198754; }
.wysiwyg img { cursor:pointer; transition: outline .12s, box-shadow .12s; }
.wysiwyg img.editor-image-selected { outline: 3px solid rgba(21,128,61,.45); box-shadow:0 0 0 5px rgba(21,128,61,.12); }
.editor-panel { position: sticky; top: 66px; z-index: 10; box-shadow: 0 8px 18px rgba(15, 23, 42, .06); }
.editor-select { width: auto; min-width: 130px; }
.editor-variable-select { width: auto; min-width: 140px; }
.editor-color-input { width: 0; height: 0; opacity: 0; position:absolute; pointer-events:none; }
.image-tools .btn { padding:.15rem .45rem; }
.badge.status-draft { background:#6c757d; }
.badge.status-scheduled { background:#0dcaf0; color:#111; }
.badge.status-running { background:#198754; }
.badge.status-paused { background:#ffc107; color:#111; }
.badge.status-completed { background:#0d6efd; }
.badge.status-cancelled { background:#dc3545; }
.badge.status-failed { background:#dc3545; }
.badge.status-queued { background:#6c757d; }
.badge.status-sending { background:#ffc107; color:#111; }
.badge.status-sent { background:#198754; }
.badge.status-opened { background:#0dcaf0; color:#111; }
.badge.status-clicked { background:#212529; }
.badge.status-bounced { background:#dc3545; }
.badge.status-unsubscribed { background:#fd7e14; }
.table td, .table th { vertical-align: middle; }
.preview-email-body img { max-width:100%; height:auto; }
.attachment-drop { border:2px dashed #b7d8c4; background:#f7fbf8; border-radius:16px; padding:18px; }

/* V1.6 visual polish */
.settings-icon { width: 48px; height: 48px; border-radius: 16px; display:flex; align-items:center; justify-content:center; font-size: 24px; }
.settings-kpi { background: linear-gradient(180deg, #ffffff, #f8fffa); }
.automation-flow { display:grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; align-items:center; gap:.5rem; }
.automation-flow > div { background:#f5fbf7; border:1px solid #d9f0e2; border-radius:18px; padding:14px 10px; text-align:center; min-height:92px; }
.automation-flow span { display:inline-flex; width:22px; height:22px; border-radius:50%; background:#15803d; color:#fff; align-items:center; justify-content:center; font-size:12px; font-weight:700; margin-bottom:4px; }
.automation-flow strong { display:block; color:#15803d; font-size:26px; line-height:1; }
.automation-flow small { display:block; color:#6b7280; font-weight:600; margin-top:4px; }
.automation-flow i { color:#94a3b8; }
.settings-form .form-control, .settings-form .form-select { border-radius: 12px; }
.variable-chips span { background:#f0fdf4; border:1px solid #bbf7d0; color:#166534; padding:6px 10px; border-radius:999px; font-size:12px; font-weight:700; }
.email-canvas { min-height: 640px; padding:0; background:#eef5f0; border:1px solid #cfe8d8; }
.email-canvas:empty::before { content:'Empiece a escribir su correo aquí...'; color:#94a3b8; padding:24px; display:block; }
.email-canvas > * { max-width: 820px; margin-left:auto; margin-right:auto; }
.email-preview-shell { min-height:320px; max-height:520px; overflow:auto; transform-origin: top center; }
.email-preview-shell img, .email-canvas img { max-width:100%; height:auto; }
.editor-preview-card { z-index:5; }
.recipient-filter-pills .nav-link { border:1px solid #dbe7df; color:#166534; border-radius:999px; font-size:13px; padding:.35rem .75rem; }
.recipient-filter-pills .nav-link.active { background:#15803d; color:#fff; border-color:#15803d; }
.table-hover tbody tr:hover { background:#f8fbf9; }
.page-link { color:#15803d; }
.active>.page-link, .page-link.active { background-color:#15803d; border-color:#15803d; }
@media (max-width: 991px) { .automation-flow { grid-template-columns: 1fr; } .automation-flow i { transform: rotate(90deg); justify-self:center; } .email-canvas { min-height: 460px; } }

/* V1.7 - Email professional composer and reports */
.professional-email-canvas {
    background: #ffffff;
    border: 1px solid #cfded4;
    border-radius: 18px;
    padding: 0;
    min-height: 720px;
    box-shadow: inset 0 0 0 18px #f3f6f4;
}
.professional-email-canvas > table,
.professional-email-canvas > div,
.professional-email-canvas > p,
.professional-email-canvas > h1,
.professional-email-canvas > h2,
.professional-email-canvas > h3,
.professional-email-canvas > ul,
.professional-email-canvas > ol {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}
.email-preview-frame { border-radius: 16px; overflow: hidden; box-shadow: 0 10px 24px rgba(15,23,42,.08); }
.email-preview-toolbar { background:#e2e8f0; padding:10px 12px; display:flex; gap:6px; }
.email-preview-toolbar span { width:10px; height:10px; background:#94a3b8; border-radius:50%; display:inline-block; }
.email-preview-shell { max-height: 650px; overflow:auto; }
.email-preview-shell table { max-width: 100%; }
.report-hero-card { background: linear-gradient(135deg, #0f5132, #15803d); color:#fff; border-radius:24px; overflow:hidden; }
.report-hero-card .muted { color:#d7ffe3; }
.report-kpi { border:0; border-radius:20px; box-shadow:0 10px 28px rgba(15,23,42,.06); }
.report-kpi .icon { width:48px; height:48px; border-radius:16px; display:flex; align-items:center; justify-content:center; font-size:24px; }
.report-table-card { border:0; border-radius:22px; box-shadow:0 10px 28px rgba(15,23,42,.06); overflow:hidden; }
.report-table-card .table thead th { background:#f8faf9; color:#475569; font-size:12px; text-transform:uppercase; letter-spacing:.04em; }
.report-filter-tabs .nav-link { border:1px solid #dbe7df; border-radius:999px; color:#166534; font-weight:700; padding:.45rem .85rem; }
.report-filter-tabs .nav-link.active { background:#15803d; border-color:#15803d; color:#fff; }
.email-quality-box { background:#f0fdf4; border:1px solid #bbf7d0; color:#166534; border-radius:18px; padding:14px 16px; }
@media (max-width: 1199px) { .professional-email-canvas { min-height: 520px; } }

/* V1.8 - Composer responsivo y seguro para Outlook */
.professional-email-canvas {
    background: #f3f6f4;
    border: 1px solid #cfded4;
    border-radius: 18px;
    padding: 24px 12px;
    min-height: 720px;
    box-shadow: inset 0 0 0 1px rgba(21,128,61,.04);
    overflow-x: auto;
}
.professional-email-canvas::before {
    content: "Área segura del correo: 640 px";
    display: block;
    width: 640px;
    max-width: 100%;
    margin: 0 auto 8px;
    color: #64748b;
    font-size: 12px;
    text-align: center;
}
.professional-email-canvas > table,
.professional-email-canvas > div,
.professional-email-canvas > p,
.professional-email-canvas > h1,
.professional-email-canvas > h2,
.professional-email-canvas > h3,
.professional-email-canvas > ul,
.professional-email-canvas > ol {
    width: 640px !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}
.professional-email-canvas img,
.email-preview-shell img,
#emailPreviewBody img {
    max-width: 100% !important;
    height: auto !important;
}
.professional-email-canvas img.editor-image-selected {
    outline: 3px solid #22c55e;
    outline-offset: 3px;
}
.email-quality-box strong { color:#14532d; }
.outlook-safe-note {
    background:#ecfdf5;
    border:1px solid #bbf7d0;
    color:#14532d;
    border-radius:16px;
    padding:12px 14px;
}
@media (max-width: 767px) {
    .professional-email-canvas { padding: 16px 6px; }
    .professional-email-canvas::before { width: 100%; }
}

/* V1.9 - Centro de plantillas y seguimiento de clics */
.template-type-pills .nav-link { border:1px solid #dbe7df; border-radius:999px; color:#166534; font-weight:700; padding:.45rem .85rem; }
.template-type-pills .nav-link.active { background:#15803d; color:#fff; border-color:#15803d; }
.template-type-pills .nav-link.active .badge { color:#15803d!important; }
.template-card-preview { background:#f3f6f4; border:1px solid #dbe7df; border-radius:18px; padding:14px; }
.template-card-preview-inner { width:640px; max-width:100%; margin:0 auto; background:#fff; border:1px solid #e3e9e5; overflow:hidden; border-radius:14px; }
.email-quality-box { background:#f0fdf4; border:1px solid #bbf7d0; color:#166534; border-radius:18px; padding:14px 16px; }
.link-performance-url { max-width: 360px; word-break: break-all; }
