:root {
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --accent: #3b82f6;
  --accent-dark: #2563eb;
  --bg: #f1f5f9;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }

/* Sidebar */
.sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 220px; background: var(--sidebar-bg); overflow-y: auto; z-index: 100; display: flex; flex-direction: column; }
.sidebar-logo { padding: 22px 20px; color: white; font-size: 0.95rem; font-weight: 700; border-bottom: 1px solid #1e293b; }
.sidebar-logo span { color: var(--accent); }
.sidebar-logo small { display: block; font-size: 0.65rem; font-weight: 400; color: var(--sidebar-text); margin-top: 2px; }
.sidebar-nav { padding: 10px 0; flex: 1; }
.nav-section { padding: 12px 20px 4px; color: #475569; font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.sidebar-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 20px; color: var(--sidebar-text); text-decoration: none; font-size: 0.85rem; transition: all 0.15s; border-left: 3px solid transparent; }
.sidebar-nav a:hover { background: rgba(255,255,255,0.05); color: white; }
.sidebar-nav a.active { background: rgba(59,130,246,0.15); color: white; border-left-color: var(--accent); }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid #1e293b; }
.sidebar-footer .user-email { font-size: 0.75rem; color: var(--sidebar-text); margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer a { color: #64748b; font-size: 0.75rem; text-decoration: none; }
.sidebar-footer a:hover { color: white; }

/* Main */
.main { margin-left: 220px; min-height: 100vh; }
.topbar { background: white; border-bottom: 1px solid var(--border); padding: 0 32px; height: 52px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; }
.topbar-title { font-size: 0.9rem; font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.content { padding: 28px 32px; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.card { background: white; border-radius: 10px; padding: 18px 20px; border: 1px solid var(--border); }
.card-label { font-size: 0.7rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.card-value { font-size: 1.6rem; font-weight: 700; color: var(--text); line-height: 1; }
.card-sub { font-size: 0.72rem; color: var(--text-muted); margin-top: 6px; }

/* Sections */
.section { background: white; border-radius: 10px; border: 1px solid var(--border); margin-bottom: 20px; }
.section-header { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.section-header h2 { font-size: 0.875rem; font-weight: 600; }
.section-body { padding: 20px; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th { padding: 8px 12px; text-align: left; font-size: 0.7rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 2px solid var(--border); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid var(--border); color: var(--text); }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #f8fafc; }

/* Forms */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 0.8rem; font-weight: 500; margin-bottom: 5px; }
.form-group input[type=text], .form-group input[type=email], .form-group input[type=password], .form-group input[type=number], .form-group select, .form-group textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 0.875rem; color: var(--text); background: white; transition: border 0.15s; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.form-group textarea { resize: vertical; min-height: 80px; font-family: inherit; }
.form-row { display: grid; gap: 14px; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-hint { font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; }
.form-sep { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 6px; border: none; cursor: pointer; font-size: 0.85rem; font-weight: 500; text-decoration: none; transition: all 0.15s; line-height: 1.2; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { background: white; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #16a34a; }
.btn-warning { background: var(--warning); color: white; }
.btn-sm { padding: 4px 10px; font-size: 0.78rem; }
.btn-lg { padding: 10px 20px; font-size: 0.95rem; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 0.68rem; font-weight: 600; }
.badge-active { background: #dcfce7; color: #166534; }
.badge-suspended { background: #fee2e2; color: #991b1b; }
.badge-admin { background: #dbeafe; color: #1e40af; }
.badge-user { background: #f1f5f9; color: #475569; }
.badge-nuevo { background: #f1f5f9; color: #475569; }
.badge-validado { background: #dcfce7; color: #166534; }
.badge-invalido { background: #fee2e2; color: #991b1b; }
.badge-enviado { background: #dbeafe; color: #1e40af; }
.badge-bounce { background: #fff7ed; color: #9a3412; }
.badge-unsubscribed { background: #f5f3ff; color: #5b21b6; }

/* Alerts */
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 18px; font-size: 0.85rem; display: flex; align-items: flex-start; gap: 8px; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-warning { background: #fef9c3; color: #854d0e; border: 1px solid #fde68a; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--sidebar-bg); }
.login-box { background: white; border-radius: 14px; padding: 36px; width: 360px; }
.login-logo { text-align: center; margin-bottom: 26px; }
.login-logo h1 { font-size: 1.2rem; font-weight: 700; }
.login-logo h1 span { color: var(--accent); }
.login-logo p { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

/* Toggle */
.toggle-list { }
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.toggle-row:last-child { border-bottom: none; }
.toggle-info .toggle-label { font-size: 0.85rem; font-weight: 500; }
.toggle-info .toggle-desc { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.toggle { position: relative; display: inline-block; width: 38px; height: 20px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: #cbd5e1; border-radius: 20px; transition: 0.2s; }
.toggle-slider:before { content: ''; position: absolute; height: 14px; width: 14px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: 0.2s; }
.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider:before { transform: translateX(18px); }

/* Misc */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state p { margin-top: 8px; font-size: 0.85rem; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-end { display: flex; justify-content: flex-end; }
.gap-8 { gap: 8px; }
.mt-16 { margin-top: 16px; }
.text-muted { color: var(--text-muted); font-size: 0.85rem; }
.text-right { text-align: right; }
.progress-bar { background: var(--border); border-radius: 4px; height: 6px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.3s; }
.progress-fill.warning { background: var(--warning); }
.progress-fill.danger { background: var(--danger); }
.search-bar { display: flex; gap: 8px; margin-bottom: 16px; }
.search-bar input { flex: 1; padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 0.85rem; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
