:root {
    --bg: #eef3f8;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --text: #172033;
    --muted: #64748b;
    --line: #d9e2ec;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --accent: #0f766e;
    --warning: #b45309;
    --danger: #dc2626;
    --success: #15803d;
    --sidebar: #111827;
    --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.10), transparent 30%),
        linear-gradient(180deg, #f8fafc 0%, var(--bg) 42%, #edf2f7 100%);
    color: var(--text);
    font-family: Cambria, "Cambria Math", Georgia, serif;
}

a {
    color: inherit;
    text-decoration: none;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 264px;
    background:
        linear-gradient(180deg, rgba(37, 99, 235, 0.14), transparent 24%),
        var(--sidebar);
    color: #fff;
    padding: 22px 18px;
    box-shadow: 12px 0 32px rgba(15, 23, 42, 0.16);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 26px;
    padding: 4px 4px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
    font-weight: 700;
}

.brand small,
.topbar p,
td small {
    display: block;
    color: var(--muted);
}

.sidebar nav {
    display: grid;
    gap: 6px;
}

.sidebar nav a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #dbe4f0;
    font-weight: 700;
    transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
}

.sidebar nav a:hover {
    transform: translateX(2px);
}

.sidebar nav a.active::before {
    position: absolute;
    inset: 9px auto 9px -18px;
    width: 4px;
    border-radius: 0 999px 999px 0;
    background: #60a5fa;
    content: "";
}

.nav-icon {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.10);
}

.nav-icon::before {
    width: 11px;
    height: 11px;
    border: 2px solid currentColor;
    border-radius: 3px;
    content: "";
}

.nav-buku::before,
.nav-laporan::before {
    width: 12px;
    height: 14px;
    border-radius: 2px;
}

.nav-peminjaman::before,
.nav-pengembalian::before {
    width: 13px;
    height: 9px;
    border-radius: 999px;
}

.nav-user::before,
.nav-anggota::before {
    width: 12px;
    height: 12px;
    border-radius: 999px;
}

.main {
    min-height: 100vh;
    margin-left: 264px;
    padding: 28px 30px 40px;
}

.topbar,
.panel-head,
.form-actions,
.actions,
.toolbar-actions,
.panel-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    margin: -28px -30px 24px;
    padding: 22px 30px;
    border-bottom: 1px solid rgba(217, 226, 236, 0.85);
    background: rgba(248, 250, 252, 0.86);
    backdrop-filter: blur(16px);
}

h1,
h2,
p {
    margin: 0;
}

h1 {
    font-size: 30px;
    letter-spacing: 0;
}

h2 {
    font-size: 18px;
    letter-spacing: 0;
}

