/* Kashi — reference kit (Tastefolio). Persian heritage: symmetric compositions on a central axis, pointed arches,
   girih star patterns (CSS masks, recolorable), tile friezes, double gilded frames with corner stars, cartouche labels,
   glazed buttons and a lajevard sidebar. Requires tokens.css. RTL-first. */

:root {
  /* ornaments as masks so they take any token color */
  --star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M14.6 14.6H85.4V85.4H14.6Z M50 0L100 50L50 100L0 50Z'/%3E%3C/svg%3E");
  --girih: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cg fill='none' stroke='%23000' stroke-width='1.1'%3E%3Cpath d='M5.86 5.86H34.14V34.14H5.86Z'/%3E%3Cpath d='M20 0L40 20L20 40L0 20Z'/%3E%3Ccircle cx='20' cy='20' r='4.5'/%3E%3Cpath d='M0 0L5.86 5.86M40 0L34.14 5.86M0 40L5.86 34.14M40 40L34.14 34.14'/%3E%3C/g%3E%3C/svg%3E");
  --girih-fill: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cpath d='M7.5 7.5H32.5V32.5H7.5Z M20 2.3L37.7 20L20 37.7L2.3 20Z'/%3E%3C/svg%3E");
  --arch: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 100V40C0 19 25 7 50 0C75 7 100 19 100 40V100Z'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: var(--fw-regular) var(--fs-md)/var(--lh-body) var(--font-sans); -webkit-font-smoothing: antialiased; overflow-x: clip; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
::selection { background: var(--saffron); color: #1b1d33; }
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }
.sr-only { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; inset-inline-start: 12px; inset-block-start: -60px; z-index: 100; background: var(--lajevard); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm); }
.skip-link:focus { inset-block-start: 12px; }
.ltr { direction: ltr; unicode-bidi: isolate; }

/* ------------------------------------------------------------ layout */
.container { max-inline-size: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); align-content: start; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.center { text-align: center; justify-items: center; justify-content: center; }
.cols { display: grid; gap: var(--space-6); grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); }
.cols > * { min-inline-size: 0; }
@media (max-width: 960px) { .cols { --n: 2 !important; } }
@media (max-width: 620px) { .cols { --n: 1 !important; } .hide-sm { display: none !important; } }
.section { padding-block: var(--space-9); }
.section-head { display: grid; justify-items: center; text-align: center; gap: var(--space-3); margin-block-end: var(--space-7); }
.section-head p { max-inline-size: 56ch; color: var(--ink-2); }

/* ------------------------------------------------------------ type */
.display { font: var(--fw-display) var(--fs-display)/var(--lh-tight) var(--font-display); letter-spacing: var(--tracking-display); color: var(--lajevard); text-wrap: balance; }
.h1 { font: 600 clamp(34px, 4.4vw, 58px)/1.08 var(--font-display); color: var(--lajevard); text-wrap: balance; }
.h2 { font: 600 clamp(26px, 2.8vw, 36px)/1.15 var(--font-display); color: var(--lajevard); }
.h3 { font: 700 var(--fs-lg)/1.3 var(--font-sans); }
:lang(fa) .display, :lang(fa) .h1, :lang(fa) .h2 { line-height: var(--lh-tight); letter-spacing: 0; }
:lang(fa) .display { font-weight: 300; }
:lang(fa) .h1, :lang(fa) .h2 { font-weight: 600; }
:lang(fa) .h1 { font-size: clamp(30px, 3.8vw, 48px); }
:lang(fa) .h2 { font-size: clamp(22px, 2.2vw, 28px); line-height: 1.6; }
.em { font-style: italic; color: var(--brand); }
:lang(fa) .em { font-style: normal; }
.eyebrow { font: 700 var(--fs-xs)/1.4 var(--font-sans); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--gilt); }
:lang(fa) .eyebrow { font-size: var(--fs-sm); text-transform: none; }
.lead { font-size: var(--fs-lg); color: var(--ink-2); max-inline-size: 52ch; }
.muted { color: var(--ink-2); }
.subtle { color: var(--ink-3); }
.small { font-size: var(--fs-sm); }
.num { font-variant-numeric: lining-nums tabular-nums; }
.verse { font: 300 clamp(21px, 2.2vw, 28px)/1.9 var(--font-verse); color: var(--lajevard); }
:root:not(:lang(fa)) .verse { font: italic 500 clamp(22px, 2.4vw, 30px)/1.4 var(--font-display); }

