/* =========================================================================
   02._.librarian — หลังบ้าน
   ใช้ tokens เดียวกันกับ 02._.library (css/tokens.css) ต่างกันแค่โทนกลางคืน
   + โครง layout ของหลังบ้าน
   ========================================================================= */

/* หลังบ้านใช้ tokens ชุดเดียวกับหน้าบ้าน (โทนกระดาษ) */
:root {
  --bg: var(--paper);
  --panel: var(--surface);
  --panel-2: var(--surface-2);
  --line-soft: rgba(11, 11, 12, .06);
  --gold: #b08d1f;
  --gold-soft-2: var(--gold-soft);
}

body { background: var(--paper); min-height: 100vh; }
body::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(52% 38% at 82% -8%, rgba(201, 162, 39, .12), transparent 70%),
    linear-gradient(180deg, rgba(255, 253, 248, .55), transparent 40%);
}

/* ---------------------------------------------------------------- boot */
.boot { display: grid; place-items: center; gap: 14px; height: 100vh; color: var(--muted); font-size: var(--fs-xs); }

/* ---------------------------------------------------------------- login */
.login-shell { position: relative; display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.login-card {
  position: relative; width: min(100%, 412px); background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--line); border-radius: var(--r-xl); padding: 34px;
  box-shadow: var(--shadow-3); backdrop-filter: blur(18px);
}
.login-card::before {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; z-index: -1;
  background: linear-gradient(160deg, rgba(201, 162, 39, .5), transparent 42%, transparent 68%, rgba(201, 162, 39, .18));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 24px; }
.login-brand img { width: 40px; height: 40px; border-radius: 12px; }
.login-brand b { font-family: var(--display); font-weight: 600; font-size: var(--fs-md); display: block; line-height: 1.2; }
.login-brand span { font-size: var(--fs-2xs); color: var(--muted); }
.login-card h1 { font-family: var(--display); font-weight: 600; font-size: 24px; margin-bottom: 6px; letter-spacing: -.02em; }
.login-card p.sub { color: var(--muted); font-size: var(--fs-xs); margin-bottom: 24px; }
.field { display: grid; gap: 7px; }
.field > label { font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 11px 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.textarea { min-height: 98px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 175, 55, .18); }
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px; background-size: 5px 5px; background-repeat: no-repeat; }
.error-box { padding: 11px 13px; border-radius: var(--r-sm); background: var(--danger-soft); color: var(--danger); font-size: var(--fs-xs); }

/* ---------------------------------------------------------------- buttons */
.btn {
  --bg: var(--navy); --fg: #fbf7ee; --bd: transparent;
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 9px 17px; border-radius: var(--r-pill); background: var(--bg); color: var(--fg);
  border: 1px solid var(--bd); font-size: var(--fs-xs); font-weight: 600; line-height: 1;
  transition: transform var(--dur-fast) var(--ease-out), filter var(--dur-fast), opacity var(--dur-fast), background var(--dur-fast), border-color var(--dur-fast);
  white-space: nowrap;
}
.btn::before { content: ''; position: absolute; inset: 0; z-index: -1; opacity: 0; background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, .3) 48%, transparent 70%); transform: translateX(-120%); transition: opacity var(--dur-fast), transform .7s var(--ease-out); }
.btn:hover { transform: translateY(-1px); }
.btn:hover::before { opacity: 1; transform: translateX(120%); }
.btn:disabled, .btn.is-disabled { opacity: .45; pointer-events: none; }
.btn--ghost { --bg: transparent; --fg: var(--ink-2); --bd: var(--line-2); }
.btn--ghost:hover { --bg: var(--surface-2); }
.btn--soft { --bg: var(--surface); --fg: var(--ink); --bd: var(--line); }
.btn--gold { --bg: var(--gold); --fg: var(--gold-ink); }
.btn--danger { --bg: transparent; --fg: var(--danger); --bd: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn--sm { min-height: 34px; padding: 6px 12px; font-size: var(--fs-2xs); }
.btn--lg { min-height: 50px; padding: 13px 22px; font-size: var(--fs-sm); }
.btn--block { width: 100%; }
.btn--icon { min-height: 38px; width: 38px; padding: 0; border-radius: var(--r-sm); }
.btn__spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }

