:root {
  --brand: #77fc03;
  --brand-deep: #63e000;
  --brand-soft: #f0ffe0;
  --ink: #111111;
  --muted: #5c5c5c;
  --legal: #7a7a7a;
  --line: #e6e6e8;
  --paper: #f4f5f3;
  --white: #ffffff;
  --side: #16141c;
  --side-mid: #1f1c27;
  --danger: #d92d20;
  --ok: #12b76a;
  --warn: #dc6803;
  --font: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --r: 14px;
  --shadow: 0 12px 40px rgba(17, 17, 17, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
}

button, input, select { font-family: inherit; }
button { cursor: pointer; border: none; background: none; }
.is-off, .btn[hidden] { display: none !important; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand strong {
  display: block;
  font-size: 18px;
  letter-spacing: -0.04em;
}

.brand small {
  display: block;
  color: var(--legal);
  font-size: 12px;
}

.brand svg { flex-shrink: 0; }

.ico {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background: var(--paper);
}

.auth-card {
  width: min(420px, 100%);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px 28px;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  margin: 28px 0 8px;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.lead, .hint {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.hint { margin-top: 14px; font-size: 12px; }

.lbl {
  display: block;
  margin: 16px 0 6px;
  font-size: 13px;
  font-weight: 600;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 4px;
  font-size: 14px;
  font-weight: 600;
}

.check input {
  width: 16px;
  height: 16px;
}

.inp {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  font-size: 15px;
  background: var(--white);
}

.inp:focus {
  outline: 2px solid #111;
  outline-offset: 1px;
  border-color: #111;
}

.inp:disabled {
  background: #f4f4f6;
  color: #555;
  cursor: default;
  opacity: 1;
}

.btn {
  height: 46px;
  border-radius: 999px;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-brand {
  width: 100%;
  margin-top: 20px;
  background: var(--brand);
  color: #111;
}

.btn-brand:hover { background: var(--brand-deep); }

.btn-ghost {
  background: #f3f3f4;
  color: var(--ink);
}

.btn-danger {
  background: #fee4e2;
  color: var(--danger);
}

.btn-danger:hover { background: #fecdca; }

.qty-num {
  color: var(--brand-deep);
  font-weight: 800;
  background: none;
}

.btn-sm {
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  width: auto;
  margin: 0;
}

.btn-sm .ico { width: 14px; height: 14px; }

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
}

.side {
  background: var(--side);
  color: #f5f5f5;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand-side small { color: #9c98a8; }

.nav { display: flex; flex-direction: column; gap: 4px; }

.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  color: #c9c5d3;
  padding: 11px 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
}

.nav-count {
  margin-left: auto;
  min-width: 0;
  height: auto;
  padding: 0;
  border-radius: 0;
  background: none;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  display: inline;
  line-height: 1;
}

.nav-count[hidden] { display: none !important; }

.nav-btn.has-alert {
  color: #fff;
}

.nav-btn .ico { width: 20px; height: 20px; opacity: 0.72; }

.nav-btn:hover {
  background: var(--side-mid);
  color: #fff;
}

.nav-btn:hover .ico { opacity: 1; }

.nav-btn.is-on {
  background: #2a2733;
  color: #fff;
}

.nav-btn.is-on .ico {
  opacity: 1;
  color: var(--brand);
}

.side-foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #9c98a8;
  font-size: 13px;
  gap: 8px;
}

.who-mini {
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: #2a2733;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.avatar-lg {
  width: 34px;
  height: 34px;
  font-size: 12px;
  background: #eef0eb;
  color: #111;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
}

.icon-btn:hover { background: var(--paper); color: var(--ink); }

.side-foot .icon-btn { color: #c9c5d3; }
.side-foot .icon-btn:hover { background: #2a2733; color: #fff; }

.main { padding: 28px 32px 48px; }

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 22px;
}

.kicker {
  color: var(--legal);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.top h2 {
  font-size: 30px;
  letter-spacing: -0.04em;
}

.top .btn-brand { width: auto; margin: 0; }

.page { display: none; }
.page.is-on { display: block; }

.page-map.is-on {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  gap: 12px;
  height: calc(100vh - 140px);
  min-height: 420px;
}

.map-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}

.map-side .toolbar {
  padding: 12px;
  margin: 0;
  flex-direction: column;
}

.map-side .search-wrap,
.map-side .select-wrap { max-width: none; }

.map-list {
  list-style: none;
  overflow: auto;
  padding: 4px 8px 12px;
}

.map-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 8px;
  border-radius: 10px;
  cursor: pointer;
}

.map-item:hover, .map-item.is-on { background: #f3f4f1; }

.map-item b { display: block; font-size: 13px; }
.map-item small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }

.map-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.06);
}

.map-empty {
  padding: 18px 12px;
  color: var(--muted);
  font-size: 13px;
}

.map-stage {
  position: relative;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: #e8ebe4;
}

#ops-map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

.layers-tool {
  position: absolute;
  top: auto;
  right: 12px;
  bottom: 40px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}

.layers-fab {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
  pointer-events: auto;
}

.layers-fab:hover { background: #f7f7f7; }

.layers-tip {
  min-width: 22px;
  height: 14px;
  padding: 0 5px;
  border-radius: 7px;
  background: #111;
  color: var(--brand);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 14px;
  text-align: center;
  white-space: nowrap;
}

.ops-emoji {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  cursor: pointer;
  overflow: visible;
}

.ops-emoji-head {
  position: relative;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.ops-emoji.is-on .ops-emoji-head {
  width: 66px;
  height: 66px;
}

.ops-emoji-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2.5px solid #63e000;
  box-shadow: 0 0 10px rgba(99, 224, 0, 0.7);
  animation: ops-ring-pulse 1.4s ease-in-out infinite;
}

.ops-emoji.is-on .ops-emoji-ring { border-width: 3px; }

.ops-emoji-glyph {
  position: relative;
  z-index: 1;
  font-size: 28px;
  line-height: 1;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.45));
}

.ops-emoji.is-on .ops-emoji-glyph { font-size: 34px; }

.ops-beam {
  display: none;
  width: 8px;
  flex: 1;
  min-height: 0;
  border-radius: 8px;
  background: linear-gradient(to top, rgba(99, 224, 0, 0.12), rgba(198, 255, 90, 0.95));
  box-shadow: 0 0 10px rgba(99, 224, 0, 0.45);
}

.ops-emoji.is-iso {
  justify-content: flex-start;
}

.ops-emoji.is-iso .ops-beam { display: block; }

.ops-emoji.is-iso::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -28px;
  width: 56px;
  height: 56px;
  margin-left: -28px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(214, 255, 138, 0.9) 0%, rgba(99, 224, 0, 0.45) 22%, rgba(99, 224, 0, 0) 70%);
  pointer-events: none;
}

