/* Nube de archivos */

/* ================================================================ archivos */
.files { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; min-height: calc(100vh / var(--zoom, 1) - 64px - 56px); align-items: start; }
.files-side { position: sticky; top: 84px; display: grid; gap: 4px; padding: 12px; }
.files-spaces { display: grid; gap: 2px; }
.fs-item { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 6px 10px; border-radius: 9px; color: var(--text-2); font-size: 13.5px; font-weight: 550; }
.fs-item:hover { background: var(--surface-2); color: var(--text); }
.fs-item.active { background: var(--accent-soft); color: var(--text); }
.fs-item > .icon { width: 17px; height: 17px; color: var(--muted); }
.fs-item.active > .icon { color: var(--accent); }
.fs-item > span:not(.fs-folder) { flex: 1; min-width: 0; display: grid; }
.fs-item small { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.fs-tag { margin-left: auto; font-size: 10.5px !important; padding: 1px 6px; border-radius: 5px; background: var(--surface-3); }
.fs-folder { display: inline-grid; color: var(--fc); }
.fs-folder .icon { width: 18px; height: 18px; }
.fs-lock { width: 13px !important; height: 13px !important; color: var(--muted); }
.fs-section { padding: 14px 10px 4px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.fs-disk { display: grid; gap: 4px; margin-top: 10px; padding: 12px 10px 4px; border-top: 1px solid var(--border); }
.files-main { position: relative; padding: 18px; min-height: 420px; }
.files-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-width: 0; font-size: 15px; font-weight: 650; }
.crumbs a { padding: 3px 6px; border-radius: 6px; color: var(--muted); }
.crumbs a:hover { background: var(--surface-3); color: var(--text); }
.crumbs a.current { color: var(--text); }
.crumb-sep { width: 14px !important; height: 14px !important; color: var(--muted); }
.files-actions { display: flex; align-items: center; gap: 8px; }
.files-actions .segmented button { display: inline-grid; place-items: center; padding: 0 8px; }
.files-actions .segmented .icon { width: 15px; height: 15px; }
.files-hint { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0 16px; }
.files-hint .tag { margin-left: 0; }
.files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.fi {
  position: relative; display: grid; justify-items: center; gap: 4px; padding: 14px 10px 10px;
  border-radius: 12px; border: 1px solid transparent; cursor: pointer; text-align: center; transition: background .12s, border-color .12s;
}
.fi:hover, .fi:focus-visible { background: var(--surface-2); border-color: var(--border); outline: none; }
.fi-thumb { position: relative; display: grid; place-items: center; width: 96px; height: 80px; color: var(--muted); }
.fi-thumb > .icon { width: 52px; height: 52px; stroke-width: 1.5; }
.fi-folder .fi-thumb { color: var(--fc); }
.fi-folder .fi-thumb > .icon { width: 72px; height: 72px; stroke-width: 1.3; }
.fi-thumb.is-img img {
  width: 96px; height: 80px; border-radius: 8px; object-fit: contain; box-shadow: var(--shadow-sm);
  /* Cuadros grises de fondo: así se ven también las imágenes transparentes con partes blancas o negras */
  background: repeating-conic-gradient(#a7acba 0 25%, #c4c8d2 0 50%) 0 0 / 14px 14px;
}
.fi-badge { position: absolute; right: 6px; bottom: 10px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-sm); color: var(--text-2); }
.fi-badge .icon { width: 13px; height: 13px; }
.fi-name { max-width: 100%; font-size: 13px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.fi-meta { font-size: 11.5px; color: var(--muted); }
.fi-menu { position: absolute; top: 6px; right: 6px; opacity: 0; }
.fi:hover .fi-menu, .fi:focus-within .fi-menu, .fl-row:hover .fi-menu { opacity: 1; }
.fi-popmenu {
  position: absolute; top: 36px; right: 6px; z-index: 30; display: grid; min-width: 170px; padding: 5px;
  border-radius: 10px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); text-align: left;
}
.fi-popmenu button { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; font-size: 13px; }
.fi-popmenu button:hover { background: var(--surface-3); }
.fi-popmenu button.danger { color: var(--danger-text); }
.fi-popmenu .icon { width: 15px; height: 15px; }
.files-list { display: grid; }
.fl-row { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr) 110px 140px 110px 34px; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 9px; cursor: pointer; font-size: 13.5px; }
.fl-row:hover { background: var(--surface-2); }
.fl-head { cursor: default; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border); border-radius: 0; }
.fl-head:hover { background: transparent; }
.fl-icon { display: grid; place-items: center; color: var(--muted); }
.fl-icon.is-folder { color: var(--fc); }
.fl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.fl-row .fi-menu { position: static; }
/* La tarjeta con el menú abierto queda por encima de las de alrededor (que se elevan al pasar el ratón) */
.fi:has(.fi-popmenu), .fl-row:has(.fi-popmenu) { z-index: 40; }
.fl-row .fi-popmenu { top: 40px; right: 8px; }
.inline-icon { width: 13px !important; height: 13px !important; vertical-align: -2px; }
.files-drop {
  position: absolute; inset: 0; z-index: 15; display: grid; place-content: center; justify-items: center; gap: 8px;
  background: color-mix(in srgb, var(--accent) 12%, color-mix(in srgb, var(--surface) 85%, transparent));
  border: 2px dashed var(--accent); border-radius: var(--radius); color: var(--accent); pointer-events: none;
}
.files-drop .icon { width: 40px; height: 40px; }
.uploads { display: grid; gap: 6px; margin-bottom: 14px; }
.upload { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 9px; background: var(--surface-2); overflow: hidden; font-size: 13px; }
.upload > .icon { width: 15px; height: 15px; color: var(--accent); }
.upload.is-done > .icon { color: var(--success); }
.upload.has-error > .icon, .upload.has-error .small { color: var(--danger-text); }
.up-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; }
.up-bar i { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.files-locked { display: grid; justify-items: center; gap: 10px; padding: 60px 20px; text-align: center; }
.fl-lock-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: color-mix(in srgb, var(--fc) 16%, transparent); color: var(--fc); }
.fl-lock-icon .icon { width: 28px; height: 28px; }
.files-unlock { display: flex; gap: 8px; width: min(360px, 100%); }
.files-unlock input { flex: 1; }
.access-list { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 4px; max-height: 260px; overflow-y: auto; }
.access-list li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; background: var(--surface-2); }
.access-list li > span:not(.avatar) { flex: 1; font-weight: 550; }
.access-list select { width: 130px; }
.file-view { display: grid; place-items: center; min-height: 200px; background: var(--surface-3); border-radius: 10px; overflow: hidden; }
.file-view img, .file-view video { max-width: 100%; max-height: calc(100vh / var(--zoom, 1) - 240px); }
.file-view iframe { width: 100%; height: calc(100vh / var(--zoom, 1) - 240px); border: 0; background: #fff; }
.fv-audio { display: grid; justify-items: center; gap: 16px; padding: 40px; }
.fv-audio .icon { width: 48px; height: 48px; color: var(--accent); }
.fv-text { margin: 0; width: 100%; max-height: calc(100vh / var(--zoom, 1) - 240px); overflow: auto; padding: 16px; font: 12.5px/1.5 var(--mono); white-space: pre-wrap; background: var(--surface); }
@container (max-width: 760px) {
  .files { grid-template-columns: 1fr; }
  .files-side { position: static; }
  .fl-row { grid-template-columns: 32px minmax(0, 1fr) 90px 34px; }
  .fl-who, .fl-date, .fl-head span:nth-child(4), .fl-head span:nth-child(5) { display: none; }
  .files-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

.auth-note { text-align: center; margin-top: 4px; }
.auth-single { grid-template-columns: 1fr; }
.credentials { margin: 12px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--surface-3); font: 13px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; user-select: all; }

.install-steps { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.install-steps li { display: grid; gap: 2px; padding: 10px 12px; border-radius: 9px; background: var(--surface-2); font-size: 13px; }
.install-steps li.is-here { box-shadow: inset 0 0 0 1px var(--accent); }
.install-steps span { color: var(--text-2); }

/* ================================================================ nube: mover */
.fi.is-dragging, .fl-row.is-dragging { opacity: .4; }
.drop-over { outline: 2px dashed var(--accent); outline-offset: 2px; background: var(--accent-soft) !important; border-radius: 10px; }
.crumbs a.drop-over, .fs-item.drop-over { outline-offset: 0; }
.move-picker { display: grid; gap: 12px; }
.move-spaces { display: flex; gap: 6px; flex-wrap: wrap; }
.move-spaces .chip { gap: 6px; border: 0; cursor: pointer; padding: 5px 10px; }
.move-spaces .chip .icon { width: 14px; height: 14px; }
.move-spaces .chip.active { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.move-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 320px; overflow-y: auto; }
.move-list button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 9px; background: var(--surface-2); text-align: left; font-weight: 550; }
.move-list button:hover { background: var(--surface-3); }
.move-list button > .icon:last-child { margin-left: auto; width: 15px; height: 15px; color: var(--muted); }

/* --- Nube: archivo encontrado con el buscador */
.fi.flash, .fl-row.flash { animation: flash 1.6s ease; border-radius: 10px; }

.files-main.is-loading .files-body { opacity: .55; transition: opacity .15s; pointer-events: none; }
