.billing-page {
  gap: 1.35rem;
}

.billing-shell {
  display: grid;
  gap: 1.2rem;
}

.billing-section {
  display: grid;
  gap: 1rem;
  padding: 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.36);
  box-shadow: var(--shadow-soft);
}

[data-theme="dark"] .billing-section {
  background: rgba(15, 23, 42, 0.44);
}

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

.billing-section-head h3 {
  margin-top: 0.22rem;
  font-size: 1.3rem;
  letter-spacing: -0.03em;
}

.plan-box {
  padding: 1.05rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.5));
}

[data-theme="dark"] .plan-box {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.78), rgba(15, 23, 42, 0.58));
}

.plan-summary {
  display: grid;
  gap: 0.55rem;
}

.plan-name {
  font-size: 1.12rem;
  letter-spacing: -0.02em;
}

.plan-validity {
  color: var(--muted);
}

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

.tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.tag.active,
.tag.paid {
  color: #0f5132;
  background: rgba(16, 185, 129, 0.16);
}

.tag.open {
  color: var(--primary);
  background: rgba(0, 113, 227, 0.12);
}

.tag.pending {
  color: #7c5800;
  background: rgba(245, 158, 11, 0.18);
}

.tag.canceled,
.tag.cancelled {
  color: #991b1b;
  background: rgba(239, 68, 68, 0.14);
}

.tag.expired {
  color: #475569;
  background: rgba(148, 163, 184, 0.18);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  min-width: 40rem;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.table th,
.table td {
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.table thead th {
  background: rgba(0, 113, 227, 0.08);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table td {
  background: rgba(255, 255, 255, 0.28);
}

[data-theme="dark"] .table td {
  background: rgba(15, 23, 42, 0.3);
}

.table-message {
  color: var(--muted);
}

@media (max-width: 768px) {
  .billing-section {
    padding: 1.05rem;
  }

  .billing-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .billing-actions .btn {
    width: 100%;
  }

  .table {
    min-width: 0;
    border: none;
    background: transparent;
  }

  .table thead {
    display: none;
  }

  .table,
  .table tbody,
  .table tr,
  .table td {
    display: block;
    width: 100%;
  }

  .table tr {
    margin-bottom: 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
  }

  .table td {
    border: none;
    border-bottom: 1px solid var(--border);
    padding: 0.7rem 0.85rem;
  }

  .table tr td:last-child {
    border-bottom: none;
  }

  .table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.28rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
}
