* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #0f172a; color: #e2e8f0; min-height: 100vh; }

a { color: #60a5fa; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Nav */
.navbar { background: #1e293b; border-bottom: 1px solid #334155; }
.nav-inner { max-width: 1200px; margin: 0 auto; padding: 0 1rem; display: flex; align-items: center; height: 56px; gap: 2rem; }
.brand { font-weight: 700; font-size: 1.1rem; color: #f1f5f9 !important; text-decoration: none !important; }
.nav-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.nav-links a { color: #94a3b8; font-size: 0.9rem; padding: 0.25rem 0; }
.nav-links a:hover { color: #e2e8f0; text-decoration: none; }

/* Layout */
.container { max-width: 1200px; margin: 0 auto; padding: 2rem 1rem; }

/* Cards */
.card { background: #1e293b; border: 1px solid #334155; border-radius: 8px; padding: 1.5rem; margin-bottom: 1rem; }
.card.empty { text-align: center; padding: 3rem; color: #64748b; }
.form-card { max-width: 500px; margin: 2rem auto; }
.form-card h1 { margin-bottom: 1.5rem; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.85rem; color: #94a3b8; margin-bottom: 0.4rem; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 0.6rem 0.75rem; background: #0f172a; border: 1px solid #334155;
    border-radius: 6px; color: #e2e8f0; font-size: 0.95rem; outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: #60a5fa; }
.form-group textarea { resize: vertical; min-height: 60px; }

/* Buttons */
.btn { display: inline-block; padding: 0.5rem 1rem; border-radius: 6px; font-size: 0.9rem;
    background: #334155; color: #e2e8f0; border: 1px solid transparent; cursor: pointer; text-decoration: none !important; }
.btn:hover { background: #475569; }
.btn.primary { background: #2563eb; color: #fff; }
.btn.primary:hover { background: #1d4ed8; }
.btn.danger { background: #dc2626; color: #fff; }
.btn.danger:hover { background: #b91c1c; }
.btn.small { padding: 0.3rem 0.6rem; font-size: 0.8rem; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #1e293b; border-radius: 8px; overflow: hidden; }
th, td { padding: 0.6rem 0.75rem; text-align: left; border-bottom: 1px solid #334155; font-size: 0.9rem; }
th { background: #0f172a; color: #94a3b8; font-weight: 600; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.05em; }
tr:hover td { background: #1a2332; }

/* Badges */
.badge { display: inline-block; padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }
.badge-message { background: #1e3a5f; color: #60a5fa; }
.badge-call, .badge-voice { background: #3b1f3b; color: #c084fc; }
.badge-mixed { background: #1e3a3a; color: #34d399; }
.badge-draft { background: #334155; color: #94a3b8; }
.badge-scheduled { background: #1e3a5f; color: #60a5fa; }
.badge-sending, .badge-queued { background: #5f3b1e; color: #fbbf24; }
.badge-completed, .badge-delivered { background: #1a3b1a; color: #4ade80; }
.badge-partial { background: #3b3b1e; color: #fbbf24; }
.badge-failed { background: #3b1a1a; color: #f87171; }
.badge-cancelled { background: #2d1a1a; color: #94a3b8; }
.badge-pending { background: #1e293b; color: #64748b; }
.badge-no_answer, .badge-busy { background: #3b2d1a; color: #fb923c; }
.badge-generating, .badge-generating_voices { background: #2d3b4d; color: #60a5fa; animation: pulse 1.5s infinite; }
.badge-calling { background: #2d4d3b; color: #4ade80; }
.badge-answered { background: #1a3b2d; color: #34d399; }
.badge-ready { background: #1a4d2d; color: #4ade80; }
.badge-paused { background: #4d3b1a; color: #fbbf24; }
.badge-playing { background: #2d3b4d; color: #60a5fa; animation: pulse 1s infinite; }
.badge-auto { background: #2d1a4d; color: #c084fc; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Dashboard */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { text-align: center; padding: 2rem 1rem; }
.stat-num { display: block; font-size: 2.5rem; font-weight: 700; color: #60a5fa; }
.stat-label { font-size: 0.85rem; color: #94a3b8; margin-top: 0.25rem; }
.stat-card.warning .stat-num { color: #fbbf24; }

.quick-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 0.5rem; }
.page-header h1 { font-size: 1.5rem; }

.campaign-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
.btn.warning { background: #d97706; color: #fff; }
.btn.warning:hover { background: #b45309; }

.content-cell { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.error-cell { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #f87171; font-size: 0.8rem; }

.key-reveal { border: 2px solid #2563eb; }
.key-display { display: block; background: #0f172a; padding: 0.75rem; border-radius: 4px; font-family: monospace; font-size: 0.9rem; word-break: break-all; margin: 0.5rem 0; }

.checkbox-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0; border-bottom: 1px solid #1e293b; }
.checkbox-row input[type="checkbox"] { width: auto; }
.checkbox-row select, .checkbox-row input[type="text"] { max-width: 200px; margin-left: auto; }

/* Auth */
.auth-page { display: flex; justify-content: center; padding-top: 4rem; }
.auth-page .form-card { width: 100%; }

/* Alerts */
.alert { padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.9rem; }
.alert.error { background: #3b1a1a; border: 1px solid #5f1a1a; color: #f87171; }
.alert.success { background: #1a3b1a; border: 1px solid #1a5f1a; color: #4ade80; }

.muted { color: #64748b; font-size: 0.85rem; margin-top: 0.25rem; }

/* Voice player */
.voice-cell { display: flex; flex-direction: column; gap: 0.3rem; min-width: 160px; }
.voice-player { height: 32px; width: 100%; min-width: 140px; }
.rendered-text { font-size: 0.75rem; color: #94a3b8; cursor: help; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }

/* Template display */
.template-display { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid #334155; }
.template-display blockquote { background: #0f172a; padding: 0.5rem 0.75rem; border-radius: 4px; margin-top: 0.25rem; font-style: italic; color: #cbd5e1; }

code { background: #0f172a; padding: 0.1rem 0.3rem; border-radius: 3px; font-size: 0.8rem; color: #60a5fa; }

.msg-cell { display: flex; align-items: center; gap: 0.4rem; }
.msg-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; cursor: help; }
.template-badge { font-size: 0.65rem; padding: 0.1rem 0.35rem; border-radius: 3px; background: #2d3b4d; color: #60a5fa; flex-shrink: 0; }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1.5rem; padding: 1rem; }
.page-info { color: #94a3b8; font-size: 0.85rem; }

/* Profile */
.profile-page .form-card { max-width: 500px; margin: 0 auto; }
