/* ── Modal ───────────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(27,36,48,0.34); display: flex; align-items: flex-start; justify-content: center; z-index: 1000; backdrop-filter: blur(3px); padding: 34px 24px; overflow-y: auto; }
.modal { background: var(--bg-1); border: none; border-radius: 18px; width: 100%; max-width: 880px; max-height: none; overflow: visible; box-shadow: var(--shadow-2); margin: auto; animation: modalIn 0.22s ease both; }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 22px 30px; border-bottom: 1px solid #edf0f3; position: sticky; top: 0; background: var(--bg-1); z-index: 2; border-radius: 18px 18px 0 0; }
.modal-header h3 { font-family: var(--font-display); font-size: 16px; font-weight: 700; letter-spacing: -0.01em; text-transform: none; }
.modal-close { font-size: 22px; color: var(--ink-3); line-height: 1; transition: color 120ms; }
.modal-close:hover { color: var(--ink-0); }
.modal-body { padding: 28px 30px; }

/* ── Toast ───────────────────────────────────────────────────────── */
.toast-container { position: fixed; top: 1rem; right: 1rem; z-index: 2000; }
.toast { background: var(--bg-1); color: var(--ink-0); padding: 13px 18px; border-radius: var(--radius-sm); margin-bottom: 0.5rem; font-size: 13.5px; animation: slideIn 0.3s ease; box-shadow: 0 12px 30px -12px rgba(20,26,34,0.28); border: 1px solid var(--border); }
.toast-success { border-color: var(--ok); border-left: 3px solid var(--ok); }
.toast-error { border-color: var(--danger); border-left: 3px solid var(--danger); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Login ───────────────────────────────────────────────────────── */
.login-screen { position: fixed; inset: 0; background: var(--bg-0); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.login-box { background: var(--bg-1); border: 1px solid var(--border); border-radius: 18px; padding: 48px 40px; width: 100%; max-width: 400px; text-align: center; box-shadow: var(--shadow-2); }

/* ── Forms ───────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-family: var(--font-display); font-size: 12.5px; font-weight: 600; color: var(--ink-1); text-transform: none; letter-spacing: 0; margin-bottom: 7px; }
input, select, textarea { width: 100%; padding: 11px 14px; background: #fbfcfd; border: 1px solid #dbe1e8; border-radius: 10px; font-size: 14px; font-family: var(--font-sans); color: var(--ink-0); transition: border-color 120ms, background 120ms; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); background: var(--bg-1); box-shadow: 0 0 0 3px rgba(47,102,144,0.10); }
input::placeholder { color: var(--ink-3); }
textarea { resize: vertical; min-height: 100px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
select { appearance: none; cursor: pointer; }
option { background: var(--bg-1); color: var(--ink-0); }

/* ── Tables ──────────────────────────────────────────────────────── */
.table-container { background: var(--bg-1); border-radius: var(--radius-sm); border: 1px solid #e6eaef; overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 18px; text-align: left; border-bottom: 1px solid #eef1f4; font-size: 13.5px; }
th { font-family: var(--font-display); font-size: 11.5px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.03em; background: #f6f8fa; position: sticky; top: 0; }
tbody tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafbfc; }
td b { font-weight: 600; color: var(--ink-0); }
td.num, th.num { text-align: right; font-family: var(--font-mono); }
.pos-pill { font-family: var(--font-mono); font-weight: 700; padding: 3px 9px; border-radius: 6px; }

/* ── Badges ──────────────────────────────────────────────────────── */
.badge { font-family: var(--font-display); font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 6px; text-transform: none; letter-spacing: 0.02em; white-space: nowrap; }
.badge-success { background: var(--ok-soft); color: var(--ok); }
.badge-warning { background: var(--warn-soft); color: var(--warn); }
.badge-danger  { background: var(--danger-soft); color: var(--danger); }
.badge-info    { background: var(--accent-soft); color: var(--accent-2); }
.badge-steel   { background: var(--steel-soft); color: var(--accent-2); }
.badge-neutral { background: var(--surface-2); color: var(--ink-2); }

/* ── Article preview (blog) ──────────────────────────────────────── */
.article-preview { background: #fcfdfe; border: 1px solid #e6eaef; border-radius: var(--radius-sm); padding: 24px 28px; max-height: 420px; overflow-y: auto; line-height: 1.7; }
.article-preview img { width: 100%; border-radius: 10px; margin-bottom: 18px; }
.article-preview h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin: 4px 0 12px; color: var(--ink-0); line-height: 1.2; }
.article-preview h3 { font-size: 17px; margin: 18px 0 8px; color: var(--accent-2); }
.article-preview p { margin: 12px 0; color: var(--ink-1); font-size: 15px; }
.article-preview ul, .article-preview ol { margin: 10px 0 10px 20px; list-style: revert; color: var(--ink-1); }
.article-preview table { margin: 14px 0; }

@media (max-width: 768px) { .form-row { grid-template-columns: 1fr; } .modal-overlay { padding: 16px; } }
