:root { --navy:#0f1f3a; --navy-2:#1b3358; --gold:#b8893a; --ink:#1f2633; --muted:#5c6578; --line:#e2e6ee; --bg:#f5f7fa; --danger:#b3261e; }
* { box-sizing: border-box; }
body { margin:0; font-family:"Source Sans 3", "Segoe UI", system-ui, sans-serif; color:var(--ink); background:var(--bg); font-size:15px; }
[hidden] { display:none !important; }
a { color:inherit; }
.muted { color:var(--muted); }
.error { color:var(--danger); min-height:1.2em; margin:0; }

.btn { display:inline-block; padding:10px 18px; border-radius:6px; border:1px solid transparent; font:inherit; font-weight:600; cursor:pointer; text-decoration:none; }
.btn:disabled { opacity:.6; cursor:wait; }
.btn-primary { background:var(--navy); color:#fff; }
.btn-primary:hover { background:var(--navy-2); }
.btn-ghost { background:#fff; color:var(--navy); border-color:var(--navy); }
.btn-ghost:hover { background:var(--navy); color:#fff; }
.btn-outline { background:transparent; color:#fff; border-color:rgba(255,255,255,.6); }
.btn-danger { background:#fff; color:var(--danger); border-color:#e5b5b1; }
.btn-sm { padding:7px 14px; font-size:.88rem; }
.btn-block { width:100%; }

/* Login */
.login-wrap { min-height:100vh; display:grid; place-items:center; background:linear-gradient(180deg, var(--navy), var(--navy-2)); padding:16px; }
.login-card { background:#fff; padding:36px; border-radius:10px; width:min(380px, 100%); box-shadow:0 20px 50px rgba(0,0,0,.25); display:grid; gap:14px; }
.login-card h1 { margin:0; font-size:1.5rem; color:var(--navy); font-family:"Libre Baskerville", Georgia, serif; }
.login-card label { display:grid; gap:6px; font-weight:600; font-size:.9rem; color:var(--navy); }
input, textarea { font:inherit; padding:10px 12px; border:1px solid #cfd5e2; border-radius:6px; width:100%; background:#fff; color:var(--ink); }
input:focus, textarea:focus { outline:none; border-color:var(--gold); box-shadow:0 0 0 3px rgba(184,137,58,.2); }

/* Shell */
.topbar { display:flex; justify-content:space-between; align-items:center; background:var(--navy); color:#fff; padding:14px 24px; flex-wrap:wrap; gap:10px; }
.top-actions { display:flex; gap:8px; }
.layout { display:grid; grid-template-columns:230px 1fr; min-height:calc(100vh - 56px); }
.sidebar { background:#fff; border-right:1px solid var(--line); padding:16px 10px; }
.sidebar button { display:block; width:100%; text-align:left; background:none; border:0; padding:10px 12px; border-radius:6px; font:inherit; cursor:pointer; color:var(--ink); }
.sidebar button:hover { background:var(--bg); }
.sidebar button.active { background:var(--navy); color:#fff; }
.editor { padding:24px; max-width:960px; width:100%; }

.panel { background:#fff; border:1px solid var(--line); border-radius:10px; padding:24px; margin-bottom:20px; }
.panel h2 { margin:0 0 16px; font-size:1.15rem; color:var(--navy); font-family:"Libre Baskerville", Georgia, serif; }
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.grid2 .full { grid-column:1 / -1; }
.field { display:grid; gap:6px; font-weight:600; font-size:.85rem; color:var(--navy); }
.item { border:1px solid var(--line); border-radius:8px; padding:16px; margin-bottom:12px; background:#fbfcfe; }
.item-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; font-weight:600; color:var(--navy); }
.add-row { margin-top:4px; }
.savebar { position:sticky; bottom:0; background:#fff; border-top:1px solid var(--line); margin:0 -24px -24px; padding:14px 24px; display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; }
.savebar-actions { display:flex; gap:8px; flex-wrap:wrap; }
#status { font-weight:600; color:var(--gold); }

/* Photo upload */
.photo-row { display:flex; gap:18px; align-items:flex-start; flex-wrap:wrap; }
.photo-preview { width:140px; height:175px; object-fit:cover; border-radius:8px; border:1px solid var(--line); background:var(--bg); }
.photo-preview.empty { display:grid; place-items:center; color:var(--muted); font-weight:600; }
.photo-actions { display:grid; gap:8px; min-width:220px; }
.photo-actions input[type=file] { padding:8px; background:#fff; }

@media (max-width:760px) {
  .layout { grid-template-columns:1fr; }
  .sidebar { display:flex; overflow-x:auto; gap:4px; border-right:0; border-bottom:1px solid var(--line); }
  .sidebar button { white-space:nowrap; width:auto; }
  .grid2 { grid-template-columns:1fr; }
  .editor { padding:16px; }
  .savebar { margin:0 -16px -16px; padding:12px 16px; }
}

.check-field { display:flex; align-items:center; gap:10px; font-size:.95rem; }
.check-field input { width:auto; }
