:root {
  --bg: #f3f0ea;
  --ink: #1c2430;
  --muted: #5c6775;
  --card: #fffdf8;
  --accent: #0f6b5c;
  --accent-2: #c45c26;
  --line: #ddd6c8;
  --ok: #1a7a4c;
  --warn: #9a6b00;
  --err: #a12828;
  --radius: 14px;
  --font: "Manrope", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #d7ebe4 0%, transparent 55%),
    radial-gradient(900px 400px at 100% 0%, #f3d9c8 0%, transparent 50%),
    var(--bg);
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
.wrap { max-width: 920px; margin: 0 auto; padding: 20px 16px 48px; }
.top {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-bottom: 18px; flex-wrap: wrap;
}
.brand { font-weight: 800; letter-spacing: -0.02em; font-size: 1.15rem; }
.brand span { color: var(--accent); }
.muted { color: var(--muted); font-size: 0.92rem; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: 0 10px 30px rgba(28,36,48,0.06);
  margin-bottom: 14px;
}
h1,h2 { margin: 0 0 10px; letter-spacing: -0.02em; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 10px; padding: 10px 14px;
  font-weight: 700; cursor: pointer; font-family: inherit;
  background: var(--accent); color: #fff;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    color 0.18s ease,
    filter 0.18s ease;
  box-shadow: 0 2px 0 rgba(15, 107, 92, 0.25);
  will-change: transform;
}
.btn.secondary {
  background: #e8e2d6;
  color: var(--ink);
  box-shadow: 0 2px 0 rgba(28, 36, 48, 0.08);
}
.btn.danger {
  background: var(--accent-2);
  box-shadow: 0 2px 0 rgba(196, 92, 38, 0.28);
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.block { width: 100%; }
.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow:
    0 8px 18px rgba(15, 107, 92, 0.22),
    0 0 0 3px rgba(15, 107, 92, 0.12);
}
.btn.secondary:hover:not(:disabled) {
  background: #ddd5c5;
  box-shadow:
    0 8px 16px rgba(28, 36, 48, 0.12),
    0 0 0 3px rgba(15, 107, 92, 0.1);
}
.btn.danger:hover:not(:disabled) {
  box-shadow:
    0 8px 18px rgba(196, 92, 38, 0.28),
    0 0 0 3px rgba(196, 92, 38, 0.14);
}
.btn:active:not(:disabled) {
  transform: translateY(0);
  filter: brightness(0.98);
}
.btn.active,
a.btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow:
    0 4px 14px rgba(15, 107, 92, 0.28),
    0 0 0 3px rgba(15, 107, 92, 0.18);
}
.btn.secondary.active {
  background: var(--accent);
  color: #fff;
}
.admin-nav .nav-back {
  border: 1px solid rgba(15, 107, 92, 0.22);
}
.submenu-actions .btn {
  min-width: 132px;
}
.filters a {
  padding: 6px 10px; border-radius: 999px; background: #ebe5d9; color: var(--ink);
  font-size: 0.85rem; font-weight: 600;
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}
.filters a:hover {
  transform: translateY(-1px);
  background: #e0d8c8;
  box-shadow: 0 0 0 3px rgba(15, 107, 92, 0.1);
}
.filters a.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(15, 107, 92, 0.16);
}
@media (prefers-reduced-motion: reduce) {
  .btn, .filters a { transition: none; }
  .btn:hover:not(:disabled), .filters a:hover { transform: none; }
}
label { display: block; font-weight: 600; margin: 12px 0 6px; font-size: 0.92rem; }
input, select, textarea {
  width: 100%; padding: 11px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; font: inherit;
}
textarea { min-height: 90px; resize: vertical; }
.flash {
  padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; font-weight: 600;
}
.flash.ok { background: #e5f6ec; color: var(--ok); }
.flash.warn { background: #fff4d6; color: var(--warn); }
.flash.err { background: #fde8e8; color: var(--err); }
.error { color: var(--err); font-weight: 600; margin: 8px 0; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line);
  vertical-align: top; font-size: 0.95rem;
}
.table th { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.badge {
  display: inline-block; padding: 3px 8px; border-radius: 999px;
  background: #e8e2d6; font-size: 0.8rem; font-weight: 700;
}
.badge.ready { background: #dff3e8; color: var(--ok); }
.badge.repair { background: #fff0df; color: var(--accent-2); }
.badge.issued { background: #e7eef8; color: #245a8c; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.client-hint {
  margin: 8px 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #eef7f4;
  font-size: 0.9rem;
  color: var(--ink);
}
.client-hint .hist { margin: 8px 0 0; padding-left: 18px; }
.client-hint .hist li { margin: 2px 0; color: var(--muted); }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.stat-pill {
  background: #ebe5d9;
  border-radius: 12px;
  padding: 10px 12px;
}
.stat-n { font-size: 1.4rem; font-weight: 800; margin-top: 2px; }
.stat-pill.highlight {
  background: #dff3e8;
  border: 1px solid #b5dfc8;
}
.payout-banner {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #ebe5d9;
  line-height: 1.45;
}
.payout-banner.now {
  background: #dff3e8;
  border: 1px solid #b5dfc8;
}
.payout-banner.soon {
  background: #fff0df;
  border: 1px solid #efd2a8;
}
.payout-banner.next {
  background: #e7eef8;
  border: 1px solid #c5d4e8;
}
.hist { margin: 8px 0 0; padding-left: 18px; }
.howto {
  background: #eef7f4;
  border-color: #b9d9cf;
}
.howto-list {
  margin: 0 0 12px;
  padding-left: 20px;
  line-height: 1.55;
}
.howto-list li { margin: 6px 0; }
.howto-contacts {
  margin: 0;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  line-height: 1.55;
  font-size: 0.95rem;
}
.howto-compact {
  font-size: 0.95rem;
  line-height: 1.5;
}
.sticker-modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(28,36,48,0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.sticker-box {
  background: #fffdf8;
  border: 2px solid var(--ink);
  border-radius: 16px;
  padding: 22px 20px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}
.sticker-id {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin: 8px 0 14px;
  color: var(--accent);
}
.sticker-line {
  text-align: left;
  font-size: 1.05rem;
  margin: 6px 0;
}
.filters label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 4px; }
.filters select, .filters input { min-width: 140px; }
.filter-bar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end;
  margin-bottom: 12px;
}
.filter-bar input[type="search"], .filter-bar input:not([type]), .filter-bar select {
  flex: 1; min-width: 160px;
}
.pager {
  display: flex; gap: 12px; align-items: center; justify-content: center;
  margin-top: 14px; flex-wrap: wrap;
}
.order-cards { display: none; }
.order-card {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 8px;
  background: #fff;
  color: inherit;
}
.order-card-top {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; margin-bottom: 4px;
}
.notif-card { background: #fff0df; border-color: #efd2a8; }
.notif-list { margin: 8px 0 0; padding-left: 0; list-style: none; }
.notif-list li {
  display: flex; justify-content: space-between; gap: 10px;
  align-items: flex-start; padding: 6px 0;
  border-bottom: 1px dashed var(--line);
}
.inline-form { margin: 0; }
.linkish {
  border: 0; background: none; color: var(--muted); cursor: pointer;
  font: inherit; text-decoration: underline; padding: 0;
}
.app-row {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.reject-form, .pw-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 0; }
.wrap.has-bottom-nav { padding-bottom: 88px; }
.bottom-nav {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: rgba(255,253,248,0.96);
  border-top: 1px solid var(--line);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  justify-content: space-around;
  backdrop-filter: blur(8px);
}
.bottom-nav-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; font-size: 0.75rem; font-weight: 700; color: var(--ink);
  min-width: 72px; padding: 4px;
}
.bn-ico { font-size: 1.2rem; line-height: 1; }
.bn-badge {
  display: inline-block;
  margin-left: 4px;
  min-width: 1.1rem;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent-2);
  color: #fff;
  font-size: 0.7rem;
  line-height: 1.3;
  vertical-align: middle;
}
.live-toast {
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(72px + env(safe-area-inset-bottom));
  z-index: 45;
  background: #1c2430;
  color: #fff;
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
}
.live-toast a { color: #9fe0d0; }
.share-block {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.share-block:first-of-type { border-top: 0; padding-top: 0; }
.share-text {
  margin-top: 8px;
  font-size: 0.9rem;
  background: #f7f3ec;
}
.svc-rows { display: flex; flex-direction: column; gap: 8px; }
.svc-row {
  display: grid;
  grid-template-columns: 1fr 90px 110px 42px;
  gap: 8px;
  align-items: center;
}
.svc-row input { margin: 0; }
@media (max-width: 640px) {
  .svc-row { grid-template-columns: 1fr 1fr; }
  .svc-row input[name="svc_name"] { grid-column: 1 / -1; }
}
.login-wrap { max-width: 420px; margin: 8vh auto; padding: 16px; }
.meta-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 640px) {
  .meta-row { grid-template-columns: 1fr; }
  .table th:nth-child(4), .table td:nth-child(4) { display: none; }
  .desktop-table { display: none; }
  .order-cards { display: block; }
  .bottom-nav { display: flex; }
  .top-actions .btn:not(.secondary) { display: none; }
}
@media (min-width: 641px) {
  .order-cards { display: none; }
  .desktop-table { display: table; }
}

