:root{
  color-scheme: dark;
}

*{box-sizing:border-box}

html,body{
  margin:0;
  padding:0;
  min-height:100%;
}

body{
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(59,130,246,.18), transparent 28%),
    radial-gradient(circle at top right, rgba(168,85,247,.16), transparent 24%),
    linear-gradient(180deg, #08101d 0%, #0b1220 100%);
  color:#e8eefb;
}

a{color:#9dc3ff}

.topbar{
  position:sticky;
  top:0;
  z-index:50;
  backdrop-filter: blur(12px);
  background: rgba(6,10,18,.82);
  border-bottom:1px solid rgba(255,255,255,.08);
}

.topbar .inner{
  max-width:1280px;
  margin:0 auto;
  padding:14px 18px;
  display:flex;
  gap:16px;
  justify-content:space-between;
  align-items:center;
}

.brand{
  font-weight:800;
  letter-spacing:.2px;
  white-space:nowrap;
}

.nav{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:center;
}

.nav a{
  text-decoration:none;
  color:#dbe6f7;
  padding:8px 12px;
  border-radius:999px;
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.06);
}

.nav a:hover{
  background:rgba(96,165,250,.18);
  border-color:rgba(96,165,250,.3);
}

.userbox{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:flex-end;
  white-space:nowrap;
}

.shell{
  max-width:1280px;
  margin:0 auto;
  padding:24px 18px 42px;
}

.pagehead{
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:flex-end;
  margin-bottom:18px;
}

.pagehead h1{
  margin:0;
  font-size:clamp(28px, 4vw, 44px);
  line-height:1.05;
}

.pagehead p{
  margin:8px 0 0;
}

.grid{
  display:grid;
  gap:16px;
}

.cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}
@media (max-width:1100px){
  .cols-4{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:900px){
  .cols-3,.cols-2{grid-template-columns:1fr}
  .pagehead{flex-direction:column; align-items:flex-start}
  .topbar .inner{flex-direction:column; align-items:flex-start}
  .userbox{width:100%; justify-content:flex-start; flex-wrap:wrap}
}
@media (max-width:650px){
  .cols-4{grid-template-columns:1fr}
}

.card{
  background: rgba(10,16,28,.8);
  border:1px solid rgba(255,255,255,.09);
  border-radius:22px;
  padding:18px;
  box-shadow:0 18px 46px rgba(0,0,0,.22);
}

.card h2,.card h3{
  margin-top:0;
}

.metric{
  font-size:34px;
  font-weight:800;
  line-height:1.05;
  margin-top:8px;
}

.label{
  color:#9ab0cf;
  font-size:13px;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.muted{
  color:#98a8c4;
}

.small{
  font-size:13px;
}

.code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  font-size:13px;
  font-weight:700;
}

.badge.free{
  background:rgba(16,185,129,.15);
  color:#8ce8bf;
}

.badge.borrowed{
  background:rgba(245,158,11,.15);
  color:#ffd88f;
}

.badge.admin{
  background:rgba(168,85,247,.18);
  color:#dfbcff;
}

.badge.member{
  background:rgba(59,130,246,.16);
  color:#b8d4ff;
}

.flash{
  padding:12px 14px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.08);
  margin-bottom:14px;
}

.flash.success{
  background:rgba(16,185,129,.13);
  color:#cbffe8;
}

.flash.error{
  background:rgba(239,68,68,.13);
  color:#ffd6d6;
}

.flash.info{
  background:rgba(59,130,246,.13);
  color:#dcebff;
}

.table-wrap{
  overflow:auto;
  border-radius:18px;
}

table{
  width:100%;
  border-collapse:collapse;
  min-width:760px;
}

th,td{
  text-align:left;
  padding:12px 10px;
  border-bottom:1px solid rgba(255,255,255,.08);
  vertical-align:top;
}

th{
  color:#c9d8ef;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.08em;
}

tr:hover td{
  background:rgba(255,255,255,.02);
}

.button,
button{
  appearance:none;
  border:none;
  border-radius:14px;
  padding:10px 14px;
  font-weight:700;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  text-decoration:none;
}

.button.primary,
button.primary{
  background:linear-gradient(135deg,#60a5fa,#8b5cf6);
  color:#fff;
}

.button.secondary,
button.secondary{
  background:rgba(255,255,255,.07);
  color:#edf4ff;
}

.button.success,
button.success{
  background:rgba(16,185,129,.16);
  color:#c9ffe3;
}

.button.danger,
button.danger{
  background:rgba(239,68,68,.16);
  color:#ffd0d0;
}

.button:disabled,
button:disabled{
  opacity:.5;
  cursor:not-allowed;
}

input,textarea,select{
  width:100%;
  color:#edf3ff;
  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.12);
  border-radius:14px;
  padding:12px 14px;
  outline:none;
}

input:focus,textarea:focus,select:focus{
  border-color:rgba(96,165,250,.72);
  box-shadow:0 0 0 4px rgba(96,165,250,.12);
}

textarea{
  min-height:120px;
  resize:vertical;
}

.form-grid{
  display:grid;
  gap:14px;
  grid-template-columns:repeat(2,minmax(0,1fr));
}

@media (max-width:780px){
  .form-grid{grid-template-columns:1fr}
}

.stack{
  display:grid;
  gap:16px;
}

.toolbar{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}

.hr{
  height:1px;
  background:rgba(255,255,255,.08);
  margin:16px 0;
}

.empty{
  padding:22px;
  text-align:center;
  color:#9eb2d2;
  border:1px dashed rgba(255,255,255,.12);
  border-radius:18px;
}

.scanner{
  width:100%;
  min-height:360px;
  border-radius:20px;
  overflow:hidden;
  background:#060a12;
  border:1px solid rgba(255,255,255,.1);
}

.login-shell{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:24px 16px;
}

.login-card{
  width:min(560px, 100%);
}