.ops-emoji.is-iso.is-on::after {
  width: 72px;
  height: 72px;
  margin-left: -36px;
  bottom: -36px;
}

@keyframes ops-ring-pulse {
  0%, 100% { transform: scale(0.9); opacity: 1; }
  50% { transform: scale(1.22); opacity: 0.4; }
}

.map-notice {
  position: absolute;
  inset: auto 12px 12px 12px;
  z-index: 2;
  margin: 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: #111;
  color: #fff;
  font-size: 13px;
}

.map-item.is-nopos { opacity: 0.55; }
.map-item.is-deleted b { text-decoration: line-through; }

.ops-pop { font-family: var(--font); min-width: 200px; }
.ops-pop b { display: block; margin-bottom: 4px; font-size: 14px; }
.ops-pop p { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.ops-pop .ops-pop-coord { font-variant-numeric: tabular-nums; font-size: 12px; }
.ops-pop-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.ops-pop .btn { width: auto; margin: 0; text-decoration: none; }

.plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.plan-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 18px;
}

.plan-card small {
  color: var(--legal);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.plan-card strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 22px;
  letter-spacing: -0.04em;
}

.plan-card span { display: block; color: var(--muted); font-size: 13px; }

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}

.tab {
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--white);
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.tab.is-on { background: #111; color: #fff; border-color: #111; }

.mgmt { display: none; }
.mgmt.is-on { display: block; }

.mgmt-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sku-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 4px;
}

.sku-row {
  display: grid;
  grid-template-columns: 1fr 160px;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  background: var(--paper);
  border-radius: 12px;
}

.sku-row strong { display: block; font-size: 15px; }
.sku-row small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.sku-row .lbl { margin: 0 0 6px; }

.cat-plans { margin: 12px 0 4px; }
.cat-plans .plan-card { padding-bottom: 8px; }
.cat-plans .lbl { margin-top: 12px; }
.cat-help { padding: 0 18px; margin-bottom: 0; }
.table-card .toolbar { padding: 12px 18px 8px; }

.card.pad { padding: 8px 18px 20px; }

.btn-inline {
  width: auto;
  margin-top: 16px;
}

