@font-face {
  font-family: "Vazirmatn";
  src: url("/fonts/Vazirmatn.woff2") format("woff2-variations"), url("/fonts/Vazirmatn.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #f4efe8;
  --surface: #fffcf8;
  --surface-2: #f7f1e9;
  --ink: #1a2230;
  --ink-2: #3a4352;
  --muted: #7a7268;
  --line: rgba(26, 34, 48, 0.08);
  --line-strong: rgba(26, 34, 48, 0.14);
  --accent: #c0603a;
  --accent-2: #e2895a;
  --accent-deep: #8c4124;
  --accent-soft: #f6e1d3;
  --navy: #1c2430;
  --navy-2: #253042;
  --good: #2f7d57;
  --good-soft: #dff0e6;
  --warn: #a8722a;
  --warn-soft: #f7ead2;
  --bad: #b23b3b;
  --bad-soft: #f8e0dd;
  --info: #3b5b85;
  --info-soft: #e1e8f2;
  --grad: linear-gradient(135deg, #c0603a 0%, #e2895a 100%);
  --grad-night: linear-gradient(170deg, #253042 0%, #1a2230 100%);
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(26, 34, 48, 0.05), 0 1px 6px rgba(26, 34, 48, 0.04);
  --shadow-md: 0 1px 3px rgba(26, 34, 48, 0.05), 0 10px 30px -12px rgba(26, 34, 48, 0.14);
  --shadow-lg: 0 30px 70px -20px rgba(26, 34, 48, 0.4);
  --shadow-accent: 0 10px 24px -10px rgba(192, 96, 58, 0.6);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --rail-w: 264px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Vazirmatn", Tahoma, "Segoe UI", sans-serif;
  line-height: 1.6;
}

h1, h2, h3, p { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }

[hidden] { display: none !important; }

.ltr { direction: ltr; unicode-bidi: isolate; }

.ic {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ic.sm { width: 16px; height: 16px; }
.ic.lg { width: 26px; height: 26px; }

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: var(--grad);
  color: white;
  font-size: 14.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--shadow-accent);
  transition: transform 0.2s var(--spring), box-shadow 0.2s var(--ease), background 0.2s var(--ease), filter 0.2s var(--ease);
}

.btn:hover { filter: brightness(1.05); box-shadow: 0 14px 28px -12px rgba(192, 96, 58, 0.75); }
.btn:active { transform: scale(0.97); }
.btn:focus-visible, .nav a:focus-visible, .chip:focus-visible, .icon-btn:focus-visible { outline: 3px solid rgba(192, 96, 58, 0.35); outline-offset: 2px; }
.btn.block { width: 100%; min-height: 50px; font-size: 15.5px; }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }

.btn.secondary {
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  filter: none;
}

.btn.secondary:hover { background: white; box-shadow: inset 0 0 0 1px rgba(26, 34, 48, 0.22); }

.btn.soft {
  background: var(--surface-2);
  color: var(--ink-2);
  box-shadow: none;
  min-height: 38px;
  padding: 0 12px;
  font-size: 13.5px;
}

.btn.soft:hover { background: var(--accent-soft); color: var(--accent-deep); filter: none; }

.btn.busy { color: transparent; pointer-events: none; }
.btn.busy .ic { opacity: 0; }

.btn.busy::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}
.profile-hero{display:flex;align-items:center;gap:18px;margin:22px 0;padding:22px}.profile-hero h2{font-size:25px}.profile-hero p{color:var(--muted)}.profile-hero>div{flex:1}.profile-avatar{width:76px;height:76px;font-size:24px;overflow:hidden}.profile-logo-edit{display:flex;align-items:center;gap:16px;margin:14px 0}.profile-logo-edit small{display:block;color:var(--muted);margin-top:8px}.profile-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px}.profile-fields .field:last-child{grid-column:1/-1}.profile-dialog,.crop-dialog{border:0;border-radius:20px;padding:0;max-width:680px;width:calc(100% - 32px);box-shadow:var(--shadow-lg);background:transparent}.profile-dialog::backdrop,.crop-dialog::backdrop{background:rgba(20,25,32,.62);backdrop-filter:blur(5px)}.profile-dialog .card{padding:24px}.modal-head{display:flex;align-items:flex-start;gap:14px;justify-content:space-between}.modal-head p{color:var(--muted)}.modal-actions{display:flex;gap:10px;justify-content:flex-start;margin-top:18px}.crop-card{background:var(--surface);padding:26px;text-align:center}.crop-card p{color:var(--muted)}#crop-canvas{display:block;width:320px;height:320px;max-width:100%;margin:18px auto;background:#222;border-radius:12px}.crop-card input[type=range]{width:100%;direction:ltr}
.profile-edit-btn{display:inline-flex;align-items:center;gap:5px;border:0;background:transparent;color:var(--accent-deep);font-size:13px;font-weight:700;padding:6px 8px;border-radius:8px;cursor:pointer;white-space:nowrap}.profile-edit-btn:hover{background:var(--accent-soft)}
@media(max-width:700px){.profile-fields{grid-template-columns:1fr}.profile-fields .field:last-child{grid-column:auto}.profile-hero{flex-wrap:wrap}.profile-hero .btn{width:100%}}

