/* ============================================================
   Московский Политех — фирменный слой /hd
   Брендбук: цвет #2C5BBA. Шрифт — системный, как до изменений.
   Подключается после mobile.css и переопределяет оформление.
   ============================================================ */

:root {
  --brand: #2C5BBA;
  --brand-dark: #1E4292;
  --brand-deep: #163472;
  --brand-2: #4C7BD9;
  --brand-soft: #EBF0FB;
  --brand-tint: #F6F8FD;

  --mp-blue: #2C5BBA;
  --mp-blue-2: #4C7BD9;
  --mp-accent: #7FA3EA;
  --mp-blue-soft: #EBF0FB;

  --ink: #151C2E;
  --muted: #6B7488;
  --line: #E3E8F2;
  --bg: #F3F5FA;
  --white: #fff;

  --r: 16px;
  --shadow-sm: 0 2px 8px rgba(24, 45, 94, .06);
  --shadow-md: 0 14px 34px rgba(24, 45, 94, .11);
  --shadow-brand: 0 8px 22px rgba(44, 91, 186, .25);
}

html { background: var(--bg); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 440px at 50% -220px, #E5ECFB 0%, rgba(243, 245, 250, 0) 72%),
    var(--bg);
  letter-spacing: .002em;
}
button, input, select, textarea { font-family: inherit; }
::selection { background: rgba(44, 91, 186, .18); color: var(--brand-deep); }

/* ---------- Шапка ---------- */
.topbar {
  background: linear-gradient(118deg, var(--brand-dark) 0%, var(--brand) 52%, var(--brand-2) 100%);
  box-shadow: 0 8px 28px rgba(22, 52, 114, .26);
  padding-top: calc(12px + var(--safe-top));
  padding-bottom: 12px;
}
.topbar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .62), rgba(255, 255, 255, .04));
  pointer-events: none;
}
.title-main {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.015em;
}
.title-sub {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .045em;
  text-transform: uppercase;
  opacity: .72;
}
.icon-btn {
  border-radius: 12px;
  background: rgba(255, 255, 255, .13);
  border: 1px solid rgba(255, 255, 255, .1);
  transition: background .15s, border-color .15s;
}
.icon-btn:hover { background: rgba(255, 255, 255, .22); }
.topbar-mode {
  border-color: rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .14);
  font-weight: 700;
  letter-spacing: .04em;
}
.topbar-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 1 230px;
  min-width: 110px;
}
.topbar-search-icon {
  position: absolute;
  left: 10px;
  color: rgba(255, 255, 255, .68);
  font-size: 16px;
  line-height: 1;
  pointer-events: none;
}
.topbar-search input {
  width: 100%;
  height: 36px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .13);
  color: #fff;
  padding: 0 10px 0 30px;
  font-size: 13px;
  outline: none;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.topbar-search input::placeholder { color: rgba(255, 255, 255, .66); }
.topbar-search input:focus {
  background: rgba(255, 255, 255, .2);
  border-color: rgba(255, 255, 255, .48);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .08);
}
.topbar-user {
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .24);
  font-weight: 800;
}

