/* Nexus Customer Portal - GippsHost */

:root {
  --gh-red: #8F1017;
  --gh-red-hover: #6F0D12;
  --gh-red-light: rgba(143, 16, 23, 0.08);
  --gh-red-subtle: rgba(143, 16, 23, 0.04);
  --gh-dark: #111827;
  --gh-sidebar: #0f1420;
  --gh-sidebar-hover: rgba(255, 255, 255, 0.06);
  --gh-sidebar-active: rgba(143, 16, 23, 0.15);
  --gh-sidebar-text: #94a3b8;
  --gh-sidebar-text-active: #ffffff;
  --gh-body-bg: #f1f5f9;
  --gh-card-bg: #ffffff;
  --gh-border: #e2e8f0;
  --gh-text: #1e293b;
  --gh-text-muted: #5c6b7f;
  --gh-sidebar-width: 260px;
  /* Bootstrap theme overrides */
  --bs-primary: #8F1017;
  --bs-primary-rgb: 143, 16, 23;
  --bs-link-color: #8F1017;
  --bs-link-color-rgb: 143, 16, 23;
  --bs-link-hover-color: #6F0D12;
  --bs-link-hover-color-rgb: 111, 13, 18;

  --bs-success: #047857;
  --bs-success-rgb: 4, 120, 87;
  --bs-warning: #b45309;
  --bs-warning-rgb: 180, 83, 9;
  --bs-danger: #dc2626;
  --bs-danger-rgb: 220, 38, 38;
  --bs-info: #0284c7;
  --bs-info-rgb: 2, 132, 199;
  --bs-secondary: #475569;
  --bs-secondary-rgb: 71, 85, 105;

  --bs-body-font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --bs-body-color: #1e293b;
  --bs-body-bg: #f1f5f9;
  --bs-border-color: #e2e8f0;
}

/* ── Base ────────────────────────────── */

html, body {
  height: 100%;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  font-size: 1rem;
  background-color: var(--gh-body-bg);
  color: var(--gh-text);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6,
.nexus-topbar-title,
.stat-value,
.auth-card h1,
.auth-right-content h2 {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.2rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

/* ── Top Loading Bar ──────────────────── */

.nexus-loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--gh-red);
  z-index: 9999;
  opacity: 0;
  transition: width 0.3s ease;
  box-shadow: 0 0 8px rgba(143, 16, 23, 0.4);
}

.nexus-loading-bar.loading {
  width: 70%;
  opacity: 1;
  transition: width 4s cubic-bezier(0.1, 0.5, 0.3, 1), opacity 0.08s ease;
}

.nexus-loading-bar.done {
  width: 100%;
  opacity: 0;
  transition: width 0.15s ease, opacity 0.3s ease 0.15s;
}

/* ── Pull to Refresh ─────────────────── */

.ptr-indicator {
  align-items: center;
  display: flex;
  justify-content: center;
  left: 0;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  right: 0;
  top: 0;
  transform: translateY(-4rem);
  z-index: 9998;
}

.ptr-spinner {
  animation: none;
  border: 2.5px solid var(--gh-border);
  border-radius: 50%;
  border-top-color: var(--gh-red);
  height: 1.75rem;
  width: 1.75rem;
}

.ptr-triggered .ptr-spinner,
.ptr-refreshing .ptr-spinner {
  animation: ptr-spin 0.6s linear infinite;
}

@keyframes ptr-spin {
  to { transform: rotate(360deg); }
}

/* ── Sidebar ─────────────────────────── */

.nexus-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--gh-sidebar-width);
  height: 100vh;
  background: var(--gh-sidebar);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform 0.2s ease;
}

