/* Optional roleplay book mode. Remove this file/link plus the Buchmodus button to go back fully. */
body.historical-theme {
  --bg: #221409;
  --bg-2: #3a2413;
  --sidebar: #2b160c;
  --panel: #f0dfb8;
  --panel-2: #ead4a6;
  --panel-3: #d8bc82;
  --line: #7b4f1f;
  --line-soft: rgba(92, 53, 18, .35);
  --text: #2b1609;
  --muted: #795a31;
  --gold: #9d6717;
  --gold-soft: rgba(157, 103, 23, .18);
  --green: #006f4f;
  --green-2: #2d6b42;
  --emerald: #007a54;
  --teal: #0b705e;
  --amber: #a46113;
  --ruby: #8f261d;
  --red: #8f261d;
  --blue: #24506c;
  --brass: #9d6717;
  --velvet: #190d07;
  --shadow: 0 18px 44px rgba(32, 17, 7, .28);
  background:
    radial-gradient(circle at 24% 8%, rgba(255, 245, 199, .34), transparent 28%),
    radial-gradient(circle at 74% 12%, rgba(121, 71, 21, .18), transparent 28%),
    linear-gradient(90deg, rgba(80, 39, 10, .18) 0 1px, transparent 1px 42px),
    linear-gradient(0deg, rgba(80, 39, 10, .12) 0 1px, transparent 1px 42px),
    #2a170b;
  color: var(--text);
}

body.historical-theme::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(50, 25, 5, .10), transparent 12%),
    radial-gradient(circle at 86% 26%, rgba(50, 25, 5, .11), transparent 14%),
    radial-gradient(circle at 54% 88%, rgba(50, 25, 5, .10), transparent 18%),
    repeating-linear-gradient(8deg, rgba(53, 27, 7, .045) 0 1px, transparent 1px 6px);
  mix-blend-mode: multiply;
}

body.historical-theme .app-shell {
  position: relative;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(30, 15, 6, .85), transparent 280px),
    radial-gradient(ellipse at 50% -10%, rgba(255, 219, 147, .18), transparent 42%);
}

body.historical-theme .content {
  background:
    linear-gradient(90deg, rgba(71, 39, 14, .10) 0 1px, transparent 1px 80px),
    radial-gradient(ellipse at 50% 0, rgba(247, 225, 171, .30), transparent 44%),
    #25150b;
}

body.historical-theme .page,
body.historical-theme .dashboard-page,
body.historical-theme .kasse,
body.historical-theme .payroll-page,
body.historical-theme .deposits-page,
body.historical-theme .inventory-page {
  background:
    linear-gradient(90deg, rgba(122, 77, 26, .07) 0 1px, transparent 1px 36px),
    linear-gradient(0deg, rgba(122, 77, 26, .05) 0 1px, transparent 1px 36px),
    radial-gradient(circle at 8% 4%, rgba(255, 255, 220, .32), transparent 24%),
    #ead9ad;
  border: 2px solid #8f641e;
  border-radius: 4px;
  box-shadow: var(--shadow), inset 0 0 0 5px rgba(255, 247, 211, .35), inset 0 0 80px rgba(96, 45, 8, .12);
  color: #2a1608;
  margin: 18px;
  padding: 24px;
}

body.historical-theme .sidebar {
  background:
    linear-gradient(90deg, rgba(255, 210, 99, .08), transparent 18px),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .14) 0 2px, transparent 2px 28px),
    linear-gradient(180deg, #3a1f10, #1c0e07);
  border-right: 4px double #9b6b28;
  box-shadow: 10px 0 28px rgba(21, 9, 3, .38), inset -18px 0 24px rgba(0, 0, 0, .20);
}

body.historical-theme .sidebar::before,
body.historical-theme .sidebar::after {
  opacity: .55;
}

body.historical-theme .brand {
  background: rgba(20, 10, 5, .36);
  border: 1px solid rgba(198, 142, 48, .45);
  border-radius: 4px;
  padding: 10px;
}

body.historical-theme .brand-logo {
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .45)) sepia(.15);
}