/* ---------- Вкладки ---------- */
.tabs {
  background: rgba(243, 245, 250, .9);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(44, 91, 186, .07);
  padding-top: 12px;
  padding-bottom: 11px;
}
.tab {
  border-radius: 12px;
  border-color: var(--line);
  background: #fff;
  color: var(--muted);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(24, 45, 94, .04);
  transition: color .15s, border-color .15s, background .15s, box-shadow .15s;
}
.tab:hover { color: var(--brand); border-color: #C9D6EE; }
.tab .badge {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
}
.tab.active {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-brand);
}
.tab.active .badge { background: rgba(255, 255, 255, .2); color: #fff; }

/* ---------- Лента и карточки ---------- */
.card {
  border-radius: var(--r);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.card:hover {
  transform: translateY(-1px);
  border-color: #CFDAEF;
  box-shadow: var(--shadow-md);
}
.card-title { font-weight: 700; letter-spacing: -.012em; }
.card-id { color: var(--brand); font-weight: 700; }
.card-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--st-grey-soft);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
}
.st-red .card-status { background: var(--st-red-soft); color: var(--st-red); }
.st-yellow .card-status { background: var(--st-yellow-soft); color: #8a5a00; }
.st-green .card-status { background: var(--st-green-soft); color: var(--st-green); }
.st-grey .card-status { background: var(--st-grey-soft); color: var(--muted); }
.card-top { flex-wrap: wrap; row-gap: 4px; }
.prio-cube { border-radius: 4px; }
.card-time { color: var(--muted); }
.meta-row { color: var(--muted); }
.vip-badge {
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: .02em;
}
.empty {
  background: #fff;
  border: 1px dashed #D6DFF0;
  border-radius: var(--r);
  padding: 26px 18px;
}
.feed-more {
  display: flex;
  justify-content: center;
  padding: 6px 0 18px;
}
.feed-more .btn {
  width: 100%;
  max-width: 320px;
}
/* ---------- Карточка заявки ---------- */
.detail-body { color: var(--ink); }
.detail-title {
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.28;
}
.detail-status { border-radius: 14px; }
.block {
  border-radius: 18px;
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
}
.block-head {
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .085em;
}
.breadcrumbs { color: var(--muted); }
.breadcrumbs a,
.dept-back { color: var(--brand); font-weight: 600; }
.dept-path { color: var(--muted); }

/* ---------- Вложения в карточке заявки ---------- */
.attachments { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.attachments-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 8px;
}
.attachment-preview { display: block; margin: 0 0 10px; }
.attachment-preview img {
  display: block;
  max-width: 100%;
  max-height: 480px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
}
.attachment-list { display: flex; flex-direction: column; gap: 6px; }
.attachment-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--brand-dark);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
}
.attachment-file:hover { background: var(--brand-soft); border-color: #C2D0EB; }
.attachment-icon { flex: 0 0 auto; }
.attachment-name { flex: 1 1 auto; word-break: break-word; }
.attachment-size { flex: 0 0 auto; color: var(--muted); font-size: 12px; white-space: nowrap; }

/* ---------- Кнопки ---------- */
.btn {
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: .005em;
  transition: transform .12s, filter .12s, box-shadow .15s, background .15s;
}
.btn-take {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  box-shadow: var(--shadow-brand);
}
.btn-take:hover { filter: brightness(1.04); }
.btn-status { background: var(--brand-soft); color: var(--brand); }
.btn-comment,
.btn-plain { border-color: #D8E0EF; }
.btn-comment:hover,
.btn-plain:hover { background: var(--brand-tint); border-color: #C2D0EB; }
.btn-danger { box-shadow: 0 6px 16px rgba(229, 72, 77, .2); }
.actionbar { background: rgba(255, 255, 255, .94); }
.sheet { border-radius: 22px 22px 0 0; box-shadow: 0 -18px 50px rgba(22, 52, 114, .18); }
.sheet-handle { background: #D5DEED; }
.sheet-title { font-weight: 800; letter-spacing: -.01em; }

/* ---------- Боковое меню ---------- */
.topbar-burger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 11px;
  background: rgba(255, 255, 255, .13);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.topbar-burger:hover,
.topbar-burger[aria-expanded="true"] {
  background: rgba(255, 255, 255, .24);
  border-color: rgba(255, 255, 255, .4);
}

.drawer {
  border-radius: 0 20px 20px 0;
  box-shadow: 14px 0 44px rgba(14, 34, 76, .24);
}
.drawer-close {
  margin-left: auto;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 9px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.drawer-close:hover { background: rgba(255, 255, 255, .24); }
.drawer-section {
  padding: 12px 18px 5px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.drawer-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  color: var(--brand-2);
  font-size: 14px;
}
.drawer-item.active {
  background: var(--brand-soft);
  color: var(--brand-dark);
  box-shadow: inset 3px 0 0 var(--brand);
}
body.drawer-open { overflow: hidden; }
.drawer-head {
  background: linear-gradient(155deg, var(--brand-dark) 0%, var(--brand) 58%, var(--brand-2) 100%);
  padding-top: calc(24px + var(--safe-top));
  padding-bottom: 18px;
}
.drawer-avatar {
  background: rgba(255, 255, 255, .17);
  border: 1px solid rgba(255, 255, 255, .24);
  font-weight: 800;
}
.drawer-name { font-weight: 700; letter-spacing: -.01em; }
.drawer-item {
  border-bottom-color: #F1F4FA;
  font-weight: 600;
  transition: background .15s, color .15s;
}
.drawer-item:hover { background: var(--brand-tint); color: var(--brand); }
.drawer-mode { color: var(--muted); }
.drawer-mode b { color: var(--brand); }
.role-chip {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}
.drawer-foot { border-top-color: var(--line); }

/* ---------- Подразделения ---------- */
.dept-summary {
  background: linear-gradient(135deg, #F4F7FE 0%, #EAF0FC 100%);
  border-color: #DCE6F8;
}
.dept-summary-value { color: var(--brand); font-weight: 800; }
.dept-summary-label { color: var(--muted); font-weight: 700; }
.dept-table-wrap {
  border-color: var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
.dept-table thead th {
  background: #F3F6FC;
  color: var(--muted);
  font-weight: 700;
}
.dept-table tbody tr:hover { background: var(--brand-tint); }
.dept-table-link { color: var(--brand); }
.dept-table-link:hover { color: var(--brand-dark); }
.dept-table .total { color: var(--brand); }
.dept-name-cell { color: var(--ink); }
.dept-ticket-table .status-pill { font-weight: 700; }
.dept-hint, .dept-note { color: var(--muted); }

/* ---------- Уведомления и статусы ---------- */
.notice {
  border-radius: 12px;
  border-color: #D7E3F7;
  background: var(--brand-soft);
  color: var(--brand-deep);
}
.notice.error { background: #FFF2F2; border-color: #F4CACA; color: #A5161B; }
.notice.success { background: #EDF9F1; border-color: #C7ECD3; color: #176C3A; }
.status-pill { font-weight: 700; }

/* ---------- Вход ---------- */
.login-page {
  background:
    radial-gradient(900px 520px at 50% -8%, #5A86DE 0%, #2C5BBA 46%, #163472 100%);
}
.login-brand img { height: 44px; }
.login-card {
  border-radius: 22px;
  padding: 28px 24px 20px;
  box-shadow: 0 26px 70px rgba(10, 30, 70, .38);
  border: 1px solid rgba(255, 255, 255, .65);
}
.login-card h1 { font-weight: 800; letter-spacing: -.02em; }
.login-field span { color: var(--muted); font-weight: 700; }
.login-field input,
.login-field select {
  border-color: #D6DEEE;
  border-radius: 12px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.login-field input:focus,
.login-field select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(44, 91, 186, .12);
}
.login-submit {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  box-shadow: var(--shadow-brand);
}
.login-help a { color: var(--brand); font-weight: 600; }
.login-error { border-radius: 12px; }

/* ---------- Мелочи ---------- */
.card,
.block,
.dept-table-wrap,
.login-card { -webkit-backface-visibility: hidden; }
@media (min-width: 900px) {
  body { background: #F3F5FA; }
  .topbar { padding-left: 32px; padding-right: 32px; }
  .tabs { padding-left: 32px; padding-right: 32px; }
  .feed { padding-left: 32px; padding-right: 32px; }
  .detail-body { padding-left: 36px; padding-right: 36px; }
}

/* ---------- Поиск в шапке ---------- */
.search-table .dept-ticket-name { min-width: 300px; }
.search-table td:nth-child(3) { white-space: nowrap; }
.search-table td:nth-child(5),
.search-table td:nth-child(6) { max-width: 240px; }

@media (max-width: 760px) {
  .topbar-search { flex-basis: 120px; min-width: 84px; }
  .topbar-search input { height: 34px; font-size: 12px; padding-left: 27px; }
  .topbar-search-icon { left: 8px; font-size: 14px; }
}
@media (max-width: 560px) {
  .topbar-search { flex-basis: 92px; min-width: 72px; }
  .topbar-search input { padding-left: 9px; }
  .topbar-search-icon { display: none; }
  .topbar-title .title-main { font-size: 15px; }
}

/* ---------- Верхние кнопки разделов ---------- */
.topbar-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.topbar-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .65);
  background: #fff;
  color: var(--brand-dark);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(16, 40, 96, .18);
  transition: background .15s, border-color .15s, box-shadow .15s, transform .12s;
}
.topbar-nav-btn:hover {
  background: var(--brand-soft);
  border-color: #fff;
  color: var(--brand);
  box-shadow: 0 5px 14px rgba(16, 40, 96, .24);
  transform: translateY(-1px);
}
.topbar-nav-icon { font-size: 14px; line-height: 1; opacity: .85; }
.topbar-nav-btn.active {
  background: var(--brand-soft);
  border-color: #fff;
  color: var(--brand);
  box-shadow: inset 0 0 0 1px rgba(44, 91, 186, .18);
}
.topbar.detail.with-nav .topbar-mode { display: none; }

@media (max-width: 1400px) {
  .topbar.with-nav .topbar-mode { display: none; }
  .topbar.with-nav .topbar-search { flex-basis: 190px; }
}

@media (max-width: 1200px) {
  .topbar.with-nav { position: relative; flex-wrap: wrap; }
  .topbar.with-nav .topbar-nav {
    order: 10;
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
    margin-top: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .topbar.with-nav .topbar-nav::-webkit-scrollbar { display: none; }
  .topbar.with-nav .topbar-nav-btn { flex: 0 0 auto; }
  .topbar.with-nav .topbar-mode { display: none; }
  .portal-index .tabs { top: 0; }
}

@media (max-width: 600px) {
  /* На телефоне оставляем компактный ряд иконок: подписи доступны
     скринридеру, но не раздвигают шапку за пределы экрана. */
  .topbar.with-nav .topbar-nav { overflow: visible; }
  .topbar.with-nav .topbar-nav-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 6px;
  }
  .topbar.with-nav .topbar-nav-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .topbar.with-nav .topbar-nav-icon { font-size: 16px; }
}

/* ---------- Клиентский режим: выпадающее меню на мобильных ---------- */
.topbar-client-toggle { display: none; }

@media (max-width: 900px) {
  .topbar-client-toggle { display: inline-flex; }

  .topbar.with-nav .topbar-nav.topbar-nav-client {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    width: auto;
    min-width: 0;
    margin: 0;
    padding: 10px 14px calc(14px + var(--safe-bottom));
    background: linear-gradient(160deg, #142F6B 0%, var(--brand) 100%);
    box-shadow: 0 22px 40px rgba(8, 25, 60, .28);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity .18s, transform .18s, visibility .18s;
    overflow: visible;
    z-index: 60;
  }

  .topbar.with-nav .topbar-nav.topbar-nav-client.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  .topbar.with-nav .topbar-nav.topbar-nav-client .topbar-nav-btn {
    flex: 0 0 auto;
    width: 100%;
    height: 42px;
    justify-content: flex-start;
    padding: 0 14px;
    font-size: 13.5px;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    color: #fff;
  }

  .topbar.with-nav .topbar-nav.topbar-nav-client .topbar-nav-btn:hover {
    background: rgba(255, 255, 255, .14);
    border-color: transparent;
    color: #fff;
    box-shadow: none;
    transform: none;
  }

  .topbar.with-nav .topbar-nav.topbar-nav-client .topbar-nav-btn.active {
    background: #fff;
    border-color: #fff;
    color: var(--brand-dark);
    box-shadow: none;
  }

  .topbar.with-nav .topbar-nav.topbar-nav-client .topbar-nav-btn.topbar-nav-cta,
  .topbar.with-nav .topbar-nav.topbar-nav-client .topbar-nav-btn.topbar-nav-cta.active {
    background: #E82550;
    border-color: #E82550;
    color: #fff;
    box-shadow: 0 8px 20px rgba(232, 37, 80, .28);
  }

  .topbar.with-nav .topbar-nav.topbar-nav-client .topbar-nav-btn.topbar-nav-cta:hover {
    background: #CF1E44;
    border-color: #CF1E44;
    color: #fff;
  }

  .topbar.with-nav .topbar-nav.topbar-nav-client .topbar-nav-label {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }

  .topbar.with-nav .topbar-nav.topbar-nav-client .topbar-nav-icon {
    font-size: 15px;
    opacity: .9;
  }
}


/* ---------- Панель фильтров списка заявок ---------- */
.hd-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: flex-end;
  padding: 12px 14px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.hd-filters.is-active { background: var(--brand-tint); }
.hd-filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
  flex: 1 1 160px;
}
.hd-filter-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.hd-filter select,
.hd-filter input[type="text"] {
  height: 36px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
  font-size: 13px;
  color: var(--ink, #151C2E);
  background: #fff;
}
.hd-filter select:focus,
.hd-filter input[type="text"]:focus {
  outline: 2px solid rgba(44, 91, 186, .22);
  outline-offset: 1px;
  border-color: var(--brand-2);
}
.hd-filter select:disabled {
  background: #F3F5FA;
  color: #A6B0C3;
  cursor: not-allowed;
}
.hd-filter-person { position: relative; }
.hd-suggest {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(24, 45, 94, .16);
  max-height: 260px;
  overflow: auto;
  padding: 4px;
}
.hd-suggest-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--ink, #151C2E);
  border-radius: 8px;
  cursor: pointer;
}
.hd-suggest-item:hover { background: var(--brand-soft); color: var(--brand-dark); }

/* Комбобокс с поиском по части текста (фильтры Исполнитель /
   Подразделение исполнителя / Сервис). Сам <select> скрыт, но остаётся
   в форме и отправляет своё значение. */
.hd-combo { position: relative; }
.hd-combo::after {
  content: '▾';
  position: absolute;
  right: 11px;
  top: 18px;
  transform: translateY(-50%);
  font-size: 11px;
  line-height: 1;
  color: var(--muted);
  pointer-events: none;
}
.hd-combo .hd-combo-input { padding-right: 28px; }
.hd-filter select.hd-combo-native {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}
.hd-combo-list {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(24, 45, 94, .16);
  max-height: 280px;
  overflow: auto;
  padding: 4px;
}
.hd-combo-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--ink, #151C2E);
  border-radius: 8px;
  cursor: pointer;
}
.hd-combo-item:hover,
.hd-combo-item.is-active { background: var(--brand-soft); color: var(--brand-dark); }
.hd-combo-item.is-selected { font-weight: 700; color: var(--brand-dark); }
.hd-combo-item-all { color: var(--muted); }
.hd-combo-group {
  padding: 8px 10px 3px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
}
.hd-combo-empty,
.hd-combo-more {
  padding: 8px 10px;
  font-size: 12px;
  color: var(--muted);
}
.hd-filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 0 0 auto;
}
@media (max-width: 900px) {
  .hd-filters { padding: 10px 12px; }
  .hd-filter { flex: 1 1 100%; }
  .hd-filter-actions { flex: 1 1 100%; }
  .hd-filter-actions .btn { flex: 1; }
}

/* ---------- Панель списка: вкладки + сортировка + вид ---------- */
.list-toolbar {
  position: sticky;
  top: calc(60px + var(--safe-top));
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(243, 245, 250, .94);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(44, 91, 186, .07);
}
.list-toolbar .tabs {
  position: static;
  top: auto;
  z-index: auto;
  flex: 1 1 auto;
  min-width: 0;
  padding: 4px 0;
  background: transparent;
  border: 0;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.list-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.list-sort { display: flex; align-items: center; gap: 6px; }
.list-sort-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  white-space: nowrap;
}
.list-sort select {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  padding: 0 8px;
  font-size: 12.5px;
  color: var(--ink, #151C2E);
}
.list-sort select:focus {
  outline: 2px solid rgba(44, 91, 186, .22);
  outline-offset: 1px;
  border-color: var(--brand-2);
}
.view-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 32px;
  color: var(--muted);
  font-size: 15px;
  text-decoration: none;
}
.view-btn + .view-btn { border-left: 1px solid var(--line); }
.view-btn.active { background: var(--brand-soft); color: var(--brand); }
.view-btn:hover { color: var(--brand); }

@media (max-width: 900px) {
  .list-toolbar { top: 0; flex-wrap: wrap; padding: 6px 12px; }
  .list-toolbar .tabs { order: 1; flex: 1 1 100%; }
  .list-tools { order: 2; flex: 1 1 100%; justify-content: flex-end; }
  .list-sort-label { display: none; }
}

/* ---------- Табличный вид списка заявок ---------- */
.tickets-table-wrap {
  margin-top: 10px;
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
.tickets-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 13px;
}
.tickets-table th:nth-child(1) { width: 82px; }
.tickets-table th:nth-child(3) { width: 104px; }
.tickets-table th:nth-child(4) { width: 112px; }
.tickets-table th:nth-child(5) { width: 168px; }
.tickets-table th:nth-child(6) { width: 126px; }
.tickets-table th:nth-child(7) { width: 112px; }
.tickets-table th {
  position: sticky;
  top: 0;
  background: #F3F5FA;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  text-align: left;
  padding: 9px 10px;
  white-space: nowrap;
}
.tickets-table td {
  padding: 9px 10px;
  border-top: 1px solid var(--line);
  vertical-align: top;
}
.tickets-table tbody tr { cursor: pointer; }
.tickets-table tbody tr:hover { background: var(--brand-tint); }
.tickets-table tbody tr.priority-high { background: #FFF8F2; }
.tickets-table .tt-num { white-space: nowrap; font-weight: 700; color: var(--brand); }
.tickets-table .tt-subject a { color: var(--ink); font-weight: 600; text-decoration: none; }
.tickets-table .tt-subject a:hover { color: var(--brand); }
.tickets-table .tt-subject .vip-badge { margin-left: 6px; }
.tickets-table .tt-subject,
.tickets-table .tt-assignee {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tickets-table .tt-date { white-space: nowrap; color: var(--muted); }
.tickets-table .status-pill { display: inline-block; }
.tickets-table .tt-prio { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* На ПК табличный вид занимает всю ширину, без сетки карточек. */
@media (min-width: 900px) {
  .feed.feed-table {
    display: block;
    padding: 20px 28px 110px;
  }
  .feed .list-footer { grid-column: 1 / -1; }
}

/* На узких экранах убираем второстепенные колонки и сужаем служебные,
   чтобы таблица читалась без горизонтальной прокрутки. */
@media (max-width: 900px) {
  .tickets-table th:nth-child(6),
  .tickets-table td:nth-child(6) { display: none; }
  .tickets-table th:nth-child(1) { width: 70px; }
  .tickets-table th:nth-child(3) { width: 96px; }
  .tickets-table th:nth-child(4) { width: 104px; }
  .tickets-table th:nth-child(5) { width: 130px; }
  .tickets-table th:nth-child(7) { width: 96px; }
  .tickets-table th,
  .tickets-table td { padding-left: 8px; padding-right: 8px; }
}
@media (max-width: 620px) {
  .tickets-table th:nth-child(5),
  .tickets-table td:nth-child(5) { display: none; }
  .tickets-table th:nth-child(1) { width: 58px; }
  .tickets-table th:nth-child(3) { width: 82px; }
  .tickets-table th:nth-child(4) { width: 90px; }
  .tickets-table th:nth-child(7) { width: 84px; }
  .tickets-table { font-size: 12.5px; }
  .tickets-table th,
  .tickets-table td { padding-left: 7px; padding-right: 7px; }
}

/* ---------- Пагинация ---------- */
.list-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 2px 4px;
}
.list-shown { font-size: 12.5px; color: var(--muted); }
.pager { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pager-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink, #151C2E);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
}
.pager-btn:hover { border-color: #C9D6EE; color: var(--brand); }
.pager-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager-gap { color: var(--muted); padding: 0 2px; }

/* ---------- Меню профиля (аватар в правом верхнем углу) ---------- */
.topbar-user-wrap { position: relative; flex: 0 0 auto; }
.topbar-user { border: 0; padding: 0; color: #fff; cursor: pointer; }
.topbar-user:hover { background: rgba(255, 255, 255, .28); }
.user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 90;
  min-width: 230px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(16, 40, 96, .18);
  padding: 6px;
}
.user-menu[hidden] { display: none; }
.user-menu-item {
  display: block;
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--ink, #151C2E);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.user-menu-item:hover { background: var(--brand-soft); color: var(--brand-dark); }
.user-menu-exit { color: #B42318; font-weight: 700; }
.user-menu-exit:hover { background: #FDECEC; color: #B42318; }

/* ---------- Форма «Создать подзаявку» ---------- */
.subticket-form { display: flex; flex-direction: column; gap: 10px; }
.subticket-form .field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}
.subticket-form .field input[type="text"],
.subticket-form .field select {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
  font-size: 13.5px;
  color: var(--ink, #151C2E);
  background: #fff;
}
.subticket-form .field input[readonly] {
  background: #F3F5FA;
  color: var(--muted);
}
.subticket-form .field select:disabled {
  background: #F3F5FA;
  color: #A6B0C3;
}
.subticket-content {
  min-height: 90px;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink, #151C2E);
  background: #fff;
}
.subticket-content:focus { outline: 2px solid rgba(44, 91, 186, .22); outline-offset: 1px; }
.subticket-content img { max-width: 100%; height: auto; }

/* ---------- Страница «Создать заявку» ---------- */
.nt-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 14px 60px;
}
.nt-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink, #151C2E);
  margin: 6px 0 14px;
}
.nt-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.nt-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.nt-field > span {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}
.nt-field input[type="text"],
.nt-field input[type="email"],
.nt-field input[type="tel"],
.nt-field select,
.nt-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
  height: 40px;
  font-size: 14px;
  color: var(--ink, #151C2E);
  background: #fff;
}
.nt-field textarea {
  height: auto;
  padding: 10px;
  line-height: 1.45;
  resize: vertical;
}
.nt-field input[type="file"] {
  font-size: 13px;
  color: var(--muted);
}
.nt-field input[readonly] {
  background: #F3F5FA;
  color: var(--muted);
}
.nt-field select:disabled {
  background: #F3F5FA;
  color: #A6B0C3;
}
.nt-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.nt-row .nt-field {
  flex: 1 1 240px;
}
.nt-hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.nt-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}
.nt-actions .btn {
  flex: 1;
}
@media (max-width: 600px) {
  .nt-actions {
    flex-direction: column;
  }
}

/* ---------- CTA «Создать заявку» (как на основном сайте) ---------- */
.topbar-nav-btn.topbar-nav-cta {
  background: #E82550;
  border-color: #E82550;
  color: #fff;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(232, 37, 80, .28);
}
.topbar-nav-btn.topbar-nav-cta:hover {
  background: #CF1E44;
  border-color: #CF1E44;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(232, 37, 80, .34);
}
.topbar-nav-btn.topbar-nav-cta.active {
  background: #E82550;
  border-color: #E82550;
  color: #fff;
  box-shadow: 0 8px 20px rgba(232, 37, 80, .28);
}
.topbar-nav-btn.topbar-nav-cta .topbar-nav-icon { opacity: .95; }

/* ---------- Комбо-поле «Сервис» с поиском ---------- */
.nt-combo { position: relative; }
.nt-combo-list {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(16, 40, 96, .16);
  max-height: 220px;
  overflow: auto;
  padding: 4px;
  display: none;
}
.nt-combo-list.open { display: block; }
.nt-combo-opt {
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--ink, #151C2E);
  cursor: pointer;
}
.nt-combo-opt:hover { background: var(--brand-soft); color: var(--brand-dark); }
.nt-combo-empty { padding: 8px 10px; font-size: 13px; color: #98a2b3; }

/* ---------- Экран «Заявка принята» ---------- */
.nt-success {
  max-width: 540px;
  margin: 48px auto 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(16, 40, 96, .14);
  padding: 30px 26px;
  text-align: center;
}
.nt-success h2 {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 800;
  color: var(--ink, #151C2E);
}
.nt-success p {
  margin: 0 0 22px;
  font-size: 15px;
  color: var(--muted);
}
.nt-success p b {
  font-size: 19px;
  color: var(--ink, #151C2E);
}
.nt-success .btn {
  display: inline-block;
  min-width: 260px;
}

/* ---------- Раздел «Услуги» (личный кабинет) ---------- */
.svc-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 14px 60px;
}
.svc-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink, #151C2E);
  margin: 6px 0 4px;
}
.svc-lead {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}
.svc-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  padding: 20px;
}
.svc-card-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.svc-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .02em;
}
.svc-card-headtext h2 {
  margin: 2px 0 6px;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink, #151C2E);
}
.svc-card-headtext p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
}
.svc-points {
  margin: 16px 0 18px;
  padding-left: 20px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink, #151C2E);
}
.svc-points li { margin-bottom: 6px; }
.svc-form { display: flex; }
.svc-form .btn { width: 100%; }
.svc-link {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.svc-link:hover { color: var(--brand-dark); }

/* Модальное окно с результатом запроса */
.svc-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(11, 24, 51, .48);
}
.svc-dialog {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(10, 26, 60, .3);
  padding: 24px 22px;
}
.svc-dialog h2 {
  margin: 0 0 12px;
  font-size: 19px;
  font-weight: 800;
  color: var(--ink, #151C2E);
}
.svc-dialog-body p {
  margin: 0 0 12px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink, #151C2E);
}
.svc-dialog-body p:last-child { margin-bottom: 0; }
.svc-ticket { color: var(--muted); }
.svc-ticket b { color: var(--ink, #151C2E); }
.svc-dialog .btn {
  display: block;
  width: 100%;
  margin-top: 18px;
  text-align: center;
}

/* ---------- Клиентская страница «Все разделы» ---------- */
.all-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 4px 14px 60px;
}
.all-section { margin: 0 0 18px; }
.all-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
}
.all-section-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--ink, #151C2E);
}
.all-more {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  white-space: nowrap;
}
.all-more:hover { color: var(--brand-dark); }

/* Разделитель между разделами */
.all-sep {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2px 0 16px;
}

/* Услуги — карточки в стиле раздела «Заявки», выравнивание по левому краю */
.all-services {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  text-align: left;
}
.svc-tile {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  background: var(--white, #fff);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: 0 2px 6px rgba(16, 32, 64, .05);
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.svc-tile:hover {
  border-color: #CFDAEF;
  box-shadow: var(--shadow-md, 0 6px 18px rgba(24, 45, 94, .10));
  transform: translateY(-1px);
}
.svc-tile .svc-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 13px;
}
.svc-tile-text {
  flex: 1 1 auto;
  min-width: 0;
}
.svc-tile-text h3 {
  margin: 2px 0 6px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink, #151C2E);
}
.svc-tile-text p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--muted);
}
.svc-tile-arrow {
  flex: 0 0 auto;
  align-self: center;
  font-size: 18px;
  color: var(--brand);
}

/* Заявки в разделе */
.all-tickets {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.all-tickets .card {
  display: block;
  margin-bottom: 0;
  text-decoration: none;
  color: inherit;
}

/* На широком экране — как лента заявок: карточки в ряд по всей ширине */
@media (min-width: 900px) {
  .all-page {
    max-width: none;
    margin: 0;
    padding: 20px 28px 60px;
  }
  .all-services,
  .all-tickets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
    align-items: start;
  }
  .all-section { margin: 0 0 22px; }
  .all-sep { margin: 4px 0 20px; }
}

/* Ссылка «Назад» на странице услуги */
.svc-back {
  display: inline-block;
  margin: 0 0 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
}
.svc-back:hover { color: var(--brand-dark); }
