/*
 * Family Tree Application Shell & Unified Specialty Coffee Design System
 * Inspired by the Bootstrap Studio "Specialty Coffee" editorial aesthetic:
 * Warm parchment & oat-cream surfaces, rich roasted espresso typography,
 * caramel (#8d5f3b), honey-gold (#d1a15d), sage (#819279), and terracotta (#bf5c45) accents.
 */

:root,
[data-bs-theme="light"] {
  --bs-font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-font-family-heading: "Playfair Display", Georgia, "Times New Roman", serif;
  --bs-font-family-accent: "Instrument Serif", Georgia, serif;

  --bs-primary: #8d5f3b;
  --bs-primary-rgb: 141, 95, 59;
  --bs-secondary: #4c392f;
  --bs-secondary-rgb: 76, 57, 47;
  --bs-success: #6f8665;
  --bs-success-rgb: 111, 134, 101;
  --bs-info: #c89448;
  --bs-info-rgb: 200, 148, 72;
  --bs-warning: #d4943a;
  --bs-warning-rgb: 212, 148, 58;
  --bs-danger: #bf5c45;
  --bs-danger-rgb: 191, 92, 69;
  --bs-light: #fbf6ef;
  --bs-light-rgb: 251, 246, 239;
  --bs-dark: #241814;
  --bs-dark-rgb: 36, 24, 20;

  --bs-body-font-family: var(--bs-font-family);
  --bs-body-color: #241814;
  --bs-body-color-rgb: 36, 24, 20;
  --bs-body-bg: #f7efe4;
  --bs-body-bg-rgb: 247, 239, 228;

  --bs-secondary-color: rgba(36, 24, 20, 0.72);
  --bs-secondary-bg: #efe4d5;
  --bs-tertiary-color: rgba(36, 24, 20, 0.54);
  --bs-tertiary-bg: #fbf6ef;

  --bs-card-bg: #fbf6ef;
  --bs-card-cap-bg: #f1e5d5;
  --bs-border-color: rgba(141, 95, 59, 0.18);
  --bs-border-radius: 0.65rem;
  --bs-border-radius-sm: 0.45rem;
  --bs-border-radius-lg: 0.95rem;
  --bs-border-radius-xl: 1.25rem;
  --bs-border-radius-pill: 50rem;

  --bs-link-color: #8d5f3b;
  --bs-link-color-rgb: 141, 95, 59;
  --bs-link-hover-color: #634025;
  --bs-box-shadow: 0 1rem 2.5rem rgba(36, 24, 20, 0.08);
  --bs-box-shadow-sm: 0 0.25rem 0.85rem rgba(36, 24, 20, 0.06);
}

[data-bs-theme="dark"] {
  color-scheme: dark;
  --bs-primary: #c48b5c;
  --bs-primary-rgb: 196, 139, 92;
  --bs-secondary: #9c8474;
  --bs-secondary-rgb: 156, 132, 116;
  --bs-success: #8fa386;
  --bs-success-rgb: 143, 163, 134;
  --bs-info: #d1a15d;
  --bs-info-rgb: 209, 161, 93;
  --bs-warning: #dfa75a;
  --bs-warning-rgb: 223, 167, 90;
  --bs-danger: #cf6d56;
  --bs-danger-rgb: 207, 109, 86;

  --bs-body-color: #efe7dd;
  --bs-body-color-rgb: 239, 231, 221;
  --bs-body-bg: #120e0d;
  --bs-body-bg-rgb: 18, 14, 13;

  --bs-secondary-color: rgba(239, 231, 221, 0.72);
  --bs-secondary-bg: #1b1513;
  --bs-tertiary-color: rgba(239, 231, 221, 0.52);
  --bs-tertiary-bg: #211916;

  --bs-card-bg: #1b1513;
  --bs-card-cap-bg: #241c19;
  --bs-border-color: rgba(239, 231, 221, 0.12);
  --bs-link-color: #d1a15d;
  --bs-link-hover-color: #e2b97e;
  --bs-box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.45);
  --bs-box-shadow-sm: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.32);
}

/* ==========================================================================
   1. Global Typography, Surfaces & Editorial Page Polish
   ========================================================================== */
body {
  background-color: var(--bs-body-bg) !important;
  color: var(--bs-body-color) !important;
  font-family: var(--bs-font-family) !important;
  line-height: 1.65;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--bs-font-family-heading);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--bs-body-color);
}

h1, .h1, .h2 {
  position: relative;
}

a {
  color: var(--bs-link-color);
  transition: color 0.15s ease;
}

a:hover {
  color: var(--bs-link-hover-color);
}

.text-body {
  color: var(--bs-body-color) !important;
}

.text-secondary {
  color: var(--bs-secondary-color) !important;
}

.text-muted {
  color: var(--bs-tertiary-color) !important;
}

.fs-6 { font-size: 1rem !important; }
.fs-7, .small, small { font-size: 0.85rem !important; }
.fw-semibold { font-weight: 600 !important; }
.font-monospace { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important; }

/* ==========================================================================
   2. Complete Responsive Grid System & Gutters (g-0..g-4, col-*, col-md-*, col-lg-*, col-xl-*)
   ========================================================================== */
.row {
  --bs-gutter-x: 1.25rem;
  --bs-gutter-y: 0;
  display: flex;
  flex-wrap: wrap;
  margin-top: calc(-1 * var(--bs-gutter-y));
  margin-right: calc(-0.5 * var(--bs-gutter-x));
  margin-left: calc(-0.5 * var(--bs-gutter-x));
}

.row > * {
  box-sizing: border-box;
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  padding-right: calc(var(--bs-gutter-x) * 0.5);
  padding-left: calc(var(--bs-gutter-x) * 0.5);
  margin-top: var(--bs-gutter-y);
}

.g-0, .gx-0 { --bs-gutter-x: 0; }
.g-0, .gy-0 { --bs-gutter-y: 0; }
.g-1, .gx-1 { --bs-gutter-x: 0.25rem; }
.g-1, .gy-1 { --bs-gutter-y: 0.25rem; }
.g-2, .gx-2 { --bs-gutter-x: 0.5rem; }
.g-2, .gy-2 { --bs-gutter-y: 0.5rem; }
.g-3, .gx-3 { --bs-gutter-x: 1rem; }
.g-3, .gy-3 { --bs-gutter-y: 1rem; }
.g-4, .gx-4 { --bs-gutter-x: 1.5rem; }
.g-4, .gy-4 { --bs-gutter-y: 1.5rem; }

