:root {
  --bg: #F7F7F6;
  --panel: #FFFFFF;
  --ink: #232A38;
  --ink-soft: #5B6472;
  --muted: #8B92A0;
  --line: #E3E6EA;
  --brand: #2C3A52;
  --brand-dark: #1B2233;
  --brand-light: #E8EAF0;
  --clay: #B65C38;
  --clay-light: #F6E7DF;
  --gold: #AD8A5C;
  --navy-2: #24304A;
  --navy-3: #3E5273;
  --shadow-color: 17,33,56;
  --success: #2F6B2F;
  --success-light: #DCEAD4;
  --warning: #8A5A20;
  --warning-light: #FCE9D6;
  --info: #2A5B8C;
  --info-light: #E3EEF9;
  --neutral: #6B6656;
  --neutral-light: #E5E0D3;
  --highlight: #8A6A20;
  --highlight-light: #EFE2C4;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: 'Manrope', sans-serif; color: var(--ink);
  background:
    radial-gradient(1100px 640px at -6% -12%, rgba(174,141,105,0.14), transparent 60%),
    radial-gradient(900px 560px at 108% -8%, rgba(31,64,102,0.09), transparent 55%),
    radial-gradient(1000px 700px at 50% 115%, rgba(185,142,61,0.07), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
.font-display { font-family: 'Fraunces', serif; }
.font-mono { font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; outline: none; }
table { border-collapse: collapse; width: 100%; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.input:focus-visible { outline: none; }

.skip-link {
  position: fixed; top: -48px; left: 12px; z-index: 200;
  background: var(--brand-dark); color: #fff; font-size: 13px; font-weight: 600;
  padding: 10px 16px; border-radius: 8px; transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

/* min-height:100vh then :100dvh - mobile browsers resize the vh unit as the
   address bar shows/hides while scrolling, which visibly stretches/jumps
   full-height layout on Android/iOS. dvh tracks the actual visible viewport
   instead; browsers that don't support it just keep the vh value above. */
.shell { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; overflow-x: hidden; }
@media (min-width: 640px) { .shell { flex-direction: row; } }

.sidebar {
  position: relative; overflow: hidden;
  background:
    radial-gradient(85% 55% at 100% 0%, rgba(185,142,61,0.16) 0%, transparent 60%),
    radial-gradient(130% 120% at 100% 0%, var(--navy-3) 0%, transparent 55%),
    linear-gradient(175deg, var(--brand-dark) 0%, var(--navy-2) 100%);
  padding: 18px 14px; display: flex; gap: 4px;
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.06);
}
.sidebar::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5; z-index: 0;
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 84px);
}
.sidebar::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; z-index: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
}
.sidebar > * { position: relative; z-index: 1; }
@media (min-width: 640px) { .sidebar { flex-direction: column; width: 232px; flex-shrink: 0; min-height: 100vh; min-height: 100dvh; padding: 32px 16px; } }

/* Mobile (<640px): the sidebar becomes an off-canvas drawer instead of a
   horizontal icon-only bar - a Owner account has 13 nav items, which never
   fit in one row on a phone in portrait (this is why landscape "worked"
   before: just enough extra width to squeeze them all in). */
