/* Helpdesk — единая тема публичной формы и кабинета. */

:root {
  --page: #f2efe6;
  --page-deep: #e9e5d9;
  --surface: #fffdf8;
  --surface-soft: #f7f5ee;
  --ink: #17231f;
  --ink-soft: #3c4b46;
  --muted: #6b7772;
  --line: #dedbd0;
  --line-strong: #cbc7ba;
  --accent: #0f6654;
  --accent-strong: #0a4c3e;
  --accent-soft: #e3f0ea;
  --accent-bright: #b6dfcf;
  --amber: #a46112;
  --amber-soft: #fbefd5;
  --danger: #a63d2f;
  --danger-soft: #fbe8e4;
  --blue: #1f6078;
  --blue-soft: #e3f0f5;
  --green: #276749;
  --green-soft: #e7f3eb;
  --staff-bg: #eff2ee;
  --staff-ink: #142a24;
  --topbar: #112a23;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --shadow-soft: 0 8px 30px rgba(22, 43, 36, .06);
  --shadow-card: 0 22px 70px rgba(22, 43, 36, .12);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --max-width: 1180px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-strong);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
p,
dl,
dd,
ol,
ul {
  margin-top: 0;
}

h1,
h2,
h3 {
  line-height: 1.15;
}

:focus-visible {
  outline: 3px solid rgba(15, 102, 84, .35);
  outline-offset: 2px;
}

::selection {
  background: var(--accent-bright);
  color: var(--ink);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.muted {
  color: var(--muted);
}

.required-mark {
  color: var(--danger);
  font-weight: 700;
}

/* ---------- Общие элементы ---------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.brand:hover {
  color: inherit;
}

.brand-mark {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--accent);
  color: #f5fff9;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}

.brand-mark svg {
  width: 27px;
  height: 27px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-text strong {
  font-size: 15px;
  letter-spacing: .01em;
}

.brand-text span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button svg {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
}

.button-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 20px rgba(15, 102, 84, .2);
}

.button-primary:hover {
  background: var(--accent-strong);
  color: #fff;
  box-shadow: 0 10px 24px rgba(15, 102, 84, .26);
}

.button-secondary {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.button-secondary:hover {
  background: #d6e9e1;
  color: var(--accent-strong);
}

.button-success {
  background: var(--green);
  color: #fff;
}

.button-success:hover {
  background: #1d543b;
  color: #fff;
}

.button-ghost {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--ink-soft);
}

.button-ghost:hover {
  border-color: var(--ink-soft);
  background: rgba(255, 255, 255, .5);
  color: var(--ink);
}

.button-small {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
}

.button-full {
  width: 100%;
}

.button:disabled {
  cursor: wait;
  opacity: .72;
  transform: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 20px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(15, 102, 84, .11);
}

.eyebrow-dark {
  margin-bottom: 10px;
  color: var(--accent);
}

.form-step {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.form-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  margin-bottom: 20px;
  border: 1px solid #efc8c0;
  border-radius: 12px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 14px;
}

.form-alert svg {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  margin-top: 1px;
}

.form-alert p {
  margin: 0;
}

.form-alert p + p {
  margin-top: 4px;
}

.field {
  display: flex;
  flex-direction: column;
}

.field label {
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 650;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.field input {
  min-height: 49px;
  padding: 12px 14px;
}

.field textarea {
  padding: 13px 14px;
  resize: vertical;
  min-height: 128px;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #9aa39f;
}

.field input:hover,
.field textarea:hover {
  border-color: #b4afa1;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 102, 84, .13);
}

.field-hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.field-error {
  margin: 6px 0 0;
  color: var(--danger);
  font-size: 12.5px;
  font-weight: 600;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.field-wide {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: 22px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  cursor: pointer;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.checkbox-field span {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.checkbox-field strong {
  font-size: 13px;
}

.checkbox-field small {
  color: var(--muted);
  font-size: 12px;
}

/* ---------- Публичная страница ---------- */

.public-body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 8% 6%, rgba(217, 165, 79, .18), transparent 32rem),
    radial-gradient(ellipse at 95% 22%, rgba(32, 110, 88, .13), transparent 34rem),
    var(--page);
}

.public-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0 28px;
}

.public-header {
  width: 100%;
  max-width: var(--max-width);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto;
  padding: 24px 0 12px;
}

.staff-link {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: color .15s ease;
}

.staff-link span {
  display: inline-block;
  margin-left: 5px;
  transition: transform .15s ease;
}

.staff-link:hover span {
  transform: translateX(3px);
}

.public-main {
  width: 100%;
  max-width: var(--max-width);
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 530px);
  align-items: start;
  gap: clamp(34px, 7vw, 96px);
  margin: 0 auto;
  padding: clamp(44px, 7vh, 88px) 0 70px;
}

.public-intro {
  padding-top: 18px;
}

.public-intro h1 {
  max-width: 620px;
  margin-bottom: 24px;
  font-family: var(--font-display);
  font-size: clamp(46px, 6.2vw, 82px);
  font-weight: 500;
  letter-spacing: -.045em;
  line-height: .98;
}

.public-intro .lead {
  max-width: 480px;
  margin-bottom: 38px;
  color: var(--ink-soft);
  font-size: clamp(16px, 1.4vw, 18px);
  line-height: 1.65;
}

.intro-points {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 460px;
  margin-bottom: 32px;
  border-top: 1px solid var(--line-strong);
}

.intro-point {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 14px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.point-number {
  padding-top: 2px;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 15px;
  font-style: italic;
}

.intro-point p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 440px;
  color: var(--muted);
}

.privacy-note svg {
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
  margin-top: 1px;
  color: var(--accent);
}

.privacy-note p {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
}

