:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  background: #05070f;
  color: #e6edf7;
}

body {
  min-height: 100vh;
}

.bg {
  min-height: 100vh;
  background: radial-gradient(1000px 600px at 10% -10%, rgba(59, 130, 246, 0.25), transparent 55%),
    radial-gradient(900px 500px at 90% 20%, rgba(30, 64, 175, 0.2), transparent 55%),
    #05070f;
}

.hidden {
  display: none !important;
}

.mono {
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

.mt { margin-top: 12px; }
.mt2 { margin-top: 20px; }

.w100 { width: 100%; }

.center {
  text-align: center;
}

.wrap {
  width: 100%;
  margin: 0;
}

.app-screen {
  min-height: 100vh;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: rgba(5, 7, 15, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-name {
  font-weight: 700;
  font-size: 18px;
}

.logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.35);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.meta-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 12px;
  color: #cbd5f5;
  min-height: 28px;
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 6px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 14px;
  margin-bottom: 24px;
  max-width: 520px;
  flex-shrink: 0;
}

.header-tabs {
  margin-bottom: 0;
  max-width: none;
  width: min(520px, 100%);
}

.tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: #94a3b8;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn.active {
  background: rgba(30, 41, 59, 0.9);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.2);
}

.tab-panel {
  margin-bottom: 24px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

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

  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .header-actions {
    justify-content: flex-start;
  }
}

.h1 {
  margin: 6px 0 16px;
  font-size: 26px;
  font-weight: 700;
}

.h2 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 600;
}

.h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
}

.muted {
  color: #94a3b8;
  font-size: 13px;
}

.err {
  color: #f87171;
  font-size: 13px;
}

.card {
  background: rgba(15, 23, 42, 0.65);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.6);
}

.panel-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rowBetween {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.rowEnd {
  display: flex;
  justify-content: flex-end;
}

.lbl {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}

.in {
  width: 100%;
  background: rgba(2, 6, 23, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  padding: 10px 14px;
  color: #e6edf7;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.in:focus {
  border-color: rgba(59, 130, 246, 0.7);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.vh-input {
  height: 64px;
  font-size: 26px;
  text-align: center;
  letter-spacing: 0.2em;
}

.scan-module {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 20px;
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.2);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.scan-module:hover {
  border-color: rgba(59, 130, 246, 0.6);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.2);
}

.scan-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.scan-icon svg {
  width: 30px;
  height: 30px;
  fill: #60a5fa;
}

.scan-title {
  font-size: 16px;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 4px;
}

.manual-scan {
  padding: 16px;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

textarea.in {
  resize: vertical;
  min-height: 80px;
}

.btn {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
}

.btn.sm {
  padding: 6px 10px;
  font-size: 12px;
}

.btn.ghost {
  background: rgba(15, 23, 42, 0.6);
  color: #cbd5f5;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.iconBtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.badge {
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
}

.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #1e293b;
  color: #cbd5f5;
  font-size: 13px;
}

.tag {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  margin-right: 6px;
}

.tag.info { background: #1d4ed8; }
.tag.warn { background: #a16207; }
.tag.error { background: #b91c1c; }

.notif-panel {
  position: static;
  align-self: start;
  width: 100%;
  max-height: 520px;
  overflow-y: auto;
}

.panelHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.notifList {
  list-style: none;
  padding: 0;
  margin: 0;
}

.notifItem {
  background: rgba(2, 6, 23, 0.6);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.notifItem.unread {
  border-color: rgba(59, 130, 246, 0.6);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.2);
}

.notifTop {
  display: flex;
  justify-content: space-between;
}

.notifMsg {
  font-size: 14px;
}

.notifMeta {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}

.notifActions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.label {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
  justify-content: flex-start;
}

.labelLeft {
  flex: 0 1 70%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.labelRight {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.label-card {
  border: 1px dashed rgba(148, 163, 184, 0.35);
  border-radius: 16px;
  padding: 16px;
  background: rgba(2, 6, 23, 0.5);
}

.label-empty {
  border: 1px dashed rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  background: rgba(2, 6, 23, 0.3);
}

.qr {
  width: 120px;
  height: 120px;
}

.barcode {
  width: 320px;
  max-width: 100%;
  height: auto;
}

.label-code {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #0b1220;
  background: #fff;
  padding: 4px 10px;
  border-radius: 10px;
}

.register-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.register-id {
  font-size: 22px;
  letter-spacing: 0.16em;
  font-weight: 700;
}

.status-pill {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.log {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 240px;
  overflow: auto;
}

.log li {
  font-size: 13px;
  padding: 4px 0;
  color: #cbd5f5;
}

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.login-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(59, 130, 246, 0.3), transparent 55%);
  pointer-events: none;
}

.login-card {
  width: min(420px, 100%);
  position: relative;
  z-index: 1;
}

.login-brand {
  text-align: center;
  margin-bottom: 20px;
}

.login-title {
  margin: 12px 0 4px;
  font-size: 28px;
  font-weight: 700;
}

.login-subtitle {
  color: #94a3b8;
  margin: 0;
  font-size: 13px;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.app-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  padding: 28px 20px 60px;
  align-items: start;
}

@media (max-width: 600px) {
  .tabs {
    max-width: 100%;
  }

  .row {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 1100px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .notif-panel {
    position: static;
    max-height: none;
    border-left: none;
  }
}
