/* ═══════════════════════════════════════════════════════════════════
   ISP DARK TECH v8.7 ULTRA PREMIUM — DESIGN SYSTEM UNIFICADO
   ═══════════════════════════════════════════════════════════════════ */
:root {
    --isp-bg:           #0f0c29;
    --isp-bg2:          #302b63;
    --isp-bg3:          #24243e;
    --isp-surface:      rgba(255,255,255,0.08);
    --isp-surface2:     rgba(255,255,255,0.05);
    --isp-border:       rgba(255,255,255,0.12);
    --isp-border2:      rgba(255,255,255,0.15);
    --isp-text:         #ffffff;
    --isp-text-muted:   rgba(255,255,255,0.7);
    --isp-text-dim:     rgba(255,255,255,0.5);
    --isp-primary:      #4361ee;
    --isp-primary-d:    #3651d4;
    --isp-success:      #06d6a0;
    --isp-success2:     #2ecc71;
    --isp-warning:      #ffb703;
    --isp-warning2:     #f39c12;
    --isp-danger:       #ef476f;
    --isp-danger2:      #e74c3c;
    --isp-info:         #06b6d4;
    --isp-purple:       #7209b7;
    --isp-radius:       8px;
    --isp-radius-lg:    16px;
    --isp-radius-xl:    14px;
    --isp-shadow:       0 8px 32px rgba(0,0,0,0.4);
    --isp-shadow-lg:    0 15px 35px rgba(0,0,0,0.5);
    --isp-font:         'DM Sans', sans-serif;
    --isp-font-mono:    'JetBrains Mono', monospace;
    --isp-font-head:    'Syne', sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    background: linear-gradient(135deg, var(--isp-bg) 0%, var(--isp-bg2) 50%, var(--isp-bg3) 100%);
    background-attachment: fixed;
    font-family: var(--isp-font);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    color: var(--isp-text);
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--isp-bg); }
::-webkit-scrollbar-thumb { background: var(--isp-surface2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--isp-primary); }

