:root {
  --bg: #0d1424;
  --bg-elev: #131d31;
  --bg-elev2: #1b2740;
  --border: #27334c;
  --btn-hover: #223150;
  --text: #e8eef7;
  --text-dim: #93a6be;
  --accent: #3b82f6;
  --accent-hover: #4c94ff;
  --accent2: #8b5cf6;
  --danger: #e5534b;
  --danger-hover: #f06a62;
  --ok: #3fb950;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --gap: 18px;
  --shadow: 0 10px 34px rgba(0,0,0,.4);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow-x: hidden; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(1100px 480px at 50% -260px, rgba(59,130,246,.10), transparent 60%),
    radial-gradient(900px 420px at 100% 0%, rgba(139,92,246,.07), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Buttons ---- */
button, .btn {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-elev2);
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius);
  transition: background .14s, border-color .14s, transform .08s, box-shadow .2s;
}
button:hover, .btn:hover { background: var(--btn-hover); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); border: none; color: #fff; box-shadow: 0 6px 16px rgba(59,130,246,.28); }
.btn-primary:hover { background: linear-gradient(135deg, #4c94ff, #9b6cff); box-shadow: 0 9px 22px rgba(59,130,246,.4); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--bg-elev2); }

input, select {
  font: inherit;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 11px;
  border-radius: var(--radius);
  width: 100%;
  transition: border-color .14s, box-shadow .14s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,.16); }
label { display: block; margin-bottom: 4px; color: var(--text-dim); font-size: 13px; }
.field { margin-bottom: 14px; }

/* ---- Layout ---- */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 0 20px; height: 58px;
  background: var(--bg-elev);
  background: color-mix(in srgb, var(--bg-elev) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.topbar .brand { font-weight: 800; font-size: 17px; letter-spacing: .2px; }
.topbar .brand span { background: linear-gradient(135deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.topbar .spacer { flex: 1; }
.topbar .user { color: var(--text-dim); }
.topbar .user b { color: var(--text); }
.nav-link { padding: 7px 12px; border-radius: var(--radius); color: var(--text-dim); font-weight: 500; transition: background .14s, color .14s; }
.nav-link:hover { background: var(--bg-elev2); text-decoration: none; color: var(--text); }
.nav-link.active { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent2)); box-shadow: 0 4px 12px rgba(59,130,246,.3); }

.container { max-width: 1160px; margin: 0 auto; padding: 22px; }

/* ---- Cards ---- */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: var(--gap);
  box-shadow: 0 8px 26px rgba(0,0,0,.2);
}
.card h2 { margin: 0 0 14px; font-size: 16px; }

/* ---- Toolbar ---- */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }

/* ---- Breadcrumb ---- */
.breadcrumb { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 14px; }
.breadcrumb a { color: var(--text-dim); padding: 3px 6px; border-radius: var(--radius-sm); }
.breadcrumb a:hover { background: var(--bg-elev2); text-decoration: none; color: var(--text); }
.breadcrumb .sep { color: var(--text-dim); }

/* ---- File table ---- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--text-dim); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
tbody tr:hover { background: var(--bg-elev2); }
td.name { display: flex; align-items: center; gap: 9px; }
td.size, td.date { color: var(--text-dim); white-space: nowrap; }
td.actions { text-align: right; white-space: nowrap; }
.icon { width: 18px; text-align: center; }
.row-link { cursor: pointer; color: var(--text); }
.row-link:hover { color: var(--accent); }
.col-check { width: 34px; }

/* ---- Dropzone ---- */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 26px; text-align: center; color: var(--text-dim); cursor: pointer;
  transition: border-color .15s, background .15s, color .15s; margin-bottom: 14px;
}
.dropzone::before { content: "⬆"; display: block; font-size: 26px; line-height: 1; margin-bottom: 10px; color: var(--accent); }
.dropzone:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: color-mix(in srgb, var(--accent) 6%, transparent); color: var(--text); }
.dropzone.drag { border-color: var(--accent); background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, transparent), color-mix(in srgb, var(--accent2) 12%, transparent)); color: var(--text); }

