/* ==========================================================================
   Preschool ERP — components
   Class names map 1:1 to the future Blade components (x-ui.button → .btn …).
   Only tokens from tokens.css are used, so every brand reskins automatically.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font-sans); font-size: var(--fs-md); line-height: var(--lh-normal);
  color: var(--text); background: var(--canvas-grad) fixed; -webkit-font-smoothing: antialiased;
}
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
        stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 28px; height: 28px; }
:focus-visible { outline: none; box-shadow: var(--ring); }
/* Owner decision 2026-12-06: no focus outline/glow on form fields (text boxes, selects, table input cells).
   Buttons and links keep the ring above, which browsers show only for keyboard (Tab) focus. */
input:focus-visible, textarea:focus-visible, select:focus-visible, [contenteditable]:focus-visible { box-shadow: none; }

/* ---- Card ------------------------------------------------------------ */
.stack { align-content: start; }
.card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
        padding: var(--sp-6); }
.card-sheen { background: var(--surface-sheen); }
.card-header-grad { margin: calc(var(--sp-6) * -1) calc(var(--sp-6) * -1) var(--sp-5);
  padding: var(--sp-4) var(--sp-6); background: var(--brand-grad); color: var(--text-on-brand);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0; font-size: var(--fs-lg); font-weight: var(--fw-semibold);
  letter-spacing: .04em; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.card-title { margin: 0 0 var(--sp-4); font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
.card-grad { background: var(--brand-grad); color: var(--text-on-brand); }

/* ---- Buttons --------------------------------------------------------- */
.btn { --h: 42px; display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  height: var(--h); padding: 0 var(--sp-5); border: 0; border-radius: var(--radius-md); cursor: pointer;
  font: inherit; font-weight: var(--fw-semibold); font-size: var(--fs-md); letter-spacing: .02em;
  text-decoration: none; white-space: nowrap; transition: transform var(--dur) var(--ease),
  box-shadow var(--dur) var(--ease), filter var(--dur) var(--ease); }
.btn:hover { transform: translateY(-1px); filter: brightness(1.04); }
.btn:active { transform: translateY(0); filter: brightness(.97); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-sm { --h: 34px; padding: 0 var(--sp-4); font-size: var(--fs-sm); border-radius: var(--radius-sm); }
.btn-lg { --h: 52px; padding: 0 var(--sp-6); font-size: var(--fs-lg); }
.btn-pill { border-radius: var(--radius-pill); }
.btn-block { width: 100%; }
.btn-primary { background: var(--brand-grad); color: var(--text-on-brand);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--brand-primary) 35%, transparent), inset 0 1px 0 rgba(255,255,255,.25); }
.btn-accent { background: var(--brand-grad-accent); color: #fff;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--brand-accent) 35%, transparent), inset 0 1px 0 rgba(255,255,255,.3); }
.btn-fresh { background: var(--brand-grad-fresh); color: #fff;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--brand-secondary) 35%, transparent); text-shadow: 0 1px 1px rgba(0,0,0,.15); }
.btn-secondary { background: var(--surface-sheen); color: var(--text); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--border); }
.btn-ghost { background: transparent; color: var(--brand-primary-deep); }
.btn-ghost:hover { background: var(--brand-primary-soft); }
.btn-danger { background: var(--danger-grad); color: #fff; box-shadow: 0 4px 12px rgba(214, 69, 65, .3); }

/* Segment button: label on a light pill + gradient icon cap (ref. "Menu ≡", "Home ⌂") */
.btn-seg { display: inline-flex; align-items: stretch; height: 46px; padding: 0; border: 0; cursor: pointer;
  border-radius: var(--radius-md); overflow: hidden; background: var(--surface-sheen); color: var(--text);
  font: inherit; font-weight: var(--fw-medium); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--border);
  transition: transform var(--dur) var(--ease); }
.btn-seg:hover { transform: translateY(-1px); }
.btn-seg > span { display: flex; align-items: center; padding: 0 var(--sp-5); min-width: 110px; justify-content: center; }
.btn-seg > i { display: flex; align-items: center; justify-content: center; width: 52px; color: #fff; background: var(--brand-grad); }
.btn-seg.is-accent > i { background: var(--brand-grad-accent); }
.btn-seg.is-fresh > i { background: var(--brand-grad-fresh); }
.btn-seg.btn-pill { border-radius: var(--radius-pill); }
.btn-seg.btn-pill > i { width: 40px; height: 40px; margin: 3px; border-radius: 50%; align-self: center; }

/* Circular icon button (ref. heart / pin / download) */
.btn-icon { width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; background: var(--surface-sheen); color: var(--brand-primary);
  box-shadow: var(--shadow-md), inset 0 0 0 1px rgba(255,255,255,.8); transition: transform var(--dur) var(--ease); }
.btn-icon:hover { transform: translateY(-2px); }
.btn-icon.is-accent { color: var(--brand-accent); }
.btn-icon.is-fresh { color: var(--brand-secondary); }
.btn-icon-sm { width: 38px; height: 38px; }

/* Square gradient tile (ref. kit B app tiles) */
.tile { width: 76px; height: 76px; border-radius: var(--radius-lg); display: inline-flex; align-items: center;
  justify-content: center; color: #fff; background: var(--brand-grad); box-shadow: var(--shadow-md);
  border: 3px solid #fff; position: relative; overflow: hidden; }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(255,255,255,.28), transparent 45%); }
.tile.is-accent { background: var(--brand-grad-accent); }
.tile.is-fresh { background: var(--brand-grad-fresh); }
.tile .icon { width: 34px; height: 34px; }
.tile-label { display: grid; justify-items: center; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--text-muted); }

/* Step circles 1·2·3 */
.step { width: 48px; height: 48px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-num); font-weight: var(--fw-bold); font-size: var(--fs-xl); color: #fff;
  background: var(--brand-grad); border: 3px solid #fff; box-shadow: var(--shadow-md); }
.step.is-done { background: var(--brand-grad-fresh); }
.step.is-todo { background: var(--surface-sunken); color: var(--text-subtle); }
.step-line { flex: 1; height: 3px; border-radius: 2px; background: var(--border); min-width: 24px; }
.step-line.is-done { background: var(--brand-grad-fresh); }

/* ---- Form controls --------------------------------------------------- */
.field { display: grid; gap: 6px; }
.label { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-muted); }
.label .req { color: var(--danger); margin-left: 2px; }
.help { font-size: var(--fs-xs); color: var(--text-subtle); }
.error-text { font-size: var(--fs-xs); color: var(--danger); }
.input-wrap { position: relative; display: flex; align-items: center; height: 46px; background: var(--surface);
  border-radius: var(--radius-md); box-shadow: var(--shadow-inset), inset 0 0 0 1px var(--border);
  transition: box-shadow var(--dur) var(--ease); }
.input-wrap.is-invalid { box-shadow: inset 0 0 0 2px var(--danger); }
.input-wrap > .icon { margin-left: var(--sp-4); color: var(--text-subtle); }
.input { flex: 1; min-width: 0; height: 100%; padding: 0 var(--sp-4); border: 0; background: transparent;
  font: inherit; color: var(--text); outline: none; }
.input::placeholder { color: var(--text-subtle); }
.input-wrap .addon { padding: 0 var(--sp-4); color: var(--text-muted); font-size: var(--fs-sm); }
textarea.input { padding: var(--sp-3) var(--sp-4); height: auto; min-height: 96px; resize: vertical; }
.input-wrap.is-textarea { height: auto; }
.search { height: 52px; border-radius: var(--radius-pill); background: var(--surface-sheen); box-shadow: var(--shadow-md); }
.search > .search-btn { margin: 4px; width: 44px; height: 44px; border-radius: 50%; border: 0; color: #fff;
  background: var(--brand-grad); display: flex; align-items: center; justify-content: center; cursor: pointer; }
select.input { appearance: none; cursor: pointer; padding-right: 40px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b7587' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 16px center; }

/* checkbox / radio / switch */
.check { display: inline-flex; align-items: center; gap: var(--sp-2); cursor: pointer; user-select: none; }
.check input { appearance: none; margin: 0; width: 22px; height: 22px; border-radius: 7px; background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--border-strong); display: grid; place-items: center; cursor: pointer;
  transition: background var(--dur) var(--ease); }
.check input[type="radio"] { border-radius: 50%; }
.check input:checked { background: var(--brand-grad-accent); box-shadow: none; }
.check input[type="checkbox"]:checked::after { content: ""; width: 10px; height: 6px; border: 2.5px solid #fff;
  border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.check input[type="radio"]:checked::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.switch { position: relative; display: inline-flex; align-items: center; gap: var(--sp-3); cursor: pointer; }
.switch input { appearance: none; margin: 0; width: 46px; height: 26px; border-radius: 13px; background: var(--border-strong);
  position: relative; cursor: pointer; transition: background var(--dur) var(--ease); }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-sm); transition: transform var(--dur) var(--ease); }
.switch input:checked { background: var(--brand-grad-fresh); }
.switch input:checked::after { transform: translateX(20px); }

/* range slider (ref. kit B gradient sliders) */
.range { appearance: none; width: 100%; height: 8px; border-radius: 4px; outline: none;
  background: linear-gradient(90deg, var(--brand-primary-deep), var(--brand-secondary)) 0 / var(--val, 60%) 100% no-repeat, var(--border); }
.range.is-accent { background: linear-gradient(90deg, var(--brand-accent-deep), var(--brand-accent)) 0 / var(--val, 60%) 100% no-repeat, var(--border); }
.range::-webkit-slider-thumb { appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: var(--shadow-md), inset 0 0 0 1px var(--border); cursor: pointer; }
.range::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50%; background: #fff; box-shadow: var(--shadow-md); }

/* ---- Badges / status pills ------------------------------------------ */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--radius-pill);
  font-size: var(--fs-xs); font-weight: var(--fw-semibold); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.no-dot::before { display: none; }
