:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --ink: #1d2433;
    --muted: #667085;
    --brand: #0f766e;
    --brand-dark: #0a5d57;
    --danger: #b42318;
    --danger-bg: #fef3f2;
    --success: #027a48;
    --success-bg: #ecfdf3;
    --border: #d9deea;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(180deg, #f8fafc 0%, #eef3ff 100%);
    color: var(--ink);
}

.container {
    width: min(1100px, 94%);
    margin: 0 auto;
}

.topbar {
    background: #0b1220;
    color: #f8fafc;
    border-bottom: 1px solid #1e293b;
}

.topbar-inner {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    color: #f8fafc;
    text-decoration: none;
    font-weight: 700;
}

.nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav a {
    color: #dbe4ff;
    text-decoration: none;
    font-weight: 600;
}

main.container {
    padding: 24px 0 40px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 18px;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
}

.auth-card {
    max-width: 460px;
    margin: 60px auto 0;
}

h1, h2 {
    margin: 0 0 10px;
}

.subtle {
    margin: 0 0 16px;
    color: var(--muted);
}

label {
    display: block;
    margin-top: 12px;
    margin-bottom: 6px;
    font-weight: 600;
}

input, textarea, button, .btn {
    font: inherit;
}

input, textarea {
    width: 100%;
    border: 1px solid #c7d2e5;
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
}

input:focus, textarea:focus {
    outline: 2px solid #99f6e4;
    border-color: var(--brand);
}

button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 10px;
    border: none;
    background: var(--brand);
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
}

button:hover, .btn:hover {
    background: var(--brand-dark);
}

.btn.secondary {
    background: #475467;
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 10px 8px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}

th {
    color: #475467;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.actions a {
    color: var(--brand);
    text-decoration: none;
    font-weight: 600;
}

.actions form {
    margin: 0;
}

.link-btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--danger);
    text-decoration: underline;
}

.form-actions {
    margin-top: 18px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.alert {
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-weight: 600;
}

.alert.error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid #fecdca;
}

.alert.success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid #abefc6;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.editor-toolbar button {
    padding: 7px 10px;
}

.editor {
    min-height: 280px;
    border: 1px solid #c7d2e5;
    border-radius: 10px;
    padding: 12px;
    background: #fff;
}

.recipient-list {
    margin-top: 0;
    padding-left: 20px;
}

.footer {
    border-top: 1px solid var(--border);
    padding: 16px 0;
    color: #667085;
}

@media (max-width: 780px) {
    .topbar-inner {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px 0;
    }

    .page-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}
