/* Domácí Cloud – profesionální tmavé téma ve stylu TrueNAS / firemního cloudu:
   chladná břidlicová základna, jedna technická modrá jako akcent,
   ploché panely s tenkým rámečkem, semantické stavové barvy. */

:root {
  --bg: #0a0f16;
  --bg-raised: #101720;
  --bg-card: rgb(16 23 32 / 0.92);
  --bg-solid: #131b26;
  --bg-hover: rgb(255 255 255 / 0.04);
  --border: rgb(148 174 205 / 0.14);
  --border-strong: rgb(148 174 205 / 0.28);
  --text: #e9eef5;
  --text-muted: #8a9ab0;
  --accent: #3aa0ff;
  --accent-amber: #5ec8f5;
  --accent-strong: #1b7fd4;
  --accent-contrast: #ffffff;
  --accent-soft: rgb(58 160 255 / 0.14);
  --gradient-accent: linear-gradient(180deg, #3aa0ff 0%, #1b7fd4 100%);
  --danger: #f87171;
  --warn: #f5a524;
  --ok: #34d399;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --shadow-card: 0 14px 34px -24px rgb(0 0 0 / 0.85);
  --shadow-glow: 0 6px 16px -8px rgb(27 127 212 / 0.55);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  overflow-x: hidden;
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    radial-gradient(80rem 44rem at 78% -18%, rgb(27 127 212 / 0.13), transparent 65%),
    radial-gradient(56rem 32rem at -12% 4%, rgb(56 189 248 / 0.07), transparent 62%),
    linear-gradient(180deg, rgb(255 255 255 / 0.015), transparent 30%);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Inter var", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  font-size: 14.5px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}


.hidden { display: none !important; }
.muted { color: var(--text-muted); }
.center {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
.center-text { text-align: center; padding: 2.75rem 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Logo */
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 14px;
  background: var(--gradient-accent);
  color: var(--accent-contrast);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: var(--shadow-glow);
}
.brand-mark.small { width: 2rem; height: 2rem; border-radius: 10px; font-size: 1rem; }

/* Karty */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.65rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-card);
  animation: rise 0.35s var(--ease) both;
}
.login-card { position: relative; overflow: hidden; }
.login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  pointer-events: none;
}
.login-card > * { position: relative; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 1.15rem 0 0.9rem;
  padding: 0.3rem 0.85rem;
  border: 1px solid rgb(58 160 255 / 0.45);
  border-radius: var(--radius-pill);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: var(--accent-soft);
}
.login-card h1 {
  margin: 0 0 0.45rem;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.12;
}
.login-card h1 .accent,
.accent-text {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.login-card .muted { margin: 0 0 0.4rem; font-size: 0.92rem; }

label { display: block; margin: 1rem 0 0.35rem; font-size: 0.78rem; font-weight: 700; color: var(--text-muted); letter-spacing: 0.06em; text-transform: uppercase; }
input[type="text"], input[type="password"], input[type="email"], input[type="number"], select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: rgb(7 11 18 / 0.75);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
input::placeholder { color: rgb(147 161 184 / 0.6); }
input:hover, select:hover { border-color: var(--border-strong); }
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(58 160 255 / 0.2);
  background: rgb(7 11 18 / 0.95);
}
.error { color: var(--danger); min-height: 1.2em; margin: 0.6rem 0 0; font-size: 0.85rem; }
.hint { margin: 0.55rem 0 0; font-size: 0.82rem; color: var(--text-muted); }
.sep { border: 0; border-top: 1px solid var(--border, rgba(255,255,255,0.08)); margin: 0.9rem 0; }

