/* ============================================================
   Панель сотрудника и личный кабинет · Смарт Гарант
   Дополняет styles.css
   ============================================================ */

.panel-body { background: var(--ice); min-height: 100vh; }

/* ---------- вход ---------- */
.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.auth-card {
  width: min(400px, 100%); background: var(--frost); border-radius: 26px;
  padding: 2.2rem 2rem; box-shadow: var(--shadow-soft);
  display: flex; flex-direction: column; gap: .95rem; text-align: center;
}
.auth-mark { width: 56px; height: 56px; border-radius: 18px; font-size: 1.3rem; margin: 0 auto .4rem; display:grid; place-items:center; background: var(--grad); color:#fff; font-weight:900; }
.brand-logo.auth-mark { background: none; border-radius: 50%; }
.auth-card h1 { font-size: 1.5rem; }
.auth-sub { color: var(--slate); font-size: .92rem; margin-top: -.5rem; }
.auth-card label { text-align: left; display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .88rem; color: var(--slate); }
.auth-card input {
  font: inherit; background: var(--ice); border: 1px solid var(--line);
  border-radius: 12px; padding: .7rem .9rem; color: var(--ink);
}
.auth-card input:focus { outline: none; border-color: var(--pulse); box-shadow: 0 0 0 3px rgba(30,107,255,.15); }
.auth-error { color: #c62828; font-size: .86rem; font-weight: 600; }
.auth-hint { color: var(--slate); font-size: .78rem; }
.auth-hint code { background: var(--tint); padding: .1rem .4rem; border-radius: 6px; }

/* ---------- каркас панели ---------- */
.panel-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(243,248,254,.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.panel-header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 0; flex-wrap: wrap; }
.panel-tabs { display: flex; gap: .4rem; flex-wrap: wrap; }
.ptab {
  border: 1px solid var(--line); background: var(--frost); border-radius: 999px;
  padding: .55rem 1.1rem; font-weight: 700; color: var(--slate); transition: all .2s;
  display: inline-flex; align-items: center; gap: .45rem;
}
.ptab:hover { border-color: var(--pulse); color: var(--pulse); }
.ptab.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.pcount {
  font-family: var(--font-hud); font-size: .7rem; background: rgba(30,107,255,.14);
  color: var(--pulse); border-radius: 999px; padding: .1rem .5rem;
}
.ptab.is-on .pcount { background: rgba(255,255,255,.2); color: #fff; }
.panel-actions { display: flex; align-items: center; gap: .8rem; }
.panel-link { font-weight: 600; color: var(--slate); font-size: .9rem; }
.panel-link:hover { color: var(--pulse); }

.panel-main { padding: 1.8rem 0 4rem; }
.pane-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.pane-head h2 { font-size: 1.5rem; }
.pane-filter { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.pane-empty { text-align: center; color: var(--slate); padding: 3rem 0; }

/* ---------- товары в админке ---------- */
.admin-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.ap-card {
  background: var(--frost); border: 1px solid var(--line); border-radius: 18px;
  overflow: hidden; display: flex; flex-direction: column;
}
.ap-photo { aspect-ratio: 4/3; background: var(--tint); }
.ap-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ap-body { padding: .9rem 1rem 1rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.ap-title { font-weight: 700; font-size: .95rem; }
.ap-meta { color: var(--slate); font-size: .8rem; flex: 1; }
.ap-price { font-weight: 800; }
.ap-actions { display: flex; gap: .5rem; margin-top: .6rem; }
.ap-actions .btn { padding: .4rem .9rem; font-size: .82rem; flex: 1; }
.btn-danger { background: #fdecec; color: #c62828; border: 1px solid #f6caca; }
.btn-danger:hover { background: #fbdada; }

/* ---------- таблица заказов ---------- */
.orders-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; background: var(--frost); }
.orders-table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 760px; }
.orders-table th {
  text-align: left; font-family: var(--font-hud); font-size: .68rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--slate);
  padding: .9rem 1rem; border-bottom: 1px solid var(--line);
}
.orders-table td { padding: .85rem 1rem; border-bottom: 1px solid var(--tint); vertical-align: middle; }
.orders-table tr:last-child td { border-bottom: 0; }
.orders-table tr:hover td { background: #f7fbff; }
.ord-no { font-family: var(--font-hud); font-weight: 700; }
.ord-sub { color: var(--slate); font-size: .78rem; display: block; }
.status-pill {
  font: inherit; font-weight: 700; font-size: .8rem; border-radius: 999px;
  padding: .35rem .8rem; border: 1px solid transparent; cursor: pointer;
  appearance: none; -webkit-appearance: none;
}
.st-0 { background: #eef2f8; color: #47566f; }           /* Принят */
.st-1 { background: #e6f3fd; color: #0f6cad; }           /* Диагностика */
.st-2 { background: #fff3e0; color: #a35b00; }           /* Ожидание запчасти */
.st-3 { background: #ede9ff; color: #5b3fd1; }           /* В ремонте */
.st-4 { background: #e5f8ec; color: #0d8a4c; }           /* Готов к выдаче */
.st-5 { background: #f0f0f0; color: #777; }              /* Выдан */
.creds-mini { font-family: var(--font-hud); font-size: .78rem; color: var(--slate); }
.row-actions { display: flex; gap: .35rem; justify-content: flex-end; }
.icon-btn {
  width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--frost); color: var(--slate); display: grid; place-items: center;
  transition: all .2s; font-size: .85rem;
}
.icon-btn:hover { border-color: var(--pulse); color: var(--pulse); }
.icon-btn.danger:hover { border-color: #c62828; color: #c62828; }

/* ---------- настройки ---------- */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.settings-card {
  background: var(--frost); border: 1px solid var(--line); border-radius: 20px;
  padding: 1.6rem; display: flex; flex-direction: column; gap: .9rem;
}
.settings-card h3 { font-size: 1.1rem; }
.settings-card label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .88rem; color: var(--slate); }
.settings-card input[type="password"] {
  font: inherit; background: var(--ice); border: 1px solid var(--line);
  border-radius: 12px; padding: .65rem .85rem; color: var(--ink);
}
.settings-note { color: var(--slate); font-size: .88rem; }
.settings-btns { display: flex; gap: .7rem; flex-wrap: wrap; }
.import-label { position: relative; overflow: hidden; }
.settings-msg { font-weight: 600; font-size: .86rem; color: #0d8a4c; }
.settings-msg.is-err { color: #c62828; }

/* ---------- доступ клиента ---------- */
.creds-intro { color: var(--slate); font-size: .9rem; margin-bottom: 1rem; }
.creds-box {
  background: var(--ice); border: 1px dashed var(--line); border-radius: 16px;
  padding: 1.2rem; font-family: var(--font-hud); font-size: .95rem;
  display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1.2rem;
}
.creds-box b { font-size: 1.15rem; letter-spacing: .04em; }
.creds-box small { color: var(--slate); font-family: var(--font-body); }

.modal-card-wide { width: min(560px, 100%); }

/* ---------- ЛК клиента ---------- */
.lk-orders { display: flex; flex-direction: column; gap: 1.2rem; }
.lk-card {
  background: var(--frost); border: 1px solid var(--line); border-radius: 22px;
  padding: 1.6rem; box-shadow: var(--shadow-soft);
}
.lk-top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: .4rem; }
.lk-no { font-family: var(--font-hud); font-weight: 700; font-size: 1.05rem; }
.lk-date { color: var(--slate); font-size: .82rem; }
.lk-device { font-size: 1.2rem; font-weight: 800; letter-spacing: -.01em; }
.lk-issue { color: var(--slate); margin: .3rem 0 1.2rem; }

.lk-timeline { display: grid; grid-template-columns: repeat(6, 1fr); gap: .4rem; margin-bottom: 1.2rem; }
.tl-step { display: flex; flex-direction: column; gap: .45rem; align-items: center; text-align: center; }
.tl-bar { width: 100%; height: 6px; border-radius: 6px; background: var(--line); }
.tl-step.done .tl-bar { background: var(--grad); }
.tl-step.now .tl-bar { background: var(--grad); animation: pulseBar 1.6s ease-in-out infinite; }
@keyframes pulseBar { 50% { opacity: .55; } }
.tl-name { font-size: .68rem; color: var(--slate); font-weight: 600; line-height: 1.2; }
.tl-step.now .tl-name { color: var(--pulse); }

.lk-meta { display: flex; gap: 2rem; flex-wrap: wrap; }
.lk-meta div { display: flex; flex-direction: column; gap: .1rem; }
.lk-meta span { font-family: var(--font-hud); font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--slate); }
.lk-meta b { font-size: 1.05rem; }
.lk-note {
  margin-top: 1.1rem; background: var(--tint); border-radius: 14px;
  padding: .9rem 1.1rem; font-size: .92rem; color: var(--ink);
}
.lk-note::before { content: "Комментарий мастера: "; font-weight: 700; }
.lk-help { text-align: center; color: var(--slate); font-size: .88rem; margin-top: 2rem; }
.lk-help a { color: var(--pulse); font-weight: 700; }

/* ---------- печать квитанции ---------- */
.print-area { display: none; }
@media print {
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .print-area {
    display: block; position: fixed; inset: 0; background: #fff;
    padding: 14mm; font-family: Georgia, "Times New Roman", serif; color: #000;
  }
  .pr-head { display: flex; justify-content: space-between; border-bottom: 2px solid #000; padding-bottom: 6mm; margin-bottom: 6mm; }
  .pr-head h1 { font-size: 18pt; margin: 0; }
  .pr-head p { margin: 1mm 0 0; font-size: 10pt; }
  .pr-title { font-size: 14pt; margin: 0 0 4mm; }
  .pr-table { width: 100%; border-collapse: collapse; font-size: 11pt; }
  .pr-table td { padding: 2.5mm 0; border-bottom: 1px solid #ccc; vertical-align: top; }
  .pr-table td:first-child { width: 42mm; color: #444; }
  .pr-creds { margin-top: 6mm; border: 1.5px dashed #000; padding: 4mm; font-size: 11pt; }
  .pr-foot { margin-top: 8mm; font-size: 9pt; color: #444; }
}

@media (max-width: 900px) {
  .settings-grid { grid-template-columns: 1fr; }
  .lk-timeline { grid-template-columns: repeat(3, 1fr); row-gap: .9rem; }
}
@media (max-width: 560px) {
  .panel-header-row { justify-content: center; }
  .pane-head { flex-direction: column; align-items: stretch; }
  .pane-head .btn { width: 100%; }
}

/* приоритет hidden над display */
.auth-screen[hidden], .panel[hidden] { display: none !important; }
