:root { --ink:#1d2330; --muted:#667085; --line:#e4e7ec; --bg:#f7f8fa; --accent:#1f5eff; --err:#b42318; }
* { box-sizing: border-box; }
body { margin:0; font:15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color:var(--ink); background:var(--bg); }
a { color:var(--accent); }
.topbar { display:flex; align-items:center; gap:16px; padding:10px 24px; background:#fff; border-bottom:1px solid var(--line); }
.brand { font-weight:600; text-decoration:none; color:var(--ink); }
.crumb { color:var(--muted); }
.logout { margin-left:auto; display:flex; gap:10px; align-items:center; }
.page { max-width:1100px; margin:32px auto; padding:0 24px; }
.narrow { max-width:420px; margin:64px auto; padding:32px; background:#fff; border:1px solid var(--line); border-radius:10px; }
h1 { font-size:22px; margin:0 0 16px; }
h2 { font-size:17px; margin:24px 0 8px; }
.stack { display:flex; flex-direction:column; gap:14px; }
label { display:flex; flex-direction:column; gap:4px; font-weight:500; }
input[type=email], input[type=password], input[type=text] { padding:9px 11px; border:1px solid #cfd4dc; border-radius:7px; font:inherit; }
input:focus { outline:2px solid var(--accent); outline-offset:1px; }
button { padding:9px 16px; border:0; border-radius:7px; background:var(--accent); color:#fff; font:inherit; font-weight:500; cursor:pointer; }
button.link { background:none; color:var(--accent); padding:0; }
.error { color:var(--err); background:#fef3f2; border:1px solid #fecdca; padding:8px 12px; border-radius:7px; }
.flash { background:#eff4ff; border:1px solid #c7d7fe; padding:8px 12px; border-radius:7px; }
.muted { color:var(--muted); }
.kv { display:grid; grid-template-columns:auto 1fr; gap:6px 14px; }
.kv dt { color:var(--muted); }
.kv dd { margin:0; }
.secret { font-family:ui-monospace, Menlo, Consolas, monospace; font-size:16px; letter-spacing:1px; }
table.list { width:100%; border-collapse:collapse; background:#fff; border:1px solid var(--line); border-radius:10px; overflow:hidden; }
table.list th, table.list td { text-align:left; padding:10px 14px; border-bottom:1px solid var(--line); }
table.list th { font-size:13px; color:var(--muted); font-weight:500; background:#fafbfc; }
table.list form { margin:0; }
.qr { display:block; margin:8px auto 16px; border:1px solid var(--line); border-radius:8px; background:#fff; }

/* fase 2 */
.topbar .tabs { display:flex; align-items:center; gap:14px; }
.topbar .tabs a, .logout a { text-decoration:none; }
.head { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:12px; }
.head h1 { margin:0; }
.button { display:inline-block; padding:9px 16px; border-radius:7px; background:var(--accent); color:#fff; text-decoration:none; font-weight:500; }
.actions { display:flex; align-items:center; gap:14px; }
.empty { padding:24px; background:#fff; border:1px dashed var(--line); border-radius:10px; color:var(--muted); }
.crumbs { margin:0 0 6px; }
.form { display:flex; flex-direction:column; gap:16px; }
.field { display:flex; flex-direction:column; gap:4px; font-weight:500; }
.field.has-error input, .field.has-error textarea, .field.has-error select { border-color:var(--err); }
.error-text { color:var(--err); font-weight:400; }
.help { color:var(--muted); font-weight:400; font-size:13px; }
.req { color:var(--err); }
select, textarea { padding:9px 11px; border:1px solid #cfd4dc; border-radius:7px; font:inherit; background:#fff; }
textarea.code, .code { font-family:ui-monospace, Menlo, Consolas, monospace; font-size:13px; }
input.short { max-width:180px; }
input[type=date] { padding:8px 10px; border:1px solid #cfd4dc; border-radius:7px; font:inherit; max-width:200px; }
.check { flex-direction:row; align-items:center; gap:8px; font-weight:400; }
.checks { display:flex; flex-wrap:wrap; gap:6px 18px; }
fieldset { border:1px solid var(--line); border-radius:10px; padding:14px 16px; background:#fff; display:flex; flex-direction:column; gap:14px; }
legend { font-weight:600; padding:0 6px; }
.grid2 { display:grid; grid-template-columns:repeat(auto-fit, minmax(240px, 1fr)); gap:14px; }
.two-cols { display:grid; grid-template-columns:minmax(0, 1fr) 280px; gap:28px; align-items:start; }
@media (max-width: 900px) { .two-cols { grid-template-columns:1fr; } }
.side-col { background:#fff; border:1px solid var(--line); border-radius:10px; padding:16px; }
.side-col h2:first-child { margin-top:0; }
.revisions { list-style:none; padding:0; margin:0 0 8px; }
.revisions li { display:flex; justify-content:space-between; align-items:center; padding:4px 0; border-bottom:1px solid var(--line); }
.revisions form { margin:0; }
.badge { display:inline-block; padding:2px 8px; border-radius:20px; font-size:12px; background:#f2f4f7; color:#344054; }
.badge.published { background:#ecfdf3; color:#027a48; }
.badge.unpublished { background:#fef3f2; color:#b42318; }
.badge.warn { background:#fffaeb; color:#b54708; }
button.danger { background:#fff; color:var(--err); border:1px solid #fecdca; }
.danger-zone { margin-top:20px; display:flex; flex-direction:column; align-items:flex-start; gap:6px; }
.help-box { background:#fff; border:1px solid var(--line); border-radius:10px; padding:10px 14px; font-size:14px; }
.help-box summary { cursor:pointer; font-weight:500; }
.media-pick summary { cursor:pointer; display:flex; align-items:center; gap:10px; color:var(--accent); font-weight:400; }
.thumb-sm { width:56px; height:56px; object-fit:cover; border-radius:6px; border:1px solid var(--line); }
.pick-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(120px, 1fr)); gap:10px; margin:10px 0; max-height:360px; overflow:auto; }
.pick { display:flex; flex-direction:column; gap:4px; font-weight:400; font-size:12px; border:1px solid var(--line); border-radius:8px; padding:6px; background:#fff; cursor:pointer; }
.pick img { width:100%; height:90px; object-fit:cover; border-radius:5px; }
.pick span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pick:has(input:checked) { outline:2px solid var(--accent); }
.pick.none { justify-content:center; align-items:center; min-height:90px; }
.upload { display:flex; flex-wrap:wrap; align-items:center; gap:10px; background:#fff; border:1px solid var(--line); border-radius:10px; padding:14px; margin-bottom:16px; }
.upload input[type=text] { flex:1; min-width:220px; }
.upload .help { flex-basis:100%; }
.media-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(170px, 1fr)); gap:14px; }
.media-card { display:flex; flex-direction:column; gap:6px; background:#fff; border:1px solid var(--line); border-radius:10px; padding:8px; text-decoration:none; color:var(--ink); font-size:13px; }
.media-card img { width:100%; height:130px; object-fit:cover; border-radius:6px; background:#f2f4f7; }
.media-card span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.preview { max-width:100%; height:auto; border-radius:10px; border:1px solid var(--line); background:#fff; }
.card { background:#fff; border:1px solid var(--line); border-radius:10px; padding:18px; margin-bottom:18px; }
.card h2 { margin-top:0; }
.narrow-form { max-width:380px; }
table.list .actions { justify-content:flex-end; }
