/* =====================================================================
   Kütüphane — tasarım sistemi
   Bootstrap 5 tabanı + bu dosyadaki bileşenler. Açık tema, Türkçe öncelikli.
   ===================================================================== */

:root {
    --brand: #2b59c3;
    --brand-600: #2349a6;
    --brand-50: #eef3fd;
    --brand-100: #dbe6fb;

    --ink: #1b2430;
    --ink-2: #475467;
    --ink-3: #7a8699;
    --line: #e4e8ef;
    --bg: #f4f6fb;
    --surface: #ffffff;

    --ok: #16794c;
    --ok-bg: #e3f6ec;
    --warn: #a15c07;
    --warn-bg: #fff3dc;
    --bad: #b42318;
    --bad-bg: #fdeceb;

    --sidebar-bg: #111c3a;
    --sidebar-ink: #c5cde0;
    --sidebar-ink-strong: #ffffff;
    --sidebar-hover: rgba(255, 255, 255, .07);
    --sidebar-active: rgba(255, 255, 255, .13);

    --soft: #eef1f7;
    --soft-2: #f7f9fc;
    --line-strong: #d3d9e4;
    --late-bg: #fff5f4;
    --dirty-bg: #fffbe6;
    --input-bg: #ffffff;
    --topbar-bg: rgba(255, 255, 255, .9);
    --dno-red: #d92d20;

    --radius: 10px;
    --radius-sm: 7px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
    --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 4px 14px rgba(16, 24, 40, .05);
    --shadow-lg: 0 12px 40px rgba(16, 24, 40, .22);

    /* Bootstrap değişkenlerini marka rengine bağla */
    --bs-primary: var(--brand);
    --bs-primary-rgb: 43, 89, 195;
    --bs-body-bg: var(--bg);
    --bs-body-color: var(--ink);
    --bs-border-color: var(--line);
    --bs-link-color: var(--brand);
    --bs-link-hover-color: var(--brand-600);
    --bs-body-font-size: .94rem;
}

html, body {
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

h1 { font-size: 1.45rem; font-weight: 650; letter-spacing: -.01em; margin: 0; }
h2 { font-size: 1.12rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: 3px solid rgba(43, 89, 195, .45); outline-offset: 1px; }

.btn-primary {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-600);
    --bs-btn-hover-border-color: var(--brand-600);
    --bs-btn-active-bg: var(--brand-600);
    --bs-btn-active-border-color: var(--brand-600);
    --bs-btn-disabled-bg: var(--brand);
    --bs-btn-disabled-border-color: var(--brand);
}
.btn-outline-primary {
    --bs-btn-color: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand);
    --bs-btn-hover-border-color: var(--brand);
    --bs-btn-active-bg: var(--brand);
}
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font-weight: 550; border-radius: var(--radius-sm); }
.btn .icon { flex: none; }
.form-control, .form-select { border-radius: var(--radius-sm); border-color: var(--line-strong); background-color: var(--input-bg); color: var(--ink); }
.form-control:disabled, .form-select:disabled { background-color: var(--soft); }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(43, 89, 195, .18); }
.form-label { font-weight: 550; font-size: .85rem; color: var(--ink-2); margin-bottom: .3rem; }
.form-text { color: var(--ink-3); }
.icon { vertical-align: -3px; flex: none; }