.nexus-sidebar-brand {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand-link {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-height: 36px;
  text-decoration: none;
}

.sidebar-brand-logo {
  height: 32px;
  max-width: 180px;
  width: auto;
}

.nexus-sidebar-nexus {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 1rem 1.5rem 1.25rem;
}

.sidebar-nexus-logo {
  display: block;
  height: auto;
  max-width: 132px;
  opacity: 0.9;
  width: 100%;
}

.nexus-account-switcher {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.75rem 1rem;
}

.nexus-account-current {
  align-items: center;
  display: flex;
  gap: 0.6rem;
}

.nexus-account-icon {
  color: var(--gh-red);
  font-size: 0.85rem;
  flex: 0 0 auto;
  opacity: 0.7;
}

.nexus-account-info {
  min-width: 0;
}

.nexus-account-name {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nexus-account-company {
  color: var(--gh-sidebar-text);
  font-size: 0.75rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nexus-account-switch {
  color: var(--gh-sidebar-text);
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 0.4rem;
  text-decoration: none;
}

.nexus-account-switch:hover {
  color: #fff;
}

.nexus-sidebar-nav {
  flex: 1;
  padding: 0.75rem 0;
  overflow-y: auto;
}

.nexus-sidebar-nav .nav-section {
  padding: 1rem 1.5rem 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
}

.nexus-sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.5rem;
  color: var(--gh-sidebar-text);
  font-size: 0.95rem;
  font-weight: 450;
  text-decoration: none;
  border-radius: 0;
  transition: all 0.12s ease;
}

.nexus-sidebar-nav .nav-link i {
  width: 18px;
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.7;
}

.nexus-sidebar-nav .nav-link:hover {
  color: #ffffff;
  background: var(--gh-sidebar-hover);
}

.nexus-sidebar-nav .nav-link:hover i {
  opacity: 1;
}

.nexus-sidebar-nav .nav-link.active {
  color: var(--gh-sidebar-text-active);
  background: var(--gh-sidebar-active);
  font-weight: 500;
}

.nexus-sidebar-nav .nav-link.active i {
  color: var(--gh-red);
  opacity: 1;
}

/* ── Main Content ────────────────────── */

.nexus-main {
  margin-left: var(--gh-sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.nexus-topbar {
  background: var(--gh-card-bg);
  border-bottom: 1px solid var(--gh-border);
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.nexus-topbar-main {
  align-items: center;
  display: flex;
  gap: 1rem;
  min-width: 0;
}

.nexus-topbar-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gh-text);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nexus-back-button {
  align-items: center;
  background: #fff;
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  color: var(--gh-text);
  display: none;
  flex-shrink: 0;
  font-size: 0.9rem;
  font-weight: 600;
  gap: 0.45rem;
  min-height: 40px;
  padding: 0.45rem 0.75rem;
  text-decoration: none;
  transition: color 0.12s ease, border-color 0.12s ease, background-color 0.12s ease;
}

.nexus-back-button.is-visible {
  display: inline-flex;
}

.nexus-back-button:hover,
.nexus-back-button:focus {
  background: var(--gh-red-light);
  border-color: rgba(143, 16, 23, 0.25);
  color: var(--gh-red);
}

.topbar-user {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  gap: 0.75rem;
}

.topbar-user-meta {
  line-height: 1.2;
  max-width: 260px;
  min-width: 0;
  text-align: right;
}

.topbar-user-name {
  color: var(--gh-text);
  font-size: 0.9rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-user-email {
  color: var(--gh-text-muted);
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-user-avatar {
  align-items: center;
  background: var(--gh-red);
  border-radius: 50%;
  color: #fff;
  display: flex;
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 700;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.topbar-signout {
  align-items: center;
  background: #fff;
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  color: var(--gh-text-muted);
  display: inline-flex;
  font-size: 0.875rem;
  font-weight: 500;
  gap: 0.45rem;
  min-height: 40px;
  padding: 0.45rem 0.75rem;
  text-decoration: none;
  transition: color 0.12s ease, border-color 0.12s ease, background-color 0.12s ease;
}

.topbar-signout:hover,
.topbar-signout:focus {
  background: var(--gh-red-light);
  border-color: rgba(143, 16, 23, 0.25);
  color: var(--gh-red);
}

.nexus-content {
  flex: 1;
  padding: 2rem;
}

.mobile-bottom-nav {
  display: none;
}

/* ── Mobile Sidebar ──────────────────── */

.nexus-sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--gh-text);
  font-size: 1.25rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
}

.nexus-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1035;
}

@media (max-width: 991.98px) {
  .nexus-sidebar {
    transform: translateX(-100%);
  }

  .nexus-sidebar.show {
    transform: translateX(0);
  }

  .nexus-sidebar-overlay.show {
    display: block;
  }

  .nexus-main {
    margin-left: 0;
  }

  .nexus-sidebar-toggle {
    display: block;
  }

  .nexus-content {
    padding: 1.25rem;
  }

  .nexus-topbar {
    padding: 0.75rem 1.25rem;
  }

  .topbar-user-meta {
    max-width: 220px;
  }
}

@media (max-width: 575.98px) {
  html {
    font-size: 106.25%;
  }

  body {
    background-color: var(--gh-red);
    line-height: 1.55;
    overscroll-behavior-y: none;
  }

  body#auth {
    background-color: var(--gh-body-bg);
    overscroll-behavior-y: auto;
  }

  .nexus-main {
    background-color: var(--gh-body-bg);
    min-height: 100dvh;
  }

  .nexus-topbar {
    background: var(--gh-red);
    border-bottom: 0;
    box-shadow: 0 6px 16px rgba(15, 20, 32, 0.14);
    color: #fff;
    min-height: 64px;
    padding: 0.55rem 1rem;
  }

  .nexus-back-button {
    background: rgba(255, 255, 255, 0.18);
    border-color: transparent;
    color: #fff;
    height: 44px;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    padding: 0;
    position: relative;
    z-index: 1;
  }

  .nexus-back-button:hover,
  .nexus-back-button:focus {
    background: rgba(255, 255, 255, 0.28);
    border-color: transparent;
    color: #fff;
  }

  .nexus-back-label {
    display: none;
  }

  .nexus-topbar-main {
    gap: 0.5rem;
    left: 50%;
    position: absolute;
    transform: translateX(-50%);
  }

  .nexus-topbar-title {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    max-width: 58vw;
    text-align: center;
  }

  .topbar-user {
    margin-left: auto;
    gap: 0.5rem;
  }

  .topbar-user-avatar {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    height: 34px;
    width: 34px;
  }

  .topbar-signout {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.32);
    color: #fff;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    padding: 0;
  }

  .topbar-signout:hover,
  .topbar-signout:focus {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
  }

  .nexus-sidebar-toggle {
    display: none;
  }

  .nexus-content {
    padding: 1.25rem 1rem calc(9rem + env(safe-area-inset-bottom));
  }

  .mobile-bottom-nav {
    align-items: center;
    background: var(--gh-red);
    bottom: 0;
    box-shadow: 0 -8px 18px rgba(15, 20, 32, 0.18);
    display: grid;
    gap: 0;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    left: 0;
    min-height: calc(94px + env(safe-area-inset-bottom));
    padding: 0.45rem 0.35rem calc(1.55rem + env(safe-area-inset-bottom));
    position: fixed;
    right: 0;
    z-index: 1045;
  }

  .mobile-bottom-nav-link {
    align-items: center;
    border-radius: 0.75rem;
    color: rgba(255, 255, 255, 0.62);
    display: flex;
    flex-direction: column;
    font-size: 0.72rem;
    font-weight: 600;
    gap: 0.25rem;
    justify-content: center;
    line-height: 1.1;
    min-height: 56px;
    min-width: 0;
    padding: 0.35rem 0.15rem;
    text-align: center;
    text-decoration: none;
  }

  .mobile-bottom-nav-link i {
    font-size: 1.35rem;
    line-height: 1;
  }

  .mobile-bottom-nav-link.active,
  .mobile-bottom-nav-link:focus,
  .mobile-bottom-nav-link:hover {
    color: #fff;
  }

  .mobile-bottom-nav-link.active i {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.18));
  }

  .breadcrumb {
    display: none;
  }

  .card-header {
    padding: 1.05rem 1rem;
  }

  .card-body {
    padding: 1.1rem;
  }

  .card {
    border-radius: 0.85rem;
  }

  .card + .card,
  .row + .card,
  .card + .row {
    margin-top: 1rem;
  }

  .btn,
  .list-group-item-action {
    align-items: center;
    display: inline-flex;
    min-height: 44px;
  }

  .btn {
    justify-content: center;
  }

  .btn.text-start,
  .list-group-item-action {
    justify-content: flex-start;
  }

  .btn-sm {
    min-height: 44px;
    min-width: 44px;
    padding: 0.45rem 0.75rem;
  }

  .form-control,
  .form-select {
    font-size: 1rem !important;
    min-height: 44px;
  }

  .form-label,
  .form-text,
  dt,
  .table,
  .breadcrumb,
  .badge {
    font-size: 0.9rem;
  }
}

