:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --error: #ef4444;
    --radius: 12px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    margin-bottom: 2rem;
    min-width: 0;
}

h1, h2, h3 { margin-top: 0; color: var(--text); }
h2 { font-size: 1.25rem; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-size: 0.875rem; font-weight: 500; color: var(--text-muted); }

#smtp-form {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
#smtp-form .form-group {
    margin-bottom: 0;
}

input[type="text"], input[type="password"], input[type="email"], select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 0.875rem;
    transition: all 0.2s;
}
input:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); }

button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
button:hover { background: var(--primary-hover); transform: translateY(-1px); }
button:active { transform: translateY(0); }
button.secondary { background: white; color: var(--text); border: 1px solid var(--border); }
button.secondary:hover { background: var(--bg); }

.presets { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.presets button { flex: 1; padding: 0.5rem; font-size: 0.875rem; }

#editor-container { height: 150px; margin-bottom: 1rem; border-radius: 8px; }
.ql-toolbar { border-top-left-radius: 8px; border-top-right-radius: 8px; }
.ql-container { border-bottom-left-radius: 8px; border-bottom-right-radius: 8px; }

.variables-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: 8px;
}
.variable-badge {
    background: white;
    border: 1px solid var(--border);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}
.variable-badge:hover { border-color: var(--primary); color: var(--primary); }

table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: 0.875rem; }
th, td { padding: 0.75rem; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { background: var(--bg); font-weight: 500; color: var(--text-muted); }
.table-container { overflow-x: auto; max-height: 300px; position: relative; }

/* Sticky Right Column for Status */
.sticky-status-col {
    position: sticky;
    right: 0;
    border-left: 1px solid var(--border);
    z-index: 2;
}
th.sticky-status-col {
    background: var(--bg);
}
td.sticky-status-col {
    background: var(--surface);
}

.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}
.status-success { background: #d1fae5; color: #065f46; }
.status-error { background: #fee2e2; color: #991b1b; }

.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
}
.upload-zone:hover { border-color: var(--primary); background: rgba(99, 102, 241, 0.05); }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.card { animation: fadeIn 0.3s ease-out forwards; }
