/* ==========================================================================
   Finder-Darstellung für Fileshare & Vault (optional, pro Benutzer)
   Aktiv über <html data-fs="finder">; sonst ohne Wirkung.
   ========================================================================== */
.fx-bar { display: none; }

html[data-fs="finder"] {
  --fx-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Inter, system-ui, sans-serif;
  --fx-win: #FFFFFF; --fx-side: rgba(235,235,240,.86); --fx-bar: #F6F6F8; --fx-sep: #E3E3E8; --fx-text: #1D1D1F; --fx-sub: #86868B;
  --fx-hover: rgba(0,0,0,.045); --fx-sel: #0A84FF; --fx-sel-soft: rgba(10,132,255,.14); --fx-stripe: #F7F7F9; --fx-field: rgba(118,118,128,.12);
}
html[data-fs="finder"][data-theme="dark"] {
  --fx-win: #1E1E20; --fx-side: rgba(44,44,48,.92); --fx-bar: #2A2A2D; --fx-sep: #3A3A3D; --fx-text: #F5F5F7; --fx-sub: #98989D;
  --fx-hover: rgba(255,255,255,.06); --fx-sel: #0A84FF; --fx-sel-soft: rgba(10,132,255,.26); --fx-stripe: #232326; --fx-field: rgba(118,118,128,.24);
}

/* ---------- Fenster ---------- */
html[data-fs="finder"] .fs-layout,
html[data-fs="finder"] .vault-layout {
  gap: 0; background: var(--fx-win); border: 1px solid var(--fx-sep); border-radius: 12px; overflow: hidden;
  box-shadow: 0 1px 1px rgba(0,0,0,.04), 0 12px 32px rgba(0,0,0,.10); font-family: var(--fx-font); color: var(--fx-text);
  align-items: stretch; min-height: 560px;
}
html[data-fs="finder"][data-theme="dark"] .fs-layout,
html[data-fs="finder"][data-theme="dark"] .vault-layout { box-shadow: 0 0 0 1px rgba(0,0,0,.5), 0 18px 44px rgba(0,0,0,.45); }

/* ---------- Seitenleiste ---------- */
html[data-fs="finder"] .fs-sidebar,
html[data-fs="finder"] .vault-side {
  background: var(--fx-side); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 0; border-right: 1px solid var(--fx-sep); border-radius: 0; box-shadow: none; position: relative; top: 0; max-height: none;
  padding: 44px 8px 12px;
}
html[data-fs="finder"] .fs-side-head,
html[data-fs="finder"] .vs-head { padding: 10px 8px 4px; border: 0; background: none; }
html[data-fs="finder"] .fs-tree-label,
html[data-fs="finder"] .vs-head > span:first-child { font-size: 11px; font-weight: 600; color: var(--fx-sub); text-transform: none; letter-spacing: 0; }
html[data-fs="finder"] .fs-tree-row,
html[data-fs="finder"] .vs-row { border-radius: 6px; margin: 1px 0; min-height: 28px; }
html[data-fs="finder"] .fs-tree-row:hover,
html[data-fs="finder"] .vs-row:hover { background: var(--fx-hover); }
html[data-fs="finder"] .fs-tree-row.is-active,
html[data-fs="finder"] .vs-row.active { background: var(--fx-sel-soft); }
html[data-fs="finder"] .fs-tree-item,
html[data-fs="finder"] .vs-link { font-size: 13px; font-weight: 500; color: var(--fx-text); }
html[data-fs="finder"] .vs-link .ico, html[data-fs="finder"] .fs-tree-item .ico { color: var(--fx-sel); }
html[data-fs="finder"] .vs-cnt { color: var(--fx-sub); background: none; font-size: 12px; }
html[data-fs="finder"] .vs-search { margin: 0 4px 8px; background: var(--fx-field); border: 0; border-radius: 8px; }
html[data-fs="finder"] .vs-search input { background: transparent; }

