:root {
    --bg: #f8f9fa;
    --card-bg: #ffffff;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --danger: #dc2626;
    --success: #16a34a;
    --warning: #d97706;
    --text: #1f2937;
    --text-light: #6b7280;
    --border: #e5e7eb;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

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

nav {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

nav .container {
    display: flex;
    align-items: center;
    gap: 2rem;
}

nav a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
}

nav a:hover { color: var(--primary); }
nav .logo { font-size: 1.25rem; font-weight: 700; }

h1, h2, h3 { margin-bottom: 1rem; }
h1 { font-size: 1.75rem; }

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
th { font-weight: 600; color: var(--text-light); font-size: 0.875rem; text-transform: uppercase; }
tr:hover { background: #f3f4f6; }
tr.clickable { cursor: pointer; }

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.75rem; }

.badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-draft { background: #e5e7eb; color: #374151; }
.badge-scheduled { background: #dbeafe; color: #1e40af; }
.badge-in_progress { background: #fef3c7; color: #92400e; }
.badge-completed { background: #d1fae5; color: #065f46; }
.badge-sent { background: #d1fae5; color: #065f46; }
.badge-pending { background: #dbeafe; color: #1e40af; }
.badge-failed { background: #fee2e2; color: #991b1b; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: 0.25rem; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
}
.form-group textarea { min-height: 200px; font-family: monospace; }

.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}
.alert-success { background: #d1fae5; color: #065f46; }
.alert-error { background: #fee2e2; color: #991b1b; }

.steps {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.step {
    padding: 0.5rem 1rem;
    background: #e5e7eb;
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--text-light);
}

.step.active { background: var(--primary); color: white; }
.step.done { background: #d1fae5; color: #065f46; }

.stats { display: flex; gap: 1rem; margin-bottom: 1.5rem; }
.stat { text-align: center; }
.stat-value { font-size: 1.5rem; font-weight: 700; }
.stat-label { font-size: 0.75rem; color: var(--text-light); }

.flex { display: flex; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }

.checkbox-list { max-height: 400px; overflow-y: auto; }
.checkbox-list label { display: block; padding: 0.5rem; cursor: pointer; }
.checkbox-list label:hover { background: #f3f4f6; }
.checkbox-list input[type="checkbox"] { margin-right: 0.5rem; }

.preview-card { border: 1px solid var(--border); border-radius: 6px; padding: 1rem; margin-bottom: 1rem; }
.preview-card .preview-to { font-weight: 600; margin-bottom: 0.25rem; }
.preview-card .preview-subject { color: var(--text-light); margin-bottom: 0.5rem; }

.follow-up-item {
    padding: 0.75rem;
    border-left: 3px solid var(--primary);
    margin-bottom: 0.5rem;
    background: #f9fafb;
}
.follow-up-item .follow-up-date { font-size: 0.75rem; color: var(--text-light); }