.badge-success { color: var(--success); background: var(--success-soft); }
.badge-warning { color: var(--warning); background: var(--warning-soft); }
.badge-danger  { color: var(--danger);  background: var(--danger-soft); }
.badge-info    { color: var(--info);    background: var(--info-soft); }
.badge-subsidy { color: var(--subsidy); background: var(--subsidy-soft); }
.badge-neutral { color: var(--text-muted); background: var(--surface-sunken); }
.badge-brand   { color: var(--brand-primary-deep); background: var(--brand-primary-soft); }
.badge-solid   { color: #fff; background: var(--brand-grad-accent); }
.badge-solid::before { background: #fff; }

/* ---- Progress ring (ref. 78% / 68% / 52%) ---------------------------- */
.ring { --size: 120px; --stroke: 12; position: relative; width: var(--size); height: var(--size);
  border-radius: 50%; background: var(--surface-sheen); box-shadow: var(--shadow-md); }
.ring svg { position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); transform: rotate(-90deg); }
.ring .track { fill: none; stroke: var(--surface-sunken); stroke-width: var(--stroke); }
.ring .bar { fill: none; stroke-width: var(--stroke); stroke-linecap: round; transition: stroke-dashoffset .6s var(--ease); }
.ring .center { position: absolute; inset: 24%; border-radius: 50%; background: var(--surface);
  box-shadow: 0 3px 10px rgba(31,45,70,.12); display: grid; place-content: center; text-align: center; }
.ring .value { font-family: var(--font-num); font-size: calc(var(--size) * .2); font-weight: var(--fw-medium); line-height: 1;
  background: var(--ring-grad, var(--brand-grad)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ring .caption { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }
.ring-lg { --size: 168px; --stroke: 14; }

.progress { height: 10px; border-radius: 5px; background: var(--surface-sunken); box-shadow: var(--shadow-inset); overflow: hidden; }
.progress > i { display: block; height: 100%; width: var(--val, 50%); border-radius: inherit; background: var(--brand-grad); }
.progress.is-accent > i { background: var(--brand-grad-accent); }
.progress.is-fresh > i { background: var(--brand-grad-fresh); }

/* ---- KPI stat -------------------------------------------------------- */
.stat { display: flex; gap: var(--sp-4); align-items: center; }
.stat .tile { width: 56px; height: 56px; border-width: 0; border-radius: var(--radius-md); }
.stat .tile .icon { width: 26px; height: 26px; }
.stat-label { font-size: var(--fs-sm); color: var(--text-muted); }
.stat-value { font-family: var(--font-num); font-size: var(--fs-3xl); font-weight: var(--fw-semibold); line-height: 1.1; }
.stat-value small { font-size: var(--fs-md); color: var(--text-muted); font-weight: var(--fw-medium); margin-left: 4px; }
.delta { font-size: var(--fs-xs); font-weight: var(--fw-semibold); }
.delta.up { color: var(--success); } .delta.down { color: var(--danger); }

/* ---- Lists ----------------------------------------------------------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) 0; border-bottom: 1px solid var(--border); }
.list > li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.check-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: var(--brand-grad-accent); box-shadow: 0 2px 6px color-mix(in srgb, var(--brand-accent) 40%, transparent); flex: none; }
.check-dot.is-empty { background: var(--surface-sunken); box-shadow: inset 0 0 0 2px var(--border); }

/* ---- Avatar ---------------------------------------------------------- */
.avatar { --s: 44px; width: var(--s); height: var(--s); border-radius: 50%; flex: none; display: grid; place-items: center;
  font-weight: var(--fw-semibold); color: #fff; background: var(--brand-grad); font-size: calc(var(--s) * .38);
  border: 3px solid #fff; box-shadow: var(--shadow-sm); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { --s: 88px; }
.avatar.is-accent { background: var(--brand-grad-accent); }
.avatar.is-fresh { background: var(--brand-grad-fresh); }

/* ---- Table ----------------------------------------------------------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-md); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th { text-align: left; font-weight: var(--fw-semibold); color: var(--text-muted); background: var(--surface-sunken);
  padding: var(--sp-3) var(--sp-4); white-space: nowrap; font-size: var(--fs-xs); letter-spacing: .04em; }
.table td { padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:hover { background: color-mix(in srgb, var(--brand-primary-soft) 55%, transparent); }
.table .num, .table .r { text-align: right; }
.table-toolbar { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; padding: var(--sp-4); }
.pager { display: flex; gap: var(--sp-1); align-items: center; }
.pager a { min-width: 34px; height: 34px; border-radius: var(--radius-sm); display: grid; place-items: center;
  color: var(--text-muted); text-decoration: none; font-family: var(--font-num); }
.pager a:hover { background: var(--surface-sunken); }
.pager a.is-active { background: var(--brand-grad); color: #fff; }

/* ---- Tabs ------------------------------------------------------------ */
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-sunken); border-radius: var(--radius-pill); box-shadow: var(--shadow-inset); }
.tabs button { border: 0; background: transparent; font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-medium);
  color: var(--text-muted); padding: 8px 18px; border-radius: var(--radius-pill); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--brand-primary-deep); box-shadow: var(--shadow-sm); }