.form-card {
  position: relative;
  padding: clamp(25px, 3.4vw, 38px);
  border: 1px solid rgba(212, 206, 191, .9);
  border-radius: var(--radius-xl);
  background: rgba(255, 253, 248, .94);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(7px);
  scroll-margin-top: 24px;
}

.form-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 36px;
  right: 36px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, var(--accent), #40917b 55%, #c99a48);
}

.form-card-head {
  margin-bottom: 26px;
}

.form-card-head h2 {
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-size: clamp(27px, 3vw, 34px);
  font-weight: 500;
  letter-spacing: -.02em;
}

.form-card-head > p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.ticket-form {
  display: flex;
  flex-direction: column;
  gap: 19px;
}

.contacts-fieldset {
  min-width: 0;
  margin: 3px 0 0;
  padding: 20px 0 0;
  border: 0;
  border-top: 1px dashed var(--line-strong);
}

.contacts-fieldset legend {
  padding: 0;
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
}

.fieldset-hint {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 12px;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.button-submit {
  width: 100%;
  min-height: 54px;
  margin-top: 4px;
  border-radius: 13px;
  font-size: 15px;
}

.submit-note {
  margin: -7px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
}

.public-footer {
  width: 100%;
  max-width: var(--max-width);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 auto;
  padding: 20px 0 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.public-footer p {
  margin: 0;
}

.public-footer a {
  color: var(--muted);
  text-decoration: none;
}

.public-footer a:hover {
  color: var(--accent);
}

/* ---------- Страница подтверждения ---------- */

.accepted-page {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(32, 110, 88, .16), transparent 40rem),
    var(--page);
}

.accepted-wrap {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 40px 0 60px;
}

.accepted-card {
  width: min(100%, 580px);
  padding: clamp(30px, 6vw, 56px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.success-icon {
  width: 82px;
  height: 82px;
  margin: 0 auto 24px;
  color: var(--accent);
}

.success-icon svg {
  width: 100%;
  height: 100%;
}

.accepted-card .form-step {
  margin-bottom: 10px;
}

.accepted-card h1 {
  margin-bottom: 18px;
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 48px);
  font-weight: 500;
  letter-spacing: -.03em;
}

.accepted-text {
  max-width: 430px;
  margin: 0 auto 24px;
  color: var(--ink-soft);
  font-size: 15px;
}

.number-ticket {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 320px;
  margin: 0 auto 18px;
  padding: 16px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--surface-soft);
}

.number-ticket span {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.number-ticket strong {
  color: var(--accent-strong);
  font-size: 24px;
  letter-spacing: .04em;
}

.accepted-hint {
  max-width: 430px;
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: 12px;
}

.accepted-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.accepted-actions .button {
  flex: 1;
  min-width: 190px;
}

/* ---------- Страницы ошибок ---------- */

.error-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 22px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(32, 110, 88, .14), transparent 36rem),
    var(--page);
}

.error-card {
  width: min(100%, 560px);
  padding: clamp(30px, 7vw, 58px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.error-code {
  margin-bottom: 12px;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: clamp(64px, 14vw, 104px);
  font-style: italic;
  line-height: .85;
  opacity: .78;
}

.error-card h1 {
  margin-bottom: 14px;
  font-family: var(--font-display);
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 500;
  letter-spacing: -.03em;
}

.error-card > p:not(.form-step) {
  max-width: 410px;
  margin: 0 auto 25px;
  color: var(--ink-soft);
  font-size: 14px;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
}

.error-actions .button {
  flex: 1;
  min-width: 180px;
}

/* ---------- Вход ---------- */

.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 24px 48px;
  background:
    radial-gradient(circle at 12% 16%, rgba(183, 224, 208, .13), transparent 24rem),
    radial-gradient(circle at 88% 80%, rgba(201, 154, 72, .12), transparent 28rem),
    #122c25;
}

.login-brand {
  width: min(100%, 1050px);
  margin-bottom: auto;
}

.login-brand .brand-text strong,
.login-brand .brand-text span {
  color: #edf8f2;
}

.login-brand .brand-text span {
  opacity: .62;
}

.login-brand .brand-mark {
  background: #e8f4ee;
  color: #12382d;
}

.login-card {
  width: min(100%, 440px);
  margin: 56px auto auto;
  padding: clamp(26px, 5vw, 40px);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .28);
}

.login-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
}

.login-icon svg {
  width: 28px;
  height: 28px;
}

.login-card h1 {
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-size: 37px;
  font-weight: 500;
  letter-spacing: -.025em;
}

.login-lead {
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 14px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 17px;
}

.login-help {
  margin: 24px 0 15px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.back-link {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  text-decoration: none;
}

.back-link:hover {
  color: var(--accent);
}

.login-page .public-footer {
  display: none;
}

/* ---------- Каркас кабинета ---------- */

.staff-body {
  background: var(--staff-bg);
  color: var(--staff-ink);
}

.staff-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(17, 42, 35, .97);
  color: #f5fbf7;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06);
  backdrop-filter: blur(10px);
}

.staff-topbar-inner {
  width: min(100% - 48px, var(--max-width));
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 34px;
  margin: 0 auto;
}

.brand-staff .brand-mark {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
  border-radius: 12px;
  background: #dff0e8;
  color: #12382d;
}

.brand-staff .brand-mark svg {
  width: 23px;
  height: 23px;
}

.brand-staff .brand-text strong {
  color: #f4fbf7;
}

.brand-staff .brand-text span {
  color: rgba(236, 248, 242, .56);
}

.staff-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.staff-nav a {
  padding: 8px 13px;
  border-radius: 8px;
  color: rgba(239, 250, 244, .68);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}