.mobile-topbar { display: none; }
@media (max-width: 639.98px) {
  .mobile-topbar {
    display: flex; align-items: center; justify-content: space-between;
    background: linear-gradient(180deg, var(--navy-2) 0%, var(--brand-dark) 100%); padding: 12px 16px; position: sticky; top: 0; z-index: 40;
    border-bottom: 1px solid rgba(185,142,61,0.25);
  }
  .mobile-topbar-brand { display: flex; align-items: center; gap: 8px; }
  .mobile-topbar-brand img { width: 26px; height: auto; object-fit: contain; }
  .mobile-topbar-brand span { color: #fff; font-weight: 600; font-size: 14px; }
  .mobile-nav-toggle { color: #fff; padding: 8px; border-radius: 8px; display: inline-flex; transition: background .12s; }
  .mobile-nav-toggle:hover, .mobile-nav-toggle:active { background: rgba(255,255,255,0.12); }

  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; height: 100dvh; width: 268px; max-width: 82vw;
    flex-direction: column; overflow-y: auto; z-index: 60;
    transform: translateX(-100%); transition: transform .25s cubic-bezier(.2,.8,.2,1);
    box-shadow: 8px 0 32px rgba(var(--shadow-color),0.28);
  }
  .sidebar.sidebar-open { transform: translateX(0); }
  .sidebar .brand { display: flex; } /* full logo+name inside the open drawer, same as desktop */
  .sidebar .mobile-badge { display: none; } /* superseded by .mobile-topbar's own brand mark */
  .sidebar .navbtn span.label { display: inline; } /* full labels inside the drawer, same as desktop */
  /* Pre-existing bug, not new: .sidebar-user (name/role/Log out) was gated
     to >=640px only, meaning there was no way to log out on a phone at any
     screen size. Now shown inside the open drawer, same as desktop. */
  .sidebar .sidebar-user { display: flex; }
  .sidebar .sidebar-spacer { display: block; } /* so the user/logout block still sits pinned at the bottom of the drawer, not right after the last nav item */
  .sidebar .nav-group-label { display: block; }

  .sidebar-backdrop {
    display: none; position: fixed; inset: 0; background: rgba(14,27,46,0.55); backdrop-filter: blur(1px); z-index: 55;
    opacity: 0; transition: opacity .2s;
  }
  .sidebar-backdrop.visible { display: block; opacity: 1; }
}
.brand { display: none; align-items: center; gap: 10px; padding: 0 8px 20px; margin-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,0.1); }
@media (min-width: 640px) { .brand { display: flex; } }
.brand-badge-img { width: 32px; height: auto; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3)); }
.mobile-badge { display: block; }
@media (min-width: 640px) { .mobile-badge { display: none; } }
.mobile-badge-img { width: 30px; height: auto; object-fit: contain; align-self: center; margin-right: 4px; }
.brand-name { font-size: 16.5px; font-weight: 600; color: #fff; letter-spacing: -0.01em; }
.navbtn { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 500; color: rgba(255,255,255,0.62); transition: background .15s, color .15s, transform .15s; }
.navbtn:hover { background: rgba(255,255,255,0.07); color: #fff; transform: translateX(2px); }
.navbtn.active {
  background: linear-gradient(90deg, rgba(185,142,61,0.26), rgba(185,142,61,0.06));
  color: #fff; font-weight: 600;
  box-shadow: inset 2.5px 0 0 var(--gold), 0 4px 14px -6px rgba(185,142,61,0.5);
}
.navbtn span.label { display: none; }
@media (min-width: 640px) { .navbtn span.label { display: inline; } }
.nav-group-label { display: none; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: rgba(255,255,255,0.32); margin: 18px 0 6px; padding: 0 12px; }
.nav-group-label:first-of-type { margin-top: 4px; }
@media (min-width: 640px) { .nav-group-label { display: block; } }
.main { flex: 1; min-width: 0; padding: 22px 18px; max-width: 1080px; }
@media (min-width: 640px) { .main { padding: 48px 56px; } }
.sidebar-spacer { flex: 1; display: none; }
@media (min-width: 640px) { .sidebar-spacer { display: block; } }
.sidebar-user { display: none; flex-direction: column; gap: 10px; padding: 14px 12px 0; border-top: 1px solid rgba(255,255,255,0.12); margin-top: 8px; }
@media (min-width: 640px) { .sidebar-user { display: flex; } }
.sidebar-user-row { display: flex; align-items: center; gap: 10px; }
.sidebar-avatar {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-family: 'Fraunces', serif; font-size: 14px; font-weight: 600; color: var(--brand-dark);
  background: linear-gradient(155deg, var(--gold), #E0B563);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25), inset 0 1px 1px rgba(255,255,255,0.4);
}
.sidebar-user-name { font-size: 13px; font-weight: 600; color: #fff; margin: 0; }
.sidebar-user-role { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); margin: 2px 0 0; }

h2.page-title { font-family: 'Fraunces', serif; font-size: 40px; font-weight: 600; margin: 0; color: var(--ink); letter-spacing: -0.025em; text-wrap: balance; position: relative; padding-bottom: 14px; line-height: 1.08; }
@media (max-width: 639.98px) { h2.page-title { font-size: 30px; } }
h2.page-title::after {
  content: ''; position: absolute; left: 1px; bottom: 0; width: 38px; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), var(--brand));
}
.subtle { color: var(--muted); font-size: 13px; }
.eyebrow { display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin: 0 0 8px; }
.eyebrow::after { content: ''; flex: 1; max-width: 64px; height: 1px; background: linear-gradient(90deg, rgba(185,142,61,0.5), transparent); }

.main-content-inner { animation: contentFadeIn .28s cubic-bezier(.22,.9,.32,1); }
@keyframes contentFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.btn { font-size: 14px; font-weight: 600; padding: 10px 18px; border-radius: 11px; display: inline-flex; align-items: center; gap: 6px; transition: filter .15s, transform .1s, box-shadow .15s; }
.btn:hover { filter: brightness(1.05); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn-primary { background: linear-gradient(155deg, #C4A177, var(--brand) 55%); color: #fff; box-shadow: 0 4px 14px rgba(174,141,105,0.42), 0 1px 2px rgba(174,141,105,0.3); }
.btn-primary:hover { box-shadow: 0 6px 20px rgba(174,141,105,0.5), 0 1px 3px rgba(174,141,105,0.35); transform: translateY(-1px); }
.btn-secondary { background: var(--panel); color: var(--ink); border: 1px solid var(--line); }
.btn-secondary:hover { border-color: var(--muted); }
.btn-danger { background: var(--clay-light); color: var(--clay); }
.btn-danger:hover { filter: brightness(0.97); }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { padding: 6px; border-radius: 8px; display: inline-flex; transition: background .12s, transform .1s; }
.icon-btn:hover { background: rgba(42,42,34,0.06); }
.icon-btn:active { transform: scale(.92); }

.field-label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  font-size: 14px; padding: 10px 12px; border-radius: 10px; transition: box-shadow .15s, border-color .15s;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light); }
select.input {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%238C8672' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
  padding-right: 34px; cursor: pointer;
}
select.input:hover { border-color: var(--muted); }

.product-search-wrap { position: relative; }
.product-search-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 20;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 8px 24px -8px rgba(var(--shadow-color),0.3);
  max-height: 260px; overflow-y: auto; padding: 4px;
}
.product-search-item { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.product-search-item:hover, .product-search-item.active { background: var(--brand-light); }
.product-search-empty { padding: 12px; text-align: center; color: var(--muted); font-size: 13px; }

.card {
  background: var(--panel); border-radius: 22px; padding: 28px;
  box-shadow:
    0 0 0 1px rgba(var(--shadow-color),0.055),
    inset 0 1px 0 rgba(255,255,255,0.9),
    0 1px 2px rgba(var(--shadow-color),0.04),
    0 14px 32px -20px rgba(var(--shadow-color),0.22);
  transition: box-shadow .2s, transform .2s;
}
.card:hover {
  box-shadow:
    0 0 0 1px rgba(var(--shadow-color),0.07),
    inset 0 1px 0 rgba(255,255,255,0.9),
    0 1px 2px rgba(var(--shadow-color),0.05),
    0 22px 44px -22px rgba(var(--shadow-color),0.3);
}
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 640px) { .grid-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
/* Single column all the way up to 1280px (accounting for the 232px sidebar
   + 112px of .main's own padding eating into whatever's left) - a cramped
   2-column tier in between just wraps these long money values mid-digit.
   Better to let the cards breathe full-width than fight for a tight column. */
.grid-4 { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 1280px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } }

.stat-card {
  position: relative; overflow: hidden;
  background: var(--panel); border-radius: 22px; padding: 26px 24px 24px;
  box-shadow:
    0 0 0 1px rgba(var(--shadow-color),0.055),
    inset 0 1px 0 rgba(255,255,255,0.9),
    0 1px 2px rgba(var(--shadow-color),0.04),
    0 14px 32px -20px rgba(var(--shadow-color),0.2);
  display: flex; flex-direction: column; gap: 18px; transition: box-shadow .2s, transform .2s;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--brand) 60%, transparent);
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(var(--shadow-color),0.07),
    inset 0 1px 0 rgba(255,255,255,0.9),
    0 1px 2px rgba(var(--shadow-color),0.05),
    0 24px 44px -20px rgba(var(--shadow-color),0.3);
}
.stat-card-icon { width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background-image: linear-gradient(155deg, rgba(255,255,255,0.55), transparent 60%); background-blend-mode: overlay; box-shadow: inset 0 1px 1px rgba(255,255,255,0.5), 0 4px 12px -4px rgba(var(--shadow-color),0.3); }
.stat-card-label { font-size: 11.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .07em; margin: 0; }
.stat-card-value { font-family: 'Fraunces', serif; font-size: 25px; font-weight: 600; letter-spacing: -0.015em; margin: 0; overflow-wrap: break-word; line-height: 1.1; }
.stat-card-sub { font-size: 12px; color: var(--muted); margin: 0; }

