:root {
  --brand: #0f5f9b;
  --brand-soft: #e8f4ff;
  --bg: #f3f6fa;
  --card: #ffffff;
  --text: #243447;
}

html {
  font-size: 15px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin-bottom: 60px;
  background:
    radial-gradient(1100px 320px at 0% 0%, #dcecff 0%, transparent 60%),
    radial-gradient(900px 280px at 100% 0%, #e9fff5 0%, transparent 55%),
    var(--bg);
  color: var(--text);
}

.admin-shell {
  margin: 0;
  background:
    radial-gradient(900px 420px at 0% 0%, rgba(255, 180, 119, 0.18) 0%, transparent 55%),
    radial-gradient(900px 420px at 100% 0%, rgba(78, 112, 255, 0.16) 0%, transparent 55%),
    #f6f7fb;
  color: #1f2937;
  font-family: "Outfit", "Noto Sans SC", sans-serif;
}

.admin-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
}

.admin-sidebar {
  padding: 24px 18px;
  background: linear-gradient(180deg, #111827 0%, #172033 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 14px 0 40px rgba(15, 23, 42, 0.18);
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: #fff;
  padding: 12px 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.admin-brand:hover {
  color: #fff;
}

.admin-brand strong,
.admin-brand small {
  display: block;
}

.admin-brand small {
  opacity: 0.65;
  font-size: 0.82rem;
}

.admin-brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #ff7a59, #ffb36b);
  color: #1f2937;
  font-weight: 800;
  box-shadow: 0 12px 22px rgba(255, 122, 89, 0.28);
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-nav-link {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.76);
  padding: 12px 14px;
  border-radius: 14px;
  transition: 0.18s ease;
  font-weight: 600;
}

.admin-nav-link:hover,
.admin-nav-link.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 122, 89, 0.92), rgba(255, 179, 107, 0.92));
  box-shadow: 0 12px 24px rgba(255, 122, 89, 0.24);
}

.admin-sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
}

.admin-side-user {
  display: flex;
  flex-direction: column;
  margin-bottom: 14px;
}

.admin-side-user-label {
  font-size: 0.78rem;
  opacity: 0.65;
}

