.hem-wrap {
    max-width: 1280px;
}

.hem-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.hem-card,
.hem-panel {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    padding: 16px;
}

.hem-card strong {
    display: block;
    color: #50575e;
    font-size: 13px;
    margin-bottom: 8px;
}

.hem-card span {
    color: #1d2327;
    font-size: 28px;
    font-weight: 700;
}

.hem-grid-two {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 18px;
    margin-bottom: 20px;
}

.hem-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px 16px;
    align-items: end;
}

.hem-form label,
.hem-inline-form {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.hem-form label span {
    font-weight: 600;
}

.hem-form input,
.hem-form select,
.hem-form textarea,
.hem-inline-form input,
.hem-inline-form select {
    max-width: 100%;
}

.hem-form .hem-wide,
.hem-form p.submit {
    grid-column: 1 / -1;
}

.hem-report-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}

.hem-actions {
    display: inline-block;
    margin: 0 8px 8px 0;
}

.hem-portal {
    max-width: 980px;
}

.hem-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.hem-table th,
.hem-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.hem-table th {
    background: #f6f7f7;
}

.hem-success {
    background: #edfaef;
    border-left: 4px solid #00a32a;
    padding: 10px 12px;
}

.hem-error {
    background: #fcf0f1;
    border-left: 4px solid #d63638;
    padding: 10px 12px;
}

.hem-documents {
    grid-column: 1 / -1;
}

.hem-documents > span {
    font-weight: 600;
}

.hem-documents ul {
    margin: 4px 0 0;
    padding-left: 18px;
}

.hem-documents small {
    color: #666;
}

.hem-hint {
    color: #555;
    font-style: italic;
}

/* Asset-class filter tabs above the register. */
.hem-class-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0;
}

.hem-class-filter a {
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 999px;
    padding: 4px 14px;
    text-decoration: none;
    font-size: 13px;
}

.hem-class-filter a.hem-class-active {
    background: #DC7C24;
    border-color: #C0631A;
    color: #fff;
    font-weight: 600;
}

/* Requisition sanction chain. */
.hem-chain {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 16px 0 24px;
    padding: 0;
    counter-reset: hem-chain;
}

.hem-chain li {
    flex: 1 1 130px;
    border-top: 4px solid #dcdcde;
    padding: 8px 10px 10px;
    background: #f6f7f7;
    border-radius: 0 0 4px 4px;
}

.hem-chain li span {
    display: block;
    font-weight: 600;
    font-size: 13px;
    line-height: 1.3;
}

.hem-chain li small {
    display: block;
    color: #666;
    font-size: 11px;
    margin-top: 2px;
}

.hem-chain .hem-chain-done {
    border-top-color: #3a6a47;
    background: #f2f8f3;
}

.hem-chain .hem-chain-current {
    border-top-color: #DC7C24;
    background: #fdf4ea;
    box-shadow: 0 2px 8px rgba(120, 58, 19, 0.12);
}

.hem-justification {
    background: #fdf9f3;
    border-left: 4px solid #DC7C24;
    margin: 0;
    padding: 12px 16px;
}

.hem-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.hem-actions-row .hem-danger {
    color: #a4292c;
    border-color: #c9a1a2;
}

.hem-details {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 8px 16px;
}

.hem-details dt {
    font-weight: 700;
}

.hem-qr {
    width: 220px;
    height: 220px;
}

.hem-updates {
    margin-left: 18px;
}

.hem-search {
    display: flex;
    gap: 8px;
    margin: 12px 0;
    align-items: center;
}

.hem-search input[type="search"] {
    min-width: 260px;
}

.hem-qr-panel {
    margin: 16px 0;
}

.hem-qr-label {
    display: inline-block;
    text-align: center;
    padding: 12px;
    border: 1px dashed #999;
    background: #fff;
}

.hem-qr-label p {
    margin: 8px 0 0;
}

.hem-delete {
    color: #b32d2e;
}

.hem-radios {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 400;
}

.hem-radios label {
    flex-direction: row;
    align-items: center;
}

.hem-import-errors {
    margin-left: 18px;
    list-style: disc;
    max-height: 320px;
    overflow-y: auto;
}

/* Status pills, tinted with the Sarva Dharma palette. Used in both wp-admin
   and the front-end portals. */
.hem-badge {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1.5;
    border: 1px solid transparent;
    text-transform: capitalize;
    white-space: nowrap;
}

.hem-badge-good {
    background: #eef4e7;
    color: #3a6a47;
    border-color: #cfe0bb;
}

.hem-badge-info {
    background: #EDF4F8;
    color: #234255;
    border-color: #B6D2E6;
}

.hem-badge-warn {
    background: #FBF1E5;
    color: #9C4E16;
    border-color: #F0C594;
}

.hem-badge-bad {
    background: #f7ebec;
    color: #7a4452;
    border-color: #ecd2d5;
}

.hem-badge-neutral {
    background: #F4EEE3;
    color: #544D40;
    border-color: #EAE2D4;
}


/* When a QR label panel is on screen (admin or staff portal), printing shows
   only the label. The hem-printing-qr body class is set by admin.js. */
@media print {
    body.hem-printing-qr * {
        visibility: hidden !important;
    }

    body.hem-printing-qr .hem-qr-label,
    body.hem-printing-qr .hem-qr-label * {
        visibility: visible !important;
    }

    body.hem-printing-qr .hem-qr-label {
        position: fixed;
        top: 15mm;
        left: 15mm;
    }
}

@media (max-width: 782px) {
    .hem-grid-two {
        grid-template-columns: 1fr;
    }
}