@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}

.icon-btn:hover { background: rgba(26, 34, 48, 0.06); }
.icon-btn:active { transform: scale(0.92); }

label {
  display: block;
  margin: 0 0 8px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
}

.input, input:not([type="radio"]):not([type="checkbox"]), textarea {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 13px;
  background: white;
  font-size: 16px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

textarea { padding: 12px 16px; min-height: 96px; resize: vertical; line-height: 1.7; font-weight: 500; }

input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(192, 96, 58, 0.14); }
input::placeholder, textarea::placeholder { color: #b3aaa0; font-weight: 500; }

.field + .field { margin-top: 16px; }

.input-icon { position: relative; }
.input-icon .ic { position: absolute; top: 50%; right: 15px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon input { padding-right: 46px; }
.input-icon input.ltr { text-align: left; }

.note {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 0;
  margin: 14px 0 0;
  color: var(--bad);
  font-size: 14px;
  font-weight: 600;
}

.note:empty { display: none; }

.note.ok, .note.bad {
  padding: 11px 14px;
  border-radius: 12px;
}

.note.ok { background: var(--good-soft); color: var(--good); }
.note.bad { background: var(--bad-soft); color: var(--bad); }

.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 22px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 16px;
}

.card-head h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 800;
}

.card-head p { font-size: 13px; color: var(--muted); }

.chip-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  flex: 0 0 auto;
}

.chip-icon.good { background: var(--good-soft); color: var(--good); }
.chip-icon.info { background: var(--info-soft); color: var(--info); }
.chip-icon.warn { background: var(--warn-soft); color: var(--warn); }
.chip-icon .ic { width: 18px; height: 18px; }

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--ink-2);
}

.pill .ic { width: 13px; height: 13px; stroke-width: 2.4; }
.pill.ok { background: var(--good-soft); color: var(--good); }
.pill.wait { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.accent { background: var(--accent-soft); color: var(--accent-deep); }
.pill.wait .ic { animation: pulse 1.6s ease-in-out infinite; }

@keyframes pulse { 50% { opacity: 0.4; } }

.badge {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  margin-inline-start: auto;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: 11.5px;
  font-weight: 800;
  animation: badge-in 0.4s var(--spring) both;
}

@keyframes badge-in { from { transform: scale(0); } to { transform: scale(1); } }

body.dash { min-height: 100vh; }

.rail {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 30;
  width: var(--rail-w);
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  background: var(--grad-night);
  color: #efe6d8;
  overflow: hidden;
  isolation: isolate;
}

.rail::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 320px;
  height: 320px;
  top: -160px;
  left: -120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(226, 137, 90, 0.28), transparent 70%);
}

.rail-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 8px 22px;
}

.logo {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--grad);
  color: white;
  box-shadow: var(--shadow-accent);
  flex: 0 0 auto;
}

.logo .ic { width: 22px; height: 22px; stroke-width: 2; }

.rail-brand .brand { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: 0.16em; color: var(--accent-2); line-height: 1.3; }
.rail-brand small { display: block; font-size: 12px; opacity: 0.55; }

.venue {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 20px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.venue-avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(226, 137, 90, 0.18);
  color: var(--accent-2);
  font-weight: 900;
  font-size: 17px;
  flex: 0 0 auto;
}

