﻿@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Cormorant+Garamond:wght@600;700&display=swap');

:root {
    --bg: #fcf6f7;
    --surface: #fffdfd;
    --surface-soft: #f8eff1;
    --ink: #241217;
    --muted: #705c63;
    --primary: #6f1028;
    --primary-dark: #4f0a1b;
    --accent: #8f2a43;
    --accent-soft: #f4dde3;
    --line: #ead5db;
    --success-bg: #f5e8eb;
    --success-text: #7b1830;
    --error-bg: #f7e1e6;
    --error-text: #7f132a;
    --shadow: 0 20px 48px rgba(79, 10, 27, 0.1);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    min-width: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(111, 16, 40, 0.12), transparent 24%),
        linear-gradient(180deg, #fffafb 0%, var(--bg) 100%);
    color: var(--ink);
    font-family: 'Plus Jakarta Sans', sans-serif;
}

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

button,
input,
select,
textarea {
    font: inherit;
}

button {
    border: none;
    cursor: pointer;
}

input,
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--ink);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(111, 16, 40, 0.45);
    box-shadow: 0 0 0 4px rgba(111, 16, 40, 0.1);
}

textarea {
    resize: vertical;
}

h1,
h2,
h3,
p,
li,
td,
th,
span {
    overflow-wrap: anywhere;
}

h1,
h2,
h3 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(2.2rem, 4vw, 3.4rem);
}

h2 {
    font-size: clamp(1.5rem, 2.8vw, 2.2rem);
}

h3 {
    font-size: 1.1rem;
}

p {
    color: var(--muted);
    line-height: 1.7;
}

.shell {
    width: min(1140px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 253, 248, 0.94);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(34, 49, 39, 0.08);
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 18px 0;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--ink);
}

.brand-badge {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #6f1028 0%, #a73f59 100%);
    color: #fff;
    box-shadow: 0 12px 28px rgba(111, 16, 40, 0.24);
}

.public-nav,
.member-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

.public-nav a,
.member-nav a {
    font-weight: 600;
    color: var(--muted);
}

.public-nav a:hover,
.member-nav a:hover,
.text-link:hover {
    color: var(--primary);
}

.nav-button {
    padding: 11px 18px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff !important;
}

.nav-button:hover {
    background: var(--primary-dark);
}

.landing-section,
.info-section,
.page-space {
    padding: 42px 0;
}

.landing-grid,
.info-grid,
.content-grid {
    display: grid;
    gap: 24px;
}

.landing-grid {
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
    align-items: start;
}

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

.content-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
    margin-top: 24px;
}

.admin-layout {
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
}

.panel,
.book-card,
.loan-card,
.mini-stat,
.point-card,
.empty-state {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
}

.panel {
    padding: 30px;
}

.landing-copy,
.auth-card {
    min-height: 100%;
}

.kicker {
    display: inline-flex;
    align-items: center;
    padding: 7px 13px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.lead-text {
    max-width: 56ch;
    font-size: 1.02rem;
    margin-top: 14px;
}

.section-text {
    margin-top: 10px;
}

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

.point-card {
    padding: 18px;
    border-radius: var(--radius-lg);
}

.point-card h3,
.info-card h2,
.section-intro h2 {
    margin-bottom: 10px;
}

.auth-card h2 {
    margin-bottom: 4px;
}

.auth-shell {
    margin-top: 20px;
}

.auth-tabs {
    display: inline-flex;
    width: 100%;
    padding: 5px;
    border-radius: 999px;
    background: #f7e8ec;
    margin-bottom: 18px;
}

.tab-button {
    flex: 1;
    padding: 11px 14px;
    background: transparent;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 700;
}

.tab-button.is-active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 6px 18px rgba(34, 49, 39, 0.08);
}

.auth-shell .form-box {
    display: none;
}

.auth-shell .form-box.active {
    display: block;
}

.form-stack {
    display: grid;
    gap: 14px;
}

.helper-text {
    font-size: 0.92rem;
}

.helper-text a,
.text-link,
.table-link {
    color: var(--primary);
    font-weight: 700;
}

.list-clean {
    list-style: none;
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.list-clean li {
    position: relative;
    padding-left: 18px;
    color: var(--muted);
}

.list-clean li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 11px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
}