.page-title p {
    margin-top: 5px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 6px 12px 6px 7px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.user-chip > span {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #e0f2fe;
    color: #075985;
    font-weight: 800;
}

.user-chip strong,
.user-chip small {
    display: block;
    line-height: 1.2;
}

.user-chip small {
    margin-top: 2px;
    color: var(--muted);
    text-transform: capitalize;
}

.stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.stat,
.panel,
.login-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.stat {
    position: relative;
    overflow: hidden;
    padding: 18px;
    min-height: 118px;
}

.stat::before {
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    content: "";
}

.stat:nth-child(2)::before {
    background: linear-gradient(90deg, var(--accent), #22c55e);
}

.stat:nth-child(3)::before {
    background: linear-gradient(90deg, #7c3aed, var(--primary));
}

.stat:nth-child(4)::before {
    background: linear-gradient(90deg, var(--danger), #f97316);
}

.stat:nth-child(5)::before {
    background: linear-gradient(90deg, var(--warning), #f59e0b);
}

.stat span {
    color: var(--muted);
}

.stat strong {
    display: block;
    margin-top: 8px;
    font-size: 28px;
    letter-spacing: 0;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.8fr);
    gap: 16px;
    margin-bottom: 16px;
}

.bar-chart {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: end;
    gap: 12px;
    min-height: 230px;
}

.bar-item {
    display: grid;
    align-items: end;
    gap: 8px;
    text-align: center;
}

.bar-value {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.bar-track {
    display: flex;
    align-items: end;
    justify-content: center;
    height: 170px;
    border-radius: 8px;
    background: #edf2f7;
}

.bar-fill {
    display: block;
    width: 70%;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(180deg, #38bdf8, var(--primary-dark));
}

.bar-item small {
    min-height: 32px;
    color: var(--muted);
    font-size: 12px;
}

.rank-list {
    display: grid;
    gap: 10px;
}

.rank-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.rank-item > span {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 700;
}

.rank-item strong,
.rank-item small {
    display: block;
}

.rank-item small {
    margin-top: 4px;
    color: var(--muted);
}

.rank-item em {
    color: var(--text);
    font-style: normal;
    font-weight: 700;
    white-space: nowrap;
}

.panel {
    padding: 18px;
    overflow-x: auto;
}

.panel-head {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.panel-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
}

table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 8px;
}

.data-table {
    min-width: 860px;
}

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    background: #f8fafc;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

tbody tr {
    transition: background 0.16s ease;
}

tbody tr:hover {
    background: #f8fafc;
}

.actions {
    justify-content: flex-end;
    white-space: nowrap;
}

.actions form {
    display: inline;
}

.toolbar-actions {
    justify-content: flex-end;
}

.toolbar-actions form {
    margin: 0;
}

.member-card-mini {
    display: grid;
    grid-template-columns: 54px minmax(120px, 1fr);
    gap: 10px;
    align-items: center;
    min-width: 210px;
}

.member-card-mini img {
    width: 54px;
    height: 54px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
}

.member-card-mini strong,
.member-card-mini small {
    display: block;
}

.member-card-mini small {
    margin-top: 4px;
    color: var(--muted);
}

.member-card-page {
    display: grid;
    justify-items: center;
}

.member-card-page .panel-head {
    width: 100%;
}

.member-card-print {
    width: 360px;
    overflow: hidden;
    border: 1px solid #111827;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(17, 24, 39, 0.12);
}

.member-card-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: #111827;
    color: #fff;
}

.member-card-brand span {
    display: inline-grid;
    place-items: center;
    width: 52px;
    height: 34px;
    border-radius: 6px;
    background: var(--primary);
    font-size: 12px;
    font-weight: 700;
}

.member-card-body {
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 18px 16px;
}

.member-card-qr {
    width: 116px;
    height: 116px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
}

.member-card-info span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.member-card-info h1 {
    margin-top: 5px;
    font-size: 20px;
}

.member-card-info h2 {
    margin-top: 8px;
    font-size: 17px;
    line-height: 1.25;
}

.member-card-info p {
    margin-top: 5px;
    color: var(--muted);
}

.member-card-footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 16px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.book-table .col-cover {
    width: 82px;
}

.book-cover,
.cover-preview {
    display: inline-grid;
    place-items: center;
    width: 54px;
    height: 76px;
    border: 1px solid var(--line);
    border-radius: 6px;
    object-fit: cover;
    background: #eef2f7;
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}

.cover-preview {
    width: 96px;
    height: 132px;
    flex: 0 0 auto;
}

.stock-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 30px;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 700;
}

.stock-ok {
    background: #dcfce7;
    color: #166534;
}

.stock-empty {
    background: #fee2e2;
    color: #991b1b;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.btn:hover {
    border-color: #bfcbda;
    background: #f8fafc;
    transform: translateY(-1px);
}

.btn-small {
    min-height: 32px;
    padding: 0 10px;
    font-size: 13px;
}

.btn-primary {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.20);
}

.btn-primary:hover {
    border-color: var(--primary-dark);
    background: var(--primary-dark);
}

.btn-danger {
    border-color: var(--danger);
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    border-color: #b91c1c;
    background: #b91c1c;
}

.badge {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #075985;
    font-size: 12px;
    font-weight: 700;
}

.badge-dipinjam {
    background: #e0f2fe;
    color: #075985;
}

.badge-terlambat {
    background: #fee2e2;
    color: #991b1b;
}

.badge-selesai {
    background: #dcfce7;
    color: #166534;
}

.badge-ebook {
    background: #fef3c7;
    color: #92400e;
}

.alert {
    margin-bottom: 16px;
    padding: 13px 15px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 700;
}

.alert.success {
    background: #dcfce7;
    border-color: #bbf7d0;
    color: var(--success);
}

.alert.error {
    background: #fee2e2;
    border-color: #fecaca;
    color: var(--danger);
}

.form-panel {
    max-width: 1040px;
}

.filter-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, max-content));
    gap: 10px;
    align-items: start;
    margin-bottom: 16px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.filter-bar input,
