:root {
  color: #445c6a;
}

body,
.app-body {
  margin: 0;
  background: #f7fbfc;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
    sans-serif;
  color: #364152;
}

.app-shell {
  display: flex;
  min-height: calc(100vh - 112px);
}

.app-content {
  flex: 1;
  padding: 2rem;
  background: #f7fbfc;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header__brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, #4ca1af, #2c3e50);
  display: grid;
  place-items: center;
  color: white;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.brand-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #1f2a37;
}

.brand-subtitle {
  margin: 0;
  font-size: 0.85rem;
  color: #94a3b8;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid #d1d9e6;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6d8290;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.icon-button:hover {
  border-color: #4ca1af;
  color: #2c3e50;
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: #edf5f7;
  color: #1f2a37;
}

.user-chip__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #4ca1af;
  color: white;
  display: grid;
  place-items: center;
  font-weight: 600;
}

.user-chip__name {
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
}

.user-chip__role {
  margin: 0;
  font-size: 0.8rem;
  color: #6d8290;
}

.sidebar {
  width: 250px;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
}

.sidebar__inner {
  padding: 2rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidebar__section-label {
  text-transform: uppercase;
  color: #94a3b8;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

.sidebar__menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidebar__link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 0.85rem;
  border-radius: 0.75rem;
  border: none;
  background: transparent;
  color: #6d8290;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar__link svg {
  width: 20px;
  height: 20px;
}

.sidebar__link--active,
.sidebar__link:hover {
  background: #ebf3f9;
  color: #3e5461;
}

.sidebar__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}

.sidebar__label {
  flex: 1;
}

.sidebar__chevron {
  font-size: 1.1rem;
  color: inherit;
}

.sidebar__group {
  border-radius: 0.85rem;
  background: #f7fbfc;
  padding: 0.1rem 0.35rem 0.35rem;
}

.sidebar__group[open] {
  background: #d8f4ff;
}

.sidebar__group > summary::-webkit-details-marker {
  display: none;
}

.sidebar__group > summary {
  cursor: pointer;
}

.sidebar__link--expanded .sidebar__chevron {
  transition: transform 0.2s ease;
}

.sidebar__group:not([open]) .sidebar__link--expanded .sidebar__chevron {
  transform: rotate(-90deg);
}

.sidebar__sublist {
  list-style: none;
  margin: 0.5rem 0 0 2.3rem;
  padding-left: 1rem;
  border-left: 2px solid #36c1e1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar__subitem {
  position: relative;
  display: inline-flex;
  padding-left: 0.75rem;
  color: #4c5d70;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}

.sidebar__subitem::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #36c1e1;
  position: absolute;
  left: -1.15rem;
  top: 0.55rem;
}

.sidebar__subitem--active {
  color: #0f172a;
  font-weight: 600;
}

.sidebar__subitem--active::before {
  box-shadow: 0 0 0 4px #b6ecfa;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.page-title {
  margin: 0;
  font-size: 1.5rem;
  color: #1f2a37;
}

.eyebrow,
.card__eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  font-weight: 600;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.cards-grid--purchase {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr);
  align-items: flex-start;
}

@media (max-width: 960px) {
  .cards-grid--purchase {
    grid-template-columns: minmax(0, 1fr);
  }
}

.card {
  padding: 1.25rem;
  background: #fff;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 30px rgb(15 23 42 / 0.07);
}

.card__section {
  margin-bottom: 1rem;
}

.card__section--border-top {
  border-top: 1px solid #e5e7eb;
  padding-top: 1rem;
}

.card__value {
  margin: 0;
  font-size: 1.75rem;
  color: #0f172a;
}

.site-footer {
  margin-top: auto;
  padding: 1.5rem 2rem;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: #6d8290;
}

.site-footer__links {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
}

.site-footer__links a {
  color: #4ca1af;
  text-decoration: none;
  font-weight: 500;
}

.site-footer__links a:hover {
  text-decoration: underline;
}

