.storage-page {
    max-width: 1180px;
    margin-inline: auto;
}

.storage-page .storage-heading {
    padding: 8px 0 18px;
}

.storage-page .storage-card {
    border-radius: 12px;
    padding: 20px;
    box-shadow: none;
}

.storage-page .storage-section-title {
    font-size: 15px;
    margin-block: 0 16px;
}

.storage-page .storage-connections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.storage-page .storage-connection {
    min-width: 0;

    border-radius: 10px;
}

.storage-page .storage-connection > div {
    min-width: 0;
    overflow-wrap: anywhere;
}

.storage-page .storage-connection.is-active {
    background: var(--surface-soft);
    border-color: var(--primary);
}

.storage-page #storageForm {
}

.storage-page #storageHint {
    margin: 0;
}

.storage-page .storage-actions {
}

.storage-page #storageKeyStatus {
    margin: 0;
    line-height: 1.8;
}

@media (max-width: 760px) {
    .storage-page #storageForm {
        grid-template-columns: minmax(0, 1fr);
    }
    .storage-page .storage-card {
        padding: 14px;
    }
}

/* Employee file workspace; scoped to avoid altering other modules. */
.employee-file {
    --ef-accent: #285d48;
    --ef-soft: #edf4ef;
    --ef-border: #dce5df;
    --ef-surface: #fff;
    --ef-muted: #69766e;
    padding: 20px 24px 28px;
    display: grid;
    gap: 20px;
    min-width: 0;
    color: var(--text);
}
html[data-theme='dark'] .employee-file {
    --ef-accent: #a7d8bb;
    --ef-soft: #25382f;
    --ef-border: #3a4b42;
    --ef-surface: #18251f;
    --ef-muted: #b2c1b8;
}
.employee-file [hidden] {
    display: none !important;
}
.employee-file h2,
.employee-file h3,
.employee-file h4,
.employee-file p {
    margin: 0;
}
.file-page-heading,
.file-heading-copy,
.file-toolbar,
.file-table-heading,
.file-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.file-heading-copy {
    justify-content: flex-start;
}
.file-page-heading h2 {
    font-size: 23px;
    font-weight: 800;
    line-height: 1.7;
}
.file-heading-copy p {
    color: var(--ef-muted);
    font-size: 12px;
    margin-top: 3px;
}
.file-heading-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    color: var(--ef-accent);
    background: var(--ef-soft);
    font-size: 24px;
    flex-shrink: 0;
}
.employee-file .file-hrsd {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid var(--ef-border);
    border-radius: 12px;
    color: var(--ef-accent);
    background: var(--ef-surface);
    text-decoration: none;
    font-size: 11px;
    white-space: nowrap;
}
.file-hrsd img {
    width: 85px;
    height: 32px;
    object-fit: contain;
}
html[data-theme='dark'] .file-hrsd img {
    background: #fff;
    padding: 3px;
    border-radius: 5px;
}
.employee-file button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid var(--ef-border);
    border-radius: 9px;
    background: var(--ef-surface);
    color: var(--text);
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: none;
}
.employee-file button:hover {
    background: var(--ef-soft);
    border-color: var(--ef-accent);
}
.employee-file button:disabled {
    opacity: 0.45;
    cursor: default;
}
.employee-file button.file-primary {
    background: #285d48;
    border-color: #285d48;
    color: #fff;
}
.employee-file button.file-primary:hover {
    background: #1b4836;
}
.employee-file :is(input, select, textarea) {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid var(--ef-border);
    border-radius: 9px;
    background: var(--ef-surface);
    color: var(--text);
    font: inherit;
    font-size: 12px;
    box-shadow: none;
}
.employee-file :is(input, select) {
    min-height: 42px;
}
.employee-file textarea {
    resize: vertical;
    line-height: 1.9;
}
.employee-file :is(input, select, textarea):focus-visible {
    outline: 2px solid var(--ef-accent);
    outline-offset: 2px;
}
.employee-file label {
    min-width: 0;
    font-size: 11px;
    font-weight: 700;
    display: grid;
    gap: 8px;
}
.employee-file .searchable-select {
    min-width: 0;
    width: 100%;
}
.employee-file .searchable-select-trigger {
    width: 100%;
    min-height: 42px;
    font-size: 12px;
}
.file-filters {
    display: grid;
    grid-template-columns: minmax(200px, 1.6fr) repeat(2, minmax(140px, 1fr));
    gap: 16px;
    padding: 20px;
    border: 1px solid var(--ef-border);
    border-radius: 14px;
    background: var(--ef-surface);
    margin: 0 0 20px;
    align-items: end;
}
.file-filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}
.file-filter-actions button {
    min-width: 86px;
    min-height: 42px;
}
.file-table-card {
    overflow: hidden;
    min-width: 0;
    border: 1px solid var(--ef-border);
    border-radius: 14px;
    background: var(--ef-surface);
    box-shadow: 0 4px 20px #18352305;
}
.file-table-heading {
    padding: 18px 20px;
    border-bottom: 1px solid var(--ef-border);
}
.file-table-heading h3 {
    font-size: 15px;
    font-weight: 800;
}
#fileCount {
    display: inline-block;
    margin-top: 5px;
    font-size: 11px;
    color: var(--ef-muted);
}
.employee-file .file-grid {
    height: clamp(330px, 48vh, 540px);
    width: 100%;
    min-width: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
}
.employee-file .madar-grid-toolbar {
    margin: 0;
    border: 0;
    border-bottom: 1px solid var(--ef-border);
    border-radius: 0;
    padding: 10px 16px;
    background: var(--ef-soft);
}
.employee-file .madar-grid-toolbar button {
    min-height: 30px;
    padding: 5px 9px;
    font-size: 10px;
}
.file-pagination {
    padding: 12px 20px;
    border-top: 1px solid var(--ef-border);
    font-size: 11px;
    color: var(--ef-muted);
}
.file-pagination button {
    min-height: 32px;
    padding: 5px 12px;
}
.file-row-actions {
}
.file-row-actions button {
    min-height: 30px;
    padding: 4px 9px;
    font-size: 10px;
    line-height: 1.4;
}
.file-status {
    display: inline-flex;
    align-items: center;
    border-radius: 6px;
    padding: 4px 9px;
    line-height: 1.6;
    font-size: 10px;
    font-weight: 750;
    background: var(--ef-soft);
    color: var(--ef-accent);
}
.file-status-Submitted,
.file-status-Investigating,
.file-status-Appealed {
    background: #fff3dc;
    color: #865d16;
}
.file-status-Cancelled,
.file-status-Unsubstantiated {
    background: #eeeef1;
    color: #666675;
}
html[data-theme='dark'] .file-status-Submitted,
html[data-theme='dark'] .file-status-Investigating {
    background: #493b22;
    color: #efd18d;
}
#fileEditorPanel {
    padding: 24px;
    border: 1px solid var(--ef-border);
    border-radius: 14px;
    background: var(--ef-surface);
    min-width: 0;
}
.file-editor-heading {
    padding-bottom: 18px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--ef-border);
}
.file-editor-heading h3 {
    font-size: 20px;
    margin-top: 5px;
}
.file-eyebrow {
    font-size: 10px;
    font-weight: 700;
    color: var(--ef-muted);
}
#fileEmployeePicker {
    padding: 18px;
    background: var(--ef-soft);
    border-radius: 12px;
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}
#fileSearch {
    display: flex;
    align-items: center;
    gap: 8px;
}
#fileSearch input {
    flex: 1;
}
#fileSummary:not(:empty) {
    display: block;
    padding: 12px 16px;
    background: var(--ef-soft);
    border-radius: 9px;
    font-size: 12px;
    margin-bottom: 20px;
}
.file-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin: 18px 0 0;
}
.file-wide,
.file-form-footer {
    grid-column: 1/-1;
}
.file-form-footer {
    display: flex;
    gap: 10px;
    border-top: 1px solid var(--ef-border);
    padding-top: 18px;
    margin-top: 4px;
}
.file-description {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 2;
    padding: 16px;
    background: var(--ef-soft);
    border-radius: 10px;
    margin-block: 14px !important;
}
#fileContent article > h4 {
    margin: 24px 0 12px;
    font-size: 14px;
}
#fileContent article > p {
    margin-block: 10px;
    color: var(--ef-muted);
    font-size: 12px;
}
#attachForm {
    display: flex;
    gap: 10px;
    padding: 14px;
    border: 1px dashed var(--ef-border);
    border-radius: 10px;
    align-items: center;
}
#fileAction {
    display: grid;
    gap: 12px;
    padding: 18px;
    background: var(--ef-soft);
    border-radius: 12px;
}
#fileAction button {
    justify-self: start;
}
.file-history {
    margin-block: 12px;
    font-size: 12px;
}
#fileError:empty {
    display: none;
}
#fileError {
    border: 1px solid #f0c8c8;
    background: #fff4f3;
    border-radius: 9px;
    color: #9e3434;
    padding: 12px;
}
#fileTypes details {
    border: 1px solid var(--ef-border);
    border-radius: 12px;
    background: var(--ef-surface);
    padding: 16px 20px;
}
#fileTypes summary {
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    color: var(--ef-accent);
}
#fileTypes .file-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-bottom: 18px;
    border-bottom: 1px solid var(--ef-border);
}
#typeRows {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding-top: 16px;
}
#typeRows p {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
    border: 1px solid var(--ef-border);
    border-radius: 9px;
    padding: 12px;
    font-size: 11px;
}
@media (min-width: 1500px) {
    .file-filters {
        grid-template-columns: minmax(220px, 1.6fr) repeat(4, minmax(140px, 1fr)) auto;
    }
}
@media (max-width: 760px) {
    .employee-file {
        padding: 14px 12px;
        gap: 14px;
    }
    .file-page-heading {
        align-items: flex-start;
        flex-wrap: wrap;
    }
    .file-page-heading h2 {
        font-size: 20px;
    }
    .file-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        padding: 14px;
    }
    .file-search-field {
        grid-column: 1/-1;
    }
    .file-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .file-form label:first-child {
        grid-column: 1/-1;
    }
    .file-table-heading {
        padding: 14px;
    }
    #fileEditorPanel {
        padding: 16px;
    }
    #typeRows {
        grid-template-columns: 1fr;
    }
    #attachForm {
        flex-wrap: wrap;
    }
}
@media (max-width: 440px) {
    .file-filters,
    .file-form {
        grid-template-columns: minmax(0, 1fr);
    }
    .file-filter-actions {
        justify-content: stretch;
    }
    .file-filter-actions button {
        flex: 1;
    }
    .file-hrsd {
        width: 100%;
        justify-content: space-between;
    }
    .file-heading-copy p {
        font-size: 10px;
    }
    .file-table-heading h3 {
        font-size: 13px;
    }
}
.file-type-name {
    display: grid;
    gap: 5px;
}
.file-type-name small {
    color: var(--ef-muted);
    font-size: 10px;
}
#fileTypes .file-form > button {
    justify-self: start;
    min-width: 120px;
    width: auto;
}
.file-fine-panel {
    border-top: 1px solid var(--ef-border);
    padding-top: 24px;
    margin-top: 24px;
    display: grid;
    gap: 18px;
}
.file-fine-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 0;
}
.file-fine-summary > div {
    padding: 14px;
    background: var(--ef-soft);
    border-radius: 10px;
}
.file-fine-summary dt {
    color: var(--ef-muted);
    font-size: 13px;
}
.file-fine-summary dd {
    margin: 8px 0 0;
    font-weight: 700;
    overflow-wrap: anywhere;
}
.file-use-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.file-fine-table {
    max-width: 100%;
    overflow-x: auto;
}
.file-fine-table table {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
}
.file-fine-table th,
.file-fine-table td {
    text-align: start;
    padding: 12px;
    border-bottom: 1px solid var(--ef-border);
    overflow-wrap: anywhere;
}
.file-fine-table th {
    background: var(--ef-soft);
}
@media (max-width: 600px) {
    .file-fine-summary,
    .file-use-fields {
        grid-template-columns: 1fr;
    }
}
.employee-file .file-fine-table table {
    min-width: 850px;
}
.file-fine-table th,
.file-fine-table td:nth-child(-n + 4) {
    white-space: nowrap;
}
html[data-theme='dark'] .file-fine-panel input[type='date'] {
    color-scheme: dark;
}
/* Identity comes before the administrative record in create, edit and detail. */
.employee-file #fileSummary.file-employee-card {
    display: grid;
    gap: 18px;
    padding: 22px;
    margin: 0;
    background: var(--ef-surface);
    border: 1px solid var(--ef-border);
    border-radius: 14px;
    font-weight: 400;
}
.file-employee-card header {
    display: flex;
    align-items: center;
    gap: 12px;
}
.file-person-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: var(--ef-soft);
    color: var(--ef-accent);
    font-size: 22px;
}
.file-employee-card dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 24px;
    margin: 0;
}
.file-employee-card dl > div {
    min-width: 0;
    padding: 14px 0;
    border-top: 1px solid var(--ef-border);
}
.file-employee-card dt {
    color: var(--ef-muted);
    font-size: 13px;
    margin-bottom: 7px;
}
.file-employee-card dd {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    overflow-wrap: anywhere;
}
.file-section-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--ef-border);
}
.file-section-heading .file-eyebrow {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--ef-soft);
    color: var(--ef-accent);
}
.file-record-heading {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--ef-border);
}
@media (max-width: 760px) {
    .file-employee-card dl {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 480px) {
    .file-employee-card dl {
        grid-template-columns: 1fr;
    }
    .employee-file #fileSummary.file-employee-card {
        padding: 16px;
    }
}
html[data-theme='dark'] #entryForm input[type='date'] {
    color-scheme: dark;
}
.employee-file .file-employee-value {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid var(--ef-border);
    border-radius: 9px;
    background: var(--ef-soft);
    color: var(--text);
    font: inherit;
    font-weight: 600;
}
.employee-file .file-employee-hint {
    color: var(--ef-muted);
    font-size: 13px;
}
.incident-block {
    min-width: 0;
    margin: 0 0 20px;
    padding: 20px;
    border: 1px solid var(--ef-border);
    border-radius: 12px;
}
.incident-block legend {
    padding: 0 8px;
    font-weight: 700;
}
.incident-block legend small {
    color: var(--ef-muted);
    margin-inline-start: 10px;
}
.incident-checklist {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.employee-file .incident-choice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--ef-border);
    border-radius: 8px;
    background: var(--ef-surface);
    margin-bottom: 8px;
    cursor: pointer;
}
.employee-file .incident-choice input {
    width: 18px !important;
    min-width: 18px;
    height: 18px;
    margin: 4px 0 0;
    padding: 0;
    accent-color: var(--ef-accent);
}
.incident-choice span {
    line-height: 1.7;
    font-weight: 600;
}
.incident-choice small {
    display: block;
    font-size: 12px;
    color: var(--ef-muted);
    font-weight: 400;
}
.incident-choice:has(input:checked) {
    border-color: var(--ef-accent);
    background: var(--ef-soft);
}
.incident-other {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}
.incident-decision-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 14px;
    background: var(--ef-soft);
    border-radius: 8px;
}
.incident-help {
    margin: 8px 0 14px !important;
    color: var(--ef-muted);
    font-size: 13px;
}
.incident-signatures {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.incident-signatures section {
    padding: 16px;
    border: 1px solid var(--ef-border);
    border-radius: 10px;
    background: var(--ef-soft);
}
.incident-signatures small,
.incident-signatures time {
    display: block;
    color: var(--ef-muted);
    font-size: 12px;
}
.incident-signatures img {
    display: block;
    width: 160px;
    height: 65px;
    object-fit: contain;
    background: white;
    border-radius: 5px;
    margin: 10px 0;
}
.incident-sign-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}
.incident-sign-actions form {
    width: 100%;
}
@media (max-width: 760px) {
    .incident-checklist,
    .incident-signatures,
    .incident-decision-fields {
        grid-template-columns: 1fr;
    }
    .incident-block {
        padding: 12px;
    }
}
.incident-print-preview {
    width: min(1100px, 94vw);
    max-width: 94vw;
    height: 92vh;
    padding: 12px;
    border: 1px solid #ccd5ce;
    border-radius: 12px;
    background: #fff;
}
.incident-print-preview::backdrop {
    background: #0009;
}
.incident-print-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
}
.incident-print-preview iframe {
    width: 100%;
    height: calc(100% - 56px);
    border: 1px solid #ddd;
    background: #fff;
}
/* Compact editor: one page heading and one employee selector. */
.employee-file.file-editing {
    gap: 12px;
    padding-top: 10px;
}
.file-editing .file-heading-copy p,
.file-editing .file-editor-heading {
    display: none;
}
.file-editing .file-page-heading h2 {
    font-size: 20px;
}
.file-editing .file-heading-icon {
    width: 36px;
    height: 36px;
    font-size: 20px;
}
.file-editing #fileEditorPanel {
    padding: 18px;
}
.file-editing #fileEmployeePicker {
    padding: 0 0 14px;
    background: transparent;
    gap: 7px;
    margin-bottom: 0;
}
.file-editing #fileSummary.file-employee-card {
    border: 0;
    border-radius: 0;
    padding: 12px 0 16px;
    gap: 8px;
    border-top: 1px solid var(--ef-border);
}
.file-editing .file-person-icon {
    display: none;
}
.file-editing .file-employee-card dl {
    gap: 10px 20px;
}
.file-editing .file-employee-card dl > div {
    border: 0;
    padding: 0;
}
.file-editing .file-employee-value {
    padding: 6px 0;
    border: 0;
    background: transparent;
    border-radius: 0;
    min-height: 28px;
}
.file-editing .file-employee-hint {
    margin: 0;
}
.file-editing .file-section-heading {
    padding: 12px 0;
}
@media (max-width: 600px) {
    .file-editing #fileEditorPanel {
        padding: 12px;
    }
    .file-editing .file-employee-card dl {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .file-editing .file-employee-card dl > div:nth-child(2) {
        grid-column: 1/-1;
    }
    .file-editing .file-hrsd {
        padding: 6px 10px;
    }
}
.employee-file .select-trigger {
    width: 100%;
    justify-content: space-between;

    min-height: 44px;
}
.employee-file .select-trigger-value {
    text-align: start;
}
.employee-file .select-trigger {
    background: var(--ef-surface) !important;
    color: var(--text) !important;
    border-color: var(--ef-border) !important;
}
/* Fill the workspace and keep desktop filter actions on the same row. */
#pageHost .employee-file {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    padding: 5px 0 16px;
}
.employee-file .file-filters {
    grid-template-columns: minmax(180px, 1.6fr) repeat(5, minmax(115px, 1fr)) auto;
    gap: 10px;
    padding: 16px;
}
.employee-file .file-filter-actions {
    flex-wrap: nowrap;
}
.employee-file .file-filter-actions button {
    min-width: 0;
    padding: 8px 10px;
}
.file-types-card {
    padding: 20px;
    border: 1px solid var(--ef-border);
    border-radius: 12px;
    background: var(--ef-surface);
    margin-bottom: 16px;
}
.file-types-card > h3 {
    margin-bottom: 16px;
}
@media (max-width: 1200px) {
    .employee-file .file-filters {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .employee-file .file-filter-actions {
        grid-column: 1/-1;
        justify-content: flex-start;
    }
}
@media (max-width: 600px) {
    .employee-file .file-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 12px;
    }
    .employee-file .file-search-field {
        grid-column: 1/-1;
    }
    .file-types-card {
        padding: 12px;
    }
}
.module-main .module-page.storage-page {
    max-width: 1160px;
    margin-inline: auto;
    gap: 12px;
}
.storage-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
}
.storage-heading h2 {
    font-size: 22px;
}
.storage-heading p {
    color: var(--ef-muted);
    font-size: 12px;
    line-height: 1.8;
    margin-top: 6px;
}
.storage-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    background: var(--ef-soft);
    color: var(--ef-accent);
    border-radius: 12px;
    font-size: 22px;
}
.storage-add > summary {
    cursor: pointer;
    font-weight: 700;
}
.storage-add[open] > summary {
    margin-bottom: 16px;
}
.storage-card {
    border: 1px solid var(--ef-border);
    border-radius: 14px;
    background: var(--ef-surface);
    padding: 20px;
    min-width: 0;
}
.storage-card > h3 {
    font-size: 15px;
    margin-bottom: 18px;
}
.storage-connections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}
.storage-connection {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--ef-border);
    border-radius: 10px;
    min-width: 0;
}
.storage-connection.is-active {
    background: var(--ef-soft);
    border-color: var(--ef-accent);
}
.storage-connection > div {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}
.storage-connection small {
    display: block;
    color: var(--ef-muted);
    margin-top: 5px;
}
.storage-badge {
    color: var(--ef-accent);
    background: var(--ef-surface);
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 700;
}
.storage-page #storageForm {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}
.storage-page .storage-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    border-top: 1px solid var(--ef-border);
    padding-top: 16px;
}
.storage-page #storageHint {
    background: var(--ef-soft);
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.8;
    color: var(--ef-muted);
}
.storage-maintenance summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
}
.storage-maintenance p {
    margin: 14px 0;
    color: var(--ef-muted);
    font-size: 12px;
}
.storage-page #storageResult:empty {
    display: none;
}
.storage-page #storageResult:not(:empty) {
    padding: 14px;
    border: 1px solid var(--ef-border);
    background: var(--ef-soft);
    border-radius: 10px;
    font-size: 13px;
}
@media (max-width: 600px) {
    .storage-page #storageForm {
        grid-template-columns: 1fr;
    }
    .storage-card {
        padding: 14px;
    }
    .storage-connections {
        grid-template-columns: 1fr;
    }
    .storage-connection {
        flex-wrap: wrap;
    }
    .storage-heading h2 {
        font-size: 18px;
    }
}
.storage-page .storage-svg {
    width: 22px;
    height: 22px;
    flex: none;
    vertical-align: middle;
}
.storage-page .storage-icon {
    width: 54px;
    height: 54px;
    border: 1px solid var(--ef-border);
    border-radius: 14px;
    background: var(--ef-soft);
}
.storage-page .storage-icon .storage-svg {
    width: 30px;
    height: 30px;
}
.storage-page .storage-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
}
.storage-section-title .storage-svg {
    color: var(--ef-accent);
}
.storage-page .storage-connection {
    padding: 18px;
    gap: 16px;
    min-height: 106px;
    box-sizing: border-box;
}
.storage-page .storage-connection.is-active {
    border-inline-start: 4px solid var(--ef-accent);
}
.storage-page .storage-connection strong {
    font-size: 16px;
}
.storage-page .storage-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.storage-page .storage-badge .storage-svg {
    width: 16px;
    height: 16px;
}
.storage-location {
    display: block;
    width: fit-content;
    margin-top: 8px;
    font-size: 12px;
    color: var(--ef-muted);
    overflow-wrap: anywhere;
}
.storage-maintenance summary .storage-svg {
    margin-inline-end: 8px;
    color: var(--ef-accent);
}
.storage-page button .storage-svg {
    width: 20px;
    height: 20px;
}
.storage-page #storageResult[data-kind='success'] {
    border-inline-start: 4px solid var(--ef-accent);
}
.storage-page #storageResult[data-kind='error'] {
    border-inline-start: 4px solid #c74d4d;
    color: #a92a2a;
    background: #fff1f1;
}
html[data-theme='dark'] .storage-page #storageResult[data-kind='error'] {
    color: #ffd0d0;
    background: #39252b;
}
@media (max-width: 600px) {
    .storage-page .storage-connection {
        padding: 12px;
        gap: 10px;
    }
    .storage-page .storage-icon {
        width: 44px;
        height: 44px;
    }
    .storage-page .storage-icon .storage-svg {
        width: 26px;
        height: 26px;
    }
}