/* Tlačítka */
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgb(255 255 255 / 0.045);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.48rem 0.95rem;
  font-size: 0.86rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s, box-shadow 0.16s, color 0.16s;
}
.btn:hover { background: rgb(255 255 255 / 0.09); border-color: var(--border-strong); }
.btn:active { transform: translateY(0.5px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary {
  background: var(--accent-strong);
  border-color: var(--accent);
  color: #fff;
  font-weight: 650;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover { background: var(--accent); border-color: var(--accent); box-shadow: 0 8px 20px -10px rgb(27 127 212 / 0.7); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: rgb(248 113 113 / 0.12); border-color: rgb(248 113 113 / 0.4); }
.btn-small { padding: 0.28rem 0.7rem; font-size: 0.78rem; margin-left: 0.35rem; }
.btn-block { width: 100%; justify-content: center; margin-top: 1.4rem; padding: 0.72rem; font-size: 0.98rem; }
.btn-ghost { background: transparent; }
.btn-block.btn-ghost { margin-top: 0.6rem; }

/* Přepínač záložek */
.tabs {
  display: flex;
  gap: 0.25rem;
  margin: 1.3rem 0 0.2rem;
  padding: 0.25rem;
  background: rgb(7 11 18 / 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.tab {
  flex: 1;
  padding: 0.45rem 0.5rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s, color 0.16s;
}
.tab:hover { color: var(--text); background: rgb(255 255 255 / 0.04); }
.tab.active { background: var(--accent-strong); color: #fff; box-shadow: none; }
.code-input { text-align: center; font-size: 1.25rem !important; font-weight: 700; letter-spacing: 0.45em; }

/* Horní lišta */
.topbar {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr);
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: rgb(10 14 21 / 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 800; letter-spacing: -0.015em; font-size: 1.05rem; }
.brand .accent { color: var(--accent); }
.topnav { justify-self: center; }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 0.4rem; min-width: 0; justify-self: end; }
#user-label {
  padding: 0.3rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: rgb(255 255 255 / 0.04);
  font-size: 0.85rem;
}
.btn.active {
  background: var(--accent-soft);
  border-color: rgb(58 160 255 / 0.5);
  color: var(--accent);
}

/* Drobečková navigace */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 0.15rem; padding: 1.1rem 1.5rem 0.4rem; }
.crumb {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  padding: 0.22rem 0.5rem;
  border-radius: 9px;
  transition: background 0.18s, color 0.18s;
}
.crumb:hover { background: var(--accent-soft); }
.crumb-sep { color: var(--text-muted); }

/* Tabulka souborů */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 0 1.5rem; }
.toolbar > * { min-width: 0; }
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; min-width: 0; max-width: 100%; }
.drop-zone {
  margin: 0.7rem 1.5rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  animation: fade 0.4s var(--ease) both;
}
.drop-zone.dragging {
  border-color: var(--accent);
  background: rgb(27 127 212 / 0.08);
  box-shadow: 0 0 0 3px rgb(27 127 212 / 0.18), var(--shadow-card);
}
.files { width: 100%; border-collapse: collapse; }
.files th {
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 0.7rem 1.1rem;
  border-bottom: 1px solid var(--border-strong);
  background: rgb(255 255 255 / 0.03);
  position: sticky;
  top: 0;
  z-index: 1;
  backdrop-filter: blur(8px);
}
.files td { padding: 0.58rem 1.1rem; border-bottom: 1px solid var(--border); }
.files tbody tr { transition: background 0.12s, box-shadow 0.12s; }
.files tbody tr:last-child td { border-bottom: none; }
.files tbody tr:hover { background: var(--bg-hover); box-shadow: inset 2px 0 0 var(--accent); }
.file-name, .link {
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  padding: 0.2rem 0;
  text-align: left;
  width: 100%;
  transition: color 0.15s;
}
.file-icon { width: 1.1rem; height: 1.1rem; fill: var(--text-muted); margin-right: 0.6rem; vertical-align: -0.2rem; transition: fill 0.15s; }
.file-icon.dir { fill: var(--accent); }
.file-name:hover, .link:hover { color: var(--accent); }
.file-name-text { font-weight: 600; }
.col-size { width: 7rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.col-date { width: 10rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.col-actions { width: 15rem; text-align: right; white-space: nowrap; }
.files tbody tr .col-actions .btn { opacity: 0.7; transition: opacity 0.15s; }
.files tbody tr:hover .col-actions .btn { opacity: 1; }

/* Průběh nahrávání */
.progress {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 1.5rem;
  width: min(480px, 90vw);
  background: rgb(19 26 41 / 0.94);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  z-index: 30;
  animation: rise 0.3s var(--ease) both;
}
.progress-bar { height: 6px; width: 0%; background: var(--gradient-accent); transition: width 0.2s var(--ease); }
.progress-label { display: block; padding: 0.6rem 0.95rem; font-size: 0.85rem; color: var(--text-muted); }

.statusbar { padding: 0 1.5rem 2rem; font-size: 0.85rem; }

/* Panely, profil, správa */
.page { max-width: 1040px; margin: 0 auto; padding: 20px 16px 40px; display: grid; gap: 18px; }
.page .card { text-align: left; max-width: none; }
.page .files { width: 100%; }
.page .files td:first-child { width: 45%; }
.page h2 { margin: 0 0 14px; font-size: 1.18rem; font-weight: 700; letter-spacing: -0.01em; }
.page h3 { margin: 22px 0 8px; font-size: 1rem; color: #cbd5e1; }

.avatar-mini { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); }
.avatar-big {
  width: 92px; height: 92px; border-radius: 50%; object-fit: cover;
  border: 3px solid transparent;
  background: linear-gradient(#131a29, #131a29) padding-box, var(--gradient-accent) border-box;
  box-shadow: var(--shadow-glow);
}
.profile-head { display: flex; gap: 18px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.quota-bar { height: 10px; border-radius: 999px; background: rgb(255 255 255 / 0.07); overflow: hidden; margin: 8px 0 4px; }
.quota-fill { height: 100%; width: 0; background: var(--gradient-accent); transition: width 0.4s var(--ease); }
.checkline { display: flex; align-items: center; gap: 10px; margin: 6px 0; font-weight: 500; }
.drive-picker { display: grid; gap: 6px; margin-bottom: 10px; }
.drive-picker .checkline {
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgb(255 255 255 / 0.03);
  transition: border-color 0.15s, background 0.15s;
}
.drive-picker .checkline:hover { border-color: var(--border-strong); background: rgb(255 255 255 / 0.06); }
.row-gap { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.perm-select {
  margin-left: auto;
  width: auto;
  background: rgb(7 11 18 / 0.85);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 4px 8px;
  font: inherit;
  font-size: 0.83rem;
}
.perm-select:disabled { opacity: 0.5; }

input[type="checkbox"] { accent-color: var(--accent-strong); width: 16px; height: 16px; }

@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .topbar { padding: 0.65rem 1rem; }
  .topbar-actions { gap: 0.3rem; }
  .breadcrumb, .toolbar { padding-left: 1rem; padding-right: 1rem; }
  .drop-zone { margin: 0.6rem 1rem 1rem; }
  .statusbar { padding: 0 1rem 1.5rem; }
  .col-date { display: none; }
  .col-size { width: auto; }
  .col-actions { width: auto; }
  .btn-small { margin-top: 0.2rem; }
  .card { padding: 1.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ------------------------------------------------------------ Přehrávač */

.player {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(560px, calc(100% - 24px));
  z-index: 60;
  padding: 14px 16px 12px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: linear-gradient(180deg, rgba(22, 30, 46, 0.94), rgba(12, 17, 28, 0.94));
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  animation: player-in 0.25s ease;
  display: grid;
  gap: 10px;
}

@keyframes player-in {
  from { opacity: 0; transform: translate(-50%, 16px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.player-top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }

.player-cover,
.player-art {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  flex: none;
  object-fit: cover;
}

.player-art {
  display: grid;
  place-items: center;
  font-size: 20px;
  color: #12161f;
  background: linear-gradient(135deg, #5ec8f5, #1b7fd4);
}

.player-cover:not(.hidden) + .player-art { display: none; }

.player-info { min-width: 0; }

.player-title {
  font-weight: 650;
  font-size: .98rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-sub {
  font-size: .76rem;
  opacity: 0.6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-side { display: flex; gap: 6px; }

.player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.player-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.player-btn:hover { background: rgba(255, 255, 255, 0.14); transform: translateY(-1px); }

.player-btn-ghost { width: 32px; height: 32px; border-color: transparent; background: transparent; opacity: .6; font-size: 14px; }
.player-btn-ghost:hover { opacity: 1; background: rgba(255, 255, 255, 0.10); }

.player-btn-main {
  width: 52px;
  height: 52px;
  font-size: 20px;
  border: none;
  color: #12161f;
  background: linear-gradient(135deg, #5ec8f5, #1b7fd4);
  box-shadow: 0 10px 26px rgba(27, 127, 212, 0.38);
}

.player-seek { display: flex; align-items: center; gap: 10px; }

.player-time {
  font-size: 11px;
  opacity: 0.65;
  font-variant-numeric: tabular-nums;
  min-width: 34px;
  text-align: center;
}

.player-range { flex: 1; accent-color: #1b7fd4; height: 4px; cursor: pointer; }

.player-panel {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
  display: grid;
  gap: 8px;
  max-height: 46vh;
  overflow: auto;
}

.player-panel-row { display: flex; gap: 6px; flex-wrap: wrap; }

.playlist-select {
  flex: 1;
  min-width: 130px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  padding: 0 8px;
}

.queue-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }

.queue-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  font-size: .85rem;
}

.queue-item.current { background: rgba(27, 127, 212, 0.16); box-shadow: inset 2px 0 0 #1b7fd4; }
.queue-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-artist { font-size: .72rem; opacity: .6; }

.queue-btn {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  cursor: pointer;
  font-size: 12px;
}

.queue-btn:hover { background: rgba(255, 255, 255, 0.14); }

@media (max-width: 560px) {
  .player { bottom: 10px; padding: 12px 12px 10px; }
  .player-btn { width: 38px; height: 38px; }
  .player-btn-main { width: 48px; height: 48px; }
}

/* Dvoufázové ověření */
.totp-secret {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.05rem;
  letter-spacing: .12em;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  padding: .6rem .9rem;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
}

/* ------------------------------------ Přehrávač: obal alba, fronta, playlisty */

.player-cover {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  object-fit: cover;
  flex: 0 0 auto;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.player-panel {
  margin-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 10px;
  max-height: 46vh;
  overflow: auto;
}

.player-panel-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 8px;
}

.playlist-select {
  flex: 1 1 160px;
  min-width: 140px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  font: inherit;
}

.queue-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.queue-item.current {
  background: rgba(245, 158, 11, 0.16);
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.35);
}

.queue-title {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-artist {
  flex: 0 1 auto;
  font-size: 12px;
  opacity: 0.7;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 35%;
}

.queue-btn {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  cursor: pointer;
  line-height: 1;
}

.queue-btn:hover { background: rgba(255, 255, 255, 0.14); }

@media (max-width: 640px) {
  .player-cover { width: 38px; height: 38px; }
  .queue-artist { display: none; }
}

/* ================= v41: časované zálohy jednotlivých složek ================= */
.folder-backup-card { max-width: none; }
.folder-backup-card .card-head h2 { margin: 2px 0 0; }
.folder-backup-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  margin: 18px 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-hover);
}
.folder-backup-form > label { margin: 0; }
.folder-backup-form > label:nth-of-type(2), .folder-backup-form > label:nth-of-type(3) { grid-column: 1 / -1; }
.folder-backup-form input { margin-top: 6px; }
.folder-backup-form .checkline { align-self: end; padding-bottom: 10px; }
.folder-backup-form .row-actions { grid-column: 1 / -1; }
.backup-days { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 12px; border: 1px solid var(--border); border-radius: 12px; }
.backup-days legend { padding: 0 6px; color: var(--text-muted); font-size: .74rem; font-weight: 700; text-transform: uppercase; }
.backup-days label { margin: 0; min-width: 47px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-card); cursor: pointer; text-align: center; }
.backup-days input { width: auto; margin: 0 4px 0 0; }
.folder-backup-list { display: grid; gap: 10px; margin-top: 16px; }
.folder-backup-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 15px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-card); }
.folder-backup-item.is-paused { opacity: .7; }
.folder-backup-main { min-width: 0; }
.folder-backup-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.folder-backup-path { margin-top: 6px; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .8rem; }
.folder-backup-meta, .folder-backup-result { margin-top: 4px; font-size: .78rem; }
.folder-backup-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.folder-backup-actions .btn { margin: 0; }
.status-pill { padding: 2px 8px; border-radius: 999px; font-size: .68rem; font-weight: 700; }
.status-pill.active { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.status-pill.running { color: var(--accent); background: var(--accent-soft); }
.status-pill.paused { color: var(--text-muted); background: var(--bg-hover); }
@media (max-width: 640px) {
  .folder-backup-form { grid-template-columns: 1fr; padding: 14px; }
  .folder-backup-form > label:nth-of-type(2), .folder-backup-form > label:nth-of-type(3), .folder-backup-form .row-actions, .backup-days { grid-column: 1; }
  .backup-days { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .backup-days label { min-width: 0; padding: 8px 3px; }
  .folder-backup-item { grid-template-columns: 1fr; padding: 14px; }
  .folder-backup-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .folder-backup-actions .btn { justify-content: center; }
  .folder-backup-actions .btn:last-child { grid-column: 1 / -1; }
}

/* ------------------------------------------------------------ Notifikace */
.toasts {
  position: fixed;
  right: 16px;
  bottom: 96px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--bg-solid);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  box-shadow: var(--shadow-card);
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  animation: toast-in 0.24s ease-out;
}

.toast-success { border-left-color: var(--ok); }
.toast-error { border-left-color: var(--danger); }
.toast-warn { border-left-color: var(--warn); }

.toast-msg { flex: 1; }

.toast-close {
  background: none;
  border: 0;
  color: var(--text-muted);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  min-width: 24px;
  min-height: 24px;
}
.toast-close:hover { color: var(--text); }

.toast.leaving { animation: toast-out 0.28s ease-in forwards; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(8px) scale(0.97); }
}

@media (max-width: 640px) {
  .toasts { left: 12px; right: 12px; bottom: 120px; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .toast, .toast.leaving { animation: none; }
}

/* ============================================================
   Designové vylepšení šablony (v12) – jemnější povrchy,
   živější akcenty, lepší čitelnost a mikrointerakce.
   ============================================================ */

::selection { background: rgb(58 160 255 / 0.32); color: #fff; }

html { color-scheme: dark; }

* { scrollbar-width: thin; scrollbar-color: rgb(58 160 255 / 0.45) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgb(255 255 255 / 0.12);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb:hover { background: rgb(58 160 255 / 0.5); background-clip: content-box; }

/* Jemná světelná linka pod horní lištou */
.topbar { position: sticky; }
.topbar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgb(58 160 255 / 0.55), rgb(56 189 248 / 0.25), transparent);
  opacity: 0.8;
}
.brand-mark { position: relative; }
.brand-mark::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  background: var(--gradient-accent);
  filter: blur(14px);
  opacity: 0.35;
  z-index: -1;
}

/* Karty – jemný vnitřní highlight a zvednutí při hoveru */
.card, .drop-zone, .player {
  box-shadow: var(--shadow-card), inset 0 1px 0 rgb(255 255 255 / 0.06);
}
.page .card {
  transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.25s;
}
.page .card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 30px 70px -24px rgb(0 0 0 / 0.8), inset 0 1px 0 rgb(255 255 255 / 0.08);
}

/* Nadpisy sekcí s akcentovým proužkem */
.page h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.page h2::before {
  content: "";
  width: 4px;
  height: 1.05em;
  border-radius: 999px;
  background: var(--gradient-accent);
  box-shadow: var(--shadow-glow);
  flex: none;
}
.page h3 { color: var(--text); font-weight: 700; letter-spacing: -0.01em; }

/* Tabulka souborů – čitelnější řádky a zvýraznění při hoveru */
.files tbody tr { position: relative; }
.files tbody tr:hover {
  background: linear-gradient(90deg, rgb(58 160 255 / 0.08), rgb(255 255 255 / 0.03) 45%, transparent);
  box-shadow: inset 3px 0 0 var(--accent-strong);
}
.files tbody tr:hover .file-icon { fill: var(--accent-amber); }
.files th:first-child, .files td:first-child { padding-left: 1.3rem; }
.files th:last-child, .files td:last-child { padding-right: 1.3rem; }

/* Tlačítka – jemný lesk u primárního */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 -60%;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgb(255 255 255 / 0.45), transparent);
  transform: skewX(-18deg);
  transition: left 0.55s var(--ease);
}
.btn-primary:hover::after { left: 115%; }

/* Vstupy – větší komfort */
input[type="text"], input[type="password"], input[type="email"], input[type="number"], select {
  padding: 0.78rem 0.95rem;
  border-radius: 14px;
}

/* Odznáčky / štítky uživatele */
#user-label { background: linear-gradient(180deg, rgb(255 255 255 / 0.07), rgb(255 255 255 / 0.02)); font-weight: 600; }

/* Kvóta – gradient a vnitřní stín */
.quota-bar { box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.5); overflow: hidden; }
.quota-bar > * { background: var(--gradient-accent) !important; }

/* Přehrávač – výraznější hlavní tlačítko a plynulý pruh */
.player { border-color: rgb(58 160 255 / 0.22); }
.player-btn-main { transition: transform 0.15s var(--ease), box-shadow 0.2s; }
.player-btn-main:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 12px 30px rgb(27 127 212 / 0.5); }
.player-cover { border: 1px solid rgb(255 255 255 / 0.12); }

/* Prázdné stavy */
.center-text { color: var(--text-muted); font-size: 0.95rem; }

/* Přihlašovací karta – dvojitá aura */
.login-card::after {
  content: "";
  position: absolute;
  inset: 55% -35% -45% 35%;
  background: radial-gradient(closest-side, rgb(56 189 248 / 0.14), transparent);
  pointer-events: none;
}

@media (max-width: 720px) {
  .page { padding: 14px 12px 120px; }
  .files th:first-child, .files td:first-child { padding-left: 1rem; }
  .files th:last-child, .files td:last-child { padding-right: 1rem; }
}

/* ============================================================
   v13 — světlý režim, prázdné stavy, statistiky, responzivita
   ============================================================ */

/* Světlý režim (ruční volba nebo automaticky podle systému) */
html[data-theme='light'] {
  color-scheme: light;
  --bg: #f4f6fb;
  --bg-raised: #ffffff;
  --bg-card: rgb(255 255 255 / 0.88);
  --bg-solid: #ffffff;
  --bg-hover: rgb(15 23 42 / 0.05);
  --border: rgb(15 23 42 / 0.1);
  --border-strong: rgb(15 23 42 / 0.2);
  --text: #10192b;
  --text-muted: #5c6b85;
  --accent-contrast: #ffffff;
  --accent-soft: rgb(27 127 212 / 0.12);
  --shadow-card: 0 18px 40px -24px rgb(15 23 42 / 0.35);
  --shadow-glow: 0 10px 26px -10px rgb(27 127 212 / 0.5);
}

html[data-theme='light'] body {
  background-image:
    radial-gradient(70rem 38rem at 82% -12%, rgb(27 127 212 / 0.14), transparent 62%),
    radial-gradient(60rem 34rem at -10% 6%, rgb(56 189 248 / 0.10), transparent 60%);
}

html[data-theme='light'] .topbar,
html[data-theme='light'] .card,
html[data-theme='light'] .player {
  backdrop-filter: blur(14px);
}

.btn-icon {
  padding: 0.45rem 0.7rem;
  font-size: 1rem;
  line-height: 1;
}

.theme-select { max-width: 22rem; }

/* Prázdné a chybové stavy s jasným tlačítkem */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-align: center;
  padding: 2.6rem 1.2rem;
  margin: 0.6rem 0;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--bg-hover), transparent);
}