/* ── Cards ───────────────────────────── */

.card {
  border: 1px solid var(--gh-border);
  border-radius: 0.75rem;
  background: var(--gh-card-bg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.15s ease;
}

.card:hover {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--gh-border);
  padding: 1rem 1.25rem;
}

.card-body {
  padding: 1.25rem;
}

.card-footer {
  background: transparent;
  border-top: 1px solid var(--gh-border);
  padding: 0.75rem 1.25rem;
}

/* ── Stat Cards ──────────────────────── */

.stat-card {
  border: 1px solid var(--gh-border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  background: var(--gh-card-bg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.stat-card .stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.stat-card .stat-icon.red {
  background: var(--gh-red-light);
  color: var(--gh-red);
}

.stat-card .stat-icon.green {
  background: rgba(16, 185, 129, 0.08);
  color: #10b981;
}

.stat-card .stat-icon.amber {
  background: rgba(245, 158, 11, 0.08);
  color: #f59e0b;
}

.stat-card .stat-icon.blue {
  background: rgba(59, 130, 246, 0.08);
  color: #3b82f6;
}

.stat-card .stat-label {
  font-size: 0.9rem;
  color: var(--gh-text-muted);
  font-weight: 450;
  margin-bottom: 0.15rem;
}

.stat-card .stat-value {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--gh-text);
  line-height: 1.2;
}

/* ── Buttons ─────────────────────────── */

.btn-primary {
  background-color: var(--gh-red);
  border-color: var(--gh-red);
  color: #fff;
}

.btn-primary:hover, .btn-primary:focus {
  background-color: var(--gh-red-hover);
  border-color: var(--gh-red-hover);
  color: #fff;
}

.btn-primary:active,
.btn-primary:first-child:active,
.btn-primary.active,
.btn-primary:active:focus,
.btn-check:checked + .btn-primary,
.btn-check:active + .btn-primary {
  background-color: var(--gh-red-hover) !important;
  border-color: var(--gh-red-hover) !important;
  color: #fff !important;
}

.btn-primary:focus-visible,
.btn-primary.focus {
  box-shadow: 0 0 0 0.25rem rgba(143, 16, 23, 0.25);
}

.btn-primary:disabled,
.btn-primary.disabled {
  background-color: var(--gh-red);
  border-color: var(--gh-red);
  color: #fff;
  opacity: 0.65;
}

.btn-outline-primary {
  color: var(--gh-red);
  border-color: var(--gh-red);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background-color: var(--gh-red);
  border-color: var(--gh-red);
  color: #fff;
}

.btn-outline-primary:active,
.btn-outline-primary:first-child:active,
.btn-outline-primary.active {
  background-color: var(--gh-red-hover) !important;
  border-color: var(--gh-red-hover) !important;
  color: #fff !important;
}

.btn-outline-primary:focus-visible {
  box-shadow: 0 0 0 0.25rem rgba(143, 16, 23, 0.25);
}

/* Secondary/outline buttons */
.btn-outline-secondary:hover {
  background-color: var(--gh-red-light);
  border-color: var(--gh-red);
  color: var(--gh-text);
}

.btn-outline-secondary:active,
.btn-outline-secondary:first-child:active {
  background-color: var(--gh-red-light) !important;
  border-color: var(--gh-red) !important;
  color: var(--gh-text) !important;
}

.btn-outline-secondary:focus-visible {
  box-shadow: 0 0 0 0.25rem rgba(108, 117, 125, 0.25);
}

/* Link color in buttons */
.btn-link {
  color: var(--gh-red);
}

.btn-link:hover {
  color: var(--gh-red-hover);
}

/* ── Tables ──────────────────────────── */

.table {
  font-size: 0.95rem;
}

.table th {
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gh-text-muted);
  border-bottom-width: 1px;
  padding: 0.75rem 1rem;
}

.table td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
  border-color: var(--gh-border);
}

.table-hover tbody tr:hover {
  background-color: var(--gh-red-subtle);
}

.mobile-record-list {
  background: #fff;
}

.mobile-record-item {
  border-bottom: 1px solid var(--gh-border);
  color: var(--gh-text);
  display: block;
  padding: 1rem;
  text-decoration: none;
}

.mobile-record-item:last-child {
  border-bottom: 0;
}

a.mobile-record-item:hover,
button.mobile-record-item:hover,
a.mobile-record-item:focus {
  background: var(--gh-red-subtle);
  color: var(--gh-text);
}

