/* File manager styles — owned by M2. */

.file-shell { display: grid; gap: 14px; }

/* ---------- toolbar ---------- */
.file-toolbar {
  display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center;
}
.file-root { display: inline-flex; align-items: center; gap: 8px; }
.file-root-label { color: var(--muted); font-size: 10px; letter-spacing: .12em; }
.file-root-select {
  width: auto; min-width: 180px; max-width: 320px;
  padding: 7px 10px; font-family: var(--mono); font-size: 12px;
}
.file-crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px;
  flex: 1 1 240px; min-width: 0;
}
.file-crumb {
  background: transparent; border: 1px solid transparent; border-radius: 6px;
  color: var(--muted); font: 12px/1.4 var(--mono); padding: 4px 7px; cursor: pointer;
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-crumb:hover { color: var(--text); background: var(--panel); border-color: var(--border); }
.file-crumb-sep { color: var(--border-strong); font-family: var(--mono); font-size: 12px; }
.file-crumb-current { color: var(--muted); font-size: 12px; padding: 4px 2px; }
.file-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.file-actions .btn { padding: 6px 10px; font-size: 12px; }

/* ---------- feedback ---------- */
.file-error {
  background: rgba(239,106,102,.09); border: 1px solid rgba(239,106,102,.35);
  color: #ffb3b0; padding: 9px 12px; border-radius: 8px; font-size: 13px;
  overflow-wrap: anywhere;
}
.file-error[hidden] { display: none; }
.file-status { min-height: 16px; font-size: 12px; }
.file-banner {
  background: rgba(240,182,75,.08); border: 1px solid rgba(240,182,75,.35);
  color: #ffd89a; padding: 8px 12px; border-radius: 8px; font-size: 12px;
}

/* ---------- upload progress ---------- */
.file-uploads {
  display: grid; gap: 8px; padding: 12px 14px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
}
.file-uploads[hidden] { display: none; }
.file-upload { display: grid; gap: 4px; }
.file-upload-label { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.file-upload-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-upload-pct { font-variant-numeric: tabular-nums; }
.file-upload-bar {
  appearance: none; width: 100%; height: 6px; border: 0; border-radius: 99px;
  background: var(--bg); overflow: hidden;
}
.file-upload-bar::-webkit-progress-bar { background: var(--bg); border-radius: 99px; }
.file-upload-bar::-webkit-progress-value { background: var(--accent); border-radius: 99px; }
.file-upload-bar::-moz-progress-bar { background: var(--accent); border-radius: 99px; }
.file-upload.done .file-upload-pct { color: var(--ok); }
.file-upload.failed .file-upload-pct { color: var(--danger); }
.file-upload.failed .file-upload-bar::-webkit-progress-value { background: var(--danger); }

/* ---------- listing ---------- */
.file-list { padding: 4px 6px; overflow-x: auto; }
.file-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.file-table th {
  text-align: left; color: var(--muted); font-size: 10px; letter-spacing: .08em;
  text-transform: uppercase; font-weight: 600; padding: 10px 10px 8px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.file-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.file-table th:last-child { text-align: right; }
.file-table tr:last-child td { border-bottom: 0; }
.file-table tr:hover td { background: rgba(22,33,45,.45); }
.file-name { display: flex; align-items: center; gap: 8px; min-width: 200px; }
.file-name-link {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--text); font: inherit; text-align: left;
  overflow-wrap: anywhere;
}
.file-name-link:hover { color: var(--accent); text-decoration: underline; }
.file-name-text { color: var(--muted); overflow-wrap: anywhere; }
.file-num { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.file-mode { color: var(--muted); font-size: 11px; white-space: nowrap; }
.file-time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.file-ops { display: flex; gap: 2px; justify-content: flex-end; white-space: nowrap; }
.file-ops .btn { padding: 4px 8px; font-size: 12px; }
.file-danger { color: #ffb3b0; }
.file-danger:hover { background: rgba(239,106,102,.1); color: #ffd0ce; }
.file-table tr.is-symlink td { color: var(--muted); }

/* ---------- editor ---------- */
.file-editor { display: grid; gap: 12px; }
.file-editor[hidden], .file-list[hidden] { display: none; }
.file-editor-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.file-editor-title { display: flex; align-items: baseline; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.file-editor-title strong { font-family: var(--mono); font-size: 13px; font-weight: 600; }
.file-editor-actions { display: flex; gap: 8px; }
.file-editor-area {
  width: 100%; min-height: 320px; resize: vertical;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 12px 14px; font: 13px/1.6 var(--mono); tab-size: 2;
  outline: none; white-space: pre; overflow: auto;
}
.file-editor-area:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(70,212,192,.12); }
.file-editor-area:disabled { opacity: .75; }

/* ---------- dialog extras ---------- */
.file-check {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted);
}
.file-check input { accent-color: var(--danger); }

@media (max-width: 900px) {
  .file-actions { margin-left: 0; width: 100%; }
  .file-root-select { min-width: 140px; }
  .file-table th:nth-child(3), .file-table td:nth-child(3) { display: none; }
  .file-table th:nth-child(4), .file-table td:nth-child(4) { display: none; }
  .file-editor-area { min-height: 300px; }
}