.isp-header {
    background: linear-gradient(180deg, rgba(26,26,46,0.98) 0%, rgba(22,33,62,0.95) 100%);
    border-bottom: 1px solid var(--isp-border);
    padding: 12px 24px;
    position: sticky;
    top: 0;
    z-index: 1050;
    backdrop-filter: blur(20px);
}
.isp-status-dot { width:12px; height:12px; border-radius:50%; display:inline-block; flex-shrink:0; }
.isp-status-dot.online{ background:#2ecc71; box-shadow:0 0 6px rgba(46,204,113,.6); }
.isp-btn {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .45rem .85rem; border-radius: var(--isp-radius);
    font-size: 13px; font-weight: 500; cursor: pointer;
    border: 1px solid transparent; transition: all .2s;
    background: rgba(255,255,255,0.08); color: var(--isp-text); border-color: var(--isp-border);
}
.isp-btn-primary  { background: var(--isp-primary); border-color: var(--isp-primary); color: #fff; }
.isp-btn-primary:hover  { background: var(--isp-primary-d); transform: translateY(-1px); box-shadow:0 4px 12px rgba(67,97,238,.4); }
.isp-btn-success { background: var(--isp-success2); border-color: var(--isp-success2); color: #fff; }
.isp-btn-danger  { background: var(--isp-danger2); border-color: var(--isp-danger2); color: #fff; }
.isp-btn-warning { background: var(--isp-warning2); border-color: var(--isp-warning2); color: #fff; }
.isp-btn-ghost { background: rgba(255,255,255,0.03); border-color: var(--isp-border); }
.isp-btn-ghost:hover { background: var(--isp-surface2); border-color: var(--isp-border2); }
.isp-btn-sm { padding: .25rem .55rem; font-size: 12px; }

/* Cards */
.isp-card {
    background: var(--isp-surface);
    backdrop-filter: blur(20px);
    border: 1px solid var(--isp-border);
    border-radius: var(--isp-radius-lg);
    transition: all 0.3s ease;
    height: 100%;
    overflow: hidden;
}
.isp-card:hover {
    transform: translateY(-3px);
    border-color: var(--isp-primary);
    box-shadow: var(--isp-shadow);
}
.isp-card-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--isp-border);
}
.isp-card-body {
    padding: 1rem;
}
.isp-card-footer {
    padding: 0.75rem 1rem;
    background: rgba(0,0,0,0.2);
    border-top: 1px solid var(--isp-border);
}

/* KPIs */
.stat-card {
    background: var(--isp-surface);
    backdrop-filter: blur(20px);
    border: 1px solid var(--isp-border);
    border-radius: var(--isp-radius-lg);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}
.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
}
.stat-card.card-total::after { background: linear-gradient(90deg, #7209b7, #4361ee); }
.stat-card.card-email::after { background: linear-gradient(90deg, #4361ee, #06b6d4); }
.stat-card.card-whatsapp::after { background: linear-gradient(90deg, #2ecc71, #06d6a0); }
.stat-card.card-sms::after { background: linear-gradient(90deg, #f39c12, #ffb703); }
.stat-value { font-size: 1.8rem; font-weight: 800; line-height: 1; font-family: var(--isp-font-head); }
.stat-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: .06em; color: var(--isp-text-muted); }

/* Badges */
.badge-email { background: rgba(67,97,238,0.15); color: #4361ee; }
.badge-whatsapp { background: rgba(46,204,113,0.15); color: #2ecc71; }
.badge-sms { background: rgba(243,156,18,0.15); color: #f39c12; }
.badge-ativo { background: rgba(46,204,113,0.15); color: #2ecc71; }
.badge-inativo { background: rgba(239,71,111,0.15); color: #ef476f; }

/* Filtros */
.isp-filter-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.isp-filter-tab {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--isp-border);
    border-radius: 30px;
    padding: 0.4rem 1rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}
.isp-filter-tab i { margin-right: 0.5rem; }
.isp-filter-tab.active {
    background: var(--isp-primary);
    border-color: var(--isp-primary);
    box-shadow: 0 0 15px rgba(67,97,238,0.4);
}
.isp-filter-tab:hover:not(.active) { background: rgba(255,255,255,0.1); }
.isp-search-wrap {
    position: relative;
    width: 250px;
}
.isp-search-wrap .isp-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--isp-text-muted);
}
.isp-search-wrap #ispSearchInput {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--isp-border);
    border-radius: 30px;
    padding: 0.4rem 0.75rem 0.4rem 2rem;
    color: #fff;
    width: 100%;
    font-size: 0.75rem;
}
.isp-search-wrap #ispSearchInput:focus { outline: none; border-color: var(--isp-primary); box-shadow: 0 0 0 3px rgba(67,97,238,0.2); }

/* Toast */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

/* Log Flutuante */
.isp-log-floating {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 320px;
    z-index: 1060;
    background: rgba(26,26,46,0.95);
    backdrop-filter: blur(8px);
    border-radius: var(--isp-radius-lg);
    border: 1px solid var(--isp-border);
    box-shadow: var(--isp-shadow);
}
.isp-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid var(--isp-border);
    cursor: move;
    user-select: none;
}
.isp-log-header h6 { margin: 0; font-size: 0.75rem; font-weight: 600; }
.isp-log-body {
    max-height: 200px;
    overflow-y: auto;
    font-size: 11px;
    padding: 5px 0;
}
.log-entry {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.log-entry .le-time {
    margin-left: auto;
    color: var(--isp-text-dim);
    font-size: 10px;
}
.empty-state-log {
    text-align: center;
    color: var(--isp-text-dim);
    padding: 20px;
}

/* Modal */
.modal-content {
    background: var(--isp-surface);
    backdrop-filter: blur(20px);
    border: 1px solid var(--isp-border);
}

/* Preview de template */
.template-preview {
    background: rgba(0,0,0,0.2);
    border-radius: var(--isp-radius);
    max-height: 400px;
    overflow: auto;
}
.template-preview pre {
    background: rgba(0,0,0,0.3);
    padding: 0.75rem;
    border-radius: var(--isp-radius);
    color: var(--isp-text);
    font-family: var(--isp-font-mono);
    font-size: 0.7rem;
    white-space: pre-wrap;
}

@media (max-width: 768px) {
    .isp-log-floating { width: 280px; bottom: 10px; right: 10px; }
    .isp-search-wrap { width: 100%; margin-top: 0.5rem; }
}