/* ---- Badges / chips ---- */
.badge { display: inline-block; padding: 2px 8px; border-radius: var(--radius-pill); font-size: 12px; border: 1px solid var(--border); color: var(--text-dim); }
.badge.admin { color: #ffd479; border-color: #6b5624; background: rgba(255,212,121,.08); }
.badge.ok { color: var(--ok); border-color: #23532b; }
.badge.off { color: var(--danger); border-color: #5a2925; }

/* ---- Login ---- */
.login-wrap { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 360px; }
.login-card .brand { text-align: center; font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.login-card .brand span { color: var(--accent); }
.login-card .sub { text-align: center; color: var(--text-dim); margin-bottom: 22px; font-size: 13px; }

/* ---- Modal ---- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(6,10,20,.5); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.modal { background: color-mix(in srgb, var(--bg-elev) 92%, transparent); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); width: 100%; max-width: 460px; padding: 20px; backdrop-filter: blur(12px) saturate(1.1); }
.modal h3 { margin: 0 0 16px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.hidden { display: none !important; }

/* ---- Permission checkboxes ---- */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 6px 14px; margin: 8px 0; }
.perm-grid label { display: flex; align-items: center; gap: 7px; color: var(--text); margin: 0; }
.perm-grid input { width: auto; }
.checkbox-inline { display: flex; align-items: center; gap: 8px; }
.checkbox-inline input { width: auto; }

/* ---- Progress ---- */
.progress { height: 6px; background: var(--bg-elev2); border-radius: 4px; overflow: hidden; margin-top: 10px; }
.progress > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .15s; }

/* ---- Nahrávací panel s procenty ---- */
.upbox { margin-bottom: 14px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; box-shadow: 0 8px 26px rgba(0,0,0,.2); }
.upbox-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; }
.upbox-head #upName { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upbox-head #upPct { color: var(--accent); font-weight: 800; font-variant-numeric: tabular-nums; flex: none; }
.upbox .progress { margin-top: 8px; height: 10px; }

/* ---- Nahrávací popup (blokující) ---- */
.upload-modal .modal { max-width: 440px; }
.up-file { font-weight: 600; margin: 2px 0 8px; word-break: break-all; }
.up-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; color: var(--text-dim); margin-bottom: 8px; }
.up-meta #upPct { color: var(--accent); font-weight: 800; font-variant-numeric: tabular-nums; }
.upload-modal .progress { height: 12px; }
.up-sub { font-size: 12px; margin-top: 8px; }
.upload-modal .actions { justify-content: center; margin-top: 18px; }
.upload-modal .actions .btn-danger { min-width: 180px; }

/* ---- Toast ---- */
#toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--bg-elev2); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  padding: 11px 15px; border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(0,0,0,.28); max-width: 340px; }
.toast.error { border-left-color: var(--danger); }
.toast.ok { border-left-color: var(--ok); }

.muted { color: var(--text-dim); }
.empty { text-align: center; color: var(--text-dim); padding: 40px 20px; }
.empty .empty-icon { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: var(--radius-lg); display: grid; place-items: center; font-size: 26px; background: linear-gradient(135deg, rgba(59,130,246,.18), rgba(139,92,246,.18)); border: 1px solid var(--border); }
.empty .empty-title { font-size: 16px; color: var(--text); margin-bottom: 4px; font-weight: 600; }
.empty .empty-sub { font-size: 13px; color: var(--text-dim); margin-bottom: 14px; }
.right { text-align: right; }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }

/* ---- Dashboard / statistiky ---- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.stat-card { position: relative; overflow: hidden; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 18px 16px; box-shadow: 0 8px 26px rgba(0,0,0,.18); }
.stat-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(180deg, var(--accent), var(--accent2)); }
.stat-card .stat-label { color: var(--text-dim); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.stat-card .stat-value { font-size: 28px; font-weight: 800; margin: 6px 0 2px; letter-spacing: -.5px; }
.stat-card .stat-sub { color: var(--text-dim); font-size: 12px; }
.stat-card .stat-value.accent { background: linear-gradient(135deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr; gap: var(--gap); }
@media (max-width: 820px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.chart { width: 100%; height: auto; }
.chart-axis { fill: var(--text-dim); font-size: 10px; }
.chart-val { fill: var(--text); font-size: 10px; font-weight: 600; }

.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut { width: 168px; height: 168px; }
.donut-num { fill: var(--text); font-size: 30px; font-weight: 700; }
.donut-lbl { fill: var(--text-dim); font-size: 11px; }
.legend-item { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; color: var(--text-dim); }
.legend-item b { color: var(--text); }
.legend-dot { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

.hbar-row { display: grid; grid-template-columns: 140px 1fr 42px; align-items: center; gap: 10px; margin-bottom: 9px; }
.hbar-label { color: var(--text-dim); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { background: var(--bg-elev2); border-radius: 4px; height: 10px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 4px; transition: width .3s; }
.hbar-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }

/* ---- Info řádky (nastavení) ---- */
.info-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.info-row:last-child { border-bottom: none; }
.info-row .k { color: var(--text-dim); }
.info-row .v { font-family: ui-monospace, Consolas, monospace; text-align: right; word-break: break-all; }
.callout { background: linear-gradient(135deg, rgba(59,130,246,.06), rgba(139,92,246,.06)); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 12px 14px; margin: 10px 0; color: var(--text-dim); font-size: 13px; }

/* ---- Zobrazit / skrýt heslo ---- */
.pw-wrap { position: relative; }
.pw-wrap > input { width: 100%; padding-right: 42px; }
.pw-toggle { position: absolute; right: 4px; top: 0; bottom: 0; width: 34px; display: flex;
  align-items: center; justify-content: center; background: transparent; border: none;
  color: var(--text-dim); cursor: pointer; padding: 0; }
.pw-toggle:hover { background: transparent; color: var(--text); }

/* ---- Tabulky: vodorovné rolování uvnitř kontejneru ---- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll table { min-width: 520px; }

/* ---- Horní menu / hamburger ---- */
.topbar-menu { display: flex; align-items: center; gap: 16px; flex: 1; }
.topbar-toggle { display: none; margin-left: auto; width: 40px; height: 38px;
  flex-direction: column; justify-content: center; align-items: center; gap: 4px;
  background: transparent; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; padding: 0; }
.topbar-toggle span { display: block; width: 20px; height: 2px; background: var(--text); border-radius: 2px; }

/* ---- Kolaps horního menu do hamburgeru (dřív, ať se řádek nikdy nepřetéká) ---- */
@media (max-width: 1024px) {
  .topbar { gap: 10px; padding: 0 14px; }
  .topbar-toggle { display: flex; }
  .topbar-menu {
    display: none; position: absolute; top: 100%; left: 0; right: 0; flex: none;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: var(--bg-elev); border-bottom: 1px solid var(--border);
    padding: 10px 14px; box-shadow: var(--shadow); z-index: 30;
  }
  .topbar.open .topbar-menu { display: flex; }
  .topbar-menu .spacer { display: none; }
  .topbar-menu .nav-link { padding: 11px 12px; }
  .topbar-menu .user { padding: 8px 2px; border-top: 1px solid var(--border); margin-top: 4px; }
  .topbar-menu button { width: 100%; }
}

/* ---- Mobilní úpravy ---- */
@media (max-width: 760px) {
  .container { padding: 14px; }
  .card { padding: 14px; }
  .card h2 { font-size: 15px; }
  .toolbar { gap: 6px; }
  .toolbar .spacer { flex-basis: 100%; height: 0; }
  .stat-card .stat-value { font-size: 22px; }
  th, td { padding: 8px; }
  .hbar-row { grid-template-columns: 96px 1fr 34px; }
  .modal { max-width: 100%; }
  .breadcrumb { font-size: 13px; }
}

/* ---- Správce souborů: strom + panely + commander ---- */
.fm-container { max-width: 1320px; }
.fm { display: grid; grid-template-columns: 250px 1fr; gap: var(--gap); align-items: start; }
.fm-tree { padding: 12px; position: sticky; top: 14px; max-height: calc(100vh - 34px); overflow: auto; }
.fm-tree-title { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-dim); margin-bottom: 8px; }
.fm-main { padding: 14px; min-width: 0; }

.tree-row { display: flex; align-items: center; gap: 4px; padding: 3px 4px; border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap; }
.tree-row:hover { background: var(--bg-elev2); }
.tree-row.sel { background: rgba(47,129,247,.16); }
.tree-caret { width: 14px; text-align: center; color: var(--text-dim); font-size: 10px; flex: none; }
.tree-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.tree-children { margin-left: 12px; border-left: 1px solid var(--border); padding-left: 4px; }

.fm-toolbar { align-items: center; }
.fm-search { flex: 0 1 220px; min-width: 120px; }
.fm-search input { padding: 6px 10px; }
.fm-tree-btn { display: none; font-size: 16px; }

.fm-panes { display: grid; grid-template-columns: 1fr; gap: var(--gap); }
.fm-panes.dual { grid-template-columns: 1fr 1fr; }
.fm-panes.dual .pane .table-scroll table { min-width: 0; }
.pane { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg); min-width: 0; }
.pane-active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.pane-head { padding: 8px 10px; border-bottom: 1px solid var(--border); background: var(--bg-elev); }
.pane .pane-bc { font-size: 13px; }
.pane table { font-size: 13px; }
.pane .pane-empty { padding: 30px 18px; }

.cmd-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; padding: 8px 10px; background: var(--bg-elev2); border: 1px solid var(--border); border-radius: var(--radius); }

.modal-backdrop.modal-wide .modal { max-width: 860px; width: 96vw; }
.editor { width: 100%; height: 60vh; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 13px; line-height: 1.5; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; box-sizing: border-box; }

@media (max-width: 900px) {
  .fm { grid-template-columns: 1fr; }
  .fm-tree { position: fixed; left: 0; top: 56px; bottom: 0; width: 260px; z-index: 40; border-radius: 0; display: none; box-shadow: var(--shadow); }
  .fm-tree.open { display: block; }
  .fm-tree-btn { display: inline-flex; }
  .fm-panes.dual { grid-template-columns: 1fr; }
}

