:root {
    --accent: #0b2e59;
    --accent-light: #eaf0f8;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --bg: #f7f8fa;
    --success: #14804a;
    --error: #b3261e;
    --radius: 8px;
}

* { box-sizing: border-box; }

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

.container {
    max-width: 980px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--accent);
    font-weight: 700;
    font-size: 16px;
}
.brand-logo { height: 32px; }
.topbar nav a {
    margin-left: 18px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
}
.topbar nav a:hover { color: var(--accent); }

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}
.page-head h1 { margin: 0 0 4px 0; font-size: 24px; }
.head-actions { display: flex; gap: 10px; }

h1 { font-size: 22px; }
h2 { font-size: 17px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.btn {
    display: inline-block;
    padding: 10px 16px;
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #082346; }
.btn-ghost { background: #fff; color: var(--accent); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-small { padding: 6px 10px; font-size: 12px; background: var(--accent-light); color: var(--accent); border-radius: 6px; }
.btn-icon { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 14px; }
.link-danger { background: none; border: none; color: var(--error); cursor: pointer; font-size: 13px; padding: 0; }
.inline-form { display: inline; }

form label {
    display: block;
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}
form input[type=text], form input[type=email], form input[type=password], form select {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text);
    background: #fff;
}
.inline-label { max-width: 240px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-actions { margin-top: 20px; }

.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
.table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.actions a { margin-right: 10px; color: var(--accent); text-decoration: none; font-size: 13px; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-draft { background: #f3f4f6; color: #4b5563; }
.badge-sent { background: #fef3c7; color: #92400e; }
.badge-validated { background: #d1fae5; color: #065f46; }

.empty-state { background: #fff; border: 1px dashed var(--border); border-radius: var(--radius); padding: 40px; text-align: center; }

.block-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.block-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.block-label { flex: 1; margin: 0 !important; }
.editor-toolbar { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.editor-toolbar button {
    background: var(--accent-light); border: none; color: var(--accent);
    padding: 6px 10px; border-radius: 5px; font-size: 12px; cursor: pointer;
}
.editor-toolbar button:hover { background: #dbe6f5; }
.editor {
    min-height: 140px;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    font-size: 14px;
    line-height: 1.5;
    background: #fff;
}
.editor:focus { outline: 2px solid var(--accent-light); border-color: var(--accent); }
.editor h2 { color: var(--accent); }
.hidden-content { display: none; }

.text-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.text-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.text-card-head h2 { margin: 0; color: var(--accent); }
.text-preview h2, .text-preview h3 { color: var(--accent); }
.text-preview { font-size: 14px; line-height: 1.6; }

.status-row { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; font-size: 14px; }
.status-row select { width: auto; margin: 0; padding: 8px 10px; }

.error { color: var(--error); background: #fdecea; border: 1px solid #f5c6c3; padding: 10px 14px; border-radius: 6px; }
.success { color: var(--success); background: #e8f7ef; border: 1px solid #b7e4cb; padding: 10px 14px; border-radius: 6px; }

.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--accent); }
.auth-box { background: #fff; border-radius: 12px; padding: 36px 32px; width: 100%; max-width: 380px; box-shadow: 0 10px 40px rgba(0,0,0,.2); }
.auth-box h1 { margin-top: 0; color: var(--accent); }
.auth-box .btn { width: 100%; text-align: center; }

@media (max-width: 640px) {
    .grid-2 { grid-template-columns: 1fr; }
    .page-head { flex-direction: column; gap: 12px; }
}