.breadcrumb {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.9rem;
  color: #6b7a90;
}

.breadcrumb a {
  color: #38bdf8;
  text-decoration: none;
}

.breadcrumb strong {
  color: #0f172a;
}

.profile-card {
  margin-bottom: 1.5rem;
}

.profile-card__header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.profile-card__avatar {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: #0ea5e9;
  color: white;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  font-weight: 600;
}

.profile-card__name {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
}

.profile-card__role {
  margin: 0.15rem 0 0;
  color: #6d8290;
}

.profile-card__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.profile-card__stat-label {
  margin: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
}

.profile-card__stat-value {
  margin: 0.25rem 0 0;
  font-size: 1.4rem;
  font-weight: 600;
  color: #0f172a;
}

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

.section-title {
  margin: 0;
  font-size: 1.25rem;
  color: #0f172a;
}

.btn-primary,
.btn-outline {
  border-radius: 999px;
  padding: 0.55rem 1.5rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}

.btn-primary {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: white;
  border: none;
  box-shadow: 0 10px 20px rgb(14 165 233 / 0.2);
}

.btn-outline {
  background: transparent;
  border: 1px solid #0ea5e9;
  color: #0ea5e9;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem 1.25rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.input-group label {
  font-weight: 600;
  color: #475467;
}

.input-group input {
  border-radius: 0.8rem;
  border: 1px solid #d0d5dd;
  padding: 0.65rem 0.85rem;
  font-size: 0.95rem;
}

.input-group input:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgb(14 165 233 / 0.2);
}

.input-group.span-2 {
  grid-column: span 2;
}

.security-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.security-list article {
  padding: 1.1rem;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  background: #f8fbff;
}

.security-list h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.security-list p {
  margin: 0 0 0.65rem;
  color: #5f6c84;
}

.link-button {
  background: transparent;
  border: none;
  color: #0ea5e9;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

/* Reports / tables / badges
   -------------------------------------------------- */

.page-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.toolbar__group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
}

.field__label {
  font-weight: 600;
  color: #6b7280;
}

.field__control {
  border-radius: 0.75rem;
  border: 1px solid #d1d5db;
  padding: 0.45rem 0.8rem;
  font-size: 0.9rem;
  min-width: 160px;
}

.field__control:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgb(14 165 233 / 0.18);
}

.card__header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.card__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #0f172a;
}

.card__meta {
  margin: 0;
  font-size: 0.9rem;
  color: #6b7280;
}

.card__chart {
  margin-top: 0.5rem;
}

.card__chart canvas {
  width: 100%;
  max-width: 100%;
  display: block;
}

