button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: var(--tap);
  padding: 10px 14px;
  margin: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  background: linear-gradient(180deg, var(--bg-3), #141f2f);
  color: var(--text-1);
  font: inherit;
  font-size: var(--fs-base);
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: filter var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}
button:hover,
.btn:hover { filter: brightness(1.18); box-shadow: var(--sh-1); }
button:active,
.btn:active { transform: scale(0.97); }
button:disabled { opacity: 0.5; cursor: default; filter: none; transform: none; box-shadow: none; }

button.primary { background: linear-gradient(180deg, #2e97e8, #1f7fd4); border-color: #3aa8ff; color: var(--acc-ink); font-weight: 600; }
button.green { background: linear-gradient(180deg, #2fae6a, #239a58); border-color: #38c77e; color: var(--acc-ink); }
button.btn-danger, .btn-danger { background: #571b1b; border-color: #7a2828; color: #ffd7dc; }

button.btn-icon {
  width: var(--tap);
  min-width: var(--tap);
  padding: 0;
  font-size: 18px;
}
button.btn-block, .btn-block { width: 100%; }

.btn-sm {
  min-height: 34px;
  width: 100%;
  padding: 7px 9px;
  font-size: var(--fs-md);
  margin: var(--s-1) 0;
  white-space: nowrap;
}
.btn-sm.tg { background: linear-gradient(180deg, #1d3d66, #16304f); border-color: #2a5a9c; width: auto; padding: 7px 14px; }
.btn-sm.tg:disabled { opacity: 0.6; }
.btn-sm.tg.mark { background: linear-gradient(180deg, #1f6b43, #1a5938); border-color: #2f9e63; }
.btn-sm.tg.mark:disabled { background: #14361f; }
.btn-sm.cop { background: linear-gradient(180deg, #3a2d5e, #2d2349); border-color: #5a47a0; width: auto; padding: 7px 14px; }

.btn-status { font-size: var(--fs-base); padding: var(--s-3); width: 100%; min-height: 52px; font-weight: 600; }

input,
select,
textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 11px 13px;
  margin: var(--s-2) 0;
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  background: rgba(8, 14, 22, 0.9);
  color: var(--text-1);
  font: inherit;
  font-size: var(--fs-base);
  outline: none;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
input::placeholder,
textarea::placeholder { color: var(--text-3); }
input:focus, select:focus, textarea:focus { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }
textarea { resize: vertical; min-height: 44px; }
select { appearance: auto; }

input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  min-height: 0;
  flex: none;
  margin: 0;
  padding: 0;
  border: 1.5px solid var(--line-2);
  border-radius: 6px;
  background: var(--bg-1);
  display: grid;
  place-content: center;
  cursor: pointer;
}
input[type="checkbox"]:checked { background: var(--ok); border-color: var(--ok); }
input[type="checkbox"]:checked::after {
  content: "";
  width: 10px;
  height: 5px;
  margin-top: -2px;
  border-left: 2.5px solid #04150c;
  border-bottom: 2.5px solid #04150c;
  transform: rotate(-45deg);
}

label.chk {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin: var(--s-2) 0;
  padding: 10px 12px;
  border: 1px solid var(--line-1);
  border-radius: var(--r-2);
  background: var(--bg-1);
  cursor: pointer;
  font-size: var(--fs-md);
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease);
}
label.chk:hover { border-color: var(--line-2); }
label.chk input { width: auto; margin: 0; }
label.chk input:disabled { cursor: default; }

.no-orders { color: var(--text-2); text-align: center; padding: var(--s-7) var(--s-4); font-size: var(--fs-md); }

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line-2);
  border-top-color: var(--acc);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  height: 78px;
  border-radius: var(--r-3);
  margin-bottom: 10px;
  background: linear-gradient(90deg, var(--bg-2) 0%, var(--bg-3) 50%, var(--bg-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--s-3);
  padding: 14px 16px;
  margin-bottom: 10px;
  border: 1px solid var(--line-1);
  border-radius: var(--r-3);
  background: linear-gradient(180deg, rgba(22, 32, 46, 0.85), rgba(12, 19, 29, 0.85));
  box-shadow: var(--sh-2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: border-color var(--t) var(--ease), transform var(--t-fast) var(--ease), box-shadow var(--t) var(--ease);
}
.card:hover { border-color: var(--line-2); transform: translateY(-1px); box-shadow: var(--sh-3); }
.card .title { font-weight: 600; font-size: var(--fs-base); line-height: 1.35; }
.card .sub { color: var(--text-2); font-size: var(--fs-md); margin-top: 3px; overflow-wrap: anywhere; }
.card .right { text-align: right; flex-shrink: 0; }
.card .time { font-size: var(--fs-sm); color: var(--text-3); margin-top: var(--s-1); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  border: 1px solid transparent;
}
.chip-назначен { background: var(--gold-soft); color: #e8c14c; border-color: var(--gold-line); }
.chip-выехал { background: var(--acc-soft); color: #66c8ff; border-color: var(--acc-line); }
.chip-на_месте { background: var(--violet-soft); color: #b3a0ff; border-color: var(--violet-line); }
.chip-готово { background: var(--ok-soft); color: #5fe6a6; border-color: var(--ok-line); }
.chip-не_выполнен { background: var(--danger-soft); color: #ff8a99; border-color: var(--danger-line); }
.chip-ext { background: var(--ext-soft); border-color: var(--ext-line); color: #d4b3ff; font-weight: 700; }

.sub.issue { color: #ff9aa7; }

.detail-row { display: flex; gap: var(--s-3); margin: var(--s-2) 0; font-size: var(--fs-md); }
.detail-row b { flex: 0 0 108px; color: #9db4cc; font-weight: 600; }
.detail-row span { overflow-wrap: anywhere; min-width: 0; }

.statusflow { display: flex; flex-wrap: wrap; gap: 6px; margin: var(--s-3) 0; }
.flowstep {
  flex: 1 1 96px;
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  border-radius: var(--r-2);
  padding: 7px 11px;
  font-size: var(--fs-sm);
  text-align: center;
}
.flowstep small { color: var(--text-3); font-size: var(--fs-xs); }
.flowstep.done { border-color: var(--ok-line); background: rgba(47, 212, 131, 0.08); }
.flowstep.now { border-color: var(--acc); background: var(--acc-soft); box-shadow: 0 0 12px rgba(51, 177, 255, 0.15); font-weight: 600; }

.photos { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-2); }
.photos img {
  width: 100px;
  height: 75px;
  object-fit: cover;
  border-radius: var(--r-2);
  border: 1px solid var(--line-1);
  background: var(--bg-2);
  cursor: zoom-in;
}

.issue-banner {
  background: var(--danger-soft);
  border: 1px solid var(--danger-line);
  color: #ffb0ba;
  border-radius: var(--r-2);
  padding: var(--s-2) var(--s-3);
  margin: var(--s-2) 0;
  font-size: var(--fs-md);
}
.issue-form { margin-top: var(--s-3); padding: var(--s-3); border: 1px solid var(--danger-line); border-radius: var(--r-3); background: rgba(255, 91, 107, 0.05); }
.issue-form textarea { margin-bottom: var(--s-2); }

.cl-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-2); margin: var(--s-3) 0 var(--s-2); font-size: var(--fs-md); }
.cl-head b { font-size: var(--fs-md); }
.cl-prog { font-size: var(--fs-sm); color: var(--text-2); }
.cl-title { font-weight: 600; font-size: var(--fs-md); margin: var(--s-3) 0 var(--s-2); color: #cfe0f2; }
.chk-list { display: flex; flex-direction: column; gap: 6px; }
.chk-list label.chk { margin: 0; padding: 9px 10px; }
.chk-item.chk-req { border-color: rgba(255, 91, 107, 0.45); }
.chk-item.chk-done span { color: var(--text-2); text-decoration: line-through; }
.chk-item.chk-req.chk-done { border-color: rgba(47, 212, 131, 0.5); }
.req-badge {
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #ff8a99;
  border: 1px solid rgba(255, 91, 107, 0.5);
  border-radius: 7px;
  padding: 1px 6px;
  margin-left: 6px;
  font-weight: 700;
}
.chk-item.chk-done .req-badge { color: #5fe6a6; border-color: rgba(47, 212, 131, 0.5); }

.cm-list {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-2);
  border: 1px solid var(--line-1);
  border-radius: var(--r-3);
  background: var(--bg-1);
}
.cm { background: var(--bg-2); border: 1px solid var(--line-1); border-radius: var(--r-2); padding: 7px 10px; }
.cm.cm-admin { border-color: var(--acc-line); background: rgba(51, 177, 255, 0.07); }
.cm-head { display: flex; justify-content: space-between; gap: var(--s-2); font-size: var(--fs-sm); color: var(--text-2); margin-bottom: 3px; }
.cm-head b { color: var(--text-1); }
.cm-text { font-size: var(--fs-md); white-space: pre-wrap; overflow-wrap: anywhere; }
.cm-input { display: flex; gap: 6px; align-items: flex-end; margin-top: 6px; }
.cm-input textarea { flex: 1; margin: 0; }
.cm-input button { flex-shrink: 0; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-2); margin-bottom: var(--s-3); }
.stat-card { background: var(--bg-2); border: 1px solid var(--line-1); border-radius: var(--r-3); padding: var(--s-2); text-align: center; }
.stat-num { font-size: var(--fs-xl); font-weight: 700; line-height: 1.2; }
.stat-cap { font-size: var(--fs-xs); color: var(--text-2); margin-top: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { font-size: var(--fs-md); padding: 8px 11px; min-height: 34px; border-radius: var(--r-pill); }
.chips button.sel { background: linear-gradient(180deg, #2fae6a, #239a58); border-color: #38c77e; color: var(--acc-ink); }

.brg-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--s-2); }
.brg-chip {
  padding: 8px 12px;
  font-size: var(--fs-md);
  border-radius: var(--r-pill);
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  color: var(--text-1);
  cursor: pointer;
  line-height: 1.1;
}
.brg-chip.sel { background: linear-gradient(180deg, #1c5f86, #174c6b); border-color: var(--acc); color: #fff; }

.worker-status { margin-top: var(--s-3); display: flex; gap: var(--s-2); }
.worker-status button { flex: 1; font-size: var(--fs-base); padding: var(--s-3); }

.list-field { display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-3); }

#mat-search-box { position: relative; margin-bottom: 6px; }
#mat-search { font-size: var(--fs-base); }
.mat-sug {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 12;
  max-height: 260px;
  overflow-y: auto;
  background: #0c1522;
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  margin-top: 2px;
  box-shadow: var(--sh-3);
}
.mat-sug button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  width: 100%;
  text-align: left;
  margin: 0;
  border: none;
  border-bottom: 1px solid var(--line-1);
  background: transparent;
  border-radius: 0;
  padding: 11px 12px;
  font-size: var(--fs-md);
}
.mat-sug button:last-child { border-bottom: none; }
.mat-sug button:active, .mat-sug button:focus { background: var(--bg-3); }
.mat-sug small { color: var(--text-2); font-size: var(--fs-xs); white-space: nowrap; }
.mat-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.mat-row { display: flex; align-items: center; gap: var(--s-2); background: var(--bg-2); border: 1px solid var(--line-1); border-radius: var(--r-2); padding: 8px 10px; }
.mat-row .mat-name { flex: 1; min-width: 0; font-size: var(--fs-md); overflow-wrap: anywhere; }
.mat-qty { display: flex; align-items: center; gap: 3px; }
.mat-qty button { width: 34px; height: 34px; min-height: 34px; padding: 0; margin: 0; font-size: 17px; border-radius: var(--r-1); flex-shrink: 0; }
.mat-qty .m-n {
  width: 72px;
  height: 36px;
  min-height: 36px;
  padding: 6px;
  margin: 0;
  text-align: center;
  font-size: var(--fs-base);
  border-radius: var(--r-1);
}
.mat-row .m-del { width: 34px; height: 34px; min-height: 34px; padding: 0; margin: 0; font-size: 14px; border-radius: var(--r-1); }

.rep-card { flex-direction: column; align-items: stretch; }
.rep-card .photos img { width: 130px; height: 95px; }
.report-tools { display: flex; gap: var(--s-2); margin-top: var(--s-2); flex-wrap: wrap; }
.report-tools .btn-sm { margin: 0; }

#report-form > button { margin-top: var(--s-2); }

.price-top { margin-bottom: var(--s-2); }
.price-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: var(--s-3); }
.price-tabs button { font-size: var(--fs-sm); padding: 7px 11px; min-height: 32px; border-radius: var(--r-pill); background: var(--bg-2); border: 1px solid var(--line-1); color: var(--text-2); }
.price-tabs button.active { border-color: var(--acc); color: var(--acc); background: var(--acc-soft); }
.price-search { width: 100%; margin-bottom: var(--s-2); }
.price-note { font-size: var(--fs-sm); color: var(--text-2); background: var(--bg-2); border: 1px solid var(--line-1); padding: var(--s-2) var(--s-3); border-radius: var(--r-1); margin-bottom: var(--s-3); white-space: pre-line; }
.price-view { max-height: 58vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.price-cat { margin: var(--s-4) 0 var(--s-1); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.04em; color: var(--acc); font-weight: 700; }
.price-row { display: flex; gap: var(--s-3); padding: 7px 2px; border-bottom: 1px solid var(--line-1); }
.price-name { flex: 1; min-width: 0; }
.price-name b { font-size: var(--fs-md); font-weight: 600; }
.price-name small { display: block; color: var(--text-2); font-size: var(--fs-sm); margin-top: 2px; line-height: 1.35; }
.price-val { font-weight: 700; color: var(--acc); white-space: nowrap; font-size: var(--fs-md); }

.regl-head { margin-bottom: var(--s-2); }
.regl-title { font-size: var(--fs-base); font-weight: 700; margin-bottom: var(--s-1); line-height: 1.35; }
.regl-meta { font-size: var(--fs-sm); color: var(--text-2); margin-bottom: var(--s-2); }
.regl-view { max-height: 58vh; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-right: 4px; }
.regl-sec { margin-bottom: var(--s-4); }
.regl-sec-t { font-size: var(--fs-md); font-weight: 700; color: var(--acc); margin: var(--s-3) 0 var(--s-2); }
.regl-sub { font-size: 12.5px; font-weight: 600; margin: var(--s-2) 0 var(--s-1); }
.regl-item { font-size: var(--fs-md); line-height: 1.45; padding: 4px 0 4px 2px; border-bottom: 1px solid var(--line-1); }
.regl-item.ind { padding-left: 14px; color: #c6d2e0; }
.regl-empty { color: var(--text-2); padding: var(--s-3) 0; }
.regl-item.warn, .regl-sub.warn { color: #ffb35c; border-left: 3px solid #ff8a3d; padding-left: 8px; }

.bell-on { border-color: var(--acc); color: var(--acc); }
.bell-denied { color: var(--danger); border-color: var(--danger-line); }
.card.flash { outline: 2px solid var(--acc); outline-offset: 3px; animation: flash 1s ease-in-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 4px rgba(51, 177, 255, 0.45); } 100% { box-shadow: none; } }

.card.compact { padding: var(--s-2) var(--s-3); }
.detail-row.tight { margin-top: var(--s-2); margin-bottom: 0; }
.detail-row.tight-sm { margin-top: var(--s-1-5); margin-bottom: 0; }
.photos.tight { margin-top: var(--s-1-5); }
.row > textarea { margin: 0; }
.is-busy { opacity: 0.7; cursor: progress; }
