:root {
  color-scheme: light;
  --ink: #17221d;
  --muted: #65736c;
  --paper: #f5f0e6;
  --card: #fffdf8;
  --green: #176b4b;
  --green-2: #0f5038;
  --lime: #d8ef9f;
  --rust: #be5d38;
  --gold: #e3b44f;
  --line: #d8d3c7;
  --shadow: 0 16px 48px rgba(34, 43, 37, .12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--green); }
.center-card { width: min(560px, calc(100% - 32px)); margin: 8vh auto; padding: 32px; background: var(--card); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; background: var(--green); color: white; border-radius: 15px 15px 15px 4px; font-size: 22px; }
.brand h1, .brand h2 { margin: 0; font-family: Georgia, serif; letter-spacing: -.03em; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.auth h2 { margin: 28px 0 4px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.eyebrow { margin: 0 0 8px; color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
label { display: grid; gap: 6px; color: #39473f; font-size: 12px; font-weight: 700; }
input, select, textarea { width: 100%; padding: 11px 12px; border: 1px solid #c9c5bb; border-radius: 10px; background: white; color: var(--ink); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23, 107, 75, .13); }
textarea { min-height: 90px; resize: vertical; }
.button, button.primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 11px; padding: 11px 15px; background: var(--green); color: white; font-weight: 800; text-decoration: none; }
button.secondary { border: 1px solid var(--line); border-radius: 10px; padding: 10px 13px; background: white; color: var(--ink); font-weight: 750; }
button.danger { border: 1px solid #dfb5aa; background: #fff6f2; color: #8f321c; }
button:disabled { opacity: .45; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin-top: 16px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 16px; background: #13281f; color: #f7f3e9; }
.sidebar .brand p { color: #acc4b7; }
.sidebar nav { display: grid; gap: 6px; margin-top: 28px; }
.sidebar nav button { display: flex; gap: 10px; align-items: center; width: 100%; padding: 11px 12px; border: 0; border-radius: 10px; background: transparent; color: #d7e4dd; text-align: left; }
.sidebar nav button:hover, .sidebar nav button.active { background: #285540; color: white; }
.sidebar footer { position: absolute; bottom: 18px; left: 18px; right: 18px; color: #99b1a4; font-size: 12px; }
.main { min-width: 0; padding: 28px clamp(18px, 3.5vw, 48px) 60px; }
.topbar { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 24px; }
.topbar h2 { margin: 0; font-family: Georgia, serif; font-size: 30px; }
.panel { padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 8px 24px rgba(44, 51, 47, .06); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.metric { padding: 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.metric strong { display: block; font-family: Georgia, serif; font-size: 30px; }
.metric span { color: var(--muted); font-size: 12px; font-weight: 700; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input { max-width: 440px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; border-bottom: 1px solid #e6e1d6; text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
tbody tr:hover { background: #f8f4ea; }
.book-title { font-weight: 800; }
.copy-id { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.badge { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 99px; background: #e4eee8; color: var(--green-2); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.badge.warn { background: #fff0cf; color: #875b00; }
.badge.error { background: #fae1da; color: #8d331d; }
.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, .8fr); gap: 18px; }
.drawer { position: sticky; top: 20px; align-self: start; }
.channel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.channel-card { padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; }
.channel-card header { display: flex; justify-content: space-between; gap: 12px; align-items: start; margin-bottom: 12px; }
.channel-card h3 { margin: 0; }
.callout { padding: 13px 14px; border-left: 4px solid var(--gold); border-radius: 8px; background: #fff8e6; font-size: 13px; }
.callout.green { border-color: var(--green); background: #edf7f1; }
.check-row { display: flex; flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #faf7ef; }
.check-row input { width: auto; }
.pricing-card { margin-top: 10px; padding: 12px; border: 1px solid #b8d7c7; border-radius: 12px; background: #edf7f1; font-size: 12px; }
.pricing-card.review { border-color: #e3b44f; background: #fff8e6; }
.pricing-card p { margin: 7px 0; }
.pricing-card table { margin-top: 8px; background: rgba(255,255,255,.55); }
.token-box { padding: 14px; overflow-wrap: anywhere; border-radius: 10px; background: #13281f; color: #e3f4e9; font-family: ui-monospace, monospace; }
.empty { padding: 40px 20px; color: var(--muted); text-align: center; }
#toast { position: fixed; right: 20px; bottom: 20px; z-index: 20; max-width: 420px; padding: 12px 16px; border-radius: 12px; background: #12281f; color: white; opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s; box-shadow: var(--shadow); }
#toast.show { opacity: 1; transform: none; }
#toast.error { background: #8c3523; }
.kiosk-page { min-height: 100vh; padding: 28px; background: linear-gradient(145deg, #f5f0e6, #e9e1d2); }
.kiosk-shell { width: min(1150px, 100%); margin: auto; }
.kiosk-search { position: sticky; top: 14px; z-index: 2; display: flex; gap: 10px; padding: 14px; margin: 20px 0; border-radius: 18px; background: rgba(255, 253, 248, .94); box-shadow: var(--shadow); backdrop-filter: blur(15px); }
.kiosk-search input { font-size: 20px; padding: 15px; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.book-card { min-height: 188px; display: grid; grid-template-columns: 76px 1fr; gap: 13px; padding: 16px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.book-cover { width: 76px; height: 112px; object-fit: cover; border-radius: 7px; background: #dbe4dd; }
.book-cover.placeholder { display: grid; place-items: center; color: var(--green); font-size: 30px; }
.location { margin-top: 9px; color: var(--green); font-weight: 800; }
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 14px; }
  .sidebar .brand p, .sidebar footer { display: none; }
  .sidebar nav { display: flex; overflow-x: auto; margin-top: 12px; }
  .sidebar nav button { width: auto; white-space: nowrap; }
  .split, .channel-grid { grid-template-columns: 1fr; }
  .drawer { position: static; }
}
@media (max-width: 620px) {
  .form-grid, .metrics { grid-template-columns: 1fr 1fr; }
  .main { padding: 18px 12px 50px; }
  .topbar { align-items: start; }
  .topbar h2 { font-size: 25px; }
  .channel-grid { gap: 10px; }
  .kiosk-page { padding: 14px; }
}
