/* Панель поддержки */

.adminpage { background: var(--bg); }

.adminhead { padding-bottom: 26px; }
.adminhead__row { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.adminhead__title { font-size: 26px; letter-spacing: -.02em; }
.adminhead__sub { font-size: 13px; color: rgba(255, 255, 255, .55); margin-top: 6px; max-width: 70ch; }
.whoami { margin-left: auto; display: grid; gap: 5px; font-size: 11px; color: rgba(255, 255, 255, .45); }
.whoami select {
  appearance: none; background: rgba(255, 255, 255, .1); color: #fff;
  border: 1px solid rgba(255, 255, 255, .16); border-radius: 8px;
  padding: 8px 12px; font: inherit; font-size: 12.5px; font-weight: 500;
}
.whoami select option { color: #0b1730; }

.metrics { display: grid; gap: 8px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .metrics { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .metrics { grid-template-columns: repeat(6, 1fr); } }
.metric {
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--r-m); padding: 12px 13px;
  display: grid; gap: 2px;
}
.metric__icon { color: rgba(255, 255, 255, .35); }
.metric__icon .i { width: 15px; height: 15px; }
.metric__v { font-size: 20px; font-weight: 600; letter-spacing: -.02em; color: #fff; }
.metric__k { font-size: 12px; color: rgba(255, 255, 255, .72); }
.metric__hint { font-size: 11px; color: rgba(255, 255, 255, .35); }
.metric--warn { background: rgba(255, 204, 1, .1); border-color: rgba(255, 204, 1, .25); }
.metric--warn .metric__icon { color: var(--gold-2); }
.metric--danger { background: rgba(220, 38, 38, .14); border-color: rgba(220, 38, 38, .3); }
.metric--danger .metric__icon { color: #ff8080; }

.adminmain { padding: 20px 14px 60px; }

.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  background: none; border: 1px solid transparent; border-radius: 999px;
  padding: 8px 14px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
}
.tab:hover { background: #fff; }
.tab.is-active { background: #fff; border-color: var(--line); color: var(--ink); box-shadow: var(--shadow); }
.tab__count:not(:empty) {
  background: var(--blue); color: #fff; border-radius: 999px;
  font-size: 11px; font-weight: 600; padding: 1px 6px; min-width: 18px; text-align: center;
}

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.segmented { display: inline-flex; background: #e9edf4; border-radius: 999px; padding: 3px; gap: 2px; }
.segmented button {
  background: none; border: 0; border-radius: 999px; padding: 6px 12px;
  font-size: 12.5px; font-weight: 500; color: var(--muted); cursor: pointer;
}
.segmented button.is-on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.segmented b { color: var(--blue); }
.btn--sm { padding: 8px 12px; font-size: 12.5px; }
.btn--danger { background: #fef2f2; color: var(--red); border-color: #fbd5d5; }
.btn--danger:hover { background: #fee2e2; }

/* таблица заказов */
.table { background: #fff; border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; }
.table__head, .row {
  display: grid; gap: 14px;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr);
  padding: 12px 14px; text-align: left;
}
.table__head {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  background: #fafbfd; border-bottom: 1px solid var(--line);
}
.row {
  width: 100%; background: #fff; border: 0; border-bottom: 1px solid var(--line);
  cursor: pointer; font: inherit; transition: background .15s;
}
.row:last-child { border-bottom: 0; }
.row:hover { background: #f8fbff; }
.row--hot { background: #fffcf5; }
.row--hot:hover { background: #fff8ea; }
.row__cell { display: grid; gap: 3px; align-content: start; min-width: 0; }
.row__title { font-size: 13.5px; font-weight: 600; }
.row__sub { font-size: 11.5px; color: var(--muted); display: block; }
.row__none { font-size: 12.5px; color: var(--amber); }

.pill {
  display: inline-flex; align-self: start; font-size: 11.5px; font-weight: 500;
  padding: 3px 9px; border-radius: 999px; background: #eef2f8; color: var(--ink-2);
}
.pill--paid { background: #fff5e5; color: var(--amber); }
.pill--collecting { background: #eef5ff; color: #0d4d92; }
.pill--setup { background: #eaf4ff; color: var(--blue-600); }
.pill--review { background: #f3eeff; color: #5b3ec8; }
.pill--accepted { background: var(--green-bg); color: var(--green); }

.flag {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; line-height: 1.3; color: var(--ink-2);
}
.flag .i { width: 13px; height: 13px; flex: none; }
.flag--high { color: #b42318; }
.flag--mid { color: var(--amber); }
.flag--ok { color: var(--muted); }

@media (max-width: 860px) {
  .table__head { display: none; }
  .row { grid-template-columns: 1fr 1fr; }
}

/* заявки */
.claims { display: grid; gap: 12px; }
.subhead { font-size: 13px; color: var(--muted); margin: 22px 0 10px; font-weight: 600; }
.claim {
  background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--amber);
  border-radius: var(--r-l); padding: 16px; box-shadow: var(--shadow);
}
.claim--refuse { border-left-color: var(--red); }
.claim--closed { border-left-color: var(--green); opacity: .75; }
.claim__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 9px; }
.claim__type { font-size: 14px; font-weight: 600; }
.claim__id { font-size: 11.5px; color: var(--muted); font-family: ui-monospace, Menlo, monospace; }
.claim__status { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.claim__status--new { background: #fef2f2; color: var(--red); }
.claim__status--in_progress { background: #eaf4ff; color: var(--blue-600); }
.claim__status--closed { background: var(--green-bg); color: var(--green); }
.claim__due { margin-left: auto; font-size: 11.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.claim__due .i { width: 13px; height: 13px; }
.claim__due.is-overdue { color: var(--red); font-weight: 600; }
.claim__text { font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }
.claim__meta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 11px; font-size: 11.5px; color: var(--muted); }
.claim__meta span { display: inline-flex; align-items: center; gap: 5px; }
.claim__meta .i { width: 13px; height: 13px; }
.claim__replies { margin-top: 12px; display: grid; gap: 8px; }
.claim__reply {
  background: #f6f9fd; border-radius: var(--r-m); padding: 10px 12px;
  font-size: 11.5px; color: var(--muted);
}
.claim__reply span { display: block; margin-top: 4px; font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.claim__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.claim__assignee { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.claim__assignee .i { width: 14px; height: 14px; }
.claim__done { margin-top: 12px; font-size: 12.5px; color: var(--green); display: flex; align-items: center; gap: 7px; }
.claim__done .i { width: 15px; height: 15px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--blue); font: inherit; font-size: inherit; cursor: pointer; text-decoration: none; }

.empty {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-l);
  padding: 46px; text-align: center; color: var(--muted); font-size: 13.5px;
  display: flex; align-items: center; justify-content: center; gap: 9px;
}
.empty .i { width: 18px; height: 18px; color: var(--green); }

/* диалоги */
.inbox { background: #fff; border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; }
.inboxrow {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 13px 14px; background: #fff; border: 0; border-bottom: 1px solid var(--line);
  cursor: pointer; font: inherit;
}
.inboxrow:last-child { border-bottom: 0; }
.inboxrow:hover { background: #f8fbff; }
.inboxrow.is-unread { background: #fffdf6; }
.inboxrow__body { flex: 1; min-width: 0; }
.inboxrow__top { display: flex; align-items: baseline; gap: 8px; }
.inboxrow__top b { font-size: 13.5px; }
.inboxrow__id { font-size: 11px; color: var(--muted); }
.inboxrow__time { margin-left: auto; font-size: 11px; color: var(--muted); }
.inboxrow__sub { font-size: 11.5px; color: var(--muted); display: block; margin-top: 2px; }
.badge-dot {
  background: var(--blue); color: #fff; border-radius: 999px;
  font-size: 11px; font-weight: 600; padding: 2px 7px;
}
.avatar-sm {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: #eef2f8; color: var(--ink-2);
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.avatar-sm--blue { background: linear-gradient(150deg, #1336c3, #0088ff); color: #fff; }

/* панель заказа */
.drawer { position: fixed; inset: 0; z-index: 50; }
.drawer__backdrop { position: absolute; inset: 0; background: rgba(0, 8, 29, .45); }
.drawer__panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(560px, 100%);
  background: var(--bg);
  display: flex; flex-direction: column;
  box-shadow: -20px 0 60px -30px rgba(0, 8, 29, .6);
  animation: slidein .18s ease-out;
}
@keyframes slidein { from { transform: translateX(24px); opacity: .6; } }
.drawer__head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 18px; background: #fff; border-bottom: 1px solid var(--line);
}
.drawer__title { font-size: 16px; font-weight: 600; }
.drawer__sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.drawer__close { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px; }
.drawer__close .i { width: 18px; height: 18px; }
.drawer__body { overflow-y: auto; padding: 14px 18px 40px; display: grid; gap: 14px; }

.dsec { background: #fff; border: 1px solid var(--line); border-radius: var(--r-l); padding: 15px; }
.dsec__title { font-size: 12.5px; font-weight: 600; margin-bottom: 11px; }
.dsec__note { color: var(--muted); font-weight: 400; }
.dsec__actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.select {
  flex: 1; min-width: 160px;
  border: 1px solid var(--line); border-radius: var(--r-s);
  padding: 9px 11px; font: inherit; font-size: 12.5px; background: #fff; color: var(--ink);
}

.stagebox__now { display: flex; align-items: center; gap: 10px; }
.stagebox__timer { font-size: 14px; font-weight: 600; }
.stagebox__hint { font-size: 12px; color: var(--muted); margin-top: 7px; line-height: 1.45; }

.dcontractor { display: flex; gap: 11px; align-items: center; }
.dcontractor b { font-size: 13.5px; }

.intake { display: grid; gap: 8px; }
.intake__row { display: flex; align-items: baseline; gap: 10px; font-size: 12.5px; }
.intake__label { color: var(--muted); min-width: 108px; }
.intake__value { font-weight: 500; flex: 1; word-break: break-word; }
.src { font-size: 10.5px; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.src--form { background: #eaf4ff; color: #0b4f9e; }
.src--payment { background: #f3eeff; color: #5b3ec8; }
.src--fiscal { background: var(--green-bg); color: var(--green); }
.src--bot { background: #fff5e5; color: var(--amber); }
.src--client, .src--system { background: #f1f4f9; color: var(--muted); }

.linkrow {
  display: flex; align-items: center; gap: 8px; margin-top: 12px;
  background: #f7f9fc; border: 1px solid var(--line); border-radius: var(--r-m); padding: 9px 11px;
  font-size: 11.5px;
}
.linkrow .i { width: 14px; height: 14px; color: var(--muted); flex: none; }
.linkrow code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, Menlo, monospace; }

.dchecklist { display: grid; }
.dcheck {
  display: flex; gap: 10px; align-items: flex-start; text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--line);
  padding: 10px 0; cursor: pointer; font: inherit; font-size: 12.5px; width: 100%;
}
.dcheck:last-child { border-bottom: 0; }
.dcheck__box {
  width: 18px; height: 18px; border-radius: 6px; flex: none; margin-top: 1px;
  border: 1.5px solid #cbd5e3; display: grid; place-items: center; color: #fff;
}
.dcheck__box .i { width: 11px; height: 11px; stroke-width: 3; opacity: 0; }
.dcheck.is-done .dcheck__box { background: var(--green); border-color: var(--green); }
.dcheck.is-done .dcheck__box .i { opacity: 1; }
.dcheck.is-done { color: var(--muted); }

.dchat { max-height: 280px; overflow-y: auto; display: grid; gap: 8px; padding-right: 4px; }
.dbubble {
  max-width: 90%; padding: 9px 11px; border-radius: 12px;
  font-size: 12.5px; line-height: 1.45; display: grid; gap: 3px;
}
.dbubble--client { background: #f1f5fa; justify-self: start; }
.dbubble--support { background: #eaf4ff; justify-self: end; }
.dbubble--system { background: none; color: var(--muted); font-size: 11.5px; justify-self: center; text-align: center; }
.dbubble__author { font-size: 10.5px; color: var(--muted); }
.dchatform { display: grid; gap: 8px; margin-top: 11px; }
.dchatform textarea {
  border: 1px solid var(--line); border-radius: var(--r-m);
  padding: 10px 11px; font: inherit; font-size: 12.5px; resize: vertical; color: var(--ink);
}
.dchatform textarea:focus { outline: 2px solid rgba(0, 136, 255, .3); border-color: var(--blue); }
.dchatform .btn { justify-self: start; }

.dfeed { display: grid; gap: 10px; }
.dfeed__row { display: grid; gap: 2px; font-size: 12px; }
.dfeed__row b { font-weight: 600; }
.dfeed__row span { color: var(--muted); line-height: 1.4; }
.dfeed__row i { font-style: normal; font-size: 11px; color: #97a2b5; }

.claim__form { display: grid; gap: 9px; margin-top: 12px; }
.claim__form textarea {
  border: 1px solid var(--line); border-radius: var(--r-m);
  padding: 10px 12px; font: inherit; font-size: 12.5px; resize: vertical; color: var(--ink);
}
.claim__form textarea:focus { outline: 2px solid rgba(0, 136, 255, .3); border-color: var(--blue); }
.claim__formrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.claim__formnote { font-size: 11.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.claim__formnote .i { width: 13px; height: 13px; }
.claim__formrow .btn { margin-left: auto; }

.dclaim {
  border-left: 2px solid var(--amber); padding: 2px 0 2px 11px;
  display: grid; gap: 4px; margin-bottom: 12px; font-size: 12.5px;
}
.dclaim:last-child { margin-bottom: 0; }
.dclaim.is-closed { border-left-color: var(--green); opacity: .7; }
.dclaim__top { display: flex; align-items: center; gap: 8px; }
.dclaim p { color: var(--ink-2); line-height: 1.45; }
.dclaim .linkbtn { justify-self: start; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.dclaim .linkbtn .i { width: 13px; height: 13px; }

.dsec__danger { justify-self: start; }