.staff-nav a:hover,
.staff-nav a.is-active {
  background: rgba(255, 255, 255, .09);
  color: #fff;
}

.staff-account {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.account-name {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 230px;
  overflow: hidden;
  color: rgba(244, 252, 247, .85);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-avatar,
.mini-avatar {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 750;
  line-height: 1;
}

.account-avatar {
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  background: rgba(221, 241, 232, .14);
  color: #d8f2e7;
  font-size: 12px;
}

.mini-avatar {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  font-size: 10px;
}

.logout-button {
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: rgba(240, 251, 245, .55);
  font-size: 12px;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, .25);
  text-underline-offset: 3px;
}

.logout-button:hover {
  color: #fff;
}

.staff-main {
  width: min(100% - 48px, var(--max-width));
  min-height: calc(100vh - 150px);
  margin: 0 auto;
  padding: 38px 0 62px;
}

.staff-footer {
  width: min(100% - 48px, var(--max-width));
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 0 auto;
  padding: 18px 0 28px;
  border-top: 1px solid #d9ded8;
  color: var(--muted);
  font-size: 11px;
}

.staff-footer a {
  color: var(--muted);
  text-decoration: none;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.message {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  font-size: 13px;
}

.message-success {
  border-color: #bcdcc9;
  background: #edf8f1;
  color: #245d42;
}

.message-error {
  border-color: #edc4bc;
  background: #fdf0ed;
  color: var(--danger);
}

.message-warning {
  border-color: #ead5a8;
  background: #fdf6e6;
  color: #7c530e;
}

.message-info {
  border-color: #c8dbe1;
  background: #eef6f8;
  color: #24596a;
}

.message-close {
  flex: 0 0 auto;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 20px;
  line-height: 1;
  opacity: .65;
}

.message-close:hover {
  opacity: 1;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 27px;
}

.page-heading h1 {
  margin-bottom: 5px;
  font-size: clamp(30px, 4vw, 38px);
  font-weight: 700;
  letter-spacing: -.035em;
}

.page-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.page-subtitle strong {
  color: var(--accent);
}

.dashboard-tools {
  padding: 14px;
  border: 1px solid #dde2dc;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, .58);
}

.status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
}

.status-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 9px;
  color: #52605b;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
}

.status-tab span {
  min-width: 19px;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(23, 42, 35, .06);
  color: #69756f;
  font-size: 10px;
  text-align: center;
}

.status-tab:hover {
  background: rgba(15, 102, 84, .06);
  color: var(--accent-strong);
}

.status-tab.is-active {
  background: var(--accent);
  color: #fff;
}

.status-tab.is-active span {
  background: rgba(255, 255, 255, .18);
  color: #e8fff5;
}

.search-form {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-icon {
  position: absolute;
  left: 13px;
  width: 19px;
  height: 19px;
  color: #82908a;
  pointer-events: none;
}

.search-form input {
  width: 100%;
  min-height: 43px;
  padding: 9px 12px 9px 40px;
  border: 1px solid #d5dcd5;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}

.search-form input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 102, 84, .1);
}

.search-form button {
  min-height: 43px;
  flex: 0 0 auto;
  padding: 8px 17px;
  border: 0;
  border-radius: 10px;
  background: var(--staff-ink);
  color: #fff;
  font-size: 12px;
  font-weight: 650;
}

.search-form button:hover {
  background: var(--accent-strong);
}

.filter-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 2px 0;
  color: var(--muted);
  font-size: 12px;
}

.filter-summary a {
  color: var(--accent);
  font-weight: 600;
}

/* ---------- Список заявок ---------- */

.ticket-list {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid #dce1db;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.ticket-list-head,
.ticket-row {
  display: grid;
  grid-template-columns: 96px 106px minmax(130px, .8fr) minmax(210px, 1.55fr) 122px minmax(150px, 1fr);
  align-items: center;
  gap: 15px;
  padding: 0 19px;
}

.ticket-list-head {
  min-height: 40px;
  border-bottom: 1px solid var(--line);
  background: #faf8f1;
  color: #7a857f;
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.ticket-row {
  min-height: 73px;
  border-bottom: 1px solid #ecebe4;
  color: inherit;
  text-decoration: none;
  transition: background-color .13s ease;
}

.ticket-row:last-child {
  border-bottom: 0;
}

.ticket-row:hover {
  background: #fbfaf5;
  color: inherit;
}

.ticket-row.is-new {
  box-shadow: inset 3px 0 0 var(--amber);
}

.ticket-number {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .015em;
}

.ticket-date {
  display: flex;
  flex-direction: column;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.3;
}

.ticket-date small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.ticket-client {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-description {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-assignee {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unassigned {
  color: #98a19d;
  font-size: 11.5px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .01em;
  white-space: nowrap;
}

.status-badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: .7;
}

.status-new {
  background: var(--amber-soft);
  color: #86530d;
}

.status-in_progress {
  background: var(--blue-soft);
  color: var(--blue);
}

.status-done {
  background: var(--green-soft);
  color: var(--green);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 12px;
}

.pagination a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.pagination .is-disabled {
  opacity: .45;
}

.page-count {
  font-size: 11px;
}

.empty-state {
  margin-top: 20px;
  padding: 58px 28px;
  border: 1px dashed #ccd4cb;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, .48);
  text-align: center;
}

.empty-state.compact {
  padding: 38px 24px;
  margin-top: 0;
  border: 0;
  background: transparent;
}

.empty-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto 17px;
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--accent);
}

.empty-icon svg {
  width: 34px;
  height: 34px;
}

.empty-state h2 {
  margin-bottom: 7px;
  font-size: 21px;
  letter-spacing: -.02em;
}

.empty-state p {
  max-width: 390px;
  margin: 0 auto 18px;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Карточка заявки ---------- */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 17px;
  color: #8a958f;
  font-size: 11.5px;
}

.breadcrumb a {
  color: #6e7c75;
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.detail-heading {
  margin-bottom: 22px;
}

.title-with-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 13px;
}

.title-with-status h1 {
  margin-bottom: 5px;
  font-size: clamp(27px, 3.7vw, 36px);
  letter-spacing: -.035em;
}

.assignment-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px 15px;
  border: 1px solid #c9dce1;
  border-radius: 11px;
  background: #f0f7f9;
  color: #315e6b;
  font-size: 12.5px;
}

.assignment-banner p {
  margin: 0;
}

.assignment-banner .mini-avatar {
  background: #d9ecf1;
  color: #205666;
}

.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 26px;
}