/* ---- Alerts & toasts ------------------------------------------------- */
.alert { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-4); border-radius: var(--radius-md);
  font-size: var(--fs-sm); border-left: 4px solid currentColor; }
.alert strong { display: block; color: var(--text); margin-bottom: 2px; }
.alert p { margin: 0; color: var(--text-muted); }
.alert-info { color: var(--info); background: var(--info-soft); }
.alert-success { color: var(--success); background: var(--success-soft); }
.alert-warning { color: var(--warning); background: var(--warning-soft); }
.alert-danger { color: var(--danger); background: var(--danger-soft); }
.toast { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); min-width: 300px;
  background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); font-size: var(--fs-sm); }
.toast .tile { width: 36px; height: 36px; border-width: 0; border-radius: 10px; }
.toast .tile .icon { width: 18px; height: 18px; }

/* ---- Modal ----------------------------------------------------------- */
.modal { width: min(440px, 100%); background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-head { padding: var(--sp-5) var(--sp-6); background: var(--brand-grad); color: #fff; font-weight: var(--fw-semibold); font-size: var(--fs-lg); }
.modal-body { padding: var(--sp-6); color: var(--text-muted); }
.modal-foot { display: flex; justify-content: flex-end; gap: var(--sp-3); padding: var(--sp-4) var(--sp-6); background: var(--surface-sunken); }

/* ---- Calendar (ref. MARCH / JUNE) ------------------------------------ */
.cal { width: 100%; max-width: 380px; }
.cal-head { display: flex; align-items: center; gap: var(--sp-2); background: var(--surface-sunken); border-radius: var(--radius-md); }
.cal-head .btn-nav { width: 52px; height: 48px; border: 0; border-radius: var(--radius-md); background: var(--brand-grad);
  color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-sm); }
.cal-title { flex: 1; text-align: center; font-weight: var(--fw-bold); font-size: var(--fs-xl); color: var(--brand-primary-deep); letter-spacing: .04em; }
.cal-title small { display: block; font-size: var(--fs-xs); color: var(--text-muted); font-weight: var(--fw-medium); letter-spacing: 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: var(--sp-4); text-align: center; }
.cal-grid .dow { font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--text-muted); padding-bottom: var(--sp-2); }
.cal-grid .d { font-family: var(--font-num); height: 38px; display: grid; place-items: center; border-radius: 50%; cursor: pointer; color: var(--text); position: relative; }
.cal-grid .d:hover { background: var(--brand-primary-soft); }
.cal-grid .d.is-weekend { color: var(--danger); opacity: .8; }
.cal-grid .d.is-today { box-shadow: inset 0 0 0 2px var(--brand-primary); }
.cal-grid .d.is-selected { background: var(--brand-grad); color: #fff; opacity: 1; }
.cal-grid .d.is-holiday::after { content: ""; position: absolute; bottom: 4px; width: 5px; height: 5px; border-radius: 50%; background: var(--brand-accent); }
.cal-grid .d.is-muted { color: var(--text-subtle); }

/* time chip (ref. clock | 8:00 AM) */
.time-chip { display: inline-flex; align-items: stretch; height: 60px; border-radius: var(--radius-md); overflow: hidden;
  background: var(--surface-sheen); box-shadow: var(--shadow-md); }
.time-chip > i { width: 64px; display: grid; place-items: center; background: var(--brand-grad-accent); color: #fff; }
.time-chip > span { display: flex; align-items: center; padding: 0 var(--sp-6); font-family: var(--font-num); font-size: var(--fs-2xl); color: var(--text-muted); }

/* ---- Timeline -------------------------------------------------------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline li { position: relative; padding: 0 0 var(--sp-5) 36px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 4px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--brand-grad); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border); }
.timeline li.is-accent::before { background: var(--brand-grad-accent); }
.timeline li.is-fresh::before { background: var(--brand-grad-fresh); }
.timeline time { font-family: var(--font-num); font-size: var(--fs-xs); color: var(--text-subtle); }

/* ---- Empty state & skeleton ----------------------------------------- */
.empty { text-align: center; padding: var(--sp-10) var(--sp-6); color: var(--text-muted); }
.empty .tile { margin-bottom: var(--sp-4); }
.skeleton { border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--surface-sunken) 25%, #fff 50%, var(--surface-sunken) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---- App shell ------------------------------------------------------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 640px; border-radius: var(--radius-xl); overflow: hidden;
  background: var(--canvas); box-shadow: var(--shadow-lg); }
.sidebar { background: var(--surface); padding: var(--sp-5) var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-1); border-right: 1px solid var(--border); }
.sidebar .logo { min-height: 56px; display: flex; align-items: center; padding: 0 var(--sp-2) var(--sp-4); margin-bottom: var(--sp-2); border-bottom: 1px solid var(--border); }
.sidebar .logo img { max-height: 64px; max-width: 100%; }
.nav-group { font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--text-subtle); letter-spacing: .08em; padding: var(--sp-4) var(--sp-3) var(--sp-1); }
.nav-item { display: flex; align-items: center; gap: var(--sp-3); padding: 10px var(--sp-3); border-radius: var(--radius-md);
  color: var(--text-muted); text-decoration: none; font-weight: var(--fw-medium); font-size: var(--fs-md); }