.col { flex: 1 0 0%; }
.col-auto { flex: 0 0 auto; width: auto; }
.col-1 { flex: 0 0 auto; width: 8.333333%; }
.col-2 { flex: 0 0 auto; width: 16.666667%; }
.col-3 { flex: 0 0 auto; width: 25%; }
.col-4 { flex: 0 0 auto; width: 33.333333%; }
.col-5 { flex: 0 0 auto; width: 41.666667%; }
.col-6 { flex: 0 0 auto; width: 50%; }
.col-7 { flex: 0 0 auto; width: 58.333333%; }
.col-8 { flex: 0 0 auto; width: 66.666667%; }
.col-9 { flex: 0 0 auto; width: 75%; }
.col-10 { flex: 0 0 auto; width: 83.333333%; }
.col-11 { flex: 0 0 auto; width: 91.666667%; }
.col-12 { flex: 0 0 auto; width: 100%; }

@media (min-width: 576px) {
  .col-sm { flex: 1 0 0%; }
  .col-sm-auto { flex: 0 0 auto; width: auto; }
  .col-sm-3 { flex: 0 0 auto; width: 25%; }
  .col-sm-4 { flex: 0 0 auto; width: 33.333333%; }
  .col-sm-6 { flex: 0 0 auto; width: 50%; }
  .col-sm-8 { flex: 0 0 auto; width: 66.666667%; }
  .col-sm-9 { flex: 0 0 auto; width: 75%; }
  .col-sm-12 { flex: 0 0 auto; width: 100%; }
  .d-sm-inline { display: inline !important; }
  .d-sm-flex { display: flex !important; }
  .d-sm-none { display: none !important; }
}

@media (min-width: 768px) {
  .col-md { flex: 1 0 0%; }
  .col-md-auto { flex: 0 0 auto; width: auto; }
  .col-md-2 { flex: 0 0 auto; width: 16.666667%; }
  .col-md-3 { flex: 0 0 auto; width: 25%; }
  .col-md-4 { flex: 0 0 auto; width: 33.333333%; }
  .col-md-5 { flex: 0 0 auto; width: 41.666667%; }
  .col-md-6 { flex: 0 0 auto; width: 50%; }
  .col-md-7 { flex: 0 0 auto; width: 58.333333%; }
  .col-md-8 { flex: 0 0 auto; width: 66.666667%; }
  .col-md-9 { flex: 0 0 auto; width: 75%; }
  .col-md-10 { flex: 0 0 auto; width: 83.333333%; }
  .col-md-12 { flex: 0 0 auto; width: 100%; }
  .text-md-end { text-align: right !important; }
}

@media (min-width: 992px) {
  .col-lg { flex: 1 0 0%; }
  .col-lg-auto { flex: 0 0 auto; width: auto; }
  .col-lg-2 { flex: 0 0 auto; width: 16.666667%; }
  .col-lg-3 { flex: 0 0 auto; width: 25%; }
  .col-lg-4 { flex: 0 0 auto; width: 33.333333%; }
  .col-lg-5 { flex: 0 0 auto; width: 41.666667%; }
  .col-lg-6 { flex: 0 0 auto; width: 50%; }
  .col-lg-7 { flex: 0 0 auto; width: 58.333333%; }
  .col-lg-8 { flex: 0 0 auto; width: 66.666667%; }
  .col-lg-9 { flex: 0 0 auto; width: 75%; }
  .col-lg-10 { flex: 0 0 auto; width: 83.333333%; }
  .col-lg-12 { flex: 0 0 auto; width: 100%; }
  .d-lg-flex { display: flex !important; }
  .d-lg-block { display: block !important; }
  .d-lg-none { display: none !important; }
}

@media (min-width: 1200px) {
  .col-xl-3 { flex: 0 0 auto; width: 25%; }
  .col-xl-4 { flex: 0 0 auto; width: 33.333333%; }
  .col-xl-6 { flex: 0 0 auto; width: 50%; }
  .col-xl-8 { flex: 0 0 auto; width: 66.666667%; }
  .col-xl-9 { flex: 0 0 auto; width: 75%; }
  .col-xl-10 { flex: 0 0 auto; width: 83.333333%; }
}

/* ==========================================================================
   3. Utility Classes & Accessibility Helpers
   ========================================================================== */
.visually-hidden,
.visually-hidden-focusable:not(:focus):not(:focus-within) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.invalid-feedback {
  display: none;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.85em;
  color: var(--bs-danger);
}

.is-invalid ~ .invalid-feedback,
.was-validated :invalid ~ .invalid-feedback {
  display: block;
}

.border-dashed {
  border: 2px dashed rgba(141, 95, 59, 0.3) !important;
}

.rounded-circle {
  border-radius: 50% !important;
}

.rounded-pill {
  border-radius: 50rem !important;
}

.rounded-3 {
  border-radius: var(--bs-border-radius-lg) !important;
}

.sticky-top {
  position: sticky;
  top: 1rem;
  z-index: 1010;
}

/* ==========================================================================
   4. Editorial Cards, Filter Panels & Containers
   ========================================================================== */
.card {
  background-color: var(--bs-card-bg) !important;
  border: 1px solid var(--bs-border-color) !important;
  border-radius: var(--bs-border-radius-lg) !important;
  box-shadow: var(--bs-box-shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card-header,
.card-footer {
  background-color: var(--bs-card-cap-bg) !important;
  border-color: var(--bs-border-color) !important;
  padding: 0.9rem 1.25rem;
}

.card-body {
  padding: 1.35rem;
}

.bg-light,
.bg-body-tertiary,
.bg-body-secondary {
  background-color: var(--bs-secondary-bg) !important;
  color: var(--bs-body-color) !important;
}

.bg-white {
  background-color: var(--bs-card-bg) !important;
  color: var(--bs-body-color) !important;
}

/* ==========================================================================
   5. Editorial Tables (Directory, Relationships, Audit Logs, Users)
   ========================================================================== */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--bs-body-color);
  --bs-table-border-color: var(--bs-border-color);
  --bs-table-hover-bg: rgba(141, 95, 59, 0.06);
  width: 100%;
  margin-bottom: 0;
  color: var(--bs-body-color) !important;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 0.9rem 1.1rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--bs-border-color);
}

.table thead th,
.table .table-light th {
  background: linear-gradient(180deg, rgba(141, 95, 59, 0.11) 0%, rgba(141, 95, 59, 0.06) 100%) !important;
  color: var(--bs-secondary) !important;
  font-family: var(--bs-font-family);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  border-bottom: 2px solid rgba(141, 95, 59, 0.22) !important;
  white-space: nowrap;
}

[data-bs-theme="dark"] .table thead th,
[data-bs-theme="dark"] .table .table-light th {
  color: #e4c397 !important;
  background: rgba(209, 161, 93, 0.1) !important;
}