.action-bar form {
  margin: 0;
}

.action-bar .button {
  min-height: 42px;
  font-size: 12.5px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, .9fr);
  align-items: start;
  gap: 20px;
}

.detail-main,
.detail-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel {
  border: 1px solid #dce1db;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 21px 0;
}

.panel-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: -.01em;
}

.panel-meta {
  color: #8d9792;
  font-size: 10.5px;
}

.internal-label,
.public-label {
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--surface-soft);
  color: #8a938e;
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: .02em;
}

.public-label {
  background: #eaf6ee;
  color: #2c6a46;
}

.public-reply-block {
  margin-top: 4px;
  padding: 15px;
  border: 1px solid #d4e6d9;
  border-radius: 10px;
  background: #fbfdfb;
}

.comment-hint {
  margin: -2px 0 10px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.problem-text {
  padding: 15px 21px 24px;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.72;
  overflow-wrap: anywhere;
}

.contact-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 9px;
  padding: 15px 21px 21px;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #e8e6dd;
  border-radius: 10px;
  background: #fcfbf6;
}

.contact-icon {
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
}

.contact-icon svg {
  width: 15px;
  height: 15px;
}

.contact-item > div {
  min-width: 0;
}

.contact-item span:not(.contact-icon) {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.contact-item a,
.contact-item strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 650;
  text-decoration: none;
}

.contact-item a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.contact-extra {
  margin: -8px 21px 20px;
  color: var(--muted);
  font-size: 11px;
}

.contact-extra code {
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--surface-soft);
}

/* История */

.timeline {
  margin: 0;
  padding: 18px 21px 8px;
  list-style: none;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr);
  gap: 11px;
  padding-bottom: 18px;
}

.timeline-item:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 28px;
  bottom: 0;
  left: 13px;
  width: 1px;
  background: #e4e6df;
}

.timeline-dot {
  position: relative;
  z-index: 1;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid #dce1db;
  border-radius: 8px;
  background: #f8f7f1;
  color: #72817a;
}

.timeline-dot svg {
  width: 14px;
  height: 14px;
}

.event-completed .timeline-dot {
  border-color: #c7e1d1;
  background: var(--green-soft);
  color: var(--green);
}

.event-comment .timeline-dot {
  border-color: #d5e4df;
  background: var(--accent-soft);
  color: var(--accent);
}

.event-created .timeline-dot {
  border-color: #ecddbd;
  background: #fcf4e4;
  color: #8a641e;
}

.timeline-content {
  min-width: 0;
  padding-top: 3px;
}

.timeline-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.timeline-top strong {
  font-size: 12px;
  font-weight: 700;
}

.timeline-top time {
  color: #929b96;
  font-size: 9.5px;
}

.timeline-message {
  margin: 6px 0 4px;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.event-comment .timeline-message {
  padding: 9px 11px;
  border-left: 2px solid var(--accent-bright);
  border-radius: 0 7px 7px 0;
  background: #f7faf7;
}

.timeline-author {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.status-change {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin: 7px 0;
  color: #a0a8a3;
  font-size: 10px;
}

.timeline-empty {
  padding: 10px 0 18px;
  color: var(--muted);
  font-size: 12px;
}

.comment-block {
  margin: 0 21px 21px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.comment-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.comment-heading h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
}

.comment-block textarea {
  min-height: 91px;
}

.comment-block .button {
  margin-top: 8px;
}

/* Боковая колонка */

.side-panel .panel-head {
  padding-bottom: 13px;
}

.meta-list {
  margin: 0;
  padding: 0 21px 12px;
}

.meta-list > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid #ecece5;
  font-size: 11.5px;
}

.meta-list dt {
  flex: 0 0 auto;
  color: var(--muted);
}

.meta-list dd {
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

.assignee-value {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  justify-content: flex-end;
  font-weight: 650;
}

.notification-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 0 17px 8px;
}

.notification-card {
  padding: 12px;
  border: 1px solid #e6e6dd;
  border-radius: 10px;
  background: #fdfcf8;
}

.notification-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.channel-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
}

.channel-icon svg {
  width: 16px;
  height: 16px;
}

.channel-email {
  background: #edf1f8;
  color: #3e5d86;
}

.channel-telegram {
  background: #e5f2f7;
  color: #28708c;
}

.notification-name {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.notification-name strong {
  font-size: 11.5px;
}

.notification-name span {
  color: var(--muted);
  font-size: 9px;
}

.notif-badge {
  margin-left: auto;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 8.5px;
  font-weight: 750;
  white-space: nowrap;
}

.notif-pending {
  background: var(--amber-soft);
  color: #86530d;
}

.notif-processing {
  background: var(--blue-soft);
  color: var(--blue);
}

.notif-sent {
  background: var(--green-soft);
  color: var(--green);
}

.notif-failed {
  background: var(--danger-soft);
  color: var(--danger);
}

.notification-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 11px;
  margin-top: 7px;
  color: #8b948f;
  font-size: 9.5px;
}

