:root {
  --t-bg: #121212;
  --t-surface: rgba(255, 255, 255, 0.06);
  --t-surface-2: rgba(255, 255, 255, 0.085);
  --t-field: rgba(255, 255, 255, 0.06);
  --t-text: rgba(255, 255, 255, 0.92);
  --t-muted: rgba(255, 255, 255, 0.62);
  --t-border: rgba(255, 255, 255, 0.10);
  --t-border-2: rgba(255, 255, 255, 0.14);
  --t-primary: #007aff;
  --t-success: #34c759;
  --t-danger: #ef4444;
  --t-radius: 16px;
  --t-tab-h: 86px;
  --t-blur: 18px;
  --t-shadow: 0 18px 40px rgba(0, 0, 0, 0.38);
}

html,
body {
  height: 100%;
}

.t-body {
  background:
    radial-gradient(900px 600px at 18% -10%, rgba(0, 122, 255, 0.18), transparent 60%),
    radial-gradient(900px 600px at 84% -16%, rgba(52, 199, 89, 0.14), transparent 62%),
    radial-gradient(1000px 720px at 50% 120%, rgba(0, 122, 255, 0.10), transparent 60%),
    var(--t-bg);
  color: var(--t-text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, Roboto, "Segoe UI", system-ui, Arial, sans-serif;
}

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

.t-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(18, 18, 18, 0.78);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(var(--t-blur));
}

.t-topbar__inner {
  max-width: 920px;
  margin: 0 auto;
  padding: 14px 16px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.t-headerTitle {
  font-weight: 900;
  font-size: 1.55rem;
  letter-spacing: -0.4px;
  line-height: 1.05;
}

.t-headerHint {
  color: var(--t-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.t-headerCredit {
  margin-left: 8px;
  color: rgba(255, 255, 255, 0.44);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1px;
}

.t-main {
  max-width: 920px;
  margin: 0 auto;
  padding: 14px 16px calc(var(--t-tab-h) + env(safe-area-inset-bottom) + 18px);
  animation: tEnter 240ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.t-main.is-leaving {
  animation: tLeave 180ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.t-panel {
  background: var(--t-surface);
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius);
  overflow: hidden;
  backdrop-filter: blur(var(--t-blur));
  box-shadow: var(--t-shadow);
}

.t-panel + .t-panel {
  margin-top: 12px;
}

.t-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.t-panel__title {
  font-weight: 900;
  font-size: 0.86rem;
  letter-spacing: 0.55px;
  color: rgba(255, 255, 255, 0.75);
  text-transform: uppercase;
}

.t-panel__body {
  padding: 12px;
}

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

.t-kpi {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.t-kpi__badge {
  background: rgba(52, 199, 89, 0.16);
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(52, 199, 89, 0.26);
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.t-empty {
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: var(--t-radius);
  padding: 14px;
  color: var(--t-muted);
  background: rgba(255, 255, 255, 0.03);
}

.scanner-box {
  width: 100%;
  min-height: 220px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--t-radius);
  overflow: hidden;
}

.scanner-box video {
  width: 100% !important;
  height: auto !important;
  object-fit: cover;
}

.form-label {
  color: rgba(243, 244, 246, 0.7);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.35px;
  text-transform: uppercase;
}

.form-control,
.form-select {
  background: var(--t-field);
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--t-text);
  border-radius: 14px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.form-control::placeholder {
  color: rgba(243, 244, 246, 0.36);
}

.form-control:focus,
.form-select:focus {
  background: var(--t-field);
  color: var(--t-text);
  border-color: rgba(0, 122, 255, 0.75);
  box-shadow: 0 0 0 0.22rem rgba(0, 122, 255, 0.18);
}

.btn-success {
  background: linear-gradient(180deg, rgba(52, 199, 89, 1), rgba(39, 174, 74, 1));
  border-color: rgba(52, 199, 89, 0.55);
  font-weight: 900;
  border-radius: 16px;
}

.btn-outline-light {
  border-color: rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.86);
  border-radius: 16px;
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn:active {
  transform: scale(0.98);
}

.btn-success:active,
.btn-outline-light:active {
  transform: scale(0.95);
}

.t-tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  background: rgba(18, 18, 18, 0.78);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 12px calc(env(safe-area-inset-bottom) + 12px);
  backdrop-filter: blur(var(--t-blur));
}

.t-tabs__inner {
  max-width: 920px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 10px;
}

.t-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 56px;
  border-radius: 18px;
  text-decoration: none;
  color: rgba(243, 244, 246, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  font-weight: 900;
  letter-spacing: 0.15px;
  gap: 3px;
}

.t-tab.is-active {
  color: rgba(255, 255, 255, 0.92);
  border-color: rgba(0, 122, 255, 0.32);
  background: rgba(0, 122, 255, 0.14);
}

.t-tab__icon {
  width: 22px;
  height: 22px;
  display: block;
  opacity: 0.9;
}

.t-tab__label {
  font-size: 11px;
  line-height: 1;
  opacity: 0.85;
}

.t-tab.is-active .t-tab__icon,
.t-tab.is-active .t-tab__label {
  opacity: 1;
}

.table-responsive {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--t-radius);
  overflow: hidden;
}

.table-dark {
  --bs-table-bg: rgba(18, 18, 18, 0.35);
  --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
  --bs-table-striped-color: var(--t-text);
  --bs-table-color: var(--t-text);
  border-color: rgba(255, 255, 255, 0.08);
}

.table-dark thead th {
  font-size: 0.78rem;
  color: rgba(243, 244, 246, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.35px;
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.text-secondary {
  color: rgba(243, 244, 246, 0.55) !important;
}

.flash-ok .t-app {
  box-shadow: inset 0 0 0 9999px rgba(52, 199, 89, 0.05);
}

.flash-bad .t-app {
  box-shadow: inset 0 0 0 9999px rgba(239, 68, 68, 0.08);
}

.t-scanOk {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  z-index: 50;
}

.t-scanOk__bubble {
  width: 92px;
  height: 92px;
  border-radius: 28px;
  background: rgba(18, 18, 18, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(var(--t-blur));
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
  transform: translateY(10px) scale(0.92);
}

.t-scanOk.is-visible {
  opacity: 1;
  transition: opacity 120ms ease;
}

.t-scanOk.is-visible .t-scanOk__bubble {
  animation: tPop 420ms cubic-bezier(0.18, 1.2, 0.18, 1) both;
}

.t-scanOk__icon {
  width: 46px;
  height: 46px;
  color: rgba(52, 199, 89, 1);
}

.t-swal {
  border-radius: 18px !important;
  background: rgba(18, 18, 18, 0.62) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  backdrop-filter: blur(var(--t-blur)) !important;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55) !important;
}

.t-swal-backdrop {
  backdrop-filter: blur(8px);
}

.t-swal .swal2-title,
.t-swal .swal2-html-container {
  color: rgba(255, 255, 255, 0.92) !important;
}

@keyframes tEnter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes tLeave {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(10px);
  }
}

@keyframes tPop {
  0% {
    transform: translateY(10px) scale(0.85);
  }
  55% {
    transform: translateY(0) scale(1.04);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}