.table-hover tbody tr {
  transition: background-color 0.15s ease;
}

.table-hover tbody tr:hover {
  background-color: rgba(141, 95, 59, 0.065) !important;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

/* ==========================================================================
   6. Specialty Coffee Buttons, Button Groups & Input Groups
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border-radius: 50rem !important;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.45rem 1.05rem;
  line-height: 1.4;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-sm {
  padding: 0.3rem 0.75rem !important;
  font-size: 0.8125rem !important;
}

.btn-lg {
  padding: 0.65rem 1.4rem !important;
  font-size: 1rem !important;
}

.btn-primary {
  background: linear-gradient(135deg, #8d5f3b 0%, #6e472a 100%) !important;
  border-color: #6e472a !important;
  color: #fbf6ef !important;
  box-shadow: 0 0.2rem 0.6rem rgba(141, 95, 59, 0.25);
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, #734b2d 0%, #583820 100%) !important;
  border-color: #583820 !important;
  color: #ffffff !important;
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: #4c392f !important;
  border-color: #4c392f !important;
  color: #fbf6ef !important;
}

.btn-secondary:hover,
.btn-secondary:focus {
  background-color: #382921 !important;
  border-color: #382921 !important;
  color: #ffffff !important;
}

.btn-outline-primary {
  color: var(--bs-primary) !important;
  border-color: rgba(141, 95, 59, 0.5) !important;
  background-color: transparent !important;
}

.btn-outline-primary:hover,
.btn-outline-primary.active {
  background-color: var(--bs-primary) !important;
  border-color: var(--bs-primary) !important;
  color: #fbf6ef !important;
}

.btn-outline-secondary {
  color: var(--bs-body-color) !important;
  border-color: rgba(141, 95, 59, 0.35) !important;
  background-color: rgba(251, 246, 239, 0.5) !important;
}

[data-bs-theme="dark"] .btn-outline-secondary {
  background-color: rgba(255, 255, 255, 0.04) !important;
}

.btn-outline-secondary:hover,
.btn-outline-secondary.active {
  background-color: #4c392f !important;
  border-color: #4c392f !important;
  color: #fbf6ef !important;
}

.btn-outline-danger {
  color: #bf5c45 !important;
  border-color: rgba(191, 92, 69, 0.45) !important;
  background-color: transparent !important;
}

.btn-outline-danger:hover {
  background-color: #bf5c45 !important;
  border-color: #bf5c45 !important;
  color: #ffffff !important;
}

.btn-success {
  background-color: #6f8665 !important;
  border-color: #6f8665 !important;
  color: #ffffff !important;
}

.btn-danger {
  background-color: #bf5c45 !important;
  border-color: #bf5c45 !important;
  color: #ffffff !important;
}

.btn-warning {
  background-color: #d1a15d !important;
  border-color: #c28f47 !important;
  color: #241814 !important;
}

/* Button Groups */
.btn-group {
  display: inline-flex;
  vertical-align: middle;
  border-radius: 50rem;
}

.btn-group > .btn {
  position: relative;
  flex: 1 1 auto;
}

.btn-group > .btn:not(:first-child) {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
  margin-left: -1px;
}

.btn-group > .btn:not(:last-child) {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

/* Input Groups */
.input-group {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  width: 100%;
}

.input-group > .form-control,
.input-group > .form-select {
  position: relative;
  flex: 1 1 auto;
  width: 1%;
  min-width: 0;
}

.input-group-text {
  display: flex;
  align-items: center;
  padding: 0.45rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--bs-secondary);
  text-align: center;
  white-space: nowrap;
  background-color: #f1e5d5;
  border: 1px solid rgba(141, 95, 59, 0.28);
  border-radius: 0.55rem;
}

[data-bs-theme="dark"] .input-group-text {
  background-color: #281f1b;
  color: #d1a15d;
  border-color: rgba(209, 161, 93, 0.25);
}

.input-group > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
  margin-left: -1px;
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}

