/* V12 consolidated responsive hardening.
   Loaded after the existing UI/module styles so these rules only correct
   small-screen usability without redesigning the desktop application. */

@media (max-width: 900px) {
  .admin-content { min-width: 0; }
  .admin-section-head,
  .admin-panel-title { align-items: flex-start; }
}

@media (max-width: 760px) {
  /* Field controls: practical touch targets for onboard/mobile use. */
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea,
  button,
  .btn {
    min-height: 44px;
  }

  textarea { min-height: 104px; }
  .btn.btn-sm { min-height: 40px; }

  /* Recruitment: do not force an eight-column horizontal board on phones. */
  .kanban-wrap {
    overflow: visible !important;
    padding-bottom: 0 !important;
  }
  .kanban {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100% !important;
    min-width: 0 !important;
    gap: 12px !important;
  }
  .kanban-col {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
  }
  .kanban-col-body {
    max-height: 58vh !important;
    min-height: 120px !important;
  }
  .candidate-name { font-size: 14px !important; }
  .candidate-meta,
  .candidate-vacancy,
  .candidate-actions select { font-size: 12px !important; }

  /* Crew 360 document/assignment tables become cards rather than 760px tables. */
  .crew-table-wrap { overflow: visible; }
  .crew-table {
    display: block;
    min-width: 0;
    width: 100%;
  }
  .crew-table thead { display: none; }
  .crew-table tbody,
  .crew-table tr,
  .crew-table td { display: block; width: 100%; box-sizing: border-box; }
  .crew-table tr {
    margin: 0 0 10px;
    border: 1px solid #dfe8f2;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
  }
  .crew-table td {
    display: grid;
    grid-template-columns: minmax(96px, 34%) minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #edf1f5;
    font-size: 12px;
    line-height: 1.45;
  }
  .crew-table td:last-child { border-bottom: 0; }
  .crew-table td::before {
    content: attr(data-label);
    color: #718497;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .035em;
    text-transform: uppercase;
  }
  .crew-table td[colspan] { display: block; }
  .crew-table td[colspan]::before,
  .crew-manage-row td::before { display: none; }
  .crew-manage-row { border: 0 !important; margin-top: -10px !important; }
  .crew-manage-row td { display: block !important; padding: 0 !important; }
  .crew-table td small { font-size: 10px; }
  .doc-state { font-size: 10px !important; }
  .crew-doc-actions { flex-wrap: wrap; }

  .crew-profile-grid label { font-size: 10px; }
  .crew-profile-grid strong { font-size: 13px; line-height: 1.4; }
  .crew-doc-guidance,
  .crew-doc-form p,
  .form-note,
  .crew-side-note { font-size: 11px; }
  .crew-doc-form label { font-size: 10px; }
  .crew-panel-head small,
  .crew-kpi-grid span,
  .crew-kpi-grid small { font-size: 10px; }
  .crew-compliance-list>div,
  .crew-history-list b,
  .crew-history-list span,
  .crew-history-list small,
  .crew-empty-card { font-size: 11px; }

  /* Sign-off is an operational action; give each field room on phones. */
  .assignment-signoff-form {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    margin-top: 10px;
  }
  .assignment-signoff-form input,
  .assignment-signoff-form .btn {
    width: 100%;
    max-width: none;
  }

  .form-row { grid-template-columns: 1fr !important; }
  .admin-section-head { gap: 10px; }
  .admin-section-head > .btn { width: 100%; justify-content: center; }
}

@media (max-width: 520px) {
  .crew-panel { padding: 12px; }
  .crew-table td { grid-template-columns: 1fr; gap: 4px; }
  .crew-table td::before { margin-bottom: 2px; }
  .candidate-actions .btn,
  .pipeline-filter-actions .btn { width: 100%; }
}
