/* Holeta ERP v2.4.179: strict 36px rows, compact statuses, vertical actions and previews. */
:root {
    --hsf-table-action-size: 36px;
    --hsf-table-row-size: 36px;
    --hsf-table-action-colour: #ff7552;
}

/* Left/right workflow dots must remain square so they do not enlarge rows. */
.hsf-action-dot,
.sales-doc-dot-btn,
.trip-dot,
.pickup-dot,
.qr-dot,
.proc-dot,
.repro-action-dot,
.ac-dot,
.return-action-dot,
button[class*="action-dot"],
button[class$="-dot"] {
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: var(--hsf-table-action-size) !important;
    min-width: var(--hsf-table-action-size) !important;
    max-width: var(--hsf-table-action-size) !important;
    height: var(--hsf-table-action-size) !important;
    min-height: var(--hsf-table-action-size) !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 2px !important;
    background: var(--hsf-table-action-colour) !important;
    color: #fff !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    letter-spacing: -1px !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
    overflow: hidden !important;
}

/* Bootstrap's dropdown caret must not turn a square action into a rectangle. */
.proc-dot.dropdown-toggle::after,
button[class*="action-dot"].dropdown-toggle::after {
    display: none !important;
}

table.hsf-compact-list > :not(caption) > * > *,
.table.hsf-compact-list > :not(caption) > * > * {
    box-sizing: border-box !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    vertical-align: middle !important;
}

/* A data row must never grow beyond its 36px left/right action square. */
table.hsf-compact-list > tbody > tr:not(.hsf-column-filter-row),
.table.hsf-compact-list > tbody > tr:not(.hsf-column-filter-row) {
    height: var(--hsf-table-row-size) !important;
    min-height: var(--hsf-table-row-size) !important;
    max-height: var(--hsf-table-row-size) !important;
}

table.hsf-compact-list > tbody > tr:not(.hsf-column-filter-row) > td,
table.hsf-compact-list > tbody > tr:not(.hsf-column-filter-row) > th,
.table.hsf-compact-list > tbody > tr:not(.hsf-column-filter-row) > td,
.table.hsf-compact-list > tbody > tr:not(.hsf-column-filter-row) > th {
    height: var(--hsf-table-row-size) !important;
    min-height: var(--hsf-table-row-size) !important;
    max-height: var(--hsf-table-row-size) !important;
    padding: 0 7px !important;
    font-size: 13px !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Status text scales with the compact row rather than increasing its height. */
table.hsf-compact-list > tbody .badge,
table.hsf-compact-list > tbody [class*="status-badge"],
table.hsf-compact-list > tbody .hsf-status,
table.hsf-compact-list > tbody .supplier-status,
table.hsf-compact-list > tbody .pr-status,
table.hsf-compact-list > tbody .hsf-del-badge,
table.hsf-compact-list > tbody .hsf-q-status,
table.hsf-compact-list > tbody .hsf-cs-badge,
table.hsf-compact-list > tbody .qr-status-badge {
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 22px !important;
    min-height: 22px !important;
    padding: 2px 8px !important;
    margin: 0 !important;
    border-radius: 11px !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

table.hsf-compact-list th.hsf-action-column,
table.hsf-compact-list td.hsf-action-column {
    box-sizing: border-box;
    width: 46px !important;
    min-width: 46px !important;
    max-width: 46px !important;
    padding-left: 5px !important;
    padding-right: 5px !important;
    text-align: center !important;
}

.hsf-column-filter-row th,
.hsf-column-filter-row td {
    padding: 4px !important;
    background: #f7f9fb !important;
    vertical-align: middle !important;
}

.hsf-column-filter {
    box-sizing: border-box !important;
    display: block !important;
    width: 100% !important;
    min-width: 72px !important;
    height: 32px !important;
    margin: 0 !important;
    padding: 4px 7px !important;
    border: 1px solid #cfd8e3 !important;
    border-radius: 4px !important;
    background: #fff !important;
    color: #26384a !important;
    font: 400 13px/1.2 Arial, sans-serif !important;
    box-shadow: none !important;
}

.hsf-column-filter:focus {
    border-color: #0d6efd !important;
    outline: 2px solid rgba(13,110,253,.13) !important;
}

.hsf-column-filter-hidden {
    display: none !important;
}

.hsf-filter-no-results td {
    padding: 14px !important;
    color: #6c757d !important;
    text-align: center !important;
}

/* Workflow/activity dialogs use an adaptive, old-ERP-style vertical menu. */
.hsf-compact-action-dialog {
    width: min(500px, calc(100vw - 32px)) !important;
    max-width: 500px !important;
    height: auto !important;
    max-height: calc(100vh - 48px) !important;
    margin: auto !important;
    overflow: hidden !important;
}

.hsf-compact-action-list {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
    padding: 10px 14px 14px !important;
    overflow: auto !important;
    max-height: calc(100vh - 190px) !important;
}

.hsf-compact-action-list > a,
.hsf-compact-action-list > button,
.hsf-compact-action-list > form > button,
.hsf-compact-action-list > form > div > button {
    box-sizing: border-box !important;
    display: block !important;
    width: 100% !important;
    min-height: 38px !important;
    margin: 0 !important;
    padding: 8px 11px !important;
    border: 1px solid #e2e6e9 !important;
    border-width: 0 1px 1px !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: #34403f !important;
    font: 500 14px/1.35 Arial, sans-serif !important;
    text-align: left !important;
    text-decoration: none !important;
    white-space: normal !important;
}

.hsf-compact-action-list > :first-child,
.hsf-compact-action-list > form:first-child > :first-child {
    border-top-width: 1px !important;
}

.hsf-compact-action-list > a:nth-child(odd),
.hsf-compact-action-list > button:nth-child(odd) {
    background: #f7f7f7 !important;
}

.hsf-compact-action-list > a:hover,
.hsf-compact-action-list > button:hover,
.hsf-compact-action-list > form button:hover {
    background: #eef7f2 !important;
    color: #006b3f !important;
}

.hsf-left-action-modal .hsf-attachment-action {
    display: none !important;
}

/* In-page printable preview. */
.hsf-print-preview-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(17, 25, 32, .72);
}
.hsf-print-preview-overlay.open { display: flex; }
.hsf-print-preview-shell {
    display: flex;
    flex-direction: column;
    width: min(1180px, 96vw);
    height: 94vh;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(0,0,0,.35);
    overflow: hidden;
}
.hsf-print-preview-head {
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 0 8px 0 16px;
    border-bottom: 1px solid #d8dde2;
    background: #fff;
    color: #152b46;
    font: 700 15px/1 Arial, sans-serif;
}
.hsf-print-preview-head span { flex: 1; }
.hsf-print-preview-head button {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 2px;
    background: transparent;
    color: #ff7552;
    font-size: 24px;
    cursor: pointer;
}
.hsf-print-preview-frame { flex: 1; width: 100%; border: 0; background: #e9e9e9; }
