:root{
  --navy:#0F172A; --blue:#2563EB; --teal:#0D9488; --slate:#475569;
  --bg:#F4F6FB; --card:#FFFFFF; --border:#E4E9F2; --text:#1E293B;
  --sidebar-w:272px;
}
*{box-sizing:border-box;}
html,body{margin:0;padding:0;height:100%;}
body{
  font-family:'Inter',system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  background:var(--bg); color:var(--text); -webkit-font-smoothing:antialiased;
}
a{color:inherit; text-decoration:none;}

.shell{display:flex; min-height:100vh;}

/* ---------- Sidebar ---------- */
.sidebar{
  width:var(--sidebar-w); flex-shrink:0; background:var(--navy); color:#E2E8F0;
  display:flex; flex-direction:column; position:sticky; top:0; height:100vh;
  overflow-y:auto; z-index:20;
}
.brand{display:flex; align-items:center; gap:12px; padding:22px 20px 18px;}
.brand-mark{
  width:40px; height:40px; border-radius:10px; background:linear-gradient(135deg,var(--blue),var(--teal));
  display:flex; align-items:center; justify-content:center; font-weight:800; font-size:12px; letter-spacing:.5px;
}
.brand-text{display:flex; flex-direction:column; line-height:1.3;}
.brand-text strong{font-size:14.5px; color:#fff;}
.brand-text span{font-size:11px; color:#94A3B8; text-transform:uppercase; letter-spacing:1px;}

.nav-list{display:flex; flex-direction:column; padding:6px 12px; gap:2px; flex:1;}
.nav-heading{
  font-size:10.5px; text-transform:uppercase; letter-spacing:1.5px; color:#64748B;
  margin:16px 12px 6px;
}
.nav-item{
  display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:10px;
  font-size:13.5px; color:#CBD5E1; font-weight:500;
}
.nav-item:hover{background:rgba(255,255,255,.06); color:#fff;}
.nav-item.active{background:rgba(37,99,235,.18); color:#fff;}
.nav-ico{font-size:14px; opacity:.85;}
.book-nav-item{align-items:flex-start; padding:9px 12px;}
.nav-dot{
  width:8px; height:8px; border-radius:50%; background:var(--dot,#2563EB); margin-top:5px; flex-shrink:0;
}
.nav-item-text{display:flex; flex-direction:column; line-height:1.35;}
.nav-item-text small{font-size:10px; color:#7C8AA5; text-transform:uppercase; letter-spacing:.5px;}

.sidebar-foot{
  padding:16px 20px 22px; border-top:1px solid rgba(255,255,255,.08); font-size:11px; color:#7C8AA5; line-height:1.6;
}
.pub-name{color:#CBD5E1; font-weight:600; margin-bottom:2px;}

/* ---------- Main column ---------- */
.main-col{flex:1; min-width:0; display:flex; flex-direction:column;}
.topbar{
  display:flex; align-items:center; gap:14px; padding:16px 28px; background:var(--card);
  border-bottom:1px solid var(--border); position:sticky; top:0; z-index:10;
}
.burger{display:none; background:none; border:none; font-size:20px; cursor:pointer; color:var(--slate);}
.topbar-title{font-weight:700; font-size:15px; color:var(--navy);}
.topbar-spacer{flex:1;}
.topbar-badge{
  font-size:11px; font-weight:700; letter-spacing:.5px; text-transform:uppercase;
  background:#EFF6FF; color:var(--blue); padding:6px 12px; border-radius:999px;
}

.content-area{flex:1; padding:28px 32px 40px; max-width:1200px; width:100%; margin:0 auto;}

/* ---------- Overview ---------- */
.hero-panel{
  background:linear-gradient(135deg,var(--navy) 0%, #1E3A8A 60%, var(--teal) 140%);
  color:#fff; border-radius:20px; padding:40px 36px; margin-bottom:26px;
  box-shadow:0 14px 30px rgba(15,23,42,.16);
}
.hero-panel-badge{
  display:inline-block; font-size:11px; font-weight:800; letter-spacing:2px; text-transform:uppercase;
  background:rgba(255,255,255,.14); border:1px solid rgba(255,255,255,.3); padding:5px 14px; border-radius:999px;
  margin-bottom:14px;
}
.hero-panel h1{margin:0 0 10px; font-size:28px;}
.hero-panel p{margin:0; max-width:680px; opacity:.92; line-height:1.7; font-size:14.5px;}

.stat-row{display:grid; grid-template-columns:repeat(3,1fr); gap:16px; margin-bottom:28px;}
.stat-card{
  background:var(--card); border:1px solid var(--border); border-radius:16px; padding:20px 22px;
  display:flex; flex-direction:column; gap:4px; box-shadow:0 4px 14px rgba(15,23,42,.04);
}
.stat-num{font-size:26px; font-weight:800; color:var(--navy);}
.stat-label{font-size:12px; color:var(--slate); text-transform:uppercase; letter-spacing:.5px;}

.book-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:18px;}
.book-card{
  background:var(--card); border:1px solid var(--border); border-top:4px solid var(--accent,#2563EB);
  border-radius:16px; padding:22px; display:flex; flex-direction:column; gap:8px;
  box-shadow:0 4px 14px rgba(15,23,42,.04); transition:transform .15s ease, box-shadow .15s ease;
}
.book-card:hover{transform:translateY(-3px); box-shadow:0 12px 26px rgba(15,23,42,.09);}
.book-card-top{display:flex; justify-content:space-between; font-size:11px; color:var(--slate); font-weight:700; text-transform:uppercase; letter-spacing:.5px;}
.book-card h3{margin:2px 0 0; font-size:17px; color:var(--navy);}
.book-card p{margin:0 0 8px; font-size:13px; color:var(--slate); line-height:1.55; flex:1;}
.book-card-actions{display:flex; gap:8px;}

/* ---------- Detail / viewer ---------- */
.back-link{font-size:13px; color:var(--blue); font-weight:600; display:inline-block; margin-bottom:14px;}
.detail-head{margin-bottom:18px;}
.detail-title-row{display:flex; justify-content:space-between; align-items:flex-end; gap:20px; flex-wrap:wrap;}
.detail-kicker{font-size:11px; font-weight:800; letter-spacing:1.5px; text-transform:uppercase; margin-bottom:8px;}
.detail-title-row h1{margin:0 0 8px; font-size:24px; color:var(--navy);}
.detail-subtitle{margin:0; font-size:13.5px; color:var(--slate); max-width:640px; line-height:1.6;}
.detail-actions{display:flex; gap:10px; flex-shrink:0;}

.viewer-frame-wrap{
  background:var(--card); border:1px solid var(--border); border-radius:16px; overflow:hidden;
  box-shadow:0 4px 14px rgba(15,23,42,.05); height:calc(100vh - 260px); min-height:520px;
}
.viewer-frame{width:100%; height:100%; border:none; display:block;}

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex; align-items:center; gap:6px; padding:10px 18px; border-radius:10px;
  font-size:13px; font-weight:700; cursor:pointer; border:1px solid transparent; white-space:nowrap;
}
.btn-sm{padding:8px 14px; font-size:12.5px;}
.btn-primary{background:var(--blue); color:#fff;}
.btn-primary:hover{background:#1D4ED8;}
.btn-outline{background:#fff; color:var(--blue); border-color:#BFDBFE;}
.btn-outline:hover{background:#EFF6FF;}
.btn-ghost{background:#F1F5F9; color:var(--slate);}
.btn-ghost:hover{background:#E2E8F0;}

/* ---------- Footer ---------- */
.app-footer{
  padding:16px 32px 26px; font-size:11.5px; color:#94A3B8; display:flex; gap:8px; flex-wrap:wrap;
  max-width:1200px; margin:0 auto; width:100%;
}
.dot-sep{opacity:.5;}

/* ---------- Responsive ---------- */
@media (max-width:900px){
  .sidebar{
    position:fixed; left:0; top:0; transform:translateX(-100%); transition:transform .2s ease; box-shadow:0 0 0 100vmax rgba(0,0,0,0);
  }
  .sidebar.open{transform:translateX(0); box-shadow:0 0 0 100vmax rgba(0,0,0,.35);}
  .burger{display:inline-block;}
  .content-area{padding:20px 16px 32px;}
  .stat-row{grid-template-columns:1fr 1fr;}
  .detail-title-row{flex-direction:column; align-items:flex-start;}
  .viewer-frame-wrap{height:70vh;}
}