.chart-legend {
  display: inline-flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.chart-legend__item {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.85rem;
  color: #6b7280;
}

.chart-legend__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.chart-legend__dot--primary {
  background: #4f46e5;
}

.chart-legend__dot--secondary {
  background: #60a5fa;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table thead th {
  text-align: left;
  padding: 0.6rem 0.5rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ca3af;
  border-bottom: 1px solid #e5e7eb;
}

.table tbody td {
  padding: 0.55rem 0.5rem;
  color: #111827;
  border-bottom: 1px solid #edf2f7;
}

.table tbody tr:nth-child(odd) {
  background: #f9fafb;
}

.table tbody tr:hover {
  background: #eff6ff;
}

.table--compact thead th,
.table--compact tbody td {
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge--success {
  background: #dcfce7;
  color: #166534;
}

.badge--warning {
  background: #ffedd5;
  color: #9a3412;
}

.badge--danger {
  background: #fee2e2;
  color: #b91c1c;
}

.badge--muted {
  background: #e5e7eb;
  color: #374151;
}

/* Purchase & Repurchase page
   -------------------------------------------------- */

.tabs {
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.1rem;
  border-radius: 999px;
  background: #e5f3f9;
  margin-bottom: 0; /* spacing handled by the panel below */
}

/* Ensure tab content (including the search bar) sits clearly below the pill tabs */
.tabs + .tabs__panel {
  margin-top: 1.25rem;
}

.tabs__tab {
  border: none;
  background: transparent;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.tabs__tab--active {
  background: #0ea5e9;
  color: #f9fafb;
  box-shadow: 0 8px 16px rgb(14 165 233 / 0.25);
}

.tabs__panel {
  display: none;
}

.tabs__panel--active {
  display: block;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #4b5563;
}

.field-with-icon {
  position: relative;
}

.text-input {
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid #d1d5db;
  padding: 0.55rem 0.75rem;
  font-size: 0.9rem;
}

.text-input--sm {
  padding: 0.35rem 0.55rem;
  font-size: 0.85rem;
}

.text-input:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgb(14 165 233 / 0.18);
}

.purchase-search {
  margin-bottom: 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  border-radius: 999px;
  border: none;
  padding: 0.45rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease;
}

.btn--sm {
  padding: 0.3rem 0.9rem;
  font-size: 0.8rem;
}

.btn--ghost {
  background: #e5f0ff;
  color: #111827;
  box-shadow: none;
}

.btn--ghost:hover {
  background: #d4e2ff;
  transform: translateY(-1px);
}

.btn--primary {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #f9fafb;
  box-shadow: 0 8px 18px rgb(14 165 233 / 0.28);
}

.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgb(14 165 233 / 0.32);
}

.btn--full {
  width: 100%;
}

.cart-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cart-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.cart-list__title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #111827;
}

.cart-list__meta {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: #6b7280;
}

.cart-list__price {
  font-weight: 600;
  color: #111827;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
  color: #4b5563;
}

.summary-row--total {
  margin-top: 0.35rem;
  font-weight: 700;
  color: #111827;
}

/* Make purchase table more robust so buttons don't overlap on smaller widths */
.purchase-table-wrapper {
  overflow-x: auto;
}

.purchase-table {
  min-width: 640px;
}

.purchase-table__qty .text-input--sm {
  max-width: 96px;
  width: 100%;
}

.purchase-table__action {
  white-space: nowrap;
}