.nav-item:hover { background: var(--surface-sunken); color: var(--text); }
.nav-item.is-active { background: var(--brand-grad); color: #fff; box-shadow: 0 4px 12px color-mix(in srgb, var(--brand-primary) 30%, transparent); }
.nav-item .count { margin-left: auto; font-size: var(--fs-xs); background: var(--brand-grad-accent); color: #fff; border-radius: var(--radius-pill); padding: 0 8px; line-height: 20px; }
.nav-item.is-active .count { background: rgba(255,255,255,.25); }
.topbar { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-4) var(--sp-6); background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar .grow { flex: 1; }
.main { padding: var(--sp-6); display: grid; gap: var(--sp-5); align-content: start; }
.page-title { margin: 0; font-size: var(--fs-2xl); font-weight: var(--fw-semibold); }
.crumbs { font-size: var(--fs-xs); color: var(--text-subtle); }

/* ---- Logo fallback (brand without artwork yet) ----------------------- */
.wordmark { display: inline-flex; flex-direction: column; line-height: 1.1; }
.wordmark b { font-size: var(--fs-xl); background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wordmark span { font-size: var(--fs-xs); letter-spacing: .12em; color: var(--brand-primary); text-transform: uppercase; }

/* ---- Print document (receipt / notice), A4 portrait ------------------ */
.doc { background: #fff; color: #111; border-radius: var(--radius-sm); box-shadow: var(--shadow-md); padding: 28px 32px; font-size: 13px; }
.doc-head { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding-bottom: 12px; border-bottom: 3px solid var(--brand-primary-deep); }
.doc-head img { height: 54px; }
.doc-head h3 { margin: 0; font-size: 18px; letter-spacing: .3em; text-align: center; }
.doc-legal { font-size: 11px; color: #444; line-height: 1.6; }
.doc table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.doc th, .doc td { border: 1px solid #999; padding: 6px 8px; }
.doc th { background: #f2f2f2; font-weight: 600; }
.doc .seal { width: 70px; height: 70px; border: 2px solid #c8102e; color: #c8102e; border-radius: 4px; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; writing-mode: vertical-rl; letter-spacing: .2em; opacity: .85; }
@media print { body { background: #fff; } .doc { box-shadow: none; } }
