/* ==========================================================================
   Bedienbarkeit (alle Seiten, geladen von includes/page_shell.php)
   Stand: November 2026

   1. Button-Gruppen wieder zusammenhaengend (style.css rundet jeden Button)
   2. Touch-Geraete (Handy/Tablet): groessere Tippflaechen
   ========================================================================== */

/* 1. Button-Gruppen ------------------------------------------------------ */
/* style.css setzt fuer .btn-sm "border-radius: pill !important". In einer
   .btn-group sahen die Buttons dadurch wie einzelne, ueberlappende Pillen aus. */
.btn-group:not(.rounded-pill):not(.btn-group-vertical) > .btn:not(:last-child):not(.dropdown-toggle),
.btn-group:not(.rounded-pill):not(.btn-group-vertical) > .btn.dropdown-toggle-split:first-child {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}
.btn-group:not(.rounded-pill):not(.btn-group-vertical) > .btn:nth-child(n+3),
.btn-group:not(.rounded-pill):not(.btn-group-vertical) > :not(.btn-check) + .btn {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}

/* 2. Touch-Geraete ------------------------------------------------------- */
/* Nur bei Finger-Bedienung (Handy, Tablet). Am PC mit Maus bleibt alles wie bisher. */
@media (hover: none) and (pointer: coarse) {

  /* Kleine Buttons: mindestens 36 px hoch, Inhalt mittig */
  .btn-sm,
  .btn-group-sm > .btn,
  .table .btn {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;
  }
  .btn-sm.d-block, .btn-sm.w-100 { display: flex; }

  /* Buttons mit Symbol (z. B. Kopieren, Drei-Punkte-Menue, Spalte einklappen) */
  .btn:has(> i.bi:only-child),
  .btn-close {
    min-width: 36px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Checkboxen und Radio-Buttons */
  .form-check-input:not([role="switch"]) {
    width: 1.3rem;
    height: 1.3rem;
    flex-shrink: 0;
  }
  .form-check { min-height: 1.75rem; }
  .form-switch .form-check-input { width: 2.75rem; height: 1.5rem; }

  /* Seitenzahlen */
  .page-link {
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Reiter (z. B. im Projekt) */
  .nav-tabs .nav-link,
  .nav-pills .nav-link { min-height: 40px; }

  /* Menue-Eintraege */
  .dropdown-item { padding-top: .6rem; padding-bottom: .6rem; }

  /* Sprachumschalter DE/EN (Kundenseiten) */
  .navbar-lang-pill .btn-lang {
    min-height: 34px;
    min-width: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Lager: Plus/Minus am Bestand und Farbpunkt-Filter */
  .quick-stepper .step-btn {
    min-width: 36px !important;
    min-height: 36px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }
  .color-dot-indicator { position: relative; }
  .color-dot-indicator::after {
    content: "";
    position: absolute;
    inset: -11px;
  }
}

/* 3. Geschuetzter Bereich: Knoepfe unter dem Titel ---------------------- */
@media (max-width: 767.98px) {
  .secure-head-actions > * { flex: 1 1 0; min-width: 0; }
  .secure-head-actions .btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    padding-left: .4rem;
    padding-right: .4rem;
  }
}
