:root {
  --th-navy: #10203a;
  --th-navy-2: #16305a;
  --th-blue: #2f6feb;
  --th-blue-2: #1d4ed8;
  --th-bg: #f3f5f9;
  --th-card-border: #e6e9f0;
  --th-muted: #7c8797;
  --th-radius: 14px;
}

body {
  background: var(--th-bg);
  color: #1c2536;
}

/* Navbar */
.th-navbar {
  background: linear-gradient(120deg, var(--th-navy) 0%, var(--th-navy-2) 100%);
  padding: 0.9rem 0;
  -webkit-box-shadow: 0 2px 10px rgba(16, 32, 58, 0.25);
          box-shadow: 0 2px 10px rgba(16, 32, 58, 0.25);
  margin-bottom: 0;
}
.th-navbar .navbar-brand {
  font-weight: 700;
  letter-spacing: 0.2px;
  font-size: 1.15rem;
}
.th-navbar-sub {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.85rem;
}
.th-badge-sandbox {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-weight: 500;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.35em 0.6em;
  border-radius: 999px;
}

.th-page {
  max-width: 1180px;
  margin: 0 auto;
}

/* Cards */
.th-card {
  border: 1px solid var(--th-card-border);
  border-radius: var(--th-radius);
  -webkit-box-shadow: 0 1px 2px rgba(16, 32, 58, 0.04), 0 8px 24px -12px rgba(16, 32, 58, 0.12);
          box-shadow: 0 1px 2px rgba(16, 32, 58, 0.04), 0 8px 24px -12px rgba(16, 32, 58, 0.12);
}
.th-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--th-navy);
}
.th-icon {
  color: var(--th-blue);
  font-size: 1.1rem;
}

/* Tabs */
.th-tabs {
  border-bottom: 1px solid var(--th-card-border);
  gap: 0.25rem;
}
.th-tabs .nav-link {
  border: none;
  border-radius: 10px 10px 0 0;
  color: var(--th-muted);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.6rem 1rem;
}
.th-tabs .nav-link:hover {
  color: var(--th-blue-2);
}
.th-tabs .nav-link.active {
  color: var(--th-blue-2);
  background: #fff;
  border: 1px solid var(--th-card-border);
  border-bottom-color: #fff;
}

/* Forms */
.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--th-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 0.3rem;
}
.form-control, .form-select {
  border-radius: 9px;
  border-color: var(--th-card-border);
}
.form-control:focus, .form-select:focus {
  border-color: var(--th-blue);
  -webkit-box-shadow: 0 0 0 0.2rem rgba(47, 111, 235, 0.15);
          box-shadow: 0 0 0 0.2rem rgba(47, 111, 235, 0.15);
}
.th-mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.88rem;
}

/* Buttons */
.btn-primary {
  background: var(--th-blue-2);
  border-color: var(--th-blue-2);
  border-radius: 9px;
  font-weight: 600;
  padding-inline: 1rem;
}
.btn-primary:hover {
  background: #1a41b0;
  border-color: #1a41b0;
}
.btn-outline-secondary {
  border-radius: 9px;
  font-weight: 600;
}

/* Table */
.th-table thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--th-muted);
  border-bottom: 2px solid var(--th-card-border);
  background: #fafbfd;
}
.th-table td {
  font-size: 0.92rem;
}
.th-muted {
  color: var(--th-muted);
}
.th-empty {
  text-align: center;
  color: var(--th-muted);
  padding: 1.75rem 0.5rem;
  font-size: 0.92rem;
}

/* Status badges */
.th-status-badge {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 0.4em 0.7em;
  border-radius: 999px;
  font-weight: 700;
}
.th-status-open {
  background: rgba(220, 53, 69, 0.12);
  color: #b3202f;
}
.th-status-closed {
  background: rgba(25, 135, 84, 0.12);
  color: #157347;
}

/* Raw response viewer */
.th-raw-toggle {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--th-blue-2);
  text-decoration: none;
}
.th-raw-toggle:hover {
  color: #1a41b0;
}
.th-raw {
  background: #0f1524;
  color: #d7e0f0;
  border-radius: 10px;
  padding: 1rem;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  max-height: 420px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}
.th-raw-note {
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}
.th-subheading {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--th-navy);
}

/* Detail summary fields */
.th-detail-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--th-muted);
  font-weight: 600;
}
.th-detail-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1c2536;
}

/* Sidebar */
.th-sidebar-group {
  margin-bottom: 1.25rem;
}
.th-sidebar-heading {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--th-muted);
  padding: 0 0.5rem 0.4rem;
}
.th-sidebar-nav .nav-link {
  border: none;
  border-radius: 8px;
  color: #33415a;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.5rem 1.75rem 0.5rem 0.7rem;
  text-align: left;
  margin-bottom: 2px;
}
.th-sidebar-nav .nav-link:hover {
  background: #eef1f7;
  color: var(--th-blue-2);
}
.th-sidebar-nav .nav-link.active {
  background: var(--th-blue-2);
  color: #fff;
}
.th-sidebar-nav .nav-link {
  position: relative;
}
.th-sidebar-nav .nav-link::after {
  content: "\f107";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  position: absolute;
  right: 0.7rem;
  top: 50%;
  -webkit-transform: translateY(-50%) rotate(-90deg);
          transform: translateY(-50%) rotate(-90deg);
  -webkit-transition: -webkit-transform 0.15s ease;
  transition: -webkit-transform 0.15s ease;
  transition: transform 0.15s ease;
  transition: transform 0.15s ease, -webkit-transform 0.15s ease;
  font-size: 0.75rem;
  opacity: 0.6;
}
.th-sidebar-nav .nav-link.active::after {
  -webkit-transform: translateY(-50%) rotate(0deg);
          transform: translateY(-50%) rotate(0deg);
}

/* Panels (independently shown/hidden, not exclusive tabs) */
.th-panels > .collapse {
  margin-bottom: 1rem;
}

/* Generated key banner */
.th-generated-key {
  background: rgba(25, 135, 84, 0.08);
  border: 1px solid rgba(25, 135, 84, 0.25);
  color: #157347;
  border-radius: 9px;
  padding: 0.6rem 0.9rem;
  font-size: 0.9rem;
  display: inline-block;
}