:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --surface-light: #f5f3ef;
  --border: #e6e1d8;
  --border-dim: #ede8e0;
  --text: #2c2519;
  --text-muted: #6b6258;
  --text-faint: #9a9288;
  --gold: #c9a84c;
  --gold-dark: #8a6520;
  --info-text: #0c447c;
  --success-text: #085041;
  --danger-text: #791f1f;
  --danger-bg: #fcebeb;
  --radius: 8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }

a { color: var(--gold-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Nav */
.nav { display: flex; align-items: center; justify-content: space-between; padding: 0 24px; height: 56px; background: var(--text); border-bottom: 2px solid var(--gold); }
.nav-brand { font-size: 18px; font-style: italic; color: var(--gold); font-family: Georgia, serif; }
.nav-brand:hover { text-decoration: none; }
.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-home { font-size: 13px; color: rgba(255,255,255,0.6); }

/* Layout */
.container { max-width: 1100px; margin: 0 auto; padding: 32px 24px; }
.container.narrow { max-width: 720px; }

/* Page header */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; }
.page-header h2 { font-size: 24px; font-weight: 600; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 16px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; font-family: inherit; cursor: pointer; background: var(--surface); color: var(--text); transition: all 0.15s; white-space: nowrap; }
.btn:hover { background: var(--surface-light); }
.btn-primary { background: var(--text); color: #fff; border-color: var(--text); }
.btn-primary:hover { background: #3d352a; }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-light); color: var(--text); }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-view { background: transparent; color: var(--info-text); border-color: var(--info-text); }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; margin-bottom: 24px; }
.card.form label { display: block; font-size: 13px; font-weight: 500; color: var(--text-muted); margin: 16px 0 4px; }
.card.form label:first-of-type { margin-top: 0; }
.card.form input, .card.form select, .card.form textarea { display: block; width: 100%; padding: 9px 12px; font-size: 14px; font-family: inherit; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); color: var(--text); outline: none; }
.card.form input:focus, .card.form select:focus, .card.form textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(201,168,76,0.15); }
.card.form textarea { resize: vertical; min-height: 80px; }
.card.form h3 { font-size: 16px; margin: 24px 0 8px; padding-top: 16px; border-top: 1px solid var(--border-dim); color: var(--text); }
.card.form h3:first-of-type { margin-top: 0; padding-top: 0; border-top: none; }

/* Form actions */
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border-dim); }

/* Input with action */
.input-with-action { display: flex; gap: 8px; align-items: center; }
.input-with-action input { flex: 1; }

/* Grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; }
.alert-danger { background: #fcebeb; color: var(--danger-text); border: 1px solid #f5c6c6; }
.alert-success { background: #e8f7f3; color: var(--success-text); border: 1px solid #b3e4d6; }

/* Badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 100px; font-size: 12px; font-weight: 500; }
.badge-info { background: #e8f0fc; color: var(--info-text); }
.badge-muted { background: var(--surface-light); color: var(--text-muted); }

/* List */
.card.list { padding: 0; overflow: hidden; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border-dim); }
.list-row:last-child { border-bottom: none; }
.list-row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 500; font-size: 15px; }
.row-meta { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.section-heading { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin: 24px 0 8px; }

/* Misc */
.muted { color: var(--text-muted); }
.small { font-size: 13px; }
.hint { font-size: 12px; color: var(--text-faint); margin-top: 4px; }
.file-input { display: block; font-size: 13px; }
.empty-state { text-align: center; padding: 48px; color: var(--text-muted); }

/* Preview overlay */
.preview-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.preview-overlay.hidden { display: none; }
.preview-modal { background: #1a1a1a; border: 1px solid #444; border-radius: 8px; max-width: 900px; width: 100%; max-height: 90vh; overflow: auto; display: flex; flex-direction: column; }
.preview-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid #333; }
.preview-header h3 { margin: 0; color: #fff; font-size: 16px; }
#previewContent { padding: 20px; }
#previewContent video, #previewContent img, #previewContent audio { max-width: 100%; display: block; margin: 0 auto; }
#previewContent video { max-height: 60vh; }

/* Auth */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 40px; width: 100%; max-width: 400px; }
.auth-logo { font-size: 28px; font-style: italic; font-family: Georgia, serif; color: var(--gold-dark); margin-bottom: 4px; text-align: center; }
.auth-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; text-align: center; }