/* ---------- Titelleiste ---------- */
html[data-fs="finder"] .fx-bar {
  display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 14px; background: var(--fx-bar);
  border-bottom: 1px solid var(--fx-sep); font-family: var(--fx-font);
}
html[data-fs="finder"] .fx-tl { display: inline-flex; gap: 8px; margin-right: 6px; }
html[data-fs="finder"] .fx-tl i { width: 12px; height: 12px; border-radius: 50%; background: #FF5F57; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.12); }
html[data-fs="finder"] .fx-tl i:nth-child(2) { background: #FEBC2E; }
html[data-fs="finder"] .fx-tl i:nth-child(3) { background: #28C840; }
html[data-fs="finder"] .fx-navs { display: inline-flex; gap: 2px; }
html[data-fs="finder"] .fx-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 26px; border: 0; border-radius: 6px; background: transparent; color: var(--fx-sub); cursor: pointer; }
html[data-fs="finder"] .fx-btn:hover { background: var(--fx-hover); color: var(--fx-text); }
html[data-fs="finder"] .fx-btn.on { background: var(--fx-field); color: var(--fx-text); }
html[data-fs="finder"] .fx-title { font-size: 14px; font-weight: 700; color: var(--fx-text); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html[data-fs="finder"] .fx-seg { display: inline-flex; padding: 2px; border-radius: 7px; background: var(--fx-field); }
html[data-fs="finder"] .fx-seg .fx-btn { height: 24px; width: 32px; }
html[data-fs="finder"] .fx-seg .fx-btn.on { background: var(--fx-win); box-shadow: 0 1px 2px rgba(0,0,0,.15); }
html[data-fs="finder"] .fx-search { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 9px; border-radius: 7px; background: var(--fx-field); color: var(--fx-sub); width: 180px; margin: 0; text-transform: none; letter-spacing: 0; font-weight: 400; flex-direction: row; }
html[data-fs="finder"] .fx-search input { border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 0 !important; height: 26px; font-size: 13px; color: var(--fx-text); width: 100%; }

/* ---------- Fileshare: Hauptbereich ---------- */
html[data-fs="finder"] .fs-main { gap: 0; display: flex; flex-direction: column; min-width: 0; background: var(--fx-win); }
html[data-fs="finder"] .fs-main > .card { border: 0; border-radius: 0; box-shadow: none; background: var(--fx-win); margin: 0; }
html[data-fs="finder"] .fs-head { padding: 8px 14px !important; border-bottom: 1px solid var(--fx-sep) !important; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
html[data-fs="finder"] .fs-crumb { font-size: 12px; color: var(--fx-sub); margin: 0; }
html[data-fs="finder"] .fs-crumb a { color: var(--fx-sub); }
html[data-fs="finder"] .fs-toolbar { margin: 0; gap: 6px; }
html[data-fs="finder"] .fs-toolbar .btn { height: 28px; font-size: 12.5px; border-radius: 7px; font-family: var(--fx-font); }
html[data-fs="finder"] .fs-table { font-family: var(--fx-font); font-size: 13px; }
html[data-fs="finder"] .fs-table thead th { background: var(--fx-win); color: var(--fx-sub); font-size: 11.5px; font-weight: 500; text-transform: none; letter-spacing: 0; border-bottom: 1px solid var(--fx-sep); padding: 6px 12px; }
html[data-fs="finder"] .fs-table tbody tr td { border: 0; padding: 4px 12px; height: 30px; }
html[data-fs="finder"] .fs-table tbody tr:nth-child(even) td { background: var(--fx-stripe); }
html[data-fs="finder"] .fs-table tbody tr:hover td { background: var(--fx-sel-soft); }
html[data-fs="finder"] .fs-name a { color: var(--fx-text); font-weight: 400; }
html[data-fs="finder"] .fs-table .fs-icon { width: 20px; height: 20px; font-size: 15px; }

/* Liste: kleine Mac-Ordner und Dokumente */
html[data-fs="finder"] .fs-icon.folder {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 52'%3E%3Cdefs%3E%3ClinearGradient id='a' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%2384C9FB'/%3E%3Cstop offset='1' stop-color='%234AA6F5'/%3E%3C/linearGradient%3E%3ClinearGradient id='b' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23A6D8FF'/%3E%3Cstop offset='1' stop-color='%236BB8F8'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M4 6a4 4 0 0 1 4-4h14l5 5h29a4 4 0 0 1 4 4v35a4 4 0 0 1-4 4H8a4 4 0 0 1-4-4z' fill='url(%23a)'/%3E%3Cpath d='M2 16a4 4 0 0 1 4-4h52a4 4 0 0 1 4 4v30a4 4 0 0 1-4 4H6a4 4 0 0 1-4-4z' fill='url(%23b)'/%3E%3C/svg%3E") center / contain no-repeat !important;
  border: 0 !important; box-shadow: none !important; position: relative; font-size: 0 !important;
}
html[data-fs="finder"] .fs-icon:not(.folder) {
  background: #FFFFFF !important; border: 1px solid #D5D5DA; border-radius: 3px; position: relative; overflow: hidden;
  clip-path: polygon(0 0, 70% 0, 100% 24%, 100% 100%, 0 100%);
}
html[data-fs="finder"] .fs-icon:not(.folder)::after { content: ''; position: absolute; top: 0; right: 0; width: 30%; height: 24%; background: linear-gradient(225deg, transparent 50%, #E3E3E8 50%); }
html[data-fs="finder"] .fs-icon:not(.folder) .fs-ext { position: absolute; left: 50%; bottom: 14%; transform: translateX(-50%); background: var(--fc, #8E8E93); color: #fff; border-radius: 3px; padding: 0 3px; font-size: 6px; line-height: 1.5; font-weight: 700; }

/* ---------- Symbole-Ansicht ---------- */
html[data-fs="finder"] .fs-layout.fx-icons .fs-table thead { display: none; }
html[data-fs="finder"] .fs-layout.fx-icons .fs-table,
html[data-fs="finder"] .fs-layout.fx-icons .fs-table tbody { display: block; }
html[data-fs="finder"] .fs-layout.fx-icons .fs-table tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 6px; padding: 16px; }
html[data-fs="finder"] .fs-layout.fx-icons .fs-table tbody tr { display: flex; flex-direction: column; align-items: center; position: relative; padding: 10px 6px 8px; border-radius: 8px; }
html[data-fs="finder"] .fs-layout.fx-icons .fs-table tbody tr[hidden] { display: none; }
html[data-fs="finder"] .fs-layout.fx-icons .fs-table tbody tr td { display: block; background: none !important; padding: 0; height: auto; }
html[data-fs="finder"] .fs-layout.fx-icons .fs-table tbody tr td:nth-child(2),
html[data-fs="finder"] .fs-layout.fx-icons .fs-table tbody tr td:nth-child(3) { display: none; }
html[data-fs="finder"] .fs-layout.fx-icons .fs-table tbody tr:hover { background: var(--fx-hover); }
html[data-fs="finder"] .fs-layout.fx-icons .fs-table tbody tr:focus-within { background: var(--fx-sel-soft); }
html[data-fs="finder"] .fs-layout.fx-icons .fs-name { flex-direction: column; gap: 6px; text-align: center; }
html[data-fs="finder"] .fs-layout.fx-icons .fs-name a { white-space: normal; text-overflow: clip; font-size: 12px; line-height: 1.3; max-width: 100px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
html[data-fs="finder"] .fs-layout.fx-icons .fs-icon.folder { width: 64px; height: 52px; }
html[data-fs="finder"] .fs-layout.fx-icons .fs-icon:not(.folder) { width: 44px; height: 56px; border-radius: 4px; }
html[data-fs="finder"] .fs-layout.fx-icons .fs-icon:not(.folder) .fs-ext { font-size: 9px; padding: 1px 5px; bottom: 16%; }
html[data-fs="finder"] .fs-layout.fx-icons td:last-child { position: absolute; top: 2px; right: 2px; }
html[data-fs="finder"] .fs-layout.fx-icons .fs-actions { display: none; background: var(--fx-win); border: 1px solid var(--fx-sep); border-radius: 8px; padding: 2px; box-shadow: 0 4px 12px rgba(0,0,0,.12); gap: 0; }
html[data-fs="finder"] .fs-layout.fx-icons tr:hover .fs-actions { display: flex; opacity: 1; }
html[data-fs="finder"] .fs-layout.fx-icons .fs-actions .icon-btn { width: 24px; height: 24px; }
/* Ordner-Emoji als kleines Abzeichen auf dem Ordner */
html[data-fs="finder"] .fs-icon.folder[data-em]::after { content: attr(data-em); position: absolute; right: -4px; bottom: -3px; font-size: 13px; line-height: 1; }
html[data-fs="finder"] .fs-layout.fx-icons .fs-icon.folder[data-em]::after { font-size: 20px; right: -2px; bottom: -2px; }

/* ---------- Vault ---------- */
html[data-fs="finder"] #vMain { border: 0; border-radius: 0; box-shadow: none; background: var(--fx-win); }
html[data-fs="finder"] #vMain .v-headbar { padding: 8px 18px !important; border-bottom: 1px solid var(--fx-sep) !important; }
html[data-fs="finder"] #vMain .v-toolbar h2 { font-size: 13px; font-weight: 600; color: var(--fx-sub); }
html[data-fs="finder"] .v-row { border-bottom: 0; padding-top: 7px; padding-bottom: 7px; font-family: var(--fx-font); }
html[data-fs="finder"] .v-row:nth-child(even) { background: var(--fx-stripe); }
html[data-fs="finder"] .v-row:hover { background: var(--fx-sel-soft); }
html[data-fs="finder"] .v-tile { border-radius: 9px; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.12); }
html[data-fs="finder"] .v-title { font-weight: 600; }
html[data-fs="finder"] .vault-side .vs-row.active .vs-link { color: var(--fx-text); }

@media (max-width: 760px) {
  html[data-fs="finder"] .fx-search { width: 120px; }
  html[data-fs="finder"] .fs-sidebar, html[data-fs="finder"] .vault-side { padding-top: 12px; }
}