.empty-state.compact { padding: 1.4rem 1rem; }
.empty-state h3 { margin: 0; font-size: 1.05rem; letter-spacing: 0.01em; }
.empty-state p { margin: 0; max-width: 38rem; }

.empty-icon {
  font-size: 2rem;
  width: 3.4rem;
  height: 3.4rem;
  display: grid;
  place-items: center;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--border);
}

.empty-state.is-error {
  border-color: rgb(248 113 113 / 0.45);
  background: linear-gradient(180deg, rgb(248 113 113 / 0.1), transparent);
}
.empty-state.is-error .empty-icon { background: rgb(248 113 113 / 0.16); }

/* Chybový pruh u nahrávání */
.state-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  margin: 0.6rem 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-hover);
}
.state-error {
  border-color: rgb(248 113 113 / 0.5);
  background: rgb(248 113 113 / 0.12);
}
.row-gap { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Statistiky v administraci */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}
.stat-card {
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}
.stat-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-label { font-weight: 600; font-size: 0.92rem; }
.stat-sub { font-size: 0.82rem; }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.card-head h2 { margin: 0; }

/* Responzivní doladění přehrávače a seznamů */
@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }
  .player-main { flex-wrap: wrap; row-gap: 0.6rem; }
  .player-info { min-width: 45%; }
}

@media (max-width: 640px) {
  .empty-state { padding: 1.8rem 0.9rem; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 0.55rem; }
  .stat-card { padding: 0.75rem 0.8rem; }
  .stat-value { font-size: 1.25rem; }
  .card-head { align-items: flex-start; flex-direction: column; }
  .player-main {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas: 'cover info' 'controls controls';
    align-items: center;
  }
  .player-cover { grid-area: cover; }
  .player-info { grid-area: info; min-width: 0; }
  .player-controls {
    grid-area: controls;
    justify-content: space-between;
    width: 100%;
  }
  .queue-item { flex-wrap: wrap; }
  .queue-title { flex: 1 1 100%; }
  .state-bar { flex-direction: column; align-items: stretch; }
  .topbar-actions { gap: 0.35rem; }
}


/* ---------- Dialog sdílení odkazem ---------- */
.share-dialog {
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  background: var(--bg-solid);
  color: inherit;
  padding: 0;
  max-width: 420px;
  width: min(92vw, 420px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
.share-dialog::backdrop { background: rgba(4, 8, 14, 0.66); backdrop-filter: blur(3px); }
.share-dialog form { padding: 22px 22px 20px; display: block; }
.share-dialog h2 { margin: 0 0 4px; font-size: 19px; color: var(--text); }
.share-dialog input { color: var(--text); }
.share-dialog label { display: block; margin-top: 12px; }
.share-dialog input { width: 100%; box-sizing: border-box; }
.share-dialog .row-gap { margin-top: 16px; }

/* ---------- Auditní log ---------- */
.audit-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0 4px; }
.audit-filters select, .audit-filters input { min-width: 160px; flex: 0 1 240px; }
.audit-detail { font-size: 12px; opacity: 0.85; word-break: break-word; }
.audit-fail { color: var(--danger); }
@media (max-width: 640px) { .audit-filters select, .audit-filters input { flex: 1 1 100%; } }

/* ================================================================
   v18 — logo AlmontPC, hledání, přehlednější admin, zdraví disků
   ================================================================ */

.brand-logo {
  width: 72px;
  height: 72px;
  display: block;
  margin: 0 auto 14px;
  filter: drop-shadow(0 8px 22px rgba(245, 158, 11, .35));
}
.brand-logo.small {
  width: 34px;
  height: 34px;
  margin: 0 8px 0 0;
  display: inline-block;
  vertical-align: middle;
  filter: drop-shadow(0 4px 12px rgba(245, 158, 11, .35));
}

/* Hledání v aktuální složce */
.file-search {
  width: 210px;
  min-width: 150px;
  flex: 0 1 210px;
  margin: 0;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: .92rem;
}


/* Záložky ve správě */
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
  padding: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--card, #101725) 85%, transparent);
  border: 1px solid var(--border, rgba(255, 255, 255, .08));
  position: sticky;
  top: 8px;
  z-index: 5;
  backdrop-filter: blur(10px);
}
.admin-tab {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  opacity: .7;
  transition: background .15s ease, opacity .15s ease;
}
.admin-tab:hover { opacity: 1; background: rgba(255, 255, 255, .06); }
.admin-tab.active {
  opacity: 1;
  color: #10131a;
  background: linear-gradient(135deg, #3aa0ff, #1b7fd4);
  box-shadow: 0 6px 18px rgba(27, 127, 212, .35);
}
.admin-pane.pane-off { display: none !important; }

/* Dashboard grafy */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin-top: 1rem; }
.chart-wrap { min-height: 180px; display: flex; align-items: center; justify-content: center; }
.chart-wrap svg { width: 100%; height: 180px; }
.dash-alerts { max-height: 180px; overflow-y: auto; }
.dash-alert { display: flex; gap: 0.75rem; padding: 0.5rem; border-radius: 8px; background: rgba(255,255,255,0.03); margin-bottom: 0.4rem; }
.dash-alert-time { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.dash-alert-info { border-left: 3px solid var(--accent); }
.dash-alert-warn { border-left: 3px solid #f59e0b; }
.dash-alert-error { border-left: 3px solid var(--danger); }

/* Duplicity */
.dupe-box { background: rgba(255,255,255,0.03); border-radius: 10px; padding: 0.75rem; margin-bottom: 0.75rem; }
.dupe-head { font-weight: 600; margin-bottom: 0.5rem; color: var(--accent); }
.dupe-list { margin: 0; padding-left: 1.2rem; }
.dupe-list li { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.25rem 0; word-break: break-all; }



/* Zdraví disků */
.health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin: 12px 0 16px;
}
.health-card {
  border: 1px solid var(--border, rgba(255, 255, 255, .08));
  border-radius: 14px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, .03);
}
.health-card.health-bad { border-color: rgba(248, 113, 113, .5); }
.health-title { font-weight: 700; margin-bottom: 2px; }
.health-path { font-size: .8rem; word-break: break-all; margin-bottom: 10px; }
.health-state { font-size: .85rem; margin-top: 8px; opacity: .85; }
.health-bad-text { color: #fca5a5; font-size: .85rem; margin-top: 6px; }
.health-warnings { display: grid; gap: 6px; margin: 10px 0; }
.health-warn {
  border-radius: 10px;
  padding: 9px 12px;
  font-size: .9rem;
  background: rgba(245, 158, 11, .12);
  border: 1px solid rgba(245, 158, 11, .35);
}

/* IP seznamy */
.ip-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 8px;
}
.ip-add { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.ip-add input { margin: 0; flex: 1 1 130px; min-width: 0; }

@media (max-width: 620px) {
  .admin-tabs { position: static; }
  .file-search { width: 100%; }
}


/* v19 — čistší přihlášení a přehlednější lišta */
.login-card { text-align: center; }
.login-card h1 { margin: 0 0 18px; font-size: 1.7rem; letter-spacing: -.01em; }
.login-card label { text-align: left; display: block; }
.login-card .hint { margin-top: 14px; font-size: .82rem; opacity: .6; }
.toolbar-actions { gap: 8px; flex-wrap: wrap; }

/* Světlý motiv — pole a tabulky ať nejsou tmavé */
html[data-theme='light'] input,
html[data-theme='light'] select,
html[data-theme='light'] textarea {
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--border-strong);
}
html[data-theme='light'] input::placeholder,
html[data-theme='light'] textarea::placeholder { color: var(--text-muted); opacity: .8; }
html[data-theme='light'] .health-card,
html[data-theme='light'] .empty-state { background: rgb(15 23 42 / .02); }


/* ============================================================
   v21 — přehlednější horní lišta a výběr disku
   ============================================================ */

.topbar { padding: 0.55rem 1.25rem; gap: 0.6rem; }
.topnav {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: rgb(255 255 255 / 0.03);
}
.topnav .navbtn {
  border: 0;
  background: transparent;
  border-radius: var(--radius-pill);
  padding: 0.4rem 0.95rem;
  font-weight: 600;
}
.topnav .navbtn:hover { background: rgb(255 255 255 / 0.07); }
.topnav .navbtn.active {
  background: var(--accent);
  color: #10141c;
  box-shadow: 0 6px 16px -8px var(--accent);
}
html[data-theme='light'] .topnav { background: rgb(0 0 0 / 0.03); }
html[data-theme='light'] .topnav .navbtn:hover { background: rgb(0 0 0 / 0.06); }

.userchip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.7rem 0.25rem 0.3rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: rgb(255 255 255 / 0.04);
  font-size: 0.86rem;
  font-weight: 600;
  max-width: 14rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.userchip .avatar-mini { width: 1.6rem; height: 1.6rem; border-radius: 50%; object-fit: cover; }
#user-label { border: 0; background: none; padding: 0; }

@media (max-width: 780px) {
  .topbar { padding: 0.5rem 0.8rem; }
  .topnav { width: 100%; order: 3; justify-content: space-between; }
  .topnav .navbtn { flex: 1; padding: 0.4rem 0.4rem; font-size: 0.85rem; }
  .userchip { max-width: 8.5rem; }
}

