:root {
  --bg: #0d0e10; --panel: #16181d; --panel-2: #1b1e24; --line: #262a31;
  --text: #e9e6df; --muted: #9298a0; --muted-2: #6f757d; --accent: #b89b6e; --accent-soft: #c9b088;
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: 'Inter', system-ui, sans-serif; font-weight: 300; }
h1,h2,h3,legend { font-family: 'Cormorant Garamond', serif; font-weight: 600; letter-spacing: 0.3px; }
a { color: var(--accent-soft); text-decoration: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-family: 'Inter'; font-size: 14px; font-weight: 500; padding: 12px 22px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; transition: 0.25s; }
.btn-sm { padding: 9px 16px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-accent { background: var(--accent); color: #17130c; }
.btn-accent:hover { background: var(--accent-soft); }
.btn-ghost { border-color: var(--line); color: var(--text); background: none; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-soft); }
.btn-danger { border-color: #4a2c2c; color: #d08a7a; background: none; }
.btn-danger:hover { background: #2a1a1a; }

/* LOGIN */
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(60% 60% at 50% 0%, rgba(184,155,110,0.08), var(--bg)); }
.login-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 40px 34px; text-align: center; }
.login-card h1 { font-size: 30px; }
.login-card > p { color: var(--muted); font-size: 13px; margin: 8px 0 28px; }
.login-card input { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; color: var(--text); padding: 14px 16px; font-size: 15px; margin-bottom: 14px; font-family: 'Inter'; }
.login-card input:focus { outline: none; border-color: var(--accent); }
.login-error { color: #d08a7a; font-size: 13px; margin-top: 12px; min-height: 16px; }

/* LAYOUT */
.admin { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 26px 18px; position: sticky; top: 0; height: 100vh; }
.side-brand { font-family: 'Cormorant Garamond', serif; font-size: 24px; font-weight: 600; padding: 0 10px 24px; display: flex; flex-direction: column; }
.side-brand small { font-family: 'Inter'; font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted-2); font-weight: 400; margin-top: 4px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.side-nav button { text-align: left; background: none; border: 0; color: var(--muted); font-family: 'Inter'; font-size: 15px; padding: 12px 14px; border-radius: 9px; cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: space-between; }
.side-nav button:hover { color: var(--text); background: var(--panel-2); }
.side-nav button.active { color: var(--text); background: var(--panel-2); box-shadow: inset 2px 0 0 var(--accent); }
.pill { background: var(--accent); color: #17130c; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; }
.side-foot { display: flex; flex-direction: column; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.side-foot a { font-size: 13px; color: var(--muted); }
.side-foot a:hover { color: var(--accent-soft); }
.side-foot button { background: none; border: 0; color: var(--muted-2); font-size: 13px; text-align: left; cursor: pointer; font-family: 'Inter'; padding: 0; }
.side-foot button:hover { color: #d08a7a; }

.content { padding: 40px 44px; max-width: 1000px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 30px; flex-wrap: wrap; }
.panel-head h2 { font-size: 32px; }
.panel-head p { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* LIST / CARDS */
.list { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; transition: 0.2s; }
.row:hover { border-color: #33383f; }
.row-thumb { width: 58px; height: 58px; border-radius: 9px; background: var(--panel-2); display: grid; place-items: center; overflow: hidden; flex-shrink: 0; color: var(--accent); }
.row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-thumb svg { width: 30px; height: 30px; }
.thumb-ph { font-family: 'PT Serif', 'Cormorant Garamond', serif; font-size: 15px; color: var(--muted-2); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 16px; font-weight: 500; }
.row-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.row-tags { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.tag { font-size: 11px; color: var(--muted-2); border: 1px solid var(--line); padding: 2px 9px; border-radius: 999px; }
.tag.gold { color: var(--accent-soft); border-color: rgba(184,155,110,0.4); }
.tag.off { color: #b96f6f; border-color: #4a2c2c; }
.row-actions { display: flex; gap: 8px; flex-shrink: 0; }
.icon-btn { width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--line); background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; font-size: 15px; transition: 0.2s; }
.icon-btn:hover { color: var(--text); border-color: var(--accent); }
.icon-btn.del:hover { color: #d08a7a; border-color: #4a2c2c; }

.empty { color: var(--muted-2); padding: 40px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }

/* SETTINGS */
.settings-form { display: flex; flex-direction: column; gap: 24px; max-width: 760px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; background: var(--panel); }
legend { padding: 0 10px; font-size: 20px; color: var(--accent-soft); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); gap: 6px; }
input, textarea, select { background: var(--bg); border: 1px solid var(--line); border-radius: 9px; color: var(--text); font-family: 'Inter'; font-size: 14px; font-weight: 300; padding: 11px 13px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
.hint { font-size: 12.5px; color: var(--muted-2); line-height: 1.6; }
.hint b { color: var(--muted); }

/* MODAL */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; overflow-y: auto; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(6,7,8,0.7); backdrop-filter: blur(4px); }
.modal-card { position: relative; z-index: 1; width: 100%; max-width: 560px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; margin: auto; }
.modal-card h3 { font-size: 26px; margin-bottom: 22px; }
.modal-close { position: absolute; top: 16px; right: 18px; background: none; border: 0; color: var(--muted); font-size: 26px; cursor: pointer; }
.modal-close:hover { color: var(--text); }
#editForm { display: flex; flex-direction: column; gap: 14px; }
#editForm .row-inline { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.check { flex-direction: row; align-items: center; gap: 10px; color: var(--text); font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.upload-area { display: flex; gap: 12px; align-items: center; }
.upload-preview { width: 64px; height: 64px; border-radius: 9px; background: var(--bg); border: 1px solid var(--line); object-fit: cover; }
.modal-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; }

/* TOAST */
.toast { position: fixed; top: 22px; right: 22px; z-index: 200; background: var(--panel-2); border: 1px solid var(--accent); color: var(--text); padding: 14px 20px; border-radius: 10px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,0.4); animation: slidein 0.3s; }
.toast.err { border-color: #6a3a3a; }
@keyframes slidein { from { opacity: 0; transform: translateX(20px); } }

@media (max-width: 760px) {
  .admin { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; }
  .side-brand { padding: 0; }
  .side-nav { flex-direction: row; flex-wrap: wrap; flex: 1 1 100%; }
  .side-foot { flex-direction: row; border: 0; padding: 0; margin-left: auto; }
  .content { padding: 24px 18px; }
  .grid-2, #editForm .row-inline { grid-template-columns: 1fr; }
}
