@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --primary: #28BDBD;
    --primary-dark: #22a3a3;
    --secondary: #FA8938;
    --accent: #A670DB;
    --bg: #F6F6F0;
    --fg: #2B303B;
    --muted: #E8E4DB;
    --muted-fg: #4A5571;
    --border: #D8DFE8;
    --white: #ffffff;
    --red: #F84444;
    --orange: #FA8938;
    --green: #10b981;
    --blue: #3b82f6;
    --purple: #A670DB;
    --ring: #2DCCCC;
    --shadow-sm: rgba(0,0,0,0.05) 0px 1px 2px 0px;
    --shadow-md: rgba(0,0,0,0.1) 0px 4px 6px -1px, rgba(0,0,0,0.1) 0px 2px 4px -2px;
    --shadow-lg: rgba(0,0,0,0.1) 0px 10px 15px -3px, rgba(0,0,0,0.1) 0px 4px 6px -4px;
    --radius: 14px;
    --radius-lg: 16px;
    --radius-pill: 9999px;
    --sidebar-active-bg: #e0f5f5;
}
body { font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--fg); min-height: 100vh; }

/* ===== LOGIN ===== */
.login-screen { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); position: relative; }
.login-screen::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: radial-gradient(ellipse at top, rgba(40, 189, 189, 0.08), transparent 60%); pointer-events: none; }
.login-card { background: var(--white); border-radius: var(--radius-lg); padding: 48px 40px; max-width: 400px; width: 90%; text-align: center; box-shadow: var(--shadow-lg); position: relative; z-index: 1; }
.login-logo { font-size: 48px; margin-bottom: 12px; line-height: 1; }
.login-card h1 { font-family: 'Poppins', sans-serif; font-size: 26px; font-weight: 700; color: var(--fg); margin-bottom: 4px; }
.login-card h1 span { color: var(--primary); }
.login-sub { color: var(--muted-fg); font-size: 14px; margin-bottom: 28px; font-weight: 400; }
.login-card input { width: 100%; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; outline: none; margin-bottom: 12px; transition: border 0.2s; font-family: inherit; background: var(--white); }
.login-card input:focus { border-color: var(--ring); box-shadow: 0 0 0 3px rgba(45, 204, 204, 0.15); }
.login-error { color: var(--red); font-size: 13px; margin-top: 12px; min-height: 20px; }

/* ===== BUTTONS ===== */
.btn { padding: 10px 22px; border: none; border-radius: var(--radius-pill); font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; gap: 8px; font-family: inherit; box-shadow: var(--shadow-sm); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary { background: rgba(255,255,255,0.15); color: white; border: 1px solid rgba(255,255,255,0.3); box-shadow: none; }
.btn-secondary:hover { background: rgba(255,255,255,0.25); }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); box-shadow: none; }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-danger { background: var(--red); color: white; }
.btn-ghost { background: transparent; color: var(--muted-fg); border: 1px solid var(--border); box-shadow: none; }
.btn-ghost:hover { background: var(--muted); }
.btn-small { padding: 6px 16px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; padding: 14px; font-size: 15px; margin-top: 8px; }

/* ===== APP LAYOUT ===== */
.app-screen { min-height: 100vh; }
.app-screen.visible { display: flex !important; }

/* ===== SIDEBAR ===== */
.sidebar { width: 240px; min-width: 240px; background: var(--white); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 60; overflow-y: auto; }
.sidebar-logo { display: flex; align-items: center; gap: 10px; padding: 20px 18px; border-bottom: 1px solid var(--border); }
.sidebar-logo-icon { font-size: 28px; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: var(--sidebar-active-bg); border-radius: 10px; }
.sidebar-logo-text strong { font-size: 15px; color: var(--fg); display: block; font-weight: 700; }
.sidebar-logo-text small { font-size: 11px; color: var(--muted-fg); font-weight: 400; }

.sidebar-section { padding: 16px 12px 8px; }
.sidebar-section-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted-fg); padding: 0 8px; margin-bottom: 6px; }