#entryForm .entry-form-actions {
    justify-content: flex-end;
    direction: rtl;
}
#entryForm #descriptionError {
    color: #b42318;
    font-size: 12px;
    margin-top: 6px;
}
#entryForm textarea[aria-invalid='true'] {
    border-color: #b42318;
}

.file-linked-employee {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 16px;
    border: 1px solid var(--ef-border);
    border-radius: 10px;
    margin-bottom: 12px;
}

.file-row-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 100%;
}
.file-row-actions .file-row-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--ef-border);
    border-radius: 8px;
    background: var(--card);
    color: var(--text);
}
.file-row-action i {
    font-size: 17px;
}
.file-row-actions .is-danger {
    color: #b42318;
}
.file-row-action:hover {
    background: var(--ef-soft);
    border-color: #328168;
}
.file-detail-section {
    border: 1px solid var(--ef-border);
    border-radius: 10px;
    margin: 12px 0;
    overflow: hidden;
}
.file-detail-section > summary {
    padding: 12px 16px;
    font-weight: 700;
    cursor: pointer;
    background: var(--ef-soft);
}
.file-detail-section > summary i {
    margin-inline-end: 8px;
}
.file-detail-content {
    padding: 14px 16px;
}
.file-action-panel {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(200px, 2fr) auto;
    gap: 12px;
    align-items: end;
    padding: 16px;
    background: var(--ef-soft);
    border: 1px solid var(--ef-border);
    border-radius: 10px;
    margin: 16px 0;
}
.file-action-panel h4 {
    grid-column: 1/-1;
    margin: 0;
}
.file-action-panel label {
    display: grid;
    gap: 6px;
}
.file-action-panel textarea {
    min-height: 70px;
}
.incident-selected-item {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 8px 0;
}
.incident-selected-item i {
    color: #328168;
}
.incident-notice .incident-block {
    margin: 12px 0;
    padding: 14px 16px;
}
.incident-notice .incident-signatures:empty {
    display: none;
}
.incident-notice .incident-signatures {
    gap: 10px;
}
.incident-notice .incident-signatures section {
    padding: 12px;
}
.incident-notice .incident-signatures p {
    margin: 6px 0;
}
.file-history {
    border-inline-start: 2px solid var(--ef-border);
    padding: 8px 12px;
    margin: 8px 0;
}
@media (max-width: 700px) {
    .file-action-panel {
        grid-template-columns: 1fr;
    }
    .file-action-panel h4 {
        grid-column: auto;
    }
}