/* ---------------------------------------------------------------- shell */
.shell { position: relative; z-index: 1; display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  padding: 20px 14px; background: color-mix(in srgb, var(--surface) 62%, var(--paper));
  border-right: 1px solid var(--line); backdrop-filter: blur(10px);
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 20px; }
.side-brand img { width: 34px; height: 34px; border-radius: 10px; }
.side-brand b { font-family: var(--display); font-weight: 600; font-size: var(--fs-sm); display: block; line-height: 1.2; }
.side-brand span { font-size: var(--fs-2xs); color: var(--muted); }
.side-nav { display: grid; gap: 3px; }
.side-nav a {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: var(--r-sm); color: var(--muted); font-size: var(--fs-xs); font-weight: 500;
  transition: all var(--dur-fast) var(--ease-out);
}
.side-nav a::before {
  content: ''; position: absolute; left: 0; top: 22%; bottom: 22%; width: 2px; border-radius: 2px;
  background: var(--gold); transform: scaleY(0); transition: transform var(--dur) var(--ease-out);
}
.side-nav a:hover { background: var(--surface-2); color: var(--ink); }
.side-nav a.is-active { background: var(--gold-soft); color: var(--gold); }
.side-nav a.is-active::before { transform: scaleY(1); }
.side-nav .count { margin-left: auto; background: var(--danger); color: #fff; border-radius: var(--r-pill); font-size: 10.5px; padding: 1px 7px; font-weight: 700; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 8px; }
.side-user { display: flex; align-items: center; gap: 9px; padding: 6px 8px; font-size: var(--fs-2xs); color: var(--muted); overflow: hidden; }
.side-user b { color: var(--ink); font-size: var(--fs-2xs); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px;
  padding: 16px 28px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: blur(14px);
}
.topbar h1 { font-family: var(--display); font-weight: 600; font-size: 19px; letter-spacing: -.01em; }
.topbar .sub { font-size: var(--fs-2xs); color: var(--muted); }
.content { padding: 24px 28px 70px; }

/* ---------------------------------------------------------------- cards / stats */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-1); }
.card-head { display: flex; align-items: start; gap: 14px; margin-bottom: 16px; }
.card-title { font-family: var(--display); font-weight: 600; font-size: var(--fs-md); }
.card-sub { font-size: var(--fs-2xs); color: var(--muted); margin-top: 2px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(186px, 1fr)); gap: 14px; }
.stat {
  position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 18px 20px; transition: transform var(--dur) var(--ease-out), border-color var(--dur);
}
.stat:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--gold) 40%, var(--line)); }
.stat span { font-size: var(--fs-2xs); color: var(--muted); }
.stat b { display: block; font-family: var(--display); font-weight: 600; font-size: 28px; line-height: 1.24; margin-top: 4px; }
.stat small { font-size: var(--fs-2xs); color: var(--muted-2); }

/* ---------------------------------------------------------------- table */
.table-wrap { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-xs); }
thead th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background var(--dur-fast); }
tbody tr:hover { background: color-mix(in srgb, var(--ink) 3%, transparent); }
.td-actions { display: flex; gap: 6px; justify-content: flex-end; }
.thumb { width: 38px; height: 52px; border-radius: 5px; object-fit: cover; background: var(--surface-2); }
.book-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.book-cell b { font-weight: 600; font-size: var(--fs-xs); }
.book-cell span { display: block; font-size: var(--fs-2xs); color: var(--muted); }

/* ---------------------------------------------------------------- badges / pills */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 6px; font-size: var(--fs-2xs); font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge--ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge--warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge--danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge--gold { background: var(--gold-soft); color: var(--gold-3); border-color: transparent; }
.badge--blue { background: color-mix(in srgb, #3568a8 12%, transparent); color: #2b5a91; border-color: transparent; }

/* ---------------------------------------------------------------- toolbar */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: var(--r-pill);
  border: 1px solid var(--line-2); background: var(--surface); font-size: var(--fs-2xs); color: var(--ink-2);
  font-weight: 500; cursor: pointer; transition: all var(--dur-fast) var(--ease-out);
}
.chip:hover { border-color: var(--ink); }
.chip.is-active { background: var(--navy); border-color: var(--navy); color: #fbf7ee; }
.search-box { position: relative; margin-left: auto; min-width: 240px; }
.search-box .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted-2); }
.search-box .input { padding-left: 38px; border-radius: var(--r-pill); }

