:root {
  --bg: #f6f6f7;
  --panel: #ffffff;
  --panel-2: #fafafa;
  --border: #e6e6e9;
  --border-strong: #d4d4d8;
  --text: #18181b;
  --muted: #71717a;
  --faint: #a1a1aa;
  --hover: #f2f2f4;
  --accent: #f38020;
  --accent-hover: #e0701a;
  --accent-text: #c2580c;
  --accent-weak: #fff4ea;
  --sel: #fff1e4;
  --sel-border: #fbd3ad;
  --danger: #dc2626;
  --danger-weak: #fef2f2;
  --success: #16a34a;
  --warn: #d97706;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.08);
  --shadow-lg: 0 24px 64px rgba(0,0,0,.18);
  --radius: 10px;
  --c-folder: #f2a33a;
  --c-image: #8b5cf6;
  --c-video: #ec4899;
  --c-audio: #06b6d4;
  --c-pdf: #ef4444;
  --c-archive: #a16207;
  --c-code: #3b82f6;
  --c-text: #64748b;
  --c-file: #94a3b8;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0d0f;
    --panel: #151518;
    --panel-2: #18181c;
    --border: #26262b;
    --border-strong: #36363d;
    --text: #ededf0;
    --muted: #9b9ba5;
    --faint: #6b6b75;
    --hover: #1e1e23;
    --accent: #f6913a;
    --accent-hover: #ff9f4d;
    --accent-text: #f8a660;
    --accent-weak: rgba(246,145,58,.12);
    --sel: rgba(246,145,58,.13);
    --sel-border: rgba(246,145,58,.38);
    --danger: #f05252;
    --danger-weak: rgba(240,82,82,.12);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.4);
    --shadow-lg: 0 24px 64px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.grow { flex: 1; }
.err { color: var(--danger); }
kbd { font: 11px ui-monospace, Menlo, Consolas, monospace; color: var(--faint); }

.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i.lg { width: 28px; height: 28px; stroke-width: 1.5; }
.i.xl { width: 56px; height: 56px; stroke-width: 1.2; }

/* ---------- Botones e inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--panel); font-weight: 550; white-space: nowrap; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--hover); }
.btn .i { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-ghost { color: var(--danger); }
.btn.danger-ghost:hover { background: var(--danger-weak); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn.block { width: 100%; height: 40px; }
.btn:disabled { opacity: .55; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--accent-text); font-weight: 550; }
.link:hover { text-decoration: underline; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid transparent; background: transparent; color: var(--muted); flex: none;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.on { background: var(--accent-weak); color: var(--accent-text); }
.icon-btn.sm { width: 26px; height: 26px; border-radius: 6px; }
.icon-btn.sm .i { width: 16px; height: 16px; }

input:not([type=checkbox]), select, textarea {
  width: 100%; height: 36px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--panel); outline: none; transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--muted); display: flex; gap: 8px; align-items: baseline; }
.field > span small { font-weight: 400; color: var(--faint); }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }

/* ---------- Login ---------- */
#login { height: 100%; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(1000px 500px at 50% -10%, var(--accent-weak), transparent 70%), var(--bg); }
.login-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 32px; box-shadow: var(--shadow); }
.login-card h1 { font-size: 20px; margin: 22px 0 6px; letter-spacing: -.01em; }
.login-card p.muted { margin: 0 0 20px; }
.login-card .err { margin: 14px 0 0; min-height: 1em; font-size: 13px; }
.code-input { height: 52px !important; text-align: center; font: 600 26px ui-monospace, Menlo, Consolas, monospace !important; letter-spacing: 10px; margin-bottom: 14px; }
.login-links { display: flex; justify-content: space-between; margin-top: 14px; font-size: 13px; }

.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.brand img { width: 24px; height: 24px; }
.brand.big { font-size: 17px; }
.brand.big img { width: 30px; height: 30px; }

