:root {
  --fk-border: #e9ecef;
  --navy: #001223;
  --soft-bg: #f5f7fb;
  --fk-gold: #ffd21f;
  --fk-gold-dark: #c99700;
  --card-border: #e9edf5;
}

html,
body {
  min-height: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--soft-bg);
  color: #1f2937;
}

main {
  flex: 1 0 auto;
}

a {
  text-decoration: none;
}

.bg-navy {
  background: var(--navy) !important;
}

.client-portal-navbar.navbar.bg-navy {
  background-color: #001223 !important;
  box-shadow: none !important;
  border-bottom: 1px solid rgba(255, 210, 31, .18);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  min-width: 0;
}

.navbar-brand-logo {
  height: 34px;
  width: auto;
  max-width: 210px;
  object-fit: contain;
  display: block;
  background-color: #001223;
  border-radius: 0;
}

.brand-text {
  font-weight: 800;
  letter-spacing: .01em;
  color: #ffffff;
  white-space: nowrap;
  font-size: 1.05rem;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .25);
}

.navbar .nav-link {
  color: rgba(255, 255, 255, .74) !important;
  font-weight: 600;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus,
.navbar .nav-link.active {
  color: var(--fk-gold) !important;
}

.user-dropdown-wrap {
  white-space: nowrap;
}

.user-display-name {
  color: rgba(255, 255, 255, .88) !important;
  font-size: .92rem;
  font-weight: 600;
  min-width: 0;
  max-width: min(440px, calc(100vw - 130px));
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

.user-phone {
  color: rgba(255, 255, 255, .72);
  font-weight: 500;
}

.user-menu-toggle {
  max-width: min(520px, 100%);
  min-height: 36px;
  border: 0;
  background: transparent;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: .55rem;
  padding: 0;
}

.user-menu-toggle:hover,
.user-menu-toggle:focus {
  background: transparent;
  color: #ffffff;
  box-shadow: none;
}

.user-menu-toggle::after {
  display: none;
}

.user-avatar-icon {
  width: 34px;
  height: 34px;
  border-radius: .55rem;
  border: 1px solid rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .10);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.user-menu-toggle:hover .user-avatar-icon,
.user-menu-toggle:focus .user-avatar-icon {
  background: rgba(255, 255, 255, .20);
  border-color: rgba(255, 255, 255, .65);
}

.user-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .10);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.user-icon-btn:hover,
.user-icon-btn:focus {
  background: rgba(255, 255, 255, .20);
  border-color: rgba(255, 255, 255, .65);
  color: #ffffff;
}

.user-icon-btn::after {
  display: none;
}

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

.user-menu-dropdown {
  min-width: 205px;
  border: 0;
  border-radius: .75rem;
  overflow: hidden;
}

.app-footer {
  flex-shrink: 0;
  border-top: 1px solid #dbe3ef;
  background: #ffffff;
  color: #475569;
  font-size: .88rem;
  font-weight: 500;
  letter-spacing: .01em;
  padding: 13px 0;
  box-shadow: 0 -1px 8px rgba(15, 23, 42, .03);
}

.footer-brand {
  color: #0b223f;
  font-weight: 700;
}

.footer-separator {
  color: #c59a00;
  margin: 0 10px;
  font-weight: 700;
}

.login-shell {
  min-height: calc(100vh - 130px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-hero {
  min-height: calc(100vh - 160px);
}

.login-card {
  width: 100%;
  max-width: none;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, .08) !important;
}

.login-brand-panel {
  background: var(--navy);
  padding: 2rem 1.5rem 1.6rem;
  color: #ffffff;
  border-bottom: 4px solid var(--fk-gold);
}

.login-logo {
  max-width: 390px;
  width: 92%;
  height: auto;
  filter: none;
}

.login-app-title {
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: .02em;
  color: #ffffff;
}

.login-app-subtitle {
  color: rgba(255, 255, 255, .76);
  font-size: .92rem;
  margin-top: .2rem;
}

.login-heading {
  color: #0f172a;
}

.btn-gold {
  background: linear-gradient(135deg, var(--fk-gold), #f4b400);
  border-color: #eab308;
  color: #061525;
  font-weight: 800;
  box-shadow: 0 .35rem .9rem rgba(234, 179, 8, .22);
}

.btn-gold:hover,
.btn-gold:focus {
  background: linear-gradient(135deg, #ffde4a, #e6a700);
  border-color: var(--fk-gold-dark);
  color: #061525;
}

.summary-pill,
.mini-box,
.stat-card {
  background: #fff;
  border: 1px solid var(--fk-border);
  padding: .85rem 1rem;
}

.case-card {
  transition: transform .12s ease, box-shadow .12s ease;
}

.case-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 .5rem 1.25rem rgba(0, 0, 0, .08) !important;
}

.min-w-0 {
  min-width: 0;
}

.text-truncate-lg {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.table th {
  white-space: nowrap;
}

.table td,
.table th,
.table > :not(caption) > * > * {
  vertical-align: top !important;
}

.btn {
  border-radius: .55rem;
}

.btn-primary {
  background-color: var(--navy);
  border-color: var(--navy);
}

.btn-primary:hover {
  background-color: #17345f;
  border-color: #17345f;
}

.card,
.stat-card,
.mini-box,
.summary-pill,
.alert {
  border-radius: 0;
}

.login-card.rounded-4,
.login-card {
  border-radius: 1rem !important;
}

.login-card.overflow-hidden {
  overflow: hidden;
}

@media (max-width: 991.98px) {
  .navbar-brand-logo {
    height: 30px;
    max-width: 160px;
  }

  .brand-text {
    font-size: .92rem;
  }

  .user-dropdown-wrap {
    width: 100%;
    margin-top: .75rem;
    padding-top: .75rem;
    border-top: 1px solid rgba(255, 255, 255, .14);
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: .5rem;
    position: relative;
  }

  .navbar-collapse .user-dropdown-wrap .dropdown {
    position: static;
  }

  .navbar-collapse .user-menu-dropdown {
    position: static !important;
    transform: none !important;
    inset: auto !important;
    width: 100%;
    max-width: 275px;
    margin-top: .6rem;
    border-radius: .75rem;
    box-shadow: 0 .5rem 1.25rem rgba(0, 0, 0, .18) !important;
  }

  .navbar-collapse .user-menu-dropdown .dropdown-item,
  .navbar-collapse .user-menu-dropdown .dropdown-header {
    white-space: normal;
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media (max-width: 575.98px) {
  .display-6 {
    font-size: 2rem;
  }

  .container-fluid {
    padding-left: .85rem !important;
    padding-right: .85rem !important;
  }

  .brand-lockup {
    gap: .45rem;
  }

  .brand-text {
    display: inline-block;
    font-size: .82rem;
    letter-spacing: 0;
  }

  .navbar-brand-logo {
    max-width: 145px;
    height: 30px;
  }

  .app-footer {
    font-size: .82rem;
  }

  .footer-separator {
    margin: 0 5px;
  }

  .login-hero {
    min-height: auto;
    margin-top: .5rem;
  }

  .login-brand-panel {
    padding: 1.5rem 1rem 1.25rem;
  }

  .login-logo {
    width: 96%;
  }

  .login-app-title {
    font-size: .96rem;
  }
}

.payment-shell {
  min-height: calc(100vh - 150px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 0 3rem;
}

.payment-card {
  width: 100%;
  max-width: 580px;
  border-radius: 1.15rem;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, .08) !important;
}

.payment-header {
  border-bottom: 1px solid #edf1f7;
  padding-bottom: 1rem;
}

.payment-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .25rem .7rem;
  border-radius: 999px;
  background: #eef6ff;
  color: #0f4c81;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  margin-bottom: .75rem;
}

.payment-case-title {
  color: #64748b;
  font-size: .95rem;
  line-height: 1.45;
}

.payment-summary-box {
  text-align: center;
  border: 1px solid #edf1f7;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border-radius: 1rem;
  padding: 1.25rem 1rem;
}

.payment-payable-amount {
  color: #dc3545;
  font-size: clamp(2rem, 6vw, 2.65rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: .01em;
}

.payment-input-group .input-group-text {
  min-width: 52px;
  justify-content: center;
  background: #f8fafc;
  font-weight: 700;
}

.payment-input-group .form-control {
  font-weight: 700;
}

@media (max-width: 576px) {
  .payment-shell {
    padding: 1rem 0 2rem;
  }

  .payment-card {
    border-radius: .9rem;
  }
}

.payment-breakup {
  border: 1px solid #e7edf5;
  border-radius: 1rem;
  background: #ffffff;
  overflow: hidden;
}

.payment-breakup-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid #edf1f7;
  color: #475569;
  font-size: .94rem;
}

.payment-breakup-row:last-child {
  border-bottom: 0;
}

.payment-breakup-row strong {
  color: #0f172a;
  white-space: nowrap;
}

.payment-breakup-total {
  background: #f8fafc;
  color: #0f172a;
  font-weight: 800;
}

.payment-breakup-total strong {
  color: #198754;
  font-size: 1.08rem;
}

.receipt-charge-lines {
  line-height: 1.5;
}

.receipt-charge-lines strong {
  color: #334155;
}

@media (max-width: 576px) {
  .payment-breakup-row {
    align-items: flex-start;
    flex-direction: column;
    gap: .2rem;
  }
}

.receipt-download-link {
    color: #0f5132;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px dashed rgba(15, 81, 50, 0.45);
}

.receipt-download-link:hover,
.receipt-download-link:focus {
    color: #0a3622;
    border-bottom-style: solid;
    text-decoration: none;
}

.receipt-view-link {
    appearance: none;
    background: transparent;
    border: 0;
    border-bottom: 1px dashed rgba(15, 81, 50, 0.45);
    color: #0f5132;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 0;
    text-decoration: none;
}

.receipt-view-link:hover,
.receipt-view-link:focus {
    color: #0a3622;
    border-bottom-style: solid;
    outline: none;
}

.receipt-modal-header {
    background: #020d1a;
    border-bottom: 3px solid #facc15;
    color: #ffffff;
    padding: 1rem 1.25rem;
}

.receipt-modal-logo {
    height: 42px;
    max-width: 180px;
    object-fit: contain;
}

.receipt-modal-firm {
    color: #cbd5e1;
    font-size: .9rem;
    line-height: 1.2;
}

.receipt-modal-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 1.25rem;
}

.receipt-modal-meta span {
    color: #64748b;
    display: block;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.receipt-modal-meta strong {
    color: #0f172a;
    display: block;
    font-size: 1rem;
    margin-top: .15rem;
}

.receipt-modal-table th {
    background: #f3f4f6;
    color: #111827;
    font-weight: 700;
    width: 22%;
    white-space: nowrap;
}

.receipt-modal-table td {
    color: #111827;
    width: 28%;
}

.receipt-modal-table th,
.receipt-modal-table td {
    border-color: #d1d5db;
    padding: .7rem .85rem;
    vertical-align: top;
}

.receipt-modal-footer-note {
    color: #6b7280;
    font-size: .9rem;
    padding: 1rem 1.25rem 0;
    text-align: center;
}

@media (max-width: 576px) {
    .receipt-modal-header .d-flex {
        align-items: flex-start !important;
        flex-direction: column;
        gap: .6rem !important;
    }

    .receipt-modal-logo {
        height: 34px;
    }

    .receipt-modal-meta {
        flex-direction: column;
        gap: .55rem;
    }

    .receipt-modal-table th,
    .receipt-modal-table td {
        min-width: 140px;
    }
}
