/* ══════════════════════════════════════════════
   PROYECTO SCAN – MAIN CSS
   ══════════════════════════════════════════════ */

/* ── RESET / BASE ──────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #0f0f13;
  --surface:    #1a1a24;
  --surface2:   #22222f;
  --border:     #2e2e40;
  --accent:     #7c5cfc;
  --accent-h:   #9b7eff;
  --danger:     #e05252;
  --success:    #4caf80;
  --text:       #e8e8f0;
  --text-muted: #888898;
  --radius:     10px;
  --transition: 0.18s ease;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-h); }

/* ── UTILITIES ─────────────────────────────────── */
.hidden { display: none !important; }

/* ── BUTTONS ───────────────────────────────────── */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-primary:hover { background: var(--accent-h); }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-sm {
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.82rem;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  margin: 0 2px;
  transition: background var(--transition);
}
.btn-sm:hover { background: var(--border); }
.btn-sm.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-sm.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm.btn-primary { border-color: var(--accent); color: var(--accent); }
.btn-sm.btn-primary:hover { background: var(--accent); color: #fff; }
.btn-sm.btn-info { border-color: #5bc0de; color: #5bc0de; }
.btn-sm.btn-info:hover { background: #5bc0de; color: #000; }

.btn-logout {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}
.btn-logout:hover { color: var(--danger); border-color: var(--danger); }

/* ── FORM ──────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 1rem;
}
.form-group label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}
.form-group input,
.form-group select,
.form-group textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  padding: 0.55rem 0.8rem;
  font-size: 0.95rem;
  transition: border-color var(--transition);
  width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-group textarea { min-height: 80px; resize: vertical; }

.form-error {
  color: var(--danger);
  font-size: 0.875rem;
  margin-top: 0.4rem;
}
.form-success {
  color: var(--success);
  font-size: 0.875rem;
  margin-top: 0.4rem;
}

/* ── NAVBAR ────────────────────────────────────── */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.logo-icon { font-size: 1.4rem; }
.navbar-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.nav-link {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color var(--transition);
}
.nav-link:hover, .nav-link.active { color: var(--accent); }
.nav-greeting { font-size: 0.85rem; color: var(--text-muted); }

/* ── AUTH PAGE ─────────────────────────────────── */
.auth-page {
  --auth-ink: #f8f5ff;
  --auth-muted: #a59daf;
  --auth-line: rgba(255,255,255,.11);
  --auth-purple: #9d6cff;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 32px;
  overflow-x: hidden;
  background: #100d18;
  color: var(--auth-ink);
}
.auth-ambient {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.ambient-orb {
  position: absolute;
  width: 42vw;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(100px);
  opacity: .2;
  transform: translate(var(--pointer-x, 0), var(--pointer-y, 0));
  transition: transform .8s cubic-bezier(.2,.8,.2,1);
}
.orb-one { background: #7c3cff; top: -24%; left: -12%; }
.orb-two { background: #d04f8d; right: -18%; bottom: -30%; opacity: .12; }
.ambient-grid {
  position: absolute;
  inset: 0;
  opacity: .16;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}
.auth-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(320px, .85fr) minmax(480px, 1.15fr);
  width: min(1120px, 100%);
  min-height: 720px;
  overflow: hidden;
  border: 1px solid var(--auth-line);
  border-radius: 28px;
  background: rgba(20,16,29,.86);
  box-shadow: 0 40px 120px rgba(0,0,0,.5);
  backdrop-filter: blur(24px);
}
.auth-story {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  overflow: hidden;
  background:
    linear-gradient(155deg, rgba(137,83,255,.3), rgba(38,25,57,.35)),
    radial-gradient(circle at 20% 90%, rgba(214,86,146,.28), transparent 44%);
}
.auth-story::after {
  content: "物語";
  position: absolute;
  right: -28px;
  bottom: 80px;
  color: rgba(255,255,255,.035);
  font: 900 10rem/1 sans-serif;
  writing-mode: vertical-rl;
}
.auth-brand {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -.02em;
}
.auth-brand:hover { color: white; }
.auth-brand strong { color: #c8aaff; }
.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  font: 800 1.1rem/1 Georgia, serif;
}
.story-copy { position: relative; z-index: 1; max-width: 430px; }
.eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  color: #c9adff;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.story-copy h1 {
  max-width: 9ch;
  margin-bottom: 22px;
  font: 700 clamp(2.6rem, 4.4vw, 4.6rem)/.98 Georgia, "Times New Roman", serif;
  letter-spacing: -.055em;
}
.story-copy p { max-width: 43ch; color: #c8c0cf; line-height: 1.7; }
.story-stats { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.story-stats div { display: flex; flex-direction: column; gap: 4px; padding-top: 15px; border-top: 1px solid rgba(255,255,255,.16); }
.story-stats strong { font-size: 1.05rem; }
.story-stats span { color: #a69cac; font-size: .7rem; }
.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(34px, 5vw, 70px);
  background: rgba(16,13,24,.76);
}
.portal-heading { margin-bottom: 24px; }
.portal-heading .eyebrow { margin-bottom: 8px; }
.portal-heading h2 { margin-bottom: 8px; font-size: clamp(1.8rem,3vw,2.45rem); letter-spacing: -.045em; }
.portal-heading p { color: var(--auth-muted); font-size: .92rem; line-height: 1.55; }
.portal-switcher {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 8px;
  margin-bottom: 22px;
}
.portal-option {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 12px 10px;
  border: 1px solid var(--auth-line);
  border-radius: 14px;
  background: rgba(255,255,255,.025);
  color: #b8b0bf;
  text-align: left;
  cursor: pointer;
  transition: transform .22s ease, border-color .22s ease, background .22s ease, color .22s ease;
}
.portal-option:hover { transform: translateY(-2px); border-color: rgba(157,108,255,.55); }
.portal-option.active { border-color: rgba(157,108,255,.8); background: rgba(157,108,255,.12); color: white; box-shadow: inset 0 0 0 1px rgba(157,108,255,.08); }
.portal-icon { display: grid; flex: 0 0 28px; height: 28px; place-items: center; border-radius: 9px; background: rgba(255,255,255,.07); color: #c8aaff; }
.portal-option > span:last-child { overflow: hidden; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.portal-option small { display: block; overflow: hidden; margin-top: 3px; color: #807887; font-size: .6rem; font-weight: 500; text-overflow: ellipsis; }
.portal-option.active small { color: #aaa0b1; }
.auth-tabs {
  position: relative;
  display: flex;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--auth-line);
}
.auth-page .tab-btn {
  flex: initial;
  min-height: 42px;
  padding: 0 18px 11px 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #77707e;
  font-size: .78rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.auth-page .tab-btn + .tab-btn { padding-left: 18px; }
.auth-page .tab-btn.active { border-color: var(--auth-purple); color: white; }
.auth-page .form-group { gap: 8px; margin-bottom: 16px; }
.auth-page .form-group label { color: #aaa2b1; font-size: .72rem; font-weight: 700; }
.form-row { display: grid; grid-template-columns: 1fr 1.2fr; gap: 12px; }
.input-shell {
  display: flex;
  align-items: center;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--auth-line);
  border-radius: 13px;
  background: rgba(255,255,255,.035);
  color: #726a79;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.input-shell:focus-within { border-color: var(--auth-purple); background: rgba(157,108,255,.055); box-shadow: 0 0 0 3px rgba(157,108,255,.1); }
.auth-page .input-shell input {
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0 10px;
  color: white;
}
.auth-page .input-shell select {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0 10px;
  color: white;
  outline: 0;
}
.auth-page .input-shell select option { color: #17131f; background: white; }
.auth-page .input-shell input:focus { border: 0; }
.password-toggle { border: 0; background: transparent; color: #8f8796; font-size: .68rem; font-weight: 700; cursor: pointer; }
.auth-submit {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 52px;
  margin-top: 6px;
  padding: 0 18px;
  overflow: hidden;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(110deg, #8153ec, #a56cf5);
  color: white;
  font-size: .8rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(126,76,229,.24);
  transition: transform .22s ease, box-shadow .22s ease;
}
.auth-submit::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.2), transparent 80%); transform: translateX(-110%); transition: transform .55s ease; }
.auth-submit:hover { transform: translateY(-2px); box-shadow: 0 18px 42px rgba(126,76,229,.35); }
.auth-submit:hover::before { transform: translateX(110%); }
.auth-submit span,.auth-submit b { position: relative; }
.auth-submit.is-loading { opacity: .65; pointer-events: none; }
.form-message { margin-top: 13px; padding: 10px 12px; border-radius: 10px; font-size: .75rem; }
.auth-page .form-error { border: 1px solid rgba(224,82,82,.25); background: rgba(224,82,82,.09); }
.auth-page .form-success { border: 1px solid rgba(76,175,128,.25); background: rgba(76,175,128,.09); }
.staff-registration { padding: 28px; border: 1px dashed rgba(157,108,255,.35); border-radius: 16px; background: rgba(157,108,255,.05); text-align: center; }
.staff-symbol { display: grid; width: 45px; height: 45px; margin: 0 auto 13px; place-items: center; border-radius: 14px; background: rgba(157,108,255,.16); color: #c7a8ff; }
.staff-registration h3 { margin-bottom: 8px; font-size: 1rem; }
.staff-registration p { margin-bottom: 18px; color: var(--auth-muted); font-size: .78rem; line-height: 1.55; }
.auth-footnote { margin-top: 18px; color: #77707e; font-size: .68rem; line-height: 1.5; text-align: center; }

@media (max-width: 900px) {
  .auth-page { padding: 18px; }
  .auth-shell { grid-template-columns: 1fr; min-height: auto; }
  .auth-story { min-height: 290px; padding: 32px; }
  .story-copy { margin: 48px 0 30px; }
  .story-copy h1 { max-width: 14ch; font-size: clamp(2.3rem, 8vw, 3.5rem); }
  .story-stats { display: none; }
}
@media (max-width: 560px) {
  .auth-page { display: block; padding: 0; }
  .auth-shell { border: 0; border-radius: 0; }
  .auth-story { min-height: 230px; padding: 24px; }
  .story-copy { margin: 38px 0 0; }
  .story-copy h1 { margin-bottom: 12px; font-size: 2.25rem; }
  .story-copy p { font-size: .78rem; }
  .auth-panel { padding: 30px 20px 42px; }
  .portal-switcher { gap: 6px; }
  .portal-option { flex-direction: column; padding: 10px 4px; text-align: center; }
  .portal-option small { display: none; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
}

/* ============================================================
   MINXTRAL STUDIO — PANEL MULTI-SCAN
   ============================================================ */
.admin-page {
  --studio-bg: #f3f2f5;
  --studio-panel: #fff;
  --studio-nav: #120e1c;
  --studio-muted: #77707f;
  --studio-purple: #8959f4;
  background: var(--studio-bg);
}
.admin-page .admin-sidebar {
  width: 272px;
  padding: 1.5rem 1.15rem;
  background:
    radial-gradient(circle at 10% 0, rgba(137,89,244,.22), transparent 30%),
    var(--studio-nav);
  border-right: 1px solid rgba(255,255,255,.06);
}
.admin-page .admin-main { margin-left: 272px; padding: 2.3rem clamp(1.25rem,4vw,4rem) 6rem; }
.admin-brand { padding: .25rem .45rem; font-size: .95rem; }
.admin-brand b { color: #b898ff; }
.admin-page .brand-mark { border-radius: 11px; background: linear-gradient(135deg,#7542df,#a66eff); }
.admin-identity { margin: 1.5rem .45rem; padding: 1rem 0; }
.admin-identity strong { margin-top: .32rem; font-size: .92rem; }
.nav-group-label { margin: 1.25rem .75rem .35rem; color: rgba(255,255,255,.32); font-size: .58rem; font-weight: 900; letter-spacing: .16em; }
#admin-nav button { position: relative; min-height: 43px; color: rgba(255,255,255,.62); font-size: .78rem; font-weight: 650; transition: .2s ease; }
#admin-nav button span { width: 20px; color: #8b7b9d; text-align: center; }
#admin-nav button:hover { transform: translateX(3px); }
#admin-nav button.active { background: linear-gradient(90deg,rgba(137,89,244,.25),rgba(137,89,244,.07)); box-shadow: inset 2px 0 #9f72ff; }
.admin-topbar { padding-bottom: 1.7rem; border-bottom: 1px solid #dfdbe4; }
.admin-topbar h1 { font-family: Inter,"Segoe UI",sans-serif; font-weight: 750; letter-spacing: -.045em; }
.topbar-tools { display: flex; align-items: center; gap: .65rem; }
.command-button { padding: .55rem .85rem; border: 1px solid #ddd8e2; border-radius: 9px; background: white; color: #6e6774; cursor: pointer; }
.stats-grid { grid-template-columns: repeat(6,minmax(0,1fr)); }
.stat-card,.panel-card,.content-card,.empty-panel { border-color: #e2dee6; border-radius: 14px; box-shadow: 0 8px 30px rgba(30,20,40,.035); }
.stat-card { min-height: 145px; padding: 1.1rem; }
.stat-card strong { font-family: Inter,"Segoe UI",sans-serif; font-size: 2rem; font-weight: 760; letter-spacing: -.05em; }
.stat-card small { margin-top: auto; font-size: .68rem; }
.panel-card { min-height: 300px; padding: 1.5rem; }
.panel-card h2 { font-family: Inter,"Segoe UI",sans-serif; font-size: 1rem; font-weight: 750; }
.platform-welcome { display: flex; min-height: 235px; flex-direction: column; justify-content: center; border-radius: 12px; padding: 2rem; background: linear-gradient(135deg,#181020,#352052); color: white; }
.platform-welcome > span { color: #b995ff; font-size: .62rem; font-weight: 900; letter-spacing: .16em; }
.platform-welcome h3 { max-width: 12ch; margin: .8rem 0; font: 500 2rem/1.05 Georgia,serif; }
.platform-welcome p { max-width: 54ch; color: rgba(255,255,255,.65); font-size: .78rem; line-height: 1.55; }
.platform-welcome button { width: fit-content; margin-top: 1rem; border: 0; background: transparent; color: #cfb6ff; cursor: pointer; }
.architecture-note { display: grid; gap: .75rem; padding: .7rem; }
.architecture-note p { color: #78717d; font-size: .8rem; line-height: 1.55; }
.architecture-note div { display: flex; justify-content: space-between; padding: .7rem 0; border-bottom: 1px solid #ebe8ed; }
.architecture-note div span { color: #7445d7; font-weight: 850; }
.architecture-note div i { color: #958d9b; font-size: .75rem; font-style: normal; }
.studio-scan-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(290px,1fr)); gap: 1rem; }
.studio-scan-card { display: grid; gap: 1.2rem; padding: 1.35rem; border: 1px solid #e1dce5; border-radius: 16px; background: white; box-shadow: 0 10px 35px rgba(25,15,35,.04); }
.scan-card-head { display: flex; justify-content: space-between; align-items: center; }
.scan-avatar { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 14px; background: color-mix(in srgb,var(--scan-accent) 15%,white); color: var(--scan-accent); font-weight: 900; }
.studio-scan-card h3 { margin: .25rem 0; font-size: 1.3rem; letter-spacing: -.035em; }
.studio-scan-card p { color: #807884; font-size: .75rem; }
.scan-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; }
.scan-metrics span { padding: .65rem; border-radius: 9px; background: #f7f5f8; color: #817a86; font-size: .68rem; }
.scan-metrics b { display: block; color: #211a27; font-size: 1rem; }
.scan-status-button { padding: .65rem; border: 1px solid #ded9e2; border-radius: 9px; background: white; color: #746c79; cursor: pointer; }
.community-switcher { max-width: 190px; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 999px; background: white; color: var(--ink); font-size: .72rem; }
@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 850px) {
  .admin-page .admin-sidebar { width: auto; }
  .admin-page .admin-main { margin-left: 0; }
  .nav-group-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { scroll-behavior: auto !important; animation: none !important; transition-duration: .01ms !important; }
}

/* ── HERO ──────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 3rem 1rem 2rem;
}
.hero h2 { font-size: 2rem; font-weight: 800; margin-bottom: 0.5rem; }
.hero p { color: var(--text-muted); font-size: 1rem; }

/* ── CATALOG ───────────────────────────────────── */
.catalog-controls {
  display: flex;
  justify-content: center;
  padding: 0.5rem 1.5rem 1.5rem;
}
.catalog-controls input {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 50px;
  padding: 0.6rem 1.2rem;
  width: 100%;
  max-width: 400px;
  font-size: 0.95rem;
}
.catalog-controls input:focus { outline: none; border-color: var(--accent); }

.series-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.2rem;
  padding: 0 1.5rem 3rem;
  max-width: 1400px;
  margin: 0 auto;
}
.series-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.series-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 30px rgba(124,92,252,0.2);
}
.series-cover { height: 220px; overflow: hidden; }
.series-cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface2);
  font-size: 3rem;
}
.series-info { padding: 0.75rem; }
.series-info h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.3rem; }
.series-genre { font-size: 0.78rem; color: var(--text-muted); display: block; margin-bottom: 0.3rem; }
.series-status { font-size: 0.75rem; border-radius: 4px; padding: 2px 6px; font-weight: 600; }
.status-ongoing { background: #1e3a2f; color: var(--success); }
.status-finished { background: #2a1f3a; color: var(--accent); }

.loading-spinner, .empty-msg {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  padding: 3rem;
  font-size: 1rem;
}

/* ── BADGES ────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
}
.badge-active { background: #1e3a2f; color: var(--success); }
.badge-done   { background: #2a1f3a; color: var(--accent); }
.badge-off    { background: #3a1e1e; color: var(--danger); }

/* ── ADMIN LAYOUT ──────────────────────────────── */
.admin-layout {
  display: flex;
  min-height: calc(100vh - 54px);
}
.admin-sidebar {
  width: 200px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
  flex-shrink: 0;
}
.admin-sidebar h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.admin-sidebar ul { list-style: none; }
.admin-sidebar ul li { margin-bottom: 0.4rem; }
.admin-sidebar ul li button {
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background var(--transition), color var(--transition);
}
.admin-sidebar ul li button:hover { background: var(--surface2); color: var(--accent); }

.admin-main { flex: 1; padding: 1.5rem; overflow-x: auto; }

.admin-section { display: block; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}
.section-header h2 { font-size: 1.2rem; font-weight: 700; }

/* ── ADMIN TABLE ───────────────────────────────── */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.9rem;
}
.admin-table th {
  background: var(--surface2);
  padding: 0.7rem 1rem;
  text-align: left;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--surface2); }
.action-cell { white-space: nowrap; }

/* ── MODAL ─────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(4px);
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.modal h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 1.2rem; }
.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* ── TABLE SCROLL WRAPPER ──────────────────────── */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
}

/* ── HAMBURGER BUTTON ──────────────────────────── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.25s ease;
}

/* ── RESPONSIVE: TABLET (960px) ────────────────── */
@media (max-width: 960px) {
  .admin-sidebar { width: 170px; }
  .series-grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); }
}

/* ── RESPONSIVE: MOBILE (640px) ───────────────── */
@media (max-width: 640px) {
  html { font-size: 15px; }

  /* Navbar */
  .nav-toggle { display: flex; }
  .navbar { padding: 0.65rem 1rem; }
  .navbar-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem 1rem;
    gap: 0.6rem;
    z-index: 99;
  }
  .navbar-links.open { display: flex; }
  .navbar-links .btn-logout { margin-top: 0.25rem; width: 100%; text-align: left; }

  /* Hero */
  .hero { padding: 1.75rem 1rem 1rem; }
  .hero h2 { font-size: 1.45rem; }
  .hero p { font-size: 0.9rem; }

  /* Catalog */
  .catalog-controls { padding: 0.25rem 0.75rem 1rem; }
  .catalog-controls input { font-size: 1rem; } /* prevents iOS zoom on focus */

  /* Series grid – 2 columns */
  .series-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 0 0.75rem 4rem;
  }
  .series-cover { height: 170px; }
  .series-info { padding: 0.5rem 0.6rem; }
  .series-info h3 { font-size: 0.82rem; }
  .series-genre { font-size: 0.72rem; }

  /* Auth card */
  .auth-card {
    margin: 1rem;
    padding: 1.75rem 1.2rem;
    border-radius: 14px;
  }
  .auth-logo h1 { font-size: 1.4rem; }

  /* Admin layout → vertical stack */
  .admin-layout { flex-direction: column; }
  .admin-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 0.6rem 0.75rem;
  }
  .admin-sidebar h2 { display: none; }
  .admin-sidebar ul {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    scrollbar-width: none;
  }
  .admin-sidebar ul::-webkit-scrollbar { display: none; }
  .admin-sidebar ul li { flex-shrink: 0; margin: 0; }
  .admin-sidebar ul li button {
    padding: 0.45rem 0.9rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    font-size: 0.82rem;
    white-space: nowrap;
  }
  .admin-sidebar ul li button:hover { background: var(--surface2); }
  .admin-main { padding: 1rem 0.75rem; }
  .section-header { flex-wrap: wrap; gap: 0.5rem; }
  .section-header h2 { font-size: 1rem; }

  /* Modal – bottom sheet */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal {
    border-radius: 18px 18px 0 0;
    max-width: 100%;
    max-height: 90vh;
    padding: 1.5rem 1.25rem;
  }

  /* Prevent iOS auto-zoom on input focus */
  .form-group input,
  .form-group select,
  .form-group textarea,
  .catalog-controls input {
    font-size: 16px;
  }

  /* Touch targets */
  .btn-primary, .btn-secondary, .tab-btn { min-height: 44px; }
  .btn-sm { min-height: 36px; padding: 0.3rem 0.7rem; }
  .btn-logout { min-height: 36px; }
}

/* ── RESPONSIVE: SMALL MOBILE (380px) ─────────── */
@media (max-width: 380px) {
  .series-grid {
    gap: 0.5rem;
    padding: 0 0.5rem 4rem;
  }
  .series-cover { height: 145px; }
  .series-info h3 { font-size: 0.78rem; }
}

/* ══════════════════════════════════════════════
   NUEVOS COMPONENTES
   ══════════════════════════════════════════════ */

/* ── TEXT MUTED UTILITY ────────────────────────── */
.text-muted { color: var(--text-muted); font-size: 0.88rem; }

/* ── CHAPTERS COUNT EN TARJETAS ────────────────── */
.series-chapters {
  font-size: 0.75rem;
  color: var(--accent);
  display: block;
  margin-bottom: 0.2rem;
}

/* ── MODAL CLOSE BUTTON ────────────────────────── */
.modal-close-btn {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
}
.modal-close-btn:hover { background: var(--surface2); color: var(--text); }

/* ── SERIES DETAIL MODAL ───────────────────────── */
.modal.series-detail { max-width: 560px; position: relative; }

.series-detail-head {
  display: flex;
  gap: 1.2rem;
  margin: 0.25rem 0 1.25rem;
}
.detail-cover { flex-shrink: 0; width: 100px; }
.detail-cover img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
}
.detail-cover .cover-placeholder {
  width: 100%;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  border-radius: 8px;
  font-size: 2.5rem;
}
.detail-info { flex: 1; }
.detail-info h2 { font-size: 1.15rem; font-weight: 800; margin-bottom: 0.2rem; }

.detail-chapters-section h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

/* ── CHAPTER BUTTONS (catálogo detail) ─────────── */
.chapter-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  margin-bottom: 0.4rem;
  transition: background var(--transition), border-color var(--transition);
}
.chapter-btn:hover { background: var(--border); border-color: var(--accent); }
.ch-num { font-weight: 700; font-size: 0.88rem; min-width: 58px; color: var(--accent); }
.ch-title { flex: 1; font-size: 0.88rem; color: var(--text-muted); }
.ch-pages { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; }

/* ── CHAPTERS ACCORDION (admin) ────────────────── */
.chapters-accordion > td {
  padding: 0 !important;
  border-bottom: 2px solid var(--accent) !important;
}
.chapters-accordion-cell {
  background: var(--bg);
  border-left: 3px solid var(--accent);
}
.chapters-subpanel { padding: 0.75rem 1rem 1rem; }
.subpanel-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.subpanel-title { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; }
.chapters-sub-table { font-size: 0.83rem; }
.chapters-sub-table th { font-size: 0.72rem; }
.chapters-sub-table td { padding: 0.5rem 0.8rem; }
.accordion-toggle { font-size: 0.78rem; white-space: nowrap; }

/* ── RESPONSIVE: series detail modal ──────────── */
@media (max-width: 640px) {
  .series-detail-head { flex-direction: column; }
  .detail-cover { width: 100%; }
  .detail-cover img, .detail-cover .cover-placeholder { height: 160px; width: 110px; }
  .ch-pages { display: none; }
  .chapter-btn { padding: 0.6rem 0.7rem; }
}
/* ── SISTEMA DE MONEDAS ────────────────────────────── */

/* Saldo de monedas en la navbar */
.coin-badge {
  background: rgba(124, 92, 252, 0.15);
  border: 1px solid rgba(124, 92, 252, 0.4);
  color: var(--accent-h);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  white-space: nowrap;
}

/* Capítulo bloqueado en la lista de capítulos */
.chapter-btn.chapter-locked {
  border-color: rgba(180, 130, 0, 0.35);
  background: rgba(180, 130, 0, 0.06);
  color: var(--text-muted);
  cursor: pointer;
}
.chapter-btn.chapter-locked:hover {
  border-color: rgba(180, 130, 0, 0.7);
  background: rgba(180, 130, 0, 0.12);
  color: var(--text);
}

/* Precio en monedas del capítulo bloqueado */
.ch-price {
  font-size: 0.78rem;
  font-weight: 700;
  color: #d4a017;
  background: rgba(212, 160, 23, 0.12);
  padding: 0.15rem 0.45rem;
  border-radius: 10px;
  margin-left: auto;
}
/* ============================================================
   SISTEMA VISUAL 2026
   ============================================================ */

:root {
  --ink: #171713;
  --paper: #f4f1e8;
  --paper-strong: #fffdf7;
  --line: #d9d3c5;
  --accent: #e45a32;
  --accent-dark: #b83d1e;
  --forest: #143e35;
  --gold: #f0b84a;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 28px;
  --shadow-soft: 0 18px 60px rgba(31, 28, 20, 0.11);
}

body.catalog-page,
body.admin-page {
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.setup-intro {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: .86rem;
  line-height: 1.6;
}

.catalog-page .navbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(244, 241, 232, 0.92);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.catalog-page .navbar-brand {
  color: var(--ink);
  text-decoration: none;
}

.membership-badge,
.status-dot {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.42rem 0.7rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.membership-badge.vip {
  background: var(--gold);
  border-color: var(--gold);
}

.catalog-hero {
  min-height: 430px;
  padding: 6rem clamp(1.5rem, 7vw, 8rem);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  color: #fffaf0;
  background:
    radial-gradient(circle at 80% 20%, rgba(240, 184, 74, 0.28), transparent 25%),
    linear-gradient(120deg, #123b33, #1b5548);
}

.eyebrow {
  display: block;
  color: var(--accent);
  text-transform: uppercase;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  margin-bottom: 0.65rem;
}

.catalog-hero .eyebrow { color: #f2c56d; }

.catalog-hero h1 {
  max-width: 860px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 7vw, 6.8rem);
  font-weight: 500;
  line-height: 0.92;
  letter-spacing: -0.055em;
}

.catalog-hero p {
  max-width: 580px;
  margin: 1.6rem 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
  line-height: 1.7;
}

.hero-stat {
  flex: 0 0 auto;
  border-left: 1px solid rgba(255,255,255,.35);
  padding-left: 2rem;
}

.hero-stat strong {
  display: block;
  font-family: Georgia, serif;
  font-size: 4rem;
  line-height: 1;
}

.hero-stat span { color: rgba(255,255,255,.65); }

.catalog-shell {
  max-width: 1480px;
  margin: 0 auto;
  padding: 4rem clamp(1.2rem, 5vw, 5rem) 7rem;
}

.catalog-heading,
.section-actions,
.subsection-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
}

.catalog-heading h2,
.admin-topbar h1 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: clamp(2.1rem, 4vw, 3.4rem);
  font-weight: 500;
}

.search-field input {
  width: min(360px, 80vw);
  padding: 0.8rem 0.2rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
}

.catalog-page .series-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 2.4rem 1.4rem;
  max-width: none;
  padding: 2.5rem 0 0;
}

.catalog-page .series-card {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  cursor: pointer;
  transition: transform .25s ease;
}

.catalog-page .series-card:hover,
.catalog-page .series-card:focus-visible {
  transform: translateY(-7px);
  outline: none;
}

.catalog-page .series-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  height: auto;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: #d8d1c2;
  box-shadow: 0 10px 32px rgba(28, 25, 18, .13);
}

.catalog-page .series-cover img { width: 100%; height: 100%; object-fit: cover; }

.catalog-page .series-status {
  position: absolute;
  top: .7rem;
  left: .7rem;
  padding: .35rem .55rem;
  color: white;
  background: rgba(20, 62, 53, .88);
  border-radius: 999px;
  font-size: .64rem;
  font-weight: 800;
}

.catalog-page .series-info { padding: 1rem .1rem; }
.catalog-page .series-info h3 { margin: .3rem 0 .6rem; font-family: Georgia, serif; font-size: 1.3rem; }
.catalog-page .series-genre { color: var(--accent-dark); font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; }
.card-meta { display: flex; flex-wrap: wrap; gap: .8rem; color: #726c60; font-size: .72rem; }

.catalog-page .modal-overlay {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(16, 28, 24, .72);
  backdrop-filter: blur(8px);
}
.catalog-page .modal-overlay.hidden { display: none; }
.catalog-page .series-detail {
  width: min(1100px, 96vw);
  max-height: 92vh;
  overflow: auto;
  padding: clamp(1.3rem, 4vw, 3rem);
  background: var(--paper-strong);
  border-radius: var(--radius-lg);
  color: var(--ink);
}
.catalog-page .series-detail-head { display: grid; grid-template-columns: 180px 1fr; gap: 2rem; }
.catalog-page .detail-cover { width: 180px; height: 270px; border-radius: var(--radius-sm); overflow: hidden; background: #ddd5c6; }
.catalog-page .detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.catalog-page .detail-info h2 { margin: 0 0 .7rem; font: 500 clamp(2rem, 5vw, 4rem)/1 Georgia, serif; }
.rating-summary { display: flex; gap: .8rem; align-items: baseline; margin-top: 1rem; }
.rating-summary strong { font: 500 2rem Georgia, serif; color: var(--accent-dark); }
.rating-buttons button { color: #b9b09f; background: none; border: 0; font-size: 1.35rem; cursor: pointer; }
.rating-buttons button.active { color: var(--gold); }
.detail-columns { display: grid; grid-template-columns: 1.25fr .75fr; gap: 2.5rem; margin-top: 2.5rem; }
.chapter-list { display: grid; gap: .55rem; }
.chapter-row { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem; color: var(--ink); background: #f2ede1; border: 1px solid transparent; border-radius: var(--radius-sm); text-decoration: none; }
.chapter-row:hover { border-color: var(--accent); }
.chapter-row > div { display: grid; gap: .25rem; }
.chapter-row > div:last-child { text-align: right; }
.chapter-row span, .chapter-row small { color: #746d60; font-size: .78rem; }
.chapter-row.locked { opacity: .7; }
.chapter-lock span { color: var(--accent-dark); font-weight: 800; }
.comment-form { display: grid; gap: .65rem; }
.comment-form textarea { min-height: 90px; resize: vertical; }
.comments-list { display: grid; gap: .7rem; margin-top: 1rem; }
.comment { padding: .9rem; border-bottom: 1px solid var(--line); }
.comment > div { display: flex; justify-content: space-between; gap: .5rem; }
.comment time { color: #80786a; font-size: .68rem; }
.comment p { margin: .5rem 0 0; white-space: pre-wrap; font-size: .86rem; }

/* ============================================================
   PANEL ADMINISTRATIVO
   ============================================================ */

.admin-page { min-height: 100vh; }
.admin-page .admin-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 245px;
  display: flex;
  flex-direction: column;
  padding: 1.4rem;
  color: #f7f1e4;
  background: var(--forest);
}
.admin-brand { display: flex; align-items: center; gap: .7rem; color: white; text-decoration: none; font-weight: 800; }
.admin-identity { display: grid; margin: 2rem 0; padding: 1rem 0; border-top: 1px solid rgba(255,255,255,.15); border-bottom: 1px solid rgba(255,255,255,.15); }
.admin-identity span { color: rgba(255,255,255,.55); font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; }
#admin-nav { display: grid; gap: .25rem; }
#admin-nav button, .sidebar-footer button, .sidebar-footer a { width: 100%; display: flex; gap: .8rem; padding: .75rem; color: rgba(255,255,255,.72); background: transparent; border: 0; border-radius: var(--radius-sm); text-align: left; text-decoration: none; cursor: pointer; }
#admin-nav button:hover, #admin-nav button.active { color: white; background: rgba(255,255,255,.1); }
.sidebar-footer { margin-top: auto; border-top: 1px solid rgba(255,255,255,.15); padding-top: .7rem; }
.admin-page .admin-main { margin-left: 245px; padding: 2.5rem clamp(1.2rem, 4vw, 4rem) 5rem; max-width: none; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2.5rem; }
.status-dot { color: #226253; background: #d9eadf; border-color: #bad7c5; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.stat-card, .panel-card, .content-card, .empty-panel { background: var(--paper-strong); border: 1px solid var(--line); border-radius: var(--radius-md); }
.stat-card { display: grid; padding: 1.25rem; }
.stat-card span { color: #6f685c; font-size: .76rem; }
.stat-card strong { margin: .5rem 0; font: 500 2.4rem Georgia, serif; }
.stat-card small { color: #91887a; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.panel-card { padding: 1.4rem; }
.panel-card h2 { margin-top: 0; font: 500 1.35rem Georgia, serif; }
.ranking-row, .activity-row { display: grid; grid-template-columns: auto 1fr auto; gap: .8rem; align-items: center; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.activity-row { grid-template-columns: 1fr; gap: .2rem; }
.activity-row p { margin: 0; color: #766f63; font-size: .8rem; }
.section-actions { margin-bottom: 1.3rem; }
.section-actions p { color: #6e675b; }
.content-list { display: grid; gap: .8rem; }
.content-card { display: grid; grid-template-columns: 75px 1fr auto; gap: 1.1rem; align-items: center; padding: .9rem; }
.content-cover { width: 75px; height: 105px; display: grid; place-items: center; overflow: hidden; border-radius: 6px; background: #ddd5c5; color: #857c6e; font-weight: 900; }
.content-cover img { width: 100%; height: 100%; object-fit: cover; }
.content-copy h2 { margin: 0; font: 500 1.45rem Georgia, serif; }
.content-copy p { margin: .4rem 0 0; color: #756e62; font-size: .78rem; }
.content-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .4rem; }
.content-actions button, .chapter-admin-row button, .admin-table button, .moderation-card button { padding: .5rem .7rem; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.danger-link { color: #a13724 !important; border-color: #e3b4a9 !important; }
.chapter-admin-area { grid-column: 1 / -1; border-top: 1px solid var(--line); padding: 1rem; }
.chapter-admin-heading, .chapter-admin-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.chapter-admin-row { padding: .75rem 0; border-bottom: 1px solid var(--line); }
.chapter-admin-row > div { display: grid; gap: .2rem; }
.chapter-admin-row span, .chapter-admin-row small { color: #756e62; font-size: .75rem; }
.badge-vip { color: #684600; background: #f4cc74; }
.admin-table td strong, .admin-table td small { display: block; }
.moderation-card { padding: 1rem; background: var(--paper-strong); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.moderation-card > div { display: flex; justify-content: space-between; gap: .6rem; }
.moderation-card span { color: #756e62; font-size: .75rem; }
.app-dialog { width: min(600px, 94vw); padding: 0; color: var(--ink); background: var(--paper-strong); border: 0; border-radius: var(--radius-md); box-shadow: var(--shadow-soft); }
.app-dialog::backdrop { background: rgba(12,31,26,.72); backdrop-filter: blur(5px); }
.app-dialog form { display: grid; gap: 1rem; padding: 1.5rem; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; }
.dialog-heading h2 { margin: 0; font: 500 1.8rem Georgia, serif; }
.dialog-heading button { font-size: 1.5rem; background: none; border: 0; cursor: pointer; }
.app-dialog label { display: grid; gap: .4rem; color: #554f45; font-size: .8rem; font-weight: 700; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.check-row { grid-template-columns: auto 1fr !important; align-items: center; }
.check-row small { grid-column: 2; font-weight: 400; color: #7d7568; }

@media (max-width: 850px) {
  .catalog-hero { min-height: 390px; align-items: flex-start; flex-direction: column; padding-top: 4rem; }
  .hero-stat { border-left: 0; padding-left: 0; }
  .detail-columns { grid-template-columns: 1fr; }
  .catalog-page .series-detail-head { grid-template-columns: 110px 1fr; }
  .catalog-page .detail-cover { width: 110px; height: 165px; }
  .admin-page .admin-sidebar { position: static; width: auto; }
  .admin-page .admin-main { margin-left: 0; }
  #admin-nav { grid-template-columns: repeat(3, 1fr); }
  #admin-nav button { font-size: .72rem; }
  .sidebar-footer { display: none; }
  .stats-grid, .dashboard-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .catalog-page .navbar { padding: .75rem 1rem; }
  .catalog-page .navbar-links { gap: .45rem; }
  .nav-greeting { display: none; }
  .catalog-hero h1 { font-size: 3.2rem; }
  .catalog-heading { align-items: stretch; flex-direction: column; }
  .search-field input { width: 100%; }
  .catalog-page .series-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem .75rem; }
  .catalog-page .series-detail-head { grid-template-columns: 1fr; }
  .catalog-page .detail-cover { width: 100%; height: 220px; }
  .stats-grid, .dashboard-grid { grid-template-columns: 1fr; }
  .content-card { grid-template-columns: 55px 1fr; }
  .content-cover { width: 55px; height: 78px; }
  .content-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .form-row { grid-template-columns: 1fr; }
}
