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

:root {
    --primary: #5b4cf0;
    --primary-dark: #4536d6;
    --primary-soft: #eeecff;
    --ink: #1e293b;
    --muted: #64748b;
    --line: #e7eaf0;
    --surface: #ffffff;
    --canvas: #f6f7fb;
    --success: #17a673;
    --warning: #f59e0b;
    --danger: #e84b65;
    --shadow: 0 14px 45px rgba(30, 41, 59, .08);
    --radius: 18px;
}

* { box-sizing: border-box; }

body {
    color: var(--ink);
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    background: var(--canvas);
}

h1, h2, h3, h4, h5, h6, .brand strong { font-family: 'Manrope', sans-serif; }
a { text-decoration: none; }
.text-muted { color: var(--muted) !important; }
.btn { border-radius: 11px; font-weight: 600; padding: .68rem 1rem; }
.btn-sm { padding: .42rem .72rem; border-radius: 9px; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover, .btn-primary:focus { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-soft-primary { background: var(--primary-soft); color: var(--primary); border: 0; }
.btn-soft-primary:hover { background: #dfdcff; color: var(--primary-dark); }
.form-control, .form-select {
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: .68rem .85rem;
}
.form-control:focus, .form-select:focus {
    border-color: rgba(91, 76, 240, .45);
    box-shadow: 0 0 0 .2rem rgba(91, 76, 240, .11);
}
.form-label { color: #334155; font-weight: 600; font-size: .9rem; }
.input-group-text { background: #fff; border-color: var(--line); border-radius: 11px; color: var(--muted); }
.badge { border-radius: 100px; font-weight: 600; padding: .48em .72em; }
.table { --bs-table-bg: transparent; margin: 0; }
.table > :not(caption) > * > * { padding: .9rem .8rem; border-bottom-color: #edf0f5; vertical-align: middle; }
.table thead th { color: #7b8495; font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; font-weight: 700; white-space: nowrap; }
.dropdown-menu { border-radius: 12px; padding: .5rem; }
.dropdown-item { border-radius: 8px; padding: .6rem .75rem; }

/* Shared brand */
.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark {
    width: 42px; height: 42px; display: inline-grid; place-items: center;
    color: #fff; background: linear-gradient(145deg, #796cff, #5041df);
    border-radius: 13px; box-shadow: 0 8px 20px rgba(91, 76, 240, .24);
}
.brand strong, .brand small { display: block; line-height: 1.05; }
.brand strong { font-size: 1rem; }
.brand small { color: #8b94a5; font-size: .68rem; margin-top: .24rem; letter-spacing: .02em; }

/* Public experience */
.public-body { background: #fff; }
.public-nav { min-height: 76px; background: rgba(255,255,255,.93); border-bottom: 1px solid rgba(231,234,240,.75); backdrop-filter: blur(16px); }
.public-nav .nav-link { color: #475569; font-weight: 600; padding: .6rem .8rem !important; }
.public-nav .nav-link:hover { color: var(--primary); }
.hero-section {
    overflow: hidden; position: relative; padding: 88px 0 74px;
    background:
        radial-gradient(circle at 82% 18%, rgba(91,76,240,.14), transparent 25%),
        radial-gradient(circle at 3% 90%, rgba(23,166,115,.10), transparent 28%),
        linear-gradient(180deg, #fbfaff, #fff);
}
.hero-section::after {
    content: ''; position: absolute; width: 360px; height: 360px; right: -180px; bottom: -190px;
    border: 70px solid rgba(91,76,240,.04); border-radius: 50%;
}
.eyebrow {
    display: inline-flex; align-items: center; gap: .45rem; color: var(--primary); background: var(--primary-soft);
    border-radius: 100px; padding: .45rem .75rem; font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em;
}
.hero-title { font-size: clamp(2.5rem, 5.2vw, 4.6rem); line-height: 1.04; letter-spacing: -.045em; margin: 1.15rem 0 1.2rem; }
.hero-title .gradient-text { background: linear-gradient(90deg, var(--primary), #8c55e8); -webkit-background-clip: text; color: transparent; }
.hero-copy { color: var(--muted); max-width: 600px; font-size: 1.08rem; line-height: 1.8; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.7rem; }
.hero-actions .btn { padding: .82rem 1.2rem; }
.hero-visual { position: relative; min-height: 410px; }
.visual-card {
    position: absolute; background: #fff; border: 1px solid rgba(231,234,240,.8); box-shadow: var(--shadow); border-radius: 24px;
}
.visual-main { inset: 24px 32px 24px 28px; padding: 1.4rem; transform: rotate(2deg); }
.visual-main::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(135deg, rgba(91,76,240,.04), transparent); pointer-events: none; }
.mock-top { display: flex; gap: .35rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.mock-top span { width: 8px; height: 8px; border-radius: 50%; background: #e3e5ea; }
.mock-search { margin: 1.2rem 0; height: 48px; border-radius: 12px; background: #f5f6fa; display: flex; align-items: center; gap: .6rem; padding: 0 .9rem; color: #9ba3b1; }
.mock-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: .75rem; }
.mock-book { height: 175px; border-radius: 12px 18px 18px 12px; padding: .9rem; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; box-shadow: inset 7px 0 rgba(0,0,0,.08); }
.mock-book:nth-child(1) { background: linear-gradient(145deg,#5b4cf0,#8a7dff); }
.mock-book:nth-child(2) { background: linear-gradient(145deg,#17a673,#58c99e); }
.mock-book:nth-child(3) { background: linear-gradient(145deg,#f28a45,#f7b067); }
.mock-book strong { font-family: 'Manrope'; font-size: .8rem; }
.mock-book small { opacity: .75; font-size: .65rem; }
.floating-stat { left: 0; bottom: 44px; padding: .85rem 1rem; display: flex; align-items: center; gap: .7rem; transform: rotate(-4deg); }
.floating-stat i { width: 38px; height: 38px; display: grid; place-items: center; color: var(--success); background: #e7f8f1; border-radius: 11px; }
.floating-stat strong, .floating-stat small { display: block; line-height: 1.2; }
.floating-stat small { color: var(--muted); font-size: .7rem; }
.section-block { padding: 78px 0; }
.section-soft { background: #f8f9fc; }
.section-heading { max-width: 650px; margin: 0 auto 2.6rem; text-align: center; }
.section-heading h2 { font-size: clamp(1.9rem, 3vw, 2.6rem); letter-spacing: -.025em; }
.section-heading p { color: var(--muted); }
.feature-card { height: 100%; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.45rem; transition: .25s ease; }
.feature-card:hover { transform: translateY(-5px); border-color: rgba(91,76,240,.24); box-shadow: var(--shadow); }
.feature-icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 15px; color: var(--primary); background: var(--primary-soft); font-size: 1.2rem; margin-bottom: 1rem; }
.feature-card:nth-child(2) .feature-icon { color: var(--success); background: #e8f8f2; }
.feature-card:nth-child(3) .feature-icon { color: #d97706; background: #fff4db; }
.feature-card p { color: var(--muted); margin: 0; line-height: 1.65; }
.public-footer { padding: 28px 0; background: #151a2b; color: #aab2c0; }
.public-footer .brand { color: #fff; }

/* Auth */
.auth-page { min-height: calc(100vh - 76px); display: grid; place-items: center; padding: 48px 0; background: radial-gradient(circle at 15% 10%, rgba(91,76,240,.12), transparent 28%), #f7f8fc; }
.auth-card { background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: clamp(1.5rem, 4vw, 2.4rem); box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.8rem; letter-spacing: -.025em; }
.auth-side { min-height: 100%; border-radius: 24px; color: #fff; padding: 2.2rem; display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(145deg,#5142db,#7668f6); position: relative; overflow: hidden; }
.auth-side::after { content: ''; position: absolute; width: 280px; height: 280px; border: 52px solid rgba(255,255,255,.07); border-radius: 50%; right: -90px; bottom: -110px; }
.auth-side p { color: rgba(255,255,255,.75); line-height: 1.7; }
.auth-points { list-style: none; padding: 0; margin: 2rem 0; position: relative; z-index: 1; }
.auth-points li { display: flex; gap: .7rem; margin: .8rem 0; color: rgba(255,255,255,.9); }
.auth-points i { color: #8df0c9; }

/* Dashboard shell */
.dashboard-body { background: var(--canvas); }
.sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 1040; width: 260px; padding: 1.25rem 1rem;
    background: #171b2d; color: #fff; display: flex; flex-direction: column; transition: transform .25s ease;
}
.sidebar .brand { color: #fff; padding: .2rem .55rem 1.35rem; }
.sidebar .brand small { color: #777f94; }
.sidebar-nav { display: flex; flex-direction: column; gap: .22rem; overflow-y: auto; }
.nav-section { color: #6f778a; font-size: .67rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; margin: 1.1rem .75rem .45rem; }
.sidebar-nav a { color: #aeb4c2; display: flex; align-items: center; gap: .8rem; padding: .7rem .8rem; border-radius: 11px; font-weight: 600; font-size: .91rem; }
.sidebar-nav a i { width: 20px; font-size: 1.05rem; }
.sidebar-nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.sidebar-nav a.active { color: #fff; background: linear-gradient(90deg, rgba(91,76,240,.92), rgba(91,76,240,.72)); box-shadow: 0 8px 24px rgba(0,0,0,.15); }
.sidebar-help { margin-top: auto; display: flex; gap: .75rem; padding: .85rem; background: rgba(255,255,255,.06); border-radius: 12px; }
.sidebar-help i { color: #efc868; }
.sidebar-help strong, .sidebar-help small { display: block; }
.sidebar-help strong { font-size: .83rem; }
.sidebar-help small { color: #7e8699; font-size: .7rem; margin-top: .15rem; }
.dashboard-shell { margin-left: 260px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { height: 76px; padding: 0 2rem; background: rgba(255,255,255,.93); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 1030; backdrop-filter: blur(14px); }
.topbar-title small, .topbar-title strong { display: block; line-height: 1.15; }
.topbar-title small { color: #98a0af; font-size: .7rem; }
.topbar-title strong { font-family: 'Manrope'; margin-top: .2rem; }
.topbar-actions { display: flex; align-items: center; gap: .7rem; }
.icon-button { width: 40px; height: 40px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; color: #5d6675; background: #fff; }
.icon-button:hover { color: var(--primary); background: var(--primary-soft); }
.profile-button { display: flex; align-items: center; gap: .65rem; border: 0; background: transparent; padding: 0; }
.profile-button::after { color: #9ba2af; }
.avatar { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(145deg,#e3e0ff,#f2f0ff); color: var(--primary); font-weight: 800; }
.profile-copy strong, .profile-copy small { display: block; line-height: 1.15; text-align: left; }
.profile-copy strong { font-size: .84rem; }
.profile-copy small { color: #99a1af; font-size: .67rem; margin-top: .18rem; }
.dashboard-content { flex: 1; padding: 1.75rem 2rem; }
.dashboard-footer { padding: 1rem 2rem; display: flex; justify-content: space-between; color: #929aa8; font-size: .75rem; border-top: 1px solid var(--line); }
.sidebar-overlay { display: none; position: fixed; inset: 0; z-index: 1035; background: rgba(18,22,35,.5); }

/* Dashboard components */
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.35rem; }
.page-heading h1 { margin: 0; font-size: 1.7rem; letter-spacing: -.03em; }
.page-heading p { margin: .3rem 0 0; color: var(--muted); }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 7px 30px rgba(30,41,59,.035); }
.panel-header { padding: 1.15rem 1.25rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.panel-header h2, .panel-header h3 { margin: 0; font-size: 1rem; }
.panel-body { padding: 1.25rem; }
.table-responsive { border-radius: 0 0 var(--radius) var(--radius); }
.stat-card { height: 100%; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem; display: flex; align-items: center; gap: 1rem; }
.stat-icon { width: 52px; height: 52px; flex: 0 0 52px; display: grid; place-items: center; border-radius: 15px; background: var(--primary-soft); color: var(--primary); font-size: 1.3rem; }
.stat-card.success .stat-icon { background: #e7f8f1; color: var(--success); }
.stat-card.warning .stat-icon { background: #fff4dd; color: var(--warning); }
.stat-card.danger .stat-icon { background: #ffedf0; color: var(--danger); }
.stat-copy small, .stat-copy strong { display: block; }
.stat-copy small { color: var(--muted); font-size: .75rem; }
.stat-copy strong { font: 800 1.6rem 'Manrope'; margin-top: .15rem; }
.welcome-card { position: relative; overflow: hidden; padding: 1.6rem; color: #fff; border-radius: var(--radius); background: linear-gradient(120deg,#5041db,#7769f5); min-height: 180px; display: flex; align-items: center; }
.welcome-card::after { content: ''; position: absolute; width: 230px; height: 230px; border: 48px solid rgba(255,255,255,.08); border-radius: 50%; right: -70px; top: -95px; }
.welcome-card p { max-width: 570px; color: rgba(255,255,255,.78); margin-bottom: 1.1rem; }
.welcome-card .btn-light { color: var(--primary); }
.quick-list { display: flex; flex-direction: column; }
.quick-item { display: flex; align-items: center; gap: .8rem; padding: .85rem 0; border-bottom: 1px solid #edf0f5; }
.quick-item:last-child { border: 0; }
.quick-item-icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 11px; color: var(--primary); background: var(--primary-soft); }
.quick-item-copy { min-width: 0; flex: 1; }
.quick-item-copy strong, .quick-item-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-item-copy strong { font-size: .86rem; }
.quick-item-copy small { color: var(--muted); font-size: .72rem; margin-top: .18rem; }
.empty-state { text-align: center; padding: 3.2rem 1.2rem; color: var(--muted); }
.empty-state i { font-size: 2.2rem; color: #c7cbd4; }
.empty-state h3 { color: var(--ink); font-size: 1rem; margin: .8rem 0 .35rem; }
.filter-bar { display: flex; flex-wrap: wrap; gap: .65rem; align-items: center; }
.filter-bar .search-control { min-width: 250px; flex: 1; }
.book-cell { display: flex; align-items: center; gap: .75rem; min-width: 220px; }
.book-thumb { width: 42px; height: 54px; flex: 0 0 42px; border-radius: 6px 10px 10px 6px; background: linear-gradient(145deg,#5b4cf0,#8d82ff); color: #fff; box-shadow: inset 5px 0 rgba(0,0,0,.09); display: grid; place-items: center; font: 800 .8rem 'Manrope'; }
.book-cell strong, .book-cell small { display: block; }
.book-cell strong { font-size: .85rem; }
.book-cell small { color: var(--muted); font-size: .72rem; margin-top: .15rem; }
.book-cover { min-height: 220px; border-radius: 13px 20px 20px 13px; background: linear-gradient(145deg,#5142db,#9186ff); color: #fff; box-shadow: inset 9px 0 rgba(0,0,0,.09), 0 15px 25px rgba(81,66,219,.14); padding: 1.15rem; display: flex; flex-direction: column; justify-content: space-between; }
.book-cover small { color: rgba(255,255,255,.72); }
.book-card { height: 100%; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; transition: .25s ease; }
.book-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.book-card .book-cover { min-height: 190px; }
.book-card h3 { font-size: .95rem; margin: .95rem 0 .25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-meta { color: var(--muted); font-size: .75rem; }
.catalog-hero { padding: 60px 0 42px; background: linear-gradient(180deg,#f3f1ff,#fff); }
.catalog-search { max-width: 850px; margin: 1.6rem auto 0; background: #fff; padding: .65rem; border: 1px solid #e5e2ff; border-radius: 15px; box-shadow: 0 12px 40px rgba(91,76,240,.1); }
.catalog-search .form-control, .catalog-search .form-select { border: 0; }
.catalog-results { padding: 42px 0 72px; }
.status-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; margin-right: .35rem; background: currentColor; }
.action-group { display: flex; flex-wrap: wrap; gap: .35rem; }
.detail-list { display: grid; grid-template-columns: repeat(2,1fr); gap: .8rem; }
.detail-item { padding: .8rem; background: #f8f9fc; border-radius: 11px; }
.detail-item small, .detail-item strong { display: block; }
.detail-item small { color: var(--muted); font-size: .69rem; text-transform: uppercase; letter-spacing: .04em; }
.detail-item strong { font-size: .85rem; margin-top: .25rem; }
.toast-container { z-index: 1100; }
.toast { border-radius: 12px; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .sidebar-overlay.show { display: block; }
    .dashboard-shell { margin-left: 0; }
    .hero-visual { margin-top: 2rem; }
    .profile-copy { display: none; }
}

@media (max-width: 767.98px) {
    .hero-section { padding: 58px 0 50px; }
    .hero-visual { min-height: 340px; }
    .visual-main { inset: 15px 12px 20px; }
    .mock-grid { gap: .45rem; }
    .mock-book { height: 140px; padding: .6rem; }
    .dashboard-content { padding: 1.25rem 1rem; }
    .topbar { padding: 0 1rem; }
    .dashboard-footer { padding: 1rem; flex-direction: column; gap: .25rem; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .filter-bar > * { width: 100%; }
    .detail-list { grid-template-columns: 1fr; }
}