.notification-error {
  margin: 8px 0 0;
  padding: 6px 8px;
  border-radius: 5px;
  background: #fbf0ed;
  color: #8b4236;
  font-size: 10px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.notification-card .button {
  margin-top: 9px;
  min-height: 32px;
  padding: 6px 10px;
  font-size: 10px;
}

.panel-note {
  margin: 0;
  padding: 4px 19px 18px;
  color: #929b96;
  font-size: 9.5px;
  line-height: 1.45;
}

/* ---------- Сотрудники ---------- */

.employees-table {
  overflow: hidden;
  border-radius: var(--radius-md);
}

.employees-head,
.employee-row {
  display: grid;
  grid-template-columns: minmax(120px, .8fr) minmax(140px, 1fr) minmax(190px, 1.3fr) 140px 100px;
  align-items: center;
  gap: 16px;
  padding: 0 21px;
}

.employees-head {
  min-height: 43px;
  border-bottom: 1px solid var(--line);
  background: #faf8f1;
  color: #7a857f;
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.employee-row {
  min-height: 65px;
  border-bottom: 1px solid #ecebe4;
  color: var(--ink-soft);
  font-size: 12px;
}

.employee-row:last-child {
  border-bottom: 0;
}

.employee-username {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 700;
}

.role-badge {
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--surface-soft);
  color: #6b7670;
  font-size: 9.5px;
  font-weight: 650;
  white-space: nowrap;
}

.role-admin {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.access-active {
  color: var(--green);
  font-size: 10.5px;
  font-weight: 600;
}

.access-active::before,
.access-off::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 5px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 1px;
}

.access-off {
  color: var(--danger);
  font-size: 10.5px;
}

.admin-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.narrow-layout {
  max-width: 760px;
}

.narrow-layout .panel {
  padding: 24px;
}

.employee-form .form-grid {
  gap: 17px;
}

/* ---------- Новые элементы заявки ---------- */

.public-header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.public-footer-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.form-grid-tight {
  gap: 13px;
}

.upload-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.telegram-link-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 11.5px;
  line-height: 1.5;
}

.telegram-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 22px;
  padding: 16px 17px;
  border: 1px solid #cfe1d5;
  border-radius: 14px;
  background: linear-gradient(135deg, #f3faf5, #eef6f8);
}

.telegram-cta-copy {
  min-width: 0;
}

.telegram-cta-kicker {
  margin: 0 0 4px;
  color: #3c7b5a;
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.telegram-cta h2 {
  margin: 0 0 6px;
  font-size: 17px;
  letter-spacing: -.02em;
}

.telegram-cta p {
  margin: 0 0 10px;
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.5;
}

.telegram-cta .button {
  min-height: 38px;
}

.telegram-qr-link {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 9px;
  text-decoration: none;
}

.telegram-qr {
  display: block;
  width: 132px;
  height: 132px;
  padding: 5px;
  border: 1px solid #d7e3da;
  border-radius: 9px;
  background: #fff;
}

.upload-label {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 13px;
  background: #fcfbf6;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}

.upload-label:hover,
.upload-field:focus-within .upload-label {
  border-color: var(--accent);
  background: #f7fbf8;
}

.upload-label input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

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

.upload-icon svg {
  width: 21px;
  height: 21px;
}

.upload-label > span:last-of-type {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.upload-label strong {
  color: var(--ink);
  font-size: 13px;
}

.upload-label small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.file-selection {
  margin: 0;
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 600;
}

.upload-field.has-error .upload-label {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.public-messages {
  width: min(100%, 580px);
  margin: 0 auto 16px;
}

.notification-note {
  padding: 10px 13px;
  border: 1px solid #c9ded4;
  border-radius: 10px;
  background: #f1f8f4;
  font-size: 13px;
}

.tracking-direct {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 10.5px;
}

.tracking-direct a {
  overflow-wrap: anywhere;
  font-size: 11px;
}

/* ---------- Отслеживание ---------- */

.tracking-page {
  background:
    radial-gradient(ellipse at 5% 0%, rgba(217, 165, 79, .14), transparent 30rem),
    radial-gradient(ellipse at 100% 20%, rgba(32, 110, 88, .11), transparent 30rem),
    var(--page);
}

.tracking-wrap {
  width: min(100%, 840px);
  flex: 1;
  margin: 0 auto;
  padding: clamp(40px, 7vh, 78px) 0 64px;
}

.tracking-card,
.tracking-result {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.tracking-card {
  max-width: 590px;
  margin: 0 auto;
  padding: clamp(26px, 5vw, 44px);
}

.tracking-card h1,
.tracking-result h1 {
  margin-bottom: 12px;
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 48px);
  font-weight: 500;
  letter-spacing: -.035em;
}

.tracking-lead {
  margin-bottom: 25px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
}

.tracking-form {
  display: flex;
  flex-direction: column;
  gap: 17px;
}

.tracking-hint {
  margin: 22px 0 0;
  padding-top: 17px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}

.tracking-result {
  padding: clamp(24px, 5vw, 44px);
}

.tracking-result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.tracking-result-head .form-step {
  margin-bottom: 8px;
}

.tracking-result-head .tracking-lead {
  margin-bottom: 0;
}

.tracking-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 30px 0;
  padding: 0;
  list-style: none;
}

.tracking-progress li {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: #9ba39f;
}

.tracking-progress li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 13px;
  left: 32px;
  right: 8px;
  height: 1px;
  background: #e0e2db;
}

.tracking-progress li.is-complete:not(:last-child)::after {
  background: var(--accent-bright);
}

.progress-dot {
  position: relative;
  z-index: 1;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  display: grid;
  place-items: center;
  border: 1px solid #dfe2db;
  border-radius: 50%;
  background: #f8f7f1;
  color: #8c9791;
  font-size: 11px;
  font-weight: 700;
}

.tracking-progress .is-complete {
  color: var(--accent-strong);
}

.tracking-progress .is-complete .progress-dot {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.tracking-progress strong,
.tracking-progress small {
  display: block;
  line-height: 1.4;
}

.tracking-progress strong {
  margin-top: 3px;
  font-size: 11.5px;
}

.tracking-progress small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9.5px;
}

.tracking-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 16px;
  margin-bottom: 18px;
}

.tracking-section {
  padding: 18px;
  border: 1px solid #e6e6dd;
  border-radius: 13px;
  background: #fcfbf6;
}

.tracking-section h2 {
  margin-bottom: 13px;
  font-size: 13px;
  font-weight: 750;
}

.tracking-meta {
  padding: 0;
}

.tracking-meta > div:first-child {
  border-top: 0;
  padding-top: 0;
}

.tracking-description {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.tracking-history {
  margin-top: 16px;
}

.tracking-timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tracking-timeline li {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 0 0 15px 0;
}

.tracking-timeline li:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 0;
  left: 4px;
  width: 1px;
  background: #e1e4dd;
}

.tracking-timeline-dot {
  position: relative;
  z-index: 1;
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.tracking-timeline strong {
  font-size: 11.5px;
}

.tracking-timeline time {
  margin-left: 8px;
  color: var(--muted);
  font-size: 9.5px;
}

.tracking-timeline p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 11.5px;
}

.tracking-event-author {
  display: inline-block;
  margin-top: 4px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 650;
}

.tracking-reply {
  margin-top: 16px;
}

.tracking-reply-note {
  margin: -4px 0 13px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.tracking-reply textarea {
  min-height: 112px;
}

.tracking-reply .button {
  margin-top: 10px;
}

.tracking-success {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid #b9d9c5;
  border-radius: 10px;
  background: #eef8f1;
  color: #23613e;
  font-size: 12.5px;
}

.tracking-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 23px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.tracking-security-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

/* ---------- Кабинет: новые блоки ---------- */

.auto-refresh-note {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 8px;
  color: #8c9690;
  font-size: 10px;
}

.auto-refresh-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 102, 84, .09);
}