.input-group > :not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating) {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

/* ==========================================================================
   7. Specialty Coffee Badges (Solid + Subtle + Emphasis Variants)
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 50rem !important;
  padding: 0.35em 0.75em;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.bg-primary, .text-bg-primary {
  background-color: #8d5f3b !important;
  color: #fbf6ef !important;
}

.bg-secondary, .text-bg-secondary {
  background-color: #6d5848 !important;
  color: #fbf6ef !important;
}

.bg-success, .text-bg-success {
  background-color: #6f8665 !important;
  color: #ffffff !important;
}

.bg-info, .text-bg-info {
  background-color: #d1a15d !important;
  color: #241814 !important;
}

.bg-warning, .text-bg-warning {
  background-color: #dfa75a !important;
  color: #241814 !important;
}

.bg-danger, .text-bg-danger {
  background-color: #bf5c45 !important;
  color: #ffffff !important;
}

/* Subtle Badges (Used on /people, /relationships, /timeline, /search, /admin) */
.bg-primary-subtle {
  background-color: rgba(141, 95, 59, 0.14) !important;
  border: 1px solid rgba(141, 95, 59, 0.25);
}
.text-primary-emphasis {
  color: #694427 !important;
}

.bg-secondary-subtle {
  background-color: rgba(76, 57, 47, 0.12) !important;
  border: 1px solid rgba(76, 57, 47, 0.2);
}
.text-secondary-emphasis {
  color: #4c392f !important;
}

.bg-success-subtle {
  background-color: rgba(111, 134, 101, 0.16) !important;
  border: 1px solid rgba(111, 134, 101, 0.3);
}
.text-success-emphasis {
  color: #3d5235 !important;
}

.bg-info-subtle {
  background-color: rgba(141, 95, 59, 0.13) !important;
  border: 1px solid rgba(141, 95, 59, 0.26);
}
.text-info-emphasis {
  color: #5c3c22 !important;
}

.bg-warning-subtle {
  background-color: rgba(209, 161, 93, 0.22) !important;
  border: 1px solid rgba(209, 161, 93, 0.4);
}
.text-warning-emphasis {
  color: #6b4816 !important;
}

.bg-danger-subtle {
  background-color: rgba(191, 92, 69, 0.14) !important;
  border: 1px solid rgba(191, 92, 69, 0.28);
}
.text-danger-emphasis {
  color: #8c3723 !important;
}

[data-bs-theme="dark"] .text-primary-emphasis,
[data-bs-theme="dark"] .text-info-emphasis {
  color: #e4b882 !important;
}
[data-bs-theme="dark"] .text-secondary-emphasis {
  color: #d6c5b7 !important;
}
[data-bs-theme="dark"] .text-success-emphasis {
  color: #b5cba9 !important;
}
[data-bs-theme="dark"] .text-warning-emphasis {
  color: #f0c987 !important;
}
[data-bs-theme="dark"] .text-danger-emphasis {
  color: #f29f8d !important;
}

.text-primary { color: var(--bs-primary) !important; }
.text-success { color: var(--bs-success) !important; }
.text-warning { color: #b87c28 !important; }
.text-danger { color: var(--bs-danger) !important; }
.text-info { color: #9c6c27 !important; }

.border-primary { border-color: var(--bs-primary) !important; }
.border-success { border-color: var(--bs-success) !important; }
.border-info { border-color: #d1a15d !important; }
.border-warning { border-color: #dfa75a !important; }
.border-danger { border-color: var(--bs-danger) !important; }

/* ==========================================================================
   8. Forms, Switches, List Groups, Pagination, Breadcrumbs & Alerts
   ========================================================================== */
.form-label {
  display: inline-block;
  margin-bottom: 0.4rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--bs-secondary);
}

[data-bs-theme="dark"] .form-label {
  color: #d9c8b8;
}

.form-control,
.form-select {
  display: block;
  width: 100%;
  padding: 0.48rem 0.85rem;
  font-size: 0.92rem;
  line-height: 1.5;
  background-color: var(--bs-tertiary-bg) !important;
  color: var(--bs-body-color) !important;
  border: 1px solid rgba(141, 95, 59, 0.28) !important;
  border-radius: 0.55rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--bs-primary) !important;
  box-shadow: 0 0 0 0.2rem rgba(141, 95, 59, 0.18) !important;
  outline: 0;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 1.5rem;
}

.form-check-input {
  width: 1.1em;
  height: 1.1em;
  accent-color: var(--bs-primary);
  cursor: pointer;
}

/* Breadcrumbs */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  padding: 0.45rem 0.85rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  list-style: none;
  background-color: rgba(141, 95, 59, 0.07);
  border-radius: 50rem;
  width: fit-content;
}

.breadcrumb-item + .breadcrumb-item {
  padding-left: 0.5rem;
}

.breadcrumb-item + .breadcrumb-item::before {
  float: left;
  padding-right: 0.5rem;
  color: var(--bs-tertiary-color);
  content: "/";
}

.breadcrumb-item.active {
  color: var(--bs-secondary-color);
  font-weight: 600;
}

/* List Groups */
.list-group {
  display: flex;
  flex-direction: column;
  padding-left: 0;
  margin-bottom: 0;
  border-radius: var(--bs-border-radius);
}

.list-group-item {
  position: relative;
  display: block;
  padding: 0.85rem 1.15rem;
  color: var(--bs-body-color);
  text-decoration: none;
  background-color: var(--bs-card-bg);
  border: 1px solid var(--bs-border-color);
}

.list-group-item + .list-group-item {
  border-top-width: 0;
}

.list-group-flush > .list-group-item {
  border-width: 0 0 1px;
}

.list-group-flush > .list-group-item:last-child {
  border-bottom-width: 0;
}

/* Pagination */
.pagination {
  display: flex;
  padding-left: 0;
  list-style: none;
  gap: 0.35rem;
}

.page-link {
  position: relative;
  display: block;
  padding: 0.45rem 0.9rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bs-primary);
  text-decoration: none;
  background-color: var(--bs-card-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 50rem !important;
  transition: all 0.15s ease;
}

.page-link:hover {
  background-color: var(--bs-secondary-bg);
  color: var(--bs-link-hover-color);
}

.page-item.active .page-link {
  z-index: 3;
  color: #fbf6ef;
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}

.page-item.disabled .page-link {
  color: var(--bs-tertiary-color);
  pointer-events: none;
  background-color: var(--bs-secondary-bg);
  opacity: 0.65;
}

/* Progress Bars */
.progress {
  display: flex;
  height: 0.65rem;
  overflow: hidden;
  font-size: 0.75rem;
  background-color: rgba(141, 95, 59, 0.15);
  border-radius: 50rem;
}

.progress-bar {
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  background-color: var(--bs-primary);
  transition: width 0.4s ease;
}

/* Alerts */
.alert {
  position: relative;
  padding: 0.95rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: var(--bs-border-radius);
}

.alert-info {
  background-color: rgba(209, 161, 93, 0.16) !important;
  border-color: rgba(209, 161, 93, 0.38) !important;
  color: var(--bs-body-color) !important;
}

.alert-success {
  background-color: rgba(111, 134, 101, 0.16) !important;
  border-color: rgba(111, 134, 101, 0.35) !important;
  color: var(--bs-body-color) !important;
}

.alert-warning {
  background-color: rgba(223, 167, 90, 0.18) !important;
  border-color: rgba(223, 167, 90, 0.42) !important;
  color: var(--bs-body-color) !important;
}

.alert-danger {
  background-color: rgba(191, 92, 69, 0.14) !important;
  border-color: rgba(191, 92, 69, 0.35) !important;
  color: var(--bs-body-color) !important;
}

.alert-secondary {
  background-color: rgba(76, 57, 47, 0.08) !important;
  border-color: rgba(76, 57, 47, 0.2) !important;
  color: var(--bs-body-color) !important;
}

/* Collapse & Dropdown state helpers */
.collapse:not(.show) {
  display: none;
}

/* Accessibility Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: #d1a15d;
  color: #241814;
  padding: 0.75rem 1.25rem;
  z-index: 9999;
  font-weight: 700;
  text-decoration: none;
  border-radius: 0 0 0.5rem 0;
  box-shadow: 0 0.25rem 0.5rem rgba(36, 24, 20, 0.2);
  transition: top 0.15s ease-in-out;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid #241814;
}

/* Navbar Reset */
.navbar-nav,
.navbar-nav .nav-item {
  list-style: none !important;
  list-style-type: none !important;
  padding-left: 0 !important;
  margin-bottom: 0 !important;
}

/* High Contrast Focus Ring */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--bs-primary) !important;
  outline-offset: 2px !important;
}

/* Role Preview Bar */
.role-preview-bar {
  background-color: #f6ecdf;
  color: #4c392f;
  border-bottom: 2px solid #d1a15d;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

[data-bs-theme="dark"] .role-preview-bar {
  background-color: #2a2013;
  color: #efe7dd;
  border-bottom-color: #8d5f3b;
}

/* Privacy & Authorization Scope Notice */
.privacy-boundary-notice {
  background-color: rgba(141, 95, 59, 0.08);
  border-left: 4px solid var(--bs-primary);
  padding: 0.85rem 1.15rem;
  margin-bottom: 1.25rem;
  border-radius: 0 var(--bs-border-radius) var(--bs-border-radius) 0;
}

[data-bs-theme="dark"] .privacy-boundary-notice {
  background-color: rgba(209, 161, 93, 0.08);
  border-left-color: #d1a15d;
}

/* ==========================================================================
   9. Unified Specialty Coffee Navigation Bar
   ========================================================================== */
.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--bs-font-family-heading);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.app-brand i {
  color: #d1a15d;
}

