/* Раздел «Файлы» и вкладка «Файлы» в рабочей области (Components/Files/FileBrowser.razor). */
.fb { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.fb-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.fb-target { color: #cbd5e1; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.fb-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.fb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 30px; padding: 4px 10px;
          border: 1px solid #334155; border-radius: 8px; background: #1e293b; color: #e5e7eb; font-size: 13px; font-weight: 600;
          cursor: pointer; text-decoration: none; white-space: nowrap; box-sizing: border-box; }
.fb-btn:hover { border-color: #60a5fa; }
.fb-btn:disabled, .fb-btn.is-disabled { opacity: .6; cursor: not-allowed; }
.fb-btn.is-disabled { pointer-events: none; }
.fb-btn-primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.fb-btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.fb-btn-danger:hover { border-color: #f87171; color: #fecaca; }
.fb-alert { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 8px 10px; border-radius: 8px; font-size: 13px;
            background: rgba(37, 99, 235, .15); border: 1px solid rgba(37, 99, 235, .45); color: #bfdbfe; }
.fb-alert-error { background: rgba(220, 38, 38, .15); border-color: rgba(220, 38, 38, .45); color: #fecaca; }
.fb-x { display: inline-flex; flex: 0 0 auto; padding: 2px; border: 0; border-radius: 4px; background: transparent; color: inherit; cursor: pointer; }
.fb-x:hover { background: rgba(148, 163, 184, .18); }
.fb-body { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(280px, 1fr); gap: 14px; min-height: 0; }
.fb-compact .fb-body { grid-template-columns: 1fr; }
.fb-tree { border: 1px solid #334155; border-radius: 10px; background: #0b1222; padding: 6px; min-height: 240px; overflow: auto; }
.fb-row { display: flex; align-items: center; gap: 6px; min-height: 30px; padding: 3px 6px; border-radius: 6px; color: #e5e7eb;
          font-size: 13px; cursor: pointer; user-select: none; }
.fb-row:hover { background: #1e293b; }
.fb-row.is-target { background: rgba(37, 99, 235, .22); }
.fb-row.is-selected { background: rgba(167, 139, 250, .2); }
.fb-space { font-weight: 700; margin-top: 4px; }
.fb-arrow { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; flex: 0 0 18px; padding: 0;
            border: 0; border-radius: 4px; background: transparent; color: #94a3b8; }
button.fb-arrow { cursor: pointer; }
button.fb-arrow:hover { background: #334155; color: #e5e7eb; }
.fb-icon { flex: 0 0 auto; }
.fb-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-count { color: #64748b; font-size: 12px; }
.fb-ro { flex: 0 0 auto; color: #94a3b8; font-size: 11px; font-weight: 400; }
.fb-tag { padding: 1px 7px; border-radius: 999px; background: #1e293b; border: 1px solid #334155; color: #cbd5e1; font-size: 11px;
          max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* Куда упадут перетаскиваемые файлы. */
.fb-tree.is-drop { border-color: #60a5fa; background: #0f1b33; }
.fb-row.is-drop, .fb-empty.is-drop { outline: 1px solid #60a5fa; outline-offset: -1px; background: #0f1b33; border-radius: 6px; }

.fb-edit { cursor: default; }
.fb-input { flex: 1 1 auto; min-width: 0; height: 28px; border: 1px solid #475569; border-radius: 6px; background: #020617; color: #e5e7eb; padding: 0 8px; }
.fb-empty { color: #94a3b8; font-size: 13px; padding: 8px 6px; }
.fb-muted { color: #94a3b8; font-size: 12px; }

/* Просмотр не уезжает при прокрутке длинного дерева; длинный текст прокручивается внутри. */
.fb-preview { border: 1px solid #334155; border-radius: 10px; background: #0f172a; padding: 14px; display: flex; flex-direction: column; gap: 10px;
              min-height: 240px; position: sticky; top: 16px; align-self: start; max-height: calc(100vh - 32px); box-sizing: border-box; }
.fb-preview-head { display: flex; gap: 10px; align-items: flex-start; }
.fb-preview-name { font-size: 15px; font-weight: 700; color: #f8fafc; word-break: break-word; }
.fb-preview-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-preview-title { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.fb-rename { display: flex; flex-direction: column; gap: 8px; }
.fb-rename .fb-input { height: 32px; font-size: 14px; }
.fb-preview-head .fb-i-folder, .fb-preview-head .fb-i-space { margin-top: 5px; }
.fb-compact .fb-preview { position: static; min-height: 0; max-height: none; padding: 10px; }
.fb-text { flex: 1 1 auto; min-height: 0; margin: 0; padding: 10px; border-radius: 8px; background: #020617; color: #e2e8f0; font-family: inherit;
           font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; max-height: none; overflow: auto; }
@media (max-width: 900px) {
    .fb-body { grid-template-columns: 1fr; }
    .fb-preview { position: static; max-height: none; }
    .fb-text { max-height: 60vh; }
}

/* Значки без эмодзи: папка и раздел — фигуры, файл — метка формата. */
.fb-i-folder, .fb-i-space { width: 14px; height: 11px; border-radius: 2px; position: relative; flex: 0 0 14px; }
.fb-i-folder { background: #b98b2e; }
.fb-i-folder::before { content: ""; position: absolute; left: 0; top: -3px; width: 6px; height: 4px; border-radius: 2px 2px 0 0; background: #b98b2e; }
.fb-i-space { background: #475569; }
.fb-i-file { min-width: 30px; padding: 0 3px; border: 1px solid #475569; border-radius: 3px; color: #cbd5e1; font-size: 9px;
             font-weight: 700; line-height: 14px; text-align: center; letter-spacing: .02em; }
.fb-preview-head .fb-i-file { font-size: 11px; line-height: 20px; min-width: 40px; }

/* Поиск файла: вместо дерева — плоский список, под именем — где лежит файл. */
.fb-search { flex: 1 1 180px; min-width: 140px; max-width: 320px; height: 30px; box-sizing: border-box; padding: 0 10px; border: 1px solid #475569;
             border-radius: 8px; background: #020617; color: #e5e7eb; font-size: 13px; }
.fb-search:focus { outline: none; border-color: #60a5fa; }
.fb-found-text { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.fb-path { color: #94a3b8; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