/* ------------------------------------------------------------ ornaments */
.star { display: inline-block; inline-size: 1em; block-size: 1em; background: currentColor; -webkit-mask: var(--star) center / contain no-repeat; mask: var(--star) center / contain no-repeat; flex: none; }
.ornament { display: flex; align-items: center; justify-content: center; gap: 14px; color: var(--gilt); }
.ornament::before, .ornament::after { content: ""; flex: 0 1 110px; block-size: 1px; background: linear-gradient(90deg, transparent, currentColor); }
.ornament::after { transform: scaleX(-1); }
.ornament .star { font-size: 16px; color: var(--saffron); }
.cartouche { display: inline-flex; align-items: center; gap: 8px; padding: 4px 22px; background: var(--lajevard); color: #fbf7ee; font: 700 var(--fs-xs)/1.5 var(--font-sans); letter-spacing: var(--tracking-caps); text-transform: uppercase; clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 12px 100%, 0 50%); white-space: nowrap; }
:lang(fa) .cartouche { font-size: var(--fs-sm); text-transform: none; letter-spacing: 0; }
.cartouche.glaze { background: var(--brand); color: var(--brand-ink); }
.cartouche.saffron { background: var(--saffron); color: #2a1d05; }
[data-theme="dark"] .cartouche:not(.glaze):not(.saffron) { background: var(--surface-3); color: var(--ink); }
/* girih pattern layer: put .girih on any positioned element (decoration only) */
.girih { position: absolute; inset: 0; pointer-events: none; background: var(--pattern); opacity: var(--pattern-o, .12); -webkit-mask: var(--girih) 0 0 / var(--tile, 40px) repeat; mask: var(--girih) 0 0 / var(--tile, 40px) repeat; }
/* tile frieze band between sections */
.frieze { position: relative; block-size: 38px; background: var(--surface-ink); box-shadow: inset 0 3px 0 var(--surface-ink), inset 0 4px 0 var(--gilt), inset 0 -3px 0 var(--surface-ink), inset 0 -4px 0 var(--gilt); }
.frieze::before { content: ""; position: absolute; inset: 7px 0; background: var(--brand); -webkit-mask: var(--girih-fill) center / 24px 24px repeat-x; mask: var(--girih-fill) center / 24px 24px repeat-x; }
/* pointed arch */
.arch { -webkit-mask: var(--arch) center / 100% 100% no-repeat; mask: var(--arch) center / 100% 100% no-repeat; overflow: hidden; }
.arch-frame { position: relative; padding: 7px; background: linear-gradient(var(--gilt), var(--saffron)); -webkit-mask: var(--arch) center / 100% 100% no-repeat; mask: var(--arch) center / 100% 100% no-repeat; }
.arch-frame > .arch { inline-size: 100%; block-size: 100%; }
/* framed panel: double gilded rule + saffron corner stars */
.framed { position: relative; background: var(--surface); border: 1px solid var(--line-2); box-shadow: inset 0 0 0 5px var(--surface), inset 0 0 0 6px var(--line); border-radius: 2px; padding: var(--space-6); }
.framed::before { content: ""; position: absolute; inset: 2px; pointer-events: none; background: var(--saffron);
  -webkit-mask: var(--star) 0 0 / 14px 14px no-repeat, var(--star) 100% 0 / 14px 14px no-repeat, var(--star) 0 100% / 14px 14px no-repeat, var(--star) 100% 100% / 14px 14px no-repeat;
  mask: var(--star) 0 0 / 14px 14px no-repeat, var(--star) 100% 0 / 14px 14px no-repeat, var(--star) 0 100% / 14px 14px no-repeat, var(--star) 100% 100% / 14px 14px no-repeat; }
.framed > .cartouche:first-child { position: absolute; inset-block-start: 0; left: 50%; transform: translate(-50%, -50%); }
.framed.tight { padding: var(--space-5); }

/* ------------------------------------------------------------ header (symmetric: nav | emblem | nav) */
.site-head { position: sticky; inset-block-start: 0; z-index: 40; background: color-mix(in oklab, var(--canvas) 92%, transparent); backdrop-filter: blur(8px); border-block-end: 1px solid var(--line); }
.site-head .container { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: var(--space-5); min-block-size: 76px; }
.nav { display: flex; gap: var(--space-5); align-items: center; font-weight: 600; font-size: var(--fs-sm); }
.nav.a { justify-content: flex-end; }
.nav a { color: var(--ink-2); padding-block: 6px; position: relative; white-space: nowrap; }
.nav a:hover { color: var(--lajevard); }
.nav a[aria-current] { color: var(--lajevard); }
.nav a[aria-current]::after { content: ""; position: absolute; left: 50%; inset-block-end: -4px; inline-size: 6px; block-size: 6px; background: var(--saffron); transform: translateX(-50%) rotate(45deg); }
.emblem { display: grid; justify-items: center; gap: 2px; color: var(--lajevard); text-align: center; }
.emblem .mark { position: relative; inline-size: 34px; block-size: 34px; display: grid; place-items: center; }
.emblem .mark .star { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; color: var(--brand); }
.emblem .mark .star + .star { inset: 11px; inline-size: auto; block-size: auto; color: var(--saffron); }
.emblem b { font: 600 20px/1 var(--font-display); letter-spacing: .02em; }
:lang(fa) .emblem b { font: 700 20px/1.4 var(--font-sans); }
.emblem small { font-size: 10px; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--ink-3); }
:lang(fa) .emblem small { letter-spacing: 0; font-size: 11px; }
.head-end { display: flex; align-items: center; gap: var(--space-4); }
.head-end .tools { margin-inline-start: auto; display: flex; gap: 6px; align-items: center; }
.menu-btn { display: none !important; }
.mnav { display: none; }
@media (max-width: 980px) {
  .site-head .container { grid-template-columns: auto 1fr auto; min-block-size: 64px; }
  .site-head .nav { display: none; }
  .site-head .emblem { justify-self: center; }
  .menu-btn { display: inline-flex !important; }
  .mnav[data-open] { display: grid; gap: 2px; padding: var(--space-3) var(--gutter) var(--space-5); border-block-start: 1px solid var(--line); }
  .mnav a { padding: 10px 0; font-weight: 600; border-block-end: 1px solid var(--line); }
  .hide-md { display: none !important; }
}

/* ------------------------------------------------------------ controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-block-size: var(--control-h); padding-inline: 22px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: 700 var(--fs-sm)/1 var(--font-sans); letter-spacing: .03em; cursor: pointer; white-space: nowrap; transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease); }
:lang(fa) .btn { letter-spacing: 0; }
.btn:hover { border-color: var(--lajevard); color: var(--lajevard); }
.btn i { font-size: 1.25em; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); box-shadow: inset 0 0 0 3px var(--brand), inset 0 0 0 4px rgba(255, 255, 255, .42); }
.btn-primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); color: var(--brand-ink); box-shadow: inset 0 0 0 3px var(--brand-strong), inset 0 0 0 4px rgba(255, 255, 255, .42); }
.btn-lajevard { background: var(--lajevard); border-color: var(--lajevard); color: #fff; box-shadow: inset 0 0 0 3px var(--lajevard), inset 0 0 0 4px rgba(255, 255, 255, .35); }
.btn-lajevard:hover { color: #fff; background: var(--lajevard-deep); }
[data-theme="dark"] .btn-lajevard { color: #0e1631; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn-danger { color: var(--danger); }
.btn-lg { min-block-size: var(--control-h-lg); padding-inline: 30px; font-size: var(--fs-md); }
.btn-sm { min-block-size: 34px; padding-inline: 14px; font-size: var(--fs-xs); }
.btn-icon { padding: 0; inline-size: var(--control-h); }
.btn-icon.btn-sm { inline-size: 34px; }
.link { color: var(--brand); font-weight: 700; text-decoration: underline; text-decoration-color: color-mix(in oklab, var(--brand) 40%, transparent); text-underline-offset: 4px; }
/* centered tabs with a saffron diamond under the active one */
.tabs { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px var(--space-6); border-block-end: 1px solid var(--line); }
.tabs.start { justify-content: flex-start; }
.tabs [role="tab"] { position: relative; padding: 10px 2px 14px; border: 0; background: none; font: 700 var(--fs-md)/1.2 var(--font-sans); color: var(--ink-3); cursor: pointer; }
.tabs [role="tab"]:hover { color: var(--ink); }
.tabs [aria-selected="true"] { color: var(--lajevard); }
.tabs [aria-selected="true"]::after { content: ""; position: absolute; left: 50%; inset-block-end: -6px; inline-size: 11px; block-size: 11px; background: var(--saffron); border: 2px solid var(--canvas); transform: translateX(-50%) rotate(45deg); }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-pill); }
.seg button { border: 0; background: none; padding: 7px 16px; border-radius: var(--radius-pill); font: 700 var(--fs-sm)/1.2 var(--font-sans); color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.seg button:hover { color: var(--lajevard); }
.seg [aria-pressed="true"], .seg [aria-pressed="true"]:hover { background: var(--lajevard); color: #fff; }
[data-theme="dark"] .seg [aria-pressed="true"] { color: #0e1631; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { border: 1px solid var(--line-2); background: var(--surface); padding: 6px 14px; border-radius: var(--radius-pill); font: 600 var(--fs-sm)/1.2 var(--font-sans); color: var(--ink-2); cursor: pointer; }
.chips [aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-strong); }
[data-theme="dark"] .chips [aria-pressed="true"] { color: var(--brand); }
.field { display: grid; gap: 6px; align-content: start; }
.label { font: 700 var(--fs-sm)/1.3 var(--font-sans); color: var(--ink); }
.hint { font-size: var(--fs-xs); color: var(--ink-3); }
.input, .select, .textarea { inline-size: 100%; min-block-size: var(--control-h); padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: 400 var(--fs-md) var(--font-sans); transition: border-color var(--dur-1), box-shadow var(--dur-1); }
.textarea { padding-block: 10px; min-block-size: 110px; resize: vertical; line-height: var(--lh-body); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.select { appearance: none; padding-inline-end: 38px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%23b8902f' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 14px center / 12px; }
[dir="rtl"] .select { background-position: left 14px center; }
[aria-invalid="true"] { border-color: var(--danger) !important; box-shadow: 0 0 0 3px var(--danger-soft) !important; }
.field-error { font-size: var(--fs-xs); font-weight: 700; color: var(--danger); }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.check input { inline-size: 18px; block-size: 18px; margin: 0; accent-color: var(--brand); flex: none; }
.switch { position: relative; inline-size: 46px; block-size: 26px; border-radius: var(--radius-pill); border: 1px solid var(--line-2); background: var(--surface-3); padding: 0; cursor: pointer; flex: none; transition: background var(--dur-2) var(--ease); }
.switch::after { content: ""; position: absolute; inset-block-start: 3px; inset-inline-start: 3px; inline-size: 18px; block-size: 18px; background: var(--surface); -webkit-mask: var(--star) center / contain no-repeat; mask: var(--star) center / contain no-repeat; transition: transform var(--dur-2) var(--ease), background var(--dur-2); background-color: var(--ink-3); }
.switch[aria-checked="true"] { background: var(--brand); border-color: var(--brand); }
.switch[aria-checked="true"]::after { transform: translateX(20px) rotate(45deg); background-color: #fff; }
[dir="rtl"] .switch[aria-checked="true"]::after { transform: translateX(-20px) rotate(45deg); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); }
.qty button { inline-size: 40px; block-size: calc(var(--control-h) - 2px); border: 0; background: none; color: var(--lajevard); font-size: 18px; cursor: pointer; }
.qty button:hover { background: var(--surface-2); }
.qty input { inline-size: 52px; border: 0; background: none; text-align: center; font-weight: 700; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ------------------------------------------------------------ content */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-1); }
.tile-card { display: grid; gap: var(--space-3); justify-items: center; text-align: center; }
.tile-card .arch-frame { inline-size: 100%; aspect-ratio: 3 / 4; }
.tile-card .arch img, .arch img { inline-size: 100%; block-size: 100%; object-fit: cover; }
.menu-list { display: grid; gap: var(--space-3); }
.menu-list li { display: flex; align-items: baseline; gap: 10px; }
.menu-list li > span:first-child { font-weight: 700; }
.menu-list li::after { content: ""; order: 1; flex: 1; min-inline-size: 24px; border-block-end: 1px dotted var(--line-2); }
.menu-list li > :last-child { order: 2; font-weight: 700; color: var(--lajevard); white-space: nowrap; }
.menu-list li small { display: block; font-weight: 400; color: var(--ink-3); font-size: var(--fs-sm); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: var(--radius-pill); font: 700 var(--fs-xs)/1.6 var(--font-sans); background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge::before { content: ""; inline-size: 7px; block-size: 7px; background: currentColor; transform: rotate(45deg); }
.badge.glaze { background: var(--brand-soft); color: var(--brand-strong); }
.badge.saffron { background: var(--warning-soft); color: var(--warning); }
.badge.anar { background: var(--danger-soft); color: var(--danger); }
.badge.lajevard { background: var(--info-soft); color: var(--lajevard); }
[data-theme="dark"] .badge.glaze { color: var(--brand); }

/* tables */
.table-scroll { position: relative; overflow-x: auto; }
.table { inline-size: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th { text-align: start; font: 700 var(--fs-xs)/1.4 var(--font-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--lajevard); padding: 10px 14px; border-block-end: 2px solid var(--line-2); white-space: nowrap; }
:lang(fa) .table th { letter-spacing: 0; font-size: var(--fs-sm); }
.table td { padding: 12px 14px; border-block-end: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.table tbody tr:hover { background: color-mix(in oklab, var(--surface-2) 60%, transparent); }
.table .end { text-align: end; }
.table th button { all: unset; cursor: pointer; }
.table th button:focus-visible { outline: 2px solid var(--focus); }
.table th[aria-sort="ascending"] button::after { content: " ▴"; color: var(--saffron); }
.table th[aria-sort="descending"] button::after { content: " ▾"; color: var(--saffron); }
.empty { padding: var(--space-6); text-align: center; color: var(--ink-3); }

/* ------------------------------------------------------------ dashboard */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-block-size: 100dvh; }
.side { position: sticky; inset-block-start: 0; block-size: 100dvh; overflow: auto; background: var(--surface-ink); color: #efe6d2; padding: var(--space-5) var(--space-4); display: flex; flex-direction: column; gap: var(--space-5); isolation: isolate; }
.side .girih { --pattern: var(--saffron); --pattern-o: .07; z-index: -1; position: fixed; inset-inline-start: 0; inline-size: 264px; }
.side .emblem { color: #efe6d2; }
.side .emblem small { color: #b8b0c4; }
.side-nav { display: grid; gap: 2px; }
.side-nav a, .side-nav button { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--radius-sm); color: #cfc7d9; font-weight: 600; border: 0; background: none; text-align: start; cursor: pointer; }
.side-nav a:hover, .side-nav button:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-nav [aria-current], .side-nav [aria-selected="true"] { background: rgba(255, 255, 255, .09); color: #fff; box-shadow: inset 3px 0 0 var(--saffron); }
[dir="rtl"] .side-nav [aria-current], [dir="rtl"] .side-nav [aria-selected="true"] { box-shadow: inset -3px 0 0 var(--saffron); }
.side-nav i { font-size: 20px; color: var(--brand); }
[data-theme="dark"] .side-nav i { color: var(--brand); }
.side-nav .count { margin-inline-start: auto; font-size: var(--fs-xs); background: var(--saffron); color: #2a1d05; padding: 0 8px; border-radius: var(--radius-pill); }
.side-label { font-size: var(--fs-xs); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: #9a93ab; padding-inline: 14px; }
.side-foot { margin-block-start: auto; display: grid; gap: var(--space-3); font-size: var(--fs-sm); }
.app-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-5); padding: var(--space-5) var(--space-7) var(--space-4); }
.app-head .tools { margin-inline-start: auto; display: flex; gap: 6px; align-items: center; }
.main { min-inline-size: 0; }
.app-body { padding: 0 var(--space-7) var(--space-8); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-6); min-inline-size: 0; }
.side-toggle { display: none !important; }
@media (max-width: 980px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 60; inline-size: min(300px, 86vw); transform: translateX(-100%); transition: transform var(--dur-2) var(--ease); }
  [dir="rtl"] .side { transform: translateX(100%); }
  .side[data-open] { transform: none; box-shadow: var(--shadow-3); }
  .side-toggle { display: inline-flex !important; }
  .app-head { padding: var(--space-4) var(--gutter); }
  .app-body { padding: 0 var(--gutter) var(--space-8); }
}
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-5); }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { display: grid; gap: 4px; text-align: center; justify-items: center; padding: var(--space-5) var(--space-4); }
.kpi .value { font: 600 clamp(30px, 3vw, 42px)/1.05 var(--font-display); color: var(--lajevard); font-variant-numeric: lining-nums; }
:lang(fa) .kpi .value { font: 700 clamp(26px, 2.6vw, 34px)/1.4 var(--font-sans); }
.kpi .delta { font-size: var(--fs-xs); font-weight: 700; }
.up { color: var(--success); } .down { color: var(--danger); }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-block-end: var(--space-4); }
.panel-head .h3 { margin-inline-end: auto; }
/* floor plan of takhts (tables) */
.floor { display: grid; grid-template-columns: repeat(var(--fc, 6), minmax(0, 1fr)); gap: 12px; }
@media (max-width: 620px) { .floor { --fc: 3 !important; } }
.takht { position: relative; display: grid; place-items: center; gap: 0; aspect-ratio: 1.25; border-radius: var(--radius-sm); border: 1.5px solid var(--line-2); background: var(--surface); cursor: pointer; font: 700 var(--fs-md)/1.2 var(--font-sans); color: var(--ink); padding: 6px; }
.takht small { font-weight: 500; font-size: var(--fs-xs); color: var(--ink-3); }
.takht:hover { border-color: var(--lajevard); }
.takht.reserved { background: var(--warning-soft); border-color: var(--saffron); }
.takht.seated { background: var(--brand-soft); border-color: var(--brand); }
.takht.bill { background: var(--danger-soft); border-color: var(--anar); }
.takht.round { border-radius: 50%; aspect-ratio: 1; }
.takht.wide { grid-column: span 2; aspect-ratio: 2.6; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--fs-xs); color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend span::before { content: ""; inline-size: 10px; block-size: 10px; border-radius: 2px; background: var(--c, var(--brand)); }
.meter { display: grid; gap: 6px; }
.meter .track { block-size: 8px; border-radius: var(--radius-pill); background: var(--surface-2); overflow: hidden; }
.meter .track i { display: block; block-size: 100%; inline-size: var(--v, 50%); border-radius: inherit; background: linear-gradient(90deg, var(--brand), color-mix(in oklab, var(--brand) 60%, var(--lajevard))); }
.meter .track i.low { background: var(--anar); }
.meter .row { justify-content: space-between; font-size: var(--fs-sm); }
.feed { display: grid; }
.feed li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; padding-block: 12px; border-block-end: 1px solid var(--line); align-items: start; }
.feed li:last-child { border: 0; }
.feed .star { font-size: 12px; color: var(--saffron); margin-block-start: 6px; }
.feed time { font-size: var(--fs-xs); color: var(--ink-3); white-space: nowrap; }

/* ------------------------------------------------------------ overlays */
dialog.modal { border: 0; padding: 0; background: transparent; color: var(--ink); inline-size: min(560px, calc(100vw - 24px)); overflow: visible; }
dialog.modal::backdrop { background: var(--overlay); backdrop-filter: blur(3px); }
dialog.modal > .framed { box-shadow: inset 0 0 0 5px var(--surface), inset 0 0 0 6px var(--line), var(--shadow-3); padding: var(--space-7) var(--space-6) var(--space-6); display: grid; gap: var(--space-4); max-block-size: calc(100dvh - 48px); overflow: auto; }
.modal-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-3); margin-block-start: var(--space-2); }
.toast { display: flex; align-items: center; gap: 10px; background: var(--surface-ink); color: #f5eedf; padding: 12px 18px; border-radius: var(--radius-sm); border: 1px solid var(--gilt); box-shadow: var(--shadow-2); font-weight: 600; font-size: var(--fs-sm); }
.toast::before { content: ""; inline-size: 14px; block-size: 14px; flex: none; background: var(--saffron); -webkit-mask: var(--star) center / contain no-repeat; mask: var(--star) center / contain no-repeat; }
.toast[data-tone="danger"]::before { background: var(--anar); }
.toast.is-out { opacity: 0; transition: opacity var(--dur-2); }

/* charts */
.tf-chart .c-grid { stroke: var(--chart-grid); }
.tf-chart .c-axis { fill: var(--chart-axis); font: 500 11px var(--font-sans); }
.tf-chart .c-dot { fill: var(--surface); }
.tf-chart .c-guide { stroke: var(--gilt); stroke-dasharray: 3 3; }
.tf-chart .c-track { stroke: var(--surface-2); }
.tf-chart .c-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font: 600 26px/1.1 var(--font-display); color: var(--lajevard); }
:lang(fa) .tf-chart .c-center { font: 700 20px/1.4 var(--font-sans); }
.chart-tip { background: var(--surface-ink); color: #f5eedf; padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--gilt); font: 600 12px/1.5 var(--font-sans); display: grid; gap: 2px; }
.chart-tip span { display: flex; gap: 6px; align-items: center; }
.chart-tip i { inline-size: 8px; block-size: 8px; transform: rotate(45deg); }

/* footer: lajevard night with girih */
.site-foot { position: relative; isolation: isolate; background: var(--surface-ink); color: #e9e0cc; padding-block: var(--space-8) var(--space-6); overflow: hidden; }
.site-foot .girih { --pattern: var(--saffron); --pattern-o: .08; z-index: -1; }
.site-foot a { color: #cfc7d9; }
.site-foot a:hover { color: #fff; }
.site-foot h3 { font: 700 var(--fs-xs)/1.4 var(--font-sans); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--saffron); margin-block-end: var(--space-3); }
:lang(fa) .site-foot h3 { font-size: var(--fs-sm); letter-spacing: 0; }
.site-foot ul { display: grid; gap: 6px; font-size: var(--fs-sm); }
.site-foot .emblem { color: #efe6d2; }
.site-foot .emblem small { color: #b8b0c4; }
.foot-base { margin-block-start: var(--space-7); padding-block-start: var(--space-4); border-block-start: 1px solid rgba(222, 196, 140, .25); display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: space-between; font-size: var(--fs-xs); color: #b8b0c4; }
