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

:root {
  color-scheme: dark;
  --base: #141215;
  --surface: #201b1b;
  --field: #181519;
  --paper: #292120;
  --line: #584136;
  --text: #fff4e8;
  --muted: #cdbab0;
  --accent: #ffb573;
  --on-accent: #281309;
  --error: #ffb4a0;
  --success: #bfe6c7;
  font-family: Vazirmatn, Tahoma, sans-serif;
  background: var(--base);
  color: var(--text);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; line-height: 1.6; }
h1, h2, p, ul, ol { margin: 0; }
h1 { font-size: 1.43rem; line-height: 1.4; font-weight: 850; }
h2 { font-size: 1.16rem; font-weight: 810; overflow-wrap: anywhere; }
button, input, textarea, select { font: inherit; color: inherit; min-width: 0; }
button, select { cursor: pointer; }
button:disabled { opacity: .6; cursor: wait; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:is(a, button, input, select, textarea):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1.22rem; height: 1.22rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.shell { width: min(840px, calc(100% - 28px)); margin-inline: auto; }
.top { background: #191517; border-block-end: 1px solid var(--line); }
.top__inner { display: flex; justify-content: space-between; align-items: center; min-height: 65px; gap: 10px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 810; font-size: .91rem; }
.brand__mark { display: grid; place-items: center; flex: none; width: 39px; height: 39px; border: 1px solid #ae704a; border-radius: 10px; background: linear-gradient(145deg, #744426, #3e281e); }
.brand__mark img { width: 28px; height: 28px; object-fit: contain; }
.top__actions { display: flex; align-items: center; gap: 5px; }
.top__actions .quiet-button { padding-inline: 8px; }
.top__actions .icon { width: 1rem; height: 1rem; }
.main { padding-block: 19px 38px; }

.button, .quiet-button, .icon-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  background: var(--surface);
  font-size: .85rem;
  font-weight: 740;
}
.button--primary { border-color: #ffc38a; background: #ffad66; color: var(--on-accent); }
.button--primary:hover { background: #ffc08a; }
.quiet-button:hover, .icon-button:hover { border-color: #a47860; background: var(--paper); }
.icon-button { flex: none; width: 44px; padding: 0; }
input:not([type=checkbox]), select, textarea {
  display: block;
  width: 100%;
  min-height: 45px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--field);
  color: var(--text);
  font-size: 1rem;
}
input::placeholder { color: var(--muted); opacity: 1; }
input:read-only { color: var(--muted); }
textarea { resize: vertical; }
form { display: grid; gap: 9px; }
form > label { font-weight: 700; font-size: .87rem; }
form > input + label { margin-block-start: 4px; }
form > .button { margin-block-start: 5px; }
.login {
  width: min(100%, 405px);
  padding: 22px;
  margin: min(12vh, 86px) auto 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.login h1 { margin-block: 13px 18px; }
.login__mark { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 11px; background: #493022; color: var(--accent); }
.token-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }

.work-nav { display: flex; gap: 6px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.work-nav button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 46px;
  padding: 4px 7px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  font-size: .87rem;
  font-weight: 760;
  color: var(--muted);
}
.work-nav button[aria-pressed="true"] { color: var(--accent); border-color: #8d5d40; background: #3b2921; }
.work-nav button:hover { color: var(--text); }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-block: 22px 12px; }
.section-head p { color: var(--muted); font-size: .84rem; margin-block-start: 3px; }
.section-head button { flex: none; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-block-end: 10px; }
.filters select { width: auto; max-width: 100%; font-size: .83rem; }
.search { display: flex; flex: 1 1 158px; align-items: center; gap: 7px; padding-inline: 10px; background: var(--field); border-radius: 9px; border: 1px solid var(--line); color: var(--muted); }
.search input:not([type=checkbox]) { border: 0; padding-inline: 0; background: transparent; font-size: .87rem; }
.rows { padding: 0; list-style: none; border-radius: 12px; overflow: clip; }
.row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 9px 11px; background: var(--surface); border: 1px solid var(--line); }
.row + .row { border-block-start: 0; }
.row:first-child { border-start-start-radius: 12px; border-start-end-radius: 12px; }
.row:last-child { border-end-start-radius: 12px; border-end-end-radius: 12px; }
.row__mark { display: grid; width: 37px; height: 38px; place-items: center; background: #382821; color: var(--accent); border-radius: 8px; }
.row__line { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.row__body { min-width: 0; }
.row__body strong { font-size: .95rem; overflow-wrap: anywhere; }
.row__sub { display: block; color: var(--muted); font-size: .77rem; }
.pack__price { font-size: .9rem; text-align: end; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pill { border-radius: 5px; padding-inline: 5px; color: #ffca93; background: #443022; font-size: .68rem; font-weight: 760; white-space: nowrap; }
.pill[data-state="answered"] { color: var(--success); background: #27362b; }
.pill[data-state="closed"] { color: var(--muted); background: var(--paper); }
.state { padding: 19px 13px; margin-block: 7px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); font-size: .86rem; }
.feedback { color: var(--success); font-size: .85rem; padding-block: 4px; }
.feedback[data-error] { color: var(--error); }
.ticket-list-row { display: block; padding: 0; }
.ticket-button { display: grid; grid-template-columns: minmax(0, 1fr) auto; width: 100%; min-height: 59px; padding: 10px 13px; align-items: start; gap: 6px; border: 0; text-align: start; color: inherit; background: none; }
.ticket-button:hover { background: var(--paper); }
.ticket-button .row__sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.more { margin-block-start: 10px; }

dialog { width: min(455px, calc(100% - 24px)); max-height: calc(100dvh - 30px); padding: 16px; overflow: auto; color: var(--text); background: var(--surface); border: 1px solid #9b6849; border-radius: 14px; box-shadow: 0 15px 50px #0009; }
dialog::backdrop { background: #0e0b0cce; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-block-end: 12px; }
.checks { display: grid; gap: 1px; margin-block: 3px; }
.checks label { display: flex; align-items: center; gap: 8px; min-height: 42px; cursor: pointer; font-size: .9rem; }
.checks input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.thread-tools { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-block-end: 9px; }
.messages { display: grid; gap: 8px; list-style: none; padding: 0; margin-block: 9px 13px; }
.messages li { width: 94%; padding: 9px 10px; border-radius: 9px; background: var(--field); border: 1px solid var(--line); overflow-wrap: anywhere; }
.messages li[data-author="admin"] { justify-self: end; background: #352820; }
.messages p { white-space: pre-wrap; font-size: .91rem; }

@media (min-width: 640px) {
  .main { padding-block-start: 28px; }
  .work-nav { width: 345px; }
  .section-head { margin-block: 27px 14px; }
  .filters > .search { flex: 0 1 300px; }
  .row { padding-inline: 15px; }
  .ticket-list-row { padding: 0; }
}

@media (max-width: 550px) {
  .pack { grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 7px; row-gap: 0; }
  .pack .row__mark { grid-row: span 2; }
  .pack__price { grid-column: 2; grid-row: 2; text-align: start; font-size: .84rem; }
  .pack__edit { grid-row: 1 / span 2; grid-column: 3; }
}

@media (max-width: 350px) {
  .shell { width: calc(100% - 20px); }
  .top__actions .icon { display: none; }
  .section-head h1 { font-size: 1.25rem; }
  .section-head .button { padding-inline: 8px; }
}