.mobile-record-title {
  color: var(--gh-text);
  font-weight: 600;
  min-width: 0;
}

.mobile-record-meta {
  color: var(--gh-text-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.mobile-record-row {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.mobile-record-label {
  color: var(--gh-text-muted);
  font-size: 0.85rem;
}

.mobile-record-value {
  color: var(--gh-text);
  font-weight: 500;
  text-align: right;
}

.mobile-summary {
  border-top: 1px solid var(--gh-border);
  padding: 1rem;
}

/* ── Badges ──────────────────────────── */

.badge {
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.3em 0.65em;
  border-radius: 100px;
  letter-spacing: 0.015em;
}

.badge-paid, .bg-success { background-color: #047857 !important; }
.badge-unpaid, .bg-warning { background-color: #b45309 !important; color: #fff !important; }
.badge-overdue, .bg-danger { background-color: #dc2626 !important; }
.badge-draft, .bg-secondary { background-color: #6b7280 !important; }
.badge-active { background-color: #059669 !important; }
.badge-pending { background-color: #d97706 !important; color: #fff !important; }
.badge-suspended { background-color: #dc2626 !important; }
.badge-cancelled { background-color: #6b7280 !important; }

/* ── Links ───────────────────────────── */

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

a:hover {
  color: var(--gh-red-hover);
}

/* ── Definition Lists ────────────────── */

dt {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--gh-text-muted);
}

dd {
  color: var(--gh-text);
  margin-bottom: 0.75rem;
}

/* ── Breadcrumb ──────────────────────── */

.breadcrumb {
  font-size: 0.95rem;
  background: none;
  padding: 0;
  margin-bottom: 0;
}

.breadcrumb-item a {
  color: var(--gh-text-muted);
  text-decoration: none;
}

.breadcrumb-item a:hover {
  color: var(--gh-red);
}

.breadcrumb-item.active {
  color: var(--gh-text);
}

/* ── Auth Layout ─────────────────────── */

.auth-wrapper {
  min-height: 100vh;
  display: flex;
}

.auth-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-right {
  display: none;
  width: 45%;
  background: var(--gh-dark);
  position: relative;
  overflow: hidden;
  align-items: center;
  justify-content: center;
}

.auth-right::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 50%, rgba(230, 0, 0, 0.15) 0%, transparent 70%);
}

.auth-right-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 3rem;
  color: #e2e8f0;
  text-align: center;
}

.auth-right-content img {
  height: 40px;
  margin-bottom: 2rem;
}

.auth-right-content h2 {
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.75rem;
}

.auth-right-content p {
  font-size: 1.1rem;
  color: #94a3b8;
  max-width: 380px;
  line-height: 1.6;
}

@media (min-width: 992px) {
  .auth-right {
    display: flex;
  }
}

.auth-mobile-brands {
  align-items: center;
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  margin-bottom: 2rem;
  width: 100%;
}

.auth-mobile-divider {
  background: var(--gh-border);
  flex: 0 0 1px;
  height: 2rem;
  width: 1px;
}

.auth-mobile-nexus {
  height: 32px;
  width: auto;
}

.auth-mobile-gh {
  height: 28px;
  width: auto;
}

@media (min-width: 992px) {
  .auth-mobile-brands {
    display: none;
  }
}

@media (max-width: 991.98px) {
  .auth-card .auth-logo {
    display: none;
  }
}

.auth-card {
  width: 100%;
  max-width: 420px;
}

.auth-card .auth-logo {
  height: 42px;
  margin-bottom: 2rem;
}

.auth-card h1 {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--gh-text);
  margin-bottom: 0.25rem;
}

.auth-card .auth-subtitle {
  color: var(--gh-text-muted);
  margin-bottom: 2rem;
  font-size: 1rem;
}

/* ── Form Controls ───────────────────── */

.form-control,
.form-select {
  background-color: #ffffff;
}

.form-control:focus,
.form-select:focus {
  background-color: #ffffff;
  border-color: var(--gh-red);
  box-shadow: 0 0 0 0.2rem rgba(143, 16, 23, 0.15);
}

/* ── Loading Spinner ─────────────────── */

.spinner-border {
  color: var(--gh-red);
}

.btn .spinner-border {
  color: inherit;
}

.spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 0.15em;
}

/* ── Page Transitions ────────────────── */

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.nexus-content main {
  animation: fadeSlideIn 0.25s ease-out;
}

.card {
  animation: fadeIn 0.2s ease-out;
}

.stat-card {
  animation: fadeSlideIn 0.3s ease-out both;
}

.stat-card:nth-child(1) { animation-delay: 0s; }
.stat-card:nth-child(2) { animation-delay: 0.05s; }
.stat-card:nth-child(3) { animation-delay: 0.1s; }
.stat-card:nth-child(4) { animation-delay: 0.15s; }

.table tbody tr {
  animation: fadeIn 0.2s ease-out both;
}

.table tbody tr:nth-child(1) { animation-delay: 0.05s; }
.table tbody tr:nth-child(2) { animation-delay: 0.08s; }
.table tbody tr:nth-child(3) { animation-delay: 0.11s; }
.table tbody tr:nth-child(4) { animation-delay: 0.14s; }
.table tbody tr:nth-child(5) { animation-delay: 0.17s; }
.table tbody tr:nth-child(n+6) { animation-delay: 0.2s; }

/* Sidebar nav link transitions */
.nexus-sidebar-nav .nav-link {
  transition: all 0.15s ease;
}

/* Card hover lift */
.card {
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
  transform: translateY(-1px);
}

/* Button transitions */
.btn {
  transition: all 0.15s ease;
}

/* Badge transitions */
.badge {
  transition: background-color 0.15s ease;
}

/* Form control transitions */
.form-control,
.form-select {
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Auth page transitions */
.auth-card {
  animation: fadeSlideIn 0.35s ease-out;
}

.auth-right-content {
  animation: fadeIn 0.5s ease-out 0.15s both;
}

/* Service cards stagger */
.col-md-6.col-xl-4:nth-child(1) .card { animation-delay: 0s; }
.col-md-6.col-xl-4:nth-child(2) .card { animation-delay: 0.06s; }
.col-md-6.col-xl-4:nth-child(3) .card { animation-delay: 0.12s; }
.col-md-6.col-xl-4:nth-child(4) .card { animation-delay: 0.18s; }
.col-md-6.col-xl-4:nth-child(5) .card { animation-delay: 0.24s; }
.col-md-6.col-xl-4:nth-child(6) .card { animation-delay: 0.3s; }

/* Loading skeleton pulse */
@keyframes shimmer {
  0% { opacity: 0.6; }
  50% { opacity: 0.3; }
  100% { opacity: 0.6; }
}

.spinner-border {
  animation: spinner-border .65s linear infinite;
}

/* Smooth alert transitions */
.alert {
  animation: fadeSlideIn 0.2s ease-out;
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Misc ────────────────────────────── */

.bg-primary {
  background-color: var(--gh-red) !important;
}

.text-primary {
  color: var(--gh-red) !important;
}

.bg-primary.bg-opacity-10 {
  background-color: var(--gh-red-light) !important;
}

code {
  color: var(--gh-text);
  background: #f1f5f9;
  padding: 0.15em 0.4em;
  border-radius: 0.25rem;
  font-size: 0.875em;
}

.list-group-item-action:hover {
  background-color: var(--gh-red-subtle);
}

/* ── Nav Tabs ────────────────────────── */

.nav-tabs .nav-link {
  color: var(--gh-text-muted);
  border: none;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-tabs .nav-link:hover {
  color: var(--gh-text);
  border: none;
}

.nav-tabs .nav-link.active {
  color: var(--gh-red);
  border: none;
  border-bottom: 2px solid var(--gh-red);
  background: transparent;
}

.nav-tabs {
  border-bottom: 1px solid var(--gh-border);
}

/* ── Bootstrap Global Overrides ──────── */

/* Checkbox and radio */
.form-check-input:checked {
  background-color: var(--gh-red);
  border-color: var(--gh-red);
}

.form-check-input:focus {
  border-color: var(--gh-red);
  box-shadow: 0 0 0 0.2rem rgba(143, 16, 23, 0.15);
}

.form-check-input:checked:focus {
  box-shadow: 0 0 0 0.2rem rgba(143, 16, 23, 0.25);
}

/* Form switch */
.form-switch .form-check-input:checked {
  background-color: var(--gh-red);
  border-color: var(--gh-red);
}

/* Dropdown */
.dropdown-item.active,
.dropdown-item:active {
  background-color: var(--gh-red);
  color: #fff;
}

.dropdown-item:focus-visible {
  background-color: var(--gh-red-light);
  color: var(--gh-text);
}

/* Pagination */
.page-link {
  color: var(--gh-red);
}

.page-link:hover {
  color: var(--gh-red-hover);
}

.page-link:focus {
  box-shadow: 0 0 0 0.2rem rgba(143, 16, 23, 0.15);
}

.page-item.active .page-link {
  background-color: var(--gh-red);
  border-color: var(--gh-red);
  color: #fff;
}

/* List group active */
.list-group-item.active {
  background-color: var(--gh-red);
  border-color: var(--gh-red);
  color: #fff;
}

/* Nav pills */
.nav-pills .nav-link.active {
  background-color: var(--gh-red);
  color: #fff;
}

/* Progress bar */
.progress-bar {
  background-color: var(--gh-red);
}

/* Accordion */
.accordion-button:not(.collapsed) {
  color: var(--gh-red);
  background-color: var(--gh-red-light);
}

.accordion-button:focus {
  box-shadow: 0 0 0 0.2rem rgba(143, 16, 23, 0.15);
  border-color: var(--gh-red);
}

/* Spinner */
.text-primary {
  color: var(--gh-red) !important;
}

/* Alerts */
.alert-primary {
  color: #7f1d1d;
  background-color: #fef2f2;
  border-color: #fecaca;
}

/* Selection highlight */
::selection {
  background-color: rgba(143, 16, 23, 0.15);
  color: var(--gh-text);
}

/* Keep selected text readable on the dark sidebar (light text would
   otherwise inherit the dark --gh-text colour and disappear) */
.nexus-sidebar ::selection {
  background-color: rgba(143, 16, 23, 0.45);
  color: #fff;
}

/* Same problem on the dark auth panel — its heading/paragraph are light,
   so without this they'd flip to the dark --gh-text colour when selected. */
.auth-right ::selection {
  background-color: rgba(143, 16, 23, 0.45);
  color: #fff;
}

/* Focus visible global */
:focus-visible {
  outline-color: var(--gh-red);
}

/* Billing */
.billing-page-head {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.billing-page-head h1 {
  color: var(--gh-text);
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 0.25rem;
}

.billing-page-head p,
.billing-card-header p,
.billing-detail-title p {
  color: var(--gh-text-muted);
  font-size: 0.95rem;
  line-height: 1.45;
  margin: 0;
}

.billing-filter-card {
  margin-bottom: 1rem;
}

.billing-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.billing-filter-tab {
  background: #fff;
  border: 1px solid var(--gh-border);
  border-radius: 999px;
  color: var(--gh-text-muted);
  font-weight: 700;
  min-height: 2.5rem;
  padding: 0.45rem 0.9rem;
}

.billing-filter-tab:hover,
.billing-filter-tab:focus {
  border-color: var(--gh-red);
  color: var(--gh-red);
}

.billing-filter-tab.is-active {
  background: var(--gh-red);
  border-color: var(--gh-red);
  color: #fff;
}

.billing-card-header {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.billing-card-header h2 {
  color: var(--gh-text);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.3;
  margin: 0;
}

.billing-table {
  overflow: hidden;
}

.billing-table .table > :not(caption) > * > * {
  padding: 1rem;
  vertical-align: middle;
}

.billing-table .table > tbody > tr:nth-child(even) {
  background: #f8fafc;
}

.billing-table .table > tbody > tr:hover {
  background: var(--gh-red-subtle);
}

.billing-click-row {
  cursor: pointer;
}

.billing-invoice-number {
  color: var(--gh-text);
  font-weight: 800;
}

.billing-due-hint {
  color: var(--gh-text-muted);
  display: block;
  font-size: 0.8rem;
  margin-top: 0.15rem;
}

.billing-row-actions {
  align-items: center;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.billing-mobile-invoices {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
}

.billing-mobile-invoice {
  background: #fff;
  border: 1px solid var(--gh-border);
  border-radius: 0.65rem;
  overflow: hidden;
}

.billing-mobile-invoice-main {
  color: inherit;
  display: block;
  padding: 1rem;
  text-decoration: none;
}

.billing-mobile-invoice-main:hover,
.billing-mobile-invoice-main:focus {
  background: #fbfcfd;
}

.billing-mobile-invoice-top,
.billing-mobile-invoice-amount,
.billing-mobile-invoice-due {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.billing-mobile-invoice-amount {
  border-top: 1px solid var(--gh-border);
  margin-top: 0.85rem;
  padding-top: 0.85rem;
}

.billing-mobile-invoice-amount span,
.billing-mobile-invoice-due {
  color: var(--gh-text-muted);
  font-size: 0.95rem;
}

.billing-mobile-invoice-amount strong {
  color: var(--gh-text);
  font-size: 1.25rem;
}

.billing-mobile-invoice-due {
  justify-content: flex-start;
  margin-top: 0.75rem;
}

.billing-mobile-invoice-due i {
  color: var(--gh-red);
}

.billing-mobile-invoice-actions {
  background: #f8fafc;
  border-top: 1px solid var(--gh-border);
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
  padding: 0.75rem;
}

.billing-empty-state {
  color: var(--gh-text-muted);
  padding: 3rem 1rem;
  text-align: center;
}

.billing-empty-state i {
  font-size: 2.25rem;
  opacity: 0.35;
}

.billing-empty-state h2 {
  color: var(--gh-text);
  font-size: 1rem;
  font-weight: 800;
  margin: 0.85rem 0 0.25rem;
}

.billing-empty-state p {
  margin: 0;
}

.billing-detail-hero {
  align-items: center;
  background: #fff;
  border: 1px solid var(--gh-border);
  border-radius: 0.65rem;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding: 1.15rem;
}

.billing-detail-title {
  align-items: center;
  display: flex;
  gap: 0.9rem;
  min-width: 0;
}

.billing-detail-title h1 {
  color: var(--gh-text);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 0.25rem;
}

.billing-detail-icon {
  align-items: center;
  background: var(--gh-red-light);
  border-radius: 0.7rem;
  color: var(--gh-red);
  display: inline-flex;
  flex: 0 0 auto;
  height: 3rem;
  justify-content: center;
  width: 3rem;
}

.billing-detail-status {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-align: right;
}

.billing-detail-status strong {
  color: var(--gh-text);
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.1;
}

.billing-detail-status span:last-child {
  color: var(--gh-text-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.billing-detail-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  margin-bottom: 1.25rem;
}

.billing-pay-card,
.billing-summary-card {
  min-width: 0;
}

.billing-summary-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.billing-summary-list div {
  border-bottom: 1px solid var(--gh-border);
  display: grid;
  gap: 0.5rem;
  grid-template-columns: minmax(7rem, 0.45fr) minmax(0, 1fr);
  padding: 0.85rem 0;
}

.billing-summary-list div:first-child {
  padding-top: 0;
}

.billing-summary-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.billing-summary-list dt {
  color: var(--gh-text-muted);
  font-weight: 700;
}

.billing-summary-list dd {
  color: var(--gh-text);
  font-weight: 600;
  margin: 0;
  overflow-wrap: anywhere;
}

.billing-loading,
.billing-muted {
  color: var(--gh-text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.billing-card-list {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.billing-section-head {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.billing-section-title {
  color: var(--gh-text);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.3;
}

.billing-card-item {
  align-items: center;
  border: 1px solid var(--gh-border);
  border-radius: 0.55rem;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 2.4rem minmax(0, 1fr) auto;
  padding: 0.85rem;
}

.billing-card-brand {
  align-items: center;
  background: var(--gh-red-light);
  border-radius: 0.55rem;
  color: var(--gh-red);
  display: inline-flex;
  height: 2.4rem;
  justify-content: center;
  width: 2.4rem;
}

.billing-card-brand i,
.billing-method-icon i {
  font-size: 1.25rem;
}

.billing-card-title {
  color: var(--gh-text);
  font-weight: 700;
  line-height: 1.3;
}

.billing-card-meta {
  color: var(--gh-text-muted);
  font-size: 0.9rem;
}

.billing-card-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.billing-card-info {
  min-width: 0;
}

.billing-methods-footer {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 0.5rem;
}

.billing-methods-footer .billing-secure-note {
  flex: 1;
  min-width: 14rem;
}

.billing-manage-toggle {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.billing-manage-btn {
  background: none;
  border: none;
  color: var(--gh-red);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.25rem 0;
}

.billing-manage-btn:hover {
  text-decoration: underline;
}

.billing-manage-drawer {
  border-top: 1px solid var(--gh-border);
  display: none;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
}

.billing-manage-drawer.is-open {
  display: block;
}

.billing-edit-card-form {
  background: var(--gh-body-bg);
  border: 1px solid var(--gh-border);
  border-radius: 0.55rem;
  display: none;
  margin-bottom: 0.75rem;
  padding: 0.85rem;
}

.billing-edit-card-form.is-open {
  display: block;
}

.billing-empty {
  background: var(--gh-bg);
  border: 1px dashed var(--gh-border);
  border-radius: 0.55rem;
  color: var(--gh-text-muted);
  margin-bottom: 1rem;
  padding: 0.95rem;
}

.billing-secure-note {
  align-items: flex-start;
  background: #f8fafc;
  border: 1px solid var(--gh-border);
  border-radius: 0.55rem;
  color: var(--gh-text-muted);
  display: flex;
  font-size: 0.9rem;
  gap: 0.6rem;
  line-height: 1.45;
  padding: 0.75rem 0.85rem;
}

.billing-secure-note i {
  color: var(--gh-red);
  margin-top: 0.15rem;
}

.billing-toast {
  align-items: center;
  border-radius: 0.55rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
  display: flex;
  font-size: 0.95rem;
  font-weight: 600;
  gap: 0.5rem;
  left: 50%;
  opacity: 0;
  padding: 0.75rem 1.1rem;
  pointer-events: none;
  position: fixed;
  top: 1.25rem;
  transform: translateX(-50%) translateY(-1rem);
  transition: opacity 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
  z-index: 10000;
}

.billing-toast.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.billing-toast.is-success {
  background: #047857;
  color: #fff;
}

.billing-toast.is-error {
  background: #dc2626;
  color: #fff;
}

.billing-message {
  border-radius: 0.55rem;
  font-weight: 600;
  margin-top: 0.75rem;
  padding: 0.75rem 0.85rem;
}

.billing-message.is-success {
  background: rgba(4, 120, 87, 0.08);
  border: 1px solid rgba(4, 120, 87, 0.25);
  color: #047857;
}

.billing-message.is-error {
  background: rgba(143, 16, 23, 0.08);
  border: 1px solid rgba(143, 16, 23, 0.22);
  color: var(--gh-red);
}

.billing-add-card {
  border-top: 1px solid var(--gh-border);
  display: none;
  margin-top: 1rem;
  padding-top: 1rem;
}

.billing-add-card.is-open {
  display: block;
}

.billing-card-element {
  background: #fff;
  border: 1px solid var(--gh-border);
  border-radius: 0.55rem;
  min-height: 3rem;
  padding: 0.85rem;
}

.billing-payment-widget {
  border-top: 1px solid var(--gh-border);
  padding-top: 1rem;
}

.billing-payment-widget.is-primary {
  border-top: 0;
  padding-top: 0;
}

.billing-payment-panel {
  background: var(--gh-bg);
  border: 1px solid var(--gh-border);
  border-radius: 0.55rem;
  padding: 0.9rem;
}

.billing-payment-panel.is-settled {
  align-items: flex-start;
  background: rgba(4, 120, 87, 0.06);
  border-color: rgba(4, 120, 87, 0.2);
  display: flex;
  gap: 0.75rem;
}

.billing-payment-state {
  align-items: center;
  background: rgba(4, 120, 87, 0.12);
  border-radius: 999px;
  color: #047857;
  display: inline-flex;
  flex: 0 0 auto;
  height: 2.25rem;
  justify-content: center;
  width: 2.25rem;
}

.billing-payment-amount {
  color: var(--gh-text);
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.2;
}

.billing-payment-summary,
.billing-payment-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
}

.billing-payment-total {
  color: var(--gh-text-muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.billing-methods-heading {
  color: var(--gh-text);
  font-size: 0.9rem;
  font-weight: 800;
  margin: 1rem 0 0.5rem;
}

.billing-method-options {
  display: grid;
  gap: 0.65rem;
}

.billing-method-option {
  align-items: center;
  background: #fff;
  border: 1px solid var(--gh-border);
  border-radius: 0.55rem;
  cursor: pointer;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: auto 2.4rem minmax(0, 1fr);
  margin: 0;
  padding: 0.8rem;
}

.billing-method-option:has(input:checked) {
  border-color: var(--gh-red);
  box-shadow: 0 0 0 1px rgba(143, 16, 23, 0.16);
}

.billing-method-option input {
  accent-color: var(--gh-red);
  height: 1.1rem;
  width: 1.1rem;
}

.billing-method-icon {
  align-items: center;
  background: var(--gh-red-light);
  border-radius: 0.55rem;
  color: var(--gh-red);
  display: inline-flex;
  height: 2.4rem;
  justify-content: center;
  width: 2.4rem;
}

.billing-method-copy {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.billing-payment-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

@media (max-width: 767.98px) {
  .billing-page-head,
  .billing-detail-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .billing-page-head .btn {
    width: 100%;
  }

  .billing-filter-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.25rem;
  }

  .billing-filter-tab {
    flex: 0 0 auto;
  }

  .billing-detail-status {
    align-items: flex-start;
    text-align: left;
  }

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

  .billing-summary-list div {
    grid-template-columns: 1fr;
  }

  .billing-card-item {
    align-items: flex-start;
    grid-template-columns: 2.4rem minmax(0, 1fr);
  }

  .billing-card-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .billing-payment-row .btn,
  .billing-payment-actions .btn,
  .billing-wide-sm {
    width: 100%;
  }

  .billing-payment-summary,
  .billing-payment-row,
  .billing-payment-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .billing-balance-banner {
    flex-direction: column;
    gap: 0.75rem;
  }

  .pay-selected-method {
    flex-direction: column;
    align-items: stretch;
  }

  .pay-change-method {
    align-self: flex-start;
  }

  .pay-new-card-actions {
    flex-direction: column;
  }

  .billing-payment-success {
    padding: 2rem 1rem;
  }
}

/* ── Balance Banner ─────────────────── */

.billing-balance-banner {
  align-items: center;
  background: linear-gradient(135deg, rgba(143, 16, 23, 0.06) 0%, rgba(143, 16, 23, 0.02) 100%);
  border: 1px solid rgba(143, 16, 23, 0.15);
  border-radius: 0.65rem;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding: 1rem 1.15rem;
}

.billing-balance-info {
  align-items: center;
  display: flex;
  gap: 0.85rem;
}

.billing-balance-icon {
  align-items: center;
  background: rgba(143, 16, 23, 0.1);
  border-radius: 0.6rem;
  color: var(--gh-red);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 1.1rem;
  height: 2.75rem;
  justify-content: center;
  width: 2.75rem;
}

.billing-balance-label {
  color: var(--gh-text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.billing-balance-amount {
  color: var(--gh-text);
  font-family: 'Montserrat', sans-serif;
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.15;
}

.billing-balance-meta {
  color: var(--gh-text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Tab Counts ─────────────────────── */

.billing-tab-count {
  background: rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  margin-left: 0.25rem;
  min-width: 1.4rem;
  padding: 0.1rem 0.4rem;
  text-align: center;
}

.billing-filter-tab.is-active .billing-tab-count {
  background: rgba(255, 255, 255, 0.25);
}

/* ── Paid / Draft state ─────────────── */

.billing-paid-state,
.billing-draft-state {
  align-items: center;
  display: flex;
  gap: 0.85rem;
}

.billing-paid-icon {
  align-items: center;
  background: rgba(4, 120, 87, 0.1);
  border-radius: 999px;
  color: #047857;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 1.25rem;
  height: 2.75rem;
  justify-content: center;
  width: 2.75rem;
}

.billing-draft-icon {
  align-items: center;
  background: rgba(71, 85, 105, 0.1);
  border-radius: 999px;
  color: var(--gh-secondary);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 1rem;
  height: 2.75rem;
  justify-content: center;
  width: 2.75rem;
}

.billing-paid-title {
  color: var(--gh-text);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.3;
}

.billing-paid-meta {
  color: var(--gh-text-muted);
  font-size: 0.95rem;
  line-height: 1.45;
  margin-top: 0.1rem;
}

/* ── Selected Method + Change ────────── */

.pay-selected-method {
  align-items: center;
  background: #fff;
  border: 1px solid var(--gh-border);
  border-radius: 0.55rem;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  margin-top: 1rem;
  padding: 0.85rem;
}

.pay-selected-card {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  min-width: 0;
}

.pay-selected-copy {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.pay-change-method {
  background: none;
  border: none;
  color: var(--gh-red);
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.35rem 0.5rem;
  white-space: nowrap;
}

.pay-change-method:hover {
  text-decoration: underline;
}

/* ── Methods Drawer ─────────────────── */

.pay-methods-drawer {
  display: none;
  margin-top: 0.75rem;
}

.pay-methods-drawer.is-open {
  display: block;
}

.pay-drawer-heading {
  color: var(--gh-text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.pay-add-new-trigger {
  background: none;
  border: 1px dashed var(--gh-border);
  border-radius: 0.55rem;
  color: var(--gh-red);
  cursor: pointer;
  display: block;
  font-weight: 700;
  margin-top: 0.65rem;
  padding: 0.75rem;
  text-align: center;
  transition: background 0.15s ease, border-color 0.15s ease;
  width: 100%;
}

.pay-add-new-trigger:hover {
  background: var(--gh-red-subtle);
  border-color: rgba(143, 16, 23, 0.3);
}

.pay-new-card-form {
  background: #fff;
  border: 1px solid var(--gh-border);
  border-radius: 0.55rem;
  display: none;
  margin-top: 0.65rem;
  padding: 1rem;
}

.pay-new-card-form.is-open {
  display: block;
}

.pay-new-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

/* ── No-cards inline add card ─────── */

.pay-add-card-section {
  margin-top: 1rem;
}

.pay-add-card-prompt {
  align-items: center;
  color: var(--gh-text-muted);
  display: flex;
  font-weight: 600;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.pay-add-card-prompt i {
  color: var(--gh-red);
  font-size: 1.1rem;
}

.pay-add-card-form {
  background: #fff;
  border: 1px solid var(--gh-border);
  border-radius: 0.55rem;
  padding: 1rem;
}

/* ── Payment Success ────────────────── */

.billing-payment-success {
  padding: 2.5rem 1.5rem;
  text-align: center;
}

.billing-success-icon {
  display: inline-block;
  height: 4.5rem;
  margin-bottom: 1.25rem;
  width: 4.5rem;
}

.billing-checkmark {
  border-radius: 50%;
  display: block;
  height: 4.5rem;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-miterlimit: 10;
  stroke-width: 2;
  width: 4.5rem;
}

.billing-checkmark-circle {
  animation: billing-stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
  stroke: #047857;
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
}

.billing-checkmark-check {
  animation: billing-stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.35s forwards;
  stroke: #047857;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  transform-origin: 50% 50%;
}

@keyframes billing-stroke {
  100% { stroke-dashoffset: 0; }
}

.billing-success-title {
  color: #047857;
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.billing-success-amount {
  color: var(--gh-text);
  font-family: 'Montserrat', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.billing-success-meta {
  color: var(--gh-text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}
