:root {
  --bg: #0f172a;
  --card: #1e293b;
  --card-soft: rgba(30, 41, 59, .72);
  --border: #334155;
  --text: #f8fafc;
  --muted: #94a3b8;
  --primary: #6366f1;
  --secondary: #a855f7;
  --accent: #22d3ee;
  --danger: #ef4444;
  --radius: 22px;
  --shadow: 0 24px 80px rgba(0,0,0,.38);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 8%, rgba(99,102,241,.28), transparent 34rem),
    radial-gradient(circle at 88% 12%, rgba(168,85,247,.22), transparent 32rem),
    linear-gradient(180deg, #0f172a 0%, #111827 100%);
}
a { color: inherit; text-decoration: none; }
code { color: #c4b5fd; }
.site-header, .site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-header { padding: 22px 0; }
.site-footer { padding: 30px 0 42px; color: var(--muted); gap: 16px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 900; letter-spacing: -.02em; }
.brand-mark {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--secondary)); box-shadow: 0 14px 34px rgba(99,102,241,.35);
}
.nav-links { display: flex; align-items: center; gap: 18px; color: var(--muted); font-weight: 700; }
.nav-links a:hover { color: var(--text); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: 1px solid rgba(255,255,255,.12); color: white; font-weight: 800;
  box-shadow: 0 16px 34px rgba(99,102,241,.28);
}
.btn-sm { min-height: 38px; padding: 0 15px; }
.btn-ghost { background: rgba(15,23,42,.5); box-shadow: none; border-color: var(--border); }
.hero {
  width: min(1180px, calc(100% - 32px));
  margin: 46px auto 26px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  gap: 28px;
  align-items: stretch;
}
.hero.compact { grid-template-columns: 1fr; }
.hero-copy, .glass-panel, .feature-card {
  background: linear-gradient(180deg, rgba(30,41,59,.86), rgba(15,23,42,.76));
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.hero-copy { padding: clamp(32px, 6vw, 68px); position: relative; overflow: hidden; }
.hero-copy:before { content: ""; position: absolute; inset: -30% -10% auto auto; width: 360px; height: 360px; background: radial-gradient(circle, rgba(34,211,238,.16), transparent 70%); }
.eyebrow { color: #c4b5fd; font-weight: 900; text-transform: uppercase; letter-spacing: .14em; font-size: 12px; margin-bottom: 16px; }
h1 { font-size: clamp(36px, 6vw, 72px); line-height: .95; letter-spacing: -.06em; margin: 0 0 20px; }
p { color: var(--muted); font-size: 17px; line-height: 1.72; margin: 0; }
.hero-actions { margin-top: 30px; display: flex; gap: 12px; flex-wrap: wrap; }
.glass-panel { padding: 28px; }
.language-panel h2 { margin: 0 0 12px; letter-spacing: -.03em; }
.muted { color: var(--muted); }
.language-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.language-chip { padding: 10px 13px; border-radius: 12px; border: 1px solid var(--border); color: var(--muted); font-weight: 900; background: rgba(15,23,42,.44); }
.language-chip.active { color: white; border-color: rgba(99,102,241,.8); background: linear-gradient(135deg, rgba(99,102,241,.46), rgba(168,85,247,.34)); }
.feature-grid { width: min(1180px, calc(100% - 32px)); margin: 0 auto 46px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature-card { padding: 24px; }
.feature-card h3 { margin: 0 0 10px; letter-spacing: -.02em; }
.feature-card p { font-size: 15px; }
@media (max-width: 860px) {
  .site-header { align-items: flex-start; gap: 18px; flex-direction: column; }
  .nav-links { flex-wrap: wrap; }
  .hero, .feature-grid { grid-template-columns: 1fr; }
}

/* Batch 2 admin/auth */
.auth-shell { width: min(520px, calc(100% - 32px)); margin: 48px auto; }
.auth-card { background: linear-gradient(180deg, rgba(30,41,59,.9), rgba(15,23,42,.82)); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(26px, 5vw, 44px); }
.auth-card h1 { font-size: clamp(32px, 5vw, 48px); }
.form-stack { display: grid; gap: 16px; margin-top: 24px; }
.form-stack label { display: grid; gap: 8px; color: var(--muted); font-weight: 800; }
input, textarea, select { width: 100%; border: 1px solid var(--border); border-radius: 14px; background: rgba(15,23,42,.72); color: var(--text); min-height: 46px; padding: 0 14px; font: inherit; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(99,102,241,.16); }
.alert { margin-top: 18px; border-radius: 14px; padding: 12px 14px; font-weight: 800; }
.alert-danger { border: 1px solid rgba(239,68,68,.35); background: rgba(127,29,29,.35); color: #fecaca; }
.admin-body { background: #0b1120; }
.admin-layout { min-height: 100vh; display: grid; grid-template-columns: 280px minmax(0, 1fr); }
.admin-sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 24px; padding: 24px; border-right: 1px solid var(--border); background: rgba(15,23,42,.86); }
.admin-nav { display: grid; gap: 8px; overflow-y: auto; }
.admin-nav a { padding: 12px 14px; border: 1px solid transparent; border-radius: 14px; color: var(--muted); font-weight: 800; }
.admin-nav a:hover, .admin-nav a.active { color: var(--text); background: rgba(99,102,241,.14); border-color: rgba(99,102,241,.3); }
.logout-form { margin-top: auto; }
.admin-main { padding: 34px; }
.admin-hero { background: linear-gradient(135deg, rgba(99,102,241,.2), rgba(168,85,247,.14)); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); }
.admin-hero h1 { font-size: clamp(34px, 5vw, 56px); }
.stat-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 16px; margin: 22px 0; }
.stat-card { border: 1px solid var(--border); background: var(--card); border-radius: 18px; padding: 20px; }
.stat-card span { display: block; color: var(--muted); font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.stat-card strong { display: block; margin-top: 10px; font-size: 26px; }
.admin-feature-grid { width: 100%; margin: 0; }
@media (max-width: 980px) { .admin-layout { grid-template-columns: 1fr; } .admin-sidebar { position: relative; height: auto; } .stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }

/* Batch 3 manhwa manager */
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.alert-success { border: 1px solid rgba(34,197,94,.35); background: rgba(20,83,45,.35); color: #bbf7d0; }
.table-card, .form-panel { margin-top: 22px; border: 1px solid var(--border); background: rgba(30,41,59,.72); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.table-scroll { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.admin-table th, .admin-table td { padding: 15px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.admin-table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.admin-table small { display: block; color: var(--muted); margin-top: 4px; }
.badge { display: inline-flex; padding: 6px 10px; border-radius: 999px; color: #c4b5fd; background: rgba(99,102,241,.16); border: 1px solid rgba(99,102,241,.28); font-weight: 900; font-size: 12px; }
.muted-badge { color: var(--muted); background: rgba(15,23,42,.4); border-color: var(--border); }
.warn-badge { color: #fde68a; background: rgba(217,119,6,.16); border-color: rgba(245,158,11,.32); }
.ok-badge { color: #bbf7d0; background: rgba(22,163,74,.16); border-color: rgba(34,197,94,.32); }
.btn-small { min-height: 34px; padding: 8px 12px; font-size: 12px; }
.inline-review-form { display: grid; gap: 10px; min-width: 260px; }
.review-table textarea { min-height: 90px; font-size: 13px; }
.quality-flow { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-top: 14px; }
.quality-flow div { border: 1px solid var(--border); background: rgba(15,23,42,.46); border-radius: 16px; padding: 14px; display: grid; gap: 6px; }
.quality-flow span { color: var(--muted); font-size: 13px; line-height: 1.5; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.empty-state { text-align: center; padding: 44px 20px; }
.admin-form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 22px; align-items: start; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
textarea { padding-top: 12px; min-height: 110px; resize: vertical; }
.check-row { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 10px !important; }
.check-row input { width: auto; min-height: auto; }
.sticky-guide { position: sticky; top: 24px; display: grid; gap: 16px; }
.sticky-guide h2 { margin: 0; }
.genre-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.genre-pill { display: inline-flex !important; align-items: center; gap: 7px !important; padding: 8px 10px; border: 1px solid var(--border); border-radius: 999px; background: rgba(15,23,42,.45); color: var(--muted); font-weight: 800; }
.genre-pill input { width: auto; min-height: auto; }
.guide-box { border: 1px solid rgba(34,211,238,.25); background: rgba(8,47,73,.28); border-radius: 16px; padding: 14px; color: #bae6fd; line-height: 1.5; }
.guide-list { display: grid; gap: 10px; color: var(--muted); font-weight: 800; }
.guide-list span { border: 1px solid var(--border); background: rgba(15,23,42,.42); border-radius: 14px; padding: 10px 12px; }
.section-heading { margin-bottom: 18px; }
.section-heading h2 { margin: 0 0 6px; }
.chapter-stat-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
.page-grid { display: grid; gap: 12px; }
.page-card { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; gap: 12px; align-items: center; border: 1px solid var(--border); background: rgba(15,23,42,.42); border-radius: 16px; padding: 13px; }
.page-num { color: #c4b5fd; font-weight: 900; }
.page-path { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-path small { display: block; margin-top: 4px; color: #c4b5fd; font-weight: 800; }
.page-card a { color: #67e8f9; font-weight: 800; }
.action-row { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.import-preview-card { margin-bottom: 34px; }
.import-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.import-card { display: grid; gap: 10px; border: 1px solid var(--border); border-radius: 18px; background: rgba(15,23,42,.48); padding: 12px; cursor: pointer; }
.import-card input { width: auto; min-height: auto; }
.import-thumb { display: block; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 14px; background: rgba(2,6,23,.6); border: 1px solid var(--border); }
.import-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.import-meta { display: grid; gap: 5px; min-width: 0; }
.import-meta small { color: var(--muted); }
.import-meta code { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.import-actions { margin-top: 8px; }
.payload-code { display: block; max-width: 360px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 980px) { .row-between, .admin-form-grid, .two-col, .quality-flow { grid-template-columns: 1fr; display: grid; } .sticky-guide { position: relative; top: 0; } .chapter-stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } .page-card { grid-template-columns: 1fr; } .action-row { justify-content: stretch; } }