/* Hero variant - the flagship KPI in a dashboard's bento row, spanning wider
   with real room for a big tabular number instead of fighting 4 equal
   columns for space (that fight is what caused the clipping bug earlier). */
.stat-card-hero .stat-card-value { font-size: 26px; }
.stat-card-hero .stat-card-icon { width: 54px; height: 54px; border-radius: 15px; }

/* Compact variant - a KPI row that just needs to be scanned at a glance
   (e.g. the dashboard), not a flagship number fighting for attention. */
.stat-card-compact { flex-direction: row; align-items: center; padding: 14px 16px; border-radius: 14px; gap: 12px; }
.stat-card-compact .stat-card-icon { width: 32px; height: 32px; border-radius: 9px; }
.stat-card-compact .stat-card-value { font-size: 17px; }
.stat-card-compact .stat-card-label { font-size: 10.5px; }
.stat-card-compact .stat-card-sub { font-size: 11px; }
/* grid-column:span N expands the grid to fit even when the template itself
   is single-column (Grid doesn't clamp an out-of-range span, it grows an
   implicit track) - so the span only applies at the one width where grid-4
   actually has 4 explicit columns for it to span within. */
@media (min-width: 1280px) { .stat-card-hero { grid-column: span 2; } .stat-card-hero .stat-card-value { font-size: 40px; } }

