:root {
  --bg: #10161d;
  --surface: #1a222c;
  --surface-2: #212b37;
  --line: #2d3947;
  --steel: #3d4a5c;
  --text: #e8ecf1;
  --muted: #8a97a8;
  --amber: #ffb020;
  --amber-dim: #7a5a1f;
  --green: #4ade80;
  --red: #f0533d;
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
  --radius: 3px;
  --sidebar-w: 236px;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
  text-decoration: none;
}
.accent {
  color: var(--amber);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}

::selection {
  background: var(--amber);
  color: #10161d;
}
:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}


.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}


.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 22px 14px;
  z-index: 20;
  transition: left 0.3s ease;
}
.sidebar-top {
  padding: 0 8px 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  position: relative;
  width: 24px;
  height: 24px;
  display: inline-block;
  flex-shrink: 0;
}
.brand-mark-dot {
  position: absolute;
  inset: 6px;
  background: var(--amber);
  border-radius: 1px;
}
.corner {
  position: absolute;
  width: 8px;
  height: 8px;
  border: 2px solid var(--muted);
}
.corner.tl {
  top: 0;
  left: 0;
  border-right: none;
  border-bottom: none;
}
.corner.tr {
  top: 0;
  right: 0;
  border-left: none;
  border-bottom: none;
}
.corner.bl {
  bottom: 0;
  left: 0;
  border-right: none;
  border-top: none;
}
.corner.br {
  bottom: 0;
  right: 0;
  border-left: none;
  border-top: none;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.03em;
  font-size: 1rem;
}

.sidebar-nav {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.nav-indicator {
  position: absolute;
  left: 0;
  width: 3px;
  background: var(--amber);
  border-radius: 0 3px 3px 0;
  height: 44px;
  top: 0;
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(255, 176, 32, 0.5);
}
.nav-btn {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 11px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  transition:
    color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}
.nav-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
  transition:
    opacity 0.18s ease,
    transform 0.3s ease;
}
.nav-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  transform: translateX(2px);
}
.nav-btn:hover svg {
  transform: scale(1.08);
}
.nav-btn.active {
  color: var(--text);
  background: rgba(255, 176, 32, 0.08);
}
.nav-btn.active svg {
  opacity: 1;
  color: var(--amber);
}

.sidebar-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 12px 4px;
  border-top: 1px solid var(--line);
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--green);
  letter-spacing: 0.05em;
}
.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(74, 222, 128, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
  }
}


.mobile-topbar {
  display: none;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 15;
  background: rgba(16, 22, 29, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
}
.hamburger {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hamburger span {
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 19;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}


.content {
  padding: 36px 40px 64px;
  min-width: 0;
}
.page {
  display: none;
}
.page.active {
  display: block;
  animation: pagein 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes pagein {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.page-head {
  margin-bottom: 28px;
}
.eyebrow {
  font-family: var(--font-mono);
  color: var(--amber);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  margin: 0 0 10px;
}
.page-head h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
  margin: 0 0 8px;
}
.page-sub {
  color: var(--muted);
  margin: 0;
  max-width: 56ch;
}


.btn-primary {
  position: relative;
  overflow: hidden;
  background: var(--amber);
  color: #1a1204;
  border: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 11px 20px;
  border-radius: var(--radius);
  cursor: pointer;
  transition:
    filter 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.2s ease;
  white-space: nowrap;
}
.btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 18px rgba(255, 176, 32, 0.25);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(1px);
}
.btn-wide {
  width: 100%;
}
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-outline:hover {
  filter: none;
  box-shadow: none;
  border-color: var(--amber);
  color: var(--amber);
}
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: scale(0);
  pointer-events: none;
  animation: rippleAnim 0.6s ease-out forwards;
}
@keyframes rippleAnim {
  to {
    transform: scale(2.6);
    opacity: 0;
  }
}


.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}
.stat-card:hover {
  border-color: var(--steel);
  transform: translateY(-2px);
}
.hnum {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.9rem;
  color: var(--text);
}
.hlabel {
  color: var(--muted);
  font-size: 0.76rem;
}

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
}
.dash-col h4 {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
}
.scanner-card.compact .scanner-frame {
  height: 140px;
}

