/* 25-SECURITY-MOBILE — mobile responsive overrides */

/* ── Mobile responsive ── */
@media (max-width: 768px) {
  .sb-accordion-body {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sb-stat-toggles {
    flex-wrap: wrap;
    gap: 6px;
  }

  /* Phase/block dividers — full width, no inset */
  .sb-phase-row,
  .sb-block-divider,
  [class*="sb-phase"],
  [class*="sb-divider"] {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
    border-radius: 0 !important;
  }

  /* Compact info icon padding */
  .sb-mobile-info-btn,
  .sb-week-info-btn {
    padding: 2px !important;
  }

  /* Week header: wrap date to second line */
  .sb-accordion-header {
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 4px !important;
    row-gap: 0 !important;
  }
  .sb-week-label {
    flex: 1 !important;
    line-height: 1.2 !important;
    margin-bottom: 0 !important;
  }
  .sb-week-date {
    flex-basis: 100% !important;
    order: 10 !important;
    font-size: var(--fs-sm-s) !important;
    color: var(--white-a50) !important;
    padding-left: 20px !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
    line-height: 1 !important;
  }
  .sb-week-total {
    flex-shrink: 0 !important;
    line-height: 1.2 !important;
  }
  .sb-week-info-btn {
    flex-shrink: 0 !important;
  }

  /* Column widths — tightened so finish stays on screen */
  /* Address/Location */
  .sb-grid th[data-col="1"],
  .sb-grid tr > td:nth-child(2) {
    width: 38% !important;
    min-width: 0 !important;
  }
  /* D/N — single char, minimal */
  .sb-grid th[data-col="3"],
  .sb-grid td:nth-child(4),
  .sb-grid tr > td:nth-child(4) {
    width: 20px !important;
    max-width: 20px !important;
    min-width: 0 !important;
    padding: 0 2px !important;
    text-align: center !important;
  }
  .sb-grid td:nth-child(4) input {
    width: 20px !important;
    max-width: 20px !important;
    text-align: center !important;
    padding: 0 !important;
  }
  /* Start time */
  .sb-grid th[data-col="4"],
  .sb-grid tr > td:nth-child(5) {
    width: 18% !important;
    min-width: 0 !important;
  }
  /* Finish time + info button */
  .sb-grid th[data-col="5"],
  .sb-grid tr > td:nth-child(6) {
    width: 18% !important;
    min-width: 60px !important;
  }
  /* Input text size for visible fields */
  .sb-grid td input[data-field="address"],
  .sb-grid td input[data-field="start"],
  .sb-grid td input[data-field="finish"] {
    font-size: var(--fs-sm-s) !important;
    width: 100% !important;
  }

  /* Guard shift rows — compact height */
  .sb-grid tbody tr td {
    height: 32px !important;
    font-size: var(--fs-sm-s) !important;
    padding: 0 4px !important;
  }
  .sb-grid tbody tr td input {
    height: 28px !important;
    font-size: var(--fs-sm-s) !important;
    line-height: 28px !important;
    padding: 0 4px !important;
  }

  /* Section/column header rows same height */
  .sb-section-row th,
  .sb-col-header-row th {
    height: 32px !important;
    font-size: var(--th-font-size);
    padding: 0 4px !important;
  }

  /* Table fits screen with fixed layout matching column widths */
  .sb-grid {
    width: 100% !important;
    table-layout: fixed !important;
  }

  /* Show only: Address(col1), D/N(col3), Start(col4), Finish(col5).
     Hide: Guard(col0), Requirement(col2), financials(cols6-15), delete(col16) */
  .sb-grid tr > *:nth-child(1),
  .sb-grid tr > *:nth-child(3),
  .sb-grid tr > *:nth-child(7),
  .sb-grid tr > *:nth-child(8),
  .sb-grid tr > *:nth-child(9),
  .sb-grid tr > *:nth-child(10),
  .sb-grid tr > *:nth-child(11),
  .sb-grid tr > *:nth-child(12),
  .sb-grid tr > *:nth-child(13),
  .sb-grid tr > *:nth-child(14),
  .sb-grid tr > *:nth-child(15),
  .sb-grid tr > *:nth-child(16) {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    padding: 0 !important;
    border: none !important;
  }

  /* All tab panes: equal compact padding on mobile */
  #sb-pane-weeks,
  #sb-pane-summary,
  #sb-pane-rates,
  #sb-pane-presets {
    padding: 12px !important;
  }

  /* Hide allowance stats from weekly header rows */
  .sb-week-stats {
    display: none !important;
  }
  /* Keep weekly total pill visible */
  .sb-week-total {
    display: inline !important;
  }

  /* Ensure accordion body scrolls for remaining columns */
  .sb-accordion-body {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Stats bar — hide financial summary items */
  .sb-stat-item:not(.sb-stat-total),
  .sb-stat-hours,
  .sb-stat-shifts,
  .sb-stat-meals,
  .sb-stat-travel,
  .sb-stat-pd {
    display: none !important;
  }

  /* Remove accordion inset on mobile */
  .sb-accordion-item,
  .sb-week-item {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .sb-accordion-body {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .sb-accordion-header {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  /* Phase divider spacing between tab bar and pane content */
  .sb-page .sb-phase-divider {
    margin-top: 4px !important;
    margin-bottom: 8px !important;
    flex-shrink: 0 !important;
    position: relative !important;
    z-index: 1 !important;
  }

  /* Mobile: override base .sb-page fixed height — security accordion needs natural flow.
     !important needed because base .sb-page is unlayered (beats @layer pages) */
  .sb-page {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  /* ── Extracted inline style classes (style audit) ── */
  .sb-section-label {
    color: var(--white-a60);
    font-size: var(--fs-base-s);
    font-weight: 700;
    margin: 10px 0 4px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
  }

}

/* .sb-tab 480px sizing moved to 01-base.css */

/* ── Mobile costs info button ── */
.sb-mobile-info-btn {
  display: none;
  background: none;
  border: none;
  color: var(--clr-berry-200);
  font-size: var(--fs-xl-s);
  cursor: pointer;
  padding: 2px 4px;
  vertical-align: middle;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .sb-mobile-info-btn {
    display: inline-flex !important;
    align-items: center;
  }

  /* Toast popup grid for costs */
  .sb-popup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
    margin-top: 6px;
    font-size: var(--fs-md-s);
  }
  .sb-popup-lbl {
    color: var(--white-a60);
  }
  .sb-popup-val {
    color: var(--clr-white);
    font-weight: 600;
    text-align: right;
  }

  /* Week header info button — visible on mobile */
  .sb-week-info-btn {
    display: inline-block !important;
  }
}

/* ── Week header info button ── */
.sb-week-info-btn {
  display: none;
  background: none;
  border: none;
  color: var(--clr-berry-200);
  font-size: var(--fs-xl-s);
  cursor: pointer;
  padding: 2px 6px;
  margin-left: 8px;
  vertical-align: middle;
  flex-shrink: 0;
}

