:root {
  --fp-primary: #075E5E;
  --fp-secondary: #3c3c3c;
}

html {
  scrollbar-gutter: stable;
}

body {
  background: #f7f8f8;
  color: var(--fp-secondary);
  font-family: DIN Pro, Inter, system-ui, sans-serif;
}

.app-nav .container,
main.container {
  max-width: 1360px;
}

.app-nav {
  background: linear-gradient(135deg, var(--fp-primary), #053f3f);
}

.app-nav .navbar-brand,
.app-nav .nav-link {
  color: #fff;
}

.app-nav-brand img {
  display: block;
  height: 30px;
  width: auto;
}

.app-footer {
  align-items: center;
  color: #8b9494;
  display: flex;
  font-size: .85rem;
  gap: .75rem;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.app-footer img {
  height: auto;
  max-width: 150px;
  opacity: .7;
}

.hero-panel,
.page-head,
.search-panel,
.form-card,
.table-card,
.customer-card-preview,
.benefit-card {
  background: #fff;
  border: 1px solid rgba(7, 94, 94, .08);
  border-radius: 28px;
  box-shadow: 0 18px 55px rgba(7, 94, 94, .08);
}

.hero-panel,
.page-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem;
}

.eyebrow {
  color: var(--fp-primary);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .12em;
  margin-bottom: .35rem;
  text-transform: uppercase;
}

.search-panel,
.form-card {
  margin-top: 1.5rem;
  padding: 1.5rem;
}

.search-panel.compact {
  align-items: center;
  display: flex;
  gap: .75rem;
}

.customer-filter-panel {
  display: grid;
  gap: 1rem;
}

.customer-search-row {
  display: grid;
  gap: .75rem;
  grid-template-columns: 1fr auto;
}

.filter-grid {
  display: grid;
  gap: .9rem;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.filter-grid label {
  color: #526161;
  font-size: .82rem;
  font-weight: 800;
}

.filter-grid .form-select {
  margin-top: .35rem;
}

.customer-results-table {
  table-layout: fixed;
}

.customer-results-table .name-column {
  width: 18%;
}

.customer-results-table .type-column {
  text-align: center;
  width: 64px;
}

.customer-results-table .contact-column {
  width: 24%;
}

.truncate-cell {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plate-badge {
  background: #f2f5f5;
  border: 1px solid #e5ebeb;
  border-radius: 999px;
  color: #314141;
  display: inline-flex;
  font-size: .78rem;
  font-weight: 800;
  margin: .12rem .18rem .12rem 0;
  padding: .28rem .55rem;
  white-space: nowrap;
}

.plate-badge.muted {
  color: #748080;
}

.plate-badge.inactive {
  opacity: .65;
}

.type-icon {
  align-items: center;
  background: #edf4f4;
  border-radius: 999px;
  color: var(--fp-primary);
  display: inline-flex;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.type-icon svg {
  fill: currentColor;
  height: 18px;
  width: 18px;
}

.contact-column span {
  display: block;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tier-badge {
  background: var(--tier-color, var(--fp-primary));
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: .78rem;
  font-weight: 800;
  line-height: 1;
  padding: .42rem .72rem;
  white-space: nowrap;
}

.tier-badge.strong {
  box-shadow: 0 8px 22px rgba(0, 0, 0, .12);
  font-size: .85rem;
  padding: .55rem .85rem;
}

.customer-summary {
  align-items: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--tier-color) 20%, #fff), #fff 58%);
  border: 1px solid color-mix(in srgb, var(--tier-color) 18%, #fff);
  border-left: 8px solid var(--tier-color);
  border-radius: 30px;
  box-shadow: 0 18px 55px rgba(7, 94, 94, .08);
  display: flex;
  gap: 1.5rem;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding: 2rem;
}

.customer-summary h1 {
  margin-bottom: .75rem;
}

.summary-meta {
  align-items: center;
  color: #475757;
  display: flex;
  flex-wrap: wrap;
  gap: .65rem .9rem;
}

.summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  justify-content: flex-end;
}

.inline-form {
  display: inline-flex;
  margin: 0;
}

.card-created-prompt {
  align-items: center;
  background: #fff;
  border: 1px solid rgba(7, 94, 94, .12);
  border-radius: 24px;
  box-shadow: 0 16px 45px rgba(7, 94, 94, .08);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding: 1.25rem;
}

.customer-card-preview {
  background: radial-gradient(circle at top right, rgba(255,255,255,.24), transparent 35%), linear-gradient(135deg, #075E5E, #1d3131);
  color: #fff;
  min-height: 270px;
  padding: 2rem;
}

.customer-card-preview .tier {
  background: rgba(255,255,255,.16);
  border-radius: 999px;
  display: inline-block;
  font-weight: 700;
  padding: .35rem .85rem;
}

.vehicle-row {
  border-bottom: 1px solid #edf1f1;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  padding: .65rem 0;
}

.vehicle-row span,
.vehicle-row small {
  color: #6f7c7c;
  display: block;
}

.vehicle-row.inactive {
  opacity: .62;
}

.vehicle-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: flex-end;
}

.vehicle-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin-top: .9rem;
}

.benefit-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.benefit-toolbar {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.benefit-search-form {
  display: grid;
  gap: .65rem;
  grid-template-columns: minmax(180px, 1fr) minmax(170px, auto) auto;
  min-width: min(100%, 560px);
}

.benefit-card {
  padding: 1.2rem;
}

.benefit-code {
  color: var(--fp-primary);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .08em;
  margin-bottom: .35rem;
}

.vehicle-benefit-status {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: .85rem 0;
}

.benefit-card.redeemed {
  opacity: .72;
}

.status-pill {
  border-radius: 999px;
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  margin-bottom: .8rem;
  padding: .3rem .7rem;
}

.available .status-pill { background: #dff5ee; color: #0f6b49; }
.redeemed .status-pill { background: #eceff1; color: #5d6668; }
.not_available .status-pill { background: #fff0d8; color: #8a5a00; }

.step {
  color: var(--fp-primary);
  font-weight: 800;
  margin: 1.5rem 0 .75rem;
}

.print-toolbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.print-sheet {
  display: grid;
  gap: 1.2rem;
  justify-content: center;
}

.card-side {
  background: #fff;
  border-radius: 18px;
  padding: .5rem;
}

.member-card {
  aspect-ratio: 85.6 / 54;
  background: linear-gradient(135deg, var(--tier-primary), #182020);
  border-radius: 18px;
  color: #fff;
  height: 340px;
  overflow: hidden;
  padding: 2rem;
  position: relative;
  width: 540px;
}

.member-card::after {
  background: radial-gradient(circle, rgba(255,255,255,.2), transparent 58%);
  content: "";
  height: 320px;
  position: absolute;
  right: -120px;
  top: -110px;
  width: 320px;
}

.card-logo,
.back-title {
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: .14em;
}

.card-tier {
  background: rgba(255,255,255,.18);
  border-radius: 999px;
  display: inline-block;
  font-weight: 800;
  margin-top: 2rem;
  padding: .35rem .9rem;
}

.card-name {
  bottom: 5.1rem;
  font-size: 2rem;
  font-weight: 800;
  left: 2rem;
  position: absolute;
}

.card-number {
  bottom: 3.6rem;
  left: 2rem;
  position: absolute;
}

.card-meta {
  bottom: 1.8rem;
  font-size: .85rem;
  left: 2rem;
  opacity: .82;
  position: absolute;
}

.card-plates {
  bottom: 1.8rem;
  position: absolute;
  right: 2rem;
}

.card-plates span {
  background: rgba(255,255,255,.14);
  border-radius: 8px;
  margin-left: .35rem;
  padding: .25rem .5rem;
}

.member-card.back p {
  max-width: 370px;
  margin-top: 1.5rem;
}

.back-footer {
  bottom: 2rem;
  font-size: .85rem;
  opacity: .75;
  position: absolute;
}

@media print {
  .app-nav,
  .app-footer,
  .print-toolbar {
    display: none !important;
  }
  body {
    background: #fff;
  }
  .container {
    max-width: none;
  }
  .card-side {
    break-inside: avoid;
    box-shadow: none;
  }
}

@media (max-width: 768px) {
  .hero-panel,
  .page-head,
  .search-panel.compact {
    align-items: stretch;
    flex-direction: column;
  }
}

.btn-primary {
  --bs-btn-bg: var(--fp-primary);
  --bs-btn-border-color: var(--fp-primary);
  --bs-btn-hover-bg: #064f4f;
  --bs-btn-hover-border-color: #064f4f;
}

.login-shell {
  min-height: 85vh;
  display: grid;
  place-items: center;
  padding: 2rem 0;
}

.login-card {
  width: min(460px, 100%);
  padding: 2.35rem;
  background: #fff;
  border: 1px solid rgba(7, 94, 94, .08);
  border-radius: 30px;
  box-shadow: 0 28px 70px rgba(7, 94, 94, 0.13);
}

.login-brand {
  border-bottom: 1px solid #edf1f1;
  margin-bottom: 1.65rem;
  padding-bottom: 1.35rem;
}

.login-kfz-logo {
  display: block;
  height: auto;
  max-width: 260px;
  width: 78%;
}

.login-brand p {
  color: #05143A;
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .1em;
  margin: 1rem 0 0;
  text-transform: uppercase;
}

.login-card h1 {
  color: #253131;
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: .35rem;
}

.login-intro {
  margin-bottom: 1.5rem;
}

.login-form {
  display: grid;
  gap: 1rem;
}

.login-field {
  display: grid;
  gap: .4rem;
}

.login-field .form-label {
  color: #2d3b3b;
  font-size: .9rem;
  font-weight: 700;
  margin-bottom: 0;
}

.login-field .form-control {
  border-color: #dde6e6;
  border-radius: 14px;
  min-height: 48px;
  width: 100%;
}

.login-field .form-control:focus {
  border-color: var(--fp-primary);
  box-shadow: 0 0 0 .2rem rgba(7, 94, 94, .12);
}

.login-form .btn {
  border-radius: 14px;
  font-weight: 800;
  min-height: 48px;
  margin-top: .35rem;
}

.login-footer-brand {
  align-items: center;
  border-top: 1px solid #edf1f1;
  display: flex;
  gap: .85rem;
  justify-content: flex-end;
  margin-top: 1.6rem;
  padding-top: 1rem;
}

.login-footer-brand span {
  color: #7d8989;
  font-size: .78rem;
  white-space: nowrap;
}

.login-footer-brand img {
  height: auto;
  max-width: 155px;
  opacity: .75;
}

@media (max-width: 520px) {
  .login-card {
    padding: 1.55rem;
    border-radius: 24px;
  }
  .login-kfz-logo {
    width: 88%;
  }
  .login-footer-brand {
    align-items: flex-start;
    flex-direction: column;
  }
}

.customer-type-toggle {
  background: #eef4f4;
  border-radius: 16px;
  display: grid;
  gap: .35rem;
  grid-template-columns: 1fr 1fr;
  padding: .35rem;
}

#generate-customer-number {
  white-space: nowrap;
}

.support-list {
  display: grid;
  gap: .35rem .9rem;
  grid-template-columns: auto 1fr;
  margin-bottom: 0;
}

.support-list dt {
  color: #627070;
}

.support-list dd {
  margin-bottom: .35rem;
}

.download-list {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.toggle-option {
  cursor: pointer;
  margin: 0;
  position: relative;
}

.toggle-option input {
  opacity: 0;
  position: absolute;
}

.toggle-option span {
  border-radius: 12px;
  color: #516060;
  display: block;
  font-weight: 800;
  padding: .8rem 1rem;
  text-align: center;
}

.toggle-option input:checked + span {
  background: #fff;
  box-shadow: 0 10px 22px rgba(7, 94, 94, .12);
  color: var(--fp-primary);
}

@media (max-width: 992px) {
  .filter-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
  .benefit-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .benefit-search-form {
    grid-template-columns: 1fr;
    min-width: 100%;
  }
  .customer-summary {
    align-items: stretch;
    flex-direction: column;
  }
  .summary-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .customer-search-row,
  .filter-grid {
    grid-template-columns: 1fr;
  }
  .customer-summary {
    padding: 1.4rem;
  }
  .card-created-prompt {
    align-items: stretch;
    flex-direction: column;
  }
}