/* activity feed */
.activity-feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 340px;
  overflow-y: auto;
}
.activity-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    transform 0.15s ease;
}
.activity-item:hover {
  border-color: var(--amber-dim);
  transform: translateX(3px);
}
.activity-main {
  font-size: 0.85rem;
}
.activity-code {
  font-family: var(--font-mono);
  color: var(--amber);
  font-weight: 600;
}
.activity-notes {
  color: var(--muted);
  margin: 3px 0 0;
}
.activity-when {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--steel);
  white-space: nowrap;
}


.scan-page-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 24px;
  align-items: start;
}
.scanner-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.scanner-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.tagchip {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--amber);
  border: 1px dashed var(--amber-dim);
  padding: 3px 8px;
  border-radius: 2px;
}
.scanner-hint {
  color: var(--muted);
  font-size: 0.75rem;
}

.scanner-frame {
  position: relative;
  height: 200px;
  background: #0c1116;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 16px;
}
.scan-corners span {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2px solid var(--amber-dim);
}
.scan-corners span:nth-child(1) {
  top: 10px;
  left: 10px;
  border-right: none;
  border-bottom: none;
}
.scan-corners span:nth-child(2) {
  top: 10px;
  right: 10px;
  border-left: none;
  border-bottom: none;
}
.scan-corners span:nth-child(3) {
  bottom: 10px;
  left: 10px;
  border-right: none;
  border-top: none;
}
.scan-corners span:nth-child(4) {
  bottom: 10px;
  right: 10px;
  border-left: none;
  border-top: none;
}
.scan-line {
  position: absolute;
  left: 8%;
  right: 8%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--amber), transparent);
  opacity: 0;
  top: 20px;
}
.scan-line.active {
  opacity: 1;
  animation: scanmove 1.1s linear infinite;
}
@keyframes scanmove {
  0% {
    top: 16px;
  }
  50% {
    top: 180px;
  }
  100% {
    top: 16px;
  }
}
.scan-idle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--steel);
}
.scan-idle p {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}
.scan-idle.hide {
  display: none;
}

.scanner-input-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.scanner-input-row input {
  flex: 1;
  background: #0c1116;
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 11px 12px;
  border-radius: var(--radius);
  transition: border-color 0.15s ease;
}
.scanner-input-row input:focus {
  border-color: var(--amber);
}
.scanner-input-row input::placeholder {
  color: var(--steel);
}

.sample-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sample-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
}
.chip-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 5px 9px;
  border-radius: 2px;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}
.chip-btn:hover {
  border-color: var(--amber);
  color: var(--amber);
  transform: translateY(-1px);
}


.result-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius);
  padding: 26px;
  min-height: 280px;
}
.result-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 230px;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}
.result-fade {
  animation: fadein 0.35s ease;
}
@keyframes fadein {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.rp-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 18px;
}
.rp-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin: 0 0 6px;
}
.rp-meta {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}
.status-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  padding: 6px 12px;
  border-radius: 2px;
  text-transform: uppercase;
}
.status-badge.ok {
  background: rgba(74, 222, 128, 0.1);
  color: var(--green);
  border: 1px solid rgba(74, 222, 128, 0.3);
}
.status-badge.warn {
  background: rgba(255, 176, 32, 0.1);
  color: var(--amber);
  border: 1px solid rgba(255, 176, 32, 0.3);
}
.status-badge.bad {
  background: rgba(240, 83, 61, 0.1);
  color: var(--red);
  border: 1px solid rgba(240, 83, 61, 0.3);
}

.ai-box {
  background: #0c1116;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px;
  margin-bottom: 18px;
}
.ai-box-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.ai-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  animation: pulse 2s infinite;
}
.ai-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--amber);
  text-transform: uppercase;
}
.ai-text {
  margin: 0;
  font-size: 0.9rem;
}