.app-navbar {
  background: linear-gradient(135deg, #241814 0%, #38251e 60%, #2b1d17 100%) !important;
  color: #fbf6ef !important;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(209, 161, 93, 0.22);
  box-shadow: 0 0.35rem 1.2rem rgba(36, 24, 20, 0.18);
}

[data-bs-theme="dark"] .app-navbar {
  background: linear-gradient(135deg, #160f0d 0%, #241814 100%) !important;
  border-bottom: 1px solid rgba(209, 161, 93, 0.18);
}

.app-navbar .navbar-brand,
.app-navbar .app-brand {
  color: #fbf6ef !important;
  text-decoration: none;
  margin-right: 1.25rem;
}

.app-navbar .nav-link {
  color: rgba(251, 246, 239, 0.82) !important;
  padding: 0.6rem 0.9rem !important;
  border-radius: 50rem;
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.app-navbar .nav-link:hover {
  color: #fbf6ef !important;
  background-color: rgba(251, 246, 239, 0.1) !important;
}

.app-navbar .nav-link.active {
  color: #241814 !important;
  background: linear-gradient(135deg, #d1a15d 0%, #dfa75a 100%) !important;
  font-weight: 600;
  box-shadow: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.2);
}

.app-navbar .form-control {
  background-color: rgba(251, 246, 239, 0.1) !important;
  border-color: rgba(209, 161, 93, 0.3) !important;
  color: #fbf6ef !important;
  border-radius: 50rem !important;
  padding-left: 0.85rem;
}

.app-navbar .form-control::placeholder {
  color: rgba(251, 246, 239, 0.6) !important;
}

.app-navbar .btn-outline-light {
  border-color: rgba(209, 161, 93, 0.35) !important;
  color: #fbf6ef !important;
}

.app-navbar .btn-outline-light:hover,
.app-navbar .btn-outline-light.active {
  background-color: #d1a15d !important;
  border-color: #d1a15d !important;
  color: #241814 !important;
}

/* Page Layout Wrappers */
.app-shell-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-main-content {
  flex: 1 0 auto;
  padding-top: 1.75rem;
  padding-bottom: 2.75rem;
}

/* Footer Styling */
.app-footer,
footer.footer {
  margin-top: auto;
  padding: 1.25rem 0;
  border-top: 1px solid var(--bs-border-color);
  background-color: var(--bs-secondary-bg) !important;
  font-size: 0.875rem;
  color: var(--bs-secondary-color) !important;
}

/* Required Field Marker */
.required-star {
  color: var(--bs-danger);
  font-weight: bold;
  margin-left: 0.2rem;
}

/* Role Badges */
.role-badge-admin {
  background-color: #4c392f;
  color: #fbf6ef;
}

.role-badge-contributor {
  background-color: #8d5f3b;
  color: #fbf6ef;
}

.role-badge-readonly {
  background-color: #6f8665;
  color: #ffffff;
}

/* Explicit Responsive Navbar & Collapsible Menu Rules */
.app-navbar .container-fluid {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.75rem;
  padding-left: 1.5rem !important;
  padding-right: 1.5rem !important;
}

.app-navbar .app-navbar-toggler {
  border-radius: 50rem !important;
  padding: 0.35rem 0.85rem !important;
  font-size: 0.85rem;
  font-weight: 600;
}

.app-navbar .app-nav-dropdown {
  position: relative;
}

.app-navbar .app-nav-dropdown > .nav-link {
  display: inline-flex !important;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  background: transparent;
  border: 0;
}

.app-navbar .app-nav-dropdown .dropdown-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 1080;
  display: none !important;
  min-width: 13.5rem;
  padding: 0.45rem;
  margin: 0;
  list-style: none;
  background: linear-gradient(145deg, #2b1d17 0%, #241814 100%) !important;
  border: 1px solid rgba(209, 161, 93, 0.35) !important;
  border-radius: 0.8rem !important;
  box-shadow: 0 0.85rem 2.25rem rgba(0, 0, 0, 0.42) !important;
}

.app-navbar .app-nav-dropdown .dropdown-menu.show {
  display: block !important;
}

.app-navbar .app-nav-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.45rem 0.8rem;
  font-size: 0.86rem;
  font-weight: 500;
  color: rgba(251, 246, 239, 0.88) !important;
  text-decoration: none;
  border-radius: 0.5rem;
  transition: all 0.15s ease;
}

.app-navbar .app-nav-dropdown .dropdown-item:hover,
.app-navbar .app-nav-dropdown .dropdown-item:focus {
  color: #fbf6ef !important;
  background-color: rgba(251, 246, 239, 0.12) !important;
}

.app-navbar .app-nav-dropdown .dropdown-item.active {
  color: #241814 !important;
  background: linear-gradient(135deg, #d1a15d 0%, #dfa75a 100%) !important;
  font-weight: 600;
}

@media (min-width: 768px) {
  .app-navbar .app-navbar-toggler {
    display: none !important;
  }

  .app-navbar #appNavbarContent {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-grow: 1 !important;
    width: auto !important;
    gap: 0.5rem;
  }

  .app-navbar #appNavbarContent .navbar-nav {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 0.2rem !important;
    margin: 0 !important;
  }

  /* One row at every desktop width: links that don't fit move into "More" (shell.js fitNav). */
  .app-navbar > .container-fluid {
    flex-wrap: nowrap !important;
  }

  .app-navbar .app-brand {
    flex-shrink: 0;
  }

  .app-navbar #appNavbarContent {
    min-width: 0;
  }

  .app-navbar #appNavbarContent .app-nav-links {
    flex: 1 1 auto;
    min-width: 0;
  }

  .app-navbar .app-nav-admin.compact .app-nav-label {
    display: none;
  }

  .app-navbar #appNavbarContent .app-navbar-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.5rem !important;
    margin-top: 0 !important;
    flex-shrink: 0;
  }

  .app-navbar .app-search-input {
    width: 140px !important;
  }
}