.ticket-client small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 400;
  text-overflow: ellipsis;
}

.attachment-count {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 5px;
  color: #78847d;
  font-size: 9.5px;
}

.attachment-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 14px 21px 19px;
  list-style: none;
}

.attachment-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid #e8e6dd;
  border-radius: 9px;
  background: #fcfbf6;
}

.attachment-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
}

.attachment-icon svg {
  width: 16px;
  height: 16px;
}

.attachment-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.attachment-info strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-info small {
  color: var(--muted);
  font-size: 9px;
}

.attachment-download {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 4px 7px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 9.5px;
  font-weight: 700;
  text-decoration: none;
}

.attachment-download:hover {
  background: #d5e9e0;
  color: var(--accent-strong);
}

.attachment-empty {
  padding: 5px 21px 20px;
  font-size: 12px;
}

.contact-note {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8.5px;
}

.contact-extra p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.45;
}

.tracking-link-box {
  margin: 0 18px 18px;
  padding: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #fbfaf4;
}

.tracking-link-box span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.tracking-link-box a {
  display: block;
  overflow-wrap: anywhere;
  font-size: 10px;
}

.organization-list {
  overflow: hidden;
}

.organization-head,
.organization-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) minmax(120px, 1fr) 70px 70px 80px 90px;
  align-items: center;
  gap: 14px;
  padding: 0 19px;
}

.organization-head {
  min-height: 40px;
  border-bottom: 1px solid var(--line);
  background: #faf8f1;
  color: #7a857f;
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.organization-row {
  min-height: 60px;
  border-bottom: 1px solid #ecebe4;
  color: var(--ink-soft);
  font-size: 12px;
  text-decoration: none;
}

.organization-row:last-child {
  border-bottom: 0;
}

.organization-row:hover {
  background: #fbfaf5;
  color: var(--ink);
}

.organization-name {
  color: var(--ink);
  font-weight: 700;
}

.organization-count {
  display: inline-grid;
  place-items: center;
  width: 27px;
  height: 24px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
}

.count-new {
  background: var(--amber-soft);
  color: #86530d;
}

.count-progress {
  background: var(--blue-soft);
  color: var(--blue);
}

.count-done {
  background: var(--green-soft);
  color: var(--green);
}

/* ---------- Адаптивность ---------- */

@media (max-width: 1020px) {
  .public-main {
    grid-template-columns: minmax(0, .9fr) minmax(370px, 1.1fr);
    gap: 40px;
  }

  .public-intro h1 {
    font-size: clamp(43px, 6vw, 62px);
  }

  .public-intro .lead {
    font-size: 15.5px;
  }

  .detail-layout {
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, .85fr);
  }

  .ticket-list-head,
  .ticket-row {
    grid-template-columns: 85px 92px minmax(110px, .75fr) minmax(150px, 1.35fr) 105px minmax(120px, .9fr);
    gap: 11px;
    padding-left: 15px;
    padding-right: 15px;
  }
}

