/* Нордиам · личный кабинет клиента — мобильные стили.
   Использует переменные темы из app.css (--bg, --surface, --accent, ...). */

/* ===================== выбор роли ===================== */
.role-wrap {
  gap: 18px;
  justify-content: center;
}

.role-lead {
  margin: 4px 0 0;
  font-size: 15px;
  color: var(--muted);
  text-align: center;
}

.role-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.role-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 18px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  text-align: left;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease;
}

.role-btn:active { transform: scale(.985); }
.role-btn:hover { border-color: var(--accent); }

.role-btn .role-ico {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--accent);
}

.role-btn .role-ico svg { width: 26px; height: 26px; }

.role-btn .role-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.role-btn .role-title { font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.role-btn .role-sub { font-size: 13px; color: var(--muted); line-height: 1.35; }
.role-btn .role-chev { margin-left: auto; color: var(--muted); flex: 0 0 auto; }
.role-btn .role-chev svg { width: 20px; height: 20px; }

.role-client .role-ico { background: rgba(37, 99, 235, .12); }
.role-staff .role-ico { background: rgba(15, 122, 74, .12); color: var(--st-done-fg); }

.role-foot {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
  line-height: 1.45;
}

/* ===================== вход клиента ===================== */
.client-login-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.client-login-head .back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: none;
  padding: 6px 2px;
  color: var(--muted);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
}

.client-login-head .back-link svg { width: 16px; height: 16px; }

.phone-field input,
.code-field input {
  font-size: 20px;
  letter-spacing: .02em;
  padding: 14px 14px;
}

.code-field input {
  font-size: 24px;
  letter-spacing: .18em;
  text-align: center;
  font-weight: 700;
  text-transform: uppercase;
}

.client-hint {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.45;
}

/* ===================== кабинет ===================== */
.screen.client-app { background: var(--bg); }

.client-topbar { padding-bottom: 6px; }

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

.client-name {
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -.02em;
  margin: 2px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 4px 16px 10px;
}

.summary-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 10px;
  text-align: center;
  box-shadow: var(--shadow-card);
}

.summary-num {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.02em;
}

.summary-cap {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.2;
}

.summary-tile.is-repair .summary-num { color: var(--st-work-fg); }
.summary-tile.is-ready .summary-num { color: var(--st-done-fg); }
.summary-tile.is-returned .summary-num { color: var(--muted); }

.client-tools {
  padding: 4px 16px 10px;
}

.client-card {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 14px;
  margin: 0 0 10px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
}

.client-card:active { transform: scale(.995); }

.cc-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.cc-eq {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.25;
  min-width: 0;
}

.cc-serial {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}

.cc-status {
  margin-left: auto;
  flex: 0 0 auto;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.cc-what {
  margin-top: 9px;
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cc-foot {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed var(--border-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 12.5px;
  color: var(--muted);
}

.cc-foot b { color: var(--text-2); font-weight: 650; }

/* карточка заказа */
.cb-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  margin: 0 0 12px;
  box-shadow: var(--shadow-card);
}

.cb-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin: 0 0 10px;
}

.cb-eq {
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -.02em;
  line-height: 1.25;
}

.cb-sub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.cb-badge-row {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.cb-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13.5px;
}

.cb-row:last-child { border-bottom: 0; }
.cb-row .k { color: var(--muted); flex: 0 0 auto; }
.cb-row .v { text-align: right; font-weight: 600; color: var(--text-2); }

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

.cb-list li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13.5px;
}

.cb-list li:last-child { border-bottom: 0; }
.cb-list .li-name { flex: 1 1 auto; min-width: 0; }
.cb-list .li-qty { color: var(--muted); flex: 0 0 auto; font-size: 12.5px; }
.cb-list .li-sum { flex: 0 0 auto; font-weight: 650; }

.cb-text {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-2);
  white-space: pre-wrap;
}

.cb-rec {
  margin-top: 8px;
  border-left: 3px solid var(--accent);
  padding: 2px 0 2px 11px;
}

.cb-rec .rec-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.cb-repair-days {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--st-work-fg);
  font-weight: 650;
  margin-top: 8px;
}

.cb-repair-days svg { width: 15px; height: 15px; }

.client-empty {
  padding: 28px 22px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.client-empty .ce-ico {
  width: 46px;
  height: 46px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--muted);
}

.client-empty .ce-ico svg { width: 24px; height: 24px; }

.client-empty h3 {
  margin: 0 0 6px;
  font-size: 16px;
  color: var(--text);
}

/* нижнее меню кабинета */
.client-tabbar { grid-template-columns: repeat(3, 1fr); }

/* строка «войти другим клиентом» */
.client-logout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  border-radius: 12px;
  padding: 11px 14px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  width: 100%;
  justify-content: center;
}

.client-logout svg { width: 17px; height: 17px; }

.ret-item .cc-eq { font-size: 15px; }

@media (min-width: 640px) {
  .role-wrap { max-width: 460px; }
}