/* Výběr složky pro nový disk */
.picker {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgb(0 0 0 / 0.18);
  overflow: hidden;
}
.picker-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--border);
}
.picker-path { font-size: 0.8rem; opacity: 0.85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-list { max-height: 12rem; overflow: auto; display: flex; flex-direction: column; }
.picker-item {
  text-align: left;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  font: inherit;
}
.picker-item::before { content: '📁'; margin-right: 0.45rem; }
.picker-item:hover { background: rgb(255 255 255 / 0.06); }
html[data-theme='light'] .picker { background: rgb(0 0 0 / 0.03); }
html[data-theme='light'] .picker-item:hover { background: rgb(0 0 0 / 0.05); }

/* Přehlednější karty a tabulky ve správě */
.card { border-radius: 16px; }
.sub-head { margin: 1.1rem 0 0.35rem; font-size: 0.95rem; opacity: 0.9; }
.files th { position: sticky; top: 0; }
.toolbar { gap: 0.6rem; }

.share-dialog .checkline { display: flex; align-items: center; gap: 0.5rem; margin: 0.5rem 0; text-transform: none; letter-spacing: 0; font-size: 0.9rem; }
.share-dialog .checkline input { width: auto; margin: 0; }
.share-dialog select { width: 100%; }

/* ================================================================
   v22 — typy souborů, hromadné operace, náhledy, monitoring, logy
   ================================================================ */

.col-pick { width: 34px; text-align: center; }
.col-pick input { width: 17px; height: 17px; accent-color: var(--accent, #3aa0ff); cursor: pointer; }
tr.row-picked { background: color-mix(in srgb, var(--accent, #3aa0ff) 12%, transparent); }

.type-badge {
  display: inline-flex; align-items: center; justify-content: center;
  position: relative; flex: 0 0 auto;
  width: 38px; height: 38px; margin-right: 10px; border-radius: 10px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .09);
  overflow: hidden; font-size: 18px; line-height: 1;
}
.type-glyph { filter: saturate(1.2); }
.type-thumb { width: 100%; height: 100%; object-fit: cover; }
.type-ext {
  position: absolute; bottom: 0; left: 0; right: 0;
  font-size: 8px; letter-spacing: .04em; text-transform: uppercase;
  text-align: center; padding: 1px 0; background: rgba(6, 12, 24, .72); color: #e7eaf0;
}
.type-badge.k-dir { background: rgba(245, 158, 11, .16); border-color: rgba(245, 158, 11, .35); }
.type-badge.k-image { background: rgba(56, 189, 248, .14); border-color: rgba(56, 189, 248, .32); }
.type-badge.k-video { background: rgba(168, 85, 247, .16); border-color: rgba(168, 85, 247, .34); }
.type-badge.k-audio { background: rgba(52, 211, 153, .15); border-color: rgba(52, 211, 153, .32); }
.type-badge.k-pdf { background: rgba(248, 113, 113, .15); border-color: rgba(248, 113, 113, .32); }
.type-badge.k-archive { background: rgba(250, 204, 21, .14); border-color: rgba(250, 204, 21, .3); }
.type-badge.k-code { background: rgba(129, 140, 248, .16); border-color: rgba(129, 140, 248, .34); }

.bulk-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 10px 0; padding: 10px 14px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(245, 158, 11, .16), rgba(245, 158, 11, .05));
  border: 1px solid rgba(245, 158, 11, .32);
}
.bulk-count { font-weight: 700; margin-right: auto; }

/* Mřížka náhledů */
body.files-grid #file-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
body.files-grid table thead { display: none; }
body.files-grid #file-list tr {
  display: flex; flex-direction: column; gap: 6px; padding: 12px;
  border: 1px solid rgba(255, 255, 255, .08); border-radius: 14px; background: rgba(255, 255, 255, .03);
}
body.files-grid #file-list td { border: 0; padding: 0; }
body.files-grid .type-badge { width: 100%; height: 110px; margin: 0 0 6px; border-radius: 12px; font-size: 34px; }
body.files-grid .file-name { flex-direction: column; align-items: flex-start; text-align: left; }
body.files-grid .col-actions { display: flex; flex-wrap: wrap; gap: 6px; }


/* Náhledový lightbox */
.preview-dialog { width: min(1000px, 96vw); border: 0; border-radius: var(--radius); padding: 0; background: #0b1220; color: inherit; }
.preview-dialog::backdrop { background: rgba(3, 7, 18, .78); }
.preview-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.preview-name { font-weight: 700; margin-right: auto; }
.preview-body { display: flex; align-items: center; justify-content: center; padding: 12px; min-height: 240px; }
.preview-media { max-width: 100%; max-height: 72vh; border-radius: 12px; }

/* Monitoring */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-top: 14px; }
.chart-card { margin: 0; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .03); border: 1px solid rgba(255, 255, 255, .08); }
.chart-card figcaption { font-size: 13px; opacity: .8; margin-bottom: 8px; }
.chart-card canvas { width: 100%; height: auto; display: block; }
.temp-grid, .module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.sub-head { margin: 18px 0 8px; font-size: 15px; }
.module-card {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  padding: 12px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .09); background: rgba(255, 255, 255, .03);
}
.module-card.on { border-color: rgba(52, 211, 153, .4); }
.module-card.off { border-color: rgba(248, 113, 113, .4); opacity: .85; }
.module-name { font-weight: 700; }
.checkline.inline { display: inline-flex; align-items: center; gap: 6px; }

