
:root {
  --bg: #0b1220;
  --bg-soft: #121a2b;
  --bg-card: rgba(16, 24, 40, 0.88);
  --border: rgba(255, 255, 255, 0.09);
  --text-soft: #9ba8c2;
  --text-strong: #f6f8fc;
  --accent: #4f8cff;
  --success-soft: rgba(25, 135, 84, 0.18);
  --warning-soft: rgba(255, 193, 7, 0.16);
  --danger-soft: rgba(220, 53, 69, 0.16);
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(79, 140, 255, 0.18), transparent 24%),
    radial-gradient(circle at bottom left, rgba(13, 202, 240, 0.12), transparent 22%),
    var(--bg);
  color: var(--text-strong);
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 280px;
  background: rgba(6, 10, 18, 0.78);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.brand-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(79, 140, 255, 0.25), rgba(13, 202, 240, 0.14));
  border: 1px solid rgba(79, 140, 255, 0.28);
  font-size: 1.35rem;
}

.brand-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-subtitle {
  color: var(--text-soft);
  font-size: 0.82rem;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-soft);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  transition: all 0.2s ease;
}

.sidebar-nav .nav-link:hover {
  color: var(--text-strong);
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-nav .nav-link.active {
  color: white;
  background: linear-gradient(145deg, rgba(79, 140, 255, 0.24), rgba(79, 140, 255, 0.12));
  border: 1px solid rgba(79, 140, 255, 0.22);
  box-shadow: 0 16px 40px rgba(18, 80, 160, 0.18);
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 1rem 0.75rem 0;
}

.main-content {
  flex: 1;
  padding: 1.75rem;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-title {
  font-weight: 700;
  letter-spacing: -0.03em;
}

.page-subtitle {
  color: var(--text-soft);
  max-width: 760px;
}

.card,
.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  border-radius: 20px;
}

.metric-card {
  padding: 1.35rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  height: 100%;
}

.metric-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  margin-bottom: 1rem;
  font-size: 1.15rem;
  background: rgba(79, 140, 255, 0.18);
  border: 1px solid rgba(79, 140, 255, 0.22);
  color: white;
}

.metric-label {
  color: var(--text-soft);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.metric-value {
  font-size: 2.1rem;
  line-height: 1;
  font-weight: 700;
}

.metric-subvalue {
  color: var(--text-soft);
  margin-top: 0.35rem;
  font-size: 0.92rem;
}

.dashboard-card .card-title,
.card-title {
  font-weight: 650;
}

.card-header {
  padding: 1.2rem 1.35rem 0.25rem;
}

.card-body {
  padding: 1.35rem;
}

.table {
  --bs-table-bg: transparent;
  --bs-table-border-color: rgba(255, 255, 255, 0.08);
  --bs-table-color: var(--text-strong);
  margin-bottom: 0;
}

.table thead th {
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.table td,
.table th {
  vertical-align: middle;
  padding: 1rem 1.1rem;
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.flash-stack .alert {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.status-badge {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.health-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 0.75rem;
}

.health-pill {
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 0.85rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.health-pill.ok {
  background: var(--success-soft);
}

.health-pill.bad {
  background: var(--danger-soft);
}

.status-summary-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-size: 0.88rem;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.timeline-item {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  margin-top: 0.45rem;
  background: rgba(255, 255, 255, 0.3);
  flex: 0 0 12px;
}

.timeline-dot.success {
  background: #20c997;
  box-shadow: 0 0 0 6px rgba(32, 201, 151, 0.12);
}

.timeline-dot.warning {
  background: #ffc107;
  box-shadow: 0 0 0 6px rgba(255, 193, 7, 0.12);
}

.timeline-dot.danger,
.timeline-dot.rejected {
  background: #dc3545;
  box-shadow: 0 0 0 6px rgba(220, 53, 69, 0.12);
}

.timeline-dot.info,
.timeline-dot.received,
.timeline-dot.unverified {
  background: #6c757d;
  box-shadow: 0 0 0 6px rgba(108, 117, 125, 0.12);
}

.timeline-content {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  width: 100%;
}

.detail-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  height: 100%;
}

.detail-label {
  display: block;
  color: var(--text-soft);
  font-size: 0.8rem;
  margin-bottom: 0.35rem;
}

.detail-value {
  display: block;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.section-label {
  font-size: 0.82rem;
  color: var(--text-soft);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.detail-section + .detail-section {
  margin-top: 1.25rem;
}

.empty-state {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  color: var(--text-soft);
  padding: 2rem;
}

.empty-state.compact {
  min-height: auto;
  padding: 1.35rem;
}

.empty-state i {
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.65);
}

.video-thumb {
  width: 96px;
  height: 54px;
  border-radius: 12px;
  object-fit: cover;
  flex: 0 0 96px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
}

.payload-pre {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
  color: #d8e0f2;
  max-height: 420px;
  overflow: auto;
  margin-bottom: 0;
}

.log-box {
  min-height: 180px;
  background: rgba(0, 0, 0, 0.36);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
  white-space: pre-wrap;
  color: #d8e0f2;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.upload-progress {
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-bar {
  border-radius: 999px;
}

.copy-btn {
  white-space: nowrap;
}

.accordion-button:not(.collapsed) {
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
}

.accordion-button,
.accordion-button:focus {
  box-shadow: none;
}

.list-group-item {
  color: var(--text-strong);
}

.list-group-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.form-control,
.form-select,
.input-group-text,
textarea {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: var(--text-strong) !important;
  border-radius: 14px !important;
}

.form-control::placeholder,
textarea::placeholder {
  color: rgba(255, 255, 255, 0.35) !important;
}

.form-control:focus,
.form-select:focus {
  box-shadow: 0 0 0 0.25rem rgba(79, 140, 255, 0.18) !important;
  border-color: rgba(79, 140, 255, 0.55) !important;
}

.btn {
  border-radius: 12px;
}

.btn-primary {
  background: linear-gradient(135deg, rgba(79, 140, 255, 0.92), rgba(47, 116, 255, 0.92));
  border-color: rgba(79, 140, 255, 0.95);
  box-shadow: 0 16px 32px rgba(47, 116, 255, 0.18);
}

.btn-primary:hover {
  filter: brightness(1.06);
}

.collapse-row td {
  background: transparent;
}

.bg-body-tertiary {
  background: rgba(255, 255, 255, 0.04) !important;
}

code {
  color: #9ed0ff;
}

@media (max-width: 991.98px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: static;
  }

  .main-content {
    padding: 1rem;
  }

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