/* ---------- Layout ---------- */
#app { height: 100%; display: grid; grid-template-columns: 240px minmax(0, 1fr); grid-template-rows: 54px minmax(0, 1fr); overflow: hidden; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 16px; background: var(--panel); border-bottom: 1px solid var(--border); }
.org-switch { display: flex; align-items: center; gap: 6px; height: 32px; margin-left: 14px; padding: 0 8px 0 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel-2); font-weight: 600; max-width: 280px; }
.org-switch:hover { background: var(--hover); }
.org-switch span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-switch .i { width: 15px; height: 15px; color: var(--muted); }
.avatar { width: 32px; height: 32px; border-radius: 50%; border: 0; background: linear-gradient(135deg, var(--accent), #f5b041); color: #fff; font-weight: 700; margin-left: 4px; }

.sidebar { display: flex; flex-direction: column; min-height: 0; background: var(--panel-2); border-right: 1px solid var(--border); }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 12px 6px 18px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
#bucket-list { flex: 1; overflow: auto; padding: 4px 8px; }
.bucket-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border: 1px solid transparent; border-radius: 8px; background: none; text-align: left; color: var(--text); }
.bucket-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bucket-item .i { color: var(--muted); width: 17px; height: 17px; }
.bucket-item:hover { background: var(--hover); }
.bucket-item.active { background: var(--accent-weak); color: var(--accent-text); font-weight: 600; }
.bucket-item.active .i { color: var(--accent); }
.bucket-item.drop-hot { border-color: var(--accent); background: var(--accent-weak); }
.side-empty { padding: 10px; color: var(--faint); font-size: 13px; }
.side-head em { font-style: normal; font-weight: 600; color: var(--faint); margin-left: 4px; letter-spacing: 0; }
.side-actions { display: flex; gap: 2px; }
.icon-btn.spinning .i { animation: spin .8s linear infinite; }
.side-search { position: relative; display: block; margin: 4px 12px 6px; }
.side-search .i { position: absolute; left: 9px; top: 8px; width: 15px; height: 15px; color: var(--faint); pointer-events: none; }
.side-search input { height: 31px; padding-left: 30px; font-size: 13px; background: var(--panel); }
.side-group { padding: 12px 10px 4px; font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bucket-item.other { background: var(--hover); }
.bucket-item.other .i { color: var(--accent); }
.side-foot { padding: 10px 8px 14px; border-top: 1px solid var(--border); }
.side-link { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--muted); }
.side-link:hover { background: var(--hover); color: var(--text); }
.side-hint { padding: 8px 10px 0; font-size: 11.5px; color: var(--faint); line-height: 1.4; }

#panes { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 10px; min-width: 0; min-height: 0; overflow: auto; }
#panes.split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

/* ---------- Pane ---------- */
.pane { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; container-type: inline-size; }
#panes.split .pane.active { border-color: var(--sel-border); box-shadow: 0 0 0 1px var(--sel-border); }
.pane-head { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 10px; border-bottom: 1px solid var(--border); min-height: 52px; }
.crumbs { display: flex; align-items: center; gap: 1px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.crumbs::-webkit-scrollbar { display: none; }
.crumb { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 8px; border: 1px dashed transparent; border-radius: 7px; background: none; white-space: nowrap; color: var(--muted); font-weight: 500; }
.crumb:hover { background: var(--hover); color: var(--text); }
.crumb:last-child { color: var(--text); font-weight: 650; }
.crumb.root .i { color: var(--accent); width: 17px; height: 17px; }
.crumb.drop-hot { border-color: var(--accent); background: var(--accent-weak); color: var(--accent-text); }
.crumbs .sep .i { width: 14px; height: 14px; color: var(--faint); display: block; }
.tools { display: flex; align-items: center; gap: 2px; flex: none; }
.search { position: relative; width: 180px; margin-right: 4px; }
.search .i { position: absolute; left: 9px; top: 9px; width: 15px; height: 15px; color: var(--faint); pointer-events: none; }
.search input { height: 32px; padding-left: 30px; background: var(--panel-2); }
@container (max-width: 620px) { .search { width: 120px; } }
@container (max-width: 480px) { .search { display: none; } }

.selbar { display: flex; align-items: center; gap: 4px; padding: 6px 8px 6px 12px; background: var(--accent-weak); border-bottom: 1px solid var(--sel-border); overflow-x: auto; scrollbar-width: none; }
.selbar::-webkit-scrollbar { display: none; }
.selbar { height: 43px; flex: none; }
.selbar.idle { background: var(--panel-2); border-bottom-color: var(--border); }
.idle-hint { font-size: 12.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@container (max-width: 780px) { .selbar .btn .lbl { display: none; } .selbar .btn { padding: 0 8px; } }
.selbar .count { font-weight: 650; color: var(--accent-text); margin-right: 8px; white-space: nowrap; }
.selbar .btn { height: 30px; border-color: transparent; background: transparent; padding: 0 10px; font-weight: 500; }
.selbar .btn:hover { background: var(--panel); border-color: var(--border); }
.selbar .btn.danger-ghost:hover { background: var(--danger-weak); }

.cols, .row { display: grid; grid-template-columns: 36px minmax(0, 1fr) 96px 168px; align-items: center; }
@container (max-width: 560px) { .cols, .row { grid-template-columns: 36px minmax(0, 1fr) 84px; } .cols .dt, .row .dt { display: none; } }
.cols { height: 34px; border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--muted); padding-right: 8px; }
.cols button { display: flex; align-items: center; gap: 4px; height: 100%; padding: 0; border: 0; background: none; color: inherit; font-weight: inherit; }
.cols button:hover { color: var(--text); }
.cols .i { width: 13px; height: 13px; }
.cols .sz, .row .sz { justify-content: flex-end; text-align: right; padding-right: 16px; }
.list { flex: 1; overflow: auto; outline: none; padding: 4px 0 40px; position: relative; }
.row { height: 38px; padding-right: 8px; margin: 0 4px; border-radius: 7px; cursor: default; user-select: none; border: 1px solid transparent; }
.row:hover { background: var(--hover); }
.row.sel { background: var(--sel); border-color: var(--sel-border); }
.row.cut { opacity: .5; }
.marquee { position: absolute; z-index: 3; pointer-events: none; border: 1px solid var(--accent); border-radius: 3px; background: color-mix(in srgb, var(--accent) 14%, transparent); }
.row.drop-hot { background: var(--accent-weak); border-color: var(--accent); border-style: dashed; }
.cb { display: grid; place-items: center; height: 100%; }
.cb .i { width: 16px; height: 16px; padding: 1px; border-radius: 5px; border: 1.5px solid var(--border-strong); stroke: transparent; stroke-width: 3; background: var(--panel); opacity: 0; transition: opacity .1s; }
.row:hover .cb .i, .pane.has-sel .cb .i { opacity: 1; }
.row.sel .cb .i { opacity: 1; background: var(--accent); border-color: var(--accent); stroke: #fff; }
.nm { display: flex; align-items: center; gap: 10px; min-width: 0; }
.nm .tx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.folder .nm .tx { font-weight: 550; }
.sz, .dt { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; display: flex; }
.c-folder { color: var(--c-folder); fill: color-mix(in srgb, var(--c-folder) 22%, transparent); }
.c-image { color: var(--c-image); } .c-video { color: var(--c-video); } .c-audio { color: var(--c-audio); }
.c-pdf { color: var(--c-pdf); } .c-archive { color: var(--c-archive); } .c-code { color: var(--c-code); }
.c-text { color: var(--c-text); } .c-file { color: var(--c-file); }

.pane-foot { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 14px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); background: var(--panel-2); }
.pane-foot .spin { width: 12px; height: 12px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pane.loading .list { opacity: .6; transition: opacity .2s .15s; }

.empty { height: 100%; min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); text-align: center; padding: 24px; }
.empty .art { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--accent-weak); color: var(--accent); margin-bottom: 10px; }
.empty b { color: var(--text); font-size: 15px; }
.empty .btn { margin-top: 12px; }
.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; padding: 18px; }
.pick-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 18px; border-radius: 12px; border: 1px solid var(--border); background: var(--panel-2); text-align: left; transition: border-color .12s, transform .12s; }
.pick-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.pick-card .i { color: var(--accent); margin-bottom: 8px; }
.pick-card small { color: var(--muted); }
.pick-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 22px 18px 0; }
.pick-head > div:first-child { flex: 1; min-width: 200px; }
.pick-head h2 { margin: 0; font-size: 17px; }
.pick-head p { margin: 2px 0 0; }
.pick-search { width: 260px; margin: 0; }
.pick-more { grid-column: 1 / -1; padding: 6px 2px; }
.pick-card b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.drop-overlay { position: absolute; inset: 6px; border: 2px dashed var(--accent); border-radius: 10px; background: color-mix(in srgb, var(--accent-weak) 85%, transparent); display: none; place-items: center; text-align: center; pointer-events: none; z-index: 5; color: var(--accent-text); font-weight: 650; }
.drop-overlay .i { width: 40px; height: 40px; display: block; margin: 0 auto 8px; }
.pane.drop-hot > .drop-overlay { display: grid; }
.drag-ghost { position: fixed; top: -100px; left: 0; padding: 7px 12px; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 600; font-size: 13px; }

