/* ASCENTIUM Library - lending: the desk, books out, reservations, rules, calendar. Uses the theme variables only. */

/* ---------- the desk ---------- */
.lib-desk { display: flex; flex-direction: column; gap: .9rem; }
.lib-desk__bar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.lib-segment { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--lib-surface-2); box-shadow: inset 0 0 0 1px var(--lib-line); }
.lib-segment label { margin: 0; position: relative; cursor: pointer; }
.lib-segment input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.lib-segment span { display: block; padding: .35rem .9rem; border-radius: 999px; font-weight: 650; font-size: .9rem; color: var(--lib-ink-2); transition: background .15s, color .15s; }
.lib-segment input:checked + span { background: var(--lib-primary); color: var(--lib-on-primary); }
.lib-segment input:focus-visible + span { outline: 3px solid rgba(var(--lib-primary-rgb), .55); outline-offset: 1px; }

.lib-desk__scan { display: flex; align-items: center; gap: .6rem; padding: .55rem .6rem .55rem 1rem; border-radius: 20px; background: var(--lib-surface); box-shadow: 0 0 0 2px var(--lib-primary-line), var(--lib-shadow); }
.lib-desk__scan > .ic { width: 28px; height: 28px; flex: none; color: var(--lib-primary); }
.lib-desk__scan .form-control { border: 0; background: transparent; box-shadow: none; font-size: 1.25rem; padding-left: .25rem; min-width: 0; }
.lib-desk__scan .form-control:focus { box-shadow: none; }
.lib-desk__scan:focus-within { box-shadow: 0 0 0 3px rgba(var(--lib-primary-rgb), .55), var(--lib-shadow); }
.lib-desk__hint { margin: -.3rem 0 0 .4rem; }
@media (max-width: 575.98px) {
  .lib-desk__bar > .ms-auto { width: 100%; margin-left: 0 !important; justify-content: space-between; flex-wrap: nowrap; }
  .lib-desk__bar .lib-segment { flex: 1 1 auto; }
  .lib-desk__bar .lib-segment label { flex: 1 1 0; }
  .lib-desk__bar .lib-segment span { text-align: center; padding-inline: .3rem; }
  .lib-desk__scan { padding-left: .75rem; gap: .4rem; }
  .lib-desk__scan > .ic { width: 22px; height: 22px; }
  .lib-desk__scan .form-control { font-size: 1.05rem; }
}

.lib-desk__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 1rem; align-items: start; }
.lib-desk__member { min-height: 16rem; }
.lib-desk__empty { text-align: center; padding: 2.2rem 1rem; color: var(--lib-muted); }
.lib-desk__empty .ic { width: 44px; height: 44px; margin-bottom: .6rem; opacity: .7; }
.lib-desk__empty h2 { color: var(--lib-ink); margin-bottom: .3rem; }
.lib-desk__feed { display: flex; flex-direction: column; gap: .7rem; min-width: 0; }
[data-feed] { display: flex; flex-direction: column; gap: .7rem; }
@media (max-width: 991.98px) { .lib-desk__grid { grid-template-columns: minmax(0, 1fr); } .lib-desk__feed { order: -1; } }