/* ---- Náhledy a prohlížeč ---- */
.icon { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; }
.thumb { width: 30px; height: 30px; object-fit: cover; border-radius: 4px; background: var(--bg-elev2); }
.viewer { display: flex; align-items: center; justify-content: center; margin: 6px 0 14px; }
.viewer-media { max-width: 100%; max-height: 70vh; border-radius: var(--radius); }
.viewer-frame { width: 100%; height: 70vh; border: none; border-radius: var(--radius); background: #fff; }

/* ---- Světlý motiv ---- */
:root[data-theme="light"] {
  --bg: #eef1f6;
  --bg-elev: #ffffff;
  --bg-elev2: #e9edf3;
  --border: #d5dce5;
  --btn-hover: #e3e8ef;
  --text: #17202f;
  --text-dim: #5a6b7d;
  --accent: #2f6fe0;
  --accent-hover: #245bc0;
  --accent2: #7c5cf0;
  --shadow: 0 10px 30px rgba(20,40,70,.12);
}
:root[data-theme="light"] .card,
:root[data-theme="light"] .stat-card { box-shadow: 0 6px 20px rgba(20,40,70,.08); }
:root[data-theme="light"] .badge.admin { color: #7a5b00; border-color: #d8b25a; background: rgba(212,160,40,.14); }
:root[data-theme="light"] .badge.ok { color: #1f7a33; }
:root[data-theme="light"] .badge.off { color: #c0392f; }
:root[data-theme="light"] .thumb { background: #e5e9ee; }
.theme-toggle { font-size: 15px; }

/* ---- Přihlašovací / landing stránka (premium) ---- */
.auth-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden;
  background: linear-gradient(140deg, #070b16 0%, #0a1122 45%, #0e1630 100%); }
.auth-bg .orb { position: absolute; border-radius: 50%; filter: blur(72px); opacity: .5; will-change: transform; }
.auth-bg .o1 { width: 46vw; height: 46vw; left: -8vw; top: -10vw;
  background: radial-gradient(circle at 30% 30%, #3b82f6, transparent 70%); animation: float1 18s ease-in-out infinite; }
.auth-bg .o2 { width: 40vw; height: 40vw; right: -6vw; top: 8vh;
  background: radial-gradient(circle at 50% 50%, #8b5cf6, transparent 70%); animation: float2 23s ease-in-out infinite; }
.auth-bg .o3 { width: 34vw; height: 34vw; left: 32vw; bottom: -16vw;
  background: radial-gradient(circle at 50% 50%, #06b6d4, transparent 70%); animation: float3 27s ease-in-out infinite; }
@keyframes float1 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(6vw,4vh) scale(1.12)} }
@keyframes float2 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(-5vw,6vh) scale(1.16)} }
@keyframes float3 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(4vw,-5vh) scale(1.06)} }
.auth-bg .grid-overlay { position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 46px 46px; -webkit-mask-image: radial-gradient(ellipse at center, #000 32%, transparent 80%);
  mask-image: radial-gradient(ellipse at center, #000 32%, transparent 80%); }

.auth { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr .85fr; min-height: 100vh; color: #fff; }
.auth-hero { padding: 6vh 5vw; display: flex; flex-direction: column; justify-content: center; }
.auth-hero-inner { max-width: 540px; }
.brand-row { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 44px; height: 44px; filter: drop-shadow(0 6px 20px rgba(90,140,255,.5)); }
.auth-hero .logo, .logo-sm { font-size: 26px; font-weight: 800; letter-spacing: .3px; }
.auth-hero .logo span, .logo-sm span { color: #7cb0ff; }
.auth-hero h1 { font-size: clamp(30px, 4vw, 50px); line-height: 1.06; margin: 26px 0 16px; font-weight: 800; letter-spacing: -.5px; }
.auth-hero h1 .grad { background: linear-gradient(90deg,#6ea8ff,#a78bfa 55%,#22d3ee); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-hero .lead { color: #aebdd2; font-size: 16px; max-width: 46ch; margin: 0 0 30px; line-height: 1.6; }
.auth-features { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 540px; }
.feature-card { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border-radius: 14px;
  background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(6px);
  transition: transform .2s, border-color .2s, background .2s; }
.feature-card:hover { transform: translateY(-3px); background: rgba(255,255,255,.07); border-color: rgba(124,176,255,.35); }
.feature-card .fi { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 19px; flex: none;
  background: linear-gradient(135deg, rgba(94,162,255,.22), rgba(139,92,246,.22)); border: 1px solid rgba(255,255,255,.1); }
.feature-card b { display: block; font-size: 13.5px; }
.feature-card small { color: #93a4b3; font-size: 12px; line-height: 1.4; }
.badges { margin-top: 28px; display: flex; gap: 10px; flex-wrap: wrap; }
.badges .chip { font-size: 12px; padding: 6px 13px; border-radius: var(--radius-pill); background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12); color: #cfe0f5; backdrop-filter: blur(6px); }

.auth-form { display: flex; align-items: center; justify-content: center; padding: 6vh 4vw; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card.glass { background: rgba(16,22,38,.62); border: 1px solid rgba(255,255,255,.1); border-radius: 20px;
  padding: 34px 32px; backdrop-filter: blur(18px) saturate(1.2); box-shadow: 0 24px 70px rgba(0,0,0,.5); }
.auth-card .logo-sm { display: none; margin-bottom: 18px; color: #fff; }
.auth-card h2 { font-size: 24px; margin: 0 0 4px; color: #fff; }
.auth-card .muted { color: #9db0c7; }
.auth-card label { color: #9db0c7; }
.auth-card input { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.13); color: #fff; padding: 12px; border-radius: 11px; }
.auth-card input::placeholder { color: #6b7d94; }
.auth-card input:focus { border-color: #5aa2ff; background: rgba(255,255,255,.08); box-shadow: 0 0 0 3px rgba(90,162,255,.18); outline: none; }
.auth-card .pw-toggle { color: #9db0c7; }
.btn-lg { padding: 12px 16px; font-size: 15px; font-weight: 600; color: #fff; border: none; border-radius: 12px;
  background: linear-gradient(135deg,#3b82f6,#6d5cf6); box-shadow: 0 10px 26px rgba(59,130,246,.4); transition: transform .12s, box-shadow .2s; }
.btn-lg:hover { transform: translateY(-1px); box-shadow: 0 14px 32px rgba(59,130,246,.5); background: linear-gradient(135deg,#4c8dff,#7d6cff); }
.auth-foot { text-align: center; margin-top: 20px; font-size: 12px; color: #8b9db4; }

.reveal { opacity: 0; transform: translateY(14px); animation: reveal .7s cubic-bezier(.2,.7,.2,1) forwards; }
.reveal.d1{animation-delay:.08s}.reveal.d2{animation-delay:.16s}.reveal.d3{animation-delay:.24s}
.reveal.d4{animation-delay:.32s}.reveal.d5{animation-delay:.4s}.reveal.d6{animation-delay:.48s}
@keyframes reveal { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .reveal { animation: none; opacity: 1; transform: none; } .orb { animation: none !important; } }

@media (max-width: 940px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { padding: 6vh 7vw 2vh; }
  .auth-features { grid-template-columns: 1fr; max-width: 440px; }
  .auth-form { padding: 3vh 6vw 8vh; }
}
@media (max-width: 560px) {
  .auth-features, .badges { display: none; }
  .auth-hero { padding: 7vh 6vw 0; }
  .auth-card.glass { padding: 26px 22px; }
}

/* ===== Veřejná landing stránka ===== */
.ld-body { color: #e8eef7; }
.ld-nav { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 26px;
  padding: 0 clamp(16px, 4vw, 44px); height: 64px;
  background: rgba(10, 16, 30, .6); backdrop-filter: blur(14px) saturate(1.15); border-bottom: 1px solid rgba(255,255,255,.07); }
.ld-logo { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 800; color: #fff; }
.ld-logo:hover { text-decoration: none; }
.ld-logo b { background: linear-gradient(135deg, #6ea8ff, #a78bfa); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ld-links { display: flex; gap: 20px; margin-left: 8px; }
.ld-links a { color: #aebdd2; font-weight: 500; font-size: 14px; }
.ld-links a:hover { color: #fff; text-decoration: none; }
.ld-nav-cta { margin-left: auto; padding: 9px 18px; font-size: 14px; border-radius: 10px; }
.ld { position: relative; z-index: 1; max-width: 1080px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); }

.ld-hero { text-align: center; padding: clamp(56px, 10vh, 110px) 0 26px; }
.ld-hero-badge { display: inline-block; font-size: 13px; padding: 7px 16px; border-radius: 999px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); color: #cfe0f5; margin-bottom: 22px; }
.ld-hero h1 { font-size: clamp(30px, 5vw, 54px); line-height: 1.08; margin: 0 0 18px; font-weight: 800; letter-spacing: -.6px; color: #fff; }
.ld-hero .grad, .ld-final .grad { background: linear-gradient(90deg,#6ea8ff,#a78bfa 55%,#22d3ee); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ld-lead { color: #aebdd2; font-size: clamp(15px, 1.6vw, 17px); max-width: 62ch; margin: 0 auto 30px; line-height: 1.65; }
.ld-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.ld-cta .btn-lg { padding: 13px 30px; }
.btn-ghost-lg { display: inline-block; padding: 13px 24px; font-size: 15px; font-weight: 600; color: #cfe0f5;
  border: 1px solid rgba(255,255,255,.16); border-radius: 12px; background: rgba(255,255,255,.04); transition: background .15s, border-color .15s; }
.btn-ghost-lg:hover { background: rgba(255,255,255,.08); border-color: rgba(124,176,255,.4); text-decoration: none; color: #fff; }
.ld-badges { justify-content: center; margin-top: 26px; }

.ld-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 44px 0 10px; }
.ld-stat { text-align: center; padding: 22px 14px; border-radius: 16px;
  background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(6px); }
.ld-stat b { display: block; font-size: 34px; font-weight: 800;
  background: linear-gradient(135deg, #6ea8ff, #a78bfa); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ld-stat span { color: #93a4b3; font-size: 13px; line-height: 1.5; display: inline-block; margin-top: 6px; }

.ld-section { padding: clamp(46px, 8vh, 84px) 0 0; }
.ld-section h2 { text-align: center; font-size: clamp(23px, 3vw, 32px); margin: 0 0 10px; color: #fff; letter-spacing: -.3px; }
.ld-section-sub { text-align: center; color: #93a4b3; margin: 0 auto 30px; max-width: 60ch; }
.ld-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.ld-grid .feature-card .fi { font-size: 20px; }

.ld-proto { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.ld-proto-card { padding: 24px 22px; border-radius: 16px; text-align: center;
  background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(6px);
  transition: transform .2s, border-color .2s; }
.ld-proto-card:hover { transform: translateY(-3px); border-color: rgba(124,176,255,.35); }
.ld-proto-ic { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 14px; display: grid; place-items: center; font-size: 24px;
  background: linear-gradient(135deg, rgba(94,162,255,.22), rgba(139,92,246,.22)); border: 1px solid rgba(255,255,255,.1); }
.ld-proto-card h3 { margin: 0 0 8px; font-size: 17px; color: #fff; }
.ld-proto-card p { color: #93a4b3; font-size: 13.5px; line-height: 1.55; margin: 0 0 14px; }
.ld-proto-card code { display: inline-block; font-size: 12px; color: #9dc4ff; background: rgba(94,162,255,.1);
  border: 1px solid rgba(94,162,255,.22); padding: 6px 12px; border-radius: 8px; }

.ld-sec { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; max-width: 860px; margin: 0 auto; }
.ld-sec-item { padding: 14px 16px; border-radius: 12px; font-size: 14px; color: #cfe0f5;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07); }
.ld-sec-item b { color: #fff; }

.ld-final { text-align: center; padding: clamp(56px, 10vh, 96px) 0 70px; }
.ld-final h2 { font-size: clamp(24px, 3.4vw, 36px); margin: 0 0 12px; color: #fff; }
.ld-final-btn { display: inline-block; margin-top: 16px; padding: 15px 40px; font-size: 16px; }

.ld-foot { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  max-width: 1080px; margin: 0 auto; padding: 22px clamp(16px, 4vw, 32px) 30px;
  border-top: 1px solid rgba(255,255,255,.07); color: #7d8fa5; font-size: 13px; }
.ld-foot a { color: #9db0c7; }
.ld-foot a:hover { color: #fff; }

@media (max-width: 720px) {
  .ld-links { display: none; }
  .ld-stats { grid-template-columns: 1fr; }
}

/* ---- Připojení / aktivní relace ---- */
.conn-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-title { margin: 0; font-size: 24px; letter-spacing: -.3px; }
.page-sub { color: var(--text-dim); font-size: 13px; margin-top: 4px; }
.conn-summary { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-dim); display: inline-block; flex: none; }
.live-dot.on { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 22%, transparent); animation: livepulse 2s ease-in-out infinite; }
@keyframes livepulse { 0%,100%{opacity:1} 50%{opacity:.45} }
.ok-text { color: var(--ok); }

.conn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 12px; }
.conn-card { display: flex; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); transition: border-color .15s, transform .15s, box-shadow .15s; }
.conn-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.18); }
.conn-card.is-online { border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); }
.conn-avatar { position: relative; width: 42px; height: 42px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent2)); }
.conn-status { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; background: var(--text-dim); border: 2px solid var(--bg); }
.conn-card.is-online .conn-status { background: var(--ok); }
.conn-info { min-width: 0; flex: 1; }
.conn-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conn-meta { display: flex; align-items: center; gap: 8px; margin: 4px 0; flex-wrap: wrap; }
.conn-last { font-size: 12px; color: var(--text-dim); }

/* ===== App shell / boční lišta (styl Google Disku) ===== */
.app-shell { display: flex; align-items: stretch; min-height: 100vh; }
.sidebar { width: 248px; flex: none; background: var(--bg-elev); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px; padding: 14px 12px; position: sticky; top: 0; height: 100vh; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; font-weight: 800; font-size: 18px; color: var(--text); }
.side-brand:hover { text-decoration: none; }
.side-brand span b { font-weight: 800; background: linear-gradient(135deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-link { display: flex; align-items: center; gap: 13px; padding: 10px 14px; border-radius: var(--radius-pill);
  color: var(--text-dim); font-weight: 500; font-size: 14px; transition: background .14s, color .14s; }
.side-link:hover { background: var(--bg-elev2); color: var(--text); text-decoration: none; }
.side-link.active { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); font-weight: 600; }
.side-ic { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; flex: none; }
.side-ic svg { width: 20px; height: 20px; }
.side-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.side-storage { display: block; padding: 10px 12px; border-radius: var(--radius); background: var(--bg-elev2); border: 1px solid var(--border); }
.side-storage-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.side-storage-head .side-ic { width: 18px; height: 18px; color: var(--accent); }
.side-storage-head .side-ic svg { width: 18px; height: 18px; }
.side-storage-pct { margin-left: auto; color: var(--text-dim); font-weight: 700; font-variant-numeric: tabular-nums; }
.side-storage-bar { height: 6px; margin: 8px 0 6px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.side-storage-bar > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 999px; transition: width .35s; }
.side-storage-s { font-size: 11px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius); background: var(--bg-elev2); border: 1px solid var(--border); }
.side-ava { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent2)); }
.side-user-i { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.side-user-n { font-weight: 600; font-size: 13px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-i .badge { align-self: flex-start; }
.side-acct { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.side-mini { font-size: 12px; padding: 7px 8px; text-align: center; background: transparent; border-color: var(--border); color: var(--text-dim); }
.side-mini:hover { background: var(--bg-elev2); color: var(--text); }
.side-bottom { display: flex; gap: 6px; }
.side-bottom .theme-toggle { width: 42px; flex: none; padding: 0; }
.side-bottom #btnLogout { flex: 1; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-main > .container { max-width: 1600px; margin: 0; width: 100%; }
.app-header, .side-scrim, .side-toggle { display: none; }

@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; height: auto; z-index: 60;
    transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .app-header { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 14px;
    background: var(--bg-elev); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
  .app-header-brand { font-weight: 800; font-size: 17px; color: var(--text); }
  .app-header-brand:hover { text-decoration: none; }
  .app-header-brand span { background: linear-gradient(135deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .side-toggle { display: flex; flex-direction: column; justify-content: center; gap: 4px; width: 40px; height: 38px;
    padding: 0 10px; background: transparent; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; }
  .side-toggle span { display: block; width: 20px; height: 2px; background: var(--text); border-radius: 2px; }
  .side-scrim.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 55; }
}
