:root {
  --brand-500: #0d6efd;
  --brand-600: #0b5ed7;
  --brand-700: #0a58ca;
  --bg-soft: #f5f7fb;
  --border-soft: #e4e9f2;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --shadow-soft: 0 12px 30px rgba(15, 23, 42, 0.12);
  --radius-card: 14px;
}

html {
  font-size: 15px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body.app-body {
  min-height: 100vh;
  background: var(--bg-soft);
  color: var(--text-main);
  font-family: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
}

a {
  color: var(--brand-600);
  text-decoration: none;
}

a:hover {
  color: var(--brand-700);
  text-decoration: underline;
}

.bi {
  display: inline-block;
  width: 1em;
  height: 1em;
  fill: currentColor;
  vertical-align: -0.125em;
}

.app-navbar {
  background: linear-gradient(90deg, var(--brand-600) 0%, var(--brand-700) 100%);
  box-shadow: 0 10px 30px rgba(10, 88, 202, 0.25);
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
  border: 0;
}

.app-navbar .navbar-brand {
  font-weight: 700;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.app-navbar .navbar-brand i {
  font-size: 1.2rem;
}

.app-navbar .nav-link {
  color: #e8f0ff !important;
  font-weight: 600;
  opacity: 0.9;
}

.app-navbar .nav-link:hover {
  opacity: 1;
}

.app-navbar .dropdown-menu {
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
}

.app-navbar .btn-outline-light {
  border-color: rgba(255, 255, 255, 0.5);
}

.app-main {
  padding: 32px 18px 56px;
  min-height: calc(100vh - 140px);
}

@media (min-width: 992px) {
  .app-main {
    padding-left: 32px;
    padding-right: 32px;
  }
}

.app-footer {
  background: #fff;
  border-top: 1px solid var(--border-soft);
  color: var(--text-muted);
  padding: 18px 0;
  font-weight: 500;
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.04);
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
}

.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--text-muted);
}

.card {
  border-radius: var(--radius-card);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  background-color: #fff;
}

.card-header {
  background: #f8fafc;
  border-bottom: 1px solid var(--border-soft);
  font-weight: 700;
}

.card-title {
  color: var(--text-main);
}