/* ---------------------------------------------------------------- uygulama kabuğu */
.app-shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
    background: var(--sidebar-bg);
    color: var(--sidebar-ink);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #33426b transparent;
}
.sidebar-brand { display: flex; align-items: center; gap: .75rem; padding: 1.1rem 1.1rem .9rem; }
.sidebar-brand-mark {
    width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
    background: linear-gradient(135deg, #4c7be6, #2b59c3); color: #fff; flex: none;
}
.sidebar-brand-title { color: var(--sidebar-ink-strong); font-weight: 650; line-height: 1.15; }
.sidebar-brand-sub { font-size: .76rem; color: #8e9bbd; max-width: 170px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-nav { padding: .25rem .65rem 1rem; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nav-group-title { font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: #7482a8; padding: 1rem .6rem .35rem; font-weight: 650; }
.nav-item-link {
    display: flex; align-items: center; gap: .65rem; padding: .5rem .65rem; border-radius: 8px;
    color: var(--sidebar-ink); font-size: .9rem; text-decoration: none !important;
}
.nav-item-link small { margin-left: auto; font-size: .68rem; opacity: .65; }
.nav-item-link:hover { background: var(--sidebar-hover); color: var(--sidebar-ink-strong); }
.nav-item-link.active { background: var(--sidebar-active); color: var(--sidebar-ink-strong); font-weight: 600; box-shadow: inset 3px 0 0 #7ea3ff; }
.nav-item-primary { background: rgba(126, 163, 255, .16); color: #fff; margin: .3rem 0 .1rem; font-weight: 600; }
.nav-item-primary:hover { background: rgba(126, 163, 255, .26); }

.sidebar-footer { border-top: 1px solid rgba(255, 255, 255, .08); padding: .8rem .9rem 1rem; }
.sidebar-user { display: flex; align-items: center; gap: .65rem; margin-bottom: .6rem; }
.sidebar-user-avatar { width: 34px; height: 34px; border-radius: 50%; background: #3a4b7c; color: #fff; display: grid; place-items: center; font-weight: 650; flex: none; }
.sidebar-user-name { color: #fff; font-size: .88rem; font-weight: 600; line-height: 1.2; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-role { font-size: .74rem; color: #8e9bbd; }
.sidebar-footer-links { display: flex; gap: .4rem; flex-wrap: wrap; }
.sidebar-link { color: var(--sidebar-ink); font-size: .8rem; padding: .3rem .55rem; border-radius: 7px; text-decoration: none !important; display: inline-flex; gap: .35rem; align-items: center; }
.sidebar-link:hover { background: var(--sidebar-hover); color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
    height: 56px; display: flex; align-items: center; gap: 1rem; padding: 0 1.5rem;
    background: var(--topbar-bg); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 30;
}
.topbar-title { font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-spacer { flex: 1; }
.topbar-shortcuts { display: flex; gap: .9rem; }
.kbd-hint { color: var(--ink-3); font-size: .82rem; text-decoration: none !important; white-space: nowrap; }
.kbd-hint:hover { color: var(--brand); }
kbd {
    background: var(--surface); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; color: var(--ink-2);
    font-family: inherit; font-size: .72rem; font-weight: 650; padding: .08rem .38rem;
}
.topbar-clock { font-variant-numeric: tabular-nums; font-weight: 650; color: var(--ink); font-size: 1rem; white-space: nowrap; min-width: 8.5rem; text-align: right; }
.icon-btn { background: transparent; border: 0; padding: .35rem; border-radius: 8px; color: var(--ink-2); }
.icon-btn:hover { background: var(--soft); }
.menu-toggle { display: none; }

.content { padding: 1.4rem 1.6rem 3rem; width: 100%; max-width: 1480px; margin: 0 auto; }

.sidebar-scrim { display: none; }
@media (max-width: 991.98px) {
    .app-shell { grid-template-columns: minmax(0, 1fr); }
    .sidebar { position: fixed; z-index: 60; width: 280px; transform: translateX(-100%); transition: transform .2s ease; }
    .menu-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
    .menu-open .sidebar-scrim { display: block; position: fixed; inset: 0; background: rgba(10, 16, 36, .45); z-index: 55; }
    .menu-toggle { display: inline-flex; }
    .topbar { padding: 0 .9rem; }
    .topbar-shortcuts { display: none; }
    .content { padding: 1rem .9rem 3rem; }
}

/* ---------------------------------------------------------------- sayfa başlığı & paneller */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.page-subtitle { margin: .2rem 0 0; color: var(--ink-3); font-size: .9rem; }
.page-header-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.panel-pad { padding: 1.1rem 1.2rem; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .85rem 1.2rem; border-bottom: 1px solid var(--line); }
.panel-header h2 { margin: 0; }
.panel + .panel { margin-top: 1rem; }

.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: .9rem; }
.toolbar .form-control, .toolbar .form-select { width: auto; min-width: 150px; }
.toolbar .search-field { flex: 1 1 280px; position: relative; }
.toolbar .search-field .form-control { width: 100%; padding-left: 2.2rem; }
.toolbar .search-field .icon { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.toolbar-count { margin-left: auto; color: var(--ink-3); font-size: .86rem; }

.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: .9rem 1rem; }
.form-grid .c-12 { grid-column: span 12; } .form-grid .c-8 { grid-column: span 8; } .form-grid .c-6 { grid-column: span 6; }
.form-grid .c-4 { grid-column: span 4; } .form-grid .c-3 { grid-column: span 3; } .form-grid .c-2 { grid-column: span 2; }
@media (max-width: 767.98px) { .form-grid > * { grid-column: span 12 !important; } }
.form-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--line); }

/* ---------------------------------------------------------------- tablolar */
.table-wrap { overflow-x: auto; }
.table-app { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; }
.table-app th {
    position: sticky; top: 0; background: var(--soft-2); color: var(--ink-2); font-weight: 600; font-size: .78rem;
    text-transform: uppercase; letter-spacing: .04em; text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table-app td { padding: .55rem .75rem; border-bottom: 1px solid var(--soft); vertical-align: middle; }
.table-app tbody tr:hover td { background: var(--soft-2); }
.table-app tr.row-late td { background: var(--late-bg); }
.table-app tr.row-late:hover td { background: var(--late-bg); }
.table-app tr.row-dirty td { background: var(--dirty-bg); }
.table-app tr.row-error td { background: var(--late-bg); }
.table-app .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-app .nowrap { white-space: nowrap; }
.table-app .actions { text-align: right; white-space: nowrap; }
.cell-title { font-weight: 600; color: var(--ink); }
.cell-sub { color: var(--ink-3); font-size: .82rem; }
.dno-pill { font-variant-numeric: tabular-nums; font-weight: 650; background: var(--soft); border-radius: 6px; padding: .1rem .45rem; color: var(--ink); white-space: nowrap; }
.dno-pill.out { background: var(--bad-bg); color: var(--bad); }
.dno-pill.off { background: var(--soft); color: #98a2b3; text-decoration: line-through; }
.upper { text-transform: uppercase; }
.table-edit input, .table-edit select { min-width: 90px; padding: .25rem .4rem; font-size: .86rem; }
.table-edit td { padding: .25rem .35rem; }

/* ---------------------------------------------------------------- rozetler */
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--soft); color: var(--ink-2); white-space: nowrap; }
.chip-ok { background: var(--ok-bg); color: var(--ok); }
.chip-warn { background: var(--warn-bg); color: var(--warn); }
.chip-bad { background: var(--bad-bg); color: var(--bad); }
.chip-brand { background: var(--brand-50); color: var(--brand); }
.badge-due { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 650; white-space: nowrap; }
.badge-due-late { background: var(--bad-bg); color: var(--bad); }
.badge-due-today { background: var(--warn-bg); color: var(--warn); }
.badge-due-ok { background: var(--ok-bg); color: var(--ok); }

/* ---------------------------------------------------------------- uyarı, toast, modal, boş durum */
.app-alert { display: flex; gap: .7rem; align-items: flex-start; padding: .75rem .95rem; border-radius: var(--radius-sm); border: 1px solid; margin-bottom: .9rem; font-size: .92rem; }
.app-alert-icon { flex: none; margin-top: 1px; }
.app-alert-body { flex: 1; min-width: 0; }
.app-alert-close { background: none; border: 0; color: inherit; opacity: .6; padding: 0; }
.app-alert-info { background: var(--brand-50); border-color: var(--brand-100); color: #1e3f8f; }
.app-alert-success { background: var(--ok-bg); border-color: #bde6cf; color: var(--ok); }
.app-alert-warning { background: var(--warn-bg); border-color: #f3d79e; color: var(--warn); }
.app-alert-danger { background: var(--bad-bg); border-color: #f5c2bd; color: var(--bad); }

.toast-stack { position: fixed; right: 1rem; bottom: 1rem; z-index: 200; display: flex; flex-direction: column; gap: .5rem; max-width: min(420px, calc(100vw - 2rem)); }
.app-toast { display: flex; align-items: flex-start; gap: .6rem; padding: .7rem .8rem; border-radius: 10px; background: #1f2a44; color: #fff; box-shadow: var(--shadow-lg); animation: toast-in .18s ease-out; font-size: .92rem; }
.app-toast-text { flex: 1; }
.app-toast-close { background: none; border: 0; color: inherit; opacity: .6; padding: 0; }
.app-toast-success { background: #17603f; }
.app-toast-warning { background: #8a5206; }
.app-toast-error { background: #9a1d12; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-backdrop-custom { position: fixed; inset: 0; background: rgba(12, 18, 38, .5); z-index: 300; }
.modal-dialog-custom { position: fixed; inset: 0; z-index: 301; display: grid; place-items: center; padding: 1rem; pointer-events: none; }
.modal-card { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); width: min(480px, 100%); padding: 1.4rem 1.5rem; pointer-events: auto; }
.modal-title-custom { margin: 0 0 .5rem; font-size: 1.15rem; }
.modal-text { color: var(--ink-2); white-space: pre-line; }
.modal-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.3rem; }

.empty-state { text-align: center; padding: 2.6rem 1rem; color: var(--ink-3); }
.empty-state-icon { width: 60px; height: 60px; margin: 0 auto .8rem; border-radius: 50%; background: var(--soft); display: grid; place-items: center; color: #98a3b8; }
.empty-state-title { font-weight: 650; color: var(--ink-2); }
.empty-state-text { font-size: .9rem; margin-top: .25rem; }

.pager { display: flex; align-items: center; justify-content: center; gap: .8rem; padding: .9rem 0 .2rem; }
.pager-info { color: var(--ink-3); font-size: .88rem; }

/* ---------------------------------------------------------------- panel (dashboard) */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .9rem; margin-bottom: 1.1rem; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow-sm); display: block; color: inherit; text-decoration: none !important; }
a.stat-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.stat-label { color: var(--ink-3); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 2rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-sub { color: var(--ink-3); font-size: .82rem; }
.stat-card.is-alert .stat-value { color: var(--bad); }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1rem; align-items: start; }
.dash-grid > .panel { margin-top: 0; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 160px) 1fr 44px; gap: .6rem; align-items: center; margin: .35rem 0; font-size: .88rem; }
.bar-track { height: 10px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #6f95ee, #2b59c3); border-radius: 99px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-value { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 600; }

/* ---------------------------------------------------------------- TEZGAH */
.desk-tabs { display: inline-flex; background: var(--soft); padding: 4px; border-radius: 12px; gap: 4px; margin-bottom: 1.1rem; }
.desk-tab { border: 0; background: transparent; padding: .6rem 1.3rem; border-radius: 9px; font-weight: 650; color: var(--ink-2); display: inline-flex; align-items: center; gap: .5rem; }
.desk-tab.active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }
.desk-tab.active.is-return { color: var(--ok); }
@media (max-width: 575.98px) { .desk-tab kbd { display: none; } .desk-tab { padding: .6rem .9rem; white-space: nowrap; } }
.desk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
@media (max-width: 991.98px) { .desk-grid { grid-template-columns: minmax(0, 1fr); } }

.desk-step { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem 1.2rem; box-shadow: var(--shadow-sm); }
.desk-step.is-done { border-color: #b8dcc8; background: var(--soft-2); }
.desk-step-title { display: flex; align-items: center; gap: .6rem; font-weight: 650; margin-bottom: .7rem; }
.step-num { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: .82rem; flex: none; }
.is-done .step-num { background: var(--ok); }
.scan-input { font-size: 1.25rem; padding: .7rem .95rem; border-width: 2px; border-radius: 12px; }
.scan-input:focus { border-color: var(--brand); }
.scan-hint { color: var(--ink-3); font-size: .82rem; margin-top: .35rem; }

.pick-list { margin-top: .7rem; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.pick-item { display: flex; align-items: center; gap: .8rem; width: 100%; text-align: left; background: var(--surface); border: 0; border-bottom: 1px solid var(--soft); padding: .65rem .85rem; }
.pick-item:last-child { border-bottom: 0; }
.pick-item:hover:not(:disabled) { background: var(--brand-50); }
.pick-item:disabled { opacity: .6; background: var(--soft-2); }
.pick-main { flex: 1; min-width: 0; }
.pick-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-sub { color: var(--ink-3); font-size: .82rem; }

.selected-card { display: flex; gap: .9rem; align-items: center; padding: .85rem 1rem; border-radius: 12px; background: var(--brand-50); border: 1px solid var(--brand-100); }
.selected-card .grow { flex: 1; min-width: 0; }
.selected-title { font-weight: 700; font-size: 1.05rem; }
.selected-meta { color: var(--ink-2); font-size: .88rem; }
.member-loans { margin-top: .7rem; }
.member-loans .mini-row { display: flex; align-items: center; gap: .6rem; padding: .35rem 0; font-size: .88rem; border-top: 1px dashed var(--line); }
.member-loans .mini-row:first-child { border-top: 0; }

.desk-confirm { margin-top: 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.2rem; box-shadow: var(--shadow-sm); }
.btn-lg-action { font-size: 1.15rem; padding: .8rem 2rem; border-radius: 12px; }
.due-preview { font-size: 1.05rem; }
.due-preview strong { font-size: 1.25rem; }

.result-banner { border-radius: 14px; padding: 1.1rem 1.3rem; margin-bottom: 1rem; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; border: 1px solid; }
.result-banner.is-ok { background: var(--ok-bg); border-color: #b8dcc8; color: #0d4f31; }
.result-banner.is-warn { background: var(--warn-bg); border-color: #f1d49a; color: #7a4705; }
.result-banner .rb-icon { width: 48px; height: 48px; border-radius: 50%; background: rgba(255, 255, 255, .7); display: grid; place-items: center; flex: none; }
.result-banner .rb-main { flex: 1; min-width: 220px; }
.result-banner .rb-title { font-size: 1.15rem; font-weight: 700; }

.place-card { display: flex; gap: 1.2rem; flex-wrap: wrap; align-items: stretch; }
.place-box { background: var(--surface); border: 2px solid #0d4f31; border-radius: 12px; padding: .5rem 1.1rem; text-align: center; min-width: 120px; }
.place-box .pb-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #476b5a; font-weight: 700; }
.place-box .pb-value { font-size: 2rem; font-weight: 800; color: #b42318; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.recent-list .recent-row { display: flex; align-items: center; gap: .7rem; padding: .5rem 0; border-top: 1px solid var(--soft); font-size: .88rem; }
.recent-list .recent-row:first-child { border-top: 0; }
.recent-kind { width: 76px; flex: none; }

/* ---------------------------------------------------------------- kapak */
.book-cover { object-fit: cover; border-radius: 6px; background: var(--soft); box-shadow: 0 1px 3px rgba(16, 24, 40, .2); flex: none; display: block; }
.book-cover-sm { width: 36px; height: 52px; }
.book-cover-md { width: 90px; height: 130px; }
.book-cover-lg { width: 200px; height: 290px; }
.book-cover-placeholder {
    display: grid; place-items: center; color: rgba(255, 255, 255, .95); font-weight: 800; letter-spacing: .02em;
    background: linear-gradient(145deg, hsl(var(--cover-hue) 55% 48%), hsl(calc(var(--cover-hue) + 30) 60% 34%));
}
.book-cover-sm.book-cover-placeholder { font-size: .8rem; }
.book-cover-md.book-cover-placeholder { font-size: 1.6rem; }
.book-cover-lg.book-cover-placeholder { font-size: 3.2rem; }

/* ---------------------------------------------------------------- herkese açık katalog */
.public-shell { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.public-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.public-header-inner { max-width: 1480px; margin: 0 auto; padding: .8rem 1.2rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.public-brand { display: flex; align-items: center; gap: .75rem; color: var(--ink); text-decoration: none !important; }
.public-brand-mark { width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(135deg, #4c7be6, #2b59c3); color: #fff; display: grid; place-items: center; }
.public-brand-title { display: block; font-weight: 700; line-height: 1.15; }
.public-brand-sub { display: block; color: var(--ink-3); font-size: .8rem; }
.public-staff-link { color: var(--ink-3); font-size: .85rem; }
.public-main { flex: 1; max-width: 1480px; width: 100%; margin: 0 auto; padding: 1.4rem 1.2rem 3rem; }
.public-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 1rem 1.2rem; display: flex; justify-content: center; gap: 1.2rem; flex-wrap: wrap; font-size: .85rem; }

.catalog-hero { background: linear-gradient(135deg, #1e3a8a, #2b59c3 55%, #3f74e0); color: #fff; border-radius: 18px; padding: 1.7rem 1.6rem 1.5rem; margin-bottom: 1.2rem; }
.catalog-hero h1 { color: #fff; font-size: 1.7rem; }
.catalog-hero p { opacity: .85; margin: .3rem 0 1rem; }
.catalog-search { display: flex; gap: .6rem; flex-wrap: wrap; }
.catalog-search { flex-wrap: nowrap; }
.catalog-search .big-input { flex: 1 1 0; min-width: 0; position: relative; }
.catalog-search .big-input input { width: 100%; border: 0; border-radius: 12px; padding: .85rem 1rem .85rem 2.8rem; font-size: 1.05rem; }
.catalog-search .big-input .icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: #7a8699; }
.catalog-filters { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .7rem; }
.catalog-filters select { border: 0; border-radius: 10px; padding: .5rem .8rem; background: rgba(255, 255, 255, .95); color: var(--ink); max-width: 100%; flex: 1 1 150px; min-width: 0; }
@media (min-width: 768px) { .catalog-filters select { flex: 0 0 auto; } }
.catalog-notice { background: var(--warn-bg); border: 1px solid #f3d79e; color: #6d4306; border-radius: 12px; padding: .7rem 1rem; margin-bottom: 1rem; }
.catalog-meta { display: flex; justify-content: space-between; align-items: center; margin: 0 0 .8rem; color: var(--ink-3); font-size: .9rem; flex-wrap: wrap; gap: .5rem; }

.catalog-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem; }
@media (max-width: 1199.98px) { .catalog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 899.98px) { .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599.98px) { .catalog-grid { grid-template-columns: minmax(0, 1fr); } }
.book-card { display: flex; gap: .95rem; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: .85rem; color: inherit; text-decoration: none !important; box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .15s, border-color .15s; }
.book-card:hover { box-shadow: var(--shadow); border-color: var(--line-strong); transform: translateY(-1px); }
.book-card-body { min-width: 0; display: flex; flex-direction: column; gap: .25rem; }
.book-card-title { font-weight: 700; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book-card-author { color: var(--ink-2); font-size: .9rem; }
.book-card-meta { color: var(--ink-3); font-size: .82rem; }
.book-card-foot { margin-top: auto; display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; padding-top: .3rem; }

.detail-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1.6rem; }
@media (max-width: 767.98px) { .detail-grid { grid-template-columns: minmax(0, 1fr); } .detail-grid .book-cover-lg { margin: 0 auto; } }
.detail-title { font-size: 1.7rem; font-weight: 750; line-height: 1.2; }
.detail-author { color: var(--ink-2); font-size: 1.1rem; margin: .2rem 0 .8rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .6rem 1.2rem; margin: 1rem 0; }
.fact-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 650; }
.fact-value { font-weight: 600; }
.copy-list { display: grid; gap: .55rem; }
.copy-row { display: flex; align-items: center; gap: .8rem; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); flex-wrap: wrap; }
.copy-row .dno-big { font-size: 1.4rem; font-weight: 800; min-width: 3.5rem; font-variant-numeric: tabular-nums; }
.copy-row .grow { flex: 1; min-width: 150px; }

/* ---------------------------------------------------------------- giriş / kurulum */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 1.2rem; background: radial-gradient(1200px 600px at 20% -10%, var(--brand-100), transparent), var(--bg); }
.auth-card { width: min(430px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 1.9rem 1.8rem; }
.auth-logo { width: 54px; height: 54px; border-radius: 15px; background: linear-gradient(135deg, #4c7be6, #2b59c3); color: #fff; display: grid; place-items: center; margin-bottom: 1rem; }
.auth-card h1 { margin-bottom: .2rem; }
.auth-card .lead-sm { color: var(--ink-3); margin-bottom: 1.3rem; }

/* ---------------------------------------------------------------- barkod etiketleri */
.label-sheet { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 3mm; background: var(--surface); padding: 4mm; border: 1px solid var(--line); border-radius: 8px; }
.label-cell { border: 1px dashed var(--line-strong); border-radius: 3px; padding: 2mm 2mm 1.5mm; text-align: center; break-inside: avoid; page-break-inside: avoid; overflow: hidden; }
.label-school { font-size: 7pt; font-weight: 700; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.label-bars svg { width: 100%; height: auto; max-height: 20mm; display: block; }
.label-caption { font-size: 7pt; line-height: 1.15; margin-top: .5mm; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media print {
    .label-sheet { border: 0; padding: 0; gap: 2mm; }
    .label-cell { border-color: #d9d9d9; }
    @page { size: A4; margin: 8mm; }
}

/* ---------------------------------------------------------------- yardımcılar */
.text-muted { color: var(--ink-3) !important; }
.mono { font-variant-numeric: tabular-nums; }
.gap-2 { gap: .5rem; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropzone { border: 2px dashed var(--line-strong); border-radius: 14px; padding: 1.6rem; text-align: center; background: var(--soft-2); color: var(--ink-2); }
.dropzone:hover { border-color: var(--brand); background: var(--brand-50); }
.progress-slim { height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.progress-slim > div { height: 100%; background: var(--brand); }

/* Blazor hata arayüzü */
#blazor-error-ui { background: #fff3cd; bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, .2); display: none; left: 0; padding: .6rem 1.25rem .7rem 1.25rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

/* ---------------------------------------------------------------- KOYU TEMA (varsayılan) */
html:root {
    --brand: #5b86e8;
    --brand-600: #7aa0f2;
    --brand-50: #1c2850;
    --brand-100: #27396b;
    --ink: #e7ebf3;
    --ink-2: #b4bed3;
    --ink-3: #8794ae;
    --line: #29324d;
    --bg: #0e1322;
    --surface: #161d31;
    --soft: #222b45;
    --soft-2: #1b2339;
    --line-strong: #37426a;
    --late-bg: #2f1b21;
    --dirty-bg: #35301a;
    --input-bg: #0f1527;
    --topbar-bg: rgba(14, 19, 34, .88);
    --ok: #4cc38a; --ok-bg: #123a2b;
    --warn: #f0b45a; --warn-bg: #3b2d12;
    --bad: #ff8a80; --bad-bg: #3d1c22;
    --dno-red: #ff6b61;
    --sidebar-bg: #0a0f1d;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 3px rgba(0, 0, 0, .5), 0 4px 14px rgba(0, 0, 0, .35);
    --bs-body-bg: #0e1322;
    --bs-body-color: #e7ebf3;
    --bs-border-color: #29324d;
    --bs-link-color: #7aa0f2;
    --bs-link-hover-color: #9db8f6;
    color-scheme: dark;
}
html .btn-primary { --bs-btn-bg: #3f6fe0; --bs-btn-border-color: #3f6fe0; --bs-btn-hover-bg: #5b86e8; --bs-btn-hover-border-color: #5b86e8; --bs-btn-active-bg: #5b86e8; --bs-btn-disabled-bg: #3f6fe0; --bs-btn-disabled-border-color: #3f6fe0; }
html .app-alert-info { color: #b9ccff; }
html .app-alert-success { border-color: #1f5a43; }
html .app-alert-warning { border-color: #6b5320; }
html .app-alert-danger { border-color: #6b2b33; }
html .catalog-notice { background: var(--warn-bg); border-color: #6b5320; color: #f6d89c; }
html .result-banner.is-ok { background: var(--ok-bg); border-color: #1f5a43; color: #b9f0d6; }
html .result-banner.is-warn { background: var(--warn-bg); border-color: #6b5320; color: #f6d89c; }
html .result-banner .rb-icon { background: rgba(255, 255, 255, .1); }
html .place-box { background: var(--surface); border-color: #4cc38a; }
html .place-box .pb-label { color: var(--ink-3); }
html .place-box .pb-value { color: var(--dno-red); }
html .desk-step.is-done { background: #14261f; border-color: #1f5a43; }
html .desk-tabs { background: #0f1527; }
html .desk-tab.active { background: var(--surface); }
html kbd { background: var(--soft); border-color: var(--line-strong); color: var(--ink-2); }
html .app-toast { border: 1px solid var(--line-strong); }
html .catalog-hero { background: linear-gradient(135deg, #16296b, #1f3f9c 55%, #2b59c3); }
html .catalog-search .big-input input, html .catalog-filters select { background: #0f1527; color: var(--ink); }
html .btn-light { background: #e7ebf3; }
html .btn-outline-secondary { --bs-btn-color: var(--ink-2); --bs-btn-border-color: var(--line-strong); --bs-btn-hover-bg: var(--soft); --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: var(--line-strong); --bs-btn-active-bg: var(--soft); --bs-btn-active-color: var(--ink); }
html .label-sheet, html .label-cell { background: #fff; color: #000; }
html .book-cover-placeholder { filter: brightness(.9); }

/* Tema düğmesi, üst çubuk kullanıcı kutusu, imza */
.theme-toggle { background: transparent; border: 1px solid var(--line-strong); color: var(--ink-2); border-radius: 8px; padding: .3rem .45rem; line-height: 1; display: inline-flex; cursor: pointer; }
.theme-toggle:hover { background: var(--soft); color: var(--ink); }
.theme-toggle .ico-sun { display: none; }
.credit { color: var(--ink-3); font-size: .74rem; white-space: nowrap; }
.topbar-user { display: inline-flex; align-items: center; gap: .5rem; padding: .25rem .8rem .25rem .3rem; background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 999px; font-size: .88rem; white-space: nowrap; }
.topbar-user .avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
.topbar-user strong { color: var(--ink); }
.topbar-user small { color: var(--ink-3); }
@media (max-width: 991.98px) { .topbar-user small, .credit-admin { display: none; } }
.dno-red { color: var(--dno-red); font-weight: 800; font-size: 1.02rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Yazdırma her zaman açık renk */
@media print {
    html:root { --bg: #fff; --surface: #fff; --ink: #000; --ink-2: #333; --ink-3: #555; --line: #ccc; --soft: #f0f0f0; --soft-2: #fafafa; --late-bg: #fff; --input-bg: #fff; --bad: #b42318; --ok: #16794c; --warn: #a15c07; --bad-bg: #fdeceb; --ok-bg: #e3f6ec; --warn-bg: #fff3dc; --dno-red: #b42318; --bs-body-bg: #fff; --bs-body-color: #000; color-scheme: light; }
    .theme-toggle, .topbar-user, .credit { display: none !important; }
}

/* ---------------------------------------------------------------- yazdırma */
.print-only { display: none; }
@media print {
    .sidebar, .topbar, .sidebar-scrim, .toolbar, .page-header-actions, .no-print, .pager, .toast-stack, .public-header, .public-footer, .form-actions { display: none !important; }
    .app-shell { display: block; }
    .content, .public-main { padding: 0 !important; max-width: none !important; }
    body, html { background: var(--surface) !important; font-size: 11pt; }
    .panel { border: 0 !important; box-shadow: none !important; }
    .table-app th { position: static; background: #f0f0f0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .table-app td, .table-app th { padding: .25rem .4rem; }
    .print-only { display: block; }
    .row-late td { background: var(--surface) !important; }
    a { color: inherit !important; }
}
@media (max-width: 767.98px) { .public-header .credit { display: none; } }
.public-header-right { display: flex; flex-direction: column; align-items: flex-end; gap: .1rem; line-height: 1.2; }
.public-header-right .credit { font-size: .66rem; opacity: .8; }

/* ---------------------------------------------------------------- giriş sekmeleri / personel kartı */
.login-tabs { display: flex; gap: .4rem; margin-bottom: 1.1rem; }
.login-tabs a { flex: 1; text-align: center; padding: .45rem .6rem; border-radius: 10px; border: 1px solid var(--line); color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .92rem; }
.login-tabs a.active { background: var(--brand-50); border-color: var(--brand); color: var(--ink); }

.id-card { position: relative; width: 55mm; height: 90mm; flex: none; overflow: hidden; border-radius: 3mm; background: #8a4b30 url(/img/kart-bg.png) 0 0 / 100% 100% no-repeat; color: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; box-shadow: 0 0 0 .2mm rgba(0, 0, 0, .35); }
.id-card-name { position: absolute; left: 23%; right: 3%; top: 57.5%; height: 15.5%; display: flex; align-items: center; justify-content: center; text-align: center; font-weight: 800; letter-spacing: .08em; line-height: 1.12; text-wrap: balance; text-shadow: 0 .2mm .4mm rgba(0, 0, 0, .25); }
.id-card-qr { position: absolute; left: 33.85mm; transform: translateX(-50%); top: 74.5%; width: 20mm; height: 20mm; background: #fff; border-radius: .8mm; }
.id-card-qr svg { display: block; width: 100%; height: 100%; }
.id-card.has-photo .id-card-qr { left: 13.7mm; transform: none; }
.id-card-photo { position: absolute; left: 35.3mm; top: 74.5%; width: 18mm; height: 20mm; object-fit: cover; border-radius: .8mm; background: #fff; border: .3mm solid #fff; }

.card-overlay { position: fixed; inset: 0; z-index: 1500; background: rgba(0, 0, 0, .7); display: grid; place-items: center; padding: 1rem; overflow: auto; }
.card-dialog { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1.2rem 1.4rem; max-width: 100%; }
.card-pages { display: grid; gap: 1rem; margin: 1rem 0; max-height: 60vh; overflow: auto; }
.card-page { display: grid; grid-template-columns: repeat(3, 55mm); gap: 3mm; justify-content: center; }
@media print {
    body:has(.card-overlay) * { visibility: hidden; }
    body:has(.card-overlay) .card-pages, body:has(.card-overlay) .card-pages * { visibility: visible; }
    body:has(.card-overlay) .card-pages { position: absolute; left: 0; top: 0; max-height: none; overflow: visible; display: block; margin: 0; }
    .card-page { break-after: page; justify-content: start; }
    .card-page:last-child { break-after: auto; }
    .id-card { box-shadow: none; outline: .15mm solid #999; break-inside: avoid; }
    @page { size: A4; margin: 8mm; }
}
.user-pick { width: 1.1rem; height: 1.1rem; }
