:root {
  --dep-primary: #2563EB;
  --dep-primary-lt: rgba(37, 99, 235, 0.08);
  --tblr-badge-color: white;
}

/* Sidebar */

#sidebar-shell .nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: .75rem;
  border-radius: 6px;
  transition: background .15s ease;
}

#sidebar-shell .nav-link .badge {
  position: static;
  transform: none;
  margin-left: auto;
  flex-shrink: 0;
}

#sidebar-shell .nav-link.active {
  background: var(--dep-primary-lt);
  font-weight: 600;
}

#sidebar-shell .nav-link.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--dep-primary);
  border-radius: 3px;
}

/* Utilities */

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

.text-break {
  word-break: break-word;
}

.bg-primary-lt {
  background: var(--dep-primary-lt) !important;
}

/* Cards */

.card {
  border: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.06);
}

.card-header {
  border-bottom: 1px solid rgba(0,0,0,.04);
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.page-title {
  font-weight: 600;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
  transition: all .15s ease;
}

/* Buttons */

.btn-primary {
  box-shadow: 0 1px 2px rgba(0,0,0,.1);
}

/* Layout */

.page-body {
  padding-top: 1.5rem;
}

/* Dashboard hero */

#dash-hero-title {
  font-weight: 650;
}

#dash-hero-text {
  max-width: 60ch;
}

#dash-hero-primary {
  box-shadow: 0 1px 2px rgba(0,0,0,.1);
}

/* Billing */

#alerts:empty {
  display: none;
}

.billing-page-shell {
  max-width: 1480px;
  margin: 0 auto;
}

.billing-summary-card .card-body,
.billing-plans-card .card-body {
  padding: 1.5rem;
}

.billing-summary-card .card-header,
.billing-plans-card .card-header {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* Billing summary */

.billing-stat {
  min-height: 84px;
}

.billing-stat-label {
  font-size: 0.9rem;
  color: var(--tblr-muted, #6c7a91);
  margin-bottom: 0.45rem;
}

.billing-stat-value {
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--tblr-body-color, #182433);
}

.billing-renewal-value {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
}

.billing-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  height: 100%;
}

/* Plans header */

.billing-plans-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

#bill-footnote {
  max-width: 72ch;
  margin-top: 0.35rem;
}

.billing-interval-toggle {
  display: inline-flex;
  gap: 0;
  flex-shrink: 0;
}

.billing-interval-toggle .btn {
  border-radius: 0;
}

.billing-interval-toggle .btn:first-of-type {
  border-top-left-radius: 0.75rem;
  border-bottom-left-radius: 0.75rem;
}

.billing-interval-toggle .btn:last-of-type {
  border-top-right-radius: 0.75rem;
  border-bottom-right-radius: 0.75rem;
}

/* Plans grid */

#plans-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1.25rem;
}

@media (min-width: 768px) {
  #plans-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1400px) {
  #plans-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

#plans-grid > * {
  min-width: 0;
}

#plans-grid .card {
  height: 100%;
  border-radius: 1rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

#plans-grid .card:hover {
  transform: translateY(-2px);
}

/* Plan cards */

.plan-upgrade {
  border: 2px solid var(--dep-primary) !important;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2);
}

.plan-current {
  border: 2px solid #22c55e !important;
  box-shadow: 0 12px 28px rgba(34, 197, 94, 0.10);
}

.plan-card-body {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.5rem;
}

.plan-card-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.plan-card-badges {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.plan-price {
  font-size: clamp(2.35rem, 3vw, 3.4rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  margin-bottom: 1.1rem;
}

.plan-price.free-price {
  letter-spacing: -0.02em;
}

.plan-feature-list {
  padding-left: 0;
  margin: 0;
  list-style: none;
}

.plan-feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  margin-bottom: 0.7rem;
  color: var(--tblr-muted, #6c7a91);
  font-size: 0.98rem;
  line-height: 1.4;
}

.plan-feature-list li:last-child {
  margin-bottom: 0;
}

.plan-feature-icon {
  color: #22c55e;
  margin-top: 0.1rem;
  flex: 0 0 auto;
}

.plan-card-footer {
  margin-top: auto;
  padding-top: 1.25rem;
}

.plan-subtle {
  color: var(--tblr-muted, #6c7a91);
  font-size: 0.95rem;
}

/* Confirmation modal */

.confirm-stat {
  padding: 0.85rem;
  border: 1px solid rgba(98, 105, 118, 0.16);
  border-radius: 0.85rem;
  height: 100%;
}

.confirm-stat-label {
  font-size: 0.8rem;
  color: var(--tblr-muted, #6c7a91);
  margin-bottom: 0.35rem;
}

.confirm-stat-value {
  font-weight: 700;
  line-height: 1.3;
}

/* Responsive */

@media (max-width: 991.98px) {
  .billing-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 767.98px) {
  .billing-stat {
    min-height: auto;
  }

  .billing-stat-value {
    font-size: 1.25rem;
  }

  .plan-price {
    font-size: 2.35rem;
  }

  .billing-plans-header {
    align-items: stretch;
  }

  .billing-interval-toggle {
    width: 100%;
  }

  .billing-interval-toggle .btn {
    flex: 1 1 0;
    text-align: center;
  }

  .billing-summary-card .card-body,
  .billing-plans-card .card-body {
    padding: 1.1rem;
  }

  .billing-summary-card .card-header,
  .billing-plans-card .card-header {
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }

  .plan-card-body {
    padding: 1.1rem;
  }
}