.filter-bar select {
    margin-bottom: 0;
}

.import-box {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 320px) auto auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(135deg, #f8fafc, #eff6ff);
}

.import-box small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.import-box input {
    margin-bottom: 0;
}

.book-search {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(150px, 210px) minmax(140px, 180px) minmax(130px, 170px) auto auto;
    gap: 10px;
    align-items: start;
    margin-bottom: 16px;
}

.book-search input,
.book-search select {
    margin-bottom: 0;
}

label {
    display: block;
    margin: 0 0 7px;
    color: var(--muted);
    font-weight: 700;
}

label span {
    color: var(--danger);
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    margin-bottom: 15px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font: inherit;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(37, 99, 235, 0.72);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

textarea {
    resize: vertical;
}

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

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

.field-wide {
    grid-column: 1 / -1;
}

.form-section {
    padding: 18px 0 2px;
    border-top: 1px solid var(--line);
}

.form-section + .form-section {
    margin-top: 16px;
}

.form-section:first-child {
    padding-top: 0;
    border-top: 0;
}

.form-section h2 {
    margin-bottom: 16px;
}

.cover-field {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.ebook-field {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto;
    gap: 12px;
    align-items: center;
    margin-top: 16px;
}

.cover-field small,
.ebook-field small {
    display: block;
    color: var(--muted);
    line-height: 1.5;
}

.loan-items {
    margin: 6px 0 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.loan-items-head,
.loan-row {
    display: grid;
    gap: 10px;
    align-items: end;
}

.loan-items-head {
    grid-template-columns: 1fr auto;
    margin-bottom: 12px;
}

.loan-row {
    grid-template-columns: minmax(260px, 1fr) 120px auto;
}

.loan-row + .loan-row {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.loan-row input,
.loan-row select {
    margin-bottom: 0;
}

.loan-note {
    margin: -2px 0 16px;
    color: var(--muted);
}

.login-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(135deg, rgba(8, 18, 32, 0.74), rgba(15, 118, 110, 0.52)),
        url("../img/login-batik.png") center / cover no-repeat;
}

.login-card {
    width: min(420px, 100%);
    padding: 28px;
    border-color: rgba(255, 255, 255, 0.32);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
}

.register-card {
    width: min(720px, 100%);
}

.login-card h1 {
    margin-bottom: 6px;
}

.login-card p {
    margin-bottom: 22px;
    color: var(--muted);
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.login-divider::before,
.login-divider::after {
    height: 1px;
    flex: 1;
    background: var(--line);
    content: "";
}

.auth-switch {
    margin-top: 18px;
    color: var(--muted);
    text-align: center;
}

.auth-switch a {
    color: var(--primary);
    font-weight: 800;
}

.full {
    width: 100%;
}

.empty {
    color: var(--muted);
    text-align: center;
}

.landing-page {
    min-height: 100vh;
    background: #f8fafc;
}

.landing-nav {
    position: fixed;
    inset: 0 0 auto;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px clamp(18px, 5vw, 76px);
    color: #fff;
}

.landing-brand,
.landing-nav nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.landing-brand span {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.20);
    font-weight: 800;
}

.landing-nav nav a:not(.btn) {
    color: rgba(255, 255, 255, 0.82);
    font-weight: 700;
}

.landing-nav .btn {
    border-color: rgba(255, 255, 255, 0.42);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.landing-hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 82vh;
    padding: 110px clamp(18px, 5vw, 76px) 70px;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(8, 18, 32, 0.90), rgba(8, 18, 32, 0.52), rgba(8, 18, 32, 0.30)),
        url("../img/landing-library.png") center / cover no-repeat,
        #111827;
    color: #fff;
}

.landing-hero-overlay {
    position: absolute;
    inset: auto 0 0;
    height: 160px;
    background: linear-gradient(180deg, transparent, #f8fafc);
}

.landing-hero-content {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
}

.landing-hero-content > span,
.landing-section-head span {
    color: #bfdbfe;
    font-weight: 800;
    text-transform: uppercase;
}

.landing-hero h1 {
    margin-top: 14px;
    color: #fff;
    font-size: clamp(44px, 8vw, 86px);
    line-height: 0.98;
}

.landing-hero p {
    width: min(620px, 100%);
    margin-top: 18px;
    color: rgba(255, 255, 255, 0.84);
    font-size: 20px;
    line-height: 1.6;
}

.landing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.landing-stats,
.landing-section {
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto;
}

.landing-stats {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: -48px;
}

.landing-stats div,
.landing-feature-grid article {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.landing-stats div {
    padding: 20px;
}

.landing-stats strong,
.landing-stats span {
    display: block;
}

.landing-stats strong {
    font-size: 34px;
}

.landing-stats span {
    margin-top: 5px;
    color: var(--muted);
    font-weight: 700;
}

.landing-section {
    padding: 70px 0;
}

.landing-section-head {
    max-width: 660px;
    margin-bottom: 20px;
}

.landing-section-head span {
    color: var(--primary);
}

.landing-section-head h2 {
    margin-top: 10px;
    font-size: clamp(30px, 5vw, 48px);
    line-height: 1.08;
}

.landing-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.landing-feature-grid article {
    padding: 22px;
}

.landing-feature-grid article > span {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: #e0f2fe;
    color: #075985;
    font-weight: 800;
}

.landing-feature-grid h3 {
    margin: 18px 0 8px;
    font-size: 22px;
}

.landing-feature-grid p {
    color: var(--muted);
    line-height: 1.6;
}

.member-page {
    max-width: 1220px;
    margin: 0 auto;
    padding: 28px;
}

body:has(.member-page) {
    background:
        radial-gradient(circle at 14% 0%, rgba(14, 165, 233, 0.16), transparent 34%),
        radial-gradient(circle at 92% 8%, rgba(15, 118, 110, 0.14), transparent 30%),
        linear-gradient(180deg, #f8fafc 0%, #eef7f7 100%);
}

.member-topbar,
.member-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.member-topbar {
    position: sticky;
    top: 0;
    z-index: 4;
    padding: 14px 0;
    border-bottom: 1px solid rgba(217, 226, 236, 0.80);
    background: rgba(248, 250, 252, 0.82);
    backdrop-filter: blur(16px);
}

.member-brand-block,
.member-top-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.member-logo {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24);
    font-weight: 800;
}

.member-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 374px;
    gap: 16px;
    align-items: stretch;
    margin-bottom: 18px;
}

.member-dashboard-grid .member-hero {
    margin-bottom: 0;
}

.member-topbar h1 {
    font-size: 28px;
    line-height: 1.1;
}

.member-topbar p,
.member-hero span,
.catalog-head p {
    color: var(--muted);
}

.member-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.member-nav a {
    min-height: 38px;
    padding: 10px 14px;
    border-radius: 7px;
    color: var(--muted);
    font-weight: 700;
}

.member-nav a:hover,
.member-nav a.active {
    background: #e0f2fe;
    color: var(--text);
}

.member-hero {
    position: relative;
    overflow: hidden;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.10), rgba(15, 118, 110, 0.10)),
        #fff;
    box-shadow: var(--shadow);
}

.member-hero::after {
    position: absolute;
    inset: auto -36px -58px auto;
    width: 150px;
    height: 150px;
    border: 24px solid rgba(37, 99, 235, 0.08);
    border-radius: 999px;
    content: "";
}

.member-hero h2 {
    margin-top: 4px;
    max-width: 520px;
    font-size: 26px;
}

.member-hero p {
    max-width: 560px;
    margin-top: 8px;
    color: var(--muted);
    line-height: 1.6;
}

.member-self-card {
    overflow: hidden;
    border: 1px solid rgba(17, 24, 39, 0.18);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.member-self-card-head,
.member-self-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
}

.member-self-card-head {
    background: linear-gradient(135deg, #111827, #164e63);
    color: #fff;
}

.member-self-card-head span {
    display: inline-grid;
    place-items: center;
    width: 52px;
    height: 32px;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--primary), #38bdf8);
    font-size: 12px;
    font-weight: 800;
}

.member-self-card-body {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 18px 16px;
}

.member-self-card-body img {
    width: 112px;
    height: 112px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.member-self-card-body small,
.member-self-card-foot {
    color: var(--muted);
}

.member-self-card-body h2 {
    margin: 4px 0 7px;
    font-size: 22px;
}

.member-self-card-body strong,
.member-self-card-body p {
    display: block;
}

.member-self-card-body p {
    margin-top: 5px;
    color: var(--muted);
}

.member-self-card-foot {
    border-top: 1px solid var(--line);
    font-size: 12px;
    font-weight: 700;
}

.catalog-filter {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) minmax(150px, 190px) minmax(140px, 180px) auto auto;
    gap: 10px;
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.catalog-filter input,
.catalog-filter select {
    margin-bottom: 0;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.catalog-summary {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 14px;
    color: var(--muted);
}

.catalog-summary strong {
    color: var(--text);
    font-size: 20px;
}

.catalog-item {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 15px;
    min-height: 178px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.catalog-item:hover {
    transform: translateY(-2px);
    border-color: #c7d7e8;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.10);
}

.catalog-cover {
    display: inline-grid;
    place-items: center;
    width: 92px;
    height: 132px;
    border: 1px solid var(--line);
    border-radius: 6px;
    object-fit: cover;
    background: linear-gradient(135deg, #eef2f7, #e0f2fe);
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.catalog-body {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
}

.catalog-body h3 {
    margin: 10px 0 6px;
    font-size: 18px;
    line-height: 1.3;
}

.catalog-body p {
    color: var(--text);
}

.catalog-body small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
}

.catalog-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.ebook-reader {
    display: grid;
    gap: 18px;
}

.ebook-reader-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--shadow);
}

.ebook-reader-head h2 {
    margin-top: 8px;
    font-size: 24px;
}

.ebook-reader-head p {
    margin-top: 5px;
    color: var(--muted);
}

.ebook-reader-actions,
.ebook-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.ebook-book-shell {
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(15, 23, 42, 0.06), transparent 18%, transparent 82%, rgba(15, 23, 42, 0.06)),
        #dbe7ef;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55), var(--shadow);
    perspective: 1600px;
}

.ebook-book {
    position: relative;
    display: grid;
    grid-template-columns: minmax(190px, 0.38fr) minmax(0, 1fr);
    min-height: 680px;
    overflow: hidden;
    border-radius: 8px;
    background: #f8fafc;
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.20);
    transform-style: preserve-3d;
}

.ebook-book::before {
    position: absolute;
    inset: 0 auto 0 37.8%;
    z-index: 3;
    width: 18px;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.24), rgba(255, 255, 255, 0.72), rgba(15, 23, 42, 0.16));
    content: "";
}

