:root {
  --tally-blue-light: #e8f4fc;
  --tally-navy: #1e3a5f;
  --tally-grid: 220, 220, 220;
  --sidebar-text: 220, 220, 220;
  --sidebar-accent: #def0f7;
  --border-color: #dee2e6;
  /* Wider nav for section → group → item (3 nested collapses) */
  --sidebar-width: 360px;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  background-color: #fff;
  min-height: 100vh;
  font-size: 15px;
}

.border-primary {
  border-color: #006ea6;
}

.sectionHeading h1 {
  color: #ffffff !important;
}

.contentSection h1 {
  font-size: 1.25rem;
  color: #2a67b2;
}

.contentSection h2 {
  font-size: 1rem;
  color: #2a67b2 !important;
}

/* Hero Section */
.hero-section {
  background-color: var(--tally-blue-light);
  color: #212529;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.06;
  background-image:
    linear-gradient(rgba(var(--tally-grid), 1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--tally-grid), 1) 1px, transparent 1px);
  background-size: 60px 60px;
}

.hero-content {
  position: relative;
  z-index: 10;
}

.bg-dark-yellow,
.bg-dark-yellow:hover,
.bg-dark-yellow:active {
  background-color: #006ea6 !important;
  border-color: #006ea6 !important;
}

.btn-height {
  height: 42px;
}

.form-control:focus,
.form-select:focus {
  box-shadow: 0 0 0 0 #dee2e6 !important;
  border-color: #dee2e6 !important;
}

textarea {
  resize: none !important;
}

.hero-title {
  color: var(--tally-navy);
  font-weight: 700;
  letter-spacing: -0.025em;
}

.hero-subtitle {
  color: #6c757d;
  max-width: 44rem;
}

.text-light-blue {
  color: #2273c3;
}

.text-yellow {
  color: #006ea6 !important;
}

/* Layout */
.app-layout {
  display: flex;
  min-height: calc(100vh - 200px);
  border-top: 1px solid var(--border-color);
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  min-width: 280px;
  border-right: 1px solid var(--border-color);
  background-color: #fff;
  padding: 1rem;
  overflow-y: auto;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  width: 100%;
  padding: 0.375rem 0.5rem;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  border-radius: 0.125rem;
  transition: background-color 0.2s;
  color: #212529;
  font-size: 0.875rem;
  text-decoration: none;
}

.sidebar-nav-item:hover {
  background-color: #f8f9fa;
}

.sidebar-nav-item.active {
  background-color: var(--sidebar-accent);
  font-weight: 600;
  color: #575ecf;
}

.sidebar-nav-item.brand {
  font-weight: 700;
  font-size: 1rem;
}

.sidebar-nav-item.section-title {
  font-weight: 600;
  margin-top: 0.75rem;
}

.sidebar-nav-item.nested-1 {
  padding-left: 1.5rem;
  font-weight: 500;
}

.sidebar-nav-item.nested-2 {
  padding-left: 2.5rem;
  font-weight: 400;
}

/* Align with parent row label: nested-2 padding + chevron (~1rem) + gap (me-1) */
.sidebar-nav-item.nested-3 {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding-left: calc(2.5rem + 1rem + 0.25rem);
  padding-right: 0.5rem;
  font-weight: 400;
  font-size: 0.8125rem;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
}

.sidebar-toggle {
  padding: 0.25rem;
  border: none;
  background: none;
  border-radius: 0.25rem;
  cursor: pointer;
}

.sidebar-toggle:hover {
  background-color: #e9ecef;
}

.sidebar-chevron {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.sidebar-collapse-content {
  display: block;
}

.sidebar-collapse-content.collapsed {
  display: none;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
}

.content-block {
  border-left: 4px solid #006ea6;
  padding-left: 1.5rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.content-title {
  font-size: 1.875rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

/* Lovable Badge */
#lovable-badge {
  --badge-bg: #1b1b1b;
  --badge-text: #c5c1b9;
  --badge-text-hover: #dcdad5;
  --badge-radius: 6px;
  --badge-padding: 8px;
  --badge-gap: 6px;
  --badge-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.88), 0 1px 0 0 rgba(0, 0, 0, 0.04),
    0 2px 2px -1px rgba(0, 0, 0, 0.08);
  position: fixed;
  bottom: 12px;
  right: 12px;
  height: 24px;
  display: flex;
  align-items: center;
  z-index: 1050;
  background-color: var(--badge-bg);
  color: var(--badge-text);
  border-radius: var(--badge-radius);
  box-shadow: var(--badge-shadow);
  font-size: 12px;
}

#lovable-badge-cta {
  display: flex;
  align-items: center;
  gap: var(--badge-gap);
  padding: 0 var(--badge-padding);
  height: 100%;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  border-radius: var(--badge-radius) 0 0 var(--badge-radius);
}

#lovable-badge-cta:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--badge-text-hover);
}

#lovable-badge-divider {
  width: 1px;
  height: 24px;
  background-color: rgba(255, 255, 255, 0.04);
}

#lovable-badge-close {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 var(--badge-radius) var(--badge-radius) 0;
}

#lovable-badge-close:hover {
  background: rgba(255, 255, 255, 0.04);
}

.rounded-t-lg {
  border-top-left-radius: 0.5rem;
  border-top-right-radius: 0.5rem;
}

.page-header {
  border: 1px solid #dee2e6 !important;
  overflow: overlay;
}

.sectionHeading {
  font-size: 1.6rem;
}

@media (max-width: 991.98px) {
  .logo {
    transform: translateX(70%);
  }

  .sidebar {
    position: fixed;
    left: calc(-1 * var(--sidebar-width));
    z-index: 1040;
    transition: left 0.3s ease;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
  }

  .sidebar.show {
    left: 0;
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
  }

  .sidebar-overlay.show {
    display: block;
  }
}

.content-block th {
  background-color: #e8f7f9 !important;
}

.content-block tr {
  border: 1px solid #6587b9;
}

.code-split-col .p-3 {
  padding: 0 1rem 1rem 1rem !important;
}

.contentSection tbody {
  font-size: 1rem;
}

.contentSection
  label.form-label.small.fw-bold.text-primary.text-yellow.mb-0.mt-3 {
  font-size: 1rem;
}

.contentSection label.form-label.small.fw-bold.text-primary.text-yellow.mb-1 {
  font-size: 1rem;
}

.tally-http-headers-wrap span.small.fw-bold {
  font-size: 15px !important;
}

/* ============================================================
   CODE SPLIT LAYOUT — XML / JSON side-by-side columns
   Managed globally from this file.
   ============================================================ */

/* Container: stacked on mobile/tablet, side-by-side on large screens */
.code-split-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Each column */
.code-split-col {
  flex: 1 1 0;
  min-width: 0; /* prevent flex blowout on long code lines */
  display: flex;
  flex-direction: column;
}

/* Make the <pre> inside fill the column height and scroll independently */
.code-split-col pre {
  flex: 1 1 auto;
  height: 380px; /* fixed height — adjust here to change both columns globally */
  overflow: auto; /* both x and y scroll when content overflows */
  white-space: pre; /* preserve formatting, allows x-scroll */
  word-break: normal;
  overflow-wrap: normal;
  margin-bottom: 0;
}

/* Switch to 2-column layout on large screens (≥992px, Bootstrap lg breakpoint) */
@media (min-width: 992px) {
  .code-split-row {
    flex-direction: row;
    align-items: stretch; /* equal height columns */
  }
}