.venue div { min-width: 0; }
.venue small { display: block; font-size: 11.5px; opacity: 0.55; }

.venue h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-label { padding: 0 12px 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; opacity: 0.45; }

.nav { display: grid; gap: 4px; }

.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 12px;
  color: rgba(239, 230, 216, 0.72);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.nav a:hover { background: rgba(255, 255, 255, 0.05); color: #efe6d8; }

.nav a.on {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-weight: 750;
}

.nav a.on::before {
  content: "";
  position: absolute;
  right: -16px;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 4px 0 0 4px;
  background: var(--accent-2);
}

.nav a.on .ic { color: var(--accent-2); }

.rail-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.08); }

.rail .logout {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(239, 230, 216, 0.72);
  font-size: 14.5px;
  font-weight: 600;
  text-align: right;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.rail .logout:hover { background: rgba(178, 59, 59, 0.2); color: #ffd3cc; }

.mobile-head { display: none; }

.main {
  margin-right: var(--rail-w);
  padding: 34px 40px 60px;
  max-width: calc(1240px + var(--rail-w));
}

.page { animation: page-in 0.45s var(--ease) both; }

@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

.page-head h1 { font-size: 28px; font-weight: 850; line-height: 1.35; letter-spacing: -0.01em; }
.page-head p { margin-top: 4px; color: var(--muted); font-size: 14.5px; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.stat {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  animation: page-in 0.5s var(--ease) both;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.stat:nth-child(2) { animation-delay: 0.05s; }
.stat:nth-child(3) { animation-delay: 0.1s; }
.stat:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(26, 34, 48, 0.05), 0 18px 40px -16px rgba(26, 34, 48, 0.22); }

.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-top > span:first-child { color: var(--muted); font-size: 13.5px; font-weight: 600; }

.stat strong {
  display: block;
  margin-top: 14px;
  font-size: 38px;
  font-weight: 850;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.stat.hero { background: var(--grad); color: white; box-shadow: 0 20px 40px -18px rgba(192, 96, 58, 0.7); }
.stat.hero .stat-top > span:first-child { color: rgba(255, 255, 255, 0.85); }
.stat.hero .chip-icon { background: rgba(255, 255, 255, 0.2); color: white; }

.stat.hero::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  left: -60px;
  bottom: -100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.25), transparent 70%);
}

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.funnel { display: grid; gap: 16px; }

.funnel-row { display: grid; gap: 8px; }
.funnel-label { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 700; }
.funnel-label span { color: var(--muted); font-weight: 600; }

.bar {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--grad);
  transition: width 1s var(--ease);
}

.bar.info i { background: linear-gradient(90deg, #3b5b85, #6d8fbd); }
.bar.good i { background: linear-gradient(90deg, #2f7d57, #5fb486); }

.quick { display: grid; gap: 10px; }

.quick a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 16px;
  background: var(--surface-2);
  text-decoration: none;
  color: var(--ink);
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}

.quick a:hover { background: var(--accent-soft); transform: translateX(-3px); }
.quick a div { flex: 1; min-width: 0; }
.quick strong { display: block; font-size: 14.5px; font-weight: 800; }
.quick a div span { display: block; font-size: 12.5px; color: var(--muted); }
.quick a > .ic { color: var(--muted); }

.token-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 16px;
  align-items: start;
}

.counts {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 6px;
}

button.chip {
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 750;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--spring), box-shadow 0.2s var(--ease);
}

button.chip:hover { background: var(--accent-soft); color: var(--accent-deep); }
button.chip:active { transform: scale(0.92); }
button.chip.on { background: var(--grad); color: white; box-shadow: var(--shadow-accent); transform: scale(1.04); }

.form-foot { display: flex; gap: 12px; align-items: center; margin-top: 22px; }

.phone-mock {
  position: sticky;
  top: 24px;
  padding: 14px;
  border-radius: 34px;
  background: var(--navy);
  box-shadow: var(--shadow-lg);
}

.phone-screen {
  min-height: 320px;
  padding: 16px 14px 20px;
  border-radius: 24px;
  background: #f2ede6;
}

.phone-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.phone-bar .logo { width: 32px; height: 32px; border-radius: 50%; }
.phone-bar .logo .ic { width: 17px; height: 17px; }
.phone-bar strong { display: block; font-size: 13.5px; font-weight: 800; }
.phone-bar small { display: block; font-size: 11px; color: var(--muted); }

.bubble {
  position: relative;
  max-width: 92%;
  padding: 12px 14px;
  border-radius: 18px 18px 18px 6px;
  background: white;
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: break-word;
  unicode-bidi: plaintext;
  text-align: start;
  box-shadow: var(--shadow-sm);
  animation: bubble-in 0.5s var(--spring) both;
}

@keyframes bubble-in {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

.bubble-time { margin-top: 6px; font-size: 11px; color: var(--muted); }

.table-card { margin-top: 16px; padding: 0; overflow: hidden; }
.table-card .card-head { padding: 20px 22px 0; }

.ticket-head,
.tickets .row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) 110px 90px 100px 100px;
  column-gap: 16px;
  align-items: center;
}