.ebook-page {
    position: relative;
    min-width: 0;
    background: #fff;
}

.ebook-page-left {
    display: grid;
    place-items: center;
    padding: 26px;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(15, 118, 110, 0.14)),
        #f8fafc;
    text-align: center;
}

.ebook-page-left span {
    display: inline-grid;
    place-items: center;
    width: 72px;
    height: 44px;
    margin-bottom: 16px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
}

.ebook-page-left strong,
.ebook-page-left p {
    display: block;
}

.ebook-page-left strong {
    color: var(--muted);
}

.ebook-page-left p {
    margin-top: 10px;
    font-size: 22px;
    line-height: 1.3;
}

.ebook-page-right {
    overflow: hidden;
    background: #fff;
}

.ebook-page-right iframe {
    width: 100%;
    height: 100%;
    min-height: 680px;
    border: 0;
    background: #fff;
}

.ebook-flip-page {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    transform: rotateY(0deg);
    transform-origin: left center;
    opacity: 0;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.96)),
        repeating-linear-gradient(0deg, transparent 0 27px, rgba(15, 23, 42, 0.025) 28px);
    box-shadow: -16px 0 32px rgba(15, 23, 42, 0.18);
}

.ebook-book.is-flipping-next .ebook-flip-page {
    animation: pageFlipNext 0.72s ease-in-out;
}