/* ---- Mobile card layout for purchase & repurchase tables ---- */
@media (max-width: 768px) {
  /* Remove min-width so the table doesn't force horizontal scroll */
  .purchase-table {
    min-width: 0;
  }

  /* Convert table to block layout */
  .purchase-table,
  .purchase-table thead,
  .purchase-table tbody,
  .purchase-table tr,
  .purchase-table th,
  .purchase-table td,
  #tab-repurchase .table,
  #tab-repurchase .table thead,
  #tab-repurchase .table tbody,
  #tab-repurchase .table tr,
  #tab-repurchase .table th,
  #tab-repurchase .table td {
    display: block;
  }

  /* Hide table headers on mobile */
  .purchase-table thead,
  #tab-repurchase .table thead {
    display: none;
  }

  /* Each row becomes a card */
  .purchase-table tbody tr,
  #tab-repurchase .table tbody tr {
    background: #f8fbff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
    margin-bottom: 0.75rem;
  }

  .purchase-table tbody tr:hover,
  #tab-repurchase .table tbody tr:hover {
    background: #eff6ff;
  }

  /* Remove default table cell borders */
  .purchase-table tbody td,
  #tab-repurchase .table tbody td {
    border-bottom: none;
    padding: 0.3rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }

  /* Show data-label as pseudo-element */
  .purchase-table tbody td[data-label]::before,
  #tab-repurchase .table tbody td[data-label]::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    flex-shrink: 0;
    min-width: 60px;
  }

  /* Qty input takes remaining space */
  .purchase-table__qty {
    justify-content: space-between !important;
  }

  .purchase-table__qty .text-input--sm {
    max-width: 80px;
  }

  /* Add to cart button goes full width */
  .purchase-table__action {
    white-space: normal;
    padding-top: 0.5rem !important;
    border-top: 1px solid #e5e7eb;
    margin-top: 0.35rem;
    justify-content: center !important;
  }

  .purchase-table__action .btn {
    width: 100%;
  }

  /* Repurchase action buttons wrap */
  .repurchase-table__actions {
    flex-wrap: wrap;
    gap: 0.5rem !important;
    padding-top: 0.5rem !important;
    border-top: 1px solid #e5e7eb;
    margin-top: 0.35rem;
    justify-content: flex-start !important;
  }

  .repurchase-table__actions .btn {
    flex: 1;
    text-align: center;
    min-width: 0;
  }

  /* Cart list text wrapping */
  .cart-list__title {
    word-break: break-word;
  }

  .cart-list__meta {
    word-break: break-word;
  }

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

  /* Order summary section on mobile */
  .cards-grid--purchase .card {
    overflow: hidden;
  }

  .cards-grid--purchase .card__section {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Purchase table wrapper: let content flow naturally on mobile */
  .purchase-table-wrapper {
    overflow: visible;
    max-height: none !important;
  }

  /* Modal order details table → card layout */
  .modal-order-table,
  .modal-order-table thead,
  .modal-order-table tbody,
  .modal-order-table tr,
  .modal-order-table th,
  .modal-order-table td {
    display: block;
  }

  .modal-order-table thead {
    display: none;
  }

  .modal-order-table tbody tr {
    background: #f8fbff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.5rem;
  }

  .modal-order-table tbody td {
    border-bottom: none;
    padding: 0.25rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .modal-order-table tbody td[data-label]::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.8rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  /* Modal footer buttons stack on very small screens */
  .modal__footer {
    flex-direction: column;
  }

  .modal__footer .btn {
    width: 100%;
    text-align: center;
  }
}

/* ---- Universal mobile card table layout ---- */
@media (max-width: 768px) {
  /* Convert any table with .mobile-card-table to block layout */
  .mobile-card-table,
  .mobile-card-table thead,
  .mobile-card-table tbody,
  .mobile-card-table tfoot,
  .mobile-card-table tr,
  .mobile-card-table th,
  .mobile-card-table td {
    display: block;
  }

  /* Remove min-width on mobile */
  .mobile-card-table {
    min-width: 0 !important;
  }

  /* Hide table headers */
  .mobile-card-table thead {
    display: none;
  }

  /* Each row becomes a card */
  .mobile-card-table tbody tr {
    background: #f8fbff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
    margin-bottom: 0.75rem;
  }

  .mobile-card-table tbody tr:nth-child(odd) {
    background: #f8fbff;
  }

  .mobile-card-table tbody tr:hover {
    background: #eff6ff;
  }

  /* Remove default table cell styles */
  .mobile-card-table tbody td {
    border-bottom: none;
    padding: 0.3rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    text-align: left !important;
  }

  /* Show data-label as pseudo-element */
  .mobile-card-table tbody td[data-label]::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    flex-shrink: 0;
    min-width: 80px;
  }

  /* Footer row in tables (totals, etc) */
  .mobile-card-table tfoot tr {
    background: #edf5ff;
    border: 1px solid #d1e3ff;
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
    margin-top: 0.5rem;
  }

  .mobile-card-table tfoot td {
    border-bottom: none;
    padding: 0.3rem 0;
    text-align: left !important;
  }

  /* Action buttons inside mobile card rows */
  .mobile-card-table td[data-label="Actions"] {
    padding-top: 0.5rem !important;
    border-top: 1px solid #e5e7eb;
    margin-top: 0.35rem;
    flex-wrap: wrap;
  }

  .mobile-card-table td[data-label="Actions"] .btn {
    flex: 1;
    text-align: center;
    min-width: 0;
  }

  .mobile-card-table td[data-label="Actions"] form {
    flex: 1;
  }

  .mobile-card-table td[data-label="Actions"] form .btn {
    width: 100%;
    text-align: center;
  }

  /* Pending members confirm/reject buttons */
  .mobile-card-table td[data-label="Actions"] > div {
    width: 100%;
    flex-wrap: wrap;
  }

  .mobile-card-table td[data-label="Actions"] > div .btn {
    flex: 1;
    min-width: 0;
    text-align: center;
  }

  .mobile-card-table td[data-label="Actions"] > div form {
    flex: 1;
  }

  .mobile-card-table td[data-label="Actions"] > div form .btn {
    width: 100%;
  }

  /* Database badges in admin table */
  .mobile-card-table td[data-label="Databases"] > div {
    flex-wrap: wrap;
  }

  /* Parent scroll wrapper: let content flow on mobile */
  .mobile-card-table-wrapper {
    overflow: visible !important;
    max-height: none !important;
  }

  /* Override scrolling wrappers that contain mobile-card-tables */
  .mobile-card-parent {
    overflow: visible !important;
    max-height: none !important;
  }

  /* Payment history table (inline styles) */
  .mobile-card-table th,
  .mobile-card-table td {
    padding: 0.3rem 0 !important;
  }

  .mobile-card-table tbody tr td:first-child {
    padding-top: 0 !important;
  }
}