/* overflow-x:auto (not just hidden) so a wide table scrolls horizontally
   inside its own box on a narrow phone instead of forcing the whole page
   wider than the viewport - that's what was making the page "too big or
   too small" (the browser auto-zooms out to fit an overflowing table). */
.data-table { border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; overflow-y: hidden; box-shadow: 0 1px 2px rgba(var(--shadow-color),0.04); }
.data-table table { width: 100%; }
.data-table thead tr { background: linear-gradient(180deg, var(--brand-light), #EEE7D5); }
.data-table th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--brand-dark); padding: 11px 14px; border-bottom: 1px solid #E2D9C0; }
.data-table td { padding: 11px 14px; font-size: 14px; border-top: 1px solid var(--line); }
.data-table tbody tr:first-child td { border-top: none; }
.data-table tbody tr { transition: background .12s; }
.data-table tbody tr:hover { background: #FCFAF4; }

.list-row { transition: background .12s; border-radius: 10px; margin: 0 -10px; padding-left: 10px; padding-right: 10px; }
.list-row:hover { background: #FCFAF4; }

.badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .02em; padding: 4px 10px; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04); }

.overlay {
  position: fixed; inset: 0; background: rgba(14,27,46,0.46); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center;
  padding: 16px; z-index: 50; opacity: 0; animation: overlayFadeIn .16s ease forwards;
}
.modal {
  width: 100%; max-width: 480px; background: var(--panel); border-radius: 18px; padding: 26px; max-height: 85vh; overflow-y: auto;
  box-shadow: 0 24px 56px rgba(var(--shadow-color),0.24), 0 4px 14px rgba(var(--shadow-color),0.12);
  transform: translateY(10px) scale(.98); animation: modalPopIn .2s cubic-bezier(.22,.9,.32,1) .02s forwards;
}
@keyframes overlayFadeIn { to { opacity: 1; } }
@keyframes modalPopIn { to { transform: translateY(0) scale(1); } }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-title { font-family: 'Fraunces', serif; font-size: 20px; font-weight: 600; }

.empty { border: 1px dashed var(--line); border-radius: 18px; padding: 64px 20px; text-align: center; }
.empty p.title { font-size: 14px; font-weight: 600; margin: 8px 0 2px; }
.empty p.sub { font-size: 12px; color: var(--muted); margin: 0; }

.li-table input { border: none; background: transparent; width: 100%; font-size: 14px; padding: 6px; }
.li-table input:focus { background: var(--brand-light); border-radius: 6px; }

.sheet { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 40px; max-width: 720px; margin: 0 auto; }
@media (max-width: 639.98px) { .sheet { padding: 20px; } } /* 40px padding on each side ate ~21% of a phone's screen width */
.sheet .items-table th { border-bottom: 2px solid var(--brand-dark); text-transform: uppercase; letter-spacing: .04em; font-size: 11px; font-weight: 600; color: var(--brand-dark); text-align: left; padding-bottom: 8px; }
.sheet .items-table td { border-bottom: 1px solid var(--line); padding: 10px 0; font-size: 14px; }

/* ---------------- Auth: split brand/form screen ---------------- */
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--bg); }
.auth-split { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
@media (min-width: 900px) { .auth-split { flex-direction: row; } }
.auth-brand-panel {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(120% 140% at 100% 0%, var(--navy-3) 0%, transparent 55%),
    linear-gradient(165deg, var(--brand-dark) 0%, var(--navy-2) 100%);
  padding: 36px 24px;
}
@media (min-width: 900px) { .auth-brand-panel { width: 46%; padding: 56px; display: flex; align-items: center; } }
.auth-brand-panel::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 84px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.02) 0 1px, transparent 1px 84px);
}
.auth-brand-art { display: none; }
@media (min-width: 900px) {
  .auth-brand-art { display: block; position: absolute; right: -50px; bottom: -30px; width: 280px; opacity: 0.9; pointer-events: none; }
  .auth-brand-art img { width: 100%; height: auto; display: block; transition: opacity 0.35s ease; }
  .auth-brand-art img.brand-art-fade { opacity: 0; }
}
.auth-brand-inner { position: relative; max-width: 440px; margin: 0 auto; }
@media (min-width: 900px) { .auth-brand-inner { margin: 0; } }
.auth-brand-lockup { display: flex; align-items: center; gap: 10px; margin-bottom: 30px; }
.auth-brand-lockup img { width: 32px; height: auto; }
.auth-brand-lockup span { font-family: 'Fraunces', serif; font-size: 16.5px; font-weight: 600; }
.auth-brand-title {
  font-family: 'Fraunces', serif; font-weight: 600; font-size: 32px; line-height: 1.14; margin: 0 0 14px;
  letter-spacing: -0.01em; text-wrap: balance;
}
@media (min-width: 900px) { .auth-brand-title { font-size: 38px; } }
.auth-brand-sub { font-size: 14.5px; line-height: 1.6; color: rgba(255,255,255,0.72); margin: 0 0 8px; max-width: 40ch; }
.auth-rule {
  height: 1px; margin: 24px 0;
  background-image: repeating-linear-gradient(90deg, rgba(185,142,61,0.8) 0 6px, transparent 6px 14px);
  opacity: 0.55;
}
.auth-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 15px; }
.auth-points li { display: flex; gap: 13px; align-items: flex-start; }
.auth-points .pt-no {
  flex-shrink: 0; width: 25px; height: 25px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center; font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--gold);
}
.auth-points strong { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 1px; }
.auth-points p { margin: 0; font-size: 12.5px; color: rgba(255,255,255,0.6); line-height: 1.5; }
.auth-form-side { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 20px 56px; }
@media (min-width: 900px) { .auth-form-side { padding: 56px; } }

