:root {
  --accent: #8b7cff;
  --accent-dark: #7566ee;
  --accent-soft: rgba(139,124,255,.14);
  --bg: #090b10;
  --surface: #11141b;
  --surface-2: #151922;
  --surface-hover: #191e28;
  --text: #f5f7fb;
  --muted: #8e97a8;
  --border: #252b36;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(0,0,0,.28);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 28px; }

.site-header {
  background: rgba(9,11,16,.78);
  border-bottom: 1px solid rgba(255,255,255,.07);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  font-weight: 750;
  font-size: 18px;
  letter-spacing: -.035em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.brand span { color: var(--accent); }

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 13px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}

.nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 9px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -.01em;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.nav a:hover {
  color: var(--text);
  background: rgba(255,255,255,.07);
}

.nav a[aria-current="page"] {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 5px 18px rgba(139,124,255,.22), inset 0 1px 0 rgba(255,255,255,.12);
}

main { padding: 70px 0 100px; }
.page-head { margin-bottom: 30px; }
.eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .13em;
  margin-bottom: 9px;
}

h1 {
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1.12;
  letter-spacing: -.035em;
  margin: 0 0 12px;
  font-weight: 700;
}

.lead { color: var(--muted); font-size: 15px; max-width: 68ch; margin: 0 0 22px; }

.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.table-scroll { overflow-x: auto; }

table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
th, td {
  text-align: left;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: middle;
}

th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  font-weight: 700;
  background: var(--surface-2);
  white-space: nowrap;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: var(--surface-hover); }

td.name { font-weight: 600; min-width: 340px; }
td.num, td.date { color: var(--muted); white-space: nowrap; }

.book-title { display: flex; align-items: center; gap: 11px; min-width: 0; }
.book-title > span:last-child { overflow-wrap: anywhere; }
.pdf-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 25px;
  padding: 0 7px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: #bdb5ff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
}

.book-col { width: auto; }
th:nth-child(2), td:nth-child(2) { width: 100px; }
th:nth-child(3), td:nth-child(3) { width: 145px; }
.action-col { width: 125px; }
.view-head, .download-head { text-align: center; }
.action-cell { text-align: center; white-space: nowrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 104px;
  height: 38px;
  border-radius: 10px;
  padding: 0 13px;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  transition: .18s ease;
}
.btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.btn-view { background: var(--accent); color: #fff; border: 1px solid var(--accent); box-shadow: 0 4px 16px rgba(139,124,255,.2); }
.btn-view:hover { background: var(--accent-dark); border-color: var(--accent-dark); transform: translateY(-1px); }
.btn-download { background: #1a1f28; color: #e9ecf3; border: 1px solid #303744; }
.btn-download:hover { background: #222832; border-color: #414a59; transform: translateY(-1px); }

.state { padding: 56px 20px; text-align: center; color: var(--muted); font-size: 14px; }
.meta { margin: 13px 2px 0; font-size: 12px; color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 40px; }
.card-grid p { margin: 0; color: var(--muted); font-size: 14px; }
h2 { font-size: 18px; margin: 0 0 8px; font-weight: 600; }
.btn:disabled { opacity: .6; cursor: default; }
.form { max-width: 380px; }
.field { margin-bottom: 16px; }
label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
input[type="text"], input[type="password"] { width: 100%; padding: 9px 12px; font: inherit; font-size: 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); }
input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.status { margin-top: 16px; font-size: 14px; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--border); }
.status.ok { background: rgba(34,197,94,.1); border-color: rgba(34,197,94,.25); color: #86efac; }
.status.err { background: rgba(239,68,68,.1); border-color: rgba(239,68,68,.25); color: #fca5a5; }
.status.info { background: var(--accent-soft); border-color: rgba(139,124,255,.25); color: #c8c1ff; }
.status[hidden] { display: none; }
.note { color: var(--muted); font-size: 13px; }

@media (max-width: 760px) {
  .wrap { padding: 0 18px; }
  main { padding: 48px 0 70px; }
  .header-inner { height: 64px; }
  .nav a { padding: 0 10px; font-size: 12px; }
  th, td { padding: 13px 12px; }
  td.name { min-width: 280px; }
  th.date, td.date { display: none; }
  .action-col { width: 115px; }
}

@media (max-width: 500px) {
  .brand { font-size: 16px; }
  .nav { gap: 2px; padding: 3px; }
  .nav a { min-height: 31px; padding: 0 8px; }
  .btn { min-width: 92px; padding: 0 9px; }
  .btn span { display: none; }
  .btn svg { width: 17px; height: 17px; }
  .action-col { width: 72px; }
}