/* My Team table tweaks */
.team-table thead th {
  white-space: nowrap;
}

.team-table tbody td:nth-child(2) {
  white-space: nowrap;
}

.team-table tbody td:nth-child(5),
.team-table tbody td:nth-child(6),
.team-table tbody td:nth-child(7),
.team-table tbody td:nth-child(8) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.team-table tbody td:nth-child(9) {
  white-space: nowrap;
}

.team-table__actions-heading,
.team-table tbody td:last-child {
  text-align: right;
  white-space: nowrap;
}

.team-table tbody tr:nth-child(odd) {
  background: #f9fbff;
}

.team-table tbody tr:hover {
  background: #edf5ff;
}

/* Simple modal */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.modal--open {
  display: flex;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(15 23 42 / 0.55);
}

.modal__dialog {
  position: relative;
  max-width: 520px;
  width: 100%;
  margin: 1rem;
  background: #ffffff;
  border-radius: 1rem;
  box-shadow: 0 25px 60px rgb(15 23 42 / 0.35);
  padding: 1.25rem 1.5rem 1.25rem;
  z-index: 41;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.modal__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #0f172a;
}

.modal__close {
  border: none;
  background: transparent;
  font-size: 1.25rem;
  cursor: pointer;
  color: #6b7280;
}

.modal__body {
  margin-top: 0.25rem;
}

.modal__footer {
  margin-top: 1rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Profile Page Styles */
.profile-avatar-large {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 2px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
}

.profile-avatar-large:hover {
  background: #e2e8f0;
}

.profile-upload-tooltip {
  position: absolute;
  top: -45px;
  left: 50%;
  transform: translateX(-50%);
  background: #1f2a37;
  color: white;
  padding: 0.4rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  z-index: 10;
}

.profile-upload-tooltip::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid #1f2a37;
}

.profile-username {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2a37;
}

.profile-role {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: #6d8290;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.profile-doj {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: #94a3b8;
}

.profile-url-box {
  background: #8b5cf6;
  color: white;
  padding: 0.65rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  text-align: center;
  word-break: break-all;
  font-weight: 500;
}

.profile-contact {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.profile-contact-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.profile-contact-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #475467;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.profile-contact-value {
  font-size: 0.9rem;
  color: #1f2a37;
  line-height: 1.5;
}

.social-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #d1d9e6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6d8290;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.social-icon:hover {
  border-color: #4ca1af;
  color: #2c3e50;
  background: #f7fbfc;
}

/* Profile Tabs */
.profile-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 2rem;
  padding: 0;
}

.profile-tab {
  border: none;
  background: transparent;
  padding: 0.85rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: #6d8290;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.profile-tab:hover {
  color: #2c3e50;
  background: #f7fbfc;
}

