/* Файловый реестр */
.file-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.file-stats > div { display: flex; min-width: 0; min-height: 78px; align-items: center; gap: 11px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-xs); }
.file-stat__icon { display: inline-flex; width: 39px; height: 39px; flex: 0 0 39px; align-items: center; justify-content: center; border-radius: 10px; font-size: 9px; font-weight: 850; }
.file-stat__icon svg { width: 18px; height: 18px; }
.file-stat__icon--all { color: var(--primary); background: var(--primary-soft); }
.file-stat__icon--pdf { color: #c53b3b; background: #fff0f0; }
.file-stat__icon--word { color: #3267b7; background: #edf3ff; font-size: 14px; }
.file-stat__icon--recent { color: #7c5bb5; background: #f3effb; }
.file-stats p { display: grid; min-width: 0; margin: 0; }
.file-stats strong { color: var(--ink); font-size: 17px; line-height: 1.15; }
.file-stats p span { color: var(--muted); font-size: 9px; }

.file-filters { display: grid; grid-template-columns: minmax(280px, 1fr) 180px 130px 220px auto auto; align-items: end; gap: 9px; }
.file-table { min-width: 1160px; }
.file-primary { display: flex; min-width: 260px; max-width: 390px; align-items: center; gap: 10px; }
.file-primary > span:last-child,
.file-license-link { display: grid; min-width: 0; }
.file-primary strong { overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.file-primary small,
.file-license-link small { overflow: hidden; margin-top: 2px; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.file-primary small b { color: var(--primary-dark); font-weight: 750; }
.file-primary:hover strong,
.file-license-link:hover strong { color: var(--primary); }
.file-type { display: inline-flex; width: 40px; height: 40px; flex: 0 0 40px; align-items: center; justify-content: center; border-radius: 10px; color: #526177; background: #edf1f6; font-size: 8px; font-weight: 850; letter-spacing: -.02em; }
.file-type--pdf { color: #bd3f3f; background: #fff0f0; }
.file-type--doc,
.file-type--docx { color: #3267b7; background: #edf3ff; }
.file-license-link strong { color: var(--ink-soft); font-family: "Cascadia Mono", Consolas, monospace; font-size: 10px; }
.file-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.file-row-actions form { margin: 0; }
.row-action { border: 0; background: transparent; cursor: pointer; }
.row-action--danger:hover { color: var(--danger); background: var(--danger-soft); }

.file-form-card { max-width: 980px; }
.file-form-card > .form-alert { margin: 18px 20px 0; }
.file-being-edited { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--surface-subtle); }
.file-being-edited p { display: grid; min-width: 0; margin: 0; }
.file-being-edited strong { overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.file-being-edited small { color: var(--muted); font-size: 9px; }
.file-form-grid input[type="file"] { padding: 7px; }
.file-form-grid input[type="file"]::file-selector-button { margin-right: 10px; padding: 6px 10px; border: 0; border-radius: 7px; color: var(--primary-dark); background: var(--primary-soft); font: inherit; font-weight: 750; cursor: pointer; }

.attachment-row { grid-template-columns: 38px minmax(0, 1fr) auto auto; }
.attachment-row__actions { display: flex; align-items: center; gap: 2px; }
.attachment-row__actions form { margin: 0; }
.attachment-composer { grid-template-columns: minmax(150px, 1.2fr) minmax(105px, .65fr) minmax(120px, .8fr) minmax(135px, .75fr) auto; }
.attachment-category { display: inline-flex; align-items: center; padding: 2px 6px; border-radius: 999px; color: var(--primary-dark); background: var(--primary-soft); font-size: 8px; font-weight: 750; }

@media (max-width: 1280px) {
    .file-filters { grid-template-columns: minmax(260px, 1fr) 170px 120px 190px auto; }
  .attachment-composer { grid-template-columns: 1fr 1fr; }
    .file-filters .button--ghost { display: none; }
}

@media (max-width: 1050px) {
    .file-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .file-filters { grid-template-columns: 1fr 1fr; }
    .file-filters .search-field { grid-column: 1 / -1; }
    .attachment-composer { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
    .file-filters { grid-template-columns: 1fr; }
    .file-filters .search-field { grid-column: auto; }
    .attachment-composer { grid-template-columns: 1fr; }
  .attachment-row { grid-template-columns: 38px minmax(0, 1fr) auto; }
    .file-table { min-width: 0; table-layout: fixed; }
    .file-table th,
    .file-table td { padding-inline: 10px; }
    .file-table th:nth-child(2), .file-table td:nth-child(2),
    .file-table th:nth-child(3), .file-table td:nth-child(3),
    .file-table th:nth-child(4), .file-table td:nth-child(4),
    .file-table th:nth-child(5), .file-table td:nth-child(5) { display: none; }
    .file-table th:last-child,
    .file-table td:last-child { width: 104px; }
    .file-primary { min-width: 0; max-width: none; }
    .file-being-edited { grid-template-columns: 42px minmax(0, 1fr); }
    .file-being-edited .button { grid-column: 2; justify-self: start; }
}

@media (max-width: 480px) {
    .file-stats { grid-template-columns: 1fr 1fr; }
    .file-stats > div { padding: 12px; }
    .file-table th:last-child,
    .file-table td:last-child { width: 72px; }
    .file-row-actions .row-action:nth-child(2) { display: none; }
}