@media (min-width: 768px) and (max-width: 1360px) {
  .app-navbar .container-fluid {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .app-navbar .nav-link {
    padding: 0.55rem 0.6rem !important;
    font-size: 0.84rem !important;
  }

  .app-navbar .app-search-input {
    width: 110px !important;
  }
}

@media (min-width: 768px) and (max-width: 1080px) {
  .app-navbar .nav-link {
    padding: 0.5rem 0.6rem !important;
    font-size: 0.81rem !important;
  }

  .app-navbar .app-brand {
    font-size: 1.15rem !important;
    margin-right: 0.5rem !important;
  }

  .app-navbar .app-search-input {
    width: 135px !important;
  }
}

@media (max-width: 767.98px) {
  .app-navbar .app-navbar-toggler {
    display: inline-flex !important;
    align-items: center;
    gap: 0.35rem;
  }

  .app-navbar #appNavbarContent:not(.show) {
    display: none !important;
  }

  .app-navbar #appNavbarContent.show {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    border-top: 1px solid rgba(209, 161, 93, 0.22);
  }

  .app-navbar #appNavbarContent.show .navbar-nav {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.25rem !important;
    width: 100% !important;
  }

  .app-navbar #appNavbarContent.show .app-navbar-actions {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.5rem !important;
    margin-top: 0.75rem !important;
    width: 100% !important;
  }

  .app-navbar .app-nav-dropdown .dropdown-menu {
    position: static !important;
    box-shadow: none !important;
    margin-top: 0.25rem !important;
    width: 100% !important;
  }
}

/* ==========================================================================
   10. Spacing utilities missing from the bundled Bootstrap subset, container
       layout, and readable text on solid brand-coloured surfaces
   ========================================================================== */
.container {
  width: 100%;
  max-width: 1320px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.py-4 { padding-top: 1.75rem !important; padding-bottom: 1.75rem !important; }
.py-5 { padding-top: 3rem !important; padding-bottom: 3rem !important; }
.pt-4 { padding-top: 1.75rem !important; }
.pb-4 { padding-bottom: 1.75rem !important; }
.px-4 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }
.mb-5 { margin-bottom: 3rem !important; }
.my-3 { margin-top: 1rem !important; margin-bottom: 1rem !important; }
.my-4 { margin-top: 1.5rem !important; margin-bottom: 1.5rem !important; }

@media (min-width: 768px) {
  .px-md-4 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
}

/* Headings default to the dark body colour; on solid brand surfaces they must use the light text colour. */
:is(.bg-primary, .bg-secondary, .bg-success, .bg-danger, .text-bg-primary, .text-bg-secondary, .text-bg-success, .text-bg-danger)
  :is(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6, .card-title, i, small) {
  color: inherit !important;
}

:is(.bg-primary, .bg-secondary, .bg-success, .bg-danger, .text-bg-primary, .text-bg-secondary, .text-bg-success, .text-bg-danger)
  :is(.text-muted, .text-secondary) {
  color: rgba(251, 246, 239, 0.88) !important;
}

:is(.bg-primary, .bg-secondary, .bg-success, .bg-danger) a:not(.btn) {
  color: #fbf6ef;
  text-decoration: underline;
}

/* ==========================================================================
   11. General Dropdown Menus, Complete 12-Column Responsive Grid & Utilities
   ========================================================================== */
.dropdown,
.dropup,
.dropend,
.dropstart {
  position: relative;
}

.dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.dropdown-toggle::after {
  display: inline-block;
  margin-left: 0.2rem;
  vertical-align: 0.15em;
  content: "";
  border-top: 0.3em solid;
  border-right: 0.3em solid transparent;
  border-bottom: 0;
  border-left: 0.3em solid transparent;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 0.3rem);
  left: 0;
  z-index: 1055;
  display: none;
  min-width: 12rem;
  padding: 0.4rem;
  margin: 0;
  list-style: none !important;
  font-size: 0.875rem;
  color: var(--bs-body-color);
  text-align: left;
  background-color: var(--bs-card-bg);
  background-clip: padding-box;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.75rem;
  box-shadow: 0 0.75rem 2rem rgba(36, 24, 20, 0.18);
}

[data-bs-theme="dark"] .dropdown-menu {
  box-shadow: 0 0.85rem 2.25rem rgba(0, 0, 0, 0.52);
}

.dropdown-menu.dropdown-menu-end {
  left: auto;
  right: 0;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-menu > li {
  list-style: none !important;
}

.dropdown-header {
  display: block;
  padding: 0.35rem 0.75rem;
  margin-bottom: 0;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bs-secondary-color);
  white-space: nowrap;
}

.dropdown-divider {
  height: 0;
  margin: 0.35rem 0;
  overflow: hidden;
  border-top: 1px solid var(--bs-border-color);
  opacity: 1;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.42rem 0.75rem;
  clear: both;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--bs-body-color);
  text-align: inherit;
  text-decoration: none;
  white-space: nowrap;
  background-color: transparent;
  border: 0;
  border-radius: 0.45rem;
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
  color: var(--bs-body-color);
  background-color: rgba(141, 95, 59, 0.12);
}

.dropdown-item.active,
.dropdown-item:active {
  color: #fbf6ef;
  background-color: var(--bs-primary);
}

/* Complete 12-column responsive Bootstrap grid */
.row {
  --bs-gutter-x: 1rem;
  --bs-gutter-y: 0;
  display: flex;
  flex-wrap: wrap;
  margin-top: calc(-1 * var(--bs-gutter-y));
  margin-right: calc(-0.5 * var(--bs-gutter-x));
  margin-left: calc(-0.5 * var(--bs-gutter-x));
}

.row > * {
  box-sizing: border-box;
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  padding-right: calc(var(--bs-gutter-x) * 0.5);
  padding-left: calc(var(--bs-gutter-x) * 0.5);
  margin-top: var(--bs-gutter-y);
}

.g-0 { --bs-gutter-x: 0; --bs-gutter-y: 0; }
.g-1 { --bs-gutter-x: 0.25rem; --bs-gutter-y: 0.25rem; }
.g-2 { --bs-gutter-x: 0.5rem; --bs-gutter-y: 0.5rem; }
.g-3 { --bs-gutter-x: 1rem; --bs-gutter-y: 1rem; }
.g-4 { --bs-gutter-x: 1.5rem; --bs-gutter-y: 1.5rem; }

.col { flex: 1 0 0%; }
.col-auto { flex: 0 0 auto; width: auto; }
.col-1 { flex: 0 0 auto; width: 8.333333%; }
.col-2 { flex: 0 0 auto; width: 16.666667%; }
.col-3 { flex: 0 0 auto; width: 25%; }
.col-4 { flex: 0 0 auto; width: 33.333333%; }
.col-5 { flex: 0 0 auto; width: 41.666667%; }
.col-6 { flex: 0 0 auto; width: 50%; }
.col-7 { flex: 0 0 auto; width: 58.333333%; }
.col-8 { flex: 0 0 auto; width: 66.666667%; }
.col-9 { flex: 0 0 auto; width: 75%; }
.col-10 { flex: 0 0 auto; width: 83.333333%; }
.col-11 { flex: 0 0 auto; width: 91.666667%; }
.col-12 { flex: 0 0 auto; width: 100%; }