.profile-tab--active {
  color: #0ea5e9;
  border-bottom-color: #0ea5e9;
  font-weight: 600;
  background: transparent;
}

.profile-tab svg {
  flex-shrink: 0;
}

.profile-tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.profile-tab-content--active {
  display: block;
}

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

.profile-tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #e2e8f0;
}

.profile-tab-header > div:first-child {
  flex: 1;
}

.profile-tab-title {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 600;
  color: #0f172a;
}

.profile-tab-subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: #6b7280;
  line-height: 1.5;
}

/* Profile Form */
.profile-form {
  margin-top: 0.5rem;
}

.profile-form .input-group {
  margin-bottom: 0.5rem;
}

.profile-form input {
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.profile-form input:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgb(14 165 233 / 0.1);
}

/* Draft Form */
.draft-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 800px;
}

.draft-form .input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.draft-form label {
  font-weight: 600;
  color: #475467;
  font-size: 0.9rem;
}

.required-asterisk {
  color: #dc2626;
  font-weight: 600;
}

.draft-form input,
.draft-form textarea {
  border-radius: 0.5rem;
  border: 1px solid #d0d5dd;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  background: #ffffff;
}

.draft-form input:focus,
.draft-form textarea:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgb(14 165 233 / 0.1);
}

.draft-form textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.6;
}

.draft-form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

.btn--cancel {
  background: #475467;
  color: white;
  border: none;
}

.btn--cancel:hover {
  background: #374151;
  transform: translateY(-1px);
}

.btn--outline {
  background: transparent;
  border: 1px solid #0ea5e9;
  color: #0ea5e9;
  padding: 0.5rem 1.25rem;
  font-weight: 600;
  border-radius: 0.5rem;
  transition: all 0.15s ease;
}

.btn--outline:hover {
  background: #eff6ff;
  border-color: #0284c7;
  color: #0284c7;
}

/* Security Items */
.security-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: #f8fbff;
  margin-bottom: 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.security-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgb(15 23 42 / 0.05);
}

.security-item__content {
  flex: 1;
}

.security-item__title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: #0f172a;
}

.security-item__description {
  margin: 0;
  font-size: 0.9rem;
  color: #5f6c84;
  line-height: 1.6;
}

@media (max-width: 960px) {
  .profile-page-layout {
    grid-template-columns: 1fr;
  }
}

/* ==================== Alert Messages ==================== */
.alert-messages {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 420px;
  pointer-events: none;
}

.alert {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  font-weight: 500;
  font-size: 0.925rem;
  line-height: 1.4;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
  animation: alertSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: auto;
  backdrop-filter: blur(8px);
}

.alert::before {
  content: '';
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.alert--success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.alert--success::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M5 13l4 4L19 7'/%3E%3C/svg%3E");
}

.alert--error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.alert--error::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6 18L18 6M6 6l12 12'/%3E%3C/svg%3E");
}

.alert--info {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.alert--info::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z'/%3E%3C/svg%3E");
}

.alert--warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.alert--warning::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z'/%3E%3C/svg%3E");
}

.alert.fade-out {
  animation: alertFadeOut 0.4s ease forwards;
}

@keyframes alertSlideIn {
  from {
    transform: translateX(120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes alertFadeOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(120%);
    opacity: 0;
  }
}

@media (max-width: 480px) {
  .alert-messages {
    left: 1rem;
    right: 1rem;
    max-width: none;
  }
  
  .alert {
    font-size: 0.875rem;
  }
}

/* ==================== Mobile Responsive ==================== */

/* Hamburger button — hidden on desktop */
.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid #d1d9e6;
  background: #fff;
  color: #6d8290;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.hamburger-btn:hover {
  border-color: #4ca1af;
  color: #2c3e50;
}

/* Header left group */
.site-header__left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Sidebar overlay — hidden on desktop */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 19;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Sidebar mobile header — hidden on desktop */
.sidebar__mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 1rem 0;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.sidebar__mobile-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: #1f2a37;
}

