/* HelpDesk ЮУГК — Modern UI, этап 3.
   Real room catalog + manual proposals; conversation->reply order; per-user unread in registry.
   All rules are scoped and loaded after previous version styles. */

/* New ticket: compact two-column layout without changing the configured dynamic form fields. */
body.admin-shell[data-hd-page="ticket_create"] .hd3-create-layout { align-items:start; }
body.admin-shell[data-hd-page="ticket_create"] .hd3-create-card,
body.admin-shell[data-hd-page="ticket_create"] .hd3-create-aside {
    border:1px solid #d6e0e9;border-radius:7px;
    box-shadow:0 2px 7px rgba(18,50,77,.045);overflow:hidden;
}
body.admin-shell[data-hd-page="ticket_create"] .hd3-create-card > .card-header,
body.admin-shell[data-hd-page="ticket_create"] .hd3-create-aside > .card-header {
    padding:13px 17px;background:#f8fafc;border-bottom:1px solid #e0e7f0;color:#183b55;
}
body.admin-shell[data-hd-page="ticket_create"] .hd3-create-section-heading {
    display:flex;justify-content:space-between;gap:10px;align-items:center;flex-wrap:wrap;
}
body.admin-shell[data-hd-page="ticket_create"] .hd3-create-section-heading span {font-size:12px;color:#64748b;}
body.admin-shell[data-hd-page="ticket_create"] .hd3-create-card > .card-body {padding:19px 22px;}
body.admin-shell[data-hd-page="ticket_create"] .hd3-create-card .form-label {font-size:12px;font-weight:700;color:#334155;margin-bottom:5px;}
body.admin-shell[data-hd-page="ticket_create"] .hd3-create-card :is(.form-control,.form-select) {
    border-color:#cdd8e4;border-radius:5px;font-size:13px;min-height:36px;
}
body.admin-shell[data-hd-page="ticket_create"] .hd3-create-card :is(.form-control,.form-select):focus {
    border-color:#3e86b9;box-shadow:0 0 0 3px rgba(32,111,171,.1);
}
body.admin-shell[data-hd-page="ticket_create"] .hd3-create-attachments {
    border-top:1px solid #e8edf2;margin-top:18px;padding-top:15px;
}
body.admin-shell[data-hd-page="ticket_create"] .hd3-create-actions {
    display:flex;gap:9px;flex-wrap:wrap;margin-top:19px;padding-top:16px;border-top:1px solid #e8edf2;
}
body.admin-shell[data-hd-page="ticket_create"] .hd3-create-actions .btn {font-size:13px;padding:8px 17px;}
body.admin-shell[data-hd-page="ticket_create"] .hd3-create-aside .card-body {padding:17px;}
body.admin-shell[data-hd-page="ticket_create"] .hd3-create-aside-step {display:flex;gap:12px;margin-bottom:15px;}
body.admin-shell[data-hd-page="ticket_create"] .hd3-create-aside-step:last-child {margin-bottom:0;}
body.admin-shell[data-hd-page="ticket_create"] .hd3-create-aside-step > i {color:#286a9a;font-size:20px;line-height:1.1;flex:0 0 22px;}
body.admin-shell[data-hd-page="ticket_create"] .hd3-create-aside-step strong {font-size:13px;color:#203b50;}
body.admin-shell[data-hd-page="ticket_create"] .hd3-create-aside-step p {margin:4px 0 0;font-size:12px;line-height:1.5;color:#64748b;}

/* Room selector based on reference new-ticket.html; only real database objects are submitted. */
.hd3-location-picker {position:relative;background:#f8fbff;border:1px solid #cddfec;border-radius:8px;padding:15px 16px;}
.hd3-location-picker .hd3-location-heading {display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:12px;}
.hd3-location-picker .hd3-location-heading label {font-size:14px;color:#143550;margin:0;}
.hd3-location-picker .hd3-location-heading label i {color:#235884;}
.hd3-location-picker .hd3-location-heading small {font-size:11px;color:#64748b;}
.hd3-location-picker .hd3-building-pills {display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-bottom:12px;}
.hd3-location-picker .hd3-building-pill {
    display:inline-flex;align-items:center;min-height:27px;padding:4px 10px;
    font-size:11.5px;font-weight:650;line-height:1.2;border-radius:20px;
    border:1px solid #cbd5e1;background:#fff;color:#475569;
    cursor:pointer;transition:background .12s ease,border-color .12s ease;
}
.hd3-location-picker .hd3-building-pill:hover {color:#235884;border-color:#447eaa;}
.hd3-location-picker .hd3-building-pill.active {color:#fff;background:#235884;border-color:#235884;}
.hd3-location-picker .hd3-building-pill:focus-visible {outline:2px solid #3b82f6;outline-offset:2px;}
.hd3-room-combobox {position:relative;}
.hd3-room-input-wrapper {
    display:flex;align-items:center;flex-wrap:wrap;gap:7px;padding:6px 9px;
    min-height:44px;border:1px solid #cbd5e1;border-radius:5px;background:#fff;cursor:text;
}
.hd3-room-input-wrapper:focus-within {border-color:#3e86b9;box-shadow:0 0 0 3px rgba(32,111,171,.1);}
.hd3-room-chips {display:contents;}
.hd3-room-chip {display:inline-flex;align-items:center;gap:5px;max-width:100%;padding:4px 8px;
    border:1px solid #b6d4ee;background:#edf6fd;border-radius:5px;color:#173f5f;
    font-size:12px;font-weight:650;line-height:1.3;overflow-wrap:anywhere;}
.hd3-room-chip i {font-size:12px;flex:0 0 auto;}
.hd3-room-chip small {font-weight:400;font-size:11px;color:#596b7f;}
.hd3-room-chip button {border:0;background:transparent;color:#476b89;padding:1px 3px;font-size:17px;line-height:1;}
.hd3-room-chip button:hover {color:#b91c1c;}
.hd3-room-chip-pending {background:#fffbeb;border-color:#f8dc8b;color:#92400e;}
.hd3-room-search-field {flex:1 1 210px;min-width:120px!important;min-height:28px!important;height:28px!important;
    background:transparent!important;border:0!important;padding:2px 3px!important;
    outline:0;box-shadow:none!important;font-size:12.5px;color:#172b3e;}
.hd3-room-search-field:focus {outline:0;box-shadow:none;}
.hd3-room-dropdown {position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:1200;max-height:256px;
    border-radius:5px;border:1px solid #c7d7e5;background:#fff;overflow-y:auto;box-shadow:0 12px 24px rgba(15,23,42,.13);}
.hd3-room-dropdown .hd3-room-option {display:flex;justify-content:space-between;align-items:center;gap:10px;padding:9px 12px;border-color:#eff2f7;font-size:12.5px;}
.hd3-room-dropdown .hd3-room-option strong {color:#235884;font-size:13px;}
.hd3-room-dropdown .hd3-room-option small {display:block;margin-top:3px;font-size:11px;}
.hd3-room-dropdown .hd3-room-option:is(:hover,.active) {background:#eef6fc;}
.hd3-room-dropdown .hd3-room-add {flex:0 0 auto;color:#216b8d;font-size:11px;font-weight:700;white-space:nowrap;}
.hd3-room-empty {display:flex;align-items:center;justify-content:space-between;gap:8px;color:#64748b;font-size:12px;}
.hd3-location-picker .hd3-room-hint {font-size:11px;margin-top:7px;}
.hd3-location-picker .hd3-location-footer {display:flex;gap:8px;align-items:center;justify-content:space-between;min-height:21px;margin-top:9px;font-size:12px;}
.hd3-location-picker [data-hd3-room-counter] {font-weight:700;color:#64748b;}
.hd3-location-picker [data-hd3-room-counter].hd3-counter-selected {color:#15803d;}
.hd3-location-picker [data-hd3-room-counter].hd3-counter-required {color:#b45309;}
.hd3-manual-location {margin-top:5px;}
.hd3-manual-open {display:inline-flex;align-items:center;gap:2px;padding:3px 0;border:0;background:transparent;color:#235884;font-size:12px;font-weight:650;cursor:pointer;}
.hd3-manual-open:hover {text-decoration:underline;}
.hd3-manual-open:focus-visible {outline:2px solid #3b82f6;outline-offset:2px;}
.hd3-manual-form {margin:11px 0;padding:13px 14px;border:1px dashed #94a3b8;border-left:3px solid #df9c31;border-radius:6px;background:#fff;}
.hd3-manual-title {margin-bottom:12px;color:#143550;font-size:12.5px;}
.hd3-manual-form .form-label {font-size:12px!important;}
.hd3-manual-location [data-manual-chips] {gap:6px!important;}
.hd3-manual-location [data-manual-chips]:empty {display:none!important;}
/* Compact multi-room picker in the separate link-editing screen. */
body.admin-shell[data-hd-page="ticket_room_links"] .hd3-room-input-wrapper {max-width:100%;}

/* Messenger flow: oldest -> newest -> composer. Normal page scrolling; never reorders messages with CSS. */
body.admin-shell[data-hd-page="ticket_view"] #ticketConversation {margin-bottom:13px!important;}
body.admin-shell[data-hd-page="ticket_view"] #replyForm {scroll-margin-top:82px;}
body.admin-shell[data-hd-page="ticket_view"] #replyForm > .card-header {background:#eef6fc;color:#173f5f;}

/* Read/unread is tied to ticket_user_read_state for this signed-in employee.
   Leave status badges and colored status markers independent of read state. */
body.admin-shell[data-hd-page="tickets"] .hd2-registry-table tr.hd3-ticket-unseen .ticket-title-link,
body.admin-shell[data-hd-page="tickets"] .hd2-registry-table tr.hd3-ticket-unseen .hd2-ticket-code-link,
body.admin-shell[data-hd-page="tickets"] .hd2-registry-table tr.hd3-ticket-unseen .ticket-requester-cell {
    font-weight:800!important;
}
body.admin-shell[data-hd-page="tickets"] .hd2-registry-table tr.hd3-ticket-seen .ticket-title-link,
body.admin-shell[data-hd-page="tickets"] .hd2-registry-table tr.hd3-ticket-seen .hd2-ticket-code-link,
body.admin-shell[data-hd-page="tickets"] .hd2-registry-table tr.hd3-ticket-seen .ticket-requester-cell {
    font-weight:400!important;
}
body.admin-shell[data-hd-page="tickets"] .hd2-registry-table tr.hd3-ticket-unseen td.ticket-title-cell {background:#f7fbff;}
body.admin-shell[data-hd-page="tickets"] .tickets-browser-card.hd3-ticket-unseen .tickets-browser-card-title,
body.admin-shell[data-hd-page="tickets"] .tickets-browser-card.hd3-ticket-unseen .work-ticket-code {font-weight:800!important;}
body.admin-shell[data-hd-page="tickets"] .tickets-browser-card.hd3-ticket-seen .tickets-browser-card-title,
body.admin-shell[data-hd-page="tickets"] .tickets-browser-card.hd3-ticket-seen .work-ticket-code {font-weight:400!important;}
/* Unread emphasis and status accents are deliberately separate. */
body.admin-shell[data-hd-page="tickets"] .hd2-registry-table tbody tr[data-hd3-status] td:first-child {box-shadow:inset 3px 0 0 #94a3b8;}
body.admin-shell[data-hd-page="tickets"] .hd2-registry-table tbody tr[data-hd3-status="open"] td:first-child {box-shadow:inset 3px 0 0 #467ac6;}
body.admin-shell[data-hd-page="tickets"] .hd2-registry-table tbody tr[data-hd3-status="in_progress"] td:first-child {box-shadow:inset 3px 0 0 #16a34a;}
body.admin-shell[data-hd-page="tickets"] .hd2-registry-table tbody tr[data-hd3-status="waiting"] td:first-child {box-shadow:inset 3px 0 0 #e5a423;}
body.admin-shell[data-hd-page="tickets"] .hd2-registry-table tbody tr[data-hd3-status="resolved"] td:first-child {box-shadow:inset 3px 0 0 #0284c7;}
body.admin-shell[data-hd-page="tickets"] .hd2-registry-table tbody tr[data-hd3-status="closed"] td:first-child {box-shadow:inset 3px 0 0 #94a3b8;}
body.admin-shell[data-hd-page="tickets"] .tickets-browser-card[data-hd3-status] {border-left:3px solid #94a3b8;}
body.admin-shell[data-hd-page="tickets"] .tickets-browser-card[data-hd3-status="open"] {border-left-color:#467ac6;}
body.admin-shell[data-hd-page="tickets"] .tickets-browser-card[data-hd3-status="in_progress"] {border-left-color:#16a34a;}
body.admin-shell[data-hd-page="tickets"] .tickets-browser-card[data-hd3-status="waiting"] {border-left-color:#e5a423;}
body.admin-shell[data-hd-page="tickets"] .tickets-browser-card[data-hd3-status="resolved"] {border-left-color:#0284c7;}
@media(max-width:767px) {
    .hd3-location-picker {padding:12px;}
    .hd3-room-chip small {display:none;}
    .hd3-room-search-field {flex-basis:100%;}
    body.admin-shell[data-hd-page="ticket_create"] .hd3-create-card > .card-body {padding:14px;}
}

/* Categories and SLA administration — compact HESK mockup-inspired surfaces. */
body.admin-shell[data-hd-page="categories"] .hd3-categories-layout .card,
body.admin-shell[data-hd-page="sla_settings"] :is(.hd3-sla-rule-editor,.hd3-sla-rule-list,.hd3-sla-alerts) {
    border:1px solid #d6e0e9;border-radius:7px;overflow:hidden;
    box-shadow:0 1px 3px rgba(15,35,55,.045);
}
body.admin-shell[data-hd-page="categories"] .hd3-categories-layout .card-header,
body.admin-shell[data-hd-page="sla_settings"] :is(.hd3-sla-rule-editor,.hd3-sla-rule-list) .card-header {
    background:#f9fbfd;border-bottom:1px solid #dce5ee;
    color:#173f5f;padding:12px 15px;
}
body.admin-shell[data-hd-page="categories"] .hd3-category-editor .card-body,
body.admin-shell[data-hd-page="sla_settings"] .hd3-sla-rule-editor .card-body {padding:17px!important;}
body.admin-shell[data-hd-page="categories"] .hd3-category-editor .category-icon-picker {display:flex;flex-wrap:wrap;gap:5px;}
body.admin-shell[data-hd-page="categories"] .hd3-category-list .table,
body.admin-shell[data-hd-page="sla_settings"] .hd3-sla-rule-list .table {font-size:12.5px;}
body.admin-shell[data-hd-page="categories"] .hd3-category-list .table thead th,
body.admin-shell[data-hd-page="sla_settings"] .hd3-sla-rule-list .table thead th {
    background:#235884!important;color:white!important;border-color:#356b98;padding:10px;
    font-size:11px;white-space:nowrap;
}
body.admin-shell[data-hd-page="categories"] .hd3-category-list .table tbody td,
body.admin-shell[data-hd-page="sla_settings"] .hd3-sla-rule-list .table tbody td {
    border-color:#e9eff5;vertical-align:middle;padding:9px 10px;
}
body.admin-shell[data-hd-page="sla_settings"] .hd3-sla-rule-editor .form-label,
body.admin-shell[data-hd-page="categories"] .hd3-category-editor .form-label {font-size:12px;font-weight:700;color:#475569;}
@media(min-width:1200px) {
    body.admin-shell[data-hd-page="categories"] .hd3-category-list .category-icon-label {display:none;}
}
@media(min-width:769px) {
    body.admin-shell[data-hd-page="categories"] .hd3-category-list .table-responsive {overflow-x:auto!important;}
    body.admin-shell[data-hd-page="categories"] .hd3-category-list .categories-admin-table {min-width:670px;}
}
/* Printed registry preview: same read/unread typography and status accents as the ticket list. */
body.admin-shell[data-hd-page="ticket_registry"] .hd2-report-table tbody tr.hd3-ticket-unseen .hd2-ticket-code-link,
body.admin-shell[data-hd-page="ticket_registry"] .hd2-report-table tbody tr.hd3-ticket-unseen .hd3-registry-subject {font-weight:800!important;}
body.admin-shell[data-hd-page="ticket_registry"] .hd2-report-table tbody tr.hd3-ticket-seen .hd2-ticket-code-link,
body.admin-shell[data-hd-page="ticket_registry"] .hd2-report-table tbody tr.hd3-ticket-seen .hd3-registry-subject {font-weight:400!important;}
body.admin-shell[data-hd-page="ticket_registry"] .hd2-report-table tbody tr.hd3-ticket-unseen .hd3-registry-subject {background:#f7fbff;}
body.admin-shell[data-hd-page="ticket_registry"] .hd2-report-table tbody tr[data-hd3-status] td:first-child {box-shadow:inset 3px 0 0 #94a3b8;}
body.admin-shell[data-hd-page="ticket_registry"] .hd2-report-table tbody tr[data-hd3-status="open"] td:first-child {box-shadow:inset 3px 0 0 #467ac6;}
body.admin-shell[data-hd-page="ticket_registry"] .hd2-report-table tbody tr[data-hd3-status="in_progress"] td:first-child {box-shadow:inset 3px 0 0 #16a34a;}
body.admin-shell[data-hd-page="ticket_registry"] .hd2-report-table tbody tr[data-hd3-status="waiting"] td:first-child {box-shadow:inset 3px 0 0 #e5a423;}
body.admin-shell[data-hd-page="ticket_registry"] .hd2-report-table tbody tr[data-hd3-status="resolved"] td:first-child {box-shadow:inset 3px 0 0 #0284c7;}