body.historical-theme .brand span,
body.historical-theme .brand strong,
body.historical-theme .brand small,
body.historical-theme .nav-heading,
body.historical-theme .user-box,
body.historical-theme .user-box small {
  color: #f5e2ad;
  text-shadow: 0 1px 1px #000;
}

body.historical-theme nav button,
body.historical-theme .user-box button,
body.historical-theme .theme-toggle {
  background: linear-gradient(180deg, #ead5a2, #c99b51);
  border: 1px solid #6d3f13;
  border-radius: 3px;
  color: #321908;
  box-shadow: inset 0 1px rgba(255, 255, 255, .38), 0 2px 0 rgba(32, 17, 6, .72);
}

body.historical-theme nav button.active,
body.historical-theme nav button:hover,
body.historical-theme .primary,
body.historical-theme .link-button {
  background: linear-gradient(180deg, #097a58, #005b40);
  border-color: #07412f;
  color: #fff6cf;
  text-shadow: 0 1px 1px #001c13;
}

body.historical-theme h1,
body.historical-theme h2,
body.historical-theme .purchase-titlebar h1,
body.historical-theme .page-head h1 {
  color: #291304;
  text-shadow: 0 1px #f7e7bd;
  letter-spacing: 0;
}

body.historical-theme h1::after,
body.historical-theme .purchase-titlebar::after,
body.historical-theme .page-head::after {
  border-color: rgba(119, 70, 19, .40);
}

body.historical-theme .dashboard-panel,
body.historical-theme .welcome-panel,
body.historical-theme .stat-card,
body.historical-theme .metric,
body.historical-theme .editor,
body.historical-theme .order-panel,
body.historical-theme .sales-left,
body.historical-theme .payroll-panel,
body.historical-theme .payroll-summary > div,
body.historical-theme .cashbook-summary > div,
body.historical-theme .purchase-card,
body.historical-theme .purchase-detail-modal,
body.historical-theme .purchase-status-modal,
body.historical-theme .supplier-card,
body.historical-theme .inventory-run,
body.historical-theme .vault-editor,
body.historical-theme .order-history,
body.historical-theme .admin-row,
body.historical-theme .users-list,
body.historical-theme .table,
body.historical-theme .deposit-row {
  background:
    linear-gradient(180deg, rgba(255, 250, 221, .54), rgba(223, 196, 137, .42)),
    #e8d4a3;
  border: 1px solid rgba(111, 66, 18, .45);
  border-radius: 4px;
  color: #2b1608;
  box-shadow: inset 0 1px rgba(255, 255, 255, .42), 0 4px 14px rgba(60, 31, 9, .14);
}

body.historical-theme .product-tile {
  background:
    linear-gradient(180deg, rgba(249, 238, 197, .86), rgba(211, 177, 104, .70)),
    #ead8ab;
  border: 1px solid #8f641e;
  color: #281407;
}

body.historical-theme .product-tile img,
body.historical-theme .price-icon img {
  filter: sepia(.10) contrast(.96) saturate(.92);
}

body.historical-theme input,
body.historical-theme select,
body.historical-theme textarea {
  background: rgba(255, 246, 209, .72);
  border: 1px solid rgba(92, 53, 18, .45);
  border-radius: 3px;
  color: #211005;
  box-shadow: inset 0 2px 5px rgba(74, 36, 10, .12);
}

body.historical-theme label,
body.historical-theme .muted,
body.historical-theme small,
body.historical-theme .product-category,
body.historical-theme .dashboard-head span,
body.historical-theme .page-head span {
  color: #735329;
}

body.historical-theme .secondary {
  background: #d8bb7f;
  border: 1px solid #7a511d;
  color: #2a1608;
}

body.historical-theme .danger {
  background: linear-gradient(180deg, #9d3024, #6e1712);
  border: 1px solid #5a120e;
  color: #fff4d6;
}

body.historical-theme .positive,
body.historical-theme .stat-card.good strong {
  color: #006947;
}

body.historical-theme .negative,
body.historical-theme .stat-card.danger strong {
  color: #8b1e16;
}

body.historical-theme .table-head,
body.historical-theme .payroll-head,
body.historical-theme .purchase-detail-row.head,
body.historical-theme .report-head {
  background: #3b220f;
  color: #fff3c7;
  border-color: #8f641e;
}

body.historical-theme .table-row,
body.historical-theme .payroll-row,
body.historical-theme .purchase-detail-row,
body.historical-theme .admin-row,
body.historical-theme .order-history-row {
  border-color: rgba(100, 58, 17, .24);
}

body.historical-theme .notice,
body.historical-theme .error {
  background: #fff1bf;
  border: 1px solid #9b6b28;
  color: #4a260b;
}

body.historical-theme .purchase-status-backdrop {
  background: rgba(16, 8, 3, .70);
  backdrop-filter: blur(2px) sepia(.35);
}

body.historical-theme .purchase-detail-modal,
body.historical-theme .purchase-status-modal {
  background:
    radial-gradient(circle at 50% 0, rgba(255, 248, 211, .82), transparent 35%),
    #ead8ab;
}

body.historical-theme .inventory-detail-wrap {
  color: #2b1608;
}

body.historical-theme .inventory-report {
  background:
    radial-gradient(ellipse at 50% 0, rgba(255, 252, 225, .75), transparent 42%),
    repeating-linear-gradient(0deg, rgba(111, 66, 18, .05) 0 1px, transparent 1px 36px),
    #f0dfb8;
  color: #2b1608;
  border: 4px double #8f641e;
  box-shadow: 0 22px 48px rgba(25, 12, 3, .32), inset 0 0 0 8px rgba(255, 250, 221, .50);
}

body.historical-theme .login-shell {
  background:
    radial-gradient(circle at 50% 0, rgba(255, 231, 164, .34), transparent 30%),
    #241307;
}

body.historical-theme .login-panel {
  background:
    radial-gradient(circle at 50% 0, rgba(255, 250, 220, .40), transparent 34%),
    #e8d2a0;
  color: #2b1608;
  border: 3px double #8f641e;
}

body.historical-theme .login-quote,
body.historical-theme .eyebrow {
  color: #6b4318;
}

@media (max-width: 900px) {
  body.historical-theme .page,
  body.historical-theme .dashboard-page,
  body.historical-theme .kasse,
  body.historical-theme .payroll-page,
  body.historical-theme .deposits-page,
  body.historical-theme .inventory-page {
    margin: 10px;
    padding: 16px;
  }
}

body.book-mode {
  overflow: hidden;
}

body.book-mode .book-app-shell {
  min-height: 100vh;
  padding: clamp(14px, 2.2vw, 34px);
  position: relative;
  z-index: 1;
  background:
    radial-gradient(ellipse at 50% 12%, rgba(255, 207, 119, .20), transparent 34%),
    radial-gradient(circle at 14% 88%, rgba(20, 7, 1, .50), transparent 28%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 62px),
    linear-gradient(135deg, #140904 0%, #2c1409 42%, #170a04 100%);
  color: #2b1608;
}

body.book-mode .book-desk-shadow {
  position: fixed;
  inset: auto 6vw 1.5vw;
  height: 18vh;
  pointer-events: none;
  background: radial-gradient(ellipse, rgba(0, 0, 0, .52), transparent 66%);
  filter: blur(12px);
}

body.book-mode .saloon-book {
  position: relative;
  z-index: 1;
  height: calc(100vh - clamp(28px, 4.4vw, 68px));
  display: grid;
  grid-template-columns: minmax(270px, 340px) minmax(0, 1fr);
  max-width: 1760px;
  margin: 0 auto;
  border-radius: 12px;
  filter: drop-shadow(0 24px 44px rgba(0, 0, 0, .44));
}

body.book-mode .book-spine {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: minmax(270px, 340px);
  left: min(340px, max(270px, 24vw));
  width: 34px;
  transform: translateX(-17px);
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .34), rgba(255, 239, 180, .25) 44%, rgba(0, 0, 0, .40)),
    repeating-linear-gradient(0deg, rgba(79, 40, 12, .25) 0 10px, rgba(255, 223, 154, .18) 10px 12px);
  border-left: 1px solid rgba(68, 32, 9, .45);
  border-right: 1px solid rgba(68, 32, 9, .45);
  box-shadow: 0 0 28px rgba(0, 0, 0, .32);
}

body.book-mode .book-index-page,
body.book-mode .book-work-page {
  min-height: 0;
  background:
    radial-gradient(circle at 28% 8%, rgba(255, 252, 220, .68), transparent 28%),
    radial-gradient(circle at 80% 92%, rgba(118, 63, 18, .12), transparent 26%),
    repeating-linear-gradient(0deg, rgba(94, 54, 18, .045) 0 1px, transparent 1px 31px),
    #ead7a7;
  border: 3px solid #744211;
  box-shadow:
    inset 0 0 0 7px rgba(255, 247, 210, .42),
    inset 0 0 70px rgba(91, 44, 10, .16);
}

body.book-mode .book-index-page {
  border-radius: 13px 0 0 13px;
  border-right: 0;
  padding: 22px 20px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 16px;
}

body.book-mode .book-work-page {
  position: relative;
  border-radius: 0 13px 13px 0;
  padding: 22px 26px 18px 38px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

body.book-mode .book-work-page::before,
body.book-mode .book-index-page::before {
  content: "";
  position: absolute;
  inset: 12px;
  pointer-events: none;
  border: 1px solid rgba(117, 72, 24, .30);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 230, .28);
}

body.book-mode .book-index-page {
  position: relative;
}

body.book-mode .book-cover-mark {
  text-align: center;
  border-bottom: 4px double rgba(103, 58, 16, .45);
  padding-bottom: 14px;
}

body.book-mode .book-cover-mark img {
  width: 126px;
  height: 90px;
  object-fit: contain;
  display: block;
  margin: 0 auto 8px;
  filter: sepia(.18) drop-shadow(0 4px 6px rgba(60, 29, 7, .25));
}

body.book-mode .book-cover-mark span,
body.book-mode .book-cover-mark strong,
body.book-mode .book-cover-mark small {
  display: block;
  text-transform: uppercase;
  color: #351a08;
}

body.book-mode .book-cover-mark span {
  font-size: 13px;
  font-weight: 800;
}

body.book-mode .book-cover-mark strong {
  font-size: 26px;
  line-height: .95;
  text-shadow: 0 1px rgba(255, 246, 201, .85);
}

body.book-mode .book-cover-mark small {
  margin-top: 7px;
  color: #8b5f1e;
  font-weight: 900;
  letter-spacing: 0;
}

body.book-mode .book-owner {
  background: rgba(255, 248, 219, .38);
  border: 1px solid rgba(104, 59, 17, .32);
  border-radius: 4px;
  padding: 10px 12px;
}

body.book-mode .book-owner span,
body.book-mode .book-owner small {
  display: block;
}

body.book-mode .book-owner span {
  color: #2b1608;
  font-size: 18px;
  font-weight: 900;
}

body.book-mode .book-owner small {
  color: #765226;
  text-transform: uppercase;
  font-weight: 900;
}

body.book-mode .book-register {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 0 4px 0 0;
}

body.book-mode .book-register-group {
  display: grid;
  gap: 5px;
}

body.book-mode .book-register-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #744714;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

body.book-mode .book-register-heading span {
  height: 1px;
  flex: 1;
  background: rgba(113, 65, 17, .35);
}

body.book-mode .book-register button {
  min-height: 42px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  text-align: left;
  padding: 8px 11px;
  border: 1px solid rgba(105, 57, 14, .42);
  border-radius: 2px 10px 10px 2px;
  background:
    linear-gradient(90deg, #764311 0 5px, transparent 5px),
    linear-gradient(180deg, rgba(255, 248, 221, .78), rgba(206, 164, 85, .54));
  color: #2b1608;
  box-shadow: 0 2px 0 rgba(80, 42, 10, .22), inset 0 1px rgba(255, 255, 255, .45);
}

body.book-mode .book-register button.active {
  color: #fff4c9;
  background:
    linear-gradient(90deg, #d2a241 0 7px, transparent 7px),
    linear-gradient(180deg, #007554, #004b35);
  border-color: #003e2e;
  text-shadow: 0 1px #001d14;
}

body.book-mode .book-register .nav-icon {
  width: 26px;
  height: 26px;
}

body.book-mode .book-actions {
  display: grid;
  gap: 8px;
  border-top: 4px double rgba(103, 58, 16, .40);
  padding-top: 14px;
}

body.book-mode .book-actions button {
  min-height: 38px;
  border: 1px solid #70420f;
  border-radius: 3px;
  background: linear-gradient(180deg, #e9cb85, #b77b2e);
  color: #261105;
  font-weight: 900;
  box-shadow: inset 0 1px rgba(255, 255, 255, .42), 0 2px 0 rgba(54, 25, 6, .55);
}

body.book-mode .book-page-ribbon {
  position: absolute;
  right: 26px;
  top: -1px;
  min-width: 108px;
  padding: 14px 12px 18px;
  background: linear-gradient(180deg, #7b1911, #4d0c08);
  color: #ffe9a8;
  text-align: center;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 6px 10px rgba(51, 18, 5, .22);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
}

body.book-mode .book-page-header {
  padding: 3px 132px 14px 0;
  border-bottom: 4px double rgba(103, 58, 16, .36);
  text-align: center;
}

body.book-mode .book-page-header span,
body.book-mode .book-page-header small {
  display: block;
  color: #8f621f;
  text-transform: uppercase;
  font-weight: 900;
}

body.book-mode .book-page-header h1 {
  margin: 4px 0;
  color: #281306;
  font-size: clamp(28px, 3.2vw, 46px);
  line-height: 1;
  text-shadow: 0 2px rgba(255, 242, 197, .88);
}

body.book-mode .book-page-content {
  min-height: 0;
  overflow: auto;
  padding: 18px 4px 18px 0;
}

body.book-mode .book-page-content > .page,
body.book-mode .book-page-content > .dashboard-page,
body.book-mode .book-page-content > .kasse,
body.book-mode .book-page-content > .payroll-page,
body.book-mode .book-page-content > .deposits-page,
body.book-mode .book-page-content > .inventory-page {
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  color: #2b1608;
}

body.book-mode .book-page-content .dashboard-head,
body.book-mode .book-page-content .page-head,
body.book-mode .book-page-content .purchase-titlebar {
  border-color: rgba(92, 53, 18, .34);
  margin-bottom: 16px;
}

body.book-mode .book-page-content .dashboard-head h1,
body.book-mode .book-page-content .page-head h1,
body.book-mode .book-page-content .purchase-titlebar h1 {
  font-size: 26px;
}

body.book-mode .book-page-content .widget-grid,
body.book-mode .book-page-content .price-stats {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

body.book-mode .book-page-content .sales-layout,
body.book-mode .book-page-content .stock-layout,
body.book-mode .book-page-content .supplier-prices-layout {
  grid-template-columns: minmax(0, 1fr);
}

body.book-mode .book-page-content .product-grid {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

body.book-mode .book-page-footer {
  border-top: 1px solid rgba(103, 58, 16, .30);
  color: #8c6123;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 10px;
  font-style: italic;
}

@media (max-width: 1100px) {
  body.book-mode {
    overflow: auto;
  }

  body.book-mode .saloon-book {
    height: auto;
    min-height: calc(100vh - 28px);
    grid-template-columns: 1fr;
  }

  body.book-mode .book-spine {
    display: none;
  }

  body.book-mode .book-index-page,
  body.book-mode .book-work-page {
    border-radius: 10px;
    border: 3px solid #744211;
  }

  body.book-mode .book-index-page {
    grid-template-rows: auto auto auto auto;
  }

  body.book-mode .book-register {
    overflow: visible;
  }

  body.book-mode .book-work-page {
    min-height: 70vh;
    padding: 18px;
  }
}