.admin-main {
  min-width: 0;
  padding: 24px;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.admin-topbar-kicker,
.admin-hero-kicker {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.76rem;
  color: #ff7a59;
  font-weight: 700;
}

.admin-topbar-title {
  margin: 4px 0 0;
  font-size: 2rem;
  font-weight: 800;
}

.admin-topbar-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-topbar-meta span,
.admin-status-pill,
.admin-status-chip {
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.24);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.admin-content {
  min-width: 0;
}

.admin-hero,
.admin-surface-card {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 28px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(8px);
}

.admin-hero {
  padding: 28px 30px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

.admin-hero > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.admin-hero-title {
  margin: 6px 0 10px;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  font-weight: 800;
}

.admin-hero-text {
  margin: 0;
  color: #64748b;
  max-width: 700px;
}

.admin-hero-side {
  display: flex;
  gap: 12px;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
  margin-left: auto;
}

.admin-stat-card {
  min-width: 112px;
  min-height: 46px;
  padding: 8px 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(226, 232, 240, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.admin-stat-label {
  display: block;
  color: #64748b;
  font-size: 0.72rem;
  line-height: 1.2;
}

.admin-stat-value {
  display: block;
  margin-top: 2px;
  font-size: 0.98rem;
  line-height: 1.2;
  text-align: center;
}

.admin-dashboard-grid,
.admin-plan-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.admin-dashboard-tile,
.admin-plan-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(226, 232, 240, 0.96);
  border-radius: 24px;
  padding: 22px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.07);
}

.admin-dashboard-tile:hover {
  transform: translateY(-2px);
  color: inherit;
}

.admin-dashboard-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #1d4ed8, #60a5fa);
  color: #fff;
  font-weight: 700;
}

.admin-dashboard-tile h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.admin-dashboard-tile p {
  margin: 0;
  color: #64748b;
}

.admin-surface-card {
  padding: 24px;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table thead th {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-table tbody td {
  border-color: #eef2f7;
}

.admin-user-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-user-cell span {
  color: #64748b;
  font-size: 0.86rem;
}

.admin-status-pill.tone-success { color: #047857; background: rgba(209, 250, 229, 0.88); }
.admin-status-pill.tone-warning { color: #b45309; background: rgba(254, 243, 199, 0.88); }
.admin-status-pill.tone-secondary { color: #475569; background: rgba(226, 232, 240, 0.88); }
.admin-status-pill.tone-danger { color: #b91c1c; background: rgba(254, 226, 226, 0.9); }

.admin-status-chip.is-success { color: #047857; }
.admin-status-chip.is-danger { color: #b91c1c; }

.admin-primary-btn,
.admin-ghost-btn {
  border-radius: 14px;
  padding: 10px 16px;
  font-weight: 700;
}

.admin-primary-btn {
  background: linear-gradient(135deg, #ff7a59, #ffb36b);
  color: #fff;
  border: 0;
  box-shadow: 0 12px 24px rgba(255, 122, 89, 0.22);
}

.admin-primary-btn:hover {
  color: #fff;
  background: linear-gradient(135deg, #f56a47, #f8a853);
}

.admin-ghost-btn {
  background: #fff;
  color: #1f2937;
  border: 1px solid rgba(203, 213, 225, 0.9);
}

.admin-soft-alert {
  border-radius: 18px;
  padding: 14px 18px;
}

.admin-soft-alert.success { background: rgba(220, 252, 231, 0.92); color: #166534; }
.admin-soft-alert.warning { background: rgba(255, 247, 237, 0.95); color: #c2410c; }

.admin-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.admin-detail-grid-bottom {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-section-title,
.admin-subtitle {
  margin: 0 0 16px;
  font-weight: 800;
}

.admin-info-list {
  display: grid;
  gap: 12px;
}

.admin-info-list > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px dashed #e2e8f0;
}

.admin-info-list span,
.admin-inline-note {
  color: #64748b;
}

.admin-quick-plan-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.admin-quick-plan {
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  border-radius: 18px;
  padding: 12px 14px;
  min-width: 120px;
  text-align: left;
}

.admin-quick-plan strong,
.admin-quick-plan span,
.admin-quick-plan em {
  display: block;
}

.admin-quick-plan span,
.admin-quick-plan em {
  color: #64748b;
  font-style: normal;
  font-size: 0.88rem;
}

.admin-mini-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.admin-mini-stat {
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
}

.admin-mini-stat span {
  display: block;
  color: #64748b;
}

.admin-mini-stat strong {
  display: block;
  margin-top: 8px;
  font-size: 1.35rem;
}

.admin-plan-card-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.admin-plan-key {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #94a3b8;
  margin-bottom: 8px;
}

.admin-plan-name-input {
  font-size: 1.1rem;
  font-weight: 700;
}

.admin-plan-price-preview {
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, #111827, #1d4ed8);
  color: #fff;
  margin-bottom: 18px;
}

.admin-plan-badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 0.82rem;
  margin-bottom: 12px;
}

.admin-plan-price-line .currency {
  font-size: 1.2rem;
  vertical-align: top;
}

.admin-plan-price-line strong {
  font-size: 2rem;
}

.admin-plan-original {
  margin-top: 6px;
  opacity: 0.7;
  text-decoration: line-through;
}

.admin-plan-card.is-disabled {
  opacity: 0.72;
}

.admin-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(226, 232, 240, 0.92);
}

.admin-action-hint {
  color: #64748b;
}

.profile-membership-shop {
  margin-top: 26px;
  padding: 18px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(247,250,255,0.96) 100%);
  border: 1px solid rgba(226,232,240,0.9);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
  font-size: .9rem;
}

.profile-membership-shop-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.profile-membership-shop-title {
  margin: 4px 0 6px;
  font-size: 1.26rem;
  font-weight: 800;
}

.profile-membership-shop-text,
.profile-plan-desc,
.profile-inline-note {
  color: #64748b;
  font-size: .82rem;
}

.profile-membership-shop-highlight {
  min-width: 142px;
  padding: 10px 12px;
  border-radius: 18px;
  background: linear-gradient(135deg, #eef2ff 0%, #dde7ff 100%);
  border: 1px solid rgba(89, 99, 184, 0.16);
  color: #44507d;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.profile-membership-shop-highlight span {
  display: block;
  opacity: 1;
  font-size: 0.72rem;
  color: #7a86a8;
}

.profile-membership-shop-highlight strong {
  display: block;
  margin-top: 4px;
  font-size: 0.92rem;
  color: #4654a7;
}

.profile-plan-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.profile-plan-card {
  position: relative;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(226,232,240,0.95);
  background: #fff;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.06);
}

.profile-plan-card.is-featured {
  background: linear-gradient(180deg, #fef7ee 0%, #fff 70%);
  border-color: rgba(251, 146, 60, 0.36);
  box-shadow: 0 20px 40px rgba(249, 115, 22, 0.12);
}

.profile-plan-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.12);
  color: #c2410c;
  font-size: 0.74rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.profile-plan-name {
  font-size: .94rem;
  font-weight: 800;
}

.profile-plan-days {
  margin-top: 4px;
  color: #64748b;
  font-size: .78rem;
}

.profile-plan-price {
  margin-top: 10px;
  color: #0f172a;
}

.profile-plan-price .currency {
  font-size: .82rem;
  vertical-align: top;
}

.profile-plan-price strong {
  font-size: 1.46rem;
  line-height: 1;
}

.profile-plan-original {
  color: #94a3b8;
  text-decoration: line-through;
  margin-top: 4px;
  font-size: .76rem;
}

.profile-plan-desc {
  min-height: 40px;
  margin: 10px 0 14px;
  font-size: .78rem;
}

.profile-plan-empty {
  padding: 16px;
  border-radius: 18px;
  background: #fff;
  color: #64748b;
  font-size: .84rem;
}

@media (max-width: 1399.98px) {
  .profile-plan-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 991.98px) {
  .profile-plan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .profile-plan-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.profile-purchase-preview {
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, #fff7ed, #ffffff);
  border: 1px solid rgba(251, 146, 60, 0.24);
}

.profile-purchase-plan {
  font-size: 1.2rem;
  font-weight: 800;
}

.profile-purchase-meta {
  margin-top: 8px;
  color: #64748b;
}

@media (max-width: 1200px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
  }

  .admin-detail-grid,
  .admin-detail-grid-bottom {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .admin-main {
    padding: 16px;
  }

  .admin-topbar,
  .admin-hero,
  .profile-membership-shop-head {
    flex-direction: column;
  }

  .admin-action-bar {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Admin Morandi override */
.admin-shell {
  font-size: 14px;
  background:
    radial-gradient(900px 420px at 0% 0%, rgba(182, 162, 141, 0.20) 0%, transparent 55%),
    radial-gradient(900px 420px at 100% 0%, rgba(151, 166, 153, 0.18) 0%, transparent 55%),
    #f3f0eb;
  color: #4d4a46;
}

.admin-sidebar {
  background: linear-gradient(180deg, #857c74 0%, #6f756d 100%);
  box-shadow: 14px 0 40px rgba(95, 86, 79, 0.16);
}

.admin-brand {
  background: rgba(255, 255, 255, 0.08);
}

.admin-brand-mark {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #b58b7a, #cbb8a3);
  color: #fff;
  box-shadow: 0 10px 18px rgba(151, 116, 103, 0.22);
}

.admin-nav-link {
  font-size: 0.93rem;
  padding: 10px 12px;
}

.admin-nav-link:hover,
.admin-nav-link.active {
  background: linear-gradient(135deg, rgba(179, 145, 127, 0.92), rgba(161, 177, 161, 0.92));
  box-shadow: 0 10px 20px rgba(129, 128, 116, 0.18);
}

.admin-topbar-kicker,
.admin-hero-kicker {
  color: #9a7d70;
  font-size: 0.7rem;
}

.admin-topbar-title {
  font-size: 1.65rem;
}

.admin-topbar-meta span,
.admin-status-pill,
.admin-status-chip {
  background: rgba(255, 255, 255, 0.82);
  color: #6b665f;
}

.admin-hero,
.admin-surface-card,
.admin-dashboard-tile,
.admin-plan-card {
  background: rgba(255, 252, 249, 0.9);
  border-color: rgba(214, 205, 195, 0.85);
  box-shadow: 0 14px 30px rgba(121, 112, 99, 0.08);
}

.admin-hero-title {
  font-size: clamp(1.45rem, 2vw, 2rem);
}

.admin-hero-text,
.admin-action-hint,
.admin-inline-note,
.admin-user-cell span,
.profile-inline-note {
  color: #827a72;
}

.admin-stat-card,
.admin-mini-stat,
.admin-quick-plan {
  background: linear-gradient(180deg, #f9f5f0 0%, #f4f0ea 100%);
  border-color: rgba(214, 205, 195, 0.9);
}

.admin-dashboard-grid,
.admin-plan-grid {
  gap: 14px;
}

.admin-dashboard-tile h3,
.admin-section-title,
.admin-subtitle {
  font-size: 1rem;
}

.admin-dashboard-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #8f9b8c, #b6a28f);
}

.admin-table thead th {
  background: #efe8df;
  color: #7a736b;
  font-size: 0.76rem;
}

.admin-primary-btn {
  background: linear-gradient(135deg, #a78a7a, #b0b7a3);
  box-shadow: 0 10px 20px rgba(145, 141, 128, 0.20);
}

.admin-primary-btn:hover {
  background: linear-gradient(135deg, #967869, #9ba393);
}

.admin-ghost-btn {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(201, 194, 186, 0.95);
  color: #5f5954;
}

.admin-plan-card-top {
  gap: 12px;
}

.admin-plan-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  min-width: 98px;
}

.admin-plan-name-input {
  font-size: 0.98rem;
}

.admin-plan-price-preview {
  background: linear-gradient(135deg, #8d8175, #a9b2a2);
  padding: 16px;
  margin-bottom: 16px;
}

.admin-plan-badge {
  background: rgba(255, 255, 255, 0.18);
}

.admin-action-bar {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(252, 248, 244, 0.94);
  border-color: rgba(214, 205, 195, 0.88);
}

.admin-form-card {
  padding: 22px;
}

.admin-switch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.admin-check-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #f8f4ef;
  border: 1px solid rgba(214, 205, 195, 0.9);
}

.admin-check-card .form-check-input {
  margin-top: 2px;
}

.admin-check-card strong,
.admin-check-card small {
  display: block;
}

.admin-check-card small {
  color: #8a837b;
}

.navbar {
  background-color: rgba(255, 255, 255, 0.88) !important;
  backdrop-filter: blur(8px);
}

.portal-hero {
  background: linear-gradient(135deg, #0f5f9b, #1572a1 60%, #1f8aa8);
  border-radius: 18px;
  color: #fff;
  padding: 28px;
  box-shadow: 0 18px 30px rgba(10, 55, 92, 0.18);
}

.portal-hero-title {
  margin: 0 0 8px;
  font-size: 1.9rem;
  font-weight: 700;
}

.portal-hero-subtitle {
  margin: 0;
  opacity: 0.92;
}

.portal-card-link {
  text-decoration: none;
  color: inherit;
}

.portal-card {
  background: var(--card);
  border-radius: 16px;
  padding: 22px;
  border: 1px solid #dbe7f2;
  box-shadow: 0 10px 22px rgba(24, 54, 85, 0.08);
  transition: transform .18s ease, box-shadow .18s ease;
}

.portal-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 28px rgba(24, 54, 85, 0.14);
}

.portal-card h3 {
  margin-bottom: 10px;
  font-size: 1.25rem;
}

.portal-card p {
  color: #4e677f;
  min-height: 44px;
}

.portal-card-action {
  color: var(--brand);
  font-weight: 600;
}

.dashboard-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card {
  background: #fff;
  border: 1px solid #dbe7f2;
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 8px 18px rgba(24, 54, 85, 0.08);
}

.metric-card-wide {
  grid-column: span 2;
}

.metric-title {
  font-size: 0.9rem;
  color: #5f7389;
}

.metric-value {
  font-size: 1.9rem;
  font-weight: 700;
  color: #0f5f9b;
  line-height: 1.15;
  margin-top: 6px;
}

.metric-date {
  font-size: 1.5rem;
}

.group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #e2edf7;
  background: linear-gradient(90deg, #f7fbff 0%, #ffffff 100%);
}

.portal-table-wrap,
.portal-form-wrap {
  background: var(--card);
  border: 1px solid #dbe7f2;
  border-radius: 14px;
  box-shadow: 0 10px 22px rgba(24, 54, 85, 0.08);
}

.portal-form-wrap {
  padding: 20px;
}

.portal-table-wrap .table {
  margin: 0;
}

.portal-table-wrap thead th {
  background: #f7fbff;
  border-bottom-width: 1px;
}

.btn-primary {
  background: linear-gradient(135deg, #0f5f9b, #1a74a8);
  border-color: #0f5f9b;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0d558d, #166999);
  border-color: #0d558d;
}

@media (max-width: 992px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-card-wide {
    grid-column: span 2;
  }
}

@media (max-width: 576px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .metric-card-wide {
    grid-column: span 1;
  }
}

/* Material Dashboard style (Portal) */
.md-body {
  margin: 0;
  background: #f5f7fb;
  color: #344767;
  font-family: "Noto Sans SC", "Outfit", sans-serif;
}

.md-shell {
  min-height: 100vh;
  display: flex;
}

.md-sidebar {
  width: 270px;
  background: linear-gradient(180deg, #1a2035 0%, #12162a 100%);
  color: #fff;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 8px 0 24px rgba(18, 22, 42, 0.22);
}

.md-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.md-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #49a3f1, #1a73e8);
  display: grid;
  place-items: center;
  font-weight: 700;
}

.md-brand-title {
  font-size: 1rem;
  font-weight: 700;
}

.md-brand-sub {
  font-size: .8rem;
  color: rgba(255, 255, 255, .72);
}

.md-nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 4px;
}

.md-nav-item {
  color: rgba(255, 255, 255, .82);
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 10px;
  transition: .16s ease;
  font-weight: 500;
}

.md-nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.md-nav-item.active {
  background: linear-gradient(135deg, #ec407a, #d81b60);
  color: #fff;
  box-shadow: 0 8px 18px rgba(216, 27, 96, .35);
}

.md-sidebar-footer {
  margin-top: auto;
  padding: 10px 6px 0;
}

.md-content-wrap {
  flex: 1;
  min-width: 0;
}

.md-topbar {
  height: 70px;
  background: #fff;
  border-bottom: 1px solid #e7ecf3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 4;
}

.md-topbar-title {
  font-weight: 700;
  color: #344767;
}

.md-user {
  color: #67748e;
  font-size: .92rem;
}

.md-main {
  padding: 22px;
}

.md-hero {
  background: linear-gradient(135deg, #1a73e8, #49a3f1 65%, #83c5ff);
  border-radius: 18px;
  color: #fff;
  padding: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  box-shadow: 0 16px 30px rgba(26, 115, 232, 0.26);
}

.md-hero-title {
  margin: 0 0 6px;
  font-size: 1.7rem;
  font-weight: 700;
}

.md-hero-sub {
  margin: 0;
  color: rgba(255, 255, 255, .92);
}

.md-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e5e9f2;
  box-shadow: 0 8px 18px rgba(20, 33, 61, .08);
  overflow: hidden;
}

.md-card-head {
  padding: 14px 16px;
  border-bottom: 1px solid #e5e9f2;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.md-page-title {
  font-weight: 700;
}

.md-chip {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eaf2ff;
  color: #1a73e8;
  font-weight: 600;
  font-size: .85rem;
}

.md-card .portal-table-wrap thead th {
  background: #f8fafe;
}

@media (max-width: 992px) {
  .md-sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    bottom: 0;
    z-index: 1000;
    transition: left .2s ease;
  }

  .md-sidebar.open {
    left: 0;
  }

  .md-main {
    padding: 16px;
  }

  .md-topbar {
    padding: 0 12px;
  }

  .md-hero {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Portal form input visibility fix on Material Dashboard */
.g-sidenav-show .main-content .form-control,
.g-sidenav-show .main-content .form-select,
.g-sidenav-show .main-content textarea.form-control {
  border: 1px solid #cfd8e3 !important;
  border-radius: 0.5rem !important;
  padding: 0.625rem 0.875rem !important;
  background-color: #fff !important;
  box-shadow: none !important;
}

.g-sidenav-show .main-content .form-control:focus,
.g-sidenav-show .main-content .form-select:focus,
.g-sidenav-show .main-content textarea.form-control:focus {
  border-color: #1a73e8 !important;
  box-shadow: 0 0 0 0.2rem rgba(26, 115, 232, 0.15) !important;
}

:root {
  --portal-shell-bg: #f8fafc;
  --portal-sidenav-bg: linear-gradient(180deg, #7c85c7 0%, #6671bb 42%, #5561ad 100%);
  --portal-sidenav-text: #f8fafc;
  --portal-sidenav-muted: rgba(248, 250, 252, 0.74);
  --portal-sidenav-line: rgba(248, 250, 252, 0.14);
  --portal-sidenav-card: rgba(255, 255, 255, 0.1);
  --portal-sidenav-card-strong: rgba(255, 255, 255, 0.18);
  --portal-accent: #5963b8;
  --portal-accent-deep: #4952a0;
  --portal-accent-soft: #7c85c7;
  --portal-card-border: #e2e8f0;
  --portal-table-head: #64748b;
  --portal-table-line: #e2e8f0;
  --portal-table-hover: #f8fafc;
  --portal-alert: #eab308;
  --portal-success: #10b981;
  --portal-danger: #ef4444;
}

body.portal-shell {
  background:
    radial-gradient(circle at top right, rgba(124, 133, 199, 0.1), transparent 24rem),
    linear-gradient(180deg, #ffffff 0%, var(--portal-shell-bg) 100%) !important;
}

.portal-sidenav {
  background: var(--portal-sidenav-bg) !important;
  box-shadow: 0 22px 44px rgba(73, 82, 160, 0.18);
}

.portal-brand-text {
  color: var(--portal-sidenav-text);
  letter-spacing: .02em;
}

.portal-sidenav-divider {
  background-image: none !important;
  background-color: var(--portal-sidenav-line) !important;
}

.portal-nav-link {
  color: var(--portal-sidenav-text) !important;
  border-radius: 14px;
  margin: 0 .55rem .35rem;
  transition: all .18s ease;
}

.portal-nav-link:hover {
  background: var(--portal-sidenav-card);
}

.portal-nav-link.active {
  background: var(--portal-sidenav-card-strong) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.portal-nav-icon,
.portal-nav-link .nav-link-text,
.portal-nav-link i {
  color: var(--portal-sidenav-text) !important;
}

.portal-sidenav-caption {
  color: var(--portal-sidenav-muted);
}

.portal-sidenav-user {
  color: var(--portal-sidenav-text);
}

.portal-side-btn {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: var(--portal-sidenav-text);
}

.portal-side-btn:hover {
  color: var(--portal-sidenav-text);
  background: rgba(255, 255, 255, 0.16);
}

.portal-side-btn-primary {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.24);
}

.portal-main-content {
  background: transparent !important;
}

.portal-table-card {
  border: 1px solid var(--portal-card-border);
  box-shadow: 0 14px 30px rgba(73, 82, 160, 0.06);
}

.portal-table-card-header {
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--portal-table-line);
}

.portal-data-table thead th {
  padding: 1rem .95rem !important;
  font-size: .76rem !important;
  letter-spacing: .03em;
  color: var(--portal-table-head) !important;
  border-bottom: 1px solid var(--portal-table-line);
}

.portal-data-table tbody td {
  padding: 1rem .95rem !important;
  border-bottom: 1px solid var(--portal-table-line);
  vertical-align: middle;
}

.portal-data-table tbody tr:hover {
  background: var(--portal-table-hover);
}

.portal-data-table .btn.btn-sm {
  min-width: 64px;
}

.portal-page-hero {
  margin-bottom: 1rem;
  padding: 1.3rem 1.5rem;
  border-radius: 20px;
  background:
    radial-gradient(circle at top right, rgba(124, 133, 199, 0.12), transparent 20rem),
    linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--portal-card-border);
  box-shadow: 0 14px 30px rgba(73, 82, 160, 0.05);
}

.portal-page-eyebrow {
  margin-bottom: .45rem;
  color: var(--portal-accent-soft);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.portal-page-title {
  margin: 0;
  color: var(--portal-accent-deep);
  font-size: 1.85rem;
  font-weight: 700;
}

.portal-page-subtitle {
  margin: .45rem 0 0;
  color: #64748b;
  font-size: .95rem;
  line-height: 1.7;
}

.portal-page-hero-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.portal-page-hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1.4rem;
  flex-wrap: wrap;
}

.portal-hero-stats {
  display: flex;
  align-items: stretch;
  gap: .9rem;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.portal-hero-stat {
  width: 200px;
  height: 90px;
  padding: .85rem 1rem;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(240,243,255,.96) 100%);
  border: 1px solid rgba(89, 99, 184, 0.14);
  box-shadow: 0 16px 34px rgba(74, 85, 155, 0.14);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.portal-hero-stat span {
  display: block;
  color: #6b7280;
  font-size: .78rem;
  line-height: 1.45;
}

.portal-hero-stat strong {
  display: block;
  margin-top: .5rem;
  color: var(--portal-accent-deep);
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.02em;
}

.portal-label-row {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
}

.portal-label-note {
  color: #64748b;
  font-size: .78rem;
  line-height: 1.5;
}

.portal-label-note.is-highlight {
  color: #ca8a04;
  font-weight: 600;
}

.portal-label-note.is-warn {
  color: var(--portal-alert);
}

.portal-shell .bg-gradient-primary,
.portal-shell .btn.bg-gradient-primary {
  background: linear-gradient(135deg, var(--portal-accent-soft) 0%, var(--portal-accent) 100%) !important;
  border: 0 !important;
  color: #fff !important;
  box-shadow: 0 10px 22px rgba(73, 82, 160, 0.18);
}

.portal-shell .bg-gradient-success,
.portal-shell .btn.bg-gradient-success {
  background: linear-gradient(135deg, var(--portal-success) 0%, #059669 100%) !important;
  border: 0 !important;
  color: #fff !important;
  box-shadow: 0 10px 22px rgba(16, 185, 129, 0.18);
}

.portal-shell .bg-gradient-info,
.portal-shell .btn.bg-gradient-info {
  background: linear-gradient(135deg, var(--portal-accent-soft) 0%, var(--portal-accent) 100%) !important;
  border: 0 !important;
  color: #fff !important;
}

.portal-shell .btn-outline-primary {
  color: var(--portal-accent) !important;
  border-color: rgba(89, 99, 184, 0.22) !important;
}

.portal-shell .btn-outline-primary:hover,
.portal-shell .btn-outline-primary:focus {
  background: rgba(89, 99, 184, 0.08) !important;
  color: var(--portal-accent-deep) !important;
  border-color: rgba(89, 99, 184, 0.3) !important;
}

.portal-shell .btn-outline-secondary {
  color: #64748b !important;
  border-color: #d7dee8 !important;
}

.portal-shell .btn-outline-secondary:hover,
.portal-shell .btn-outline-secondary:focus {
  background: #f8fafc !important;
  color: #475569 !important;
}

.portal-shell .btn-outline-info {
  color: var(--portal-accent-soft) !important;
  border-color: rgba(59, 130, 246, 0.24) !important;
}

.portal-shell .btn-outline-success {
  color: var(--portal-success) !important;
  border-color: rgba(16, 185, 129, 0.24) !important;
}

.portal-shell .btn-outline-danger {
  color: var(--portal-danger) !important;
  border-color: rgba(239, 68, 68, 0.24) !important;
}

.portal-shell .badge.bg-gradient-success {
  background: linear-gradient(135deg, var(--portal-success) 0%, #059669 100%) !important;
}

.portal-shell .badge.bg-gradient-info {
  background: linear-gradient(135deg, var(--portal-accent-soft) 0%, var(--portal-accent) 100%) !important;
}

.portal-membership-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 1rem;
  border-radius: 18px;
  border: 1px solid transparent;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.portal-membership-strip-main {
  display: flex;
  align-items: center;
  gap: .85rem;
  min-width: 0;
}

.portal-membership-strip-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 .9rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
  white-space: nowrap;
}

.portal-membership-strip-text {
  color: #475569;
  font-size: .92rem;
  line-height: 1.6;
}

.portal-membership-strip-btn {
  border-radius: 999px;
  padding: 0 .95rem;
  min-height: 34px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.78);
  color: #334155;
  box-shadow: none;
}

.portal-membership-strip.tone-success {
  background: linear-gradient(135deg, rgba(236, 253, 245, 0.95) 0%, rgba(255, 255, 255, 0.95) 100%);
  border-color: rgba(16, 185, 129, 0.18);
}

.portal-membership-strip.tone-success .portal-membership-strip-badge {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}

.portal-membership-strip.tone-warning {
  background: linear-gradient(135deg, rgba(255, 251, 235, 0.96) 0%, rgba(255, 255, 255, 0.96) 100%);
  border-color: rgba(234, 179, 8, 0.18);
}

.portal-membership-strip.tone-warning .portal-membership-strip-badge {
  background: rgba(234, 179, 8, 0.14);
  color: #a16207;
}

.portal-membership-strip.tone-secondary {
  background: linear-gradient(135deg, rgba(241, 245, 249, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
  border-color: rgba(148, 163, 184, 0.22);
}

.portal-membership-strip.tone-secondary .portal-membership-strip-badge {
  background: rgba(148, 163, 184, 0.16);
  color: #475569;
}

.portal-membership-strip.tone-danger {
  background: linear-gradient(135deg, rgba(254, 242, 242, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
  border-color: rgba(239, 68, 68, 0.18);
}

.portal-membership-strip.tone-danger .portal-membership-strip-badge {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.portal-inline-note {
  padding: .85rem 1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(241, 245, 249, 0.96) 0%, rgba(255, 255, 255, 0.96) 100%);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #475569;
  font-size: .9rem;
  line-height: 1.6;
}

.membership-notice-modal {
  border: 0;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.18);
}

.membership-notice-modal .modal-body {
  padding: 2rem 2rem 1.7rem;
  text-align: center;
}

.membership-notice-icon {
  width: 66px;
  height: 66px;
  margin: 0 auto 1rem;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(124, 133, 199, 0.16) 0%, rgba(89, 99, 184, 0.12) 100%);
  color: var(--portal-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.membership-notice-icon i {
  font-size: 34px;
}

.membership-notice-kicker {
  color: var(--portal-accent-soft);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: .45rem;
}

.membership-notice-title {
  margin: 0 0 .75rem;
  color: #1e293b;
  font-size: 1.35rem;
  font-weight: 700;
}

.membership-notice-text {
  margin: 0;
  color: #64748b;
  line-height: 1.75;
  font-size: .95rem;
}

.membership-notice-actions {
  margin-top: 1.4rem;
  display: flex;
  justify-content: center;
  gap: .75rem;
  flex-wrap: wrap;
}

.action-confirm-icon {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16) 0%, rgba(249, 115, 22, 0.12) 100%);
  color: #c2410c;
}

.profile-shell {
  display: grid;
  gap: 22px;
  margin: 0 auto;
}

#profileAjaxAlertHost {
  margin-bottom: 16px;
}

.profile-hero {
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.22), transparent 28%),
    linear-gradient(135deg, #7c85c7 0%, #6671bb 44%, #5561ad 100%);
  border-radius: 24px;
  color: #fff;
  padding: 24px 26px;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 18px;
  box-shadow: 0 20px 38px rgba(73, 82, 160, 0.18);
}

.profile-hero-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.profile-hero-side {
  min-width: 280px;
  display: grid;
  gap: 12px;
}

.profile-hero-stat {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  padding: 16px 18px;
  backdrop-filter: blur(10px);
}

.profile-hero-stat span {
  display: block;
  font-size: .84rem;
  opacity: .82;
}

.profile-hero-stat strong {
  display: block;
  margin-top: 6px;
  font-size: 1.1rem;
  font-weight: 700;
  word-break: break-word;
}

.profile-banner {
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.22), transparent 26%),
    linear-gradient(135deg, #123d74, #1762a3 58%, #2f8fc1);
  border-radius: 20px;
  color: #fff;
  padding: 24px 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  box-shadow: 0 20px 34px rgba(17, 61, 116, 0.24);
}

.profile-kicker {
  font-size: .82rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .8;
  margin-bottom: 8px;
}

.profile-title {
  margin: 0 0 8px;
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
}

.profile-subtitle {
  margin: 0;
  max-width: 760px;
  color: rgba(255, 255, 255, .9);
}

.profile-banner-side {
  min-width: 210px;
}

.profile-badge {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 16px;
  padding: 16px 18px;
  backdrop-filter: blur(8px);
}

.profile-badge span {
  display: block;
  font-size: .86rem;
  opacity: .86;
}

.profile-badge strong {
  display: block;
  margin-top: 6px;
  font-size: 1.2rem;
  font-weight: 700;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.profile-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.profile-summary-grid-compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.profile-summary-card {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid #dfe8f5;
  border-radius: 22px;
  padding: 16px;
  box-shadow: 0 12px 26px rgba(73, 82, 160, 0.06);
  min-height: 136px;
}

.profile-summary-card-link {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.profile-summary-card-link:hover {
  transform: translateY(-2px);
  border-color: rgba(89, 99, 184, 0.24);
  box-shadow: 0 18px 32px rgba(73, 82, 160, 0.10);
}

.profile-summary-icon {
  width: 34px;
  height: 34px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: rgba(89, 99, 184, 0.1);
  color: var(--portal-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.profile-summary-icon i {
  font-size: 18px;
}

.profile-summary-label {
  color: #6b7e92;
  font-size: .8rem;
  margin-bottom: 4px;
}

.profile-summary-value {
  font-size: 1rem;
  font-weight: 700;
  color: #1f3147;
  margin-bottom: 6px;
  word-break: break-word;
}

.profile-summary-meta {
  color: #71859a;
  line-height: 1.5;
  font-size: .78rem;
}

.portal-membership-record-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(89, 99, 184, 0.10);
  color: #5963b8;
  font-size: .78rem;
  font-weight: 700;
}

.portal-membership-record-chip.is-trial {
  background: rgba(16, 185, 129, 0.12);
  color: #0f8a61;
}

.profile-membership-record-btn {
  min-width: 138px;
  min-height: 42px;
  padding: 0 18px;
}

.profile-membership-record-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  color: #71859a;
  font-size: .82rem;
}

.profile-membership-record-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.profile-membership-record-page-text {
  color: #64748b;
  font-size: .84rem;
}

#membershipRecordsModal .modal-dialog {
  max-width: 920px;
}

#membershipRecordsModal .modal-header {
  padding-top: 18px;
  padding-bottom: 8px;
}

#membershipRecordsModal .btn-close {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background-color: transparent;
  background-image: none;
  opacity: 1;
  border: 1px solid rgba(89, 99, 184, 0.16);
  box-shadow: none;
  position: relative;
}

#membershipRecordsModal .btn-close:hover {
  background-color: rgba(89, 99, 184, 0.08);
  border-color: rgba(89, 99, 184, 0.28);
}

#membershipRecordsModal .btn-close::before {
  content: "\00d7";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7398;
  font-size: 20px;
  line-height: 1;
  font-weight: 400;
}

#membershipRecordsModal .modal-body {
  padding-top: 8px;
  padding-bottom: 20px;
}

#membershipRecordsModal .portal-table-wrap {
  border-radius: 16px;
}

#membershipRecordsModal .table {
  font-size: .86rem;
  width: 100%;
  table-layout: auto;
}

#membershipRecordsModal .table thead th {
  font-size: .74rem;
  padding-top: 12px;
  padding-bottom: 12px;
  white-space: normal;
  color: #7380a0;
}

#membershipRecordsModal .table tbody td {
  font-size: .84rem;
  padding-top: 12px;
  padding-bottom: 12px;
  vertical-align: top;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

#membershipRecordsModal .portal-membership-record-chip {
  font-size: .72rem;
  padding: 5px 9px;
}

#membershipRecordsModal .table th:nth-child(1),
#membershipRecordsModal .table td:nth-child(1) {
  width: 18%;
  min-width: 122px;
}

#membershipRecordsModal .table th:nth-child(2),
#membershipRecordsModal .table td:nth-child(2) {
  width: 12%;
}

#membershipRecordsModal .table th:nth-child(3),
#membershipRecordsModal .table td:nth-child(3) {
  width: 10%;
  text-align: center;
}

#membershipRecordsModal .table th:nth-child(4),
#membershipRecordsModal .table td:nth-child(4) {
  width: 20%;
}

#membershipRecordsModal .table th:nth-child(5),
#membershipRecordsModal .table td:nth-child(5) {
  width: 12%;
  text-align: center;
}

#membershipRecordsModal .table th:nth-child(6),
#membershipRecordsModal .table td:nth-child(6) {
  width: 28%;
  min-width: 220px;
}

.profile-membership-record-note-cell {
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  line-height: 1.6;
  max-width: none;
}

.profile-edit-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: rgba(89, 99, 184, 0.08);
  color: var(--portal-accent);
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: .18s ease;
}

.profile-edit-btn:hover {
  background: var(--portal-accent);
  color: #fff;
}

.profile-card {
  background: #fff;
  border: 1px solid #e4ebf3;
  border-radius: 18px;
  box-shadow: 0 12px 24px rgba(20, 33, 61, 0.08);
  overflow: hidden;
}

.profile-card-accent {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.profile-card-wide {
  width: 100%;
}

.profile-modal {
  border: 0;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(73, 82, 160, 0.16);
}

.profile-modal .modal-header,
.profile-modal .modal-body {
  padding-left: 24px;
  padding-right: 24px;
}

.profile-modal .modal-header {
  padding-top: 22px;
  padding-bottom: 10px;
}

.profile-modal .modal-body {
  padding-bottom: 24px;
}

.profile-modal-kicker {
  color: var(--portal-accent-soft);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 4px;
}

.profile-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.profile-form-feedback {
  min-height: 20px;
  line-height: 1.6;
}

.profile-password-field {
  position: relative;
}

.profile-password-field .form-control {
  padding-right: 48px !important;
}

.profile-password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 32px;
  height: 32px;
  transform: translateY(-50%);
  border: 0;
  padding: 0;
  background: transparent;
  color: #7a8da3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.profile-password-toggle:hover,
.profile-password-toggle.is-active {
  color: var(--portal-accent);
}

.profile-password-toggle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.profile-step-panel {
  min-height: 280px;
}

.profile-stepper {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.profile-stepper-item {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: #f6f9fe;
  border: 1px solid #e3ebf7;
  transition: all .18s ease;
}

.profile-stepper-item.is-active {
  background: linear-gradient(180deg, #edf5ff 0%, #ffffff 100%);
  border-color: rgba(89, 99, 184, 0.26);
  box-shadow: 0 12px 24px rgba(89, 99, 184, 0.08);
}

.profile-stepper-item.is-done {
  border-color: rgba(17, 166, 117, 0.24);
  background: linear-gradient(180deg, #f2fcf8 0%, #ffffff 100%);
}

.profile-stepper-dot {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #e8ebfb;
  color: var(--portal-accent);
  font-size: .9rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.profile-stepper-item.is-active .profile-stepper-dot {
  background: var(--portal-accent);
  color: #fff;
}

.profile-stepper-item.is-done .profile-stepper-dot {
  background: #11a675;
  color: #fff;
}

.profile-stepper-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-stepper-text strong {
  color: #1f3147;
  font-size: .96rem;
  font-weight: 700;
}

.profile-stepper-text span {
  color: #7b8da3;
  font-size: .8rem;
}

.profile-stepper-line {
  width: 30px;
  height: 2px;
  background: linear-gradient(90deg, #cfe0f7, #dce8f8);
  border-radius: 999px;
  flex: 0 0 auto;
}

.profile-step-card {
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  border: 1px solid #e3ebf7;
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 14px 28px rgba(73, 82, 160, 0.06);
}

.profile-step-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: #eaf3ff;
  color: #1762a3;
  font-size: .82rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.profile-step-title {
  font-size: 1.08rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.profile-step-note {
  color: #6e8196;
  margin-bottom: 18px;
}

.profile-card-head {
  padding: 18px 20px 14px;
  border-bottom: 1px solid #edf2f7;
}

.profile-card-head h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.profile-card-eyebrow {
  font-size: .8rem;
  color: #6e7f92;
  margin-bottom: 6px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.profile-card-note {
  margin: 8px 0 0;
  color: #698095;
  font-size: .95rem;
}

.profile-form {
  padding: 20px;
}

.profile-phone-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.profile-phone-column {
  background: linear-gradient(180deg, #fbfdff 0%, #f5f9fd 100%);
  border: 1px solid #e4ebf3;
  border-radius: 16px;
  padding: 18px;
}

.profile-phone-column h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 700;
}

.profile-phone-column p {
  margin: 0 0 14px;
  color: #6a7f93;
}

.profile-phone-step {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e9f3ff;
  color: #1762a3;
  font-size: .82rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.profile-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 168px;
  gap: 10px;
}

.profile-code-row .btn {
  min-height: 48px;
  border-radius: 14px;
  padding: 0 14px;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.profile-submit-row {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 992px) {
  .portal-page-hero-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .portal-page-hero-actions {
    justify-content: flex-start;
  }

  .profile-hero,
  .profile-grid,
  .profile-phone-panel {
    grid-template-columns: 1fr;
  }

  .profile-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .profile-summary-grid-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-hero,
  .profile-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .profile-hero-side {
    width: 100%;
    min-width: 0;
  }

  .portal-membership-strip,
  .portal-membership-strip-main {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 576px) {
  .profile-hero,
  .profile-banner,
  .profile-form,
  .profile-card-head,
  .profile-phone-column,
  .profile-summary-card {
    padding: 16px;
  }

  .profile-code-row {
    grid-template-columns: 1fr;
  }

  .profile-summary-grid {
    grid-template-columns: 1fr;
  }

  .profile-summary-grid-compact {
    grid-template-columns: 1fr;
  }

  .profile-membership-record-pagination {
    justify-content: stretch;
  }

  .profile-membership-record-pagination .btn {
    flex: 1 1 0;
  }

  .profile-stepper {
    flex-direction: column;
    align-items: stretch;
  }

  .profile-stepper-line {
    width: 2px;
    height: 18px;
    margin: -4px auto;
  }

  .profile-submit-row {
    justify-content: stretch;
  }

.profile-submit-row .btn {
    width: 100%;
  }
}

button.is-submitting,
input.is-submitting[type="submit"] {
  cursor: wait !important;
  opacity: .92;
}

button.is-submitting {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.submit-loading-spinner {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  display: inline-block;
  animation: submit-loading-spin .7s linear infinite;
  flex: 0 0 auto;
}

.submit-loading-text {
  line-height: 1;
}

@keyframes submit-loading-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Admin portal-style override */
.admin-shell {
  font-size: 13.5px;
  background:
    radial-gradient(circle at top right, rgba(124, 133, 199, 0.10), transparent 24rem),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: #344767;
}

.admin-sidebar {
  background: linear-gradient(180deg, #7c85c7 0%, #6671bb 42%, #5561ad 100%);
  box-shadow: 0 22px 44px rgba(73, 82, 160, 0.18);
}

.admin-brand {
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffffff 0%, #eef2ff 100%);
  color: #5561ad;
  box-shadow: 0 10px 22px rgba(73, 82, 160, 0.16);
}

.admin-nav-link {
  font-size: 0.88rem;
  padding: 10px 12px;
  color: #f8fafc;
}

.admin-nav-link:hover {
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
}

.admin-nav-link.active {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.admin-side-user-label {
  color: rgba(248, 250, 252, 0.74);
}

.admin-sidebar-footer {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-topbar-kicker,
.admin-hero-kicker {
  color: #7c85c7;
  font-size: 0.74rem;
}

.admin-topbar-title {
  font-size: 1.45rem;
  color: #4952a0;
}

.admin-topbar-meta span,
.admin-status-pill,
.admin-status-chip {
  background: rgba(255, 255, 255, 0.95);
  color: #64748b;
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 18px rgba(73, 82, 160, 0.06);
}

.admin-hero,
.admin-surface-card,
.admin-dashboard-tile,
.admin-plan-card {
  background:
    radial-gradient(circle at top right, rgba(124, 133, 199, 0.08), transparent 20rem),
    linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  box-shadow: 0 14px 30px rgba(73, 82, 160, 0.05);
}

.admin-hero-title {
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  color: #4952a0;
}

.admin-hero-text,
.admin-action-hint,
.admin-inline-note,
.admin-user-cell span,
.profile-inline-note,
.admin-check-card small,
.admin-stat-label {
  color: #64748b;
}

.admin-stat-card,
.admin-mini-stat,
.admin-quick-plan {
  background: linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(240,243,255,.96) 100%);
  border: 1px solid rgba(89, 99, 184, 0.14);
  box-shadow: 0 12px 24px rgba(74, 85, 155, 0.08);
}

.admin-dashboard-grid,
.admin-plan-grid {
  gap: 12px;
}

.admin-dashboard-tile h3,
.admin-section-title,
.admin-subtitle {
  font-size: 0.98rem;
  color: #4952a0;
}

.admin-dashboard-tile p {
  color: #64748b;
}

.admin-dashboard-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #7c85c7 0%, #5963b8 100%);
  box-shadow: 0 10px 18px rgba(73, 82, 160, 0.16);
}

.admin-table thead th {
  background: #f8fafc;
  color: #64748b;
  font-size: 0.72rem;
  border-bottom: 1px solid #e2e8f0;
}

.admin-table tbody td {
  border-color: #e2e8f0;
}

.admin-primary-btn {
  background: linear-gradient(135deg, #7c85c7 0%, #5963b8 100%);
  color: #fff;
  border: 0;
  box-shadow: 0 10px 22px rgba(73, 82, 160, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.admin-primary-btn:hover {
  background: linear-gradient(135deg, #6e77c0 0%, #4952a0 100%);
  color: #fff;
}

.admin-soft-btn,
.admin-danger-btn,
.admin-danger-outline-btn {
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
}

.admin-soft-btn {
  background: rgba(89, 99, 184, 0.08);
  color: #5963b8;
  border: 1px solid rgba(89, 99, 184, 0.14);
}

.admin-soft-btn:hover {
  background: rgba(89, 99, 184, 0.14);
  color: #4952a0;
}

.admin-danger-btn {
  background: linear-gradient(135deg, #f47c7c 0%, #df5b72 100%);
  color: #fff;
  border: 0;
  box-shadow: 0 10px 18px rgba(223, 91, 114, 0.18);
}

.admin-danger-btn:hover {
  color: #fff;
  background: linear-gradient(135deg, #eb7070 0%, #d24e65 100%);
}

.admin-danger-outline-btn {
  background: rgba(239, 68, 68, 0.06);
  color: #d14f64;
  border: 1px solid rgba(239, 68, 68, 0.16);
}

.admin-danger-outline-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #c23f56;
}

.admin-ghost-btn {
  background: #fff;
  color: #5963b8;
  border: 1px solid rgba(89, 99, 184, 0.22);
}

.admin-ghost-btn:hover {
  background: rgba(89, 99, 184, 0.08);
  color: #4952a0;
}

.admin-plan-price-preview {
  background: linear-gradient(135deg, #7c85c7 0%, #5963b8 100%);
  padding: 14px;
}

.admin-plan-badge {
  background: rgba(255, 255, 255, 0.14);
}

.admin-action-bar {
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
}

.admin-check-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid #e3ebf7;
}

.admin-check-card-right {
  justify-content: space-between;
  align-items: center;
}

.admin-check-card-right .form-check-input {
  margin: 0 0 0 auto;
}

#membershipPlanModal .row.g-3 > [class*='col-'] {
  display: flex;
  flex-direction: column;
}

#membershipPlanModal .form-label {
  min-height: 20px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
}

#membershipPlanModal .form-control {
  min-height: 42px;
}

#membershipPlanModal textarea.form-control {
  min-height: 96px;
}

.admin-check-card strong,
.admin-info-list strong,
.admin-mini-stat strong,
.admin-stat-value {
  color: #1f3147;
}

.admin-user-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 0 0;
}

.admin-pagination-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-plan-grid-compact {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.admin-plan-card-compact {
  padding: 16px;
}

.admin-plan-badge-compact {
  margin-bottom: 8px;
  font-size: 0.74rem;
  padding: 4px 8px;
}

.admin-plan-name-compact {
  font-size: 1rem;
  font-weight: 700;
  color: #1f3147;
}

.admin-plan-key-compact {
  margin-top: 4px;
  color: #7b8da3;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.admin-plan-price-compact {
  margin-top: 12px;
  color: #4952a0;
}

.admin-plan-price-compact span {
  font-size: 0.9rem;
  vertical-align: top;
}

.admin-plan-price-compact strong {
  font-size: 1.5rem;
  line-height: 1;
}

.admin-plan-price-compact em {
  margin-left: 8px;
  font-style: normal;
  color: #94a3b8;
  text-decoration: line-through;
  font-size: 0.84rem;
}

.admin-plan-meta-compact,
.admin-plan-desc-compact {
  margin-top: 8px;
  color: #64748b;
  font-size: 0.82rem;
  line-height: 1.55;
}

.admin-plan-desc-compact {
  min-height: 38px;
}

.admin-plan-actions-row {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.admin-plan-actions-row form {
  margin: 0;
}

.admin-hero-side > .btn,
.admin-hero-side > .admin-stat-card {
  flex: 0 0 auto;
}

@media (max-width: 768px) {
  .admin-hero-side {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .admin-icon-btn,
  .admin-stat-card {
    min-width: 108px;
    min-height: 64px;
  }
}

.admin-detail-grid > .admin-surface-card,
.admin-detail-grid-bottom > .admin-surface-card {
  height: 100%;
}
