:root {
    --navy: #102e50;
    --teal: #00786c;
    --deep-teal: #006459;
    --ink: #142c41;
    --muted: #425b6d;
    --line: #d8e5e9;
}
body { background: #f3f8fa; color: var(--ink); min-height: 100vh; display: flex; flex-direction: column; }
a { color: #006a60; text-underline-offset: .19em; }
h1, h2 { color: var(--navy); font-weight: 750; letter-spacing: -.03em; }
h1 { font-size: clamp(1.9rem, 5vw, 3.1rem); margin-bottom: .7rem; }
h2 { font-size: 1.35rem; }
p { color: var(--muted); }
.top { color: white; background: var(--navy); border-top: .32rem solid #25b6a0; }
.top-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-block: 1rem; }
.brand { display: flex; gap: .85rem; align-items: center; color: white; text-decoration: none; }
.brand:hover, .profile-link:hover { color: #b5f4eb; }
.brand img { border-radius: 50%; background: white; flex: none; }
.brand strong { display: block; font-size: 1.1rem; }
.brand small, .profile small { color: #d5e6f2; display: block; }
.profile { display: flex; align-items: center; gap: .8rem; }
.profile-link { color: white; }
.navstrip { background: white; border-bottom: 1px solid var(--line); }
.navstrip a { padding: .85rem 1rem; color: var(--navy); text-decoration: none; font-weight: 600; border-bottom: .18rem solid transparent; }
.navstrip a:hover, .navstrip a.active { border-color: var(--teal); color: var(--teal); background: #eff9f7; }
.main { flex: 1; padding-top: clamp(1.5rem, 4vw, 3rem); padding-bottom: 3.5rem; }
footer { background: #e4eef2; color: #284758; padding-block: 1.2rem; }
footer .container { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.skip { position: absolute; z-index: 5; background: white; padding: .5rem; }
.hero, .login-intro { background: linear-gradient(110deg, #092b4c, #075e65); color: white; border-radius: 1rem; padding: clamp(1.5rem, 4vw, 3rem); }
.hero h1, .login-intro h1, .hero p, .login-intro p { color: white; }
.hero p, .login-intro p { margin: 0; }
.login-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 1.25rem; max-width: 930px; margin: clamp(0rem, 5vw, 3rem) auto; }
.login-intro { display: grid; align-content: center; }
.login-intro img { border-radius: 50%; margin-bottom: 1.25rem; background: white; }
.card { --bs-card-border-color: var(--line); --bs-card-border-radius: .85rem; }
.auth, .form-panel { padding: clamp(1.25rem, 4vw, 2rem); max-width: 580px; }
.form-panel.wide { max-width: 860px; }
.auth > form, .form-panel > form, .threshold > form { display: grid; gap: 1rem; }
form > label, .field-grid > label { display: block; font-weight: 600; }
form > label > :is(input,select):not(.form-check-input), .field-grid input { margin-top: .32rem; }
.form-control, .form-select { border-color: #a8bdc7; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--teal); box-shadow: 0 0 0 .21rem #00998735; }
.form-check-input:checked { border-color: var(--teal); background-color: var(--teal); }
.btn-primary { --bs-btn-bg: var(--teal); --bs-btn-border-color: var(--teal); --bs-btn-hover-bg: var(--deep-teal); --bs-btn-hover-border-color: var(--deep-teal); --bs-btn-active-bg: var(--deep-teal); --bs-btn-active-border-color: var(--deep-teal); --bs-btn-focus-shadow-rgb: 0, 120, 108; }
.btn-outline-primary { --bs-btn-color: var(--teal); --bs-btn-border-color: var(--teal); --bs-btn-hover-bg: var(--deep-teal); --bs-btn-hover-border-color: var(--deep-teal); --bs-btn-active-bg: var(--deep-teal); --bs-btn-active-border-color: var(--deep-teal); --bs-btn-focus-shadow-rgb: 0, 120, 108; }
.filters { display: grid; grid-template-columns: minmax(10rem, 2fr) repeat(2, minmax(8rem, 1fr)) auto auto; align-items: end; gap: .75rem; padding: 1rem; margin: 1.25rem 0; }
.result-count { font-weight: 650; }
.book-grid, .resource-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.resource-grid { margin-top: 1.2rem; }
.book-card { overflow: hidden; }
.cover { height: 10.5rem; display: grid; place-items: center; background: linear-gradient(130deg, #d9f2ed, #dce9f5); }
.cover img { width: 100%; height: 10.5rem; object-fit: contain; }
.cover span { display: grid; place-items: center; width: 3.7rem; height: 4.6rem; border: 2px solid #487a84; border-radius: .3rem .8rem .3rem .3rem; color: #234652; font-weight: 700; }
.book-info { padding: 1rem; flex: 1; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.book-info p { margin-bottom: .45rem; }
.tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .55rem; }
.tags span { font-size: .875rem; background: #e3f5f1; color: #075649; padding: .14rem .45rem; border-radius: .4rem; }
.book-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: auto; padding-top: .55rem; }
.empty { border: 1px dashed #9eb8c3; border-radius: .75rem; padding: 1.5rem; background: white; }
.section-heading, .pager { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin: 1rem 0; }
.admin-nav { display: flex; flex-wrap: wrap; gap: .55rem; margin-bottom: 1.5rem; }
.reader { display: block; width: 100%; height: clamp(450px, 72vh, 900px); border: 1px solid var(--line); border-radius: .75rem; background: white; margin-bottom: 1rem; }
.field-grid, .check-grid, .stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats .card { padding: 1rem; }
.stats strong { font-size: 1.7rem; }
.status { display: inline-block; font-weight: 650; padding: .25rem .55rem; border-radius: .4rem; }
.status-green { color: #064937; background: #dff5e8; }
.status-yellow { color: #5f4300; background: #fff0bf; }
.status-red { color: #891c32; background: #fbe3e6; }
.threshold { padding: 1rem; margin: 1rem 0; }
.threshold summary { font-weight: 700; cursor: pointer; }
.threshold form { margin-top: 1rem; }
.threshold p { margin: 0; }
.threshold .btn { justify-self: start; }
.thumb { max-width: 6rem; max-height: 8rem; object-fit: contain; }
.table { --bs-table-color: var(--ink); --bs-table-border-color: var(--line); }
.table thead th { background: #edf5f8; color: var(--navy); }
.table :is(th,td) { padding: .75rem; overflow-wrap: anywhere; }
@media (max-width: 850px) {
    .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filters label:first-of-type { grid-column: 1 / -1; }
    .book-grid, .resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575px) {
    .top-inner { flex-wrap: wrap; }
    .navstrip a { padding: .65rem .55rem; }
    .login-grid, .book-grid, .resource-grid, .field-grid, .stats { grid-template-columns: 1fr; }
}