.ebook-book.is-flipping-prev .ebook-flip-page {
    animation: pageFlipPrev 0.72s ease-in-out;
}

.ebook-controls {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.86);
}

.ebook-controls span {
    min-width: 110px;
    color: var(--muted);
    font-weight: 800;
    text-align: center;
}

.ebook-fallback {
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
    text-align: center;
}

.ebook-fallback p {
    margin: 8px 0 18px;
    color: var(--muted);
}

@keyframes pageFlipNext {
    0% {
        opacity: 0;
        transform: rotateY(0deg);
    }
    18% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: rotateY(-178deg);
    }
}

@keyframes pageFlipPrev {
    0% {
        opacity: 0;
        transform: rotateY(-178deg);
    }
    18% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: rotateY(0deg);
    }
}

.detail-grid,
.report-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.detail-grid div,
.report-link {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.detail-grid span,
.report-link span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
}

.report-link {
    box-shadow: var(--shadow);
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.report-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
}

.report-link strong {
    display: block;
    margin-bottom: 8px;
    font-size: 18px;
}

@media print {
    .sidebar,
    .topbar,
    .panel-actions {
        display: none;
    }

    .main {
        margin-left: 0;
        padding: 0;
    }

    .panel {
        border: 0;
        box-shadow: none;
    }

    .member-card-page {
        display: block;
        padding: 0;
    }

    .member-card-print {
        box-shadow: none;
    }
}

