/* ЮУГК HelpDesk — этап 13: стабилизация интерфейса после этапов 1–12.
   Loaded last. All selectors are scoped to staff/public shells; no data or action changes.
   Do not globally replace Bootstrap table/form styles: historical density rules are specific. */

/* 1. Work queue: old app.css / layout_19_7_1.css still paint an inset status stripe
   using box-shadow; stage 7 intentionally uses ONLY the event-driven border-left.
   Remove the duplicate stripe (including the old status-colored shadow), retain
   the stage-7 yellow/blue/red border and personal read/unread typography. */
body.admin-shell[data-hd-page="my_work"] .work-ticket-row {
  box-shadow:0 1px 3px rgba(22,56,83,.055)!important;
}

/* 2. Keep long names, identifiers and controls inside their actual columns.
   Tables retain horizontal scrolling INSIDE their existing responsive wrappers. */
body.admin-shell .page-area,
body.admin-shell .page-area .row,
body.admin-shell .page-area .card,
body.admin-shell .page-area .card-body,
body.admin-shell .page-area .card-header,
body.admin-shell .page-area .card-footer {min-width:0;}
body.admin-shell .page-area .table-responsive {
  max-width:100%;min-width:0;overflow-x:auto;overscroll-behavior-x:contain;
  -webkit-overflow-scrolling:touch;
}
body.admin-shell .page-area :is(input.form-control,select.form-select,textarea.form-control) {
  max-width:100%;box-sizing:border-box;
}
body.admin-shell :is(.hd11-subject-cell,.hd11-wrap-mail,.hd12-kb-item,.hd12-ann-item) {
  overflow-wrap:anywhere;
}
body.admin-shell[data-hd-page="ticket_view"] .hd4-ticket-params-card :is(.hd4-prop-value,.hd6-picker-choice,.additional-assignee-item) {
  min-width:0;overflow-wrap:anywhere;
}
body.admin-shell[data-hd-page="ticket_view"] .hd5-ticket-actions-card .hd4-more-actions .dropdown-menu {
  max-width:min(290px,calc(100vw - 24px));overflow-wrap:anywhere;
}

/* 3. Search fields: reserve a stable zone for the search icon regardless of UI
   density and page-specific form padding. No overlay on user-entered text. */
body.admin-shell .page-area :is(.hd9-filter-field,.hd10-mail-search,.hd11-search-field,.hd12-search) {
  min-width:0;max-width:100%;
}
body.admin-shell .page-area :is(.hd9-filter-field,.hd10-mail-search,.hd11-search-field,.hd12-search) > i.bi-search {
  position:absolute;left:12px;top:50%;transform:translateY(-50%);
  pointer-events:none;z-index:1;line-height:1;
}
body.admin-shell .page-area :is(.hd9-filter-field,.hd10-mail-search,.hd11-search-field,.hd12-search) > :is(input.form-control,input.form-control-sm) {
  padding-left:38px!important;min-width:0;text-overflow:ellipsis;
}
body.admin-shell[data-hd-page="my_work"] .hd-modern-work-search > input.form-control {
  padding-left:38px!important;min-width:0;text-overflow:ellipsis;
}

/* 4. Consistent keyboard focus on custom, actionable controls. Do not hide
   built-in outlines from inputs, selects or native disclosure elements. */
body.admin-shell .page-area :is(.btn,.hd6-picker-choice,.hd4-inline-edit,.hd3-building-pill):focus-visible,
body.public-shell :is(.hd3-building-pill,[data-hdpm-add-manual]):focus-visible {
  outline:2px solid #20659c;outline-offset:2px;
}
body.admin-shell .page-area :is(.hd8-context-card,.hd8-tools-card,.hd9-status-details) > summary:focus-visible {
  outline:2px solid #20659c;outline-offset:-2px;
}
body.admin-shell .page-area :is(.hd8-history-card,.hd12-form-card,.hd11-section-title) {
  scroll-margin-top:90px;
}

/* 5. Local filters and parameter editors must respect semantic [hidden], even
   when older CSS sets display:flex/grid/block. No JavaScript handler changes. */
body.admin-shell :is(.hd6-picker-choice,.hd6-picker-no-results,.additional-assignee-item,
  .hd5-parameter-panel,.hd5-close-fields,.hd9-status-item,.hd9-empty-message,
  .hd10-no-templates,.hd11-notification,.hd12-kb-item,.hd12-ann-item)[hidden] {
  display:none!important;
}

/* 6. Public forms: selected rooms and printers must wrap at narrow widths.
   Preserve existing input, dropdown and manual-add mechanics. */
body.public-shell:is([data-hd-page="index"],[data-hd-page="client_ticket_create"]) :is(.hd3-location-picker,.hd7-printer-card) {
  min-width:0;max-width:100%;
}
body.public-shell:is([data-hd-page="index"],[data-hd-page="client_ticket_create"]) :is(.hd3-room-input-wrapper,[data-hdpm-chips]) {
  min-width:0;max-width:100%;flex-wrap:wrap;
}
body.public-shell:is([data-hd-page="index"],[data-hd-page="client_ticket_create"]) :is(.hd3-room-chip,[data-hdpm-chips] .badge) {
  max-width:100%;white-space:normal;overflow-wrap:anywhere;text-align:left;
}

@media (max-width: 575px) {
  body.admin-shell .page-area :is(.hd9-filter-field,.hd10-mail-search,.hd11-search-field,.hd12-search) {
    width:100%;flex-basis:100%;
  }
  body.admin-shell[data-hd-page="ticket_view"] .hd5-reply-buttons {
    align-items:stretch;
  }
  body.admin-shell[data-hd-page="ticket_view"] .hd5-file-count {
    max-width:min(180px,45vw);
  }
  body.admin-shell[data-hd-page="ticket_view"] .hd5-ticket-actions-card .hd4-more-actions .dropdown-menu {
    min-width:min(255px,calc(100vw - 24px));
  }
}
@media (prefers-reduced-motion: reduce) {
  body.admin-shell .page-area :is(.hd8-history-toggle,.hd9-status-chevron,.hd6-popover),
  body.admin-shell .sidebar,
  body.public-shell :is(.hd3-room-dropdown,[data-hdpm-results]) {
    animation:none!important;transition:none!important;
  }
}