@media (min-width: 576px) {
  .col-sm { flex: 1 0 0%; }
  .col-sm-auto { flex: 0 0 auto; width: auto; }
  .col-sm-1 { flex: 0 0 auto; width: 8.333333%; }
  .col-sm-2 { flex: 0 0 auto; width: 16.666667%; }
  .col-sm-3 { flex: 0 0 auto; width: 25%; }
  .col-sm-4 { flex: 0 0 auto; width: 33.333333%; }
  .col-sm-5 { flex: 0 0 auto; width: 41.666667%; }
  .col-sm-6 { flex: 0 0 auto; width: 50%; }
  .col-sm-7 { flex: 0 0 auto; width: 58.333333%; }
  .col-sm-8 { flex: 0 0 auto; width: 66.666667%; }
  .col-sm-9 { flex: 0 0 auto; width: 75%; }
  .col-sm-10 { flex: 0 0 auto; width: 83.333333%; }
  .col-sm-11 { flex: 0 0 auto; width: 91.666667%; }
  .col-sm-12 { flex: 0 0 auto; width: 100%; }
  .mt-sm-0 { margin-top: 0 !important; }
}

@media (min-width: 768px) {
  .col-md { flex: 1 0 0%; }
  .col-md-auto { flex: 0 0 auto; width: auto; }
  .col-md-1 { flex: 0 0 auto; width: 8.333333%; }
  .col-md-2 { flex: 0 0 auto; width: 16.666667%; }
  .col-md-3 { flex: 0 0 auto; width: 25%; }
  .col-md-4 { flex: 0 0 auto; width: 33.333333%; }
  .col-md-5 { flex: 0 0 auto; width: 41.666667%; }
  .col-md-6 { flex: 0 0 auto; width: 50%; }
  .col-md-7 { flex: 0 0 auto; width: 58.333333%; }
  .col-md-8 { flex: 0 0 auto; width: 66.666667%; }
  .col-md-9 { flex: 0 0 auto; width: 75%; }
  .col-md-10 { flex: 0 0 auto; width: 83.333333%; }
  .col-md-11 { flex: 0 0 auto; width: 91.666667%; }
  .col-md-12 { flex: 0 0 auto; width: 100%; }
  .ms-md-auto { margin-left: auto !important; }
  .px-md-5 { padding-left: 2.5rem !important; padding-right: 2.5rem !important; }
}

@media (min-width: 992px) {
  .col-lg { flex: 1 0 0%; }
  .col-lg-auto { flex: 0 0 auto; width: auto; }
  .col-lg-1 { flex: 0 0 auto; width: 8.333333%; }
  .col-lg-2 { flex: 0 0 auto; width: 16.666667%; }
  .col-lg-3 { flex: 0 0 auto; width: 25%; }
  .col-lg-4 { flex: 0 0 auto; width: 33.333333%; }
  .col-lg-5 { flex: 0 0 auto; width: 41.666667%; }
  .col-lg-6 { flex: 0 0 auto; width: 50%; }
  .col-lg-7 { flex: 0 0 auto; width: 58.333333%; }
  .col-lg-8 { flex: 0 0 auto; width: 66.666667%; }
  .col-lg-9 { flex: 0 0 auto; width: 75%; }
  .col-lg-10 { flex: 0 0 auto; width: 83.333333%; }
  .col-lg-11 { flex: 0 0 auto; width: 91.666667%; }
  .col-lg-12 { flex: 0 0 auto; width: 100%; }
}

/* Positioning, Flex, Spacing, Progress & Input Group Utilities */
.position-relative { position: relative !important; }
.position-absolute { position: absolute !important; }
.d-inline-flex { display: inline-flex !important; }
.flex-wrap { flex-wrap: wrap !important; }
.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }
.text-start { text-align: left !important; }
.text-center { text-align: center !important; }
.text-end { text-align: right !important; }
.text-uppercase { text-transform: uppercase !important; }
.text-capitalize { text-transform: capitalize !important; }
.text-decoration-none { text-decoration: none !important; }
.text-body-secondary { color: var(--bs-secondary-color) !important; }
.text-body-emphasis { color: var(--bs-body-color) !important; }
.list-unstyled { list-style: none !important; padding-left: 0 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-bold { font-weight: 700 !important; }
.rounded-0 { border-radius: 0 !important; }
.rounded { border-radius: var(--bs-border-radius) !important; }
.rounded-3 { border-radius: var(--bs-border-radius-lg) !important; }
.rounded-circle { border-radius: 50% !important; }
.border-0 { border: 0 !important; }
.border-bottom { border-bottom: 1px solid var(--bs-border-color) !important; }

.ms-1 { margin-left: 0.25rem !important; }
.ms-2 { margin-left: 0.5rem !important; }
.ms-3 { margin-left: 1rem !important; }
.ms-4 { margin-left: 1.5rem !important; }
.px-1 { padding-left: 0.25rem !important; padding-right: 0.25rem !important; }
.px-2 { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
.py-0 { padding-top: 0 !important; padding-bottom: 0 !important; }
.py-1 { padding-top: 0.25rem !important; padding-bottom: 0.25rem !important; }
.pt-2 { padding-top: 0.5rem !important; }
.pt-3 { padding-top: 1rem !important; }
.p-5 { padding: 3rem !important; }

.input-group {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  width: 100%;
}

.input-group > .form-control {
  position: relative;
  flex: 1 1 auto;
  width: 1%;
  min-width: 0;
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

.input-group > .btn {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}

.input-group-sm > .form-control,
.input-group-sm > .btn {
  padding: 0.28rem 0.6rem;
  font-size: 0.85rem;
}

.progress {
  display: flex;
  height: 0.5rem;
  overflow: hidden;
  font-size: 0.75rem;
  background-color: rgba(141, 95, 59, 0.14);
  border-radius: 50rem;
}

.progress-bar {
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  background-color: var(--bs-primary);
  transition: width 0.35s ease;
}

.btn-outline-success {
  color: #556b4d !important;
  border-color: rgba(111, 134, 101, 0.5) !important;
  background-color: transparent !important;
}

[data-bs-theme="dark"] .btn-outline-success {
  color: #9bb590 !important;
}

.btn-outline-success:hover {
  background-color: #6f8665 !important;
  border-color: #6f8665 !important;
  color: #ffffff !important;
}

/* ==========================================================================
   Welcome Home Screen Hero (Two-Column Photo/Illustration + Text-Only Fallback)
   ========================================================================== */
.home-welcome-hero {
  border-radius: 1.15rem !important;
  overflow: hidden;
  border: 1px solid var(--bs-border-color);
  background: linear-gradient(135deg, rgba(251, 246, 239, 0.98) 0%, rgba(239, 228, 213, 0.72) 100%);
  box-shadow: 0 12px 32px rgba(36, 24, 20, 0.08);
}

[data-bs-theme="dark"] .home-welcome-hero {
  background: linear-gradient(135deg, rgba(27, 21, 19, 0.98) 0%, rgba(42, 31, 27, 0.85) 100%);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}

.home-hero-media-col {
  background-color: rgba(141, 95, 59, 0.08);
  border-bottom: 1px solid var(--bs-border-color);
  display: flex;
  align-items: stretch;
  justify-content: center;
}

@media (min-width: 768px) {
  .home-hero-media-col {
    border-bottom: 0;
    border-right: 1px solid var(--bs-border-color);
  }
}

.home-hero-media-frame {
  width: 100%;
  min-height: 240px;
  max-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.home-hero-img {
  width: 100%;
  height: 100%;
  max-height: 380px;
  object-fit: cover;
  display: block;
}

/* Theme-reactive dual image visibility when both light & dark images exist */
.home-hero-img-dark {
  display: none;
}

[data-bs-theme="dark"] .home-hero-img-light {
  display: none;
}

[data-bs-theme="dark"] .home-hero-img-dark {
  display: block;
}

.home-hero-copy-col {
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (min-width: 992px) {
  .home-hero-copy-col {
    padding: 2.5rem 2.75rem;
  }
}

.home-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bs-primary);
  margin-bottom: 0.65rem;
}

.home-hero-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.75rem, 2.6vw, 2.45rem);
  font-weight: 700;
  line-height: 1.18;
  color: var(--bs-body-color);
  margin-bottom: 0.85rem;
}

.home-hero-body {
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--bs-secondary-color);
  max-width: 64ch;
  white-space: pre-line;
  margin-bottom: 1.35rem;
}