.ticket-head {
  padding: 12px 22px;
  background: var(--surface-2);
  border-block: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
}

.ticket-head span:not(.phone-cell), .mark-cell, .prints, .tickets a.code { text-align: center; justify-self: center; }

ul.tickets { list-style: none; margin: 0; padding: 0; }

ul.tickets li {
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  animation: page-in 0.4s var(--ease) both;
  transition: background 0.2s var(--ease);
}

ul.tickets li:last-child { border-bottom: 0; }
ul.tickets li:hover { background: rgba(247, 241, 233, 0.6); }

.phone-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pick-gap { width: 30px; flex: 0 0 30px; }
.phone-cell .num { direction: ltr; font-weight: 750; font-size: 15px; letter-spacing: 0.02em; }

button.pick {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  background: white;
  color: white;
  cursor: pointer;
  flex: 0 0 30px;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--spring);
}

button.pick:hover { border-color: var(--accent); }
button.pick:active { transform: scale(0.88); }
button.pick.on { background: var(--accent); border-color: var(--accent); }
button.pick .ic { width: 15px; height: 15px; stroke-width: 3; }

.prints { direction: ltr; font-weight: 700; color: var(--ink-2); }

.tickets a.code {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  direction: ltr;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 750;
  font-size: 13.5px;
  letter-spacing: 0.08em;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s var(--ease);
}

.tickets a.code:hover { background: #f1cfb9; }
.tickets a.code .ic { width: 13px; height: 13px; }

.cell-label { display: none; }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 34px 20px;
  text-align: center;
  color: var(--muted);
}

.empty .chip-icon { width: 52px; height: 52px; border-radius: 16px; margin-bottom: 6px; }
.empty .chip-icon .ic { width: 24px; height: 24px; }
.empty strong { color: var(--ink); font-size: 14.5px; font-weight: 800; }
.empty span { font-size: 13px; }

.board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.lane { padding: 18px; }
.lane .card-head { margin-bottom: 12px; }
.lane-count { font-size: 13px; font-weight: 800; color: var(--muted); background: var(--surface-2); padding: 2px 10px; border-radius: 999px; }

.job {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface-2);
  animation: page-in 0.4s var(--ease) both;
}

.job + .job { margin-top: 8px; }
.job div { flex: 1; min-width: 0; }
.job strong { display: block; font-size: 14px; font-weight: 800; }
.job > div > span { display: block; font-size: 12px; color: var(--muted); }
.job code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; background: white; padding: 1px 6px; border-radius: 6px; }

.cafes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.cafe {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  animation: page-in 0.45s var(--ease) both;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.cafe:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(26, 34, 48, 0.05), 0 20px 40px -18px rgba(26, 34, 48, 0.24); }

.cafe-top { display: flex; align-items: center; gap: 14px; }

.cafe-avatar {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: var(--grad);
  color: white;
  font-size: 21px;
  font-weight: 900;
  box-shadow: var(--shadow-accent);
  flex: 0 0 auto;
}