#attachForm.file-attachment-upload {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--ef-border);
    border-radius: 12px;
    margin-top: 16px;
}
.file-attachment-upload > label {
    display: grid;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
}
.employee-file .file-attachment-upload .employee-file-picker {
    display: flex;
}
.file-detail-content > .employee-archive__list {
    width: 100%;
}
.file-detail-content .employee-archive__empty {
    display: grid;
    place-items: center;
    min-height: 180px;
    opacity: 1;
}
.file-detail-content .employee-archive__document {
    min-width: 0;
}

#storageKeyStatus {
    margin: 0;
    line-height: 1.8;
    color: var(--ef-muted);
}
#storageKeyStatus[data-state='ready'] {
    color: var(--ef-accent);
}
#storageKeyStatus[data-state='error'] {
    color: #b42318;
}

.incident-subject-grid {
    height: 520px;
    min-height: 300px;
}

/* Compact identity and entry form; no changes to list or report layouts. */
.employee-file.file-entry-form,
html[data-theme='dark'] .employee-file.file-entry-form {
    --ef-surface: var(--surface);
    --ef-soft: var(--surface-soft);
    --ef-border: var(--line);
    --ef-muted: var(--muted);
    --ef-accent: var(--primary);
}
.employee-file.file-entry-form #fileEditorPanel {
    padding: 18px;
}
.file-entry-form #fileEmployeePicker {
    max-width: 720px;
    padding: 0;
    margin-bottom: 16px;
}
.employee-file #fileSummary .file-identity-header {
    display: flex;
    gap: 12px;
    align-items: center;
    min-width: 0;
}
.file-identity-name {
    flex: 1;
    min-width: 0;
}
.file-identity-name > span,
.file-identity-code > span {
    font-size: 11px;
    color: var(--ef-muted);
}
.employee-file .file-identity-name h3 {
    font-size: 16px;
    line-height: 1.6;
    overflow-wrap: anywhere;
    margin-top: 3px;
}
.file-identity-code {
    display: grid;
    gap: 4px;
    text-align: end;
}
.file-identity-code bdi {
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.employee-file.file-entry-form #fileSummary.file-employee-card {
    padding: 14px 16px;
    border: 1px solid var(--ef-border);
    border-radius: 10px;
    gap: 12px;
    background: var(--card, var(--ef-surface));
}
.file-entry-form .file-person-icon {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    background: var(--card-alt, var(--ef-soft));
    color: var(--text);
}
.file-entry-form .file-employee-card dl {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px 20px;
    padding-top: 12px;
    border-top: 1px solid var(--ef-border);
}
.file-entry-form .file-employee-card dt {
    display: flex;
    gap: 6px;
    align-items: center;
    font-size: 11px;
    margin-bottom: 4px;
}
.file-entry-form .file-employee-card dd {
    font-size: 13px;
    line-height: 1.6;
    font-weight: 600;
}
.file-entry-form #entryForm {
    gap: 14px;
    margin-top: 18px;
}
.file-entry-form .file-section-heading {
    padding: 0 0 10px;
    gap: 8px;
}
.file-entry-form .file-section-heading h3 {
    font-size: 14px;
}
.file-entry-form #incidentEditor > .incident-block {
    margin-top: 10px;
    padding: 12px;
    min-width: 0;
}
.file-entry-form .incident-subject-grid {
    height: clamp(340px, 48vh, 500px);
}
.file-policy-link {
    order: -1;
    margin-inline-end: auto;
    align-self: center;
    font-size: 11px;
    color: var(--ef-muted);
}
@media (max-width: 760px) {
    .file-entry-form .file-employee-card dl {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .file-entry-form .file-employee-card dl > div:nth-child(2) {
        grid-column: auto;
    }
}
@media (max-width: 480px) {
    .employee-file.file-entry-form #fileEditorPanel {
        padding: 12px;
    }
    .file-entry-form .file-identity-header {
        flex-wrap: wrap;
    }
    .file-entry-form .file-identity-code {
        text-align: start;
        margin-inline-start: 50px;
    }
    .file-entry-form .entry-form-actions {
        flex-wrap: wrap;
    }
}
#fileSubjectsGrid {
    height: 580px;
    min-height: 320px;
}

@media screen {
    .file-pagination {
        flex-wrap: nowrap;
        gap: 8px;
        padding: 8px;
        overflow-x: auto;
        white-space: nowrap;
    }

    .file-pagination > * {
        flex-shrink: 0;
    }
}