.sidebar__close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f7fbfc;
  color: #6d8290;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sidebar__close-btn:hover {
  background: #e2e8f0;
  color: #1f2a37;
}

/* ---- Tablet breakpoint (960px) ---- */
@media (max-width: 960px) {
  .site-header {
    padding: 0.75rem 1.25rem;
  }

  .app-content {
    padding: 1.25rem;
  }

  /* Hide user name/role text on tablet, keep avatar */
  .user-chip__name,
  .user-chip__role {
    display: none;
  }

  .user-chip {
    padding: 0.25rem;
    background: transparent;
  }
}

/* ---- Mobile breakpoint (768px) ---- */
@media (max-width: 768px) {
  /* Show hamburger */
  .hamburger-btn {
    display: flex;
  }

  /* Header */
  .site-header {
    padding: 0.65rem 1rem;
    gap: 0.5rem;
  }

  .site-header__actions {
    gap: 0.35rem;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 0.85rem;
  }

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

  .icon-button {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .icon-button svg {
    width: 16px;
    height: 16px;
  }

  /* Sidebar off-canvas */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    z-index: 20;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar--open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  }

  .sidebar-overlay--visible {
    display: block;
    opacity: 1;
  }

  .sidebar__mobile-header {
    display: flex;
  }

  /* App shell stacks */
  .app-shell {
    flex-direction: column;
    min-height: auto;
  }

  .app-content {
    padding: 1rem;
  }

  /* Tables */
  .table {
    font-size: 0.8rem;
  }

  .table thead th {
    font-size: 0.7rem;
    padding: 0.5rem 0.35rem;
  }

  .table tbody td {
    padding: 0.45rem 0.35rem;
  }

  /* Cards */
  .cards-grid {
    grid-template-columns: 1fr;
  }

  /* Page head */
  .page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  /* Section head */
  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  /* Toolbar */
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  /* Form grid */
  .form-grid {
    grid-template-columns: 1fr;
  }

  .input-group.span-2 {
    grid-column: span 1;
  }

  /* Footer */
  .site-footer {
    padding: 1rem 1.25rem;
    flex-direction: column;
    text-align: center;
    font-size: 0.8rem;
  }

  /* Profile page layout override */
  .profile-card__stats {
    grid-template-columns: 1fr 1fr;
  }

  /* Security items */
  .security-item {
    flex-direction: column;
    gap: 1rem;
  }

  /* Profile tabs */
  .profile-tabs {
    margin-bottom: 1rem;
  }

  .profile-tab-header {
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
  }

  /* Modal adjustments */
  .modal__dialog {
    margin: 0.5rem;
    max-width: calc(100% - 1rem);
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
  }

  .modal__title {
    font-size: 1rem;
  }
}

/* ---- Small phone breakpoint (480px) ---- */
@media (max-width: 480px) {
  .site-header {
    padding: 0.5rem 0.75rem;
  }

  .brand-title {
    display: none;
  }

  .app-content {
    padding: 0.75rem;
  }

  .card {
    padding: 1rem;
    border-radius: 0.75rem;
  }

  .page-title {
    font-size: 1.25rem;
  }

  .section-title {
    font-size: 1.1rem;
  }

  .sidebar {
    width: 260px;
  }

  /* Modal full-screen on very small phones */
  .modal__dialog {
    margin: 0;
    max-width: 100%;
    min-height: 100vh;
    border-radius: 0;
    padding: 1rem;
  }

  .btn-modal {
    padding: 0.65rem 1rem;
    font-size: 0.875rem;
  }
}

/* ==================== Global Mobile Overrides ==================== */
/* These target common inline-style patterns across all pages        */