/* ---------------------------------------------------------------- forms grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stack { display: grid; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row--wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--line); border: 0; margin: 18px 0; }
.help { font-size: var(--fs-2xs); color: var(--muted-2); }

/* ---------------------------------------------------------------- modal */
#modal-root { position: relative; z-index: 200; }
.modal-overlay { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(4, 6, 10, .68); backdrop-filter: blur(4px); opacity: 0; transition: opacity .22s var(--ease-out); overflow-y: auto; }
.modal-overlay.is-open { opacity: 1; }
.modal { width: min(100%, 620px); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-xl); padding: 24px; box-shadow: var(--shadow-4); max-height: calc(100vh - 40px); overflow-y: auto; transform: translateY(14px); transition: transform .26s var(--ease-out); }
.modal-overlay.is-open .modal { transform: none; }
.modal--sm { max-width: 420px; }
.modal--lg { max-width: 830px; }
.modal-head { display: flex; align-items: start; gap: 14px; margin-bottom: 18px; }
.modal-title { font-family: var(--display); font-weight: 600; font-size: var(--fs-lg); }
.modal-close { margin-left: auto; width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r-sm); color: var(--muted); }
.modal-close:hover { background: var(--surface-2); color: var(--ink); }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- toast */
#toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 300; display: grid; gap: 10px; width: min(340px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line-2); color: var(--ink); font-size: var(--fs-xs); box-shadow: var(--shadow-3); opacity: 0; transform: translateY(10px); transition: all .26s var(--ease-out); }
.toast.is-visible { opacity: 1; transform: none; }
.toast--error { border-color: color-mix(in srgb, var(--danger) 45%, transparent); color: #ffb6b0; }
.toast--success { border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.toast__close { margin-left: auto; color: var(--muted); }

/* ---------------------------------------------------------------- misc */
.empty { display: grid; place-items: center; gap: 8px; padding: 52px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--r-lg); }
.empty h3 { font-family: var(--display); font-weight: 600; color: var(--ink); font-size: var(--fs-md); }
.qr-frame { width: 232px; height: 232px; padding: 12px; background: #fff; border-radius: var(--r-md); display: grid; place-items: center; margin-inline: auto; }
.qr-frame img { width: 208px; height: 208px; }
.key-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--fs-xs); letter-spacing: .04em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; }
.dropzone { border: 1.5px dashed var(--line-2); border-radius: var(--r-md); padding: 22px; text-align: center; color: var(--muted); font-size: var(--fs-xs); transition: all var(--dur-fast); cursor: pointer; }
.dropzone:hover, .dropzone.is-over { border-color: var(--gold); background: var(--gold-soft); color: var(--gold); }
.avatar { display: inline-grid; place-items: center; border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink-2); font-size: var(--fs-2xs); font-weight: 600; width: 32px; height: 32px; border: 1px solid var(--line); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs button { padding: 10px 14px; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.is-active { color: var(--gold); border-color: var(--gold); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--fs-xs); }
.progress { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--gold); }
.center { text-align: center; margin-inline: auto; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px; }
  .side-brand { padding: 0 10px 0 4px; }
  .side-nav { display: flex; overflow-x: auto; gap: 4px; }
  .side-nav a { white-space: nowrap; }
  .side-nav a::before { display: none; }
  .side-foot { margin: 0 0 0 auto; border: 0; padding: 0; flex-direction: row; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .content, .topbar { padding-inline: 16px; }
}

/* ---------------------------------------------------------------- entrance */
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.fade-up { animation: fade-up .5s var(--ease-out) both; }
.stat { animation: fade-up .5s var(--ease-out) both; }
.stat:nth-child(2) { animation-delay: .05s; }
.stat:nth-child(3) { animation-delay: .1s; }
.stat:nth-child(4) { animation-delay: .15s; }
tbody tr { animation: fade-up .35s var(--ease-out) both; }
tbody tr:nth-child(2) { animation-delay: .02s; } tbody tr:nth-child(3) { animation-delay: .04s; }
tbody tr:nth-child(4) { animation-delay: .06s; } tbody tr:nth-child(5) { animation-delay: .08s; }

/* ---------------------------------------------------------------- book detail */
.book-detail-admin { display: grid; grid-template-columns: 260px 1fr; gap: 26px; align-items: start; }
.book-detail-admin__cover { position: sticky; top: 96px; display: grid; gap: 10px; justify-items: start; }
.book-detail-admin__cover img { width: 100%; aspect-ratio: 3 / 4.15; object-fit: cover; border-radius: var(--r-md); box-shadow: var(--shadow-3); border: 1px solid var(--line); background: var(--surface-2); }
.thumb-lg {
  width: 100%; aspect-ratio: 3 / 4.15; border-radius: var(--r-md);
  display: grid; place-items: center; color: #f2eee4; font-family: var(--display);
  font-size: 30px; font-weight: 600; box-shadow: var(--shadow-3);
}
.book-detail-admin__main { min-width: 0; }