@media (max-width: 860px) {
  .public-page {
    padding: 0 20px;
  }

  .public-header {
    padding-top: 18px;
  }

  .public-main {
    grid-template-columns: 1fr;
    gap: 30px;
    padding-top: 39px;
  }

  .public-intro {
    padding-top: 0;
  }

  .public-intro h1 {
    max-width: 540px;
    font-size: clamp(45px, 9vw, 68px);
  }

  .public-intro .lead {
    max-width: 560px;
    margin-bottom: 26px;
  }

  .intro-points {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: none;
    border-top: 0;
    gap: 14px;
    margin-bottom: 24px;
  }

  .intro-point {
    display: block;
    padding: 0;
    border-bottom: 0;
  }

  .point-number {
    display: block;
    margin-bottom: 4px;
  }

  .privacy-note {
    max-width: 560px;
  }

  .form-card {
    max-width: 640px;
  }

  .staff-topbar-inner {
    width: min(100% - 34px, var(--max-width));
    flex-wrap: wrap;
    gap: 10px 20px;
    padding: 11px 0;
  }

  .staff-nav {
    order: 3;
    width: 100%;
    padding-top: 2px;
    border-top: 1px solid rgba(255, 255, 255, .08);
  }

  .staff-nav a {
    padding: 7px 10px;
  }

  .staff-account {
    gap: 10px;
  }

  .account-name > span:last-child {
    display: none;
  }

  .staff-main,
  .staff-footer {
    width: min(100% - 34px, var(--max-width));
  }

  .staff-main {
    padding-top: 28px;
  }

  .ticket-list {
    border: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }

  .ticket-list-head {
    display: none;
  }

  .ticket-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "number status"
      "client assignee"
      "description description"
      "date date";
    gap: 7px 14px;
    min-height: 0;
    margin-bottom: 9px;
    padding: 15px 16px;
    border: 1px solid #dce1db;
    border-radius: 13px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
  }

  .ticket-row.is-new {
    box-shadow: inset 3px 0 0 var(--amber), var(--shadow-soft);
  }

  .ticket-number {
    grid-area: number;
  }

  .ticket-status {
    grid-area: status;
    justify-self: end;
  }

  .ticket-client {
    grid-area: client;
  }

  .ticket-description {
    grid-area: description;
    color: var(--ink-soft);
    white-space: normal;
  }

  .ticket-date {
    grid-area: date;
    flex-direction: row;
    gap: 6px;
    font-size: 10.5px;
  }

  .ticket-date small {
    margin: 0;
  }

  .ticket-assignee {
    grid-area: assignee;
    justify-content: flex-end;
    max-width: 46vw;
  }

  .pagination {
    margin-top: 18px;
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-side {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .employees-head {
    display: none;
  }

  .employee-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 16px;
    padding: 14px 17px;
  }

  .employee-row > span:nth-child(2),
  .employee-row > span:nth-child(3) {
    color: var(--muted);
    font-size: 10.5px;
  }

  .employee-row > span:nth-child(4),
  .employee-row > span:nth-child(5) {
    align-self: start;
  }
}

@media (max-width: 700px) {
  .page-heading {
    align-items: flex-start;
    margin-bottom: 20px;
  }

  .page-heading .button {
    flex: 0 0 auto;
  }

  .dashboard-tools {
    padding: 10px;
  }

  .status-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    margin-bottom: 9px;
    padding-bottom: 3px;
    scrollbar-width: none;
  }

  .status-tabs::-webkit-scrollbar {
    display: none;
  }

  .status-tab {
    flex: 0 0 auto;
  }

  .search-form {
    flex-wrap: wrap;
  }

  .search-form input {
    flex: 1;
  }

  .search-form button {
    padding: 8px 14px;
  }

  .detail-side {
    grid-template-columns: 1fr;
  }

  .title-with-status {
    gap: 9px;
  }

  .action-bar {
    gap: 7px;
  }

  .action-bar form,
  .action-bar .button {
    flex: 1;
  }

  .action-bar form .button {
    width: 100%;
  }

  .panel-head {
    padding: 15px 16px 0;
  }

  .problem-text {
    padding: 13px 16px 20px;
    font-size: 14px;
  }

  .contact-list {
    padding: 13px 16px 18px;
  }

  .timeline {
    padding: 16px 16px 5px;
  }

  .comment-block {
    margin: 0 16px 18px;
  }

  .meta-list {
    padding: 0 16px 9px;
  }

  .notification-list {
    padding: 0 13px 7px;
  }

  .narrow-layout .panel {
    padding: 18px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
}