/* member panel */
.lib-deskmember__head { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.lib-deskmember__head .min-w-0 { flex: 1 1 10rem; }
.lib-deskmember .lib-statusbig { display: flex; flex-wrap: wrap; row-gap: .1rem; width: 100%; border-radius: 14px; }
.lib-deskmember .lib-statusbig small { white-space: nowrap; font-weight: 600; }
.lib-reasons--tight { gap: .5rem; margin-bottom: 1rem; }
.lib-reasons--tight .lib-reason { padding: .55rem .8rem; }
.lib-deskloans { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.lib-deskloan { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .65rem .2rem; border-top: 1px solid var(--lib-line); }
.lib-deskloan:first-child { border-top: 0; }
.lib-deskloan .min-w-0 { flex: 1 1 auto; }
.lib-deskloan.is-late strong { color: var(--lib-danger); }
.lib-deskloan__act { display: flex; align-items: center; gap: .3rem; flex: none; }
@media (max-width: 479.98px) { .lib-deskloan { flex-wrap: wrap; } .lib-deskloan__act { width: 100%; } }

/* feed cards */
.lib-ditem { display: flex; gap: .85rem; align-items: flex-start; padding: .85rem 1rem; border-radius: 16px; background: var(--lib-surface); box-shadow: 0 0 0 1px var(--lib-line); border-left: 6px solid var(--lib-line-2); animation: lib-pop .22s ease-out; }
.lib-ditem--ok { border-left-color: var(--lib-ok); }
.lib-ditem--warn { border-left-color: var(--lib-warn); }
.lib-ditem--bad { border-left-color: var(--lib-danger); background: var(--lib-danger-soft); }
.lib-ditem--info { border-left-color: var(--lib-info); }
.lib-ditem.is-undone { opacity: .5; }
.lib-ditem__ic { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--lib-surface-2); }
.lib-ditem--ok .lib-ditem__ic { background: var(--lib-ok-soft); color: var(--lib-ok); }
.lib-ditem--warn .lib-ditem__ic { background: var(--lib-warn-soft); color: var(--lib-warn); }
.lib-ditem--bad .lib-ditem__ic { background: var(--lib-surface); color: var(--lib-danger); }
.lib-ditem--info .lib-ditem__ic { background: var(--lib-info-soft); color: var(--lib-info); }
.lib-ditem__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.lib-ditem__title { font-size: 1.05rem; line-height: 1.3; overflow-wrap: anywhere; }
.lib-ditem__copy { color: var(--lib-muted); font-size: .88rem; overflow-wrap: anywhere; }
.lib-ditem__lines { margin: .2rem 0 0; padding-left: 1.1rem; color: var(--lib-ink-2); }
.lib-ditem__pick { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; }
.lib-ditem__override, .lib-ditem__why { margin-top: .5rem; display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.lib-ditem__why .form-control { flex: 1 1 14rem; min-width: 0; }
.lib-ditem__undo { flex: none; }
.lib-ditem .lib-pill { align-self: flex-start; margin-top: .2rem; }
@keyframes lib-pop { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .lib-ditem { animation: none; } }
.lib-desk__queue ul { padding-left: 1.2rem; max-height: 14rem; overflow: auto; }

/* desk mode: nothing but the desk */
html.lib-deskmode .lib-rail, html.lib-deskmode .lib-topbar, html.lib-deskmode .lib-tabbar, html.lib-deskmode .lib-pagehead, html.lib-deskmode .lib-subnav { display: none !important; }
html.lib-deskmode .lib-main { margin-left: 0 !important; }
html.lib-deskmode .lib-content { padding-top: 1rem; max-width: 1500px; margin-inline: auto; }

/* ---------- lists ---------- */
.lib-conflicts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .8rem; }
.lib-calrows { list-style: none; margin: 0; padding: 0; }
.lib-calrows li { display: flex; align-items: center; gap: .8rem; padding: .6rem 0; border-top: 1px solid var(--lib-line); }
.lib-calrows li:first-child { border-top: 0; }
.lib-calrows li .min-w-0 { flex: 1 1 auto; }
.lib-calrows li.is-past { opacity: .55; }
.lib-calrows .lib-pill { flex: none; min-width: 6.2rem; justify-content: center; text-align: center; }
.lib-testresult { padding: 1rem 1.1rem; border-radius: 16px; background: var(--lib-surface-2); box-shadow: inset 0 0 0 1px var(--lib-line); }
.lib-policyform .form-label { font-size: .85rem; font-weight: 650; margin-bottom: .2rem; }

/* a book's copies: who has it */
.lib-copyloan { display: block; font-size: .85rem; color: var(--lib-ink-2); }

/* a book's reservation line */
.lib-queue { list-style: none; counter-reset: q; margin: 0 0 .5rem; padding: 0; }
.lib-queue li { counter-increment: q; display: flex; align-items: center; gap: .8rem; padding: .6rem 0; border-top: 1px solid var(--lib-line); }
.lib-queue li:first-child { border-top: 0; }
.lib-queue li::before { content: counter(q); flex: none; width: 1.8rem; height: 1.8rem; border-radius: 50%; display: grid; place-items: center; background: var(--lib-surface-2); color: var(--lib-ink-2); font-weight: 700; font-size: .85rem; }
.lib-queue li .min-w-0 { flex: 1 1 auto; }
.lib-subtitle { font-size: .95rem; font-weight: 700; color: var(--lib-ink-2); }
