@import url("https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600&display=swap");

:root {
  --ink: #f4f7fb;
  --muted: #96a0b2;
  --panel: #161c24;
  --panel-soft: #11161d;
  --line: rgba(255, 255, 255, 0.08);
  --blue: #1991ff;
  --blue-dark: #0f5fa8;
  --danger: #ff4d4f;
  --warn: #ffb020;
  --info: #4dd0e1;
  --shadow: 0 24px 50px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top, #202734, #0b0f16 55%, #090c12 100%);
}

.app-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 24px 48px;
}

.brand-block {
  display: grid;
  gap: 4px;
}

.brand-title {
  font-family: "Rajdhani", sans-serif;
  font-size: 28px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-sub {
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.title {
  margin: 0 0 8px;
  font-size: 24px;
  font-family: "Rajdhani", sans-serif;
}

.subtitle {
  margin: 0 0 18px;
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 6px 14px;
  background: rgba(25, 145, 255, 0.15);
  color: var(--blue);
  font-weight: 600;
}

.card,
.panel,
.modal {
  background: var(--panel);
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.dashboard {
  display: grid;
  gap: 24px;
}

.dashboard-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
}

.stat-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  background: var(--panel);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--line);
}

.stat-item span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 6px;
}

.stat-item strong {
  font-size: 20px;
}

.stat-item select {
  margin-top: 6px;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
  background: linear-gradient(140deg, var(--blue), var(--blue-dark));
  color: #fff;
  transition: transform 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.secondary {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn.dark {
  background: #0c1118;
  border: 1px solid var(--line);
}

.btn.warn {
  background: #421419;
  color: #ffccd1;
}

.btn.tiny {
  padding: 8px 12px;
  font-size: 10px;
}

.btn.scan {
  justify-self: end;
  height: fit-content;
}

.dashboard-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.panel {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.panel-header h2 {
  margin: 0;
  font-size: 16px;
  font-family: "Rajdhani", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.panel-body.list {
  display: grid;
  gap: 10px;
}

.gun-row,
.table-row {
  border: none;
  background: var(--panel-soft);
  color: var(--ink);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  cursor: pointer;
}

.gun-row span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.chip {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  text-transform: uppercase;
}

.chip.danger {
  background: rgba(255, 77, 79, 0.2);
  color: #ff8c93;
}

.chip.warn {
  background: rgba(255, 176, 32, 0.2);
  color: #ffd27a;
}

.chip.info {
  background: rgba(77, 208, 225, 0.2);
  color: #8fefff;
}

.qr-panel .actions {
  display: flex;
  gap: 10px;
}

.search-block {
  display: flex;
  gap: 8px;
}

.search-block input {
  flex: 1;
}

.search-result {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--panel-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.search-actions {
  display: flex;
  gap: 8px;
}

.qr-grid {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.qr-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: var(--panel-soft);
  display: grid;
  gap: 10px;
  justify-items: center;
}

.qr-card img {
  width: 200px;
  height: 200px;
  background: #fff;
  padding: 6px;
  border-radius: 12px;
}

.qr-meta {
  font-weight: 600;
}

.table {
  display: grid;
  gap: 8px;
}

.table-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.table-row.head {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.grid.three {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.info-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.info-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #0c1219;
}

.info-item span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}

.info-item strong {
  font-size: 14px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

input,
select,
textarea {
  font-family: inherit;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0c1219;
  color: var(--ink);
  font-size: 14px;
}

.radio-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.loading {
  display: grid;
  gap: 12px;
  justify-items: center;
}

.spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--blue);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 14, 0.7);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 100;
}

.modal {
  width: min(900px, 100%);
  padding: 24px;
  display: grid;
  gap: 18px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-family: "Rajdhani", sans-serif;
}

.modal-section h3 {
  margin: 0 0 12px;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.history {
  display: grid;
  gap: 10px;
}

.history-row {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--panel-soft);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.history-row span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.hidden {
  display: none;
}

@media (max-width: 900px) {
  .dashboard-top {
    grid-template-columns: 1fr;
  }
}