.welcome-card {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
    gap: 24px;
    align-items: stretch;
}

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

.mini-stat {
    padding: 18px;
    border-radius: var(--radius-lg);
}

.mini-label {
    display: block;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 700;
}

.mini-stat strong {
    display: block;
    margin-top: 10px;
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--ink);
}

.section-panel {
    padding: 28px;
}

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

.loan-list {
    display: grid;
    gap: 14px;
}

.loan-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px;
    border-radius: var(--radius-lg);
}

.loan-copy p + p {
    margin-top: 4px;
}

.shelves-panel {
    margin-top: 24px;
}

.shelves-header {
    margin-bottom: 16px;
}

.filter-row,
.form-row,
.button-row,
.meta-row,
.book-bottom,
.card-topline,
.table-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-row,
.form-row {
    margin-bottom: 14px;
}

.button-row {
    margin-top: 4px;
}

.button-primary,
.button-secondary,
.small-button,
.table-button,
.form-stack button,
.filter-row button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    border-radius: 999px;
    font-weight: 700;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.form-stack button,
.filter-row button,
.small-button {
    background: var(--primary);
    color: #fff;
}

.form-stack button:hover,
.filter-row button:hover,
.small-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.button-secondary,
.table-button {
    background: #f6e4e8;
    color: var(--primary);
}

.button-secondary:hover,
.table-button:hover {
    background: #f0d5dc;
    transform: translateY(-1px);
}

.flash {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    margin-top: 18px;
    font-weight: 700;
}

.flash-success {
    background: var(--success-bg);
    color: var(--success-text);
}

.flash-error {
    background: var(--error-bg);
    color: var(--error-text);
}

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

.book-card {
    display: grid;
    gap: 12px;
    padding: 20px;
    border-radius: var(--radius-lg);
}

.card-topline {
    justify-content: space-between;
}

.tag,
.status-pill,
.status-note {
    display: inline-flex;
    align-items: center;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
}

.tag {
    background: #f6e3e8;
    color: #7f1c35;
}

.status-pill.is-available,
.status-note {
    background: rgba(33, 87, 56, 0.12);
    color: var(--success-text);
}

.status-pill.is-unavailable {
    background: rgba(141, 47, 52, 0.12);
    color: var(--error-text);
}

.book-meta {
    font-weight: 700;
}