.cafe-top div { min-width: 0; flex: 1; }
.cafe-top .pill { margin-top: 6px; }
.cafe strong { display: block; font-size: 17px; font-weight: 850; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cred {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 13.5px;
}

.cred .ic { color: var(--muted); }
.cred span { direction: ltr; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cafe-actions { display: flex; gap: 8px; }
.cafe-actions .btn { flex: 1; }

.modal {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(20, 26, 36, 0.45);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: fade-in 0.25s var(--ease) both;
}

.modal .card {
  width: min(460px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.4s var(--spring) both;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

@keyframes modal-in {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

.modal-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.modal-head div { flex: 1; min-width: 0; }
.modal-head h2 { font-size: 19px; font-weight: 850; }
.modal-head p { font-size: 13.5px; color: var(--muted); }
.modal-head p:empty { display: none; }

.modal-actions { display: flex; gap: 10px; margin-top: 22px; }
.modal-actions .btn { flex: 1; min-height: 48px; }

.options { display: grid; gap: 10px; margin-bottom: 18px; }

label.option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  padding: 14px;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 0 0 1.5px var(--line);
  transition: box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}

label.option:hover { box-shadow: inset 0 0 0 1.5px var(--line-strong); }

label.option input {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin: 0;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  background: white;
  flex: 0 0 auto;
  transition: border 0.2s var(--ease);
  cursor: pointer;
}

label.option input:checked { border: 7px solid var(--accent); }
label.option:has(input:checked) { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
label.option span { display: block; flex: 1; }
label.option small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 500; }

body.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.auth-art {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 44px;
  background: var(--grad-night);
  color: #efe6d8;
  isolation: isolate;
}

.auth-art::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 560px;
  height: 560px;
  left: -180px;
  bottom: -220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(226, 137, 90, 0.4), transparent 65%);
}

.auth-art .rail-brand { padding: 0; }
.auth-art h2 { font-size: 34px; font-weight: 900; line-height: 1.45; max-width: 420px; }
.auth-art h2 em { font-style: normal; color: var(--accent-2); }
.auth-art p { margin-top: 10px; opacity: 0.65; max-width: 380px; }

.auth-polaroids { position: relative; height: 200px; }

.auth-polaroids span {
  position: absolute;
  width: 120px;
  height: 146px;
  padding: 9px 9px 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 20px 40px -14px rgba(0, 0, 0, 0.55);
}

.auth-polaroids i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(160deg, #f3c19e, #c0603a 70%, #8c4124); }
.auth-polaroids span:nth-child(1) { right: 0; top: 30px; transform: rotate(-9deg); }
.auth-polaroids span:nth-child(2) { right: 90px; top: 0; transform: rotate(6deg); animation: float 6s ease-in-out infinite; }
.auth-polaroids span:nth-child(2) i { background: linear-gradient(160deg, #a9c3d6, #3a4f6a 75%); }

@keyframes float {
  0%, 100% { transform: rotate(6deg) translateY(0); }
  50% { transform: rotate(3deg) translateY(-8px); }
}

.auth-form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.sheet { width: min(400px, 100%); animation: page-in 0.5s var(--ease) both; }
.sheet .mark { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; font-size: 12px; font-weight: 800; letter-spacing: 0.12em; color: var(--accent-deep); }
.sheet .mark .logo { width: 30px; height: 30px; border-radius: 9px; box-shadow: none; }
.sheet .mark .logo .ic { width: 17px; height: 17px; }
.sheet h1 { font-size: 30px; font-weight: 900; line-height: 1.35; }
.sheet .lead { margin: 6px 0 28px; color: var(--muted); font-size: 15px; }
.sheet .btn.block { margin-top: 22px; }
.sheet .field + .field { margin-top: 16px; }

@media (max-width: 1180px) {
  .token-grid, .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .phone-mock { position: static; max-width: 420px; }
  .board { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  body.dash { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }

  .mobile-head {
    position: sticky;
    top: 0;
    z-index: 25;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(244, 239, 232, 0.85);
    -webkit-backdrop-filter: saturate(160%) blur(16px);
    backdrop-filter: saturate(160%) blur(16px);
    border-bottom: 1px solid var(--line);
  }

  .mobile-head .logo { width: 36px; height: 36px; }
  .mobile-head div { flex: 1; min-width: 0; }
  .mobile-head small { display: block; font-size: 11px; font-weight: 800; letter-spacing: 0.12em; color: var(--accent-deep); }
  .mobile-head strong { display: block; font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .rail {
    inset: auto 0 0 0;
    width: auto;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    flex-direction: row;
    background: rgba(28, 36, 48, 0.94);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    box-shadow: 0 -10px 30px -12px rgba(26, 34, 48, 0.5);
  }

  .rail::before, .rail-brand, .venue, .nav-label, .rail-foot { display: none; }

  .nav { display: flex; flex: 1; gap: 4px; }

  .nav a {
    flex: 1;
    flex-direction: column;
    gap: 3px;
    padding: 8px 4px;
    font-size: 11.5px;
    text-align: center;
  }

  .nav a .ic { width: 22px; height: 22px; }
  .nav a.on::before { display: none; }
  .nav a.on { background: rgba(255, 255, 255, 0.08); }
  .nav .badge { position: absolute; top: 3px; left: calc(50% - 26px); margin: 0; min-width: 18px; height: 18px; font-size: 10px; padding: 0 5px; }

  .main { margin: 0; padding: 22px 16px 32px; }
  .page-head { flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
  .page-head h1 { font-size: 24px; }
  .stats { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .stat { display: flex; align-items: center; gap: 14px; padding: 16px; }
  .stat-top { flex-direction: row-reverse; gap: 12px; flex: 1; justify-content: flex-end; }
  .stat strong { margin: 0; font-size: 28px; }

  .counts { grid-template-columns: repeat(5, minmax(0, 1fr)); }

  .ticket-head { display: none; }

  .tickets .row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas: "who who code" "prints carrier handset";
    row-gap: 12px;
  }

  .tickets .row .phone-cell { grid-area: who; }
  .tickets .row .code { grid-area: code; justify-self: end; }
  .tickets .row .prints, .tickets .row .mark-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
    border-radius: 12px;
    background: var(--surface-2);
    justify-self: stretch;
    direction: rtl;
  }

  .cell-label { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }

  .cafes { grid-template-columns: minmax(0, 1fr); }

  body.auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.gift-summary { padding:24px; display:flex; flex-wrap:wrap; gap:20px; align-items:center; }
.gift-summary>div { flex:1 1 280px; }
.gift-summary p { color:var(--muted); line-height:1.9; }
.gift-summary>.note { width:100%; }
.gift-catalog { position:fixed; inset:0; margin:0; width:100vw; height:100dvh; max-width:none; max-height:none; padding:0; border:0; background:var(--bg,#f5f6fa); color:var(--ink,#1c2430); }
.gift-catalog-head { display:flex; justify-content:space-between; align-items:center; padding:26px max(22px,calc((100vw - 900px)/2)); border-bottom:1px solid #8882; }
.gift-catalog-head h1 { font-size:25px; }
.gift-catalog-head p,.gift-type p { color:var(--muted); line-height:1.9; }
.gift-catalog-content { max-width:940px; margin:auto; padding:28px 22px; }
.gift-type { padding:26px; display:flex; align-items:center; gap:22px; flex-wrap:wrap; }
.gift-type>div:first-child { flex:1 1 300px; }
.gift-type-actions { display:flex; gap:16px; align-items:center; flex-wrap:wrap; }
.gift-enabled-label { display:flex; align-items:center; gap:10px; }
.gift-editor input[type=checkbox] { width:20px; height:20px; margin:0; accent-color:var(--accent,#cb8055); }
.gift-editor { width:min(620px,calc(100vw - 28px)); max-height:calc(100dvh - 28px); padding:0; border:0; border-radius:24px; background:var(--card,#fff); color:var(--ink,#1c2430); overflow:auto; }
.gift-editor::backdrop { background:#101827a6; backdrop-filter:blur(4px); }
.gift-editor form { padding:26px; }
.gift-editor-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.gift-editor-head h2 { margin:0; font-size:23px; }
.gift-editor-head p { color:var(--muted); margin-top:8px; }
.gift-explanation { line-height:1.9; font-size:14px; color:var(--muted); margin:20px 0; }
.gift-editor fieldset { border:1px solid #8883; border-radius:16px; padding:18px; margin-top:20px; }
.gift-editor legend { padding:0 8px; font-weight:700; }
.gift-editor .chips { display:flex; gap:8px; margin-bottom:18px; flex-wrap:wrap; }
.gift-editor small { display:block; margin-top:8px; color:var(--muted); }
.gift-editor-actions { display:flex; gap:12px; }
.gift-editor-actions .btn { flex:1; }
.gift-editor-head .icon-btn,.gift-catalog-head .icon-btn { font-size:28px; }
.gift-editor .chips .chip { flex:1; min-width:44px; }

.gift-type { transition:background .2s ease,border-color .2s ease; border:1px solid transparent; }
.gift-type.is-inactive { background:#fffaf9; border-color:#ecd6d3; }
.gift-type.is-active { background:#f3faf5; border-color:#c9e1d0; }
.gift-status { display:inline-flex; align-items:center; gap:8px; font-size:13px; font-weight:700; margin-top:12px; }
.gift-status::before { content:""; width:9px; height:9px; border-radius:50%; flex-shrink:0; }
.gift-status.is-inactive { color:#a44740; }
.gift-status.is-inactive::before { background:#cb6259; box-shadow:0 0 0 4px #cb625912; }
.gift-status.is-active { color:#36714b; }
.gift-status.is-active::before { background:#4c9667; box-shadow:0 0 0 4px #4c966712; }
.gift-type-actions .btn { min-width:100px; background:#fff; color:var(--ink,#1c2430); box-shadow:inset 0 0 0 1px #343b4529; }

#gift-editor-save { background:#28734c; color:#fff; box-shadow:0 6px 16px #28734c26; }
#gift-editor-save:hover { background:#205f3e; }
#gift-editor-disable { background:#b9443e; color:#fff; box-shadow:0 6px 16px #b9443e26; }
#gift-editor-disable:hover { background:#9e3631; }
.webhook-card{margin-top:24px;display:flex;align-items:center;justify-content:space-between;gap:20px}.webhook-modal.is-open{display:flex;position:fixed;inset:0;z-index:1000;background:#1b202b99;backdrop-filter:blur(8px);align-items:center;justify-content:center}.webhook-modal.is-open>.card{width:min(680px,calc(100vw - 32px));max-height:90vh;overflow:auto}.webhook-modal input{width:100%;box-sizing:border-box}.webhook-modal #webhook-url{margin-top:14px;font-size:12px}.webhook-modal .modal-actions{display:flex;flex-wrap:wrap;gap:10px}
.code-panels{display:grid;grid-template-columns:minmax(0,1fr) minmax(340px,.9fr);gap:18px;align-items:start;margin-top:24px}.code-panels .webhook-card,.code-panels .ticket-create-card{margin-top:0}.ticket-create-card{display:grid;gap:14px}.ticket-create-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.ticket-create-form input,.ticket-create-form select{padding:10px;border:1px solid #ddd;border-radius:10px;font:inherit}.ticket-create-form .btn{grid-column:1/-1}@media(max-width:800px){.code-panels{grid-template-columns:1fr}.ticket-create-form{grid-template-columns:1fr}.ticket-create-form .btn{grid-column:auto}}
.ticket-list-card{margin-top:18px}.ticket-row{display:grid;grid-template-columns:1fr 1.5fr 1fr 1fr;gap:10px;padding:11px 0;border-bottom:1px solid #eee;align-items:center}.ticket-pagination{display:flex;align-items:center;justify-content:center;gap:14px;margin-top:16px}
.ticket-list-head,.ticket-row{display:grid;grid-template-columns:1.2fr 1.4fr 1fr .9fr .9fr .9fr .9fr;gap:8px;align-items:center}.ticket-list-head{font-size:12px;font-weight:700;color:var(--muted);padding:10px 0;border-bottom:2px solid #eee}.ticket-row{padding:11px 0;border-bottom:1px solid #eee}.ticket-row span{font-size:13px}@media(max-width:800px){.ticket-list-card{overflow:auto}.ticket-list-head,.ticket-row{min-width:760px}}
.ticket-create-form label{display:grid;gap:6px;font-size:13px;font-weight:700;color:var(--text)}.ticket-create-form label input,.ticket-create-form label select{width:100%;box-sizing:border-box}
.ticket-list-head,.ticket-row{grid-template-columns:1.2fr 1.4fr 1fr .9fr .9fr .9fr}