/* цвета статусов */
.cc-status.is-repair { color: var(--st-work-fg); background: var(--st-work-bg); }
.cc-status.is-ready { color: var(--st-done-fg); background: var(--st-done-bg); }
.cc-status.is-returned { color: var(--st-plain-fg); background: var(--st-plain-bg); }
.cc-status.is-warn { color: var(--st-warn-fg); background: var(--st-warn-bg); }
.cc-status.is-bad { color: var(--st-bad-fg); background: var(--st-bad-bg); }
/* код доступа в карточке клиента (экран сотрудника) */
.access-code {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: .16em;
  color: var(--accent);
  margin: 2px 0 6px;
  font-variant-numeric: tabular-nums;
}
/* на широком экране кабинет не растягиваем на всю ширину */
@media (min-width: 760px) {
  .client-app .topbar,
  .client-app .summary-row,
  .client-app .client-tools,
  .client-app .view-scroll {
    width: 100%;
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
  }
  .client-app .tabbar {
    max-width: 760px;
    margin: 0 auto;
  }
  .role-wrap { max-width: 520px; }
}
/* ===================== фотографии оборудования ===================== */
.ph-block { margin: 0; }

.ph-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.ph-grid.is-single { grid-template-columns: 1fr; }

.ph-item {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2);
  aspect-ratio: 1 / 1;
  cursor: pointer;
  isolation: isolate;
}

.ph-grid.is-single .ph-item { aspect-ratio: 16 / 10; }

.ph-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity .18s ease;
}

.ph-item img.is-loaded { opacity: 1; }

.ph-item.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, var(--surface-2) 30%, var(--border-soft) 50%, var(--surface-2) 70%);
  background-size: 220% 100%;
  animation: ph-shimmer 1.1s linear infinite;
}

.ph-item.is-error::after {
  content: 'фото недоступно';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  padding: 6px;
}

@keyframes ph-shimmer {
  from { background-position: 120% 0; }
  to { background-position: -120% 0; }
}

.ph-shade {
  position: absolute;
  inset: auto 0 0 0;
  height: 40%;
  background: linear-gradient(to top, rgba(0, 0, 0, .28), transparent);
  pointer-events: none;
}

/* полноэкранный просмотр */
body.ph-locked { overflow: hidden; }

.ph-viewer {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: #0b0f17;
  display: none;
  flex-direction: column;
}

.ph-viewer.is-open { display: flex; }

.ph-viewer-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  padding-top: max(12px, env(safe-area-inset-top));
  color: #e8eef9;
}

.ph-counter {
  font-size: 13px;
  opacity: .8;
  flex: 1 1 auto;
  font-variant-numeric: tabular-nums;
}

.ph-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.ph-close svg { width: 20px; height: 20px; }

.ph-stage {
  flex: 1 1 auto;
  overflow: hidden;
  touch-action: pan-y;
}

.ph-track {
  display: flex;
  height: 100%;
  transition: transform .22s cubic-bezier(.22, .61, .36, 1);
  will-change: transform;
}

.ph-track.is-dragging { transition: none; }

.ph-slide {
  flex: 0 0 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 8px;
}

.ph-slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

@media (min-width: 760px) {
  .ph-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ph-viewer { background: rgba(8, 12, 20, .96); }
}
/* ---------- АРМ: «Требуют внимания» ---------- */
.arm-attention {
  margin: 10px 16px 0;
  border: 1px solid #f0c9a0;
  background: #fff8ef;
  border-radius: 14px;
  padding: 10px 12px 6px;
}
.att-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.att-head b { font-size: 14px; color: #8a4b00; }
.att-head span { font-size: 12px; color: #a2703a; }
.att-list { display: flex; flex-direction: column; }
.att-row {
  display: flex; flex-direction: column; gap: 2px; text-align: left;
  background: none; border: 0; border-top: 1px solid #f4e2cd;
  padding: 8px 0; cursor: pointer; font: inherit; color: inherit;
}
.att-row:first-child { border-top: 0; }
.att-main { font-size: 13px; }
.att-sn { color: #6b7280; }
.att-why { font-size: 12px; color: #8a4b00; }
.att-more { font-size: 12px; color: #a2703a; padding: 4px 0 6px; }

/* ---------- Карточка: редактирование заказ-наряда ---------- */
.ord-edit .oe-field { display: block; margin: 0 0 10px; }
.ord-edit .oe-field > span { display: block; font-size: 12px; color: #6b7280; margin-bottom: 4px; }
.ord-edit .oe-field em { font-style: normal; color: #b45309; }
.ord-edit .oe-input {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 14px;
  padding: 9px 10px; border: 1px solid #d7dbe0; border-radius: 10px;
  background: #fff; color: #111; resize: vertical;
}
.ord-edit .oe-hint { font-size: 13px; color: #6b7280; margin: 0 0 10px; }
.ord-edit .oe-btn { width: 100%; }
.ord-edit .oe-actions { display: flex; align-items: center; gap: 10px; }
.ord-edit .oe-msg { font-size: 12px; color: #6b7280; }
.ord-edit .oe-msg.is-ok { color: #14833b; }
.ord-edit .oe-msg.is-err { color: #b91c1c; }
.si-role { font-size: 11px; color: #6b7280; margin-left: 6px; }

/* ---------- фото: загрузка с телефона ---------- */
.ph-actions { display: flex; gap: 8px; margin-bottom: 8px; }
.ph-actions .ph-btn { flex: 1; }
.ph-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ph-note { font-size: 12px; color: #6b7280; }
.ph-progress { margin-top: 8px; font-size: 13px; color: #2563eb; }
.ph-progress.is-err { color: #b91c1c; }
.ph-item { position: relative; }
.ph-del {
  position: absolute; top: 4px; right: 4px; width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(17, 24, 39, 0.72); color: #fff;
  font-size: 16px; line-height: 1; cursor: pointer; z-index: 2;
}