/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: #1e293b; background: #f1f5f9; }

/* ===== LOGIN ===== */
.login-body { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.login-wrapper { width: 100%; max-width: 420px; padding: 24px; }
.login-card { background: white; border-radius: 20px; padding: 48px 40px; box-shadow: 0 25px 50px rgba(0,0,0,0.15); }
.login-logo { display: flex; justify-content: center; margin-bottom: 20px; }
.login-title { text-align: center; font-size: 1.5rem; font-weight: 700; color: #1e293b; margin-bottom: 8px; }
.login-subtitle { text-align: center; color: #64748b; font-size: 0.9rem; margin-bottom: 32px; }
.login-form { display: flex; flex-direction: column; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.875rem; font-weight: 600; color: #374151; }
.form-group input { padding: 12px 16px; border: 2px solid #e2e8f0; border-radius: 10px; font-size: 1rem; transition: border-color 0.2s; outline: none; }
.form-group input:focus { border-color: #4F46E5; }
.btn-login { background: #4F46E5; color: white; border: none; border-radius: 10px; padding: 14px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: background 0.2s, transform 0.1s; }
.btn-login:hover { background: #4338CA; transform: translateY(-1px); }
.alert { padding: 12px 16px; border-radius: 10px; font-size: 0.875rem; margin-bottom: 16px; }
.alert-error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.login-footer { text-align: center; color: rgba(255,255,255,0.7); font-size: 0.8rem; margin-top: 24px; }

/* ===== DASHBOARD LAYOUT ===== */
.dashboard-body { display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar { width: 240px; background: #1e293b; display: flex; flex-direction: column; padding: 24px 16px; position: fixed; top: 0; left: 0; height: 100vh; z-index: 100; }
.sidebar-logo { display: flex; align-items: center; gap: 12px; padding: 8px 12px; margin-bottom: 32px; }
.sidebar-logo span { color: white; font-weight: 700; font-size: 0.95rem; }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px; color: #94a3b8; text-decoration: none; font-size: 0.9rem; font-weight: 500; transition: all 0.2s; }
.nav-item:hover, .nav-item.active { background: rgba(79,70,229,0.2); color: white; }
.nav-item.active { background: #4F46E5; }
.sidebar-footer { padding: 16px 12px; border-top: 1px solid #334155; display: flex; flex-direction: column; gap: 8px; }
.sidebar-footer span { color: #94a3b8; font-size: 0.8rem; }
.btn-logout { color: #f87171; font-size: 0.8rem; text-decoration: none; font-weight: 600; }
.btn-logout:hover { color: #ef4444; }

/* MAIN */
.main-content { margin-left: 240px; flex: 1; padding: 32px; min-height: 100vh; }

/* TOPBAR */
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; }
.page-title { font-size: 1.75rem; font-weight: 700; color: #0f172a; }
.page-subtitle { color: #64748b; font-size: 0.9rem; margin-top: 4px; }
.topbar-date { background: white; padding: 8px 16px; border-radius: 8px; font-size: 0.85rem; color: #64748b; border: 1px solid #e2e8f0; }

/* KPI CARDS */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 32px; }
.kpi-card { background: white; border-radius: 16px; padding: 24px; display: flex; align-items: center; gap: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); border: 1px solid #f1f5f9; transition: box-shadow 0.2s; }
.kpi-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.kpi-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.kpi-blue   { background: #eff6ff; color: #3b82f6; }
.kpi-purple { background: #f5f3ff; color: #7c3aed; }
.kpi-green  { background: #f0fdf4; color: #16a34a; }
.kpi-orange { background: #fff7ed; color: #ea580c; }
.kpi-red    { background: #fef2f2; color: #dc2626; }
.kpi-gray   { background: #f8fafc; color: #64748b; }
.kpi-data { display: flex; flex-direction: column; gap: 4px; }
.kpi-label { font-size: 0.8rem; color: #64748b; font-weight: 500; }
.kpi-value { font-size: 1.6rem; font-weight: 700; color: #0f172a; line-height: 1; }

/* SECTIONS */
.section-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.section-header h2 { font-size: 1.1rem; font-weight: 700; color: #1e293b; }
.badge { background: #f1f5f9; color: #64748b; font-size: 0.75rem; padding: 4px 10px; border-radius: 20px; font-weight: 600; }

/* CHART */
.chart-section { background: white; border-radius: 16px; padding: 24px; margin-bottom: 32px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); border: 1px solid #f1f5f9; }
.chart-wrapper { height: 280px; }

/* TABLE */
.table-section { background: white; border-radius: 16px; padding: 24px; margin-bottom: 32px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); border: 1px solid #f1f5f9; }
.table-wrapper { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th { background: #f8fafc; padding: 12px 16px; text-align: left; font-weight: 600; color: #64748b; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 2px solid #e2e8f0; }
.data-table td { padding: 14px 16px; border-bottom: 1px solid #f1f5f9; color: #374151; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f8fafc; }
.td-title { font-weight: 600; color: #1e293b; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-warn { color: #dc2626; font-weight: 600; }

/* STATUS BADGES */
.status-badge { padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.status-sent      { background: #f0fdf4; color: #16a34a; }
.status-draft     { background: #f8fafc; color: #64748b; }
.status-scheduled { background: #eff6ff; color: #3b82f6; }
.status-sending   { background: #fff7ed; color: #ea580c; }

/* PROGRESS BARS */
.progress-cell { display: flex; align-items: center; gap: 8px; }
.progress-bar { flex: 1; height: 6px; background: #e2e8f0; border-radius: 10px; overflow: hidden; min-width: 60px; }
.progress-fill { height: 100%; border-radius: 10px; transition: width 0.3s; }
.progress-fill.green { background: #10b981; }
.progress-fill.blue  { background: #4F46E5; }
.progress-cell span  { font-weight: 600; color: #374151; min-width: 36px; font-size: 0.8rem; }

/* LISTS GRID */
.lists-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.list-card { display: flex; align-items: center; gap: 14px; padding: 16px 20px; background: #f8fafc; border-radius: 12px; border: 1px solid #e2e8f0; }
.list-icon { color: #4F46E5; }
.list-info { display: flex; flex-direction: column; }
.list-name { font-weight: 600; color: #1e293b; font-size: 0.9rem; }
.list-count { font-size: 0.8rem; color: #64748b; }

/* EMPTY STATE */
.empty-state { padding: 40px; text-align: center; color: #94a3b8; font-size: 0.9rem; }

/* RESPONSIVE */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .main-content { margin-left: 0; padding: 20px; }
    .kpi-grid { grid-template-columns: 1fr 1fr; }
}