.book-description {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.meta-row,
.book-bottom {
    color: var(--muted);
    font-size: 0.92rem;
}

.book-bottom {
    justify-content: space-between;
    margin-top: 4px;
}

.empty-state {
    padding: 20px;
    border-radius: var(--radius-lg);
}

.empty-state h3 {
    margin-bottom: 8px;
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(34, 49, 39, 0.08);
}

.data-table th {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
}

.table-actions {
    justify-content: flex-start;
}

@media (max-width: 1040px) {
    .landing-grid,
    .welcome-card,
    .content-grid,
    .admin-layout,
    .info-grid,
    .book-grid,
    .point-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 760px) {
    .header-row,
    .public-nav,
    .member-nav,
    .section-intro,
    .loan-card,
    .filter-row,
    .form-row,
    .button-row,
    .book-bottom,
    .card-topline {
        flex-direction: column;
        align-items: stretch;
    }

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

    .panel,
    .section-panel,
    .book-card,
    .loan-card,
    .mini-stat,
    .point-card,
    .empty-state {
        padding: 20px;
        border-radius: 20px;
    }

    .auth-tabs {
    display: inline-flex;
    width: 100%;
    padding: 5px;
    border-radius: 999px;
    background: #f7e8ec;
    margin-bottom: 18px;
}

    .tab-button,
    .nav-button,
    .form-stack button,
    .filter-row button,
    .small-button,
    .button-secondary {
        width: 100%;
    }

    .mini-stats {
        grid-template-columns: 1fr;
    }
}

.button-primary {
    background: var(--primary);
    color: #fff;
}

.button-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

@keyframes adminLift {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes adminGlow {
    0%,
    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    50% {
        transform: translate3d(-4%, -6%, 0) scale(1.08);
    }
}

body.admin-page {
    position: relative;
    background:
        radial-gradient(circle at top right, rgba(156, 106, 50, 0.18), transparent 22%),
        radial-gradient(circle at 14% 22%, rgba(38, 76, 62, 0.16), transparent 20%),
        linear-gradient(180deg, #f8f2e8 0%, #efe4d1 52%, #e8dbc5 100%);
}

body.admin-page::before,
body.admin-page::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(16px);
    opacity: 0.65;
    z-index: 0;
}

body.admin-page::before {
    width: 280px;
    height: 280px;
    top: 120px;
    right: -120px;
    background: rgba(206, 163, 108, 0.22);
}

body.admin-page::after {
    width: 220px;
    height: 220px;
    bottom: 60px;
    left: -80px;
    background: rgba(38, 76, 62, 0.14);
}

body.admin-page .site-header {
    background: rgba(255, 250, 243, 0.82);
    border-bottom-color: rgba(38, 76, 62, 0.12);
}

body.admin-page header,
body.admin-page main {
    position: relative;
    z-index: 1;
}

.admin-nav a {
    letter-spacing: 0.01em;
}

.admin-page-space {
    padding-top: 34px;
    padding-bottom: 60px;
}

.admin-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(300px, 0.82fr);
    gap: 28px;
    padding: 36px;
    background:
        radial-gradient(circle at top right, rgba(248, 223, 176, 0.25), transparent 28%),
        linear-gradient(135deg, #183126 0%, #264c3e 48%, #3c6857 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 28px 70px rgba(24, 49, 38, 0.24);
    animation: adminLift 0.7s ease both;
}

.admin-hero::before {
    content: '';
    position: absolute;
    inset: auto -6% -34% 34%;
    height: 250px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 70%);
    pointer-events: none;
    animation: adminGlow 10s linear infinite;
}

.admin-hero-copy,
.admin-hero-aside {
    position: relative;
    z-index: 1;
}

.admin-hero-copy h1 {
    max-width: 11ch;
}

.admin-hero .kicker {
    background: rgba(255, 255, 255, 0.12);
    color: #f7d7a9;
}

.admin-hero h1,
.ops-card h2,
.ops-stat-strip strong {
    color: #fff;
}

.admin-hero .lead-text,
.ops-card p,
.ops-card li,
.ops-stat-strip span {
    color: rgba(255, 255, 255, 0.82);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 26px;
}

.hero-button {
    min-width: 160px;
}

.hero-actions .button-primary {
    box-shadow: 0 12px 28px rgba(12, 25, 19, 0.24);
}

.hero-actions .button-secondary {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.hero-actions .button-secondary:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.hero-link {
    display: inline-flex;
    align-items: center;
    padding: 12px 4px;
    font-weight: 700;
    color: #f7e7cc;
}

.hero-link:hover {
    color: #fff;
}

.ops-card {
    height: 100%;
    padding: 24px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
}

.ops-label {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #f7d7a9;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ops-card h2 {
    margin-top: 14px;
}

.ops-date {
    margin-top: 8px;
    font-size: 0.95rem;
}

.ops-stat-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 22px;
}

.ops-stat-strip article {
    padding: 14px;
    border-radius: 18px;
    background: rgba(12, 25, 19, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.ops-stat-strip strong {
    display: block;
    font-size: 1.7rem;
    line-height: 1;
}

.ops-stat-strip span {
    display: block;
    margin-top: 8px;
    font-size: 0.82rem;
}

.ops-list {
    list-style: none;
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.ops-list li {
    position: relative;
    padding-left: 18px;
    line-height: 1.6;
}

.ops-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 11px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #f4c27a;
}

.overview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.overview-card {
    padding: 24px;
    border-radius: 24px;
    background: rgba(255, 253, 248, 0.92);
    border: 1px solid rgba(38, 76, 62, 0.1);
    box-shadow: 0 16px 36px rgba(34, 49, 39, 0.09);
    animation: adminLift 0.7s ease both;
}

.overview-card:nth-child(2) {
    animation-delay: 0.08s;
}

.overview-card:nth-child(3) {
    animation-delay: 0.14s;
}

.overview-card:nth-child(4) {
    animation-delay: 0.2s;
}

.overview-card h2 {
    margin: 10px 0;
    font-size: clamp(2rem, 4vw, 2.8rem);
}

.overview-eyebrow {
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}

.overview-card.is-featured {
    background: linear-gradient(160deg, rgba(255, 253, 248, 0.98) 0%, rgba(248, 241, 230, 0.95) 100%);
}

.admin-layout {
    margin-top: 26px;
    align-items: start;
}

.studio-panel,
.returns-panel,
.inventory-panel {
    position: relative;
    overflow: hidden;
    animation: adminLift 0.75s ease both;
}

.returns-panel {
    animation-delay: 0.08s;
}

.inventory-panel {
    margin-top: 24px;
    animation-delay: 0.14s;
}

.studio-panel::before,
.returns-panel::before,
.inventory-panel::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, rgba(38, 76, 62, 0.9), rgba(156, 106, 50, 0.9));
}

.section-intro-rich {
    align-items: flex-start;
}

.inline-action {
    white-space: nowrap;
}

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

.form-note {
    padding: 18px;
    border-radius: 20px;
    background: linear-gradient(180deg, #fffaf2 0%, #f6ecdd 100%);
    border: 1px solid rgba(156, 106, 50, 0.18);
}

.form-note-label,
.field-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}

.form-group-card {
    padding: 20px;
    border-radius: 22px;
    background: #fcfaf6;
    border: 1px solid rgba(38, 76, 62, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.form-group-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
}

.form-group-header p {
    max-width: 30ch;
    font-size: 0.92rem;
}

.admin-form .form-row {
    margin-bottom: 0;
}

.admin-form textarea {
    min-height: 140px;
    background: #fff;
}

.admin-button-row {
    margin-top: 10px;
}

.summary-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 999px;
    font-weight: 800;
    white-space: nowrap;
}

.summary-pill.is-alert {
    background: rgba(141, 47, 52, 0.12);
    color: var(--error-text);
}

.summary-pill.is-calm {
    background: rgba(33, 87, 56, 0.12);
    color: var(--success-text);
}

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

.returns-metric {
    padding: 16px 18px;
    border-radius: 20px;
    background: linear-gradient(180deg, #fcfaf6 0%, #f3eadc 100%);
    border: 1px solid rgba(38, 76, 62, 0.08);
}

.returns-metric span {
    display: block;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.returns-metric strong {
    display: block;
    margin-top: 8px;
    font-size: 1.8rem;
    color: var(--ink);
}

.admin-loan-list {
    gap: 16px;
}

.admin-loan-card {
    align-items: flex-start;
    padding: 20px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(250, 245, 236, 0.98) 100%);
}

.admin-loan-card.is-overdue {
    border-color: rgba(141, 47, 52, 0.24);
    box-shadow: 0 18px 36px rgba(141, 47, 52, 0.08);
}

.admin-loan-card.is-urgent {
    border-color: rgba(156, 106, 50, 0.22);
    box-shadow: 0 18px 36px rgba(156, 106, 50, 0.08);
}

.loan-status-block {
    display: grid;
    gap: 8px;
    min-width: 120px;
}

.loan-state-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.loan-state-pill.is-stable {
    background: rgba(33, 87, 56, 0.12);
    color: var(--success-text);
}

.loan-state-pill.is-urgent {
    background: rgba(156, 106, 50, 0.16);
    color: var(--accent);
}

.loan-state-pill.is-overdue {
    background: rgba(141, 47, 52, 0.12);
    color: var(--error-text);
}

.loan-state-meta {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.inventory-intro {
    align-items: flex-end;
}

.inventory-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.inventory-chip,
.table-tag {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: #f3eadc;
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 800;
}

.fancy-table-wrap {
    border: 1px solid rgba(38, 76, 62, 0.08);
    border-radius: 24px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.admin-table {
    min-width: 880px;
}

.admin-table thead {
    background: linear-gradient(180deg, #fbf6ee 0%, #f3e9da 100%);
}

.admin-table tbody tr {
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.admin-table tbody tr:hover {
    background: rgba(38, 76, 62, 0.04);
}

.table-title-stack {
    display: grid;
    gap: 6px;
}

.table-title-stack strong {
    font-size: 1rem;
    color: var(--ink);
}

.table-title-stack span {
    color: var(--muted);
    font-size: 0.88rem;
}

.table-stock {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
}

.table-stock.is-healthy {
    background: rgba(33, 87, 56, 0.12);
    color: var(--success-text);
}

.table-stock.is-low {
    background: rgba(156, 106, 50, 0.16);
    color: var(--accent);
}

.table-stock.is-empty {
    background: rgba(141, 47, 52, 0.12);
    color: var(--error-text);
}

@media (max-width: 1040px) {
    .overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-hero,
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .inventory-intro {
        align-items: flex-start;
    }

    .inventory-summary {
        justify-content: flex-start;
    }
}

@media (max-width: 760px) {
    body.admin-page::before,
    body.admin-page::after {
        display: none;
    }

    .admin-hero,
    .ops-card,
    .overview-card,
    .form-group-card,
    .form-note,
    .returns-metric,
    .admin-loan-card,
    .fancy-table-wrap {
        border-radius: 20px;
    }

    .overview-grid,
    .form-note-grid,
    .returns-summary,
    .ops-stat-strip {
        grid-template-columns: 1fr;
    }

    .hero-actions,
    .inventory-summary {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-button,
    .hero-link,
    .summary-pill,
    .inline-action {
        width: 100%;
        justify-content: center;
    }

    .form-group-header {
        flex-direction: column;
    }

    .loan-status-block {
        min-width: 0;
    }

    .admin-table {
        min-width: 720px;
    }
}
/* Visual refresh themes */
body.public-page,
body.member-page,
body.admin-page {
    position: relative;
}

body.public-page .site-header,
body.public-page main,
body.member-page .site-header,
body.member-page main,
body.admin-page .site-header,
body.admin-page main {
    position: relative;
    z-index: 1;
}

body.public-page {
    background:
        radial-gradient(circle at 12% 18%, rgba(111, 16, 40, 0.16), transparent 22%),
        radial-gradient(circle at 86% 14%, rgba(244, 221, 227, 0.95), transparent 18%),
        radial-gradient(circle at 80% 80%, rgba(255, 246, 247, 0.98), transparent 22%),
        linear-gradient(180deg, #fffafb 0%, #fcf3f5 54%, #f8ecef 100%);
}

body.public-page::before,
body.member-page::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

body.public-page::before {
    background-image:
        linear-gradient(rgba(111, 16, 40, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(111, 16, 40, 0.05) 1px, transparent 1px);
    background-size: 118px 118px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.18));
    opacity: 0.42;
}

body.public-page::after,
body.member-page::after,
body.admin-page::after {
    content: '';
    position: fixed;
    pointer-events: none;
    z-index: 0;
}

body.public-page::after {
    width: 340px;
    height: 340px;
    right: -120px;
    top: 150px;
    border-radius: 44% 56% 64% 36% / 42% 34% 66% 58%;
    background: linear-gradient(135deg, rgba(111, 16, 40, 0.15), rgba(255, 255, 255, 0));
    filter: blur(2px);
}

body.public-page .brand-badge,
body.member-page .brand-badge {
    background: linear-gradient(135deg, #6f1028 0%, #a73f59 100%);
}

body.public-page .landing-copy,
body.public-page .auth-card,
body.public-page .info-card,
body.member-page .section-panel,
body.member-page .shelves-panel,
body.member-page .book-card,
body.member-page .loan-card,
body.admin-page .overview-card,
body.admin-page .admin-loan-card {
    transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

body.public-page .landing-copy,
body.public-page .auth-card,
body.public-page .info-card {
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

body.public-page .landing-copy {
    background:
        linear-gradient(155deg, rgba(255, 255, 255, 0.98), rgba(250, 241, 244, 0.96)),
        linear-gradient(135deg, rgba(111, 16, 40, 0.05), transparent 62%);
}

body.public-page .landing-copy::after {
    content: '';
    position: absolute;
    width: 260px;
    height: 260px;
    right: -64px;
    bottom: -108px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(167, 63, 89, 0.22) 0%, rgba(167, 63, 89, 0) 72%);
}

body.public-page .auth-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 242, 244, 0.98));
    border-color: rgba(111, 16, 40, 0.1);
}

body.public-page .info-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(251, 243, 245, 0.94));
}

body.public-page .auth-card::before,
body.public-page .info-card::before {
    content: '';
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #6f1028, #a73f59, #ead3da);
}

body.public-page .point-card:nth-child(1) {
    background: linear-gradient(180deg, #fffdfd 0%, #f8eff1 100%);
}

body.public-page .point-card:nth-child(2) {
    background: linear-gradient(180deg, #fffdfd 0%, #f6ecef 100%);
}

body.public-page .point-card:nth-child(3) {
    background: linear-gradient(180deg, #fffdfd 0%, #f9f1f3 100%);
}

body.public-page .point-card:hover,
body.public-page .info-card:hover,
body.member-page .book-card:hover,
body.member-page .loan-card:hover,
body.admin-page .overview-card:hover,
body.admin-page .admin-loan-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 44px rgba(79, 10, 27, 0.14);
}

body.public-page .kicker {
    background: rgba(111, 16, 40, 0.08);
    color: #7b1830;
}

body.member-page {
    background:
        radial-gradient(circle at 8% 14%, rgba(111, 16, 40, 0.15), transparent 18%),
        radial-gradient(circle at 88% 12%, rgba(244, 221, 227, 0.78), transparent 20%),
        radial-gradient(circle at 82% 90%, rgba(251, 241, 243, 0.94), transparent 22%),
        linear-gradient(180deg, #fffafb 0%, #fcf2f4 48%, #f7eaee 100%);
}

body.member-page::before {
    background-image: radial-gradient(rgba(111, 16, 40, 0.08) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.26;
}

body.member-page::after {
    width: 290px;
    height: 290px;
    right: -90px;
    top: 120px;
    border-radius: 36px;
    background: linear-gradient(135deg, rgba(111, 16, 40, 0.16), rgba(255, 255, 255, 0.02));
    transform: rotate(28deg);
}

body.member-page .site-header {
    background: rgba(255, 251, 252, 0.92);
    border-bottom-color: rgba(111, 16, 40, 0.08);
}

body.member-page .welcome-card {
    background: linear-gradient(135deg, #4f0a1b 0%, #6f1028 46%, #9f314e 100%);
    border: none;
    box-shadow: 0 28px 58px rgba(79, 10, 27, 0.26);
}

body.member-page .welcome-card h1,
body.member-page .welcome-card .lead-text,
body.member-page .welcome-card .kicker,
body.member-page .mini-stat strong,
body.member-page .mini-label {
    color: #fff;
}

body.member-page .welcome-card .kicker {
    background: rgba(255, 255, 255, 0.14);
}

body.member-page .mini-stat {
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: none;
    backdrop-filter: blur(12px);
}

body.member-page .section-panel,
body.member-page .shelves-panel {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(111, 16, 40, 0.08);
    backdrop-filter: blur(8px);
}

body.member-page .section-panel::before,
body.member-page .shelves-panel::before {
    content: '';
    display: block;
    width: 84px;
    height: 4px;
    border-radius: 999px;
    margin-bottom: 18px;
    background: linear-gradient(90deg, #6f1028, #a73f59);
}

body.member-page .book-card,
body.member-page .loan-card {
    position: relative;
    overflow: hidden;
}

body.member-page .book-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 241, 243, 0.98));
    border-color: rgba(111, 16, 40, 0.12);
}

body.member-page .book-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    background: linear-gradient(90deg, #6f1028, #a73f59);
}

body.member-page .loan-card {
    background: linear-gradient(180deg, #fffdfd 0%, #f8eff2 100%);
}

body.member-page .tag {
    background: rgba(111, 16, 40, 0.08);
    color: #7b1830;
}

body.member-page .status-pill.is-available,
body.member-page .status-note {
    background: rgba(111, 16, 40, 0.1);
    color: #7b1830;
}

body.admin-page {
    background:
        radial-gradient(circle at 16% 14%, rgba(167, 63, 89, 0.22), transparent 20%),
        radial-gradient(circle at 88% 14%, rgba(244, 221, 227, 0.12), transparent 18%),
        linear-gradient(180deg, #2a0611 0%, #460a18 42%, #5d0d20 100%);
}

body.admin-page::before {
    content: '';
    position: fixed;
    inset: 0;
    border-radius: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 78px 78px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.76), rgba(0, 0, 0, 0.18));
    opacity: 0.16;
    z-index: 0;
}

body.admin-page::after {
    width: 420px;
    height: 420px;
    top: 130px;
    right: -140px;
    bottom: auto;
    left: auto;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(167, 63, 89, 0.24) 0%, rgba(167, 63, 89, 0) 70%);
    filter: blur(6px);
    opacity: 0.88;
}

body.admin-page .site-header {
    background: rgba(38, 6, 16, 0.84);
    border-bottom-color: rgba(244, 221, 227, 0.18);
}

body.admin-page .site-header a,
body.admin-page .site-header .brand-mark {
    color: #fff7f8;
}

body.admin-page .brand-badge {
    background: linear-gradient(135deg, #6f1028, #a73f59);
    box-shadow: 0 12px 28px rgba(111, 16, 40, 0.34);
}

body.admin-page .nav-button {
    background: linear-gradient(135deg, #6f1028, #8f2a43);
}

body.admin-page .admin-hero {
    background:
        radial-gradient(circle at top right, rgba(244, 221, 227, 0.16), transparent 28%),
        linear-gradient(135deg, #460a18 0%, #6f1028 48%, #8f2a43 100%);
    border: 1px solid rgba(244, 221, 227, 0.16);
    box-shadow: 0 30px 70px rgba(37, 6, 15, 0.38);
}

body.admin-page .admin-hero::before {
    background: radial-gradient(circle, rgba(255, 241, 243, 0.22) 0%, rgba(255, 255, 255, 0) 72%);
}

body.admin-page .admin-hero .kicker,
body.admin-page .ops-label {
    background: rgba(255, 255, 255, 0.12);
    color: #fff1f3;
}

body.admin-page .admin-hero h1,
body.admin-page .ops-card h2,
body.admin-page .ops-stat-strip strong {
    color: #fff;
}

body.admin-page .admin-hero .lead-text,
body.admin-page .ops-card p,
body.admin-page .ops-card li,
body.admin-page .ops-stat-strip span,
body.admin-page .hero-link {
    color: rgba(255, 241, 243, 0.88);
}

body.admin-page .hero-actions .button-primary {
    box-shadow: 0 14px 30px rgba(37, 6, 15, 0.28);
}

body.admin-page .ops-card {
    background: linear-gradient(180deg, rgba(70, 10, 24, 0.52), rgba(95, 13, 32, 0.34));
    border-color: rgba(244, 221, 227, 0.14);
}

body.admin-page .ops-stat-strip article {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.08);
}

body.admin-page .ops-list li::before {
    background: #f0c9d2;
}

body.admin-page .overview-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 241, 243, 0.95));
    border-color: rgba(111, 16, 40, 0.1);
}

body.admin-page .overview-card.is-featured {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.99), rgba(245, 233, 237, 0.96));
}

body.admin-page .studio-panel::before,
body.admin-page .returns-panel::before,
body.admin-page .inventory-panel::before {
    background: linear-gradient(90deg, #a73f59, #6f1028);
}

body.admin-page .returns-metric,
body.admin-page .form-note {
    background: linear-gradient(180deg, #fffdfd 0%, #f9eff2 100%);
    border-color: rgba(111, 16, 40, 0.12);
}

body.admin-page .form-group-card,
body.admin-page .fancy-table-wrap {
    border-color: rgba(111, 16, 40, 0.08);
}

body.admin-page .inventory-chip,
body.admin-page .table-tag {
    background: rgba(111, 16, 40, 0.08);
    color: #7b1830;
}

body.admin-page .admin-loan-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 241, 243, 0.98));
}

body.admin-page .admin-table thead {
    background: linear-gradient(180deg, #fcf3f5 0%, #f4dfe4 100%);
}

@media (max-width: 760px) {
    body.public-page::after,
    body.member-page::after,
    body.admin-page::after {
        display: none;
    }

    body.public-page::before,
    body.member-page::before,
    body.admin-page::before {
        opacity: 0.14;
    }
}

/* Penalty states */
button[disabled] {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.notice-panel {
    margin-top: 24px;
    border-color: rgba(111, 16, 40, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 239, 241, 0.96));
    box-shadow: 0 20px 42px rgba(79, 10, 27, 0.08);
}

.notice-panel-warning::before {
    content: '';
    display: block;
    width: 96px;
    height: 4px;
    border-radius: 999px;
    margin-bottom: 18px;
    background: linear-gradient(90deg, #6f1028, #a73f59);
}

.notice-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.notice-metric {
    padding: 16px 18px;
    border-radius: 20px;
    background: linear-gradient(180deg, #fffdfd 0%, #f8eff1 100%);
    border: 1px solid rgba(111, 16, 40, 0.1);
}

.notice-metric span {
    display: block;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.notice-metric strong {
    display: block;
    margin-top: 8px;
    font-size: 1.45rem;
    color: var(--ink);
}

.loan-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.status-pill.is-soon {
    background: rgba(111, 16, 40, 0.1);
    color: #7b1830;
}

.status-pill.is-overdue {
    background: rgba(127, 19, 42, 0.14);
    color: var(--error-text);
}

.borrow-note {
    color: #7b1830;
}

@media (max-width: 760px) {
    .notice-metrics {
        grid-template-columns: 1fr;
    }
}

.admin-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.admin-note-pill {
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
}

.admin-note-pill.is-overdue {
    background: rgba(127, 19, 42, 0.14);
    color: var(--error-text);
}

.admin-note-pill.is-history {
    background: rgba(111, 16, 40, 0.1);
    color: #7b1830;
}

.admin-note-pill.is-active {
    background: rgba(111, 16, 40, 0.16);
    color: #5f1023;
}

.penalty-history-panel {
    margin-top: 24px;
}

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

.penalty-card {
    padding: 22px;
    border-radius: 22px;
    border: 1px solid rgba(111, 16, 40, 0.1);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 241, 243, 0.95));
    box-shadow: 0 18px 36px rgba(79, 10, 27, 0.08);
}

.penalty-card.is-active {
    border-color: rgba(127, 19, 42, 0.22);
    box-shadow: 0 20px 40px rgba(127, 19, 42, 0.12);
}

.penalty-card.is-warning {
    border-color: rgba(111, 16, 40, 0.18);
}

.penalty-card-top {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.penalty-card-top p {
    margin-top: 6px;
}

.penalty-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.penalty-stats article {
    padding: 14px;
    border-radius: 18px;
    background: linear-gradient(180deg, #fffdfd 0%, #f6ecef 100%);
    border: 1px solid rgba(111, 16, 40, 0.08);
}

.penalty-stats span {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.penalty-stats strong {
    display: block;
    margin-top: 8px;
    font-size: 1.35rem;
    color: var(--ink);
}

.penalty-footer {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(111, 16, 40, 0.08);
}

@media (max-width: 1040px) {
    .penalty-history-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .admin-badge-row,
    .penalty-card-top {
        flex-direction: column;
        align-items: stretch;
    }

    .penalty-history-grid,
    .penalty-stats {
        grid-template-columns: 1fr;
    }
}

.member-reading-panel {
    margin-top: 24px;
}

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

.reader-card {
    padding: 22px;
    border-radius: 22px;
    border: 1px solid rgba(111, 16, 40, 0.1);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 241, 243, 0.95));
    box-shadow: 0 18px 36px rgba(79, 10, 27, 0.08);
}

.reader-card.is-warning {
    border-color: rgba(127, 19, 42, 0.18);
    box-shadow: 0 20px 40px rgba(127, 19, 42, 0.1);
}

.reader-card.is-reading {
    border-color: rgba(111, 16, 40, 0.14);
}

.reader-card-top {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.reader-card-top p {
    margin-top: 6px;
}

.reader-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.reader-stats article {
    padding: 14px;
    border-radius: 18px;
    background: linear-gradient(180deg, #fffdfd 0%, #f6ecef 100%);
    border: 1px solid rgba(111, 16, 40, 0.08);
}

.reader-stats span {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.reader-stats strong {
    display: block;
    margin-top: 8px;
    font-size: 1.35rem;
    color: var(--ink);
}

@media (max-width: 1040px) {
    .member-reading-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .reader-card-top {
        flex-direction: column;
        align-items: stretch;
    }

    .member-reading-grid,
    .reader-stats {
        grid-template-columns: 1fr;
    }
}