/* ==========================================================================
   11. Unified Navigation Logout Button & High Contrast Tab Styles
   ========================================================================== */

/* Prominent Top Navigation Logout Button */
.app-logout-btn {
  border: 1px solid rgba(220, 53, 69, 0.6) !important;
  color: #ffb3b3 !important;
  background-color: rgba(220, 53, 69, 0.15) !important;
  font-weight: 600 !important;
  font-size: 0.84rem !important;
  padding: 0.35rem 0.85rem !important;
  border-radius: 50rem !important;
  text-decoration: none !important;
  transition: all 0.18s ease-in-out !important;
}

.app-logout-btn:hover,
.app-logout-btn:focus {
  background-color: #dc3545 !important;
  border-color: #dc3545 !important;
  color: #ffffff !important;
  box-shadow: 0 0.2rem 0.6rem rgba(220, 53, 69, 0.4) !important;
  transform: translateY(-1px);
}

[data-bs-theme="dark"] .app-logout-btn {
  border-color: rgba(235, 87, 87, 0.7) !important;
  color: #ffc2c2 !important;
  background-color: rgba(220, 53, 69, 0.2) !important;
}

[data-bs-theme="dark"] .app-logout-btn:hover,
[data-bs-theme="dark"] .app-logout-btn:focus {
  background-color: #e03131 !important;
  border-color: #e03131 !important;
  color: #ffffff !important;
}

/* Global Navigation Tabs & Pills Contrast Guarantee */
.nav-tabs {
  border-bottom: 2px solid #decbb7 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 0.35rem !important;
  margin-bottom: 1.5rem !important;
}

.nav-tabs .nav-item {
  margin-bottom: -2px !important;
}

.nav-tabs .nav-link {
  color: #2b1d17 !important;
  background-color: #f5ebe0 !important;
  border: 1px solid #decbb7 !important;
  border-bottom: 2px solid #decbb7 !important;
  padding: 0.55rem 1rem !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  border-radius: 0.5rem 0.5rem 0 0 !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  transition: all 0.15s ease-in-out !important;
}

.nav-tabs .nav-link:hover,
.nav-tabs .nav-link:focus {
  color: #000000 !important;
  background-color: #eeddcc !important;
  border-color: #caa988 !important;
}

.nav-tabs .nav-link.active {
  color: #1e130c !important;
  background-color: #ffffff !important;
  border-color: #decbb7 #decbb7 #ffffff !important;
  border-bottom: 2px solid #ffffff !important;
  box-shadow: 0 -2px 5px rgba(60, 40, 20, 0.08) !important;
}

[data-bs-theme="dark"] .nav-tabs {
  border-bottom-color: #4a3d33 !important;
}

[data-bs-theme="dark"] .nav-tabs .nav-link {
  color: #f3ece2 !important;
  background-color: #2b2520 !important;
  border-color: #4a3d33 !important;
}

[data-bs-theme="dark"] .nav-tabs .nav-link:hover,
[data-bs-theme="dark"] .nav-tabs .nav-link:focus {
  color: #ffffff !important;
  background-color: #383029 !important;
}

[data-bs-theme="dark"] .nav-tabs .nav-link.active {
  color: #ffffff !important;
  background-color: #1a1614 !important;
  border-color: #4a3d33 #4a3d33 #1a1614 !important;
  border-bottom: 2px solid #1a1614 !important;
}

/* Navbar stays at the top while scrolling; its height no longer changes with window width. */
.app-navbar {
  position: sticky;
  top: 0;
  z-index: 1030;
}

.app-navbar .app-nav-links > li.app-nav-off {
  display: none !important;
}

.app-navbar .app-nav-more .dropdown-menu {
  right: 0;
  left: auto;
}

@media (max-width: 767.98px) {
  .app-navbar .app-nav-more {
    display: none !important;
  }
}

/* The signed-in username chip only shows when there is plenty of room. */
@media (max-width: 1499.98px) {
  .app-navbar .app-navbar-actions .navbar-text {
    display: none !important;
  }
}

/* Below 1100px the search box collapses to its button (which opens the search page). */
@media (min-width: 768px) and (max-width: 1099.98px) {
  .app-navbar .app-search-input {
    display: none !important;
  }
}

/* Phones: a slimmer top bar leaves more room for content (the tree in particular). */
@media (max-width: 767.98px) {
  .app-navbar {
    padding-top: 0.3rem !important;
    padding-bottom: 0.3rem !important;
  }
  .app-navbar .app-brand {
    font-size: 1.1rem !important;
  }
  .app-navbar .app-navbar-toggler {
    padding: 0.25rem 0.6rem !important;
  }
}
