/* Shared admin mobile / modal utilities */

body.admin-dark .admin-content {
  max-width: 100%;
  overflow-x: hidden;
}

body.admin-dark .table-stack {
  width: 100%;
}

@media (max-width: 900px) {
  body.admin-dark table.table-stack thead {
    display: none;
  }
  body.admin-dark table.table-stack tr {
    display: block;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    background: #fff;
  }
  body.admin-dark table.table-stack td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.45rem 0;
    border: none;
    text-align: right;
    word-break: break-word;
  }
  body.admin-dark table.table-stack td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #6b7280;
    text-align: left;
    flex: 0 0 var(--stack-label-w, 42%);
  }
  body.admin-dark table.table-stack .actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

/* Users page */
body.admin-dark .users-table-wrap {
  overflow-x: visible;
  width: 100%;
}

body.admin-dark .user-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

body.admin-dark .user-row-actions .btn {
  flex: 1 1 auto;
  min-width: 7rem;
}

@media (max-width: 900px) {
  body.admin-dark table.users-table.table-stack td[data-label=""]::before {
    content: none;
  }
  body.admin-dark table.users-table.table-stack td:first-child {
    justify-content: flex-start;
    padding-bottom: 0;
  }
}

@media (max-width: 768px) {
  body.admin-dark .user-actions,
  body.admin-dark .bulk-buttons {
    flex-wrap: wrap;
    width: 100%;
  }
  body.admin-dark .settings-table.purchases-table.table-stack td {
    white-space: normal;
  }
  body.admin-dark .settings-table.purchases-table.table-stack .col-title {
    font-weight: 600;
    text-align: right;
  }
}

/* Subscription cards on mobile */
.subscription-cards {
  display: none;
  flex-direction: column;
  gap: 1rem;
}

.subscription-card {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 1rem 1.15rem;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.subscription-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  color: #111827;
  word-break: break-word;
}

.subscription-card .sub-meta {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0.25rem 0;
  word-break: break-word;
}

.subscription-card .sub-actions {
  margin-top: 0.75rem;
}

@media (max-width: 768px) {
  .subscriptions-section .table.table-stack {
    display: none;
  }
  .subscriptions-section .subscription-cards {
    display: flex;
  }
}

/* Coupons / gift codes filters – light inputs on admin theme */
body.admin-dark .filter-container input,
body.admin-dark .filter-container select {
  background: #fff !important;
  border: 1px solid #e5e7eb !important;
  color: #111827 !important;
}

body.admin-dark .coupon-product-list {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.5rem;
  background: #f9fafb;
}

body.admin-dark .coupon-product-list label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.35rem 0;
  font-size: 0.9rem;
  cursor: pointer;
}

/* Subscriptions info */
.admin-info-banner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Statistics charts */
@media (max-width: 768px) {
  body.admin-dark .stats-section {
    padding: 1rem !important;
    overflow: hidden;
  }
  body.admin-dark .stats-controls {
    width: 100%;
  }
  body.admin-dark .stats-controls select,
  body.admin-dark .stats-controls button {
    width: 100%;
    max-width: 100%;
  }
  body.admin-dark .chart-container {
    position: relative;
    height: 260px !important;
    max-width: 100%;
  }
  body.admin-dark canvas {
    max-width: 100% !important;
  }
}

/* Course builder footer clearance */
@media (max-width: 768px) {
  body.admin-dark.course-builder-page .admin-main {
    padding-bottom: 5rem;
  }
  body.admin-dark.course-builder-page .builder-card,
  body.admin-dark.course-builder-page .course-card {
    margin-bottom: 1rem;
  }
}

/* Webcon buttons */
body.admin-dark.webcon-page .admin-main .btn,
body.admin-dark.webcon-page .action-btn {
  border-radius: 10px;
  font-weight: 600;
}
