/* ================= ROOT & RESET ================= */
:root{
  --brand:#0d6efd;
  --bg:#fafafa;
  --bg-card:#ffffff;
  --text:#1f2328;
  --muted:#6b7280;
  --border:#e5e7eb;
  --radius:12px;
}

*{box-sizing:border-box}

body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:var(--bg);
  color:var(--text);
  line-height:1.5;
}

a{color:var(--brand);text-decoration:none}
a:hover{text-decoration:underline}

.wrap{max-width:1200px;margin:0 auto;padding:0 16px}
.container{max-width:1000px;margin:24px auto;padding:0 16px}

/* ================= TOPBAR ================= */
.topbar{
  background:#111827;
  color:#fff;
}

.topbar .inner{
  display:flex;
  align-items:center;
  gap:16px;
  padding:12px 0;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:700;
}

.brand img{width:24px;height:24px}

/* Search */
.searchbar{
  display:flex;
  gap:10px;
  align-items:center;
  margin-left:auto;
}

.searchbar input,
.searchbar select{
  padding:10px 12px;
  border-radius:8px;
  border:1px solid #2b2f36;
  background:#0b1220;
  color:#fff;
}

.searchbar input::placeholder{color:#9ca3af}

.searchbar button{
  padding:10px 14px;
  border:0;
  border-radius:8px;
  background:var(--brand);
  color:#fff;
  font-weight:600;
  cursor:pointer;
}

.searchbar button:hover{opacity:.9}

/* ================= HERO ================= */
header.hero{
  background:url('banner.jpg') center/cover no-repeat;
  color:#fff;
}

header.hero .overlay{
  background:linear-gradient(90deg,rgba(0,0,0,.65),rgba(0,0,0,.25));
}

header.hero .overlay .wrap{
  padding:64px 16px;
}

header.hero h1{
  font-size:42px;
  margin:0 0 8px;
}

header.hero p{
  max-width:720px;
  color:#e5e7eb;
}

/* ================= TABS ================= */
nav.tabs{
  background:#fff;
  border-bottom:1px solid var(--border);
}

nav.tabs .wrap{
  display:flex;
  gap:18px;
  overflow:auto;
}

nav.tabs a{
  padding:12px 4px;
  color:#4b5563;
  border-bottom:2px solid transparent;
  white-space:nowrap;
}

nav.tabs a.active{
  color:#111827;
  font-weight:600;
  border-bottom-color:var(--brand);
}

/* ================= CARD ================= */
.card{
  background:var(--bg-card);
  border-radius:var(--radius);
  padding:16px;
  margin:16px 0;
  box-shadow:0 1px 6px rgba(0,0,0,.06);
}

/* ================= FORM ================= */
label{display:block;margin:10px 0 4px}

input[type="text"],
input[type="password"],
input[type="file"],
input[name="title"],
input[name="username"],
select{
  width:100%;
  padding:10px 12px;
  border-radius:8px;
  border:1px solid var(--border);
}

input:focus,
select:focus{
  outline:none;
  border-color:var(--brand);
}

/* Button */
button{
  padding:10px 16px;
  border:0;
  border-radius:10px;
  background:var(--brand);
  color:#fff;
  font-weight:600;
  cursor:pointer;
}

button:hover{opacity:.95}

/* ================= ALERT ================= */
.alert{
  background:#fff3cd;
  border:1px solid #ffe69c;
  padding:12px;
  border-radius:8px;
  margin:12px 0;
}

/* ================= GRID & BOOK ================= */
.section{padding:24px 0 40px}
.section h2{margin:8px 0 16px}

.grid{
  display:grid;
  gap:20px;
  grid-template-columns:repeat(auto-fill,minmax(170px,1fr));
}

.book{
  background:#fff;
  border-radius:12px;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  box-shadow:0 1px 3px rgba(0,0,0,.06);
  transition:.15s ease;
}

.book:hover{
  transform:translateY(-3px);
  box-shadow:0 12px 24px rgba(0,0,0,.1);
}

.book .cover{
  width:100%;
  height:240px;
  background:#eef2f7 url('assets/cover-placeholder.png') center/cover no-repeat;
}

.book .info{
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.book .title{
  font-size:15px;
  font-weight:600;
  line-height:1.3;
  height:40px;
  overflow:hidden;
}

.book .meta{
  font-size:12px;
  color:var(--muted);
}

.book .btn{
  margin-top:auto;
  padding:8px;
  text-align:center;
  background:var(--brand);
  color:#fff;
  border-radius:8px;
  font-weight:600;
}

/* ================= PAGINATION ================= */
.pager{
  display:flex;
  gap:8px;
  justify-content:center;
  margin-top:24px;
}

.pager a,
.pager span{
  padding:8px 12px;
  border-radius:8px;
  border:1px solid var(--border);
  background:#fff;
  color:#374151;
}

.pager .active{
  background:var(--brand);
  color:#fff;
  border-color:var(--brand);
}

/* ================= TABLE ================= */
table{width:100%;border-collapse:collapse}
th,td{padding:10px;border-bottom:1px solid #eee;text-align:left}

/* ================= CODE ================= */
code{
  background:#f1f3f5;
  padding:3px 6px;
  border-radius:6px;
  font-size:.9em;
}

/* ================= FOOTER ================= */
footer{
  text-align:center;
  padding:26px 0;
  color:var(--muted);
  font-size:.9rem;
}

/* ================= DARK MODE ================= */
.dark body{
  background:#121212;
  color:#e5e7eb;
}

.dark .card,
.dark .book,
.dark nav.tabs{
  background:#1e1e1e;
}

.dark input,
.dark select{
  background:#0b1220;
  color:#fff;
  border-color:#2b2f36;
}

.dark table td,
.dark table th{
  border-color:#2b2f36;
}