/* Živý log */
.log-view {
  margin-top: 12px; max-height: 420px; overflow: auto; border-radius: 12px;
  background: rgba(3, 7, 18, .6); border: 1px solid rgba(255, 255, 255, .08);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px;
}
.log-row { display: grid; grid-template-columns: 78px 58px 82px 160px 1fr; gap: 8px; padding: 4px 10px; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.log-row .log-level { font-weight: 700; }
.log-row.lvl-warn .log-level { color: #fbbf24; }
.log-row.lvl-error { background: rgba(248, 113, 113, .1); }
.log-row.lvl-error .log-level { color: #f87171; }
.log-row.lvl-debug { opacity: .72; }
.log-time, .log-type, .log-who { opacity: .8; }
.log-msg { word-break: break-word; }
.badge.ok { background: rgba(52, 211, 153, .18); border-color: rgba(52, 211, 153, .4); }

@media (max-width: 720px) {
  .log-row { grid-template-columns: 66px 1fr; }
  .log-row .log-type, .log-row .log-who { display: none; }
  .type-badge { width: 32px; height: 32px; font-size: 16px; }
}

/* ---- Ukazatel místa u profilového loga + QR pro dvoufázové ověření ---- */

.userchip {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 999px;
  padding: .25rem .85rem .25rem .25rem;
  color: inherit;
  cursor: pointer;
  font: inherit;
}
.userchip:hover { background: rgba(255, 255, 255, .08); }
.userchip-text { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.userchip-space { font-size: .72rem; opacity: .65; }

.quota-ring {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--ring-color, #f59e0b) var(--pct, 0%), rgba(255, 255, 255, .12) 0);
  transition: background .3s ease;
}
.quota-ring::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--panel, #101a2c);
}
.quota-ring > * { position: relative; z-index: 1; }
.quota-ring .avatar-mini { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.quota-ring-num { font-size: .68rem; font-weight: 700; }
.quota-ring.warn { --ring-color: #fbbf24; }
.quota-ring.danger { --ring-color: #ef4444; animation: quotaPulse 1.8s ease-in-out infinite; }
@keyframes quotaPulse { 50% { filter: brightness(1.5); } }

.totp-qr-row { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-start; margin: .6rem 0; }
.totp-qr { border-radius: 12px; background: #fff; padding: 6px; }
.warn-text { color: #fbbf24; }

@media (max-width: 640px) {
  .userchip-text { display: none; }
  .userchip { padding: .25rem; }
}

.quota-ring.p0 { --pct: 0%; }
.quota-ring.p5 { --pct: 5%; }
.quota-ring.p10 { --pct: 10%; }
.quota-ring.p15 { --pct: 15%; }
.quota-ring.p20 { --pct: 20%; }
.quota-ring.p25 { --pct: 25%; }
.quota-ring.p30 { --pct: 30%; }
.quota-ring.p35 { --pct: 35%; }
.quota-ring.p40 { --pct: 40%; }
.quota-ring.p45 { --pct: 45%; }
.quota-ring.p50 { --pct: 50%; }
.quota-ring.p55 { --pct: 55%; }
.quota-ring.p60 { --pct: 60%; }
.quota-ring.p65 { --pct: 65%; }
.quota-ring.p70 { --pct: 70%; }
.quota-ring.p75 { --pct: 75%; }
.quota-ring.p80 { --pct: 80%; }
.quota-ring.p85 { --pct: 85%; }
.quota-ring.p90 { --pct: 90%; }
.quota-ring.p95 { --pct: 95%; }
.quota-ring.p100 { --pct: 100%; }


/* ------------------------------------------- Řazení, filtry a fronta uploadu */

.file-select {
  width: auto;
  min-width: 120px;
  max-width: 170px;
  flex: 0 0 auto;
  height: 34px;
  margin: 0;
  padding: 0 28px 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.14));
  background: var(--surface-2, rgba(255, 255, 255, 0.05));
  color: inherit;
  font-size: .85rem;
  cursor: pointer;
}


.th-sort {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  opacity: .75;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.th-sort:hover { opacity: 1; }
.th-sort.active { opacity: 1; color: #3aa0ff; }
.th-sort[data-dir="asc"]::after { content: '▲'; font-size: .6em; }
.th-sort[data-dir="desc"]::after { content: '▼'; font-size: .6em; }

.upload-queue {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.035);
}

.uq-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.uq-spacer { flex: 1; }
.uq-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 260px; overflow: auto; }
.uq-item { padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); }
.uq-row { display: flex; align-items: center; gap: 10px; }
.uq-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.uq-state { font-size: .75rem; opacity: .7; font-variant-numeric: tabular-nums; }
.uq-btns { display: flex; gap: 6px; }
.uq-bar { margin-top: 6px; height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.uq-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #5ec8f5, #1b7fd4); transition: width .2s ease; }
.uq-done .uq-fill { background: linear-gradient(90deg, #34d399, #10b981); }
.uq-error .uq-fill { background: linear-gradient(90deg, #f87171, #ef4444); }
.uq-error .uq-state { color: #fca5a5; opacity: 1; }
.uq-paused .uq-state { color: #fbbf24; opacity: 1; }
.uq-fill.p0 { width: 0%; }
.uq-fill.p1 { width: 1%; }
.uq-fill.p2 { width: 2%; }
.uq-fill.p3 { width: 3%; }
.uq-fill.p4 { width: 4%; }
.uq-fill.p5 { width: 5%; }
.uq-fill.p6 { width: 6%; }
.uq-fill.p7 { width: 7%; }
.uq-fill.p8 { width: 8%; }
.uq-fill.p9 { width: 9%; }
.uq-fill.p10 { width: 10%; }
.uq-fill.p11 { width: 11%; }
.uq-fill.p12 { width: 12%; }
.uq-fill.p13 { width: 13%; }
.uq-fill.p14 { width: 14%; }
.uq-fill.p15 { width: 15%; }
.uq-fill.p16 { width: 16%; }
.uq-fill.p17 { width: 17%; }
.uq-fill.p18 { width: 18%; }
.uq-fill.p19 { width: 19%; }
.uq-fill.p20 { width: 20%; }
.uq-fill.p21 { width: 21%; }
.uq-fill.p22 { width: 22%; }
.uq-fill.p23 { width: 23%; }
.uq-fill.p24 { width: 24%; }
.uq-fill.p25 { width: 25%; }
.uq-fill.p26 { width: 26%; }
.uq-fill.p27 { width: 27%; }
.uq-fill.p28 { width: 28%; }
.uq-fill.p29 { width: 29%; }
.uq-fill.p30 { width: 30%; }
.uq-fill.p31 { width: 31%; }
.uq-fill.p32 { width: 32%; }
.uq-fill.p33 { width: 33%; }
.uq-fill.p34 { width: 34%; }
.uq-fill.p35 { width: 35%; }
.uq-fill.p36 { width: 36%; }
.uq-fill.p37 { width: 37%; }
.uq-fill.p38 { width: 38%; }
.uq-fill.p39 { width: 39%; }
.uq-fill.p40 { width: 40%; }
.uq-fill.p41 { width: 41%; }
.uq-fill.p42 { width: 42%; }
.uq-fill.p43 { width: 43%; }
.uq-fill.p44 { width: 44%; }
.uq-fill.p45 { width: 45%; }
.uq-fill.p46 { width: 46%; }
.uq-fill.p47 { width: 47%; }
.uq-fill.p48 { width: 48%; }
.uq-fill.p49 { width: 49%; }
.uq-fill.p50 { width: 50%; }
.uq-fill.p51 { width: 51%; }
.uq-fill.p52 { width: 52%; }
.uq-fill.p53 { width: 53%; }
.uq-fill.p54 { width: 54%; }
.uq-fill.p55 { width: 55%; }
.uq-fill.p56 { width: 56%; }
.uq-fill.p57 { width: 57%; }
.uq-fill.p58 { width: 58%; }
.uq-fill.p59 { width: 59%; }
.uq-fill.p60 { width: 60%; }
.uq-fill.p61 { width: 61%; }
.uq-fill.p62 { width: 62%; }
.uq-fill.p63 { width: 63%; }
.uq-fill.p64 { width: 64%; }
.uq-fill.p65 { width: 65%; }
.uq-fill.p66 { width: 66%; }
.uq-fill.p67 { width: 67%; }
.uq-fill.p68 { width: 68%; }
.uq-fill.p69 { width: 69%; }
.uq-fill.p70 { width: 70%; }
.uq-fill.p71 { width: 71%; }
.uq-fill.p72 { width: 72%; }
.uq-fill.p73 { width: 73%; }
.uq-fill.p74 { width: 74%; }
.uq-fill.p75 { width: 75%; }
.uq-fill.p76 { width: 76%; }
.uq-fill.p77 { width: 77%; }
.uq-fill.p78 { width: 78%; }
.uq-fill.p79 { width: 79%; }
.uq-fill.p80 { width: 80%; }
.uq-fill.p81 { width: 81%; }
.uq-fill.p82 { width: 82%; }
.uq-fill.p83 { width: 83%; }
.uq-fill.p84 { width: 84%; }
.uq-fill.p85 { width: 85%; }
.uq-fill.p86 { width: 86%; }
.uq-fill.p87 { width: 87%; }
.uq-fill.p88 { width: 88%; }
.uq-fill.p89 { width: 89%; }
.uq-fill.p90 { width: 90%; }
.uq-fill.p91 { width: 91%; }
.uq-fill.p92 { width: 92%; }
.uq-fill.p93 { width: 93%; }
.uq-fill.p94 { width: 94%; }
.uq-fill.p95 { width: 95%; }
.uq-fill.p96 { width: 96%; }
.uq-fill.p97 { width: 97%; }
.uq-fill.p98 { width: 98%; }
.uq-fill.p99 { width: 99%; }
.uq-fill.p100 { width: 100%; }

/* ----- Bezpečnost a monitoring (v24) ----- */
.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.alert-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.alert-row.alert-warn { border-left: 4px solid var(--warn); }
.alert-row.alert-error { border-left: 4px solid var(--danger); }
.alert-row.alert-info { border-left: 4px solid var(--ok); }
.alert-time { color: var(--text-muted); font-size: 0.8rem; min-width: 8.5rem; }
.alert-kind { font-weight: 600; min-width: 5rem; }
.alert-msg { flex: 1; }

/* ================================================================
   v26 — sjednocený design, nová navigace, mobilní optimalizace
   ================================================================ */

:root {
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;
  --r-sm: 8px; --r-md: 10px; --r-lg: 12px;
  --tap: 44px;
}

/* --- Karty: jednotné odsazení a hlavička, žádná karta v kartě --- */
#page-admin .card,
#page-trash .card,
#page-profile .card {
  max-width: none;
  padding: var(--sp-5);
  margin: 0 0 var(--sp-4);
  border-radius: var(--r-lg);
  box-shadow: none;
  animation: none;
}
#page-admin .card h2,
#page-trash .card h2,
#page-profile .card h2 { margin: 0 0 var(--sp-2); font-size: 1.05rem; letter-spacing: -0.01em; }
#page-admin .card-head { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-2); }
#page-admin .card-head h2 { margin: 0; margin-right: auto; }
#page-admin .card .hint { margin: 0 0 var(--sp-3); }
#page-admin .editor {
  margin-top: var(--sp-4);
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: rgb(255 255 255 / 0.025);
}
html[data-theme='light'] #page-admin .editor { background: rgb(0 0 0 / 0.02); }

/* --- Správa: boční menu + obsah --- */
.admin-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: var(--sp-5);
  align-items: start;
}
.admin-bar { display: none; }
.admin-side {
  position: sticky;
  top: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg-card);
}
.admin-menu-search { margin: 0; height: 38px; border-radius: var(--r-pill, 999px); }
.admin-tabs {
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: static;
  padding: 0;
  border: 0;
  background: none;
  margin: 0;
  backdrop-filter: none;
}
.admin-group {
  margin: var(--sp-3) 0 var(--sp-1);
  padding: 0 var(--sp-2);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.admin-group:first-of-type { margin-top: var(--sp-1); }
.admin-tab {
  text-align: left;
  padding: 10px var(--sp-3);
  border-radius: var(--r-sm);
  min-height: var(--tap);
  opacity: .82;
}
.admin-tab.active {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: none;
  border-left: 3px solid var(--accent);
  padding-left: calc(var(--sp-3) - 3px);
}
html[data-theme='light'] .admin-tab.active { color: #1b7fd4; }
.admin-content { min-width: 0; }
.quick-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.admin-scrim { position: fixed; inset: 0; background: rgb(2 6 15 / .55); z-index: 40; }

/* --- Jednotná mřížka karet (dashboard, zdraví, monitoring) --- */
.dash-grid,
.health-grid,
.chart-grid,
.ip-cols,
.temp-grid,
.module-grid,
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: var(--sp-3);
}
.dash-grid > .card { margin: 0; }
.chart-wrap { min-height: 0; }
.chart-wrap svg { height: 170px; }
.chart-card canvas { max-width: 100%; }
.pane-empty { padding: var(--sp-4); text-align: center; color: var(--text-muted); }

/* --- Mobilní spodní navigace --- */
.mobilenav { display: none; }
@media (max-width: 860px) {
  .topbar { grid-template-columns: minmax(0, 1fr) auto; }
  .topnav { display: none; }
  .brand { min-width: 0; white-space: nowrap; }
  .topbar-actions { max-width: min(62vw, 290px); }
  .userchip { min-width: 0; }
  .mobilenav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 95; /* v42: nad .sheet-scrim (88) i sheety (89), aby lišta byla vždy klikatelná */
    display: flex;
    align-items: stretch;
    min-height: calc(57px + env(safe-area-inset-bottom));
    contain: layout paint;
    gap: 2px;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg-solid) 92%, transparent);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(12px);
  }
  .mobilenav-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    flex: 1 1 0;
    min-width: 0;
    min-height: var(--tap);
    border: 0; background: none; color: var(--text-muted);
    font: inherit; font-size: .72rem; font-weight: 600; cursor: pointer;
    border-radius: var(--r-sm);
    overflow: hidden;
  }
  .mobilenav-btn span { font-size: 1.1rem; line-height: 1; }
  .mobilenav-btn svg { width: 22px; height: 22px; fill: currentColor; }

  .mobilenav-btn.active { color: var(--accent); background: var(--accent-soft); }
  #app-view { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .player { bottom: calc(64px + env(safe-area-inset-bottom)); }
}

/* --- Správa na telefonu: šuplík --- */
@media (max-width: 860px) {
  .admin-shell { display: block; }
  .admin-bar {
    display: flex; align-items: center; gap: var(--sp-2);
    margin-bottom: var(--sp-3);
  }
  .admin-section-title { font-weight: 700; font-size: 1.05rem; }
  .admin-side {
    position: fixed;
    z-index: 50;
    top: 0; bottom: 0; left: 0;
    width: min(82vw, 300px);
    border-radius: 0 var(--r-lg) var(--r-lg) 0;
    background: var(--bg-solid);
    overflow-y: auto;
    transform: translateX(-102%);
    transition: transform .22s var(--ease);
  }
  .admin-side.open { transform: none; }
  #page-admin .card { padding: var(--sp-4); }
}
@media (min-width: 861px) { .admin-scrim { display: none !important; } }

/* --- Tabulky jako karty na úzkých displejích --- */
@media (max-width: 720px) {
  .files thead { display: none; }
  .files, .files tbody, .files tr, .files td { display: block; width: 100%; }
  .files tr {
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: var(--sp-3);
    margin-bottom: var(--sp-2);
    background: rgb(255 255 255 / 0.025);
  }
  .files td { border: 0; padding: 2px 0; }
  .files td.col-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-2); }
  .files td.col-pick { position: absolute; right: var(--sp-3); padding: 0; width: auto; }
  .files tr { position: relative; }
  html[data-theme='light'] .files tr { background: rgb(0 0 0 / 0.02); }
  .btn-small { min-height: 38px; }
  .toolbar-actions { gap: 6px; }
  .toolbar-actions .btn, .file-select { min-height: 38px; }
  .file-search { flex: 1 1 100%; }
  .card { padding: var(--sp-4); }
  dialog { width: min(96vw, 520px); }
}

/* --- Výkon: méně rozostření a stínů na mobilu --- */
@media (max-width: 860px) {
  .card, .admin-side, .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .card { box-shadow: none; }
  body { background-attachment: scroll; }
}

/* --- Dotykové cíle --- */
.btn { min-height: 36px; }
.navbtn, .mobilenav-btn, .admin-tab { touch-action: manipulation; }

/* ---------- Profil: grafický přehled využití ---------- */
.usage-panel { margin: 20px 0; padding: 18px; border-radius: 16px; background: rgb(255 255 255 / 0.03); border: 1px solid rgb(255 255 255 / 0.07); }
.usage-panel h4 { margin: 18px 0 8px; font-size: 0.9rem; letter-spacing: 0.02em; opacity: 0.85; }
.usage-top { display: grid; grid-template-columns: 160px 1fr; gap: 18px; align-items: center; }
.usage-ring svg { width: 100%; max-width: 160px; height: auto; }
.usage-ring-num { fill: currentColor; font-size: 22px; font-weight: 700; }
.usage-ring-sub { fill: currentColor; font-size: 11px; opacity: 0.65; }
.usage-legend-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 0.9rem; }
.usage-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.usage-legend-name { flex: 1; }
.usage-legend-size { opacity: 0.7; font-variant-numeric: tabular-nums; }
.usage-history svg { width: 100%; height: 70px; }
.usage-largest { list-style: none; margin: 0; padding: 0; }
.usage-largest li { display: flex; gap: 12px; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid rgb(255 255 255 / 0.05); font-size: 0.88rem; }
.usage-file { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.small { font-size: 0.82rem; }
@media (max-width: 640px) {
  .usage-top { grid-template-columns: 1fr; justify-items: center; }
  .usage-legend { width: 100%; }
}

/* ---------- Webová konzole ---------- */
.console-out { min-height: 240px; max-height: 420px; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 0.82rem; white-space: pre-wrap; }
.console-line { padding: 1px 0; }
.console-cmd { color: var(--accent, #f5a524); font-weight: 600; }
.console-err { color: #f87171; }
.console-form { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.console-prompt { font-family: ui-monospace, monospace; opacity: 0.6; }
.console-form input { flex: 1; font-family: ui-monospace, monospace; }
.row-gap { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }

/* ---------- Umístění dat: kompaktní přehledové dlaždice ---------- */
#storage-now { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 14px 0 18px; }
#storage-now .stat { display: block; padding: 12px 14px; border-radius: 12px; background: rgb(148 163 184 / 0.10); }
#storage-now .stat-label { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.7; margin-bottom: 4px; }
#storage-now .stat-value { display: block; font-size: 0.95rem; font-weight: 600; word-break: break-all; line-height: 1.35; }
#storage-users td { padding: 8px 10px; font-size: 0.88rem; }

/* ---- Antivirus a převod videa (v30) ---- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.75rem 1rem;
  margin: 0.75rem 0;
}
.form-grid label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.9rem; }
.form-grid label.check {
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  grid-column: 1 / -1;
  font-weight: 500;
}
.form-grid label.check input { width: auto; margin: 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.35rem; }
.pill {
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: rgb(255 255 255 / 0.05);
  color: var(--muted);
  white-space: nowrap;
}
.pill.ok { border-color: rgb(52 211 153 / 0.45); background: rgb(52 211 153 / 0.14); color: #6ee7b7; }
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* ============ v31: dlaždice, tabulky, hromadné akce, paleta ============ */

.tile-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  text-align: left;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  color: inherit;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.tile:hover { transform: translateY(-2px); border-color: var(--accent); }
.tile-label { font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; opacity: .65; }
.tile-value { font-size: 1.4rem; font-weight: 700; line-height: 1.1; }
.tile-note { font-size: .8rem; opacity: .7; }
.tile-warn { border-color: rgb(245 165 36 / 0.55); }
.tile-warn .tile-value { color: var(--warn); }
.tile-bad { border-color: rgb(248 113 113 / 0.6); }
.tile-bad .tile-value { color: var(--danger); }
.tile-skeleton { min-height: 84px; opacity: .35; animation: tilePulse 1.2s ease-in-out infinite; }
@keyframes tilePulse { 50% { opacity: .15; } }

.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.table-toolbar input[type="search"] { flex: 1 1 220px; min-width: 0; }
.bulk-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  margin-bottom: 10px;
  border-radius: 12px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
}
.bulk-count { font-weight: 600; margin-right: 4px; }

.table-zebra tbody tr:nth-child(even) { background: var(--bg-hover); }
.table-zebra tbody tr:hover { background: var(--accent-soft); }
.col-check { width: 34px; }
.col-num { white-space: nowrap; }
.mini-bar {
  margin-top: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--border-strong);
  overflow: hidden;
}
.mini-bar span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.mini-bar-warn span { background: var(--danger); }
.table-foot {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
}

.cmdk {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  background: rgb(3 7 18 / 0.6);
  backdrop-filter: blur(6px);
}
.cmdk.hidden { display: none; }
.cmdk-box {
  width: min(620px, 92vw);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--bg-solid);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.cmdk-box input { border: 0; border-radius: 0; border-bottom: 1px solid var(--border); padding: 14px 16px; font-size: 1rem; }
.cmdk-list { overflow-y: auto; padding: 6px; }
.cmdk-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.cmdk-item:hover, .cmdk-item.active { background: var(--accent-soft); }
.cmdk-label { font-weight: 600; }
.cmdk-empty, .cmdk-foot { padding: 12px 16px; font-size: .85rem; }

@media (max-width: 720px) {
  .tile-row { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .table-toolbar > * { flex: 1 1 100%; }
  .cmdk { padding-top: 6vh; }
}
.pill.warn { border-color: rgb(58 160 255 / 0.5); background: rgb(58 160 255 / 0.14); color: #93c5fd; }
.file-name-text .pill { margin-left: 8px; font-size: .7rem; }

/* Rozvržení sloupců v tabulce uživatelů */
body .admin-pane[data-tab="uzivatele"] table.files { table-layout: fixed; width: 100%; }
body .admin-pane[data-tab="uzivatele"] th:nth-child(2),
body .admin-pane[data-tab="uzivatele"] td:nth-child(2) { width: 42%; }
body .admin-pane[data-tab="uzivatele"] th:nth-child(3),
body .admin-pane[data-tab="uzivatele"] td:nth-child(3) { width: 18%; }
body .admin-pane[data-tab="uzivatele"] th:nth-child(4),
body .admin-pane[data-tab="uzivatele"] td:nth-child(4) { width: 20%; }
body .admin-pane[data-tab="uzivatele"] td.col-actions { width: 20%; white-space: nowrap; text-align: right; }
body .admin-pane[data-tab="uzivatele"] td { vertical-align: middle; }
body .admin-pane[data-tab="uzivatele"] .file-name-text { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
@media (max-width: 820px) {
  body .admin-pane[data-tab="uzivatele"] table.files { table-layout: auto; }
  body .admin-pane[data-tab="uzivatele"] th:nth-child(4),
  body .admin-pane[data-tab="uzivatele"] td:nth-child(4) { display: none; }
}

/* ================================================================
   v32 — sjednocený vzhled (PC i mobil) a přehlednější nahrávání
   ================================================================ */

/* Karty a sekce dostanou jemný rám a stín, ať jsou od sebe odděleny. */
.card {
  border-radius: var(--radius);
  box-shadow: 0 18px 40px -28px rgb(0 0 0 / 0.75);
}
.card + .card { margin-top: 16px; }
.card-head { align-items: center; gap: 12px; }
.card h2 { letter-spacing: -0.01em; }

/* Lišta nad seznamem souborů zůstane při rolování nahoře. */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 10px 24px;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}
.breadcrumb { flex-wrap: wrap; }
.crumb { border-radius: var(--radius-sm); padding: 4px 10px; }
.crumb:hover { background: var(--accent-soft); }

/* Ovládací prvky mají stejnou výšku a čitelný stav zaměření. */
.btn, .file-search, .file-select, input[type="text"], input[type="password"], input[type="number"], input[type="search"], select {
  min-height: 38px;
  border-radius: var(--radius-sm);
}
.btn-small { min-height: 34px; }
:is(.btn, input, select, textarea):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Řádky souborů: pohodlnější rozteč a zvýraznění pod kurzorem. */
table.files td, table.files th { padding-block: 10px; }
table.files tbody tr:hover { background: var(--accent-soft); }
.file-icon { flex: none; }

/* Fronta nahrávání — čitelnější panel se stavem každého souboru. */
.upload-queue {
  position: sticky;
  bottom: 0;
  z-index: 25;
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--bg-card);
  box-shadow: 0 -10px 34px -24px rgb(0 0 0 / 0.9);
}
.uq-item { padding: 10px 12px; border-radius: var(--radius-sm); }
.uq-item + .uq-item { margin-top: 6px; }
.uq-running { background: var(--accent-soft); }
.uq-error { background: rgb(248 113 113 / 0.12); }
.uq-done { opacity: .7; }
.uq-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uq-state { font-variant-numeric: tabular-nums; font-size: .85rem; }
.uq-bar { height: 6px; border-radius: 999px; overflow: hidden; }
.uq-fill { transition: width .25s ease; }

/* Dlaždice přehledu (dashboard) — stejná výška a jemný přechod. */
.tile-row { gap: 12px; }
.tile-row > * { border-radius: var(--radius); transition: transform .15s ease, border-color .15s ease; }
.tile-row > *:hover { transform: translateY(-2px); border-color: var(--accent); }

/* --------------------------- Mobil --------------------------- */
@media (max-width: 720px) {
  .toolbar { padding: 8px 14px; gap: 8px; }
  .toolbar-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    min-width: 0;
  }
  .toolbar-actions .file-search { grid-column: 1 / -1; }
  .toolbar-actions .btn, .toolbar-actions .file-select { width: 100%; }
  .card { padding: 14px; border-radius: var(--radius); }
  .btn, .file-select, input, select { min-height: 44px; } /* pohodlné pro prst */
  .upload-queue { border-radius: 16px 16px 0 0; }
  .uq-row { flex-wrap: wrap; }
  .bulk-bar { position: sticky; bottom: 62px; z-index: 24; flex-wrap: wrap; }
  .profile-head { flex-direction: column; align-items: flex-start; }
  .topbar { gap: 8px; }
  .userchip-text { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; }
}

/* Bezpečná zóna iPhonu (spodní lišta) */
@supports (padding: env(safe-area-inset-bottom)) {
  @media (max-width: 720px) {
    .upload-queue { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  }
}

/* ---------- v34: globální hledání, galerie, plánovač ---------- */
.search-dialog .preview-head { gap: .6rem; }
.search-input { flex: 1; min-width: 0; }
.search-status { padding: .25rem .75rem; font-size: .85rem; }
.search-results { overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 0 .5rem .75rem; }
.search-hit { display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left; background: transparent; border: 0; border-radius: 8px; padding: .5rem .6rem; cursor: pointer; color: inherit; }
.search-hit:hover, .search-hit:focus-visible { background: var(--accent-soft, rgba(255,180,60,.12)); }
.search-hit-mid { display: flex; flex-direction: column; min-width: 0; }
.search-hit-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-hit-path { font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem; overflow-y: auto; padding: .5rem .75rem .75rem; }
.gallery-cell { position: relative; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--bg-card); cursor: pointer; padding: 0; color: inherit; }
.gallery-img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--bg); }
.gallery-video-badge { position: absolute; top: .4rem; right: .4rem; z-index: 1; background: rgba(0,0,0,.55); border-radius: 999px; padding: .15rem .5rem; font-size: .8rem; }
.gallery-name { font-size: .72rem; padding: .3rem .45rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }

.sched-list { display: flex; flex-direction: column; gap: .6rem; }
.sched-row { border: 1px solid var(--border); border-radius: 10px; padding: .55rem .7rem; background: var(--bg-card); }
.sched-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.sched-head strong { flex: 1; min-width: 140px; }
.sched-hours { width: 70px; }
.sched-info { font-size: .78rem; margin-top: .25rem; }

/* Kdo soubor nahrál — drobný popisek pod názvem */
.file-uploader {
  font-size: 0.72rem;
  margin-top: 2px;
  opacity: 0.8;
}

/* v36 — provozní karty */
.job-list { display: grid; gap: 12px; margin-top: 12px; }
.job-item {
  padding: 12px 14px;
  border: 1px solid var(--border, rgba(255,255,255,.08));
  border-radius: 12px;
  background: rgba(255,255,255,.03);
  display: grid;
  gap: 8px;
}
.job-item .quota-bar { height: 8px; }
.analyze-out { margin-top: 12px; display: grid; gap: 8px; }
.analyze-out h3 { margin: 12px 0 4px; font-size: .95rem; }
tr.row-warn td { color: var(--warn, #f5a524); }

/* ================= v38: lišta, sheety a mřížka na mobilu ================= */
.tb-group { display: contents; }
.only-mobile { display: none; }
.btn.btn-view.active { background: var(--accent); color: var(--accent-contrast); border-color: transparent; }

dialog.sheet {
  border: 1px solid var(--border);
  background: var(--bg-solid);
  color: var(--text);
  border-radius: var(--radius);
  padding: 16px;
  width: min(94vw, 420px);
}
dialog.sheet::backdrop { background: rgb(0 0 0 / 0.55); }
/* v42: nemodální sheety — vlastní scrim, dialog plave nad obsahem, lišta zůstává klikatelná */
.sheet-scrim { position: fixed; inset: 0; background: rgb(0 0 0 / 0.55); z-index: 88; }
dialog.sheet:not([open]) { display: none; }
dialog.sheet[open]:not(:modal) { position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); top: auto; transform: translateX(-50%); margin: 0; z-index: 89; max-height: min(70vh, 520px); overflow: auto; box-shadow: var(--shadow, 0 18px 50px rgb(0 0 0 / 0.5)); }
.sheet-title { margin: 0 0 12px; font-size: 1rem; }
.sheet-body { display: grid; gap: 8px; }
.sheet-body .tb-group { display: grid; gap: 8px; }
.sheet-body .btn, .sheet-body .file-select { width: 100%; min-height: 42px; }
.sheet-close { margin-top: 14px; width: 100%; min-height: 42px; }

/* Mřížka funguje i na telefonu */
body.files-grid .files, body.files-grid .files tbody,
body.files-grid .files tr, body.files-grid .files td { display: revert; }
body.files-grid #file-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
body.files-grid #file-list tr { display: flex; flex-direction: column; }
body.files-grid #file-list td { display: block; }
body.files-grid #file-list td.col-size, body.files-grid #file-list td.col-date {
  font-size: 0.76rem; color: var(--text-muted);
}
@media (min-width: 721px) {
  body.files-grid #file-list { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
}

@media (max-width: 720px) {
  .only-mobile { display: inline-flex; }
  .toolbar-actions {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 6px;
    align-items: center;
  }
  .toolbar-actions .file-search { grid-column: 1 / -1; }
  /* kompaktní řádek: název tučně, pod ním jedna šedá řádka */
  .files td.col-name .file-name-text { font-weight: 600; }
  .files td.col-size, .files td.col-date {
    display: inline-block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-right: 10px;
  }
  .files td.col-actions.collapsed > button:nth-of-type(n+3):not(.act-more) { display: none; }
  .files td.col-actions .act-more { margin-left: auto; }
}
body.files-grid #file-list td.col-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
body.files-grid #file-list td.col-actions .btn { flex: 0 1 auto; max-width: 100%; }
body.files-grid #file-list tr { overflow: hidden; }

@media (max-width: 720px) {
  .files td.col-size, .files td.col-date { width: auto; padding: 0; }
  .files td.col-name { padding-bottom: 2px; }
  .files tr { padding: 10px 12px; }
  .files td.col-actions { margin-top: 8px; }
}

/* ================= v39: Modern glass list-view (vyladěná šablona) ================= */
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Horní lišta – jemné sklo */
.topbar {
  backdrop-filter: blur(14px) saturate(140%);
  background: color-mix(in srgb, var(--bg-solid) 72%, transparent);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.03);
}
html[data-theme='light'] .topbar {
  background: rgb(255 255 255 / 0.78);
}

/* Záložky – klidné pilulky */
.tab { border-radius: var(--radius-pill); transition: background .16s, color .16s; }
.tab.active { background: var(--accent); color: #fff; box-shadow: 0 6px 16px -8px rgb(58 160 255 / 0.8); }

/* Vstupy – plněný, zaoblený vzhled s modrým zaměřením */
input, select, textarea { border-radius: 12px; transition: border-color .16s, box-shadow .16s, background .16s; }
.file-search, .toolbar input[type="search"], .toolbar select {
  background: var(--bg-hover);
  border-color: transparent;
}
.file-search:hover, .toolbar input[type="search"]:hover, .toolbar select:hover { border-color: transparent; background: rgb(255 255 255 / 0.07); }
.file-search:focus, .toolbar input[type="search"]:focus, .toolbar select:focus {
  background: var(--bg-hover);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}
html[data-theme='light'] .file-search,
html[data-theme='light'] .toolbar input[type="search"],
html[data-theme='light'] .toolbar select { background: rgb(15 23 42 / 0.05); }
html[data-theme='light'] .file-search:focus,
html[data-theme='light'] .toolbar input[type="search"]:focus,
html[data-theme='light'] .toolbar select:focus { background: #fff; box-shadow: 0 0 0 3px rgb(58 160 255 / 0.18); }

/* Tlačítka – měkčí zaoblení, jemný stín u hlavní akce */
.btn { border-radius: 12px; transition: background .16s, border-color .16s, transform .12s, box-shadow .16s; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); border-color: transparent; box-shadow: 0 8px 18px -10px rgb(58 160 255 / 0.65); }
.btn-primary:hover { background: var(--accent-strong); box-shadow: 0 10px 22px -10px rgb(58 160 255 / 0.8); }
.btn-primary::after { content: none; } /* pryč s lesklým přejezdem */

/* Karty – vzdušnější, měkčí stín */
.card { border-radius: 16px; box-shadow: 0 12px 32px -18px rgb(0 0 0 / 0.45); }
html[data-theme='light'] .card { box-shadow: 0 10px 28px -18px rgb(15 23 42 / 0.18); }

/* Tabulka souborů – vzdušné řádky bez tvrdých linek, jemný hover */
.files { border-collapse: separate; border-spacing: 0; }
.files th {
  font-size: 0.68rem; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
}
.files td { padding: 0.72rem 1.1rem; border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent); }
.files tbody tr:hover { background: var(--bg-hover); box-shadow: none; }
.files tbody tr:hover .file-icon { fill: var(--accent); }
.files td.col-size, .files td.col-date { font-variant-numeric: tabular-nums; color: var(--text-muted); font-size: 0.84rem; }

/* Ukazatel místa – modrá kapsle jako v návrhu */
.quota-bar { height: 8px; border-radius: var(--radius-pill); background: rgb(255 255 255 / 0.08); box-shadow: none; }
.quota-bar > *, .quota-fill {
  background: var(--accent) !important;
  border-radius: var(--radius-pill);
  box-shadow: 0 0 8px rgb(58 160 255 / 0.45);
}
html[data-theme='light'] .quota-bar { background: rgb(15 23 42 / 0.08); }

/* Spodní mobilní navigace – sklo */
.mobilenav, .bottom-nav, nav.bottom {
  backdrop-filter: blur(14px) saturate(140%);
}

/* Odznaky typů souborů – měkčí */
.type-badge { border-radius: 10px; }

/* Dialogy a sheety – větší zaoblení */
dialog.sheet, dialog { border-radius: 20px; }

/* Jemná výšková vrstva řádků v mřížce */
body.files-grid #file-list tr {
  border-radius: 16px;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
body.files-grid #file-list tr:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 14px 30px -16px rgb(0 0 0 / 0.55);
}

/* Přihlašování a pracovní plocha: klidnější provozní rozhraní. */
body:has(#login-view:not(.hidden)) {
  background-image: none;
}
#login-view { min-height: 100dvh; }
#login-view .login-card {
  max-width: 420px;
  padding: 32px;
  text-align: left;
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
  box-shadow: var(--shadow-card);
  backdrop-filter: none;
}
#login-view .login-card::before { background: var(--accent); }
#login-view .brand-logo { margin: 0 0 20px; }
#login-view .login-card h1 { margin-bottom: 28px; letter-spacing: 0; }
#login-view .login-card h1 .accent { background: none; color: var(--accent); -webkit-text-fill-color: currentColor; }
#login-view .login-card label { font-size: 0.8rem; letter-spacing: 0; text-transform: none; color: var(--text); }
#login-view .login-card input { min-height: 46px; border-radius: var(--radius-sm); background: var(--bg); }
#login-view .login-card .btn-primary { min-height: 46px; margin-top: 8px; }
#login-view .login-card .hint { opacity: 1; color: var(--text-muted); }
#login-view .login-card .error { overflow-wrap: anywhere; }
.topbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg-raised); }
html[data-theme='light'] .topbar { background: var(--bg-raised); }
.toolbar { backdrop-filter: none; background: var(--bg); }
#page-admin .admin-side { border-radius: var(--radius-sm); box-shadow: none; }
body.files-grid #file-list tr { border-radius: var(--radius-sm); }
@media (max-width: 640px) {
  #login-view { padding: 16px; align-items: center; }
  #login-view .login-card { padding: 24px; }
  #login-view .login-card h1 { font-size: 1.65rem; }
}
html[data-theme='light'] body.files-grid #file-list tr {
  background: #fff; border-color: rgb(15 23 42 / 0.07);
  box-shadow: 0 4px 14px -8px rgb(15 23 42 / 0.12);
}
html[data-theme='light'] body.files-grid #file-list tr:hover {
  box-shadow: 0 12px 26px -14px rgb(15 23 42 / 0.22);
}

/* ================= v40: přehlednější správa a výběr disku ================= */
#page-admin .admin-shell { grid-template-columns: 260px minmax(0, 1fr); gap: 22px; }
#page-admin .admin-side {
  padding: 14px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg-card) 90%, transparent);
  box-shadow: 0 18px 44px -34px rgb(0 0 0 / .75);
}
#page-admin .admin-group { margin-top: 18px; letter-spacing: .1em; }
#page-admin .admin-tab {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border-left: 0;
  border-radius: 10px;
  line-height: 1.25;
}
#page-admin .admin-tab.active { border-left: 0; padding-left: 10px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent); }
.admin-tab-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--bg-hover);
  color: var(--text-muted);
  font-size: .86rem;
  font-weight: 700;
}
.admin-tab.active .admin-tab-icon { background: var(--accent); color: var(--accent-contrast); }
.admin-content-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 2px 2px 16px;
  border-bottom: 1px solid var(--border);
}
.admin-content-head h1 { margin: 3px 0 0; font-size: clamp(1.35rem, 2vw, 1.75rem); letter-spacing: 0; }
.admin-content-kicker, .section-eyebrow { color: var(--accent); font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.admin-live { display: inline-flex; align-items: center; gap: 7px; color: var(--text-muted); font-size: .8rem; font-weight: 600; white-space: nowrap; }
.admin-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 14%, transparent); }
#page-admin .card { border-color: color-mix(in srgb, var(--border) 78%, transparent); }
#page-admin .card-head { min-height: 36px; }
#page-admin .quick-actions { padding: 0 2px; }