.area {
  height: auto;
  min-height: 96px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.45;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.stats-3 { grid-template-columns: repeat(3, 1fr); }

.stat-link { cursor: pointer; }
.stat-link:hover { border-color: #111; }

.stat.is-alert {
  border-color: #f79009;
  background: #fff8eb;
}

.stat.is-alert .stat-ico { background: #fff4e5; color: #b54708; }
.stat.is-alert strong { color: #b54708; }

.log-alert {
  margin-bottom: 14px;
}

.log-alert[hidden] { display: none !important; }

.log-alert-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  padding: 14px 16px;
  border-radius: var(--r);
  border: 1px solid #f79009;
  background: #fff8eb;
  color: #111;
}

.log-alert-btn strong { display: block; font-size: 16px; }
.log-alert-btn span { display: block; color: #b54708; font-size: 13px; margin-top: 2px; }
.log-alert-btn .ico { flex-shrink: 0; color: #b54708; }

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.stat, .card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.stat {
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.stat-ico, .card-ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #f3f4f1;
  color: #111;
  flex-shrink: 0;
}

.stat-ico .ico, .card-ico .ico { width: 20px; height: 20px; }

.stat small {
  color: var(--legal);
  font-size: 12px;
  font-weight: 600;
}

.stat strong {
  display: block;
  margin: 6px 0 4px;
  font-size: 26px;
  letter-spacing: -0.04em;
}

.stat div > span { color: var(--muted); font-size: 13px; }

.grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 12px;
}

.billing-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.billing-help {
  padding: 8px 18px 0;
}

.card-head {
  padding: 16px 18px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-head .btn { margin-left: auto; }

.card-head h3 { font-size: 16px; }

.feed { list-style: none; padding: 8px 8px 12px; }

.feed li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  border-radius: 10px;
}

.feed-ico {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #f3f4f1;
  color: #111;
  flex-shrink: 0;
}

.feed-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.feed li:hover { background: var(--paper); }
.feed li[data-nav], .feed li[data-edit-ticket] { cursor: pointer; }

.feed b { font-size: 14px; font-weight: 600; }
.feed small { display: block; color: var(--muted); font-weight: 400; margin-top: 2px; }
.feed time { color: var(--legal); font-size: 12px; white-space: nowrap; }

.empty-mini {
  padding: 18px;
  color: var(--muted);
  font-size: 14px;
}

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.search-wrap {
  position: relative;
  max-width: 360px;
  flex: 1;
}

.search-wrap .ico {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--legal);
  pointer-events: none;
}

.search-wrap .inp { padding-left: 40px; }

.search { max-width: 360px; }

.select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 260px;
  height: 46px;
  padding: 0 12px 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}

.select-wrap span {
  color: var(--legal);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.select-wrap .select {
  max-width: none;
  height: 44px;
  border: none;
  padding: 0;
  background: transparent;
}

.select-wrap .select:focus { outline: none; }

.select { max-width: 220px; }

.table-card { overflow: auto; }

table { width: 100%; border-collapse: collapse; }

th, td {
  text-align: left;
  padding: 13px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  color: var(--legal);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #fafafa;
}

tr:last-child td { border-bottom: none; }

tbody tr:hover { background: #f7f7f8; }

.who {
  display: flex;
  align-items: center;
  gap: 10px;
}

.who b { display: block; }
.who small { color: var(--muted); }

.pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.pill-ok { background: #e7f8ef; color: #087443; }
.pill-warn { background: #fff4e5; color: #b54708; }
.pill-off { background: #f3f3f4; color: #5c5c5c; }
.pill-plan { background: var(--brand-soft); color: #3b6d00; }
.pill-bad { background: #fee4e2; color: #b42318; }
.pill-reserva { background: #e8f1ff; color: #175cd3; }

tr.is-deleted td { color: var(--legal); }
tr.is-deleted b { text-decoration: line-through; }
tr.is-pending td { background: #fffdf6; }

.when {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.dates-meta {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--legal);
  font-size: 12px;
}

.dates-meta b {
  color: var(--ink);
  font-weight: 600;
}

.row-acts { display: flex; gap: 6px; justify-content: flex-end; }

.row-acts .icon-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background: var(--white);
}

.row-acts .icon-btn:hover { border-color: #111; }

.drawer {
  position: fixed;
  inset: 0;
  z-index: 20;
}

.drawer[hidden] { display: none !important; }

.drawer-back {
  position: absolute;
  inset: 0;
  background: rgba(22, 20, 28, 0.42);
}

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(440px, 100%);
  height: 100%;
  background: var(--white);
  display: flex;
  flex-direction: column;
  box-shadow: -16px 0 40px rgba(17, 17, 17, 0.12);
}

.drawer.is-modal {
  display: grid;
  place-items: center;
  padding: 24px;
}

.drawer.is-modal .drawer-panel {
  position: relative;
  width: min(460px, 100%);
  height: auto;
  max-height: min(90vh, 720px);
  border-radius: 22px;
  box-shadow: 0 24px 64px rgba(17, 17, 17, 0.16);
}

.drawer.is-wide .drawer-panel {
  width: min(820px, 100%);
  max-height: min(94vh, 920px);
}

.log-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.log-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fafafa;
}

.log-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.log-card strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  letter-spacing: -0.03em;
}

.log-card span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.log-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 10px;
}

.log-step {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f3f3f4;
  color: #667085;
}

.log-step.is-on {
  background: var(--brand-soft);
  color: #3b6d00;
}

.log-step.is-done {
  background: #e7f8ef;
  color: #087443;
}

.log-addr, .log-slip {
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}

.log-tags {
  display: grid;
  gap: 8px;
}

.log-tag {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}

.log-fretes {
  display: grid;
  gap: 8px;
}

.log-frete {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
}

.log-frete.is-on {
  border-color: #3b6d00;
  background: var(--brand-soft);
}

.log-frete.is-best {
  box-shadow: inset 0 0 0 1px #3b6d00;
}

.log-frete small { color: var(--muted); display: block; margin-top: 2px; }

.log-frete-price {
  text-align: right;
}

.log-frete-price b { display: block; font-size: 15px; }
.log-delta {
  display: block;
  font-size: 11px;
  font-weight: 700;
  margin-top: 2px;
}
.log-delta.is-save { color: #087443; }
.log-delta.is-match { color: #3b6d00; }
.log-delta.is-over { color: #b54708; }

.log-paid {
  border: 1px solid #d0f0a0;
  background: #f6ffe8;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.log-paid strong { font-size: 18px; letter-spacing: -0.03em; }
.log-paid p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.log-block {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  margin: 0 0 12px;
  background: #fff;
}

.log-block.is-current {
  border-color: #111;
  box-shadow: 0 8px 24px rgba(17, 17, 17, 0.06);
}

.log-block.is-done {
  background: #fbfef8;
}

.log-block.is-wait { opacity: 0.72; }

.log-block-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.log-n {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #111;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.log-block.is-done .log-n { background: #087443; }
.log-block.is-wait .log-n { background: #d0d5dd; color: #667085; }

.log-block-head h4 { margin: 0; font-size: 15px; }
.log-block-head p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }

.log-print {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 14px;
  background: #111;
  color: #fff;
}

.log-print p { margin: 0; color: #c9c5d3; font-size: 13px; }
.log-print.is-off { background: #2a2a2a; opacity: 0.72; }
.log-print .btn { justify-self: start; }
.log-print-wait { background: #1a1508; }
.log-print-wait b { color: #f5c451; }

.log-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tag-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.tag-choice {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 12px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fafafa;
  text-align: center;
  color: #111;
}

.tag-choice:hover {
  border-color: #111;
  background: #fff;
}

.tag-choice b { font-size: 15px; }
.tag-choice small { color: var(--muted); line-height: 1.35; }

.tag-art {
  width: 100%;
  height: 148px;
  object-fit: contain;
  background: #111;
  border-radius: 16px;
  display: block;
}

.log-paid .tag-art { height: 120px; }

.log-group { margin-top: 12px; }
.log-group > small {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
}

.log-bind {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 8px;
}

.log-bind .field-row { margin: 0; }

@media (max-width: 720px) {
  .tag-pick { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .log-grid { grid-template-columns: 1fr; }
}

.drawer-head, .drawer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.drawer-head-text { min-width: 0; }

.drawer-lead {
  margin-top: 4px;
  color: var(--legal);
  font-size: 13px;
  line-height: 1.4;
}

.drawer-lead:empty { display: none; }

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f7f8;
}

.status-row span { font-size: 13px; font-weight: 600; }

.field-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.field-row .inp { flex: 1; }

.btn-qr {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #111;
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.btn-qr:hover { background: #2a2436; }

.qr-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
}

.qr-overlay[hidden] { display: none !important; }

.qr-back {
  position: absolute;
  inset: 0;
  background: rgba(22, 20, 28, 0.55);
}

.qr-card {
  position: relative;
  width: min(420px, 100%);
  background: #111;
  color: #fff;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(17, 17, 17, 0.28);
}

.qr-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 18px 12px;
}

.qr-head h3 { font-size: 18px; letter-spacing: -0.03em; }

.qr-head p {
  margin-top: 4px;
  color: #b7b3c2;
  font-size: 13px;
}

.qr-head .icon-btn { color: #fff; }
.qr-head .icon-btn:hover { background: #2a2733; }

.qr-view {
  position: relative;
  margin: 0 18px 18px;
  aspect-ratio: 1;
  border-radius: 16px;
  overflow: hidden;
  background: #1a1a1d;
}

.qr-view video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qr-frame {
  position: absolute;
  inset: 18%;
  border: 2px solid #77fc03;
  border-radius: 16px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.drawer-foot {
  border-bottom: none;
  border-top: 1px solid var(--line);
  gap: 8px;
  justify-content: flex-end;
}

.drawer-foot-spacer { flex: 1; }

.drawer-foot .btn { width: auto; margin: 0; }

.drawer-body {
  padding: 8px 20px 24px;
  overflow: auto;
}

.drawer-acts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.icon-x {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--muted);
}

.icon-x:hover { background: var(--paper); }

.page.is-syncing .table-card,
.page.is-syncing .stats,
.page.is-syncing .grid-3 {
  opacity: 0.55;
  transition: opacity 0.15s ease;
}

.assoc-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.assoc-badge {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: #3b6d00;
  font-size: 12px;
  letter-spacing: 0;
}

.assoc-search { max-width: none; margin-bottom: 6px; }
.assoc-feed { padding: 0; max-height: 240px; overflow: auto; }
.assoc-feed li { padding: 10px 8px; }

.feed li.assoc-confirm,
.feed li.assoc-confirm:hover {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  background: var(--brand-soft);
  border: 1px solid #c9f59a;
}

.assoc-acts {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.feed small.assoc-warn { color: var(--warn); margin-top: 6px; }

.help {
  margin-top: 8px;
  color: var(--legal);
  font-size: 12px;
  line-height: 1.4;
}

.token-visual {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.04em;
  color: #444;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(16px);
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
  z-index: 30;
}

.toast.is-on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.nav-mobile { display: none; }

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .stats, .stats-3, .grid-2, .grid-3 { grid-template-columns: 1fr 1fr; }
  .main { padding: 20px 16px 40px; }
  .page-map.is-on {
    grid-template-columns: 1fr;
    height: auto;
  }
  #ops-map { min-height: 420px; }
  .nav-mobile {
    display: flex;
    gap: 6px;
    padding: 12px 16px 0;
    overflow: auto;
  }
  .nav-mobile .nav-btn {
    position: relative;
    color: var(--ink);
    background: var(--white);
    border: 1px solid var(--line);
    white-space: nowrap;
  }
  .nav-mobile .nav-count {
    min-width: 0;
    height: auto;
    font-size: 12px;
    color: var(--brand-deep);
  }
  .nav-mobile .nav-btn .ico { opacity: 0.7; }
  .nav-mobile .nav-btn.is-on {
    background: #111;
    color: #fff;
    box-shadow: none;
  }
  .nav-mobile .nav-btn.is-on .ico { color: var(--brand); opacity: 1; }
}

@media (max-width: 640px) {
  .stats, .stats-3, .grid-2, .grid-3, .plans { grid-template-columns: 1fr; }
  .sku-row { grid-template-columns: 1fr; }
  .top { flex-direction: column; align-items: flex-start; gap: 12px; }
  .search, .select, .search-wrap, .select-wrap { max-width: none; }
  .toolbar { flex-direction: column; }
}

.mon-body {
  margin: 0;
  min-height: 100dvh;
  background: #111;
  font-family: var(--font);
}

.mon-stage {
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
}

#mon-map {
  position: absolute;
  inset: 0;
}

.mon-card {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 3;
  padding: 16px 18px;
  border-radius: 18px;
  background: #111;
  color: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.mon-card b {
  display: block;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.mon-card p {
  margin: 6px 0 0;
  color: #c9c5d3;
  font-size: 13px;
}

.mon-err {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  margin: 0;
  padding: 18px;
  border-radius: 16px;
  background: #111;
  color: #fff;
  text-align: center;
  font-weight: 600;
}

.mon-stage .layers-tool {
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
  bottom: auto;
}