/* ---------- Menús ---------- */
.menu { position: fixed; z-index: 100; min-width: 210px; max-width: 320px; padding: 5px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); animation: pop .1s ease-out; }
@keyframes pop { from { opacity: 0; transform: scale(.97); } }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 32px; padding: 0 10px; border: 0; border-radius: 6px; background: none; text-align: left; outline: none; }
.menu-item .i { width: 16px; height: 16px; color: var(--muted); }
.menu-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item:hover, .menu-item:focus { background: var(--hover); }
.menu-item.danger, .menu-item.danger .i { color: var(--danger); }
.menu-item:disabled { opacity: .45; }
.menu-sep { height: 1px; margin: 5px 4px; background: var(--border); }
.menu-header { padding: 6px 10px 4px; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Modales ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(9,9,11,.45); backdrop-filter: blur(2px); animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 440px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); animation: pop .14s ease-out; }
.modal.wide { max-width: 820px; height: min(680px, calc(100vh - 32px)); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 12px 6px 20px; }
.modal-head h2 { flex: 1; margin: 0; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-form { display: contents; }
.modal-body { padding: 10px 20px 8px; overflow: auto; flex: 1; min-height: 0; }
.modal-body p { margin: 0 0 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 18px; }

/* preview */
.modal.preview { max-width: min(1200px, 96vw); height: min(900px, 94vh); }
.modal.preview .modal-head { padding: 10px 10px 10px 18px; border-bottom: 1px solid var(--border); }
.pv-titles { flex: 1; min-width: 0; }
.pv-title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-meta { font-size: 12px; color: var(--muted); }
.pv-body { flex: 1; min-height: 0; display: grid; place-items: center; background: var(--panel-2); overflow: auto; border-radius: 0 0 14px 14px; }
.pv-body img, .pv-body video { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.pv-body iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.pv-body audio { width: min(480px, 90%); }
.pv-text { align-self: stretch; justify-self: stretch; margin: 0; padding: 18px 22px; font: 12.5px/1.55 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-word; overflow: auto; }
.pv-none { text-align: center; color: var(--muted); }
.pv-none .i { color: var(--faint); }

.modal.creds { max-width: 640px; }
.warn-box { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 16px; padding: 10px 12px; border-radius: 9px; font-size: 13px;
  background: color-mix(in srgb, var(--warn) 14%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); }
.warn-box .i { color: var(--warn); margin-top: 1px; }
.env-block { margin: 0; padding: 12px 14px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--border); font: 12px/1.6 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-all; user-select: all; }
.cf-box { margin: 4px 0 14px; padding: 14px 14px 2px; border-radius: 10px; border: 1px dashed var(--border-strong); }
.cf-box .field { margin-bottom: 10px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { font: 12px ui-monospace, Menlo, Consolas, monospace; }

/* mini navegador (copiar/mover a) */
.mini-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin: 4px 0 8px; font-size: 13px; }
.mini-crumbs button { border: 0; background: none; padding: 3px 6px; border-radius: 6px; color: var(--muted); }
.mini-crumbs button:hover { background: var(--hover); color: var(--text); }
.mini-crumbs button:last-child { color: var(--text); font-weight: 600; }
.mini-list { height: 240px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; padding: 4px; }
.mini-row { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border: 0; border-radius: 7px; background: none; text-align: left; }
.mini-row:hover { background: var(--hover); }
.pad { padding: 12px; }

/* ---------- Ajustes ---------- */
.settings .modal-body { display: grid; grid-template-columns: 170px 1fr; gap: 20px; padding-bottom: 20px; }
.tabs { display: flex; flex-direction: column; gap: 2px; }
.tabs button { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--muted); text-align: left; font-weight: 500; }
.tabs button:hover { background: var(--hover); color: var(--text); }
.tabs button.active { background: var(--accent-weak); color: var(--accent-text); font-weight: 600; }
.tab-content { min-width: 0; }
.tab-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.tab-head p { margin: 4px 0 0; font-size: 13px; }
.tbl { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.tbl-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.tbl-row:last-child { border-bottom: 0; }
.tbl-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.tbl-main > div { min-width: 0; }
.tbl-main b, .tbl-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl-main small { color: var(--muted); font-size: 12px; }
.tbl-main .i { color: var(--accent); }
.tbl-actions { display: flex; gap: 6px; align-items: center; flex: none; }
.tbl-actions select { height: 30px; width: auto; font-size: 13px; padding: 0 8px; }
.empty-sm { padding: 26px; text-align: center; color: var(--muted); }
.add-member { display: flex; gap: 8px; margin-bottom: 8px; }
.add-member select { width: 150px; flex: none; }
.add-member .btn { height: 36px; }
.roles-help { display: grid; gap: 4px; margin: 14px 0 18px; padding: 12px 14px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }
.roles-help b { color: var(--text); font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-title { display: flex; align-items: center; gap: 6px; margin: -4px 0 14px -8px; }
.form-title h3 { margin: 0; font-size: 15px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.form-msg { min-height: 20px; font-size: 13px; margin-bottom: 4px; }
.form-msg.ok { color: var(--success); }
.form-msg.bad { color: var(--danger); }
.seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 10px; background: var(--hover); margin-bottom: 12px; }
.seg button { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-weight: 550; }
.seg button .i { width: 16px; height: 16px; }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg button.on .i { color: var(--accent); }
.hint { margin: 0 0 16px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.hint b { color: var(--text); font-weight: 600; }
.conn-form[data-mode=account] .only-bucket, .conn-form[data-mode=bucket] .only-account { display: none; }
details.adv { margin-bottom: 10px; }
details.adv summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.row-form { display: flex; gap: 10px; align-items: flex-end; }
.row-form .field { flex: 1; margin: 0; }
.danger-zone { display: flex; align-items: center; gap: 16px; justify-content: space-between; margin-top: 28px; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); border-radius: 10px; }
.danger-zone p { margin: 2px 0 0; font-size: 13px; }
.onboard { align-self: center; justify-self: center; width: 100%; max-width: 420px; text-align: center; padding: 24px 16px; }
.onboard .art { width: 64px; height: 64px; margin: 0 auto; border-radius: 18px; display: grid; place-items: center; background: var(--accent-weak); color: var(--accent); }
.onboard h2 { margin: 16px 0 6px; }
.onboard form { display: flex; gap: 8px; margin-top: 20px; }
.onboard form .btn { height: 36px; }

/* ---------- Transferencias ---------- */
#transfers { position: fixed; right: 16px; bottom: 16px; z-index: 40; width: 380px; max-width: calc(100vw - 32px); background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden; }
.tr-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; font-size: 13px; border-bottom: 1px solid var(--border); }
.tr-head .link { font-size: 12.5px; }
.tr-org { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-list { max-height: 320px; overflow: auto; }
.tr { display: flex; gap: 11px; align-items: flex-start; padding: 10px 8px 10px 14px; border-bottom: 1px solid var(--border); }
.tr:last-child { border-bottom: 0; }
.tr-ic { margin-top: 1px; color: var(--accent); }
.tr-ic .i { width: 17px; height: 17px; }
.tr.done .tr-ic { color: var(--success); }
.tr.error .tr-ic { color: var(--danger); }
.tr.cancelled .tr-ic { color: var(--faint); }
.tr-main { flex: 1; min-width: 0; }
.tr-title { font-size: 13px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-title .muted { font-weight: 400; }
.tr-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.tr-sub .link { font-size: 12px; }
.bar { height: 4px; border-radius: 4px; background: var(--hover); margin-top: 7px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .2s; }
.err-list { margin: 0; padding: 0 0 0 18px; font-size: 12.5px; max-height: 50vh; overflow: auto; }
.err-list li { margin-bottom: 4px; word-break: break-word; }

/* ---------- Toasts ---------- */
#toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { padding: 9px 16px; border-radius: 9px; background: #18181b; color: #fafafa; font-size: 13.5px; box-shadow: var(--shadow-lg); animation: pop .15s ease-out; max-width: min(520px, 90vw); }
.toast.error { background: var(--danger); color: #fff; }
.toast.success::before { content: "✓  "; color: #4ade80; font-weight: 700; }
.toast.warn { background: var(--warn); color: #fff; }
.toast.out { opacity: 0; transition: opacity .3s; }
@media (prefers-color-scheme: dark) { .toast:not(.error):not(.warn) { background: #f4f4f5; color: #18181b; } .toast.success::before { color: var(--success); } }

/* ---------- Móvil ---------- */
.only-mobile { display: none; }
@media (max-width: 760px) {
  .only-mobile { display: inline-grid; }
  .hide-mobile { display: none !important; }
  #app { grid-template-columns: 1fr; }
  .topbar { padding-left: 6px; }
  .topbar .brand span { display: none; }
  .org-switch { margin-left: 4px; }
  .sidebar { position: fixed; top: 54px; bottom: 0; left: 0; width: 260px; z-index: 30; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  body.side-open .sidebar { transform: none; }
  #panes, #panes.split { grid-template-columns: 1fr; padding: 0; }
  #panes.split .pane:not(.active) { display: none; }
  .pane { border-radius: 0; border: 0; }
  .settings .modal-body { grid-template-columns: 1fr; }
  .tabs { flex-direction: row; overflow-x: auto; }
  .grid2 { grid-template-columns: 1fr; }
  .cb .i { opacity: 1; }
}