.storage-panel .card-head > div { min-width: 0; }
.storage-panel .section-eyebrow { display: block; margin-bottom: 4px; }
.storage-choice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 7px 16px;
  padding: 18px;
  margin: 16px 0 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-hover);
}
.storage-choice label { font-size: .8rem; font-weight: 700; color: var(--text-muted); }
.storage-choice select, .storage-choice input { width: 100%; min-height: 46px; margin: 0; }
.storage-volume-info { grid-column: 1; margin: 0; color: var(--text-muted); font-size: .78rem; line-height: 1.35; }
.storage-choice label[for="storage-root"] { grid-column: 2; grid-row: 1; }
.storage-choice #storage-root { grid-column: 2; grid-row: 2; }
.storage-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.storage-users-title { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); }

@media (max-width: 860px) {
  .admin-content-head { display: none; }
  #page-admin .admin-shell { display: block; }
  #page-admin .admin-side { border-radius: 0 16px 16px 0; }
}
@media (max-width: 640px) {
  #page-admin .admin-bar { position: sticky; top: 0; z-index: 18; padding: 8px 0; background: var(--bg); }
  #page-admin .card { padding: 16px; border-radius: 14px; }
  #page-admin .card-head { align-items: flex-start; }
  .storage-choice { grid-template-columns: 1fr; padding: 14px; }
  .storage-choice label[for="storage-root"], .storage-choice #storage-root, .storage-volume-info { grid-column: 1; grid-row: auto; }
  .storage-actions { display: grid; grid-template-columns: 1fr; }
  .storage-actions .btn { width: 100%; }
  #storage-now { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #storage-now .stat:first-child { grid-column: 1 / -1; }
}