.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.kv-grid > div { background: var(--surface); padding: 12px 14px; }
.kv-grid span { display: block; font-size: 11px; color: var(--muted); letter-spacing: .02em; }
.kv-grid b { font-size: var(--fs-xs); font-weight: 600; }

.reader-modal { display: grid; place-items: center; gap: 12px; min-height: 320px; color: var(--muted); font-size: var(--fs-xs); }
.reader-modal iframe { background: #fff; }

@media (max-width: 900px) {
  .book-detail-admin { grid-template-columns: 1fr; }
  .book-detail-admin__cover { position: static; max-width: 220px; }
}

/* =========================================================================
   Editorial workspace pass — login + dashboard
   ========================================================================= */
.login-aurora {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none; opacity: .8;
}
.login-shell {
  position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr);
  min-height: 100vh; place-items: stretch; padding: 0; background: var(--paper);
}
.login-editorial {
  position: relative; overflow: hidden; display: grid; grid-template-rows: auto 1fr auto auto; gap: 28px;
  padding: clamp(28px, 4.6vw, 58px); color: #f3eee4;
  background:
    radial-gradient(60% 46% at 82% 12%, rgba(201, 162, 39, .24), transparent 66%),
    radial-gradient(48% 40% at 12% 90%, rgba(46, 82, 122, .30), transparent 70%),
    linear-gradient(145deg, #0a1220, #0d1a2c 58%, #080d16);
}
.login-editorial::before {
  content: ''; position: absolute; inset: 18px; border: 1px solid rgba(201, 162, 39, .18);
  border-radius: 22px; pointer-events: none;
}
.login-editorial::after {
  content: 'π'; position: absolute; right: -34px; bottom: -100px; z-index: 0;
  font-family: Georgia, serif; font-size: 420px; line-height: 1; color: rgba(201, 162, 39, .07);
  pointer-events: none;
}
.login-editorial__top, .login-editorial__main, .login-editorial__books, .login-editorial__foot { position: relative; z-index: 1; }
.login-editorial__top { display: flex; align-items: center; gap: 12px; }
.login-editorial__top .brand-mark { width: 46px; height: 46px; }
.login-editorial__top b { display: block; font-family: var(--display); font-weight: 600; font-size: 17px; line-height: 1.2; }
.login-editorial__top span { display: block; color: rgba(243, 238, 228, .5); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; margin-top: 3px; }
.login-editorial__main { align-self: center; max-width: 520px; }
.login-editorial__main .eyebrow { color: var(--gold-2); }
.login-editorial__main h2 {
  margin-top: 20px; font-family: var(--display); font-weight: 500;
  font-size: clamp(38px, 5.2vw, 68px); line-height: 1.08; letter-spacing: -.035em;
}
.login-editorial__main h2 em { font-style: normal; color: var(--gold-2); }
.login-editorial__main p { margin-top: 20px; max-width: 40ch; color: rgba(243, 238, 228, .62); font-size: 14px; line-height: 1.75; }
.login-proof { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 26px; color: rgba(243, 238, 228, .62); font-size: 11px; }
.login-proof span { display: inline-flex; align-items: center; gap: 6px; }
.login-proof .icon { color: var(--gold-2); }
.login-editorial__books { display: flex; align-items: flex-end; gap: 14px; height: 150px; padding-left: 8px; perspective: 900px; }
.login-book {
  position: relative; display: grid; grid-template-rows: 1fr auto auto; width: 86px; height: 132px;
  padding: 12px 10px; border-radius: 4px 8px 8px 4px; color: #f7f0e3;
  box-shadow: inset -7px 0 12px rgba(0,0,0,.32), 0 24px 38px rgba(0,0,0,.30);
  transform: rotate(-4deg) translateY(0); transition: transform .5s var(--ease-out);
}
.login-book:nth-child(2) { transform: rotate(3deg) translateY(-12px); }
.login-book:nth-child(3) { transform: rotate(8deg) translateY(4px); }
.login-book:hover { transform: rotate(0) translateY(-14px); }
.login-book i { font-family: Georgia, serif; font-size: 30px; font-style: normal; opacity: .9; align-self: start; }
.login-book b { font-family: var(--display); font-size: 10px; font-weight: 600; letter-spacing: .12em; }
.login-book small { font-size: 7px; letter-spacing: .12em; opacity: .55; margin-top: 4px; }
.login-book--navy { background: linear-gradient(145deg, #1d3554, #0b1728); }
.login-book--gold { background: linear-gradient(145deg, #8a681b, #4e3a0a); }
.login-book--oxblood { background: linear-gradient(145deg, #74312d, #3d1b19); }
.login-editorial__foot { display: flex; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid rgba(243,238,228,.12); font-size: 10px; color: rgba(243,238,228,.42); }
.login-editorial__foot a { display: inline-flex; align-items: center; gap: 5px; color: rgba(243,238,228,.62); }

.login-panel { display: grid; place-items: center; padding: 32px; background: color-mix(in srgb, var(--paper) 84%, var(--surface)); }
.login-panel .login-card {
  width: min(100%, 430px); padding: 0; border: 0; background: transparent;
  box-shadow: none; backdrop-filter: none;
}
.login-panel .login-card::before { display: none; }
.login-brand--mobile { display: none; }
.login-panel .eyebrow { margin-bottom: 18px; }
.login-panel h1 { font-family: var(--display); font-weight: 600; font-size: 30px; letter-spacing: -.03em; margin-bottom: 8px; }
.login-panel .sub { color: var(--muted); font-size: 13px; margin-bottom: 28px; }
.login-panel .btn--block { min-height: 52px; margin-top: 4px; }
.login-panel .input { min-height: 50px; background: var(--surface); }
.login-card__foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 10.5px; color: var(--muted-2); flex-wrap: wrap; }
.login-card__foot span { display: inline-flex; align-items: center; gap: 5px; }
.login-card__foot a { color: var(--gold-3); font-weight: 600; }

/* dashboard */
.admin-hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; align-items: end; gap: 20px; flex-wrap: wrap;
  margin-bottom: 16px; padding: 24px 26px; border-radius: var(--r-lg);
  background: linear-gradient(125deg, #0c1727, #14253d 70%, #0c1727);
  color: #f3eee4; box-shadow: var(--shadow-2);
}
.admin-hero::before {
  content: ''; position: absolute; right: -30px; top: -90px; width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 162, 39, .3), transparent 67%); pointer-events: none;
}
.admin-hero__copy { position: relative; z-index: 1; }
.admin-hero__copy .eyebrow { color: var(--gold-2); }
.admin-hero__copy h2 { margin-top: 8px; font-family: var(--display); font-weight: 500; font-size: clamp(26px, 3.4vw, 40px); letter-spacing: -.03em; line-height: 1.1; }
.admin-hero__copy p { margin-top: 7px; max-width: 52ch; color: rgba(243,238,228,.6); font-size: 12.5px; }
.admin-hero__actions { position: relative; z-index: 1; display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.admin-hero__actions .btn--soft { --btn-bg: rgba(255,255,255,.1); --btn-fg: #f3eee4; --btn-bd: rgba(255,255,255,.16); }
.admin-hero__actions .btn--sm { min-height: 38px; }
.admin-hero__glyph {
  position: absolute; right: 28px; bottom: -46px; z-index: 0;
  font-family: Georgia, serif; font-size: 170px; line-height: 1; color: rgba(201,162,39,.09);
}
.stat { position: relative; padding-top: 20px; }
.stat__icon {
  position: absolute; right: 14px; top: 14px; display: grid; place-items: center; width: 30px; height: 30px;
  border-radius: 50%; background: var(--gold-soft); color: var(--gold-3);
}
.stat b { font-size: 31px; }
.stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1080px) { .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-editorial { display: none; }
  .login-panel { min-height: 100vh; padding: 28px 20px; }
  .login-brand--mobile { display: flex; margin-bottom: 28px; }
  .admin-hero { padding: 20px; }
  .admin-hero__actions { margin-left: 0; }
}

/* logo must stay a true circle everywhere in the workspace */
.side-brand .brand-mark,
.login-brand .brand-mark,
.login-editorial__top .brand-mark { border-radius: 50%; overflow: hidden; background: transparent; }
.side-brand .brand-mark img,
.login-brand .brand-mark img,
.login-editorial__top .brand-mark img,
.side-brand img { border-radius: 50%; object-fit: contain; }

/* keep the plate above the floating books */
.book-cloud__badge { z-index: 30; right: 4px; bottom: 22px; }
.book-cloud__hint { z-index: 20; }

@media (max-width: 620px) {
  .admin-hero__glyph { display: none; }
  .login-panel h1 { font-size: 27px; }
}

/* seller detail */
.seller-detail__head { display: flex; gap: 14px; align-items: flex-start; }
.seller-detail__avatar {
  flex: 0 0 auto; width: 52px; height: 52px; display: grid; place-items: center;
  border-radius: 50%; background: var(--gold-soft); color: var(--gold-3);
}
.seller-detail .kv-grid b { overflow-wrap: anywhere; }