.alert {
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  padding: 0.9rem 1.1rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.alert-success {
  background: #eef9f2;
  border-color: #bbf7d0;
  color: #166534;
}

.alert-info {
  background: #eef4ff;
  border-color: #cbdafe;
  color: #1e3a8a;
}

.alert-warning {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #92400e;
}

.btn {
  border-radius: 10px;
  font-weight: 600;
}

.btn-sm {
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
}

.btn-primary {
  background: linear-gradient(90deg, var(--brand-600) 0%, var(--brand-700) 100%);
  border: none;
  box-shadow: 0 6px 18px rgba(13, 110, 253, 0.28);
}

.btn-primary:hover {
  background: linear-gradient(90deg, #0c62df 0%, #0a54c0 100%);
}

.btn-outline-primary {
  color: var(--brand-600);
  border-color: #cfe0ff;
  background-color: #f7f9ff;
}

.btn-outline-primary:hover {
  background-color: #e8efff;
  border-color: #b7cffd;
  color: var(--brand-700);
}

.btn-outline-secondary {
  color: #4b5563;
  border-color: #dfe3eb;
  background-color: #fff;
}

.btn-outline-secondary:hover {
  background-color: #f3f4f6;
  border-color: #cbd5e1;
}

.form-control,
.form-select {
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background-color: #fff;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.form-control:focus,
.form-select:focus,
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-check-input:focus {
  border-color: var(--brand-600);
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.input-group-text {
  border-color: var(--border-soft);
  background: #f8fafc;
}

.table {
  color: var(--text-main);
}

.table > :not(caption) > * > * {
  padding: 0.9rem 1rem;
  border-color: var(--border-soft);
}

.table thead {
  background: #f8fafc;
}

.table tbody tr:hover {
  background: #f6f9ff;
}

.badge {
  border-radius: 999px;
  font-weight: 600;
  padding: 0.45rem 0.8rem;
}

.badge.bg-light {
  color: var(--text-main);
  border: 1px solid var(--border-soft);
  background: #f1f5f9 !important;
}

.icon-pill {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #e8f0ff;
  font-size: 1.1rem;
}

.list-group-item {
  border-color: var(--border-soft);
}

.list-group-item:first-child {
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.list-group-item:last-child {
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

.content-section {
  scroll-margin-top: 96px;
}

.dashboard-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
}

.auth-wrapper {
  width: 100%;
  min-height: calc(100vh - 140px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0 32px;
}

.auth-panel {
  width: min(560px, 100%);
  padding: 26px 26px 28px;
}

.auth-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.auth-form .form-label {
  color: var(--text-main);
}

.auth-form .form-control,
.auth-form .form-select {
  height: 48px;
}

.auth-form .text-danger {
  color: #b91c1c !important;
}

/* Home page */
.home-shell {
  background: #111827;
  color: #111827;
}

.home-hero {
  background: transparent;
  color: #fff;
}

.hero-panel {
  padding: 48px 56px;
  min-height: 420px;
}

.hero-panel-left {
  background: #075985;
  position: relative;
  overflow: hidden;
  color: #fff;
}

.hero-panel-left .eyebrow,
.hero-panel-left .lead {
  color: #f8fafc;
}

.hero-text h1 {
  font-size: clamp(2.4rem, 3vw + 1rem, 3.8rem);
  font-weight: 800;
  line-height: 1.05;
  margin: 12px 0 8px;
}

.accent-red {
  color: #ffd1d6;
}

.accent-heart {
  color: #ffd1d6;
  font-size: 0.9em;
}

.hero-tags .badge {
  background: rgba(255, 255, 255, 0.9) !important;
}

.hero-panel-right {
  background: #f4d1cd;
  color: #1f2937;
  min-height: 420px;
}

.hero-feature-grid {
  margin-top: 20px;
}

.hero-grid {
  margin-top: 28px;
}

.hero-card {
  border-radius: 14px;
  padding: 20px 16px;
  height: 140px;
  color: #111827;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.35rem;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.hero-card-title {
  font-weight: 800;
  font-size: 1.05rem;
}

.hero-card span {
  font-weight: 600;
  opacity: 0.8;
  font-size: 0.95rem;
}

.hero-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
}

.hero-card.alt-1 { background: #ffedd5; }
.hero-card.alt-2 { background: #dbeafe; }
.hero-card.alt-3 { background: #dcfce7; }
.hero-card.alt-4 { background: #fef3c7; }
.hero-card.alt-5 { background: #e0f2fe; }
.hero-card.alt-6 { background: #f3e8ff; }

.text-purple {
  color: #7c3aed !important;
}

.home-footer-cta {
  background: #1f2937;
  color: #e5e7eb;
  padding: 42px 32px 48px;
}

.brand-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.brand-logo {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-text {
  color: #cbd5e1;
  max-width: 780px;
}

.social-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #e5e7eb;
  display: grid;
  place-items: center;
  transition: all 0.15s ease;
}

.social-icon:hover {
  background: #2bb8c1;
  color: #0b1324;
  text-decoration: none;
  border-color: #2bb8c1;
}

@media (max-width: 991.98px) {
  .hero-panel {
    padding: 36px 28px;
  }
}

@media (max-width: 767.98px) {
  .hero-grid .col-4 {
    width: 50%;
  }
  .home-footer-cta {
    text-align: center;
  }
  .home-footer-cta .d-flex {
    justify-content: center;
  }
}

.documentation-page {
  max-width: 1420px;
  margin: 0 auto;
}

.documentation-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: end;
  padding: 1.35rem;
  margin-bottom: 1rem;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
}

.documentation-hero h1 {
  margin: 0.2rem 0 0.35rem;
  font-size: 2rem;
  line-height: 1.2;
}

.documentation-hero p {
  max-width: 820px;
  margin: 0;
  color: var(--text-muted);
}

.documentation-actions,
.documentation-export-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
}

.documentation-role-form {
  min-width: 220px;
}

.documentation-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.documentation-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.documentation-nav {
  position: sticky;
  top: 1rem;
  align-self: start;
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: 1rem;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
}

.documentation-nav-role {
  margin-top: 0.65rem;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: #0f766e;
  text-transform: uppercase;
}

.documentation-nav-role:first-child {
  margin-top: 0;
}

.documentation-nav-link {
  display: block;
  padding: 0.5rem 0.65rem;
  margin-bottom: 0.25rem;
  color: var(--text-main);
  border-radius: 8px;
}

.documentation-nav-link:hover {
  background: #eef4ff;
  text-decoration: none;
}

.documentation-content {
  min-width: 0;
}

.documentation-role {
  margin-bottom: 1.2rem;
}

.documentation-role-header,
.documentation-chapter {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.documentation-role-header {
  padding: 1.2rem 1.35rem;
  margin-bottom: 1rem;
}

.documentation-role-header h2,
.documentation-chapter h3 {
  margin: 0.2rem 0 0.35rem;
  line-height: 1.25;
}

.documentation-role-header p,
.documentation-chapter-heading p {
  margin: 0;
  color: var(--text-muted);
}

.documentation-chapter {
  padding: 1rem;
  margin-bottom: 1rem;
  scroll-margin-top: 1rem;
}

.documentation-chapter-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.35rem 0.35rem 1rem;
}

.documentation-route {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  max-width: 100%;
  padding: 0.4rem 0.65rem;
  color: #075985;
  background: #ecfeff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
}

.documentation-section {
  margin: 0.75rem 0;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #fbfdff;
}

.documentation-section summary {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  justify-content: space-between;
  padding: 0.9rem 1rem;
  cursor: pointer;
  font-weight: 800;
}

.documentation-section summary small {
  color: var(--text-muted);
  font-family: Consolas, "Courier New", monospace;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.documentation-section-body {
  padding: 0 1rem 1rem;
}

.documentation-section-body > p {
  color: var(--text-muted);
}

.documentation-detail-block {
  margin: 1rem 0;
}

.documentation-detail-block h4,
.documentation-subheading {
  margin: 0 0 0.55rem;
  font-size: 1rem;
  font-weight: 800;
}

.documentation-compact-list,
.documentation-outcomes,
.documentation-troubleshooting {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding-left: 1.25rem;
}

.documentation-fields {
  display: grid;
  gap: 0.55rem;
}

.documentation-field {
  display: grid;
  gap: 0.25rem;
  padding: 0.65rem 0.75rem;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
}

.documentation-field strong {
  color: #0f766e;
}

.documentation-outcomes li {
  padding: 0.55rem 0.75rem;
  background: #eef9f2;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
}

.documentation-troubleshooting li {
  padding: 0.55rem 0.75rem;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 8px;
}

.documentation-steps {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 1rem;
  padding-left: 1.35rem;
}

.documentation-steps li {
  padding: 0.65rem 0.8rem;
  background: #fff;
  border: 1px solid #dbeafe;
  border-left: 4px solid var(--brand-500);
  border-radius: 8px;
}

.documentation-steps li.is-active {
  background: #eef9f2;
  border-color: #86efac;
  border-left-color: #198754;
}

.documentation-notes {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.documentation-note {
  display: flex;
  gap: 0.55rem;
  padding: 0.65rem 0.75rem;
  color: #92400e;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
}

.documentation-screenshots {
  display: grid;
  gap: 1rem;
}

.documentation-screenshots figure {
  margin: 0;
}

.documentation-screenshots img {
  width: 100%;
  max-height: 560px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
}

.documentation-screenshots figcaption {
  margin-top: 0.45rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.guide-hidden {
  display: none !important;
}

@media (min-width: 900px) {
  .documentation-hero {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .documentation-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .documentation-layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .documentation-actions {
    justify-content: flex-end;
  }
}