/* Grafy a mobilní soubory: stejné mezery a čitelné prázdné stavy ve všech motivech. */
.quota-ring { --ring-color: var(--accent); background: conic-gradient(var(--ring-color) var(--pct, 0%), var(--border-strong) 0); }
.quota-ring::after { background: var(--bg-solid); }
.quota-ring-num { color: var(--text); }
.quota-ring.warn { --ring-color: var(--warn); }
.quota-ring.danger { --ring-color: var(--danger); }
.chart-wrap { min-width: 0; }
.chart-empty { min-height: 110px; display: grid; place-items: center; margin: 0; text-align: center; color: var(--text-muted); font-size: .86rem; }
#page-files .files td.col-name > .muted { overflow-wrap: anywhere; font-size: .79rem; }
/* Přepínání sekcí nemá zachovávat polohu starého obsahu. */
#app-view { overflow-anchor: none; }
/* Fronta zůstává ovladatelná i při dlouhých názvech a malém displeji. */
.uq-head > strong { min-width: 0; }
#uq-summary { min-width: 0; overflow-wrap: anywhere; }
.uq-row { flex-wrap: wrap; }
.uq-state { max-width: 100%; overflow-wrap: anywhere; }
.uq-btns { margin-left: auto; }
.uq-head .btn:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 720px) {
  #upload-queue { margin: 8px 14px 14px; max-height: min(45vh, 340px); overflow-y: auto; }
  .uq-head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; }
  .uq-head > strong { grid-column: 1 / -1; }
  #uq-summary { grid-column: 1 / -1; }
  .uq-spacer { display: none; }
  .uq-head .btn { margin: 0; min-height: 44px; }
  #drop-zone { margin: 0 14px 14px; border: 0; background: transparent; box-shadow: none; overflow: visible; }
  #drop-zone.dragging { outline: 2px solid var(--accent); outline-offset: 2px; }
  #drop-zone .files tr { background: var(--bg-card); box-shadow: none; }
  #drop-zone .files td { padding: 2px 0; border: 0; }
  #drop-zone .files td.col-actions { padding-top: 6px; }
  #drop-zone .files td.col-pick { right: var(--sp-3); }
  #page-files .files td.col-name > .muted { line-height: 1.4; }
  #page-files .files td.col-size, #page-files .files td.col-date { border: 0; }
  #page-admin .chart-wrap { min-height: 0; }
  #page-admin .chart-wrap svg { display: block; width: 100%; }
  .usage-panel { padding: 16px 0 0; margin: 20px 0 0; border: 0; background: transparent; }
  #page-profile .usage-panel .card-head { flex-direction: row; align-items: center; flex-wrap: wrap; justify-content: space-between; }
  #page-profile .usage-panel .card-head h3 { margin: 0; }
}

/* v51 — Almont Cloud: klidnější pracovní plocha, přirozené ovládání. */
:root {
  --bg: #111820;
  --bg-raised: #1d2934;
  --bg-card: rgb(29 41 52 / 0.76);
  --bg-solid: #1d2934;
  --bg-hover: rgb(233 242 244 / 0.06);
  --border: rgb(233 242 244 / 0.11);
  --border-strong: rgb(233 242 244 / 0.22);
  --text: #e9f2f4;
  --text-muted: #a9bcc5;
  --accent: #4ca9d9;
  --accent-amber: #4ca9d9;
  --accent-strong: #398cbb;
  --accent-contrast: #111820;
  --accent-soft: rgb(76 169 217 / 0.13);
  --gradient-accent: linear-gradient(180deg, #4ca9d9, #398cbb);
  --radius: 8px;
  --radius-sm: 8px;
  --r-sm: 8px;
  --r-md: 8px;
  --r-lg: 8px;
  --shadow-card: 0 16px 36px -28px rgb(0 0 0 / 0.7);
  --shadow-glow: 0 8px 20px -12px rgb(76 169 217 / 0.5);
}
html[data-theme='light'] {
  --bg: #f4f8fa;
  --bg-raised: #ffffff;
  --bg-card: rgb(255 255 255 / 0.88);
  --bg-solid: #ffffff;
  --text: #152b35;
  --text-muted: #536c78;
  --accent: #216e96;
  --accent-strong: #185a7b;
  --accent-contrast: #ffffff;
  --accent-soft: rgb(33 110 150 / 0.12);
}
body { font-family: Figtree, system-ui, sans-serif; background-image: none; }
h1, h2, h3, h4, .brand, .tile-value { font-family: Outfit, Figtree, system-ui, sans-serif; letter-spacing: 0; }
.card, .drop-zone, .admin-side, .player { border-color: var(--border); background: var(--bg-card); backdrop-filter: blur(12px); box-shadow: var(--shadow-card); }
.page .card:hover { transform: none; border-color: var(--border-strong); box-shadow: var(--shadow-card); }
.card, .drop-zone, .tile, .usage-panel, .admin-side, dialog, dialog.sheet, body.files-grid #file-list tr { border-radius: 8px; }
.login-card::after, .topbar::after, .page h2::before { content: none; }
.page h2 { gap: 0; }
.btn {
  justify-content: center;
  border-radius: 8px;
  min-height: 40px;
  padding: 0.55rem 0.9rem;
  font-family: Figtree, system-ui, sans-serif;
  font-size: 0.87rem;
  font-weight: 650;
  line-height: 1.25;
  background: var(--bg-hover);
  border-color: var(--border);
  color: var(--text);
  box-shadow: none;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.btn:hover { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.btn:active { transform: scale(.985); }
.btn-small { min-height: 36px; margin-left: 0; padding: 0.42rem 0.75rem; font-size: .82rem; }
.btn-primary, .btn.btn-view.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
  box-shadow: 0 8px 20px -14px var(--accent);
}
.btn-primary:hover, .btn.btn-view.active:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-contrast); box-shadow: 0 10px 24px -12px var(--accent); }
.btn-danger:hover { color: var(--danger); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn:focus-visible, .admin-tab:focus-visible, .mobilenav-btn:focus-visible, .userchip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type="text"], input[type="password"], input[type="email"], input[type="number"], input[type="search"], select, textarea, .file-select, .file-search {
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  color: var(--text);
  min-height: 42px;
}
input:focus, select:focus, textarea:focus, .file-search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: .75; }
.tabs { background: var(--bg); }
.tab, .tab.active { border-radius: 6px; }
.tab.active { background: var(--accent-soft); color: var(--accent); box-shadow: none; }
#login-view .login-card { border-radius: 8px; padding: 36px; background: var(--bg-card); backdrop-filter: blur(12px); box-shadow: var(--shadow-card); }
#login-view .login-card::before { height: 1px; background: var(--border-strong); }
#login-view .login-card h1 { font-size: 1.85rem; font-weight: 700; margin-bottom: 30px; }
#login-view .login-card input { background: var(--bg); }
#login-view .login-card .btn-primary { color: var(--accent-contrast); }
.files th { background: var(--bg-raised); letter-spacing: 0; }
.files tbody tr:hover { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
.toolbar { background: var(--bg); border-color: var(--border); }
.file-search, .toolbar input[type="search"], .toolbar select { background: var(--bg-raised); border-color: var(--border); }
.topbar { background: var(--bg-raised); box-shadow: none; border-color: var(--border); }
.topnav .navbtn.active { background: var(--accent-soft); color: var(--accent); box-shadow: none; }
.topnav .navbtn:hover { background: var(--bg-hover); }
.userchip { border-radius: 8px; background: var(--bg-hover); cursor: pointer; color: var(--text); }
.userchip:hover { background: var(--accent-soft); border-color: var(--accent); }
#page-admin .admin-side { background: var(--bg-card); backdrop-filter: blur(12px); border-radius: 8px; box-shadow: var(--shadow-card); }
#page-admin .admin-tab { border-radius: 8px; opacity: 1; color: var(--text-muted); }
#page-admin .admin-tab:hover { background: var(--bg-hover); color: var(--text); }
#page-admin .admin-tab.active { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent); }
html[data-theme='light'] #page-admin .admin-tab.active { color: var(--accent); }
.admin-tab.active .admin-tab-icon { background: var(--accent-soft); color: var(--accent); }
.tile:hover { border-color: var(--accent); }

@media (min-width: 861px) {
  #app-view { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100dvh; align-items: start; }
  #app-view.hidden { display: none; }
  #app-view > .topbar {
    grid-column: 1;
    grid-row: 1;
    position: sticky;
    top: 0;
    height: 100dvh;
    padding: 28px 16px 18px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 32px;
    border-right: 1px solid var(--border);
    border-bottom: 0;
  }
  #app-view > section { grid-column: 2; grid-row: 1; min-width: 0; }
  .topbar .brand { padding: 0 10px; font-size: 1.13rem; }
  .topbar .topnav { display: flex; width: 100%; flex-direction: column; align-items: stretch; justify-self: auto; background: none; border: 0; padding: 0; gap: 5px; }
  .topbar .topnav .navbtn { justify-content: flex-start; min-height: 44px; padding: 10px 14px; border-radius: 8px; font-weight: 600; }
  .topbar .topbar-actions { margin-top: auto; width: 100%; flex-wrap: wrap; justify-content: flex-start; padding: 12px 0 0; border-top: 1px solid var(--border); }
  .topbar .userchip { order: -1; width: 100%; max-width: none; }
  #page-admin.page { max-width: none; padding: 26px 24px 40px; }
  #page-admin .admin-shell { grid-template-columns: 224px minmax(0, 1fr); gap: 22px; }
  #page-profile.page, #page-trash.page { max-width: 1100px; width: 100%; padding: 28px 26px 40px; }
  #page-files .toolbar { top: 0; padding: 16px 24px; }
  #page-files .drop-zone { margin: 20px 24px; }
}
@media (max-width: 860px) {
  .topbar { backdrop-filter: blur(12px); }
  .mobilenav { background: var(--bg-raised); }
  .mobilenav-btn.active { background: var(--accent-soft); color: var(--accent); }
  #page-admin .admin-side { background: var(--bg-raised); backdrop-filter: none; }
}
@media (max-width: 640px) {
  #login-view .login-card { padding: 24px; }
  .btn-small, .toolbar-actions .btn { min-height: 44px; }
  #page-files .toolbar { padding: 10px 14px; }
  .toolbar-actions > * { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .card, .tile { transition: none; }
}

/* Kořenové disky mají čtyři pole, zatímco v souborové tabulce je navíc výběr. */
@media (min-width: 721px) {
  body:not(.files-grid) #page-files:has(#file-list tr > td:first-child.col-name) .files thead { display: none; }
  body:not(.files-grid) #page-files:has(#file-list tr > td:first-child.col-name) .files,
  body:not(.files-grid) #page-files:has(#file-list tr > td:first-child.col-name) .files tbody { display: block; width: 100%; }
  body:not(.files-grid) #file-list tr:not(:has(.col-pick)) { display: grid; width: 100%; grid-template-columns: minmax(0, 1fr) 90px 145px 110px; align-items: center; }
  body:not(.files-grid) #file-list tr:not(:has(.col-pick)) td { width: auto; min-width: 0; }
  body:not(.files-grid) #file-list tr:not(:has(.col-pick)) .col-name > .muted { overflow-wrap: anywhere; }
  body:not(.files-grid) #file-list tr:not(:has(.col-pick)) .col-actions { white-space: normal; }
}
@media (min-width: 861px) {
  #app-view > .page { width: 100%; justify-self: stretch; }
  #page-admin.page { margin: 0; }
}
