:root {
  --bg: #0c0c0e; --panel: #151517; --panel-2: #1c1c1f; --line: rgba(255,255,255,0.09);
  --text: #ece9e4; --muted: #908b82; --accent: #c8a27a; --danger: #d9694f;
  --sans: "Inter", system-ui, sans-serif; --serif: "Fraunces", serif;
  --ease: cubic-bezier(0.22,1,0.36,1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); font-weight: 300; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font-family: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
img { display: block; max-width: 100%; }

/* ---------- LOGIN ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(circle at 30% 20%, #19191c, #0c0c0e 70%); }
.login-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 40px 34px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5); }
.login-card h1 { font-family: var(--serif); font-weight: 300; font-size: 1.7rem; }
.login-card p { color: var(--muted); font-size: 0.9rem; margin-bottom: 8px; }
.login-card input { background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px;
  padding: 13px 15px; font-size: 0.95rem; transition: border-color 0.3s; }
.login-card input:focus { outline: none; border-color: var(--accent); }
.login-card button { background: var(--accent); color: #0c0c0e; border: 0; border-radius: 9px;
  padding: 13px; font-weight: 500; cursor: pointer; transition: transform 0.2s, filter 0.2s; }
.login-card button:hover { filter: brightness(1.08); }
.login-card button:active { transform: scale(0.98); }
.login-error { color: var(--danger); font-size: 0.85rem; min-height: 1em; }

/* ---------- DASHBOARD ---------- */
.dash { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--panel); border-right: 1px solid var(--line);
  padding: 28px 20px; display: flex; flex-direction: column; gap: 30px; position: sticky; top: 0; height: 100vh; }
.side-brand { font-family: var(--serif); font-size: 1.3rem; }
.side-brand span { display: block; font-family: var(--sans); font-size: 0.62rem; letter-spacing: 0.25em;
  text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.tab { background: none; border: 0; text-align: left; padding: 11px 14px; border-radius: 8px;
  color: var(--muted); cursor: pointer; font-size: 0.92rem; transition: 0.25s; }
.tab:hover { color: var(--text); background: var(--panel-2); }
.tab.active { color: var(--text); background: var(--panel-2); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; font-size: 0.85rem; }
.side-foot button { background: none; border: 0; color: var(--muted); text-align: left; cursor: pointer; padding: 0; }
.side-foot button:hover { color: var(--danger); }

.content { padding: 40px clamp(20px, 4vw, 56px); max-width: 1100px; }
.panel { display: none; }
.panel.active { display: block; animation: fade 0.4s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.panel-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px;
  margin-bottom: 34px; flex-wrap: wrap; }
.panel-head h2 { font-family: var(--serif); font-weight: 300; font-size: 2rem; }
.panel-head p { color: var(--muted); font-size: 0.92rem; margin-top: 4px; }
.btn-primary { background: var(--accent); color: #0c0c0e; border: 0; border-radius: 9px;
  padding: 11px 20px; font-weight: 500; cursor: pointer; transition: transform 0.2s, filter 0.2s; white-space: nowrap; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: scale(0.97); }

/* ---------- COLLECTIONS ADMIN ---------- */
.collections-admin { display: flex; flex-direction: column; gap: 20px; }
.col-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.col-card-head { display: flex; align-items: center; gap: 14px; padding: 18px 20px; cursor: pointer; }
.col-handle { color: var(--muted); cursor: grab; font-size: 1.1rem; user-select: none; }
.col-cover { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--panel-2); flex-shrink: 0; }
.col-info { flex: 1; min-width: 0; }
.col-info h3 { font-family: var(--serif); font-weight: 400; font-size: 1.2rem; }
.col-info small { color: var(--muted); font-size: 0.8rem; }
.col-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn { background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
  width: 34px; height: 34px; border-radius: 8px; cursor: pointer; display: grid; place-items: center;
  font-size: 0.9rem; transition: 0.25s; }
.icon-btn:hover { color: var(--text); border-color: var(--accent); }
.icon-btn.danger:hover { color: var(--danger); border-color: var(--danger); }
.col-toggle { font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--line); padding: 6px 10px; border-radius: 20px; cursor: pointer; background: none; }
.col-toggle.on { color: var(--accent); border-color: var(--accent); }

.col-body { padding: 0 20px 20px; display: none; }
.col-card.open .col-body { display: block; }

.dropzone { border: 1.5px dashed var(--line); border-radius: 12px; padding: 26px; text-align: center;
  color: var(--muted); cursor: pointer; transition: 0.25s; margin-bottom: 18px; }
.dropzone:hover, .dropzone.drag { border-color: var(--accent); color: var(--text); background: var(--panel-2); }
.dropzone strong { color: var(--accent); }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.photo-thumb { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--panel-2); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb .ph-actions { position: absolute; inset: 0; background: rgba(8,8,9,0.55); opacity: 0;
  display: flex; flex-direction: column; justify-content: space-between; padding: 8px; transition: opacity 0.25s; }
.photo-thumb:hover .ph-actions { opacity: 1; }
.ph-actions .top { display: flex; justify-content: flex-end; gap: 6px; }
.ph-actions button { background: rgba(0,0,0,0.5); border: 0; color: #fff; border-radius: 6px;
  width: 28px; height: 28px; cursor: pointer; font-size: 0.8rem; transition: 0.2s; }
.ph-actions button:hover { background: var(--accent); color: #0c0c0e; }
.ph-actions button.del:hover { background: var(--danger); color: #fff; }
.ph-cover-badge { position: absolute; top: 6px; left: 6px; background: var(--accent); color: #0c0c0e;
  font-size: 0.58rem; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 7px; border-radius: 5px; font-weight: 600; }
.ph-caption { width: 100%; background: rgba(0,0,0,0.6); border: 0; color: #fff; font-size: 0.72rem;
  padding: 5px 7px; border-radius: 6px; }
.ph-caption::placeholder { color: rgba(255,255,255,0.5); }

.empty-photos { color: var(--muted); font-size: 0.88rem; text-align: center; padding: 10px; }

/* ---------- SETTINGS ---------- */
.settings-form { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; max-width: 820px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.field input, .field textarea, .field select {
  background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 11px 13px;
  font-size: 0.92rem; transition: border-color 0.25s; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); }
.field input[type="color"] { height: 46px; padding: 5px; cursor: pointer; }

/* ---------- TOAST ---------- */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--line); padding: 12px 22px; border-radius: 30px;
  font-size: 0.88rem; box-shadow: 0 16px 40px rgba(0,0,0,0.5); z-index: 100;
  display: flex; align-items: center; gap: 10px; }
.toast .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.toast.err .dot { background: var(--danger); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 760px) {
  .dash { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 16px; }
  .sidebar nav { flex-direction: row; }
  .side-foot { margin: 0; flex-direction: row; gap: 16px; }
  .settings-form { grid-template-columns: 1fr; }
}
