:root {
  --ink: #25221f;
  --muted: #756f67;
  --line: #ebe5dc;
  --paper: #f8f5ef;
  --surface: #ffffff;
  --accent: #e8634a;
  --accent-dark: #c24e38;
  --accent-soft: #fdefea;
  --danger: #b54a43;
  --shadow: 0 18px 55px rgba(42, 39, 36, .08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 78% -10%, rgba(232, 99, 74, .12), transparent 30rem),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: inherit; text-decoration: none; }
.admin-shell { min-height: 100vh; display: flex; }
.sidebar {
  width: 270px;
  padding: 30px 18px;
  background: #241f1b;
  color: white;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: block; padding: 0 12px; font-size: 24px; font-weight: 850; letter-spacing: -.02em; margin-bottom: 28px; }
.sidebar nav { display: grid; gap: 8px; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 12px 12px; border-radius: 12px; color: rgba(255,255,255,.78); font-weight: 750; }
.sidebar nav a i { font-size: 20px; color: rgba(255,255,255,.7); }
.sidebar nav a:hover { background: rgba(255,255,255,.1); color: white; transform: translateY(1px); }
.sidebar nav a:hover i { color: white; }
.content { flex: 1; padding: 34px; min-width: 0; }
.auth-page { min-height: 100vh; display: grid; place-items: center; width: 100%; }
.auth-card, .panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.auth-card { width: min(420px, calc(100vw - 32px)); padding: 28px; }
h1 { margin: 0 0 22px; font-size: 34px; letter-spacing: -.03em; }
h2 { margin: 0 0 16px; font-size: 20px; }
.muted { color: var(--muted); }
.grid { display: grid; gap: 18px; }
.stats { grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); }
.stat { padding: 22px; background: rgba(255,255,255,.9); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.stat strong { display: block; font-size: 34px; margin-top: 8px; }
.panel { padding: 22px; margin-bottom: 24px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 20px; }
.button, button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.button:hover, button:hover { background: var(--accent-dark); transform: translateY(1px); }
.button.secondary, button.secondary { background: var(--accent-soft); color: var(--accent); }
.button.danger, button.danger { background: #fae7e7; color: var(--danger); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: #f7f1ea; }
tr:last-child td { border-bottom: 0; }
form.inline { display: inline; }
label { display: grid; gap: 7px; font-weight: 700; margin-bottom: 14px; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 12px;
  color: var(--ink);
  background: white;
  font: inherit;
}
textarea { min-height: 130px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.full { grid-column: 1 / -1; }
.checkbox-row { display: flex; gap: 18px; flex-wrap: wrap; margin: 8px 0 18px; }
.checkbox-row label { display: flex; gap: 8px; align-items: center; margin: 0; font-weight: 600; }
.checkbox-row input { width: auto; }
.flash { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; border: 1px solid var(--line); background: white; }
.flash.success { border-color: #b9dbc8; background: #edf8f1; }
.flash.error { border-color: #ecc3c3; background: #fff0f0; }
.badge { display: inline-block; padding: 5px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 800; }
.badge.muted-badge { background: #f1f2ef; color: var(--muted); }
.thumb { width: 84px; height: 58px; object-fit: cover; border-radius: 8px; background: #eef1ec; }
.dt-container { margin-top: 10px; color: var(--ink); }
.dt-container .dt-search input,
.dt-container .dt-length select {
  width: auto;
  margin-left: 8px;
  border-radius: 999px;
  background: var(--surface);
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(37, 34, 31, .52);
  backdrop-filter: blur(14px);
}
.modal.open { display: grid; }
.modal-panel {
  width: min(640px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 24px;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 30px 100px rgba(37, 34, 31, .26);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; }
.modal-head h2 { margin: 0; }
.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: var(--accent-soft);
  color: var(--accent);
}

@media (max-width: 860px) {
  .admin-shell { display: block; }
  .sidebar { width: 100%; height: auto; position: static; }
  .content { padding: 20px; }
  .stats, .form-grid { grid-template-columns: 1fr; }
  table { display: block; overflow-x: auto; }
}