.history-log {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--line);
}
.history-log li {
  position: relative;
  padding: 4px 0 14px 18px;
}
.history-log li::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--steel);
  border: 2px solid var(--surface);
}
.hl-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--amber);
}
.hl-tech {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}
.hl-notes {
  margin: 4px 0 0;
  font-size: 0.86rem;
}

.spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
  margin-top: 6px;
}
.spec-grid div {
  font-size: 0.84rem;
}
.spec-grid span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.rp-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* QR code box shown in asset detail (modal + scan result) */
.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: #0c1116;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-top: 14px;
}
.asset-qr-canvas {
  display: block;
  border-radius: 2px;
}
.qr-caption {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
}

/* Camera QR scanner modal */
.qr-scanner-modal {
  max-width: 420px;
  text-align: center;
}
.qr-video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #0c1116;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 16px 0;
}
.qr-video-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.qr-status {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
}


.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 22px;
}
.toolbar input,
.toolbar select {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 10px 12px;
  border-radius: var(--radius);
  transition: border-color 0.15s ease;
}
.toolbar input {
  flex: 1;
  min-width: 200px;
}
.toolbar input:focus,
.toolbar select:focus {
  border-color: var(--amber);
}
.legend {
  display: flex;
  gap: 16px;
  margin-left: auto;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--muted);
  font-family: var(--font-mono);
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.dot.ok {
  background: var(--green);
}
.dot.warn {
  background: var(--amber);
}
.dot.bad {
  background: var(--red);
}
.empty-state {
  color: var(--muted);
  text-align: center;
  padding: 40px 0;
  font-size: 0.9rem;
}


.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.asset-card {
  --mx: 50%;
  --my: 50%;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  overflow: hidden;
  transition:
    border-color 0.2s ease,
    transform 0.12s ease;
  will-change: transform;
}
.asset-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    circle at var(--mx) var(--my),
    rgba(255, 176, 32, 0.16),
    transparent 60%
  );
  transition: opacity 0.25s ease;
}
.asset-card:hover::before {
  opacity: 1;
}
.asset-card:hover {
  border-color: var(--steel);
}
.asset-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
  position: relative;
}
.asset-code {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.95rem;
}
.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-top: 4px;
}
.status-dot.ok {
  background: var(--green);
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.6);
}
.status-dot.warn {
  background: var(--amber);
  box-shadow: 0 0 6px rgba(255, 176, 32, 0.6);
}
.status-dot.bad {
  background: var(--red);
  box-shadow: 0 0 6px rgba(240, 83, 61, 0.6);
}
.asset-name {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 12px;
  position: relative;
}
.asset-card-foot {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--steel);
  position: relative;
}
.asset-card.stagger {
  animation: cardIn 0.4s ease both;
}
@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


.ledger-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ledger-row {
  display: grid;
  grid-template-columns: 110px 110px 1fr 120px 90px;
  gap: 14px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    transform 0.15s ease;
  font-size: 0.85rem;
}
.ledger-row.head {
  background: transparent;
  border: none;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: default;
  padding-bottom: 0;
}
.ledger-row:not(.head):hover {
  border-color: var(--amber-dim);
  transform: translateX(3px);
}
.ledger-date {
  font-family: var(--font-mono);
  color: var(--amber);
  font-size: 0.78rem;
}
.ledger-code {
  font-family: var(--font-mono);
  font-weight: 600;
}
.ledger-notes {
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ledger-tech {
  font-family: var(--font-mono);
  font-size: 0.78rem;
}
.outcome-pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 3px 9px;
  border-radius: 20px;
  text-align: center;
  text-transform: uppercase;
}
.outcome-pill.resolved {
  background: rgba(74, 222, 128, 0.1);
  color: var(--green);
}
.outcome-pill.partial {
  background: rgba(255, 176, 32, 0.1);
  color: var(--amber);
}
.outcome-pill.issue {
  background: rgba(240, 83, 61, 0.1);
  color: var(--red);
}