@media (max-width: 860px) {
    .sidebar {
        position: static;
        width: auto;
        box-shadow: none;
    }

    .landing-nav {
        position: absolute;
        align-items: flex-start;
        flex-direction: column;
    }

    .landing-nav nav {
        flex-wrap: wrap;
    }

    .landing-hero {
        min-height: 78vh;
        padding-top: 160px;
    }

    .landing-hero p {
        font-size: 17px;
    }

    .landing-stats,
    .landing-feature-grid {
        grid-template-columns: 1fr;
    }

    .main {
        margin-left: 0;
        padding: 18px;
    }

    .topbar {
        position: static;
        align-items: flex-start;
        flex-direction: column;
        margin: -18px -18px 18px;
        padding: 18px;
    }

    .topbar-actions,
    .user-chip {
        width: 100%;
    }

    .topbar-actions {
        justify-content: space-between;
    }

    .stats,
    .dashboard-grid,
    .member-dashboard-grid,
    .grid-2,
    .grid-3,
    .detail-grid,
    .report-grid,
    .filter-bar,
    .import-box,
    .book-search,
    .catalog-filter {
        grid-template-columns: 1fr;
    }

    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bar-chart {
        overflow-x: auto;
        grid-template-columns: repeat(6, minmax(74px, 1fr));
    }

    .cover-field {
        display: grid;
    }

    .ebook-field {
        grid-template-columns: 1fr;
    }

    .loan-items-head,
    .loan-row {
        grid-template-columns: 1fr;
    }

    .member-page {
        padding: 18px;
    }

    .member-topbar,
    .member-hero,
    .member-brand-block,
    .member-top-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .member-topbar {
        position: static;
        padding-top: 0;
    }

    .member-top-actions,
    .member-top-actions .btn,
    .member-nav {
        width: 100%;
    }

    .member-top-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .member-nav {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .catalog-item {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .catalog-cover {
        width: 72px;
        height: 104px;
    }

    .member-self-card-body {
        grid-template-columns: 96px minmax(0, 1fr);
    }

    .member-self-card-body img {
        width: 96px;
        height: 96px;
    }

    .ebook-reader-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .ebook-reader-actions,
    .ebook-reader-actions .btn {
        width: 100%;
    }

    .ebook-book-shell {
        padding: 12px;
    }

    .ebook-book {
        grid-template-columns: 1fr;
        min-height: 560px;
    }

    .ebook-book::before,
    .ebook-page-left {
        display: none;
    }

    .ebook-page-right iframe {
        min-height: 560px;
    }
}
