/* admin-actions.css — Consolidated responsive & aligned action buttons in tables */

/* === Base table alignment === */
table, .table { width: 100%; border-collapse: collapse; }
.table th, .table td, table th, table td { vertical-align: middle; padding: 8px; }

/* === Utilities === */
.nowrap { white-space: nowrap; }
.t-right { text-align: right; }

/* === Normalize forms & buttons inside table cells === */
.table td form, table td form { margin: 0; }
.table td .btn, table td .btn,
.table td button.btn, table td button.btn,
.table td a.btn, table td a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1;
  white-space: nowrap;
}

/* === Actions column === */
th.actions-col, td.actions-cell { width: 1%; }
td.actions-cell {
  white-space: nowrap;
  display: flex !important;
  flex-direction: row;
  align-items: center !important;
  gap: 8px !important;
  justify-content: flex-start;
}
td.actions-cell > .actions {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
}

/* === Forms inside actions cells === */
td.actions-cell form {
  display: inline-flex !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* === Buttons in actions cells === */
td.actions-cell .btn,
.table td.actions-cell .btn {
  flex: 0 0 auto;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}

/* === Auto-detect action cells (modern browsers) === */
.table td:has(> a.btn), .table td:has(> form) {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  white-space: nowrap;
}

/* === Price cell inline treatment to avoid euro wrapping === */
.price-cell { white-space: nowrap; }
.price-cell .amount {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* === Long name truncation (apply class="name-cell") === */
.name-cell {
  max-width: 480px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* === Mobile responsiveness === */
@media (max-width: 640px) {
  .table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    min-width: 760px;
    font-size: 12px;
  }
  .table th, .table td { padding: 6px 8px; }
  .name-cell { max-width: 220px; }
  td.actions-cell > .actions .btn,
  .table td:has(> a.btn) .btn, .table td:has(> form) .btn,
  td.actions-cell .btn {
    padding: 6px 8px;
    font-size: 12px;
    width: 32px;
    height: 32px;
  }
}

/* === Narrow mobile screens === */
@media (max-width: 480px) {
  .table td.actions-cell,
  td.actions-cell {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}