.auth-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 32px 28px; box-shadow: 0 1px 2px rgba(var(--shadow-color),0.04), 0 18px 40px -22px rgba(var(--shadow-color),0.18); }
.auth-logo { display: flex; justify-content: center; margin-bottom: 18px; }
.auth-title { font-family: 'Fraunces', serif; font-size: 23px; font-weight: 600; text-align: center; margin: 0 0 4px; letter-spacing: -0.01em; }
.auth-sub { font-size: 13px; color: var(--muted); text-align: center; margin: 0 0 24px; }
.auth-error { background: var(--clay-light); color: var(--clay); font-size: 13px; padding: 10px 12px; border-radius: 10px; margin-bottom: 16px; }
.auth-split .auth-card { text-align: left; box-shadow: none; border: 1px solid var(--line); }
.auth-split .auth-title, .auth-split .auth-sub { text-align: left; }
.auth-split .auth-logo { display: none; }

/* Loading state (replaces plain "Loading…" text) */
.loading-state { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--brand); animation: spin .7s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Toasts (replaces native alert()) */
.toast-host { position: fixed; top: 20px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.toast {
  display: flex; align-items: flex-start; gap: 10px; background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--toast-accent, var(--brand)); border-radius: 12px; padding: 12px 14px;
  box-shadow: 0 14px 32px rgba(var(--shadow-color),0.16), 0 2px 8px rgba(var(--shadow-color),0.07);
  opacity: 0; transform: translateX(24px); transition: opacity .22s ease, transform .22s ease;
}
.toast.toast-in { opacity: 1; transform: translateX(0); }
.toast-icon { flex-shrink: 0; margin-top: 1px; }
.toast-msg { font-size: 13px; line-height: 1.4; flex: 1; }
.toast-close { flex-shrink: 0; opacity: .55; padding: 2px; border-radius: 4px; transition: opacity .12s, background .12s; }
.toast-close:hover { opacity: 1; background: rgba(42,42,34,0.06); }

@media print {
  .no-print { display: none !important; }
  .sidebar { display: none !important; }
  body { background: #fff; }
  .sheet { border: none; padding: 0; max-width: 100%; }
}
