:root{
  --bg:#0b0f17;
  --card:#121a28;
  --muted:#9fb0c5;
  --text:#e8eef7;
  --line:#233044;
  --accent:#4ea1ff;
  --danger:#ff5a6b;
  --ok:#39d98a;
}

*{ box-sizing:border-box; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 20% 0%, #12223a 0%, var(--bg) 55%);
  color:var(--text);
}

header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:16px 18px;
  border-bottom:1px solid var(--line);
  position:sticky;
  top:0;
  background: rgba(11,15,23,.85);
  backdrop-filter: blur(10px);
}

.headerLeft h1{ margin:0; font-size:20px; letter-spacing:.2px; }
.sub{ margin:2px 0 0; color:var(--muted); font-size:12px; }

.headerNav{ display:flex; gap:10px; }

main{ padding:18px; max-width:1100px; margin:0 auto; }

button{
  border:1px solid var(--line);
  background:#0f1625;
  color:var(--text);
  padding:10px 12px;
  border-radius:10px;
  cursor:pointer;
  font-weight:600;
}
button:hover{ border-color:#355076; }
button:disabled{ opacity:.55; cursor:not-allowed; }

button.secondary{
  background: transparent;
}

button.danger{
  border-color: rgba(255,90,107,.35);
  background: rgba(255,90,107,.12);
}
button.danger:hover{ border-color: rgba(255,90,107,.7); }

.card{
  background: rgba(18,26,40,.92);
  border:1px solid var(--line);
  border-radius:16px;
  padding:14px;
  box-shadow: 0 10px 28px rgba(0,0,0,.25);
}

.status{
  margin-bottom:12px;
  padding:10px 12px;
  border-radius:12px;
  border:1px dashed #355076;
  color: var(--muted);
}
.hidden{ display:none; }

.controls .controlRow{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  align-items:end;
}
.control{
  display:flex;
  flex-direction:column;
  gap:6px;
  font-size:12px;
  color:var(--muted);
}
input, select{
  width: 220px;
  max-width: 100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#0f1625;
  color:var(--text);
  outline:none;
}
input:focus, select:focus{ border-color:#355076; }

.formGrid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:12px;
  margin-top:12px;
}
.formGrid label{
  display:flex;
  flex-direction:column;
  gap:6px;
  font-size:12px;
  color:var(--muted);
}
.formGrid .wide{ grid-column: 1 / -1; }

.error{ color: #ff9aa4; min-height: 16px; }
.hint{ color: var(--muted); opacity:.9; }

.formActions{
  display:flex;
  gap:10px;
  margin-top:12px;
}

.grid{
  margin-top:14px;
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:12px;
}
@media (max-width: 720px){
  .grid{ grid-template-columns: 1fr; }
  input, select{ width: 100%; }
  header{ flex-direction:column; align-items:flex-start; }
}

.bookCard{
  display:flex;
  gap:12px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:16px;
  background: rgba(18,26,40,.92);
}
.thumbWrap{
  width:84px;
  flex: 0 0 84px;
}
.thumb{
  width:84px;
  height:116px;
  object-fit:cover;
  border-radius:12px;
  border:1px solid var(--line);
  background:#0f1625;
}
.bookInfo{ flex:1; min-width:0; }
.bookTitle{
  margin:0;
  font-size:16px;
  line-height:1.2;
}
.muted{ margin:6px 0 8px; color:var(--muted); }
.meta{ margin:0 0 10px; display:flex; gap:8px; flex-wrap:wrap; }
.pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#0f1625;
  color:var(--text);
  font-size:12px;
}
.actions{ display:flex; gap:8px; flex-wrap:wrap; }

.paging{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  margin:16px 0 30px;
  color:var(--muted);
}

.statsGrid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:12px;
  margin-top:12px;
}
@media (max-width: 900px){ .statsGrid{ grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px){ .statsGrid{ grid-template-columns: 1fr; } }

.statCard{
  background: rgba(18,26,40,.92);
  border:1px solid var(--line);
  border-radius:16px;
  padding:14px;
}
.statCard h2{ margin:0; color:var(--muted); font-size:12px; font-weight:600; }
.statCard p{ margin:10px 0 0; font-size:26px; font-weight:800; }

table{
  width:100%;
  border-collapse: collapse;
  margin-top: 10px;
}
th, td{
  text-align:left;
  padding:10px 8px;
  border-bottom:1px solid var(--line);
  color:var(--text);
}
th{ color:var(--muted); font-size:12px; }
.empty{ text-align:center; }