@media (max-width: 540px) {
  body {
    font-size: 15px;
  }

  .public-page {
    padding: 0 16px;
  }

  .public-header {
    padding-bottom: 4px;
  }

  .brand-mark {
    width: 39px;
    height: 39px;
    flex-basis: 39px;
    border-radius: 12px;
  }

  .brand-mark svg {
    width: 24px;
    height: 24px;
  }

  .brand-text strong {
    font-size: 13px;
  }

  .brand-text span {
    font-size: 10.5px;
  }

  .staff-link {
    max-width: 105px;
    font-size: 11px;
    line-height: 1.3;
    text-align: right;
  }

  .public-main {
    padding-top: 29px;
    padding-bottom: 45px;
    gap: 24px;
  }

  .public-intro h1 {
    margin-bottom: 17px;
    font-size: clamp(40px, 13vw, 54px);
  }

  .public-intro .lead {
    margin-bottom: 23px;
    font-size: 14.5px;
  }

  .intro-points {
    display: flex;
    gap: 0;
    margin-bottom: 21px;
    border-top: 1px solid var(--line-strong);
  }

  .intro-point {
    display: grid;
    grid-template-columns: 31px 1fr;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
  }

  .point-number {
    margin: 0;
    font-size: 13px;
  }

  .intro-point p {
    font-size: 12.5px;
  }

  .form-card {
    padding: 23px 18px;
    border-radius: 22px;
  }

  .form-card::before {
    left: 22px;
    right: 22px;
  }

  .form-card-head {
    margin-bottom: 21px;
  }

  .form-card-head h2 {
    font-size: 27px;
  }

  .ticket-form {
    gap: 17px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .field input {
    min-height: 48px;
    font-size: 16px;
  }

  .field textarea {
    font-size: 16px;
  }

  .public-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
    padding-bottom: 18px;
  }

  .accepted-wrap {
    padding: 24px 0 35px;
  }

  .accepted-card {
    padding: 28px 19px;
    border-radius: 22px;
  }

  .accepted-actions {
    flex-direction: column;
  }

  .accepted-actions .button {
    min-width: 0;
    width: 100%;
  }

  .staff-topbar-inner,
  .staff-main,
  .staff-footer {
    width: calc(100% - 28px);
  }

  .staff-topbar-inner {
    gap: 7px 10px;
  }

  .staff-account {
    gap: 8px;
  }

  .logout-button {
    font-size: 11px;
  }

  .staff-main {
    padding-top: 22px;
    padding-bottom: 42px;
  }

  .page-heading {
    gap: 12px;
  }

  .page-heading h1 {
    font-size: 29px;
  }

  .page-heading .button {
    min-height: 35px;
    padding: 7px 10px;
    font-size: 11px;
  }

  .message {
    font-size: 12px;
  }

  .ticket-row {
    grid-template-areas:
      "number status"
      "client assignee"
      "description description"
      "date date";
  }

  .ticket-assignee {
    max-width: 42vw;
    font-size: 10.5px;
  }

  .ticket-assignee .mini-avatar {
    display: none;
  }

  .empty-state {
    padding: 42px 18px;
  }

  .detail-heading .page-subtitle {
    font-size: 11px;
  }

  .action-bar {
    flex-direction: column;
  }

  .action-bar form {
    width: 100%;
  }

  .assignment-banner {
    align-items: flex-start;
    font-size: 11.5px;
  }

  .panel-head {
    flex-wrap: wrap;
  }

  .contact-list {
    grid-template-columns: 1fr;
  }

  .login-page {
    padding: 17px 15px 30px;
  }

  .login-brand {
    padding-left: 3px;
  }

  .login-card {
    margin-top: 36px;
    padding: 25px 19px;
    border-radius: 22px;
  }

  .login-card h1 {
    font-size: 32px;
  }

  .employee-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .employee-row > span:nth-child(4),
  .employee-row > span:nth-child(5) {
    display: inline-block;
  }

  .narrow-layout .panel {
    padding: 15px;
  }
}

@media (max-width: 860px) {
  .tracking-grid {
    grid-template-columns: 1fr;
  }

  .organization-head {
    display: none;
  }

  .organization-row {
    grid-template-columns: minmax(0, 1fr) minmax(100px, .7fr) repeat(4, 30px);
    gap: 8px;
    padding: 14px 16px;
  }

  .organization-row > span:nth-child(2) {
    color: var(--muted);
    font-size: 10.5px;
  }

  .organization-count {
    width: 24px;
  }
}

@media (max-width: 540px) {
  .public-header {
    align-items: flex-start;
  }

  .public-header-actions {
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
  }

  .public-header-actions .staff-link {
    max-width: 150px;
  }

  .public-footer-links {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .upload-label {
    align-items: flex-start;
    padding: 13px;
  }

  .tracking-wrap {
    padding-top: 28px;
  }

  .tracking-card,
  .tracking-result {
    border-radius: 22px;
  }

  .tracking-result {
    padding: 21px 17px;
  }

  .tracking-result-head {
    flex-direction: column;
    gap: 8px;
  }

  .tracking-progress {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .tracking-progress li:not(:last-child)::after {
    display: none;
  }

  .tracking-actions {
    flex-direction: column;
  }

  .tracking-actions .button {
    width: 100%;
  }

  .organization-row {
    grid-template-columns: minmax(0, 1fr) repeat(4, 27px);
    grid-template-areas:
      "name region new new new"
      "name total progress done";
    row-gap: 7px;
  }

  .organization-name {
    grid-area: name;
    align-self: center;
  }

  .organization-row > span:nth-child(2) {
    grid-area: region;
  }

  .organization-row > strong {
    display: none;
  }

  .organization-row > span:nth-child(4) {
    grid-area: new;
    justify-self: end;
  }

  .organization-row > span:nth-child(5) {
    grid-area: progress;
    justify-self: end;
  }

  .organization-row > span:nth-child(6) {
    grid-area: done;
    justify-self: end;
  }

  .attachment-list {
    padding: 13px 16px 16px;
  }
}

.waiting-game-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  width: 100%;
  max-width: 1080px;
  margin: 22px auto 0;
  padding: 20px 22px;
  border: 1px solid #d8e4d9;
  border-radius: 16px;
  background: linear-gradient(135deg, #f7fbf7, #eef7f3);
}

.waiting-game-accepted {
  max-width: 640px;
}

.waiting-game-copy {
  min-width: 0;
}

.waiting-game-kicker {
  margin: 0 0 5px;
  color: #4d7d5e;
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.waiting-game-card h2 {
  margin: 0 0 5px;
  font-size: 18px;
  letter-spacing: -.025em;
}

.waiting-game-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.55;
}

.waiting-game-card .button {
  flex: 0 0 auto;
  min-height: 40px;
}

@media (max-width: 540px) {
  .waiting-game-card {
    flex-direction: column;
    align-items: stretch;
    gap: 13px;
    margin-top: 16px;
    padding: 17px;
  }

  .waiting-game-card .button {
    width: 100%;
  }

  .telegram-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .telegram-qr-link {
    align-self: center;
  }

  .telegram-qr {
    width: 118px;
    height: 118px;
  }
}

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