:root {
  --gbn-bg: #f7f3ef;
  --gbn-surface: #ffffff;
  --gbn-surface-2: #fff8f3;
  --gbn-text: #241f21;
  --gbn-muted: #746c6d;
  --gbn-border: #eadeda;
  --gbn-red: #b4162a;
  --gbn-red-dark: #850f1e;
  --gbn-red-soft: #fff0f2;
  --gbn-ink: #1f2933;
  --gbn-green: #147a5c;
  --gbn-shadow: 0 18px 45px rgba(75, 28, 33, 0.08);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

body {
  background: radial-gradient(circle at 12% 8%, rgba(180, 22, 42, 0.08), transparent 26rem), linear-gradient(180deg, #fffaf7 0%, var(--gbn-bg) 36rem);
  color: var(--gbn-text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}

a { color: var(--gbn-red); }

:focus-visible {
  outline: 3px solid rgba(180, 22, 42, 0.45);
  outline-offset: 3px;
}

img,
svg {
  max-width: 100%;
}

.site-shell {
  min-height: calc(100vh - 86px);
  padding-top: 2rem;
  padding-bottom: 4rem;
}

.gbn-navbar {
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(234, 222, 218, 0.85);
  backdrop-filter: blur(14px);
}

.navbar-brand {
  align-items: center;
  color: var(--gbn-text) !important;
  display: inline-flex;
  font-weight: 800;
  gap: 0.6rem;
  min-width: 0;
}

.navbar-brand span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-mark {
  align-items: center;
  background: linear-gradient(135deg, var(--gbn-red), #e4574f);
  border-radius: 0.8rem;
  color: #fff;
  display: inline-flex;
  font-size: 0.9rem;
  font-weight: 800;
  height: 2.4rem;
  justify-content: center;
  width: 2.4rem;
}

.navbar .nav-link {
  border-radius: 999px;
  color: #50494b !important;
  font-size: 0.95rem;
  font-weight: 650;
  padding: 0.55rem 0.85rem !important;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus,
.navbar .nav-link.active {
  background: var(--gbn-red-soft);
  color: var(--gbn-red-dark) !important;
}

.navbar .nav-link.active {
  box-shadow: inset 0 0 0 1px rgba(180, 22, 42, 0.18);
}

.navbar-toggler {
  border: 1px solid var(--gbn-border);
}

.navbar-toggler-icon {
  background-image: var(--bs-navbar-toggler-icon-bg);
  filter: invert(15%) sepia(19%) saturate(528%) hue-rotate(299deg) brightness(88%) contrast(87%);
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 0.2rem rgba(180, 22, 42, 0.15);
}

.btn {
  border-radius: 0.75rem;
  font-weight: 750;
  min-height: 2.45rem;
  white-space: normal;
}

.btn-danger {
  background: linear-gradient(135deg, var(--gbn-red), var(--gbn-red-dark));
  border-color: var(--gbn-red);
  box-shadow: 0 12px 24px rgba(180, 22, 42, 0.18);
}

.btn-danger:hover,
.btn-danger:focus {
  background: var(--gbn-red-dark);
  border-color: var(--gbn-red-dark);
}

.btn-outline-danger {
  border-color: rgba(180, 22, 42, 0.35);
  color: var(--gbn-red-dark);
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
  background: var(--gbn-red);
  border-color: var(--gbn-red);
}

.btn-outline-secondary,
.btn-outline-dark {
  background: #fff;
  border-color: var(--gbn-border);
  color: var(--gbn-ink);
}

.btn-outline-secondary:hover,
.btn-outline-dark:hover,
.btn-outline-secondary:focus,
.btn-outline-dark:focus {
  background: var(--gbn-ink);
  border-color: var(--gbn-ink);
  color: #fff;
}

.page-kicker {
  color: var(--gbn-red);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.page-title {
  color: var(--gbn-text);
  font-size: clamp(2rem, 4vw, 4.5rem);
  font-weight: 800;
  line-height: 0.98;
  margin-bottom: 1rem;
  max-width: 13ch;
  overflow-wrap: anywhere;
}

.page-lead {
  color: var(--gbn-muted);
  font-size: 1.08rem;
  line-height: 1.65;
  max-width: 48rem;
  overflow-wrap: anywhere;
}

.app-header {
  align-items: end;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.app-title {
  color: var(--gbn-text);
  font-size: clamp(1.8rem, 3vw, 2.75rem);
  font-weight: 800;
  line-height: 1;
  margin: 0;
}

.hero-section {
  align-items: end;
  background: linear-gradient(90deg, rgba(36, 31, 33, 0.82) 0%, rgba(36, 31, 33, 0.5) 45%, rgba(36, 31, 33, 0.12) 100%), url("https://images.unsplash.com/photo-1615461066159-fea0960485d5?auto=format&fit=crop&w=1800&q=80") center/cover;
  border-radius: 1.5rem;
  color: #fff;
  display: flex;
  min-height: min(70vh, 620px);
  overflow: hidden;
  padding: clamp(2rem, 5vw, 4rem);
  box-shadow: var(--gbn-shadow);
}

.hero-section .page-title,
.hero-section .page-lead { color: #fff; }

.hero-panel {
  max-width: 48rem;
  min-width: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.hero-metrics {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 2rem;
  max-width: 42rem;
}

.metric-item {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0.9rem;
  padding: 0.9rem;
}

.metric-value {
  display: block;
  font-size: 1.45rem;
  font-weight: 800;
}

.metric-label {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.83rem;
}

.section-band { margin-top: 2rem; }

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

.feature-grid > *,
.flow-steps > *,
.stat-grid > *,
.hero-metrics > * {
  min-width: 0;
}

.gbn-card,
.card {
  background: var(--gbn-surface);
  border: 1px solid var(--gbn-border);
  border-radius: 0.8rem;
  box-shadow: 0 14px 30px rgba(56, 28, 31, 0.06);
}

.gbn-card { padding: 1.25rem; }

.card-title,
.gbn-card-title {
  color: var(--gbn-text);
  font-weight: 800;
}

.gbn-card p,
.card-text { color: var(--gbn-muted); }

.form-control,
.form-select {
  border-color: var(--gbn-border);
  border-radius: 0.75rem;
  min-height: 2.8rem;
  width: 100%;
}

textarea.form-control {
  min-height: 8rem;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(180, 22, 42, 0.5);
  box-shadow: 0 0 0 0.22rem rgba(180, 22, 42, 0.12);
}

.form-label {
  color: var(--gbn-ink);
  font-size: 0.9rem;
  font-weight: 750;
}

.form-check-input:checked {
  background-color: var(--gbn-red);
  border-color: var(--gbn-red);
}

.gbn-form-panel,
.search-panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--gbn-border);
  border-radius: 1rem;
  box-shadow: var(--gbn-shadow);
  padding: clamp(1rem, 3vw, 1.5rem);
}

.search-grid {
  align-items: end;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(8rem, 0.8fr) minmax(0, 3.2fr) minmax(8rem, 0.8fr) minmax(5rem, 0.45fr);
}

.search-location {
  min-width: 0;
}

.search-check {
  align-items: center;
  display: flex;
  min-height: 2.8rem;
}

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

.gbn-location-group > div {
  min-width: 0;
}

.flow-steps {
  clear: both;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  margin-bottom: 2rem;
}

.flow-steps + .alert,
.flow-steps + .gbn-form-panel,
.flow-steps + .alert + .gbn-form-panel {
  margin-top: 0.5rem;
}

.flow-step {
  background: #fff;
  border: 1px solid var(--gbn-border);
  border-radius: 0.9rem;
  color: var(--gbn-muted);
  display: block;
  min-width: 0;
  padding: 0.9rem;
  overflow-wrap: anywhere;
  word-break: normal;
}

.flow-step strong {
  color: var(--gbn-text);
  display: inline;
  font-size: 0.95rem;
  line-height: 1.3;
  white-space: normal;
}

.flow-step strong::after {
  content: " ";
}

.flow-step span {
  display: inline;
  line-height: 1.5;
  white-space: normal;
  word-break: normal;
}

.flow-step.active {
  background: var(--gbn-red-soft);
  border-color: rgba(180, 22, 42, 0.25);
  color: var(--gbn-red-dark);
}

.form-help {
  color: var(--gbn-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.alert {
  border-radius: 0.9rem;
  border-width: 1px;
}

.alert-info {
  background: #edf7fb;
  border-color: #c7e8f4;
  color: #24566a;
}

.alert-warning {
  background: #fff7e9;
  border-color: #f6dfb5;
  color: #6f4d14;
}

.table-responsive {
  background: #fff;
  border: 1px solid var(--gbn-border);
  border-radius: 1rem;
  box-shadow: 0 14px 30px rgba(56, 28, 31, 0.05);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table { margin-bottom: 0; }

.table th,
.table td {
  vertical-align: middle;
}

.table thead th {
  background: var(--gbn-surface-2);
  border-bottom: 1px solid var(--gbn-border);
  color: #5c5153;
  font-size: 0.76rem;
  padding-bottom: 0.85rem;
  padding-top: 0.85rem;
  text-transform: uppercase;
}

.table tbody td {
  border-color: #f1e8e4;
  padding-bottom: 0.9rem;
  padding-top: 0.9rem;
}

.blood-badge {
  align-items: center;
  background: var(--gbn-red-soft);
  border: 1px solid rgba(180, 22, 42, 0.18);
  border-radius: 999px;
  color: var(--gbn-red-dark);
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-width: 3rem;
  padding: 0.35rem 0.65rem;
}

.status-pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.2;
  padding: 0.35rem 0.65rem;
  white-space: nowrap;
}

.status-pill.available,
.status-pill.active,
.status-pill.approved,
.status-pill.matched,
.status-pill.fulfilled {
  background: #e9f7f2;
  color: var(--gbn-green);
}

.status-pill.pending,
.status-pill.urgent {
  background: #fff5dc;
  color: #866111;
}

.status-pill.suspended,
.status-pill.rejected,
.status-pill.cancelled,
.status-pill.expired,
.status-pill.critical {
  background: #fff0f2;
  color: var(--gbn-red-dark);
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.dashboard-actions .btn {
  flex: 0 1 auto;
}

.dashboard-hero {
  align-items: stretch;
  background: linear-gradient(135deg, #2b2023 0%, #8f1222 56%, #d85049 100%);
  border-radius: 1.1rem;
  color: #fff;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1.5fr) minmax(16rem, 0.7fr);
  margin-bottom: 1.25rem;
  overflow: hidden;
  padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: var(--gbn-shadow);
}

.dashboard-hero h2 {
  font-size: clamp(1.8rem, 3vw, 3rem);
  font-weight: 800;
  line-height: 1.05;
  margin: 0 0 0.75rem;
}

.dashboard-hero p {
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.65;
  margin: 0;
  max-width: 42rem;
}

.dashboard-hero-panel {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0.95rem;
  padding: 1rem;
}

.dashboard-summary {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1.25rem;
}

.summary-card {
  background: #fff;
  border: 1px solid var(--gbn-border);
  border-radius: 0.95rem;
  box-shadow: 0 14px 30px rgba(56, 28, 31, 0.06);
  min-width: 0;
  padding: 1rem;
}

.summary-label {
  color: var(--gbn-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.summary-value {
  color: var(--gbn-text);
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.25;
  margin-top: 0.35rem;
  overflow-wrap: anywhere;
}

.dashboard-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.15fr) minmax(18rem, 0.85fr);
}

.detail-list {
  display: grid;
  gap: 0.85rem;
}

.detail-row {
  align-items: start;
  border-bottom: 1px solid #f1e8e4;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(8rem, 0.45fr) minmax(0, 1fr);
  padding-bottom: 0.85rem;
}

.detail-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.detail-label {
  color: var(--gbn-muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.detail-value {
  color: var(--gbn-text);
  font-weight: 650;
  min-width: 0;
  overflow-wrap: anywhere;
}

.request-list {
  display: grid;
  gap: 0.75rem;
}

.request-item {
  border: 1px solid var(--gbn-border);
  border-radius: 0.8rem;
  padding: 0.9rem;
}

.request-item-title {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
}

.request-meta {
  color: var(--gbn-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-top: 0.45rem;
}

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

.donor-card {
  background: #fff;
  border: 1px solid var(--gbn-border);
  border-radius: 1rem;
  box-shadow: 0 14px 30px rgba(56, 28, 31, 0.06);
  min-width: 0;
  overflow: hidden;
}

.donor-card-main {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 1.1rem;
}

.donor-card-title {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.donor-name {
  color: var(--gbn-text);
  font-size: 1.1rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.donor-meta {
  color: var(--gbn-muted);
  display: grid;
  gap: 0.35rem;
  font-size: 0.92rem;
  line-height: 1.45;
}

.donor-card-actions {
  align-items: end;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  justify-content: space-between;
}

.donor-card-details {
  background: var(--gbn-surface-2);
  border-top: 1px solid var(--gbn-border);
  padding: 1rem 1.1rem;
}

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

.donor-detail-item {
  min-width: 0;
}

.donor-detail-label {
  color: var(--gbn-muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.donor-detail-value {
  color: var(--gbn-text);
  font-weight: 700;
  margin-top: 0.2rem;
  overflow-wrap: anywhere;
}

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

.stat-card {
  background: #fff;
  border: 1px solid var(--gbn-border);
  border-radius: 0.9rem;
  box-shadow: 0 14px 30px rgba(56, 28, 31, 0.06);
  padding: 1.1rem;
}

.stat-label {
  color: var(--gbn-muted);
  font-size: 0.78rem;
  font-weight: 800;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.stat-value {
  color: var(--gbn-text);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  margin-top: 0.35rem;
}

.list-group {
  border-radius: 0.9rem;
  box-shadow: var(--gbn-shadow);
  overflow: hidden;
}

.list-group-item {
  border-color: var(--gbn-border);
  font-weight: 750;
  overflow-wrap: anywhere;
  padding: 1rem 1.1rem;
}

.list-group-item:hover {
  background: var(--gbn-red-soft);
  color: var(--gbn-red-dark);
}

.site-footer {
  background: #fff;
  border-top: 1px solid var(--gbn-border);
}

@media (max-width: 1199.98px) {
  .navbar-collapse {
    background: #fff;
    border: 1px solid var(--gbn-border);
    border-radius: 1rem;
    margin-top: 0.75rem;
    padding: 0.75rem;
  }
}

@media (max-width: 991.98px) {

  .feature-grid,
  .stat-grid,
  .dashboard-summary,
  .dashboard-grid,
  .dashboard-hero {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .dashboard-hero,
  .donor-results {
    grid-template-columns: 1fr;
  }

  .search-grid {
    grid-template-columns: 1fr;
  }

  .gbn-location-group {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767.98px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .site-shell {
    padding-bottom: 2.5rem;
    padding-top: 1rem;
  }

  .navbar-brand {
    max-width: calc(100vw - 6rem);
  }

  .brand-mark {
    border-radius: 0.65rem;
    height: 2rem;
    width: 2rem;
  }

  .hero-section {
    border-radius: 1rem;
    min-height: auto;
    padding-bottom: 2rem;
    padding: 1.25rem;
  }

  .hero-actions .btn,
  .dashboard-actions .btn,
  .gbn-form-panel .btn,
  .search-panel .btn {
    width: 100%;
  }

  .hero-metrics {
    margin-top: 1rem;
  }

  .hero-metrics,
  .feature-grid,
  .stat-grid,
  .dashboard-summary,
  .flow-steps {
    grid-template-columns: 1fr;
  }

  .detail-row {
    gap: 0.25rem;
    grid-template-columns: 1fr;
  }

  .donor-card-main {
    grid-template-columns: 1fr;
  }

  .donor-card-actions {
    align-items: stretch;
  }

  .donor-detail-grid {
    grid-template-columns: 1fr;
  }

  .page-title {
    font-size: 2.25rem;
    line-height: 1.05;
    max-width: 100%;
  }

  .app-title {
    font-size: 1.8rem;
    line-height: 1.08;
  }

  .page-lead {
    font-size: 1rem;
    line-height: 1.55;
  }

  .gbn-form-panel,
  .search-panel {
    padding: 1rem;
  }

  .table {
    min-width: 720px;
  }

  .table thead th,
  .table tbody td {
    white-space: nowrap;
  }

  .footer-inner {
    gap: 0.4rem;
    flex-direction: column;
  }

  .app-header {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .page-title {
    font-size: 1.95rem;
  }

  .navbar-brand span:last-child {
    max-width: 12rem;
  }

  .metric-item,
  .flow-step,
  .gbn-card,
  .stat-card {
    padding: 0.85rem;
  }
}