.sidebar-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: none; background: transparent; border-radius: 10px; font-size: 13px; font-weight: 500; color: var(--muted-fg); cursor: pointer; transition: all 0.15s; font-family: inherit; text-decoration: none; margin-bottom: 2px; }
.sidebar-item:hover { background: var(--bg); color: var(--fg); }
.sidebar-item.active { background: var(--sidebar-active-bg); color: var(--primary); font-weight: 600; }
.sidebar-item.active svg { stroke: var(--primary); }
.sidebar-item svg { flex-shrink: 0; opacity: 0.6; }
.sidebar-item.active svg { opacity: 1; }

.sidebar-bottom { margin-top: auto; padding: 12px; border-top: 1px solid var(--border); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 10px 8px; margin-top: 8px; }
.sidebar-user-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: white; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 13px; font-weight: 600; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-email { font-size: 11px; color: var(--muted-fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-logout { background: transparent; border: none; padding: 6px; border-radius: 8px; cursor: pointer; color: var(--muted-fg); transition: all 0.15s; }
.sidebar-logout:hover { background: #fde8e8; color: var(--red); }

/* ===== TOPBAR ===== */
.app-main { flex: 1; margin-left: 240px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { background: var(--white); border-bottom: 1px solid var(--border); padding: 0 32px; height: 52px; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 50; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted-fg); font-weight: 500; }
.breadcrumb span:last-child { color: var(--fg); font-weight: 600; }
.breadcrumb svg { opacity: 0.4; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.topbar-actions .date { font-size: 12px; color: var(--muted-fg); font-weight: 400; }
.user-info { font-size: 12px; color: var(--muted-fg); font-weight: 400; display: none; }

/* ===== LAYOUT ===== */
.main { padding: 24px 32px; max-width: 1400px; flex: 1; }

/* ===== TABS ===== */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== KPI ===== */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.kpi-card { background: var(--white); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); border: 1px solid var(--border); border-left: 4px solid var(--primary); }
.kpi-card.red { border-left-color: var(--red); }
.kpi-card.orange { border-left-color: var(--orange); }
.kpi-card.green { border-left-color: var(--green); }
.kpi-card.blue { border-left-color: var(--blue); }
.kpi-card.purple { border-left-color: var(--purple); }
.kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted-fg); margin-bottom: 4px; font-weight: 600; }
.kpi-value { font-size: 32px; font-weight: 700; color: var(--fg); }
.kpi-sub { font-size: 12px; color: var(--muted-fg); margin-top: 4px; font-weight: 400; }

/* ===== CHARTS ===== */
.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.chart-card { background: var(--white); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.chart-card h3 { font-size: 15px; margin-bottom: 16px; color: var(--fg); font-weight: 600; }
.funnel { display: flex; flex-direction: column; gap: 7px; }
.funnel-step { display: flex; align-items: center; gap: 12px; }
.funnel-label { width: 110px; font-size: 12px; font-weight: 500; text-align: right; color: var(--muted-fg); }
.funnel-bar-wrap { flex: 1; background: var(--muted); border-radius: var(--radius-pill); height: 24px; overflow: hidden; }
.funnel-bar { height: 100%; border-radius: var(--radius-pill); transition: width 0.8s ease; display: flex; align-items: center; padding-left: 10px; font-size: 11px; font-weight: 600; color: white; min-width: fit-content; }
.country-bars { display: flex; flex-direction: column; gap: 8px; }
.country-row { display: flex; align-items: center; gap: 10px; }
.country-flag { font-size: 18px; width: 24px; text-align: center; }
.country-name { width: 90px; font-size: 12px; font-weight: 500; color: var(--muted-fg); }
.country-bar-wrap { flex: 1; background: var(--muted); border-radius: var(--radius-pill); height: 20px; overflow: hidden; }
.country-bar { height: 100%; background: var(--primary); border-radius: var(--radius-pill); display: flex; align-items: center; padding-left: 8px; font-size: 11px; color: white; font-weight: 600; transition: width 0.8s ease; }

/* ===== TABLE ===== */
.table-section { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--border); overflow: hidden; }
.table-header { padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; border-bottom: 1px solid var(--border); }
.table-header h3 { font-size: 16px; color: var(--fg); font-weight: 600; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filter-input { padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; outline: none; transition: all 0.2s; font-family: inherit; background: var(--white); }
.filter-input:focus { border-color: var(--ring); box-shadow: 0 0 0 3px rgba(45, 204, 204, 0.1); }
select.filter-input { cursor: pointer; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead { background: #faf9f6; }
th { padding: 10px 14px; text-align: left; font-weight: 600; color: var(--muted-fg); text-transform: uppercase; font-size: 11px; letter-spacing: 0.5px; cursor: pointer; user-select: none; white-space: nowrap; }
th:hover { color: var(--fg); }
th .sort-icon { margin-left: 4px; opacity: 0.4; }
th.active .sort-icon { opacity: 1; color: var(--primary); }
td { padding: 8px 14px; border-bottom: 1px solid #f0ede6; }
tr:hover { background: rgba(40, 189, 189, 0.03); }
a.email-link { color: var(--primary); text-decoration: none; font-weight: 500; }
a.email-link:hover { text-decoration: underline; }

/* Status badges */
.status-badge { display: inline-block; padding: 3px 10px; border-radius: var(--radius-pill); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.status-new { background: #dbeafe; color: #2563eb; }
.status-contacted { background: #fef3c7; color: #92400e; }
.status-replied { background: #d1fae5; color: #065f46; }
.status-interested { background: #ede9fe; color: #7c3aed; }
.status-joined_pawify { background: var(--primary); color: white; }
.status-follow_up_needed { background: #fed7aa; color: #9a3412; }
.status-onboarding { background: #e9d5ff; color: #6b21a8; }
.status-researching { background: #ddd6fe; color: #5b21b6; }
.status-not_interested { background: #fecaca; color: #dc2626; }

/* Pagination */
.table-footer { padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted-fg); }
.pagination { display: flex; gap: 4px; }
.pagination button { width: 30px; height: 30px; border: 1px solid var(--border); background: var(--white); border-radius: 8px; cursor: pointer; font-size: 12px; transition: all 0.2s; font-family: inherit; }
.pagination button:hover { border-color: var(--primary); color: var(--primary); }
.pagination button.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ===== MODAL ===== */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(43,48,59,0.4); backdrop-filter: blur(4px); z-index: 1000; align-items: center; justify-content: center; }
.modal-overlay.show { display: flex; }
.modal { background: var(--white); border-radius: var(--radius-lg); padding: 32px; max-width: 560px; width: 90%; max-height: 80vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal h2 { margin-bottom: 20px; color: var(--fg); font-weight: 700; font-size: 20px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 4px; color: var(--muted-fg); }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; outline: none; font-family: inherit; background: var(--white); }
.form-group input:focus, .form-group select:focus { border-color: var(--ring); box-shadow: 0 0 0 3px rgba(45, 204, 204, 0.1); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px; }

/* ===== EMAIL PREVIEW ===== */
.email-section { margin-bottom: 24px; }
.email-controls { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.email-controls label { font-size: 13px; font-weight: 600; color: var(--muted-fg); }
.divider-v { width: 1px; height: 24px; background: var(--border); }
.email-pill-group { display: flex; gap: 3px; background: var(--muted); border-radius: var(--radius-pill); padding: 3px; }
.email-pill { padding: 7px 16px; border: none; border-radius: var(--radius-pill); font-size: 13px; font-weight: 600; cursor: pointer; background: transparent; color: var(--muted-fg); transition: all 0.2s; font-family: inherit; }
.email-pill.active { background: var(--primary); color: white; box-shadow: var(--shadow-sm); }
.email-pill:hover:not(.active) { background: var(--border); }
.email-preview-grid { display: grid; grid-template-columns: 280px 1fr; gap: 16px; min-height: 500px; }
.email-sidebar { background: var(--white); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.email-sidebar h4 { font-size: 14px; color: var(--fg); margin-bottom: 12px; font-weight: 600; }
.email-info-item { margin-bottom: 10px; }
.email-info-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted-fg); margin-bottom: 2px; font-weight: 600; }
.email-info-value { font-size: 13px; color: var(--fg); font-weight: 500; }
.sep { margin: 16px 0; border: none; border-top: 1px solid var(--border); }
.email-sequence-flow { margin-top: 8px; }
.seq-step { display: flex; align-items: flex-start; gap: 12px; padding: 10px; margin-bottom: 4px; border-radius: 10px; cursor: pointer; transition: all 0.15s; border: 2px solid transparent; }
.seq-step:hover { background: rgba(40, 189, 189, 0.04); }
.seq-step.active { border-color: var(--primary); background: rgba(40, 189, 189, 0.06); }
.seq-dot { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: white; flex-shrink: 0; }
.seq-dot.t1 { background: var(--primary); }
.seq-dot.t2 { background: var(--orange); }
.seq-dot.t3 { background: var(--red); }
.seq-info { flex: 1; }
.seq-title { font-size: 13px; font-weight: 600; color: var(--fg); }
.seq-desc { font-size: 11px; color: var(--muted-fg); margin-top: 2px; }
.email-render-area { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--border); overflow: hidden; }
.email-render-header { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.email-render-header .subject { font-size: 15px; font-weight: 600; color: var(--fg); }
.email-badge { font-size: 11px; color: var(--muted-fg); background: var(--muted); padding: 4px 12px; border-radius: var(--radius-pill); font-weight: 500; }
.email-meta { display: flex; gap: 20px; padding: 10px 20px; background: #faf9f6; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--muted-fg); }
.email-meta strong { color: var(--fg); }
.email-render-body { padding: 20px; min-height: 400px; }
.email-render-body iframe { width: 100%; border: none; min-height: 450px; }

/* ===== GROWTH IDEAS ===== */
.ideas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.idea-card { background: var(--white); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); border: 1px solid var(--border); border-top: 4px solid var(--muted); transition: transform 0.2s, box-shadow 0.2s; }
.idea-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.idea-card.priority-high { border-top-color: var(--red); }
.idea-card.priority-medium { border-top-color: var(--orange); }
.idea-card.priority-low { border-top-color: var(--primary); }
.idea-priority { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; color: var(--muted-fg); }
.idea-card h3 { font-size: 15px; color: var(--fg); margin-bottom: 8px; font-weight: 600; }
.idea-card p { font-size: 13px; color: var(--muted-fg); line-height: 1.5; margin-bottom: 12px; font-weight: 400; }
.idea-status { display: inline-block; padding: 4px 12px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 600; }
.idea-status.active { background: #d1fae5; color: #065f46; }
.idea-status.planned { background: #ddd6fe; color: #5b21b6; }

/* ===== TOAST ===== */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--fg); color: white; padding: 12px 20px; border-radius: var(--radius); font-size: 14px; box-shadow: var(--shadow-lg); animation: slideIn 0.3s ease; font-weight: 500; }
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }
@keyframes slideIn { from { transform: translateX(100px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ===== LOADING ===== */
.loading { display: flex; align-items: center; justify-content: center; padding: 60px; color: var(--muted-fg); }
.spinner { width: 24px; height: 24px; border: 3px solid var(--muted); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; margin-right: 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== EMAIL PLATFORM ===== */

/* Sub-Navigation */
.email-subnav { display: flex; gap: 2px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px; margin-bottom: 20px; overflow-x: auto; }
.email-subtab { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border: none; background: transparent; border-radius: 10px; font-size: 13px; font-weight: 500; color: var(--muted-fg); cursor: pointer; transition: all 0.15s; font-family: inherit; white-space: nowrap; }
.email-subtab:hover { background: var(--bg); color: var(--fg); }
.email-subtab.active { background: var(--sidebar-active-bg); color: var(--primary); font-weight: 600; }
.email-subtab svg { flex-shrink: 0; opacity: 0.5; }
.email-subtab.active svg { opacity: 1; stroke: var(--primary); }

/* Sub-Tab Content */
.email-subtab-content { display: none; }
.email-subtab-content.active { display: block; }

/* Section Headers */
.email-section-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.email-section-header h2 { font-size: 20px; font-weight: 700; color: var(--fg); margin: 0; }
.section-subtitle { font-size: 13px; color: var(--muted-fg); margin-top: 2px; }
.section-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Email Card (shared) */
.email-card { background: var(--white); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.email-card h3 { font-size: 15px; font-weight: 600; color: var(--fg); margin: 0 0 16px; }

/* ===== OVERVIEW ===== */
.email-overview-grid { display: flex; flex-direction: column; gap: 16px; }
.email-kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.email-kpi { display: flex; align-items: center; gap: 14px; background: var(--white); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.email-kpi-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.email-kpi-value { font-size: 24px; font-weight: 700; color: var(--fg); }
.email-kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted-fg); font-weight: 600; }
.email-overview-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Warmup */
.warmup-progress { margin-bottom: 16px; }
.warmup-bar-wrap { background: var(--muted); border-radius: var(--radius-pill); height: 12px; overflow: hidden; margin-bottom: 6px; }
.warmup-bar { height: 100%; background: linear-gradient(90deg, var(--primary), #10b981); border-radius: var(--radius-pill); transition: width 0.6s ease; }
.warmup-stats { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted-fg); }
.warmup-target { font-weight: 600; color: var(--primary); }
.warmup-info { display: flex; flex-direction: column; gap: 8px; }
.warmup-info-item { display: flex; justify-content: space-between; font-size: 13px; }
.warmup-info-label { color: var(--muted-fg); }
.warmup-info-value { font-weight: 500; color: var(--fg); }

/* Quick Actions */
.quick-actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick-action-btn { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); cursor: pointer; transition: all 0.15s; font-family: inherit; color: var(--muted-fg); font-size: 12px; font-weight: 500; }
.quick-action-btn:hover { border-color: var(--primary); color: var(--primary); background: rgba(40, 189, 189, 0.04); }

/* Platform Summary */
.platform-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.summary-item { text-align: center; padding: 12px; background: var(--bg); border-radius: 10px; }
.summary-number { font-size: 28px; font-weight: 700; color: var(--fg); }
.summary-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted-fg); font-weight: 600; }

/* Recent Activity */
.recent-activity { display: flex; flex-direction: column; gap: 8px; }
.activity-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; transition: background 0.15s; }
.activity-item:hover { background: var(--bg); }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-dot-sent, .status-dot-delivered { background: #10b981; }
.status-dot-opened { background: #3b82f6; }
.status-dot-clicked { background: #8b5cf6; }
.status-dot-bounced { background: #f59e0b; }
.status-dot-failed { background: #F84444; }
.status-dot-queued { background: #6b7280; }
.activity-info { flex: 1; min-width: 0; }
.activity-to { font-size: 13px; font-weight: 500; color: var(--fg); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-subject { font-size: 11px; color: var(--muted-fg); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-time { font-size: 11px; color: var(--muted-fg); white-space: nowrap; }

/* Empty States */
.empty-state { text-align: center; padding: 20px; color: var(--muted-fg); font-size: 13px; }
.empty-state-card { background: var(--white); border: 2px dashed var(--border); border-radius: var(--radius); padding: 40px; text-align: center; }
.empty-state-card p { margin-bottom: 16px; color: var(--muted-fg); }

/* ===== TEMPLATES ===== */
.templates-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.template-card { background: var(--white); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); border: 1px solid var(--border); cursor: pointer; transition: all 0.15s; }
.template-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.template-card-header { display: flex; gap: 6px; margin-bottom: 10px; align-items: center; }
.template-lang-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-pill); }
.lang-es { background: #fef3c7; color: #92400e; }
.lang-fr { background: #dbeafe; color: #2563eb; }
.lang-pt { background: #d1fae5; color: #065f46; }
.lang-en { background: #ede9fe; color: #7c3aed; }
.template-cat-badge { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--muted); color: var(--muted-fg); }
.template-inactive-badge { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: var(--radius-pill); background: #fecaca; color: #dc2626; }
.template-name { font-size: 14px; font-weight: 600; color: var(--fg); margin-bottom: 4px; }
.template-subject { font-size: 12px; color: var(--muted-fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 12px; }
.template-card-footer { display: flex; justify-content: space-between; align-items: center; }
.template-date { font-size: 11px; color: var(--muted-fg); }
.template-card-actions { display: flex; gap: 4px; }

/* Icon Button */
.icon-btn { background: transparent; border: none; padding: 6px; border-radius: 8px; cursor: pointer; color: var(--muted-fg); transition: all 0.15s; display: flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--bg); color: var(--fg); }
.icon-btn.danger:hover { background: #fef2f2; color: var(--red); }

/* Template Editor */
.template-editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.template-editor-form { background: var(--white); border-radius: var(--radius); padding: 20px; border: 1px solid var(--border); }
.template-preview-panel { background: var(--white); border-radius: var(--radius); padding: 20px; border: 1px solid var(--border); max-height: 80vh; overflow-y: auto; }
.preview-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.preview-header h4 { font-size: 14px; font-weight: 600; color: var(--fg); margin: 0; }
.preview-fields { display: flex; gap: 6px; }
.preview-subject { font-size: 14px; font-weight: 600; color: var(--fg); padding: 10px; background: var(--bg); border-radius: 8px; margin-bottom: 12px; }
.preview-body { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; min-height: 400px; }

/* Smart Fields */
.smart-fields-bar { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.smart-field-tag { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: var(--radius-pill); background: rgba(40, 189, 189, 0.1); color: var(--primary); cursor: pointer; transition: all 0.15s; }
.smart-field-tag:hover { background: rgba(40, 189, 189, 0.2); }
.field-hint { font-size: 11px; font-weight: 400; color: var(--muted-fg); }
.code-textarea { font-family: 'Menlo', 'Monaco', 'Courier New', monospace; font-size: 12px; line-height: 1.5; background: #faf9f6; }

/* ===== SEQUENCES ===== */
.sequences-list { display: flex; flex-direction: column; gap: 8px; }
.sequence-card { display: flex; justify-content: space-between; align-items: center; background: var(--white); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow-sm); border: 1px solid var(--border); cursor: pointer; transition: all 0.15s; }
.sequence-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.sequence-card-left { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.sequence-status-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.sequence-card-left h4 { font-size: 14px; font-weight: 600; color: var(--fg); margin: 0; }
.sequence-desc { font-size: 12px; color: var(--muted-fg); margin-top: 2px; }
.sequence-card-meta { display: flex; align-items: center; gap: 10px; }
.sequence-step-count { font-size: 12px; color: var(--muted-fg); }
.sequence-status-badge { font-size: 10px; font-weight: 600; padding: 3px 10px; border-radius: var(--radius-pill); text-transform: uppercase; }
.seq-status-draft { background: var(--muted); color: var(--muted-fg); }
.seq-status-active { background: #d1fae5; color: #065f46; }
.seq-status-paused { background: #fef3c7; color: #92400e; }
.seq-status-completed { background: #dbeafe; color: #2563eb; }
.sequence-lang { font-size: 10px; font-weight: 700; color: var(--muted-fg); }

/* Sequence Editor */
.sequence-editor-layout { display: grid; grid-template-columns: 300px 1fr; gap: 16px; }
.sequence-info-panel { background: var(--white); border-radius: var(--radius); padding: 20px; border: 1px solid var(--border); }
.sequence-steps-panel { background: var(--white); border-radius: var(--radius); padding: 20px; border: 1px solid var(--border); }
.steps-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.steps-header h3 { font-size: 15px; font-weight: 600; color: var(--fg); margin: 0; }
.steps-list { display: flex; flex-direction: column; gap: 10px; }
.step-card { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.step-card-header { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--bg); border-bottom: 1px solid var(--border); }
.step-number { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: white; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.step-title { flex: 1; font-size: 13px; font-weight: 600; color: var(--fg); }
.step-card-body { padding: 14px; }

/* ===== CAMPAIGNS ===== */
.campaigns-list { display: flex; flex-direction: column; gap: 8px; }
.campaign-card { display: flex; justify-content: space-between; align-items: center; background: var(--white); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow-sm); border: 1px solid var(--border); transition: all 0.15s; gap: 16px; }
.campaign-card:hover { border-color: var(--primary); }
.campaign-card-left { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.campaign-type-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: rgba(40, 189, 189, 0.1); color: var(--primary); }
.campaign-type-icon.bulk { background: rgba(166, 112, 219, 0.1); color: var(--accent); }
.campaign-type-icon.sequence { background: rgba(250, 137, 56, 0.1); color: var(--secondary); }
.campaign-card-left h4 { font-size: 14px; font-weight: 600; color: var(--fg); margin: 0; }
.campaign-meta-row { display: flex; gap: 8px; font-size: 12px; color: var(--muted-fg); margin-top: 2px; }
.campaign-type-label { text-transform: capitalize; }
.campaign-card-right { display: flex; align-items: center; gap: 12px; }
.campaign-progress-section { min-width: 120px; }
.campaign-progress-bar-wrap { background: var(--muted); border-radius: var(--radius-pill); height: 6px; overflow: hidden; margin-bottom: 4px; }
.campaign-progress-bar { height: 100%; border-radius: var(--radius-pill); transition: width 0.6s ease; }
.campaign-progress-text { font-size: 11px; color: var(--muted-fg); }
.campaign-status-badge { font-size: 10px; font-weight: 600; padding: 3px 10px; border-radius: var(--radius-pill); text-transform: uppercase; }
.camp-status-draft { background: var(--muted); color: var(--muted-fg); }
.camp-status-sending { background: #fef3c7; color: #92400e; }
.camp-status-paused { background: #fed7aa; color: #9a3412; }
.camp-status-completed { background: #d1fae5; color: #065f46; }
.camp-status-cancelled { background: #fecaca; color: #dc2626; }
.campaign-actions { display: flex; gap: 4px; }

/* Campaign Editor */
.campaign-editor-grid { display: grid; grid-template-columns: 1fr 300px; gap: 16px; }
.campaign-editor-form { background: var(--white); border-radius: var(--radius); padding: 20px; border: 1px solid var(--border); }
.campaign-summary-panel { background: var(--white); border-radius: var(--radius); padding: 20px; border: 1px solid var(--border); }
.campaign-target-preview { background: var(--bg); padding: 12px 16px; border-radius: 10px; font-size: 13px; color: var(--fg); margin-top: 12px; }

/* ===== LOGS ===== */
.logs-status-pills { display: flex; gap: 4px; margin-bottom: 16px; overflow-x: auto; padding-bottom: 4px; }
.log-status-pill { padding: 6px 14px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--white); font-size: 12px; font-weight: 500; color: var(--muted-fg); cursor: pointer; transition: all 0.15s; font-family: inherit; white-space: nowrap; }
.log-status-pill:hover { border-color: var(--primary); color: var(--primary); }
.log-status-pill.active { background: var(--primary); color: white; border-color: var(--primary); }
.logs-table-wrap { background: var(--white); border-radius: var(--radius); border: 1px solid var(--border); overflow-x: auto; }
.logs-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.logs-table thead { background: #faf9f6; }
.logs-table th { padding: 10px 14px; text-align: left; font-weight: 600; color: var(--muted-fg); text-transform: uppercase; font-size: 11px; letter-spacing: 0.5px; white-space: nowrap; }
.logs-table td { padding: 10px 14px; border-bottom: 1px solid #f0ede6; }
.send-status-badge { display: inline-block; padding: 2px 8px; border-radius: var(--radius-pill); font-size: 10px; font-weight: 600; text-transform: uppercase; }
.send-status-queued { background: var(--muted); color: var(--muted-fg); }
.send-status-sent { background: #fef3c7; color: #92400e; }
.send-status-delivered { background: #d1fae5; color: #065f46; }
.send-status-opened { background: #dbeafe; color: #2563eb; }
.send-status-clicked { background: #ede9fe; color: #7c3aed; }
.send-status-bounced { background: #fed7aa; color: #9a3412; }
.send-status-failed { background: #fecaca; color: #dc2626; }
.send-status-unsubscribed { background: var(--muted); color: #6b7280; }
.log-to-cell { display: flex; flex-direction: column; }
.log-to-cell strong { font-size: 13px; }
.log-email { font-size: 11px; color: var(--muted-fg); }
.log-subject { max-width: 250px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-dash { color: var(--muted-fg); }

/* ===== ANALYTICS ===== */
.analytics-kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.analytics-kpi { background: var(--white); border-radius: var(--radius); padding: 20px; text-align: center; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.analytics-kpi-value { font-size: 32px; font-weight: 700; color: var(--fg); }
.analytics-kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted-fg); font-weight: 600; margin-top: 4px; }
.analytics-charts-row { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; margin-bottom: 16px; }
.analytics-chart-card { min-height: 200px; }

/* Daily Chart */
.daily-chart { display: flex; align-items: flex-end; gap: 2px; height: 150px; padding-top: 10px; }
.daily-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.daily-bar { width: 100%; min-width: 4px; background: var(--primary); border-radius: 3px 3px 0 0; transition: height 0.4s ease; }
.daily-bar-label { font-size: 9px; color: var(--muted-fg); margin-top: 4px; transform: rotate(-45deg); white-space: nowrap; }

/* Status Breakdown */
.status-breakdown { display: flex; flex-direction: column; gap: 10px; }
.breakdown-row { display: flex; align-items: center; gap: 8px; }
.breakdown-color { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.breakdown-label { width: 70px; font-size: 12px; color: var(--muted-fg); }
.breakdown-bar-wrap { flex: 1; background: var(--muted); border-radius: var(--radius-pill); height: 8px; overflow: hidden; }
.breakdown-bar { height: 100%; border-radius: var(--radius-pill); transition: width 0.6s ease; }
.breakdown-value { font-size: 12px; font-weight: 600; color: var(--fg); min-width: 30px; text-align: right; }

/* ===== SETTINGS ===== */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; }
.settings-card { }
.settings-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.settings-card-header h3 { margin: 0; }
.settings-status { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: var(--radius-pill); }
.settings-status.connected { background: #d1fae5; color: #065f46; }
.settings-status.active { background: #d1fae5; color: #065f46; }
.settings-status.inactive { background: var(--muted); color: var(--muted-fg); }

/* Warmup Schedule */
.warmup-schedule { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.warmup-week { display: flex; align-items: center; gap: 8px; }
.warmup-week-label { font-size: 11px; color: var(--muted-fg); width: 60px; text-align: right; }
.warmup-week-bar-wrap { flex: 1; background: var(--muted); border-radius: var(--radius-pill); height: 8px; overflow: hidden; }
.warmup-week-bar { height: 100%; background: linear-gradient(90deg, var(--primary), #10b981); border-radius: var(--radius-pill); transition: width 0.4s ease; }
.warmup-week-limit { font-size: 11px; font-weight: 600; color: var(--fg); min-width: 50px; }

/* Danger Zone */
.danger-zone { border-color: #fecaca; }
.danger-actions { display: flex; flex-direction: column; gap: 16px; }
.danger-item { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid #fecaca; }
.danger-item:last-child { border-bottom: none; }
.danger-item p { font-size: 12px; color: var(--muted-fg); margin: 4px 0 0; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .sidebar { display: none; }
    .app-main { margin-left: 0; }
}
@media (max-width: 768px) {
    .charts-row { grid-template-columns: 1fr; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .main { padding: 16px; }
    .email-preview-grid { grid-template-columns: 1fr; }
    .ideas-grid { grid-template-columns: 1fr; }
    .email-overview-row { grid-template-columns: 1fr; }
    .template-editor-grid { grid-template-columns: 1fr; }
    .sequence-editor-layout { grid-template-columns: 1fr; }
    .campaign-editor-grid { grid-template-columns: 1fr; }
    .analytics-charts-row { grid-template-columns: 1fr; }
    .settings-grid { grid-template-columns: 1fr; }
    .campaign-card { flex-direction: column; align-items: flex-start; }
    .campaign-card-right { width: 100%; justify-content: space-between; }
    .platform-summary { grid-template-columns: repeat(2, 1fr); }
    .email-subnav { gap: 0; }
    .email-subtab { padding: 6px 10px; font-size: 12px; }
    .templates-grid { grid-template-columns: 1fr; }
}
