/* ═══════════════════════════════════════════════════
   glulando — Mobile Responsive Patch v1.0
   Fixes fuer:
   1. SuperAdmin Credits Feature-Preise Tabelle
   2. SuperAdmin Dashboard Tabellen
   3. Admin Referral Member-Tab
   4. Credit-Input Touch-Targets
   5. Admin Home Chat Chips
   ═══════════════════════════════════════════════════ */

/* ─── 1. SuperAdmin Credits: Feature-Preise Tabelle ─── */
@media (max-width: 768px) {
  /* Tabelle scrollbar machen */
  #credit-tab-content .card-body:has(table) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0;
  }
  #credit-tab-content table {
    min-width: 580px;
  }
  /* API-Kosten + Einnahme + Min-Spalte verstecken */
  #credit-tab-content table th:nth-child(3),
  #credit-tab-content table td:nth-child(3),
  #credit-tab-content table th:nth-child(4),
  #credit-tab-content table td:nth-child(4),
  #credit-tab-content table th:nth-child(5),
  #credit-tab-content table td:nth-child(5) {
    display: none;
  }
  #credit-tab-content table {
    min-width: 0;
  }
  /* Kategorie-Filter volle Breite */
  #cost-category-filter {
    width: 100% !important;
    min-width: 0 !important;
  }
}

/* ─── 2. SuperAdmin Dashboard: Tabellen responsive ──── */
@media (max-width: 768px) {
  /* Login + Plan Spalte auf Mobile verstecken */
  #dash-content table th:nth-child(3),
  #dash-content table td:nth-child(3),
  #dash-content table th:nth-child(7),
  #dash-content table td:nth-child(7) {
    display: none;
  }
  /* Schnellzugriff-Karten: 1 Spalte */
  #sa-dash > .kpi-grid:last-child {
    grid-template-columns: 1fr;
  }
  /* E-Mail unter Name, Platz sparen */
  #dash-content td .text-sm.text-muted {
    font-size: 11px;
    word-break: break-all;
  }
}
@media (max-width: 480px) {
  /* Noch mehr Spalten weg auf kleinen Screens */
  #dash-content table th:nth-child(5),
  #dash-content table td:nth-child(5),
  #dash-content table th:nth-child(6),
  #dash-content table td:nth-child(6) {
    display: none;
  }
}

/* ─── 3. Admin Referral: Member-Tab responsive ──────── */
@media (max-width: 768px) {
  /* E-Mail + Promo-Code Spalten verstecken */
  #ref-content table th:nth-child(2),
  #ref-content table td:nth-child(2),
  #ref-content table th:nth-child(3),
  #ref-content table td:nth-child(3) {
    display: none;
  }
  /* Settings Form-Row 1 Spalte */
  #ref-content .form-row {
    grid-template-columns: 1fr;
  }
}

/* ─── 4. Credit-Input Touch-Targets groesser ────────── */
@media (max-width: 768px) {
  .credit-input {
    width: 70px !important;
    min-height: 44px !important;
    padding: 8px !important;
    font-size: 16px !important;
    border-radius: 6px !important;
  }
  /* Save/Reset Buttons groesser */
  .save-credit,
  .reset-credit {
    min-height: 36px !important;
    min-width: 36px !important;
    padding: 6px 10px !important;
    font-size: 14px !important;
  }
}

/* ─── 5. Admin Home: Chat Chips nicht abschneiden ───── */
@media (max-width: 768px) {
  #ah-bottom {
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding: 10px 12px !important;
  }
  #ah-chips {
    max-width: 100% !important;
    width: 100% !important;
    order: -1;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  #ah-chips::-webkit-scrollbar {
    display: none;
  }
  .ah-chip {
    flex-shrink: 0 !important;
  }
  #ah-input {
    flex: 1 !important;
    min-width: 0 !important;
    width: auto !important;
  }
  #ah-wave {
    width: 36px !important;
    height: 36px !important;
  }
  #ah-send {
    width: 36px !important;
    height: 36px !important;
  }
}
@media (max-width: 480px) {
  #ah-chips {
    gap: 4px !important;
  }
  .ah-chip {
    padding: 4px 10px !important;
    font-size: 10px !important;
  }
  .ah-bub {
    max-width: 90% !important;
    font-size: 13px !important;
  }
}