.log-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 560px;
}
.log-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
}
.log-form input,
.log-form select,
.log-form textarea {
  background: #0c1116;
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  text-transform: none;
  letter-spacing: normal;
  padding: 10px 12px;
  border-radius: var(--radius);
  resize: vertical;
  transition: border-color 0.15s ease;
}
.log-form input:focus,
.log-form select:focus,
.log-form textarea:focus {
  border-color: var(--amber);
}


.report-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.report-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.report-card h4 {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 20px;
}
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.bar-row {
  display: grid;
  grid-template-columns: 90px 1fr 34px;
  align-items: center;
  gap: 10px;
}
.bar-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
}
.bar-track {
  height: 10px;
  background: #0c1116;
  border-radius: 6px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 6px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.bar-fill.ok {
  background: var(--green);
}
.bar-fill.warn {
  background: var(--amber);
}
.bar-fill.bad {
  background: var(--red);
}
.bar-count {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-align: right;
}

.rank-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.rank-pos {
  font-family: var(--font-mono);
  color: var(--amber);
  font-size: 0.8rem;
  width: 20px;
}
.rank-name {
  flex: 1;
  font-size: 0.85rem;
}
.rank-count {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}


.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 11, 15, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 50;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-width: 720px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px;
  transform: translateY(14px) scale(0.98);
  opacity: 0;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}
.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}
.modal-close:hover {
  border-color: var(--amber);
  color: var(--amber);
  transform: rotate(90deg);
}


.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 60;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  color: var(--text);
  font-size: 0.85rem;
  padding: 13px 18px;
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateX(30px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
  max-width: 320px;
}
.toast.show {
  opacity: 1;
  transform: translateX(0);
}
.toast.success {
  border-left-color: var(--green);
}
.toast.error {
  border-left-color: var(--red);
}


@media (max-width: 980px) {
  .rp-body,
  .scan-page-grid,
  .dash-grid,
  .report-grid {
    grid-template-columns: 1fr;
  }
  .stat-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    height: 100vh;
    width: var(--sidebar-w);
    z-index: 21;
  }
  .sidebar.open {
    left: 0;
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.4);
  }
  .mobile-topbar {
    display: flex;
  }
  .sidebar-backdrop.open {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }
  .content {
    padding: 24px 20px 56px;
  }
  .ledger-row {
    grid-template-columns: 90px 1fr 80px;
  }
  .ledger-row .ledger-tech,
  .ledger-row.head span:nth-child(2) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pulse-dot,
  .scan-line.active,
  .page.active,
  .asset-card.stagger,
  .ai-dot {
    animation: none;
  }
}



.ledger-actions{
    display:flex;
    gap:8px;
}

.edit-btn,
.delete-btn{
    border:none;
    padding:6px 12px;
    border-radius:6px;
    cursor:pointer;
    color:#fff;
    font-size:13px;
    transition:.3s;
}

.edit-btn{
    background:#0ea5e9;
}

.edit-btn:hover{
    background:#0284c7;
}

.delete-btn{
    background:#ef4444;
}

.delete-btn:hover{
    background:#dc2626;
}
/* ===== Dashboard QR card ===== */
.qr-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.qr-canvas-wrap {
  background: #fff;
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr-canvas-wrap canvas {
  display: block;
  width: 200px;
  height: 200px;
}
.qr-code-label {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--amber);
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
}
.qr-card .scanner-input-row {
  width: 100%;
}

/* Asset QR - URL + open-page link */
.qr-code-url{
  display:block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size:.72rem;
  color:#8aa0b6;
  text-decoration:none;
  word-break:break-all;
  margin:.25rem 0 .6rem;
  text-align:center;
}
.qr-code-url:hover{ color:#e8ecf1; text-decoration:underline; }
#assetQrOpen{
  display:inline-flex; align-items:center; justify-content:center;
  text-decoration:none; margin-top:.5rem;
}
.qr-open-link{
  display:inline-block;
  margin-top:.4rem;
  font-size:.78rem;
  color:#5aa2ff;
  text-decoration:none;
}
.qr-open-link:hover{ text-decoration:underline; }