@media (max-width: 768px) {
  /* --- Page titles set via inline style --- */
  [style*="font-size: 2rem"],
  [style*="font-size: 1.5rem"] {
    font-size: 1.25rem !important;
  }

  /* --- Inline padding on tab/card content areas --- */
  [style*="padding: 2rem"] {
    padding: 1.25rem !important;
  }

  /* --- Inline grid layouts with minmax(250px) or minmax(350px) --- */
  [style*="grid-template-columns: repeat(auto-fit, minmax(250px"],
  [style*="grid-template-columns: repeat(auto-fill, minmax(350px"],
  [style*="grid-template-columns: repeat(auto-fill, minmax(300px"] {
    grid-template-columns: 1fr !important;
  }

  /* --- Inline 2-column grids (city/state, zip/country, expiry/cvv) --- */
  [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* --- Inline flex row with justify-content: space-between (header+button combos) --- */
  [style*="display: flex"][style*="justify-content: space-between"][style*="align-items: center"][style*="margin-bottom"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
  }

  /* --- Inline form action rows (Cancel + Save side-by-side) --- */
  [style*="display: flex"][style*="justify-content: flex-end"][style*="gap: 1rem"][style*="border-top"] {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  [style*="display: flex"][style*="justify-content: flex-end"][style*="gap: 1rem"][style*="border-top"] button {
    width: 100% !important;
    text-align: center !important;
  }

  /* --- Inline flex containers for card action buttons --- */
  [style*="display: flex"][style*="gap: 0.75rem"] > button,
  [style*="display: flex"][style*="gap: 0.5rem"] > button {
    font-size: 0.8rem !important;
    padding: 0.4rem 0.75rem !important;
  }

  /* --- Payment card inline flex (card info + action buttons) --- */
  [style*="display: flex"][style*="justify-content: space-between"][style*="align-items: center"][style*="padding: 1.5rem"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
    padding: 1.25rem !important;
  }

  /* --- Inline "display: flex; align-items: center; gap: 1.5rem" (card info rows) --- */
  [style*="display: flex"][style*="align-items: center"][style*="gap: 1.5rem"] {
    gap: 1rem !important;
  }

  /* --- Card value sizing on small screens --- */
  .card__value {
    font-size: 1.4rem;
  }

  /* --- Margin-top spacing on page sections --- */
  [style*="margin-top: 2rem"] {
    margin-top: 1.25rem !important;
  }

  [style*="margin-top: 1.5rem"] {
    margin-top: 1rem !important;
  }

  /* --- Table scroll wrapper for all tables --- */
  [style*="overflow-x: auto"],
  [style*="overflow: auto"] {
    -webkit-overflow-scrolling: touch;
  }

  /* --- Toolbar filter fields --- */
  .field__control {
    min-width: 0;
    width: 100%;
  }

  .toolbar__group {
    flex-direction: column;
    width: 100%;
  }

  .toolbar__group .field {
    width: 100%;
  }

  /* --- Inline padding on info cards --- */
  [style*="padding: 1.5rem"] {
    padding: 1rem !important;
  }

  /* --- Custom inline modals (PaymentProfile, ManageAddress) --- */
  [style*="position: fixed"][style*="z-index: 1000"] > div {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }

  [style*="position: fixed"][style*="z-index: 1000"] {
    padding: 0 !important;
    align-items: stretch !important;
  }

  /* --- Filter row wrapping (Payment history filters) --- */
  [style*="display: flex"][style*="gap: 1rem"][style*="flex-wrap: wrap"] {
    flex-direction: column !important;
  }

  [style*="display: flex"][style*="gap: 1rem"][style*="flex-wrap: wrap"] > select,
  [style*="display: flex"][style*="gap: 1rem"][style*="flex-wrap: wrap"] > input {
    width: 100% !important;
  }
}

@media (max-width: 480px) {
  .card__value {
    font-size: 1.2rem;
  }

  .card__eyebrow {
    font-size: 0.75rem;
  }

  .card__meta {
    font-size: 0.8rem;
  }

  .badge {
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
  }

  .btn, .btn--sm {
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
  }

  /* Ensure inputs don't zoom on iOS */
  input, select, textarea {
    font-size: 16px !important;
  }
}
