:root{--red:#d70012;--red2:#ff3443;--ink:#111;--muted:#6c6c73;--bg:#f8f8f8;--card:#fff;--line:#e7e7ea;--soft:#fff2f3;--ok:#11814c;--warn:#ad6d00;--radius:22px;--shadow:0 16px 40px rgba(17,17,17,.08)}
*{box-sizing:border-box}body{margin:0;font-family:Inter,ui-rounded,"Trebuchet MS",system-ui,-apple-system,Segoe UI,Arial,sans-serif;background:var(--bg);color:var(--ink)}button,input,textarea,select{font:inherit}img{display:block;max-width:100%}.hidden{display:none!important}
.btn{border:0;border-radius:15px;padding:12px 17px;font-weight:900;cursor:pointer;transition:.18s}.btn:hover{transform:translateY(-1px)}.btn-primary{background:linear-gradient(135deg,var(--red),var(--red2));color:#fff;box-shadow:0 10px 24px rgba(215,0,18,.22)}.btn-dark{background:#111;color:#fff}.btn-light{background:#fff;border:1px solid var(--line);color:var(--ink)}.btn-danger{background:#fff0f1;color:#a7000c}
.input{width:100%;padding:13px 14px;border:1px solid var(--line);border-radius:14px;background:#fff;outline:none}.input:focus{border-color:var(--red);box-shadow:0 0 0 4px rgba(215,0,18,.09)}label{display:block;font-weight:900;font-size:13px;margin:14px 0 7px}
.login{min-height:100vh;display:grid;grid-template-columns:1.05fr .95fr;background:#fff}.hero{padding:48px;background:linear-gradient(145deg,#c90011,#ff3845);color:#fff;display:flex;flex-direction:column;justify-content:space-between;position:relative;overflow:hidden}.hero:before{content:"♥";position:absolute;font-size:110px;color:rgba(255,255,255,.13);right:9%;top:7%;transform:rotate(10deg)}.hero:after{content:"";position:absolute;width:540px;height:540px;border:86px solid rgba(255,255,255,.10);border-radius:50%;right:-210px;bottom:-210px}.logo-card{background:#fff;border-radius:26px;padding:18px 22px;width:min(520px,100%);box-shadow:var(--shadow);z-index:1}.hero-copy{z-index:1;max-width:760px}.hero h1{font-size:clamp(44px,5vw,74px);line-height:.95;margin:0 0 20px}.hero p{font-size:20px;line-height:1.6;max-width:620px}.badges{z-index:1;display:flex;gap:10px;flex-wrap:wrap}.badge{padding:9px 13px;border-radius:999px;border:1px solid rgba(255,255,255,.38);background:rgba(255,255,255,.12);font-weight:800}
.login-panel{display:grid;place-items:center;padding:38px}.login-box{width:min(450px,100%)}.login-box h2{font-size:34px;margin:0 0 8px}.muted{color:var(--muted)}.full{width:100%;margin-top:15px}.msg{margin-top:14px;padding:12px 14px;border-radius:13px;font-size:14px}.msg.err{background:#fff0f1;color:#96000a}.msg.ok{background:#ecfbf3;color:#086c3d}
.app{display:grid;grid-template-columns:268px 1fr;min-height:100vh}.sidebar{background:#fff;border-right:1px solid var(--line);padding:18px 14px;position:sticky;top:0;height:100vh}.side-logo-wrap{padding:8px 10px 20px;border-bottom:1px solid var(--line);margin-bottom:14px}.side-logo-wrap img{width:100%;max-width:205px}.nav{display:grid;gap:7px}.nav button{border:0;background:transparent;color:#444;padding:12px 13px;text-align:left;border-radius:13px;font-weight:850;cursor:pointer}.nav button:hover,.nav button.active{background:var(--soft);color:var(--red)}.admin-sep{border-top:1px dashed #ddd;margin-top:10px;padding-top:12px}.side-bottom{position:absolute;left:14px;right:14px;bottom:16px}.role-box{padding:10px 12px;border-radius:13px;background:#fafafa;border:1px solid var(--line);font-size:13px;margin-bottom:10px}
.content{padding:28px 32px 84px;min-width:0}.topbar{display:flex;justify-content:space-between;align-items:center;gap:18px;margin-bottom:24px}.topbar h1{margin:0;font-size:30px}.user-chip{background:#fff;border:1px solid var(--line);border-radius:999px;padding:8px 12px;display:flex;align-items:center;gap:9px}.avatar{width:34px;height:34px;border-radius:50%;background:#ffe7e9;color:var(--red);display:grid;place-items:center;font-weight:950}
.brush-title{display:inline-block;background:linear-gradient(90deg,var(--red),#f22231);color:#fff;padding:9px 18px;border-radius:5px 16px 6px 14px;transform:rotate(-.4deg);font-weight:950;letter-spacing:.4px;box-shadow:0 8px 20px rgba(215,0,18,.16)}.grid{display:grid;gap:17px}.grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}.card{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:21px;box-shadow:0 4px 16px rgba(0,0,0,.035)}.metric{font-size:34px;font-weight:950;margin:8px 0}.progress{height:11px;background:#ececef;border-radius:999px;overflow:hidden}.progress>div{height:100%;background:linear-gradient(90deg,var(--red),var(--red2))}.section-title{display:flex;justify-content:space-between;align-items:center;gap:15px;margin:28px 0 14px}.section-title h2{margin:0}
.course{padding:0;overflow:hidden;cursor:pointer;transition:.18s;position:relative}.course:hover{transform:translateY(-2px);box-shadow:var(--shadow)}.cover{height:156px;padding:20px;color:#fff;display:flex;align-items:flex-end;font-size:23px;font-weight:950;background:linear-gradient(0deg,rgba(0,0,0,.45),rgba(0,0,0,.08)),linear-gradient(135deg,#d90012,#ff4a55)}.course-body{padding:17px}.tag{display:inline-block;padding:6px 9px;border-radius:999px;background:#fff0f1;color:var(--red);font-size:12px;font-weight:900}
.lesson-list{display:grid;gap:9px}.lesson{border:1px solid var(--line);border-radius:14px;padding:14px;cursor:pointer;background:#fff}.lesson:hover{border-color:var(--red);background:#fff8f8}.status{font-size:12px;font-weight:900;margin-top:6px}.done{color:var(--ok)}.todo{color:var(--warn)}
.layout{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(300px,.72fr);gap:18px}.video{aspect-ratio:16/9;background:#111;border-radius:18px;overflow:hidden;display:grid;place-items:center;color:#fff}.video iframe,.video video{width:100%;height:100%;border:0}.block{border:1px solid var(--line);border-radius:16px;padding:16px;margin:12px 0;background:#fff}.block.notice{background:#fff4f5;border-color:#ffc8cd}.block.check{background:#f7fff9;border-color:#ccebd8}.block h3{margin:0 0 8px}.block-list{margin:0;padding-left:20px;line-height:1.7}
.toolbar{display:flex;gap:9px;flex-wrap:wrap}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:13px}.span-2{grid-column:1/-1}.table-wrap{overflow:auto}.table{width:100%;border-collapse:collapse}.table th,.table td{text-align:left;border-bottom:1px solid var(--line);padding:12px;font-size:14px}.table th{font-size:12px;color:var(--muted);text-transform:uppercase}.empty{text-align:center;padding:44px 20px;color:var(--muted)}.toast{position:fixed;right:22px;bottom:22px;background:#111;color:#fff;padding:13px 15px;border-radius:13px;z-index:50}.mobile-nav{display:none}
@media(max-width:960px){.login{grid-template-columns:1fr}.hero{display:none}.app{grid-template-columns:1fr}.sidebar{display:none}.content{padding:18px 14px 88px}.grid-3,.grid-2,.layout,.form-grid{grid-template-columns:1fr}.span-2{grid-column:auto}.mobile-nav{display:grid;grid-template-columns:repeat(4,1fr);position:fixed;bottom:0;left:0;right:0;background:#fff;border-top:1px solid var(--line);z-index:20}.mobile-nav button{border:0;background:#fff;padding:11px 3px;font-size:11px;font-weight:850}}

/* V07 — wygodniejszy panel administratora */
.admin-workspace{display:grid;grid-template-columns:minmax(280px,.9fr) minmax(360px,1.15fr) minmax(330px,1fr);gap:14px;align-items:start}
.admin-card{min-height:640px}
.admin-card-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:12px}
.admin-tree{display:flex;flex-direction:column;gap:10px;margin-top:14px}
.tree-module{border:1px solid #eee;border-radius:14px;background:#fff;overflow:hidden}
.tree-module-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:11px 12px;background:#fff7f7}
.tree-module-title{font-weight:800;display:flex;align-items:center;gap:8px}
.tree-lessons{padding:6px 10px 10px}
.tree-lesson{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:9px;border-bottom:1px dashed #eee}
.tree-lesson:last-child{border-bottom:0}
.tree-actions{display:flex;gap:5px;flex-wrap:wrap}
.icon-btn{border:1px solid #e6e6e6;background:#fff;border-radius:9px;padding:5px 8px;cursor:pointer;font-size:12px}
.icon-btn:hover{border-color:#ef233c;background:#fff4f5}
.type-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin:8px 0 12px}
.type-tile{border:1px solid #e6e6e6;background:#fff;border-radius:12px;padding:10px 6px;text-align:center;cursor:pointer;font-weight:700;font-size:12px}
.type-tile.active{border-color:#ef233c;background:#fff0f2;color:#d90429;box-shadow:0 4px 14px rgba(239,35,60,.12)}
.field-hidden{display:none!important}
.course-list{display:flex;flex-direction:column;gap:10px;margin-top:12px}
.course-row{border:1px solid #eee;border-radius:13px;padding:11px;background:#fff}
.course-row-top{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}
.course-meta{font-size:12px;color:#777;margin-top:4px}
.empty-state{padding:24px;text-align:center;border:1px dashed #ddd;border-radius:14px;color:#777}
.preview-bar{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:10px}
@media(max-width:1200px){.admin-workspace{grid-template-columns:1fr 1fr}.admin-card:last-child{grid-column:1/-1}}
@media(max-width:760px){.admin-workspace{grid-template-columns:1fr}.admin-card:last-child{grid-column:auto}.type-grid{grid-template-columns:repeat(2,1fr)}}


/* V08 — bezpośrednie przesyłanie materiałów */
.upload-box{border:1px dashed #d8d8d8;border-radius:14px;padding:12px;background:#fcfcfc;margin:8px 0 12px}
.upload-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.upload-name{font-size:12px;color:#666;overflow-wrap:anywhere}
.upload-progress{height:8px;background:#ececec;border-radius:999px;overflow:hidden;margin-top:9px}
.upload-progress>span{display:block;height:100%;width:0;background:linear-gradient(90deg,#d90429,#ff4d67);transition:width .18s ease}
.upload-status{font-size:12px;margin-top:7px;color:#666}
.upload-status.ok{color:#118a3a;font-weight:700}
.upload-status.error{color:#c1121f;font-weight:700}


/* V09 — wygodniejszy widok kursu i lekcji */
.lesson-shell{display:grid;grid-template-columns:300px minmax(0,1fr);gap:16px;align-items:start}
.lesson-sidebar{position:sticky;top:12px;max-height:calc(100vh - 110px);overflow:auto}
.lesson-sidebar h3{margin:0 0 10px}
.lesson-nav-module{border:1px solid #eee;border-radius:14px;overflow:hidden;margin-bottom:10px;background:#fff}
.lesson-nav-module-title{padding:10px 12px;background:#fff7f7;font-weight:800}
.lesson-nav-item{width:100%;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border:0;border-top:1px solid #f0f0f0;background:#fff;text-align:left;cursor:pointer}
.lesson-nav-item:hover{background:#fafafa}
.lesson-nav-item.active{background:#fff0f2;color:#d90429;font-weight:800}
.lesson-nav-status{font-size:12px}
.course-progress-card{margin-bottom:12px}
.course-progress-top{display:flex;justify-content:space-between;gap:10px;align-items:center}
.course-progress-bar{height:10px;border-radius:999px;background:#ececec;overflow:hidden;margin-top:8px}
.course-progress-bar span{display:block;height:100%;background:linear-gradient(90deg,#d90429,#ff4d67)}
.lesson-main .video{min-height:420px}
.lesson-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}
.lesson-complete[disabled]{opacity:.45;cursor:not-allowed}
.lesson-note{font-size:12px;color:#666;margin-top:8px}
.next-lesson-box{margin-top:14px;padding:14px;border:1px solid #eee;border-radius:14px;background:#fff}
@media(max-width:900px){.lesson-shell{grid-template-columns:1fr}.lesson-sidebar{position:static;max-height:none}.lesson-main .video{min-height:260px}}


/* Uproszczone ukończenie lekcji */
.lesson-complete.done{background:#118a3a!important;box-shadow:none}
.lesson-complete.watching{background:#f4a3ad!important;box-shadow:none}
.lesson-watch-progress{height:8px;background:#ececec;border-radius:999px;overflow:hidden;max-width:420px;margin-top:8px}
.lesson-watch-progress span{display:block;height:100%;width:0;background:linear-gradient(90deg,#d90429,#ff4d67);transition:width .2s ease}


/* Własny odtwarzacz bez przewijania do przodu */
.custom-video-player{position:relative;background:#111;border-radius:18px;overflow:hidden}
.custom-video-player video{display:block;width:100%;height:100%;object-fit:contain;background:#111}
.video-controls{display:flex;align-items:center;gap:10px;padding:10px 12px;background:#171717;color:#fff}
.video-control-btn{border:0;background:#2a2a2a;color:#fff;border-radius:10px;padding:8px 11px;cursor:pointer;font-weight:700}
.video-control-btn:hover{background:#3a3a3a}
.video-control-btn:disabled{opacity:.45;cursor:not-allowed}
.video-time{font-variant-numeric:tabular-nums;font-size:13px;white-space:nowrap}
.video-spacer{flex:1}
.video-volume{width:110px}
.video-progress-static{height:6px;background:#333;overflow:hidden}
.video-progress-static span{display:block;height:100%;width:0;background:linear-gradient(90deg,#d90429,#ff4d67);transition:width .2s ease}
@media(max-width:700px){
  .video-controls{gap:6px;padding:8px}
  .video-control-btn{padding:7px 9px}
  .video-volume{width:78px}
  .video-time{font-size:12px}
}


/* FIX player controls visibility */
.video.custom-video-player{
  display:flex!important;
  flex-direction:column!important;
  place-items:initial!important;
  aspect-ratio:auto!important;
  min-height:0!important;
  overflow:hidden!important;
}
.video.custom-video-player>video{
  width:100%!important;
  height:auto!important;
  aspect-ratio:16/9!important;
  object-fit:contain!important;
  flex:0 0 auto!important;
}
.video.custom-video-player>.video-progress-static{
  flex:0 0 6px!important;
  width:100%!important;
  position:relative!important;
  z-index:3!important;
}
.video.custom-video-player>.video-controls{
  display:flex!important;
  visibility:visible!important;
  opacity:1!important;
  position:relative!important;
  z-index:4!important;
  width:100%!important;
  min-height:54px!important;
  flex:0 0 auto!important;
}
@media(max-width:700px){
  .video.custom-video-player>.video-controls{min-height:48px!important;flex-wrap:wrap!important}
}


/* Pełny ekran — film i własne sterowanie zawsze widoczne */
.custom-video-player:fullscreen,
.custom-video-player:-webkit-full-screen{
  width:100vw!important;
  height:100vh!important;
  max-width:none!important;
  max-height:none!important;
  border-radius:0!important;
  display:flex!important;
  flex-direction:column!important;
  background:#000!important;
}

.custom-video-player:fullscreen video,
.custom-video-player:-webkit-full-screen video{
  flex:1 1 auto!important;
  width:100%!important;
  height:auto!important;
  min-height:0!important;
  object-fit:contain!important;
  background:#000!important;
}

.custom-video-player:fullscreen .video-progress-static,
.custom-video-player:-webkit-full-screen .video-progress-static{
  flex:0 0 7px!important;
  width:100%!important;
  display:block!important;
}

.custom-video-player:fullscreen .video-controls,
.custom-video-player:-webkit-full-screen .video-controls{
  flex:0 0 auto!important;
  display:flex!important;
  width:100%!important;
  min-height:58px!important;
  padding:10px 14px!important;
  background:rgba(15,15,15,.96)!important;
  position:relative!important;
  z-index:999999!important;
}

.custom-video-player:fullscreen .video-control-btn,
.custom-video-player:-webkit-full-screen .video-control-btn,
.custom-video-player:fullscreen .video-time,
.custom-video-player:-webkit-full-screen .video-time,
.custom-video-player:fullscreen .video-volume,
.custom-video-player:-webkit-full-screen .video-volume{
  display:inline-flex!important;
  visibility:visible!important;
  opacity:1!important;
}


/* Ostateczna poprawka pełnego ekranu:
   wcześniejsze aspect-ratio:16/9 powodowało, że film zajmował całe 100vh,
   a sterowanie lądowało poniżej widocznego obszaru. */
.video.custom-video-player:fullscreen,
.video.custom-video-player:-webkit-full-screen{
  display:grid!important;
  grid-template-rows:minmax(0,1fr) 7px auto!important;
  width:100vw!important;
  height:100vh!important;
  max-width:none!important;
  max-height:none!important;
  overflow:hidden!important;
  border-radius:0!important;
  background:#000!important;
}

.video.custom-video-player:fullscreen>video,
.video.custom-video-player:-webkit-full-screen>video{
  grid-row:1!important;
  width:100%!important;
  height:100%!important;
  min-width:0!important;
  min-height:0!important;
  max-width:100%!important;
  max-height:100%!important;
  aspect-ratio:auto!important;
  object-fit:contain!important;
  flex:none!important;
}

.video.custom-video-player:fullscreen>.video-progress-static,
.video.custom-video-player:-webkit-full-screen>.video-progress-static{
  grid-row:2!important;
  width:100%!important;
  height:7px!important;
  min-height:7px!important;
  display:block!important;
  position:relative!important;
  z-index:20!important;
}

.video.custom-video-player:fullscreen>.video-controls,
.video.custom-video-player:-webkit-full-screen>.video-controls{
  grid-row:3!important;
  display:flex!important;
  visibility:visible!important;
  opacity:1!important;
  width:100%!important;
  min-height:62px!important;
  height:auto!important;
  padding:10px 16px!important;
  position:relative!important;
  inset:auto!important;
  z-index:30!important;
  background:#151515!important;
  box-sizing:border-box!important;
}


/* Stabilny tryb pełnoekranowy sterowany klasą — niezależny od :fullscreen */
body.player-fullscreen-open{overflow:hidden!important}

.video.custom-video-player.player-fullscreen{
  position:fixed!important;
  inset:0!important;
  z-index:2147483647!important;
  width:100vw!important;
  height:100vh!important;
  max-width:none!important;
  max-height:none!important;
  margin:0!important;
  border-radius:0!important;
  background:#000!important;
  display:grid!important;
  grid-template-rows:minmax(0,1fr) 7px 64px!important;
  overflow:hidden!important;
}

.video.custom-video-player.player-fullscreen>video{
  grid-row:1!important;
  width:100%!important;
  height:100%!important;
  min-width:0!important;
  min-height:0!important;
  max-width:100%!important;
  max-height:100%!important;
  aspect-ratio:auto!important;
  object-fit:contain!important;
  background:#000!important;
}

.video.custom-video-player.player-fullscreen>.video-progress-static{
  grid-row:2!important;
  display:block!important;
  width:100%!important;
  height:7px!important;
  min-height:7px!important;
  position:relative!important;
  z-index:2147483647!important;
}

.video.custom-video-player.player-fullscreen>.video-controls{
  grid-row:3!important;
  display:flex!important;
  visibility:visible!important;
  opacity:1!important;
  width:100%!important;
  height:64px!important;
  min-height:64px!important;
  padding:10px 16px!important;
  position:relative!important;
  z-index:2147483647!important;
  background:#151515!important;
  box-sizing:border-box!important;
}


/* Telefon w poziomie: więcej miejsca na obraz w pełnym ekranie */
@media (max-height: 820px) and (orientation: landscape){
  .video.custom-video-player.player-fullscreen{
    grid-template-rows:minmax(0,1fr) 4px 50px!important;
  }
  .video.custom-video-player.player-fullscreen>.video-progress-static{
    height:4px!important;
    min-height:4px!important;
  }
  .video.custom-video-player.player-fullscreen>.video-controls{
    height:50px!important;
    min-height:50px!important;
    padding:6px 10px!important;
    gap:6px!important;
  }
  .video.custom-video-player.player-fullscreen .video-control-btn{
    padding:6px 9px!important;
    border-radius:8px!important;
    font-size:14px!important;
  }
  .video.custom-video-player.player-fullscreen .video-time{
    font-size:12px!important;
  }
  .video.custom-video-player.player-fullscreen .video-volume{
    width:90px!important;
  }
}


/* Pełny ekran na telefonie i komputerze — obraz na całą szerokość.
   Używamy cover, więc odtwarzacz wypełnia cały dostępny obszar.
   Przy nietypowych proporcjach może zostać minimalnie przycięta góra lub dół. */
.video.custom-video-player.player-fullscreen>video,
.video.custom-video-player:fullscreen>video,
.video.custom-video-player:-webkit-full-screen>video{
  width:100%!important;
  height:100%!important;
  max-width:none!important;
  max-height:none!important;
  object-fit:cover!important;
  object-position:center center!important;
}

/* Telefon w poziomie — maksymalnie dużo miejsca na obraz,
   a sterowanie pozostaje widoczne. */
@media (orientation:landscape) and (max-height:600px){
  .video.custom-video-player.player-fullscreen{
    grid-template-rows:minmax(0,1fr) 5px 54px!important;
  }

  .video.custom-video-player.player-fullscreen>.video-controls{
    height:54px!important;
    min-height:54px!important;
    padding:6px 10px!important;
    gap:6px!important;
  }

  .video.custom-video-player.player-fullscreen .video-control-btn{
    padding:7px 10px!important;
    border-radius:10px!important;
    font-size:14px!important;
  }

  .video.custom-video-player.player-fullscreen .video-time{
    font-size:13px!important;
  }

  .video.custom-video-player.player-fullscreen .video-volume{
    width:92px!important;
  }
}


/* V7 — materiały lekcji dobierane do typu */
.lesson-content-after-media{
  margin-top:16px;
}

.external-video iframe{
  width:100%;
  height:100%;
  border:0;
}

.pdf-material{
  padding:0;
  overflow:hidden;
}

.pdf-material-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  padding:18px 20px;
  border-bottom:1px solid #ececec;
}

.pdf-material-head h2{
  margin:10px 0 4px;
  font-size:20px;
  overflow-wrap:anywhere;
}

.pdf-material-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.pdf-viewer{
  position:relative;
  width:100%;
  height:min(76vh,920px);
  min-height:620px;
  background:#ececec;
}

.pdf-viewer iframe{
  position:relative;
  z-index:2;
  display:block;
  width:100%;
  height:100%;
  border:0;
  background:#fff;
}

.pdf-fallback{
  position:absolute;
  inset:0;
  z-index:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:12px;
  padding:24px;
  text-align:center;
}

@media(max-width:900px){
  .pdf-material-head{
    flex-direction:column;
  }

  .pdf-material-actions{
    width:100%;
    justify-content:flex-start;
  }

  .pdf-viewer{
    height:68vh;
    min-height:480px;
  }
}

@media(max-width:600px){
  .pdf-material-head{
    padding:14px;
  }

  .pdf-material-actions .btn{
    width:100%;
  }

  .pdf-viewer{
    height:70vh;
    min-height:430px;
  }
}


.build-badge{
  margin-bottom:8px;
  font-size:10px;
  color:#8c8c8c;
  text-align:center;
  letter-spacing:.04em;
}


/* Hotfix 10.2 — PDF zajmuje całą szerokość podglądu */
.pdf-viewer{
  overflow:hidden;
}

.pdf-viewer .pdf-frame,
.pdf-viewer iframe,
.pdf-viewer object,
.pdf-viewer embed{
  display:block!important;
  width:100%!important;
  height:100%!important;
  min-width:100%!important;
  min-height:100%!important;
  border:0!important;
  background:#fff!important;
}

.pdf-material{
  width:100%;
}

.pdf-material .pdf-viewer{
  width:100%;
  height:calc(100vh - 310px);
  min-height:680px;
  max-height:none;
}

@media(max-width:900px){
  .pdf-material .pdf-viewer{
    height:calc(100vh - 330px);
    min-height:560px;
  }
}

@media(max-width:600px){
  .pdf-material .pdf-viewer{
    height:calc(100vh - 360px);
    min-height:480px;
  }
}



/* V12 — quizy */
.quiz-shell{
  max-width:900px;
  margin:0 auto;
}

.quiz-intro{
  text-align:center;
  padding:28px;
}

.quiz-progress-row{
  display:flex;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}

.quiz-question-card{
  margin-top:18px;
}

.quiz-answers{
  display:grid;
  gap:10px;
  margin-top:18px;
}

.quiz-answer{
  display:flex;
  align-items:flex-start;
  gap:12px;
  padding:14px;
  border:1px solid #e7e7e7;
  border-radius:14px;
  cursor:pointer;
  background:#fff;
}

.quiz-answer:hover{
  border-color:#ef233c;
  background:#fff7f8;
}

.quiz-answer input{
  margin-top:3px;
  transform:scale(1.2);
}

.quiz-actions{
  display:flex;
  justify-content:space-between;
  gap:12px;
  margin-top:18px;
}

.quiz-result{
  text-align:center;
  padding:32px;
}

.quiz-result-icon{
  width:72px;
  height:72px;
  border-radius:50%;
  display:grid;
  place-items:center;
  margin:0 auto 14px;
  font-size:34px;
  font-weight:900;
}

.quiz-result.passed .quiz-result-icon{
  background:#e9f9ef;
  color:#118a3a;
}

.quiz-result.failed .quiz-result-icon{
  background:#fff1f2;
  color:#c1121f;
}

.quiz-result-score{
  font-size:48px;
  font-weight:900;
}

@media(max-width:700px){
  .quiz-builder-answer{
    grid-template-columns:1fr;
  }

  .quiz-actions{
    flex-direction:column;
  }
}


/* V13 — profesjonalny kreator quizów */
.quiz-builder{
  margin-top:16px;
}

.quiz-builder-heading{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:18px;
  margin-bottom:16px;
}

.quiz-builder-heading h3,
.quiz-question-list-head h3{
  margin:10px 0 4px;
}

.quiz-builder-summary{
  min-width:92px;
  padding:12px 16px;
  border-radius:16px;
  background:#111;
  color:#fff;
  text-align:center;
}

.quiz-builder-summary strong{
  display:block;
  font-size:28px;
  line-height:1;
}

.quiz-builder-summary span{
  display:block;
  margin-top:5px;
  font-size:11px;
  opacity:.7;
}

.quiz-settings-card{
  border:1px solid #ececec;
  border-radius:18px;
  padding:16px;
  background:#fafafa;
}

.quiz-settings-main{
  display:grid;
  grid-template-columns:minmax(0,2fr) minmax(120px,1fr);
  gap:12px;
}

.quiz-setting-toggles{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:12px;
}

.quiz-toggle{
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding:12px;
  border:1px solid #e5e5e5;
  border-radius:14px;
  background:#fff;
  cursor:pointer;
}

.quiz-toggle input{
  margin-top:3px;
  transform:scale(1.1);
}

.quiz-toggle strong,
.quiz-toggle small{
  display:block;
}

.quiz-toggle small{
  margin-top:3px;
  color:#777;
  line-height:1.35;
}

.quiz-question-list-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:22px 0 10px;
}

.quiz-builder-questions{
  display:grid;
  gap:14px;
}

.quiz-builder-card{
  overflow:hidden;
  border:1px solid #e5e5e5;
  border-radius:18px;
  background:#fff;
  box-shadow:0 7px 24px rgba(0,0,0,.055);
}

.quiz-question-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:11px 14px;
  border-bottom:1px solid #ececec;
  background:#fafafa;
}

.quiz-question-index{
  display:flex;
  align-items:center;
  gap:8px;
}

.quiz-question-index span{
  color:#777;
  font-size:12px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.04em;
}

.quiz-question-index strong{
  display:grid;
  place-items:center;
  width:30px;
  height:30px;
  border-radius:9px;
  background:#ef233c;
  color:#fff;
}

.quiz-question-actions{
  display:flex;
  gap:5px;
}

.quiz-icon-action{
  width:32px;
  height:32px;
  display:grid;
  place-items:center;
  padding:0;
  border:1px solid #dedede;
  border-radius:9px;
  background:#fff;
  cursor:pointer;
}

.quiz-icon-action:hover:not(:disabled){
  border-color:#111;
  background:#111;
  color:#fff;
}

.quiz-icon-action.danger:hover:not(:disabled){
  border-color:#ef233c;
  background:#ef233c;
}

.quiz-icon-action:disabled{
  opacity:.3;
  cursor:not-allowed;
}

.quiz-question-body{
  padding:16px;
}

.quiz-question-mode{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:12px;
  margin:12px 0 16px;
  padding:10px 12px;
  border-radius:12px;
  background:#f7f7f7;
}

.quiz-question-mode>span{
  margin-right:auto;
  font-size:12px;
  font-weight:800;
}

.quiz-question-mode label{
  display:flex;
  align-items:center;
  gap:6px;
  margin:0;
  cursor:pointer;
}

.quiz-answers-label{
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
}

.quiz-builder-answers{
  display:grid;
  gap:8px;
}

.quiz-builder-answer{
  display:grid;
  grid-template-columns:34px minmax(0,1fr) auto 34px;
  gap:8px;
  align-items:center;
}

.quiz-answer-letter{
  display:grid;
  place-items:center;
  width:34px;
  height:34px;
  border-radius:10px;
  background:#f1f1f1;
  font-weight:900;
}

.quiz-correct-toggle{
  display:flex;
  align-items:center;
  gap:6px;
  margin:0;
  padding:8px 10px;
  border:1px solid #ddd;
  border-radius:10px;
  white-space:nowrap;
  cursor:pointer;
}

.quiz-correct-toggle:has(input:checked){
  border-color:#179147;
  background:#edf9f1;
  color:#126b36;
}

.quiz-add-answer{
  margin-top:10px;
  padding:8px 11px;
  border:1px dashed #bbb;
  border-radius:10px;
  background:#fff;
  cursor:pointer;
  font-weight:700;
}

.quiz-add-answer:hover{
  border-color:#ef233c;
  color:#ef233c;
}

.quiz-add-question-large{
  width:100%;
  display:grid;
  place-items:center;
  gap:4px;
  margin-top:14px;
  padding:19px;
  border:2px dashed #d7d7d7;
  border-radius:17px;
  background:#fafafa;
  cursor:pointer;
}

.quiz-add-question-large:hover{
  border-color:#ef233c;
  background:#fff7f8;
}

.quiz-add-question-large>span{
  font-size:25px;
  color:#ef233c;
}

.quiz-add-question-large strong,
.quiz-add-question-large small{
  display:block;
}

.quiz-add-question-large small{
  color:#777;
}

@media(max-width:700px){
  .quiz-builder-heading,
  .quiz-question-list-head{
    align-items:stretch;
    flex-direction:column;
  }

  .quiz-builder-summary{
    width:100%;
  }

  .quiz-settings-main,
  .quiz-setting-toggles{
    grid-template-columns:1fr;
  }

  .quiz-builder-answer{
    grid-template-columns:34px minmax(0,1fr);
  }

  .quiz-correct-toggle,
  .quiz-builder-answer .remove-answer{
    grid-column:2;
  }

  .quiz-question-header{
    align-items:flex-start;
  }

  .quiz-question-actions{
    flex-wrap:wrap;
    justify-content:flex-end;
  }
}


/* V14 — profesjonalny silnik egzaminacyjny */
.quiz-settings-main-4{
  grid-template-columns:repeat(4,minmax(0,1fr));
}

.quiz-settings-main-4 .span-2{
  grid-column:span 2;
}

.quiz-setting-toggles-3{
  grid-template-columns:repeat(3,minmax(0,1fr));
}

.field-help{
  display:block;
  margin-top:4px;
  color:#888;
  font-size:10px;
}

.quiz-toolbar-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:flex-end;
}

.quiz-question-meta-grid{
  display:grid;
  grid-template-columns:minmax(0,3fr) minmax(160px,1fr);
  gap:12px;
}

.quiz-card-footer{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-top:10px;
}

.quiz-modal{
  position:fixed;
  inset:0;
  z-index:10000;
  display:grid;
  place-items:center;
  padding:24px;
}

.quiz-modal.hidden{
  display:none;
}

.quiz-modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.62);
  backdrop-filter:blur(3px);
}

.quiz-modal-panel{
  position:relative;
  z-index:1;
  width:min(1050px,96vw);
  max-height:90vh;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border-radius:22px;
  background:#fff;
  box-shadow:0 30px 90px rgba(0,0,0,.32);
}

.quiz-modal-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  padding:18px 20px;
  border-bottom:1px solid #eee;
}

.quiz-modal-head h2{
  margin:10px 0 0;
}

.quiz-modal-body{
  overflow:auto;
  padding:20px;
}

.quiz-preview-summary,
.quiz-intro-stats{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin:16px 0 22px;
}

.quiz-preview-summary>div,
.quiz-intro-stats>div{
  padding:14px;
  border:1px solid #e8e8e8;
  border-radius:14px;
  text-align:center;
  background:#fafafa;
}

.quiz-preview-summary strong,
.quiz-intro-stats strong{
  display:block;
  font-size:24px;
}

.quiz-preview-summary span,
.quiz-intro-stats span{
  display:block;
  margin-top:4px;
  color:#777;
  font-size:11px;
}

.quiz-preview-question{
  display:grid;
  grid-template-columns:42px minmax(0,1fr);
  gap:14px;
  padding:16px 0;
  border-bottom:1px solid #eee;
}

.quiz-preview-number{
  display:grid;
  place-items:center;
  width:40px;
  height:40px;
  border-radius:12px;
  background:#ef233c;
  color:#fff;
  font-weight:900;
}

.quiz-preview-category,
.quiz-runtime-category{
  display:inline-block;
  padding:4px 8px;
  border-radius:999px;
  background:#fff0f2;
  color:#c90020;
  font-size:10px;
  font-weight:800;
}

.quiz-preview-question h3{
  margin:8px 0 12px;
}

.quiz-preview-answers{
  display:grid;
  gap:6px;
}

.quiz-preview-answers>div{
  padding:9px 11px;
  border:1px solid #eee;
  border-radius:10px;
}

.quiz-preview-answers>div.correct{
  border-color:#89cba3;
  background:#edf9f1;
  color:#126b36;
}

.quiz-preview-answers>div>span{
  display:inline-grid;
  place-items:center;
  width:24px;
  height:24px;
  margin-right:7px;
  border-radius:7px;
  background:#eee;
  font-weight:900;
}

.question-bank-filters{
  display:grid;
  grid-template-columns:minmax(0,2fr) minmax(180px,1fr);
  gap:10px;
  margin-bottom:14px;
}

.question-bank-list{
  display:grid;
  gap:8px;
  max-height:55vh;
  overflow:auto;
  margin-bottom:14px;
}

.question-bank-item{
  display:flex;
  gap:12px;
  align-items:flex-start;
  padding:13px;
  border:1px solid #e5e5e5;
  border-radius:14px;
  cursor:pointer;
}

.question-bank-item:hover{
  border-color:#ef233c;
  background:#fff7f8;
}

.question-bank-item input{
  margin-top:4px;
  transform:scale(1.2);
}

.question-bank-item strong,
.question-bank-item small{
  display:block;
}

.question-bank-item strong{
  margin:7px 0 3px;
}

.question-bank-item small{
  color:#777;
}

.quiz-runtime-top{
  display:flex;
  justify-content:space-between;
  gap:14px;
  align-items:flex-start;
  margin-bottom:12px;
}

.quiz-runtime-top strong,
.quiz-runtime-top span{
  display:block;
}

.quiz-runtime-category{
  margin-top:6px;
}

.quiz-timer{
  min-width:92px;
  padding:10px 14px;
  border-radius:12px;
  background:#111;
  color:#fff;
  text-align:center;
  font-size:20px;
  font-weight:900;
}

.quiz-timer.danger{
  background:#d90429;
  animation:quizTimerPulse 1s infinite;
}

@keyframes quizTimerPulse{
  50%{transform:scale(1.04)}
}

.quiz-answer{
  align-items:center;
}

.quiz-answer.selected{
  border-color:#ef233c;
  background:#fff4f5;
  box-shadow:0 0 0 2px rgba(239,35,60,.08);
}

.quiz-answer-letter-runtime{
  display:grid;
  place-items:center;
  flex:0 0 34px;
  width:34px;
  height:34px;
  border-radius:10px;
  background:#f0f0f0;
  font-weight:900;
}

.quiz-status-message{
  max-width:680px;
  margin:18px auto 0;
  padding:13px;
  border-radius:12px;
  font-weight:700;
}

.quiz-status-message.success{
  background:#edf9f1;
  color:#126b36;
}

.quiz-status-message.error{
  background:#fff0f2;
  color:#b6001c;
}

.quiz-status-message.warning{
  background:#fff8e5;
  color:#805a00;
}

.quiz-attempt-note{
  margin-top:12px;
}

.quiz-review{
  max-width:760px;
  margin:24px auto 0;
  text-align:left;
}

.quiz-review-item{
  display:grid;
  gap:5px;
  margin-top:8px;
  padding:12px;
  border-radius:12px;
  border:1px solid #e5e5e5;
}

.quiz-review-item.correct{
  border-color:#9bd4b1;
  background:#f0faf4;
}

.quiz-review-item.incorrect{
  border-color:#efb1bb;
  background:#fff5f6;
}

@media(max-width:900px){
  .quiz-settings-main-4{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .quiz-setting-toggles-3,
  .quiz-preview-summary,
  .quiz-intro-stats{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media(max-width:650px){
  .quiz-settings-main-4,
  .quiz-setting-toggles-3,
  .quiz-preview-summary,
  .quiz-intro-stats,
  .question-bank-filters,
  .quiz-question-meta-grid{
    grid-template-columns:1fr;
  }

  .quiz-settings-main-4 .span-2{
    grid-column:auto;
  }

  .quiz-toolbar-actions,
  .quiz-card-footer{
    align-items:stretch;
    flex-direction:column;
  }

  .quiz-modal{
    padding:8px;
  }

  .quiz-modal-panel{
    width:100%;
    max-height:96vh;
    border-radius:16px;
  }
}


/* V15 — kreator krok po kroku, autozapis i import/eksport */
.quiz-builder-heading-side{
  display:flex;
  align-items:center;
  gap:10px;
}

.quiz-autosave-status{
  display:flex;
  align-items:center;
  gap:7px;
  padding:9px 12px;
  border:1px solid #e4e4e4;
  border-radius:12px;
  background:#fff;
  color:#666;
  font-size:11px;
  white-space:nowrap;
}

.quiz-autosave-dot{
  width:8px;
  height:8px;
  border-radius:50%;
  background:#149447;
}

.quiz-autosave-status[data-state="saving"] .quiz-autosave-dot{
  background:#e3a008;
  animation:quizAutosavePulse .8s infinite alternate;
}

.quiz-autosave-status[data-state="error"] .quiz-autosave-dot{
  background:#d90429;
}

@keyframes quizAutosavePulse{
  to{opacity:.3}
}

.quiz-wizard-nav{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  margin:16px 0;
}

.quiz-wizard-nav button{
  display:flex;
  align-items:center;
  gap:9px;
  padding:11px;
  border:1px solid #e5e5e5;
  border-radius:13px;
  background:#fff;
  color:#777;
  cursor:pointer;
  text-align:left;
}

.quiz-wizard-nav button>span{
  display:grid;
  place-items:center;
  width:28px;
  height:28px;
  flex:0 0 28px;
  border-radius:9px;
  background:#f0f0f0;
  color:#555;
  font-weight:900;
}

.quiz-wizard-nav button.active{
  border-color:#ef233c;
  background:#fff4f5;
  color:#111;
}

.quiz-wizard-nav button.active>span{
  background:#ef233c;
  color:#fff;
}

.quiz-wizard-nav button.done>span{
  background:#159447;
  color:#fff;
}

.quiz-wizard-step{
  display:none;
}

.quiz-wizard-step.active{
  display:block;
}

.quiz-section-heading{
  margin-bottom:12px;
}

.quiz-section-heading h3{
  margin:0 0 4px;
}

.quiz-wizard-footer{
  position:sticky;
  bottom:0;
  z-index:12;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-top:16px;
  padding:12px;
  border:1px solid #e5e5e5;
  border-radius:15px;
  background:rgba(255,255,255,.96);
  box-shadow:0 -6px 24px rgba(0,0,0,.06);
  backdrop-filter:blur(10px);
}

.quiz-import-export{
  display:flex;
  gap:7px;
  flex-wrap:wrap;
  justify-content:center;
}

.quiz-final-review{
  display:grid;
  gap:15px;
}

.quiz-final-review-empty{
  min-height:260px;
  display:grid;
  place-items:center;
  align-content:center;
  gap:7px;
  padding:24px;
  border:2px dashed #ddd;
  border-radius:17px;
  text-align:center;
  background:#fafafa;
}

.quiz-final-review-empty>div{
  font-size:42px;
}

.quiz-final-review-empty h3,
.quiz-final-review-empty p{
  margin:0;
}

.quiz-final-stats{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:8px;
}

.quiz-final-stats>div{
  padding:12px;
  border:1px solid #e6e6e6;
  border-radius:13px;
  background:#fafafa;
  text-align:center;
}

.quiz-final-stats strong{
  display:block;
  font-size:22px;
}

.quiz-final-stats span{
  display:block;
  margin-top:4px;
  color:#777;
  font-size:10px;
}

.quiz-validation-panel{
  padding:14px;
  border-radius:13px;
}

.quiz-validation-panel strong,
.quiz-validation-panel p{
  display:block;
  margin:0;
}

.quiz-validation-panel p{
  margin-top:4px;
}

.quiz-validation-panel.success{
  border:1px solid #9bd4b1;
  background:#edf9f1;
  color:#126b36;
}

.quiz-validation-panel.error{
  border:1px solid #efb1bb;
  background:#fff2f4;
  color:#a50019;
}

.quiz-runtime-preview{
  overflow:hidden;
  border:1px solid #e5e5e5;
  border-radius:18px;
  background:#fff;
}

.quiz-runtime-preview-head{
  padding:18px;
  border-bottom:1px solid #eee;
  background:#fafafa;
}

.quiz-runtime-preview-head h2{
  margin:10px 0 4px;
}

.quiz-runtime-preview-question{
  display:grid;
  grid-template-columns:40px minmax(0,1fr);
  gap:13px;
  padding:16px 18px;
  border-bottom:1px solid #eee;
}

.quiz-runtime-preview-index{
  display:grid;
  place-items:center;
  width:38px;
  height:38px;
  border-radius:11px;
  background:#ef233c;
  color:#fff;
  font-weight:900;
}

.quiz-runtime-preview-question h3{
  margin:8px 0 10px;
}

.quiz-runtime-preview-answers{
  display:grid;
  gap:6px;
}

.quiz-runtime-preview-answers>div{
  display:flex;
  align-items:center;
  gap:8px;
  padding:9px;
  border:1px solid #eee;
  border-radius:10px;
}

.quiz-runtime-preview-answers>div>span{
  display:grid;
  place-items:center;
  width:25px;
  height:25px;
  border-radius:7px;
  background:#f0f0f0;
  font-weight:900;
}

.quiz-preview-more{
  padding:12px 18px;
  text-align:center;
}

@media(max-width:900px){
  .quiz-builder-heading-side{
    align-items:stretch;
    flex-direction:column;
  }

  .quiz-wizard-nav{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .quiz-final-stats{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  .quiz-wizard-footer{
    align-items:stretch;
    flex-direction:column;
  }

  .quiz-import-export{
    width:100%;
  }
}

@media(max-width:600px){
  .quiz-wizard-nav,
  .quiz-final-stats{
    grid-template-columns:1fr;
  }

  .quiz-import-export{
    flex-direction:column;
  }

  .quiz-import-export .btn,
  .quiz-wizard-footer>.btn{
    width:100%;
  }
}


/* V15.3 — sekwencyjne odblokowywanie lekcji */
.lesson-nav-item.locked{
  opacity:.55;
  cursor:not-allowed;
  background:#f7f7f7;
}
.lesson-nav-item.locked:hover{
  transform:none;
  box-shadow:none;
}


/* V15.4 — materiał → quiz → ukończenie */
.lesson-required-quiz{margin-top:22px;padding-top:18px;border-top:2px solid #eee}
.lesson-stage{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:16px;padding:12px}
.lesson-stage-item{padding:12px;border-radius:12px;background:#f6f6f6;display:flex;justify-content:space-between;gap:8px}
.lesson-stage-item span{color:#777}.lesson-stage-item.done{background:#eaf8ef}.lesson-stage-item.done span{color:#158144}.lesson-stage-item.active{box-shadow:inset 0 0 0 2px #ef233c}.lesson-stage-item.locked{opacity:.55}
.lesson-material-section,.lesson-quiz-section{margin-bottom:22px}.lesson-quiz-section.locked{opacity:.75}
@media(max-width:760px){.lesson-stage{grid-template-columns:1fr}.lesson-stage-item{align-items:center}}


/* V15.5 — opcjonalny quiz i czytelniejsze akcje */
.lesson-quiz-option{
  display:flex;align-items:flex-start;gap:10px;margin:18px 0 10px;padding:14px 16px;
  border:1px solid #e5e7eb;border-radius:12px;background:#fff;cursor:pointer;
}
.lesson-quiz-option input{margin-top:3px}
.lesson-quiz-option span,.lesson-quiz-option strong,.lesson-quiz-option small{display:block}
.lesson-quiz-option small{margin-top:3px;color:#6b7280}
.icon-btn[title]{cursor:pointer}


/* V15.6 — ergonomia panelu administratora */
.lesson-quiz-choice{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  margin:18px 0 10px;
  padding:15px 16px;
  border:1px solid #e5e7eb;
  border-radius:14px;
  background:#fff;
}
.lesson-quiz-choice strong,.lesson-quiz-choice small{display:block}
.lesson-quiz-choice small{margin-top:4px;color:#6b7280;line-height:1.35}
.quiz-switch{display:flex;align-items:center;gap:10px;cursor:pointer;white-space:nowrap}
.quiz-switch input{position:absolute;opacity:0;pointer-events:none}
.quiz-switch-track{position:relative;width:48px;height:27px;border-radius:999px;background:#d1d5db;transition:.2s}
.quiz-switch-track span{position:absolute;top:4px;left:4px;width:19px;height:19px;border-radius:50%;background:#fff;box-shadow:0 2px 5px rgba(0,0,0,.2);transition:.2s}
.quiz-switch input:checked+.quiz-switch-track{background:#ef233c}
.quiz-switch input:checked+.quiz-switch-track span{transform:translateX(21px)}
.quiz-switch input:focus-visible+.quiz-switch-track{outline:3px solid rgba(239,35,60,.25);outline-offset:2px}
.quiz-switch-label{font-weight:800;font-size:12px}
.quiz-disabled-note{margin:10px 0 18px;padding:13px 15px;border:1px dashed #d1d5db;border-radius:12px;background:#fafafa;color:#6b7280}
.module-counts{display:inline-flex;margin-left:7px;padding:3px 7px;border-radius:999px;background:#fff;color:#6b7280;font-size:10px;font-weight:700}
.lesson-admin-summary{min-width:0;display:grid;gap:6px}
.lesson-admin-title{font-weight:700;overflow-wrap:anywhere}
.lesson-admin-badges{display:flex;flex-wrap:wrap;gap:5px}
.lesson-badge{display:inline-flex;align-items:center;padding:3px 7px;border-radius:999px;font-size:9px;font-weight:800;border:1px solid transparent}
.lesson-badge.video{background:#eef2ff;color:#4338ca}.lesson-badge.pdf{background:#fff1f2;color:#be123c}.lesson-badge.text{background:#eff6ff;color:#1d4ed8}.lesson-badge.checklist{background:#ecfdf5;color:#047857}.lesson-badge.notice{background:#fffbeb;color:#b45309}.lesson-badge.link{background:#f0fdfa;color:#0f766e}
.lesson-badge.quiz-on{background:#fff1f2;color:#be123c}.lesson-badge.quiz-off{background:#f3f4f6;color:#6b7280}.lesson-badge.required{background:#ecfdf5;color:#047857}.lesson-badge.optional{background:#f3f4f6;color:#6b7280}

/* Własne tooltipy — widoczne także tam, gdzie natywne title nie działało czytelnie. */
#view [data-tooltip]{position:relative}
#view [data-tooltip]::after{
  content:attr(data-tooltip);
  position:absolute;
  z-index:9999;
  left:50%;
  bottom:calc(100% + 8px);
  transform:translate(-50%,4px);
  max-width:220px;
  padding:7px 9px;
  border-radius:8px;
  background:#111;
  color:#fff;
  font-size:10px;
  font-weight:700;
  line-height:1.25;
  white-space:nowrap;
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:.15s;
  box-shadow:0 7px 18px rgba(0,0,0,.18);
}
#view [data-tooltip]::before{
  content:"";
  position:absolute;
  z-index:9999;
  left:50%;
  bottom:calc(100% + 3px);
  transform:translateX(-50%);
  border:5px solid transparent;
  border-top-color:#111;
  opacity:0;
  visibility:hidden;
  transition:.15s;
}
#view [data-tooltip]:hover::after,#view [data-tooltip]:focus-visible::after,#view [data-tooltip]:hover::before,#view [data-tooltip]:focus-visible::before{opacity:1;visibility:visible;transform:translate(-50%,0)}
#view [data-tooltip]:hover::before,#view [data-tooltip]:focus-visible::before{transform:translateX(-50%)}
@media(max-width:760px){.lesson-quiz-choice{align-items:flex-start;flex-direction:column}.quiz-switch{width:100%;justify-content:space-between}.tree-lesson{align-items:flex-start;gap:10px}.lesson-admin-badges{gap:4px}}


/* V15.7 — zarządzanie kursami */
.course-toolbar{display:grid;grid-template-columns:1fr;gap:8px;margin-bottom:12px;padding:10px;border:1px solid #eee;border-radius:14px;background:#fafafa}
.course-row.archived{opacity:.78;background:#f7f7f7;border-style:dashed}
.course-status{font-weight:800}
.course-status.published{color:#11823b}
.course-status.draft{color:#b36b00}
.course-status.archived{color:#666}
@media(min-width:560px){.course-toolbar{grid-template-columns:1fr 1fr}.course-toolbar #courseSearch{grid-column:1/-1}}

/* V15.8 — panel lekcji i czytelniejsze statystyki */
.course-card-stats{display:flex;flex-wrap:wrap;gap:6px;margin-top:7px}
.course-card-stats span{display:inline-flex;align-items:center;gap:3px;padding:4px 7px;border:1px solid #eee;border-radius:999px;background:#fafafa;font-size:11px;font-weight:800;color:#333}
.module-counts{font-size:11px;color:#6c6c73;font-weight:700;flex-wrap:wrap}
.lesson-editor-section{border:1px solid #ececf0;border-radius:14px;margin:0 0 12px;background:#fff;overflow:hidden}
.lesson-section-toggle{width:100%;border:0;background:#fafafa;padding:12px 14px;display:grid;grid-template-columns:1fr auto;align-items:center;text-align:left;cursor:pointer;color:#171717}
.lesson-section-toggle>span{display:flex;align-items:center;gap:9px;font-weight:900}
.lesson-section-toggle b{width:24px;height:24px;border-radius:8px;background:#ececf1;display:grid;place-items:center;font-size:12px}
.lesson-section-toggle small{grid-column:1/2;margin-left:33px;color:#76767d;font-size:11px;font-weight:500}
.lesson-section-toggle i{grid-column:2;grid-row:1/3;font-style:normal;font-size:17px}
.lesson-editor-section.open .lesson-section-toggle{background:#fff7f7}
.lesson-editor-section.open .lesson-section-toggle b{background:#f21f35;color:white}
.lesson-section-body{display:none;padding:14px}
.lesson-editor-section.open .lesson-section-body{display:block}
.quiz-choice-buttons{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;background:#f1f1f4;border-radius:12px;min-width:140px}
.quiz-choice-btn{border:0;border-radius:9px;padding:8px 16px;background:transparent;font-weight:900;cursor:pointer}
.quiz-choice-btn.active{background:#fff;box-shadow:0 2px 9px rgba(0,0,0,.1);color:#e60922}
.lesson-required-option{display:flex;align-items:center;gap:8px;padding:12px;border:1px solid #ececf0;border-radius:12px;margin-bottom:12px;font-weight:800}
.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
@media(max-width:900px){.lesson-section-toggle small{margin-left:0}.quiz-choice-buttons{min-width:120px}}


/* V15.9 — bezpieczny podgląd kursanta */
.course-preview-banner{
  position:sticky;
  top:0;
  z-index:30;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:14px;
  padding:12px 14px;
  border:1px solid #111;
  border-radius:14px;
  background:#111;
  color:#fff;
  box-shadow:0 10px 26px rgba(0,0,0,.16);
}

.course-preview-banner div{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.course-preview-banner span{
  color:rgba(255,255,255,.76);
  font-size:13px;
}

.course-preview-banner .btn{
  flex:0 0 auto;
}

.lesson-preview-note{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-bottom:12px;
  padding:10px 12px;
  border:1px dashed #ef233c;
  border-radius:12px;
  background:#fff5f6;
}

.lesson-preview-note span{
  color:#6f6f6f;
  font-size:13px;
}

.lesson-nav-item.locked:not(:disabled){
  cursor:pointer;
  opacity:.72;
}

.lesson-nav-item.locked:not(:disabled):hover{
  opacity:1;
  border-color:#ef233c;
  background:#fff5f6;
}

@media(max-width:760px){
  .course-preview-banner,
  .lesson-preview-note{
    align-items:stretch;
    flex-direction:column;
  }

  .course-preview-banner .btn{
    width:100%;
  }
}


/* V15.10 — czytelne zarządzanie kursami */
.course-manager-tools{
  display:grid;
  gap:10px;
  margin:10px 0 16px;
  padding:12px;
  border:1px solid #ececec;
  border-radius:14px;
  background:#fafafa;
}
.course-search-wrap{position:relative;display:flex;align-items:center}
.course-search-wrap .input{padding-left:38px;padding-right:38px;background:#fff;font-size:14px}
.course-search-icon{position:absolute;left:12px;z-index:2;pointer-events:none}
.course-search-clear{
  position:absolute;right:8px;width:28px;height:28px;border:0;border-radius:50%;
  background:#eee;cursor:pointer;font-size:20px;line-height:1
}
.course-search-clear:hover{background:#ddd}
.course-filter-label{font-size:12px;font-weight:800;text-transform:uppercase;color:#777;letter-spacing:.04em}
.course-status-tabs{display:flex;gap:6px;flex-wrap:wrap}
.course-status-tab{
  border:1px solid #ddd;background:#fff;border-radius:999px;padding:7px 11px;
  font-weight:700;font-size:12px;cursor:pointer
}
.course-status-tab:hover{border-color:#ef233c}
.course-status-tab.active{background:#111;border-color:#111;color:#fff}
.course-sort-wrap{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:800;color:#666}
.course-sort-wrap .input{flex:1;background:#fff}
.icon-btn.danger{color:#c1121f;border-color:#f3c4c9;background:#fff7f8}
.icon-btn.danger:hover{background:#c1121f;color:#fff;border-color:#c1121f}
.course-row.archived{border-style:dashed;background:#fafafa;opacity:.88}
.course-row.archived:hover{opacity:1}
@media(max-width:760px){
  .course-status-tabs{display:grid;grid-template-columns:repeat(2,1fr)}
  .course-status-tab{width:100%}
}


/* V15.12 — kosz i przywracanie */
.course-status.deleted{
  color:#a61b1b;
  background:#fff0f0;
  border-color:#ffb5b5;
}

.course-trash-panel{
  margin-top:14px;
  border-top:1px solid #ececec;
  padding-top:12px;
}

.course-trash-toggle{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border:1px solid #dedede;
  border-radius:12px;
  padding:10px 12px;
  background:#fafafa;
  font-weight:800;
  cursor:pointer;
}

.course-trash-toggle span{
  display:inline-grid;
  place-items:center;
  min-width:24px;
  height:24px;
  border-radius:999px;
  background:#111;
  color:#fff;
  font-size:12px;
}

.course-trash-content{
  margin-top:10px;
  padding:10px;
  border:1px dashed #d7d7d7;
  border-radius:12px;
  background:#fff;
}

.trash-group+ .trash-group{
  margin-top:14px;
}

.trash-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:8px 0;
  border-bottom:1px solid #f0f0f0;
}

.trash-row:last-child{
  border-bottom:0;
}

.trash-row small{
  color:#777;
}

.trash-row .icon-btn:disabled{
  opacity:.45;
  cursor:not-allowed;
}


/* V15.13 — modale systemowe zamiast okien przeglądarki */
.system-modal-overlay{
  position:fixed;inset:0;z-index:30000;display:grid;place-items:center;padding:20px;
  background:rgba(20,20,24,.58);backdrop-filter:blur(5px);
  opacity:0;transition:opacity .14s ease;
}
.system-modal-overlay.visible{opacity:1}
.system-modal-overlay.closing{opacity:0}
.system-modal{
  width:min(520px,100%);max-height:min(86vh,760px);overflow:auto;background:#fff;
  border:1px solid rgba(0,0,0,.08);border-radius:20px;box-shadow:0 24px 80px rgba(0,0,0,.28);
  transform:translateY(10px) scale(.985);transition:transform .16s ease;
}
.system-modal-overlay.visible .system-modal{transform:translateY(0) scale(1)}
.system-modal.danger{border-top:5px solid #e50922}
.system-modal-header{display:grid;grid-template-columns:46px 1fr 34px;gap:12px;align-items:start;padding:22px 22px 14px}
.system-modal-icon{width:46px;height:46px;display:grid;place-items:center;border-radius:14px;background:#fff1f3;font-size:22px}
.system-modal-header h3{margin:1px 0 6px;font-size:20px;line-height:1.2}
.system-modal-header p{margin:0;color:#676767;font-size:14px;line-height:1.55}
.system-modal-close{border:0;background:transparent;font-size:26px;line-height:1;color:#888;cursor:pointer;border-radius:8px}
.system-modal-close:hover{background:#f3f3f3;color:#111}
.system-modal-body{padding:4px 22px 18px}
.system-modal-label{display:block;margin:12px 0 7px;font-size:13px;font-weight:800}
.system-modal-field{width:100%;box-sizing:border-box;border:1px solid #dcdcdc;border-radius:12px;padding:11px 12px;background:#fff;font:inherit;outline:none}
.system-modal-field:focus{border-color:#ef233c;box-shadow:0 0 0 3px rgba(239,35,60,.12)}
textarea.system-modal-field{resize:vertical;min-height:110px}
.system-modal-error{margin-top:8px;padding:8px 10px;border-radius:9px;background:#fff0f1;color:#b00020;font-size:12px;font-weight:700}
.system-modal-actions{display:flex;justify-content:flex-end;gap:10px;padding:16px 22px 22px;border-top:1px solid #eee}
.system-modal-actions .btn{min-width:120px}
.btn-danger{background:#d90429;color:#fff;border-color:#d90429}
.btn-danger:hover{background:#b80322;border-color:#b80322}
@media(max-width:620px){
  .system-modal-overlay{padding:10px;align-items:end}
  .system-modal{width:100%;border-radius:20px 20px 10px 10px;max-height:92vh}
  .system-modal-actions{display:grid;grid-template-columns:1fr 1fr}
  .system-modal-actions .btn{min-width:0;width:100%}
}

.danger-outline{border-color:#ef233c!important;color:#c9182b!important;background:#fff!important}
.danger-outline:hover{background:#fff1f3!important}
.course-empty-state{grid-column:1/-1;text-align:center;min-height:220px;display:grid;place-content:center}


/* V16.2 — automatyczne ukończenie lekcji filmowej */
.lesson-next-ready{
  animation:lessonNextPulse 1.8s ease-in-out 2;
  box-shadow:0 0 0 4px rgba(239,35,60,.14);
}

@keyframes lessonNextPulse{
  0%,100%{transform:translateY(0)}
  50%{transform:translateY(-2px)}
}

.lesson-complete:disabled{
  cursor:not-allowed;
}


/* =========================================================
   CERTYFIKATY 1.0 — niezależny moduł
   ========================================================= */
.certificate-module{
  display:grid;
  gap:16px;
}

.certificate-tabs{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  padding:8px;
  border:1px solid #e6e6e6;
  border-radius:16px;
  background:#fff;
}

.certificate-tab{
  display:flex;
  align-items:center;
  gap:7px;
  border:0;
  border-radius:11px;
  padding:10px 14px;
  background:transparent;
  font-weight:800;
  cursor:pointer;
}

.certificate-tab:hover:not(:disabled){
  background:#f5f5f5;
}

.certificate-tab.active{
  background:#111;
  color:#fff;
}

.certificate-tab:disabled{
  opacity:.35;
  cursor:not-allowed;
}

.certificate-view{
  min-width:0;
}

.certificate-panel,
.certificate-preview-panel{
  display:grid;
  gap:14px;
}

.certificate-panel-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  flex-wrap:wrap;
}

.certificate-panel-head p{
  margin:7px 0 0;
}

.certificate-list{
  display:grid;
  gap:8px;
}

.certificate-list-row{
  display:grid;
  grid-template-columns:12px minmax(220px,1fr) 120px auto auto;
  align-items:center;
  gap:14px;
  padding:14px;
  border:1px solid #e8e8e8;
  border-radius:14px;
  background:#fff;
}

.certificate-status-dot{
  width:10px;
  height:10px;
  border-radius:50%;
  background:#1d9b55;
}

.certificate-status-dot.revoked{
  background:#d70012;
}

.certificate-list-main{
  display:grid;
  gap:3px;
}

.certificate-list-main span,
.certificate-list-main small{
  color:#6d6d6d;
}

.certificate-status{
  display:inline-flex;
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
  font-weight:800;
}

.certificate-status.active{
  background:#eaf8f0;
  color:#177a42;
}

.certificate-status.revoked{
  background:#fff0f1;
  color:#bd1426;
}

.certificate-row-actions,
.certificate-preview-actions,
.certificate-form-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.certificate-workspace{
  display:grid;
  grid-template-columns:minmax(260px,340px) minmax(0,1fr);
  gap:16px;
  align-items:start;
}

.certificate-workspace.generator{
  grid-template-columns:minmax(320px,430px) minmax(0,1fr);
}

.certificate-template-list,
.certificate-template-editor,
.certificate-generator-form,
.certificate-generator-preview{
  min-width:0;
}

.certificate-template-items{
  display:grid;
  gap:8px;
  margin-top:14px;
}

.certificate-template-item{
  display:flex;
  align-items:center;
  gap:10px;
  width:100%;
  text-align:left;
  border:1px solid #e4e4e4;
  border-radius:12px;
  padding:10px;
  background:#fff;
  cursor:pointer;
}

.certificate-template-item.active{
  border-color:#111;
  box-shadow:0 0 0 2px rgba(17,17,17,.08);
}

.certificate-template-item span:last-child{
  display:grid;
  gap:2px;
}

.certificate-template-item small{
  color:#777;
}

.template-color{
  width:24px;
  height:42px;
  border-radius:8px;
  flex:0 0 auto;
}

.certificate-form{
  display:grid;
  gap:13px;
  margin-top:14px;
}

.certificate-form label:not(.check){
  display:grid;
  gap:6px;
  font-weight:700;
}

.certificate-color-input{
  min-height:46px;
  padding:5px;
}

.certificate-sheet{
  position:relative;
  width:min(100%,980px);
  aspect-ratio:1.414 / 1;
  margin:16px auto 0;
  padding:18px;
  background:#f3efe8;
  color:var(--cert-accent,#111);
  box-shadow:0 18px 50px rgba(0,0,0,.12);
  overflow:hidden;
}

.certificate-frame{
  position:relative;
  height:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  border:4px solid var(--cert-primary,#d70012);
  padding:5%;
  background:
    linear-gradient(135deg,rgba(255,255,255,.94),rgba(255,255,255,.84)),
    repeating-linear-gradient(45deg,transparent 0 24px,rgba(0,0,0,.018) 24px 25px);
}

.certificate-frame::before,
.certificate-frame::after{
  content:"";
  position:absolute;
  width:54px;
  height:54px;
  border-color:var(--cert-primary,#d70012);
  border-style:solid;
}

.certificate-frame::before{
  left:16px;
  top:16px;
  border-width:3px 0 0 3px;
}

.certificate-frame::after{
  right:16px;
  bottom:16px;
  border-width:0 3px 3px 0;
}

.certificate-brand{
  position:absolute;
  top:6%;
  font-size:clamp(12px,1.4vw,20px);
  font-weight:900;
  letter-spacing:.12em;
  color:var(--cert-primary,#d70012);
}

.certificate-kicker{
  font-size:clamp(18px,2.5vw,38px);
  font-weight:950;
  letter-spacing:.08em;
}

.certificate-intro,
.certificate-completion{
  margin:12px 0 6px;
  color:#555;
}

.certificate-person{
  margin:8px 0;
  font-family:Georgia,serif;
  font-size:clamp(25px,4vw,58px);
  font-weight:500;
  color:var(--cert-primary,#d70012);
}

.certificate-course{
  max-width:80%;
  margin:8px 0;
  font-size:clamp(18px,2.4vw,36px);
}

.certificate-description{
  max-width:75%;
  color:#555;
}

.certificate-meta{
  display:flex;
  justify-content:center;
  flex-wrap:wrap;
  gap:20px;
  margin-top:22px;
  font-size:clamp(10px,1.1vw,15px);
}

.certificate-signatures{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:70px;
  width:72%;
  margin-top:30px;
  font-size:clamp(10px,1vw,14px);
}

.signature-line{
  border-top:1px solid #555;
  margin-bottom:6px;
}

.certificate-footer{
  position:absolute;
  bottom:4%;
  font-size:clamp(8px,.9vw,12px);
  color:#777;
}

.certificate-revoked-stamp{
  position:absolute;
  inset:42% auto auto 50%;
  transform:translate(-50%,-50%) rotate(-12deg);
  border:6px solid #d70012;
  padding:10px 18px;
  color:#d70012;
  font-size:clamp(24px,5vw,72px);
  font-weight:950;
  opacity:.72;
}

.certificate-settings-card{
  display:grid;
  gap:20px;
}

.certificate-settings-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}

.certificate-settings-grid>div{
  border:1px solid #e7e7e7;
  border-radius:13px;
  padding:14px;
}

.certificate-loader{
  width:34px;
  height:34px;
  margin:auto;
  border:4px solid #eee;
  border-top-color:#d70012;
  border-radius:50%;
  animation:certificateSpin .8s linear infinite;
}

@keyframes certificateSpin{
  to{transform:rotate(360deg)}
}

@media(max-width:900px){
  .certificate-workspace,
  .certificate-workspace.generator{
    grid-template-columns:1fr;
  }

  .certificate-list-row{
    grid-template-columns:10px 1fr auto;
  }

  .certificate-list-date,
  .certificate-status{
    grid-column:2;
  }

  .certificate-row-actions{
    grid-column:2/-1;
  }
}

@media(max-width:620px){
  .certificate-tabs{
    display:grid;
    grid-template-columns:1fr 1fr;
  }

  .certificate-tab{
    justify-content:center;
  }

  .certificate-settings-grid{
    grid-template-columns:1fr;
  }

  .certificate-sheet{
    padding:8px;
  }

  .certificate-frame{
    padding:4%;
  }

  .certificate-signatures{
    gap:18px;
    width:88%;
    margin-top:14px;
  }

  .certificate-description{
    display:none;
  }
}

@media print{
  body.printing-certificate *{
    visibility:hidden!important;
  }

  body.printing-certificate #certificatePrintArea,
  body.printing-certificate #certificatePrintArea *{
    visibility:visible!important;
  }

  body.printing-certificate #certificatePrintArea{
    position:absolute;
    inset:0;
    width:100%;
  }

  body.printing-certificate .certificate-sheet{
    width:100%;
    height:auto;
    margin:0;
    box-shadow:none;
    -webkit-print-color-adjust:exact;
    print-color-adjust:exact;
  }
}


/* CERTYFIKATY 2.0 */
.certificate-logo{position:absolute;top:4%;left:5%;max-width:120px;max-height:58px;object-fit:contain}
.certificate-bottom{display:grid;grid-template-columns:1fr auto auto;align-items:end;gap:24px;width:86%;margin-top:20px}
.certificate-bottom .certificate-signatures{width:100%;margin:0}
.signature-image{display:block;max-width:140px;max-height:58px;object-fit:contain;margin:0 auto 4px}
.certificate-qr{display:grid;justify-items:center;gap:2px}.certificate-qr img{width:72px;height:72px}.certificate-qr small{font-size:8px}
.certificate-seal{max-width:86px;max-height:86px;object-fit:contain}
.template-assets{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}
.template-asset{display:grid!important;gap:7px;border:1px solid #e5e5e5;border-radius:12px;padding:10px;background:#fafafa}
.template-asset img,.asset-placeholder{width:100%;height:74px;object-fit:contain;border-radius:8px;background:#fff;display:grid;place-items:center;color:#777}
.certificate-generator-wizard{max-width:1100px;margin:auto}
.wizard-steps{display:flex;justify-content:center;gap:70px;margin:10px 0 18px}
.wizard-steps span{display:grid;place-items:center;width:38px;height:38px;border-radius:50%;background:#eee;font-weight:900}
.wizard-steps span.active{background:#111;color:#fff;box-shadow:0 0 0 5px rgba(215,0,18,.12)}
.wizard-page{display:grid;gap:14px}.wizard-actions{display:flex;justify-content:space-between;margin-top:10px}
.certificate-automation-card{display:grid;gap:14px;max-width:800px}
.automation-actions{display:flex;gap:10px}.automation-results{border:1px dashed #ccc;border-radius:12px;padding:16px}
.eligible-users{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}.eligible-users span{padding:5px 8px;background:#f5f5f5;border-radius:999px;font-size:12px}
.public-verification-page{min-height:100vh;padding:32px;background:#f5f5f5}
.verification-result{max-width:1100px;margin:auto;background:#fff;border-radius:22px;padding:28px;text-align:center;box-shadow:0 20px 60px rgba(0,0,0,.08)}
.verification-logo{max-width:150px}.verification-icon{display:grid;place-items:center;width:80px;height:80px;border-radius:50%;margin:20px auto;font-size:48px;font-weight:900}
.verification-result.valid .verification-icon{background:#e7f8ee;color:#18894a}.verification-result.invalid .verification-icon{background:#fff0f1;color:#d70012}
.verification-result dl{display:grid;grid-template-columns:repeat(5,1fr);gap:8px;margin:24px 0}
.verification-result dl div{padding:12px;border:1px solid #e8e8e8;border-radius:12px}.verification-result dt{font-size:11px;color:#777}.verification-result dd{margin:4px 0 0;font-weight:800}
.public-certificate-watermark{position:absolute;right:15px;top:15px;font-size:8px;letter-spacing:.15em;color:#999}
@media(max-width:900px){.template-assets{grid-template-columns:1fr 1fr}.verification-result dl{grid-template-columns:1fr 1fr}.certificate-bottom{grid-template-columns:1fr}.certificate-qr,.certificate-seal{display:none}}

/* V16.5 — naprawa certyfikatów */
.certificate-sheet{background-color:#fff;background-size:cover!important;background-position:center!important;background-repeat:no-repeat!important}
.certificate-frame{background:transparent!important}
.certificate-qr-positioned{position:absolute!important;transform:translate(-50%,-50%);z-index:8;margin:0!important;display:grid;justify-items:center}
.certificate-qr-positioned img{width:100%!important;height:auto!important}
.qr-draggable{cursor:grab;touch-action:none;outline:2px dashed rgba(215,0,18,.45);outline-offset:4px}
.qr-draggable:active{cursor:grabbing}
.certificate-template-row{display:grid;grid-template-columns:1fr auto;align-items:center;gap:6px}
.certificate-template-row .certificate-template-item{min-width:0}
.qr-layout-controls{border:1px solid #e7e7e7;border-radius:13px;padding:12px;background:#fafafa}
.grid-3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
@media(max-width:700px){.grid-3{grid-template-columns:1fr}}

/* V16.6 — pełny edytor wizualny certyfikatu */
.certificate-designer-shell{display:grid;grid-template-columns:260px minmax(0,1fr);gap:14px;align-items:start}
.certificate-designer-main{min-width:0}.certificate-template-meta{margin-bottom:16px}
.certificate-designer-grid{display:grid;grid-template-columns:170px minmax(0,1fr) 230px;gap:12px;align-items:start}
.certificate-elements-list,.certificate-inspector{position:sticky;top:12px;display:grid;gap:7px;border:1px solid #e5e5e5;border-radius:13px;padding:12px;background:#fff}
.designer-element-button{border:1px solid #e7e7e7;background:#fafafa;border-radius:9px;padding:8px;text-align:left;cursor:pointer}.designer-element-button.active{background:#111;color:#fff;border-color:#111}
.designer-canvas{min-width:0;padding:10px;border-radius:14px;background:#f4f4f4;overflow:auto}
.certificate-layout-editor .certificate-frame{position:relative;overflow:hidden}
.certificate-element{position:absolute;transform:translate(-50%,-50%);z-index:5;line-height:1.15;color:var(--cert-accent);box-sizing:border-box;max-height:30%;overflow:visible}
.certificate-element-editable{cursor:move;border:1px dashed transparent;padding:3px;min-height:16px}.certificate-element-editable:hover{border-color:rgba(215,0,18,.45);background:rgba(255,255,255,.35)}.certificate-element-editable.selected{border:2px solid #e31324;background:rgba(255,255,255,.65);box-shadow:0 0 0 3px rgba(227,19,36,.12)}
.certificate-element-person{font-family:Georgia,serif;color:var(--cert-primary)}.certificate-element-headline,.certificate-element-course{font-weight:900}.certificate-element-organization{font-weight:900;letter-spacing:.1em;color:var(--cert-primary)}
.certificate-logo-free,.certificate-seal-free,.signature-image-free,.certificate-qr-free{width:100%;height:auto;max-height:100%;object-fit:contain}.certificate-element-qr small{display:block;font-size:7px}.certificate-element-signatureOne .signature-line,.certificate-element-signatureTwo .signature-line{border-top:1px solid #555;margin:12px 0 4px}
.certificate-inspector label{display:grid;gap:4px;font-size:12px;font-weight:700}.certificate-inspector output{font-size:11px;color:#666}.certificate-inspector input[type=range]{width:100%}.inspector-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px}
@media(max-width:1200px){.certificate-designer-shell{grid-template-columns:1fr}.certificate-designer-grid{grid-template-columns:150px minmax(0,1fr)}.certificate-inspector{grid-column:1/-1;position:static;grid-template-columns:repeat(3,1fr)}}
@media(max-width:760px){.certificate-designer-grid{grid-template-columns:1fr}.certificate-elements-list,.certificate-inspector{position:static}.certificate-elements-list{grid-template-columns:1fr 1fr}.certificate-inspector{grid-template-columns:1fr}}


/* V16.7 — stabilny wizualny edytor certyfikatów */
.certificate-free-layout{position:relative;overflow:hidden}
.certificate-design-element{position:absolute;transform:translate(-50%,-50%);z-index:3;box-sizing:border-box;line-height:1.18;color:var(--cert-accent,#111);overflow:visible}
.certificate-image-element img{display:block;max-width:100%;max-height:100%;object-fit:contain;margin:auto}
.certificate-logo-free{width:100%;height:auto}.certificate-brand-free{font-weight:900;letter-spacing:.12em;color:var(--cert-primary,#d70012)}
.certificate-kicker-free{font-weight:950;letter-spacing:.06em}.certificate-person-free{font-family:Georgia,serif;color:var(--cert-primary,#d70012)}
.certificate-course-free{font-weight:900}.certificate-signature-free .signature-line{margin:0 auto 5px}.signature-image-free{display:block;max-width:100%;max-height:48px;object-fit:contain;margin:0 auto 4px}
.certificate-seal-free{width:100%;height:auto}.certificate-qr-free{display:block;width:100%;height:auto}.certificate-design-element small{display:block;font-size:.65em;margin-top:2px}
.certificate-designer-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;border:1px solid #e6e6e6;border-radius:13px;padding:12px;background:#fafafa}
.designer-toolbar-actions{display:flex;gap:7px;flex-wrap:wrap}.certificate-designer-properties{border:1px solid #e4e4e4;border-radius:13px;padding:12px;background:#fff}
.designer-empty-selection,.designer-error{color:#777;text-align:center;padding:10px}.designer-error{color:#b00020;background:#fff2f3;border-radius:9px}
.designer-properties-head{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:10px}.designer-properties-head span{font-size:11px;color:#777}
.designer-properties-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;margin-top:8px}.designer-properties-grid label,.certificate-designer-properties>label{display:grid;gap:5px;font-weight:700;font-size:11px}
.designer-visible{display:flex!important;align-items:center;justify-content:center;flex-direction:row!important}
.certificate-designer-canvas .designer-draggable{cursor:move;border:1px dashed transparent;padding:2px;user-select:none;touch-action:none}
.certificate-designer-canvas .designer-draggable:hover{border-color:rgba(215,0,18,.45);background:rgba(255,255,255,.45)}
.certificate-designer-canvas .designer-selected{border:2px solid #1677ff!important;box-shadow:0 0 0 3px rgba(22,119,255,.15);background:rgba(255,255,255,.55)}
.certificate-designer-canvas.designer-grid .certificate-frame{background-image:linear-gradient(rgba(22,119,255,.08) 1px,transparent 1px),linear-gradient(90deg,rgba(22,119,255,.08) 1px,transparent 1px);background-size:5% 5%}
@media(max-width:1000px){.designer-properties-grid{grid-template-columns:repeat(3,1fr)}}
@media(max-width:620px){.designer-properties-grid{grid-template-columns:1fr 1fr}}


/* V16.8 — bezpośredni edytor certyfikatu */
.designer-empty-selection{
  display:grid;
  gap:5px;
}
.designer-empty-selection span{
  font-size:12px;
  color:#777;
}
.designer-properties-head>div{
  display:grid;
  gap:3px;
}
.designer-direct-text-label{
  display:grid;
  gap:5px;
  margin-bottom:10px;
  font-weight:800;
  font-size:12px;
}
.designer-quick-controls{
  display:grid;
  grid-template-columns:120px minmax(160px,1fr) minmax(200px,1.3fr) auto auto;
  align-items:end;
  gap:10px;
}
.designer-quick-controls>label:not(.designer-visible){
  display:grid;
  gap:5px;
  font-size:11px;
  font-weight:800;
}
.designer-color-control input[type="color"]{
  width:100%;
  min-height:42px;
  padding:4px;
  border:1px solid #ddd;
  border-radius:9px;
  background:#fff;
}
.designer-size-control{
  display:grid;
  grid-template-columns:1fr 48px;
  align-items:center;
  gap:7px;
  min-height:42px;
}
.designer-size-control output{
  text-align:center;
  font-weight:900;
}
.designer-format-buttons{
  display:flex;
  gap:4px;
}
.designer-format-button{
  min-width:38px;
  height:42px;
  border:1px solid #ddd;
  border-radius:9px;
  background:#fff;
  cursor:pointer;
  font-size:16px;
}
.designer-format-button:nth-child(3){text-align:left}
.designer-format-button:nth-child(4){text-align:center}
.designer-format-button:nth-child(5){text-align:right}
.designer-format-button.active{
  border-color:#111;
  background:#111;
  color:#fff;
}
.designer-advanced{
  margin-top:12px;
  border-top:1px solid #eee;
  padding-top:10px;
}
.designer-advanced summary{
  cursor:pointer;
  font-weight:800;
  font-size:12px;
}
.certificate-designer-canvas .designer-text-editing{
  cursor:text!important;
  outline:3px solid #ffb000!important;
  background:#fff!important;
  user-select:text!important;
  touch-action:auto!important;
  min-height:1.2em;
}
.certificate-designer-canvas .designer-text-editing::selection{
  background:rgba(255,176,0,.25);
}
.certificate-designer-canvas [data-cert-element]:focus{
  outline:none;
}
@media(max-width:1100px){
  .designer-quick-controls{
    grid-template-columns:1fr 1fr;
  }
}
@media(max-width:620px){
  .designer-quick-controls{
    grid-template-columns:1fr;
  }
}


/* V16.8.1 — stabilne przywracanie sesji bez migania formularza logowania */
.auth-loader{
  position:fixed;
  inset:0;
  z-index:100000;
  display:grid;
  place-items:center;
  padding:24px;
  background:
    radial-gradient(circle at 18% 15%,rgba(255,255,255,.18),transparent 26%),
    linear-gradient(135deg,#cf0016,#f22545);
  opacity:1;
  transition:opacity .18s ease;
}

.auth-loader.auth-loader-finished{
  opacity:0;
  pointer-events:none;
}

.auth-loader-card{
  display:grid;
  justify-items:center;
  gap:12px;
  width:min(92vw,360px);
  padding:30px 24px;
  border-radius:22px;
  background:rgba(255,255,255,.97);
  box-shadow:0 24px 80px rgba(75,0,8,.28);
  text-align:center;
}

.auth-loader-card img{
  width:min(190px,70%);
  max-height:90px;
  object-fit:contain;
}

.auth-loader-card strong{
  font-size:18px;
}

.auth-loader-card span{
  color:#777;
  font-size:13px;
}

.auth-loader-spinner{
  width:34px;
  height:34px;
  border:4px solid #f0d7da;
  border-top-color:#d70012;
  border-radius:50%;
  animation:authLoaderSpin .75s linear infinite;
}

@keyframes authLoaderSpin{
  to{transform:rotate(360deg)}
}

@media(prefers-reduced-motion:reduce){
  .auth-loader,
  .auth-loader-spinner{
    transition:none;
    animation-duration:1.5s;
  }
}


/* V16.8.3 — ponowne odtwarzanie ukończonego filmu */
.video-replay-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:5px;
  white-space:nowrap;
  font-weight:800;
}

.video-replay-btn:not(.hidden){
  border-color:rgba(255,255,255,.55);
  background:rgba(255,255,255,.12);
}

.video-replay-btn:not(.hidden):hover{
  background:rgba(255,255,255,.22);
}

@media(max-width:700px){
  .video-replay-btn{
    min-width:42px;
  }
  .video-replay-label{
    display:none;
  }
  .video-replay-icon{
    font-size:17px;
    line-height:1;
  }
}


/* V16.9 — Użytkownicy 2.0 */
.users-summary-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
  margin-bottom:12px;
}
.users-summary-card{
  display:grid;
  gap:5px;
}
.users-summary-card span{
  color:#777;
  font-size:12px;
}
.users-summary-card strong{
  font-size:28px;
}
.users-toolbar{
  display:grid;
  grid-template-columns:minmax(280px,1fr) 190px 180px 190px auto;
  gap:10px;
  align-items:center;
  margin-bottom:12px;
}
.users-search-wrap{
  position:relative;
}
.users-search-wrap>span{
  position:absolute;
  left:12px;
  top:50%;
  transform:translateY(-50%);
}
.users-search-wrap .input{
  padding-left:38px;
}
.users-table-card{
  padding:0;
  overflow:hidden;
}
.users-table-head{
  padding:18px;
  border-bottom:1px solid #eee;
}
.users-list{
  display:grid;
}
.user-row{
  display:grid;
  grid-template-columns:48px minmax(210px,1.5fr) 170px minmax(180px,1fr) 95px 110px auto;
  gap:14px;
  align-items:center;
  padding:14px 18px;
  border-bottom:1px solid #eee;
  transition:background .16s ease;
}
.user-row:hover{
  background:#fafafa;
}
.user-avatar{
  display:grid;
  place-items:center;
  width:44px;
  height:44px;
  border-radius:50%;
  background:#fff0f1;
  color:#d70012;
  font-weight:900;
}
.user-primary{
  display:grid;
  gap:3px;
  min-width:0;
}
.user-primary span,
.user-primary small{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.user-primary span{
  color:#555;
}
.user-primary small{
  color:#999;
}
.user-role-badge,
.user-status{
  display:inline-flex;
  width:max-content;
  align-items:center;
  border-radius:999px;
  padding:6px 9px;
  font-size:11px;
  font-weight:800;
}
.user-role-badge{
  background:#f1f1f1;
}
.role-admin{background:#111;color:#fff}
.role-opiekun{background:#fff0d7;color:#8a5400}
.role-instruktor{background:#eef5ff;color:#245da7}
.role-kursant{background:#f0f8f2;color:#23743b}
.user-status.active{background:#e9f8ef;color:#168246}
.user-status.blocked{background:#fff0f1;color:#c90015}
.user-progress-cell{
  display:grid;
  gap:5px;
}
.user-progress-label{
  display:flex;
  justify-content:space-between;
  font-size:11px;
}
.user-progress-cell small{
  color:#888;
}
.user-stat-mini{
  display:grid;
  text-align:center;
}
.user-stat-mini strong{
  font-size:19px;
}
.user-stat-mini span{
  color:#888;
  font-size:10px;
}
.users-back-button{
  margin-bottom:12px;
}
.user-profile-layout{
  display:grid;
  grid-template-columns:280px minmax(0,1fr);
  gap:14px;
  align-items:start;
}
.user-profile-side{
  position:sticky;
  top:16px;
  display:grid;
  justify-items:center;
  gap:10px;
  text-align:center;
}
.user-avatar-large{
  width:88px;
  height:88px;
  font-size:28px;
}
.user-profile-side h2,
.user-profile-side p{
  margin:0;
}
.user-profile-metrics{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:7px;
  width:100%;
  margin-top:10px;
}
.user-profile-metrics div{
  display:grid;
  padding:10px 5px;
  border:1px solid #eee;
  border-radius:12px;
}
.user-profile-metrics strong{
  font-size:19px;
}
.user-profile-metrics span{
  color:#888;
  font-size:10px;
}
.user-profile-main{
  display:grid;
  gap:14px;
}
.users-section-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-bottom:12px;
}
.user-edit-form{
  display:grid;
  gap:14px;
}
.user-edit-form label{
  display:grid;
  gap:6px;
  font-size:12px;
  font-weight:800;
}
.user-card-progress{
  height:12px;
}
.user-progress-items{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
}
.user-progress-items span{
  padding:6px 9px;
  border-radius:999px;
  background:#f4f4f4;
  font-size:11px;
}
.user-progress-items span.completed{
  background:#e9f8ef;
  color:#168246;
}
.user-certificates-list{
  display:grid;
  gap:8px;
}
.user-certificates-list article{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:11px;
  border:1px solid #eee;
  border-radius:12px;
}
.user-certificates-list article>div{
  display:grid;
  gap:3px;
}
.user-certificates-list span,
.user-certificates-list small{
  color:#777;
}
.user-system-info{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}
.user-system-info div{
  padding:10px;
  border:1px solid #eee;
  border-radius:10px;
}
.user-system-info dt{
  color:#888;
  font-size:10px;
}
.user-system-info dd{
  margin:4px 0 0;
  word-break:break-word;
  font-weight:700;
}
@media(max-width:1200px){
  .users-toolbar{
    grid-template-columns:1fr 1fr 1fr;
  }
  .users-search-wrap{
    grid-column:1/-1;
  }
  .user-row{
    grid-template-columns:48px minmax(180px,1fr) 150px minmax(160px,1fr) auto;
  }
  .user-stat-mini,
  .user-row>.user-status{
    display:none;
  }
}
@media(max-width:800px){
  .users-summary-grid{
    grid-template-columns:1fr 1fr;
  }
  .users-toolbar{
    grid-template-columns:1fr;
  }
  .users-search-wrap{
    grid-column:auto;
  }
  .user-row{
    grid-template-columns:44px 1fr auto;
  }
  .user-row>div:nth-child(n+3):not(.user-primary),
  .user-row>.user-progress-cell{
    display:none;
  }
  .user-profile-layout{
    grid-template-columns:1fr;
  }
  .user-profile-side{
    position:static;
  }
  .user-system-info{
    grid-template-columns:1fr;
  }
}


/* V16.9.1 — Sprint UX Użytkownicy */
.users-page-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
  margin-bottom:14px;
}
.users-page-head h2,
.users-page-head p{
  margin:0;
}
.users-summary-card{
  display:flex;
  align-items:center;
  gap:12px;
}
.users-summary-card>div{
  display:grid;
  gap:2px;
}
.users-summary-icon{
  display:grid;
  place-items:center;
  width:44px;
  height:44px;
  border-radius:13px;
  background:#fff0f1;
  font-size:20px;
}
.user-row-card{
  grid-template-columns:48px minmax(250px,1.25fr) minmax(250px,1fr) minmax(260px,1fr) auto 38px;
  min-height:102px;
  cursor:pointer;
}
.user-row-card:focus{
  outline:2px solid #d70012;
  outline-offset:-2px;
}
.user-name-line{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:7px;
}
.user-row-metrics{
  display:grid;
  grid-template-columns:90px minmax(150px,1fr);
  gap:10px;
}
.user-row-metrics>div{
  display:grid;
  align-content:center;
  gap:2px;
  padding:9px 10px;
  border:1px solid #eee;
  border-radius:11px;
  background:#fafafa;
}
.user-row-metrics strong{
  font-size:13px;
  overflow:hidden;
  text-overflow:ellipsis;
}
.user-row-metrics span{
  color:#888;
  font-size:10px;
}
.user-action-menu-wrap{
  position:relative;
}
.user-action-trigger{
  display:grid;
  place-items:center;
  width:34px;
  height:34px;
  border:1px solid #ddd;
  border-radius:10px;
  background:#fff;
  cursor:pointer;
  font-size:19px;
}
.user-action-menu{
  position:absolute;
  right:0;
  top:40px;
  z-index:50;
  display:none;
  min-width:190px;
  padding:6px;
  border:1px solid #ddd;
  border-radius:12px;
  background:#fff;
  box-shadow:0 18px 45px rgba(0,0,0,.13);
}
.user-action-menu.open{
  display:grid;
}
.user-action-menu button{
  border:0;
  border-radius:8px;
  padding:10px;
  background:transparent;
  text-align:left;
  cursor:pointer;
}
.user-action-menu button:hover{
  background:#f5f5f5;
}
.user-action-menu button.danger{
  color:#c90015;
}
.user-card-topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:12px;
}
.user-profile-tabs{
  display:flex;
  gap:5px;
  padding:6px;
  border:1px solid #e8e8e8;
  border-radius:14px;
  background:#fff;
  overflow-x:auto;
}
.user-profile-tabs button{
  flex:0 0 auto;
  border:0;
  border-radius:10px;
  padding:10px 13px;
  background:transparent;
  cursor:pointer;
  font-weight:800;
}
.user-profile-tabs button.active{
  background:#111;
  color:#fff;
}
.user-overview-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}
.user-overview-wide{
  grid-column:1/-1;
}
.user-overview-progress-number{
  margin:16px 0 8px;
  font-size:40px;
  font-weight:900;
}
.user-overview-date{
  margin:16px 0 8px;
  font-size:19px;
  font-weight:900;
}
.user-permissions-note{
  padding:12px;
  border:1px solid #ffe0a3;
  border-radius:11px;
  background:#fff9e9;
  color:#765100;
  font-size:12px;
}
.user-history-note{
  margin-top:14px;
}
.user-progress-list{
  margin-top:12px;
}
@media(max-width:1250px){
  .user-row-card{
    grid-template-columns:48px minmax(220px,1fr) minmax(220px,1fr) auto 38px;
  }
  .user-row-metrics{
    display:none;
  }
}
@media(max-width:850px){
  .users-page-head{
    align-items:stretch;
    flex-direction:column;
  }
  .user-row-card{
    grid-template-columns:44px 1fr auto 36px;
  }
  .user-row-card .user-progress-cell{
    display:none;
  }
  .user-overview-grid{
    grid-template-columns:1fr;
  }
  .user-overview-wide{
    grid-column:auto;
  }
}


/* =========================================================
   V17.0 — CRM UŻYTKOWNIKÓW
   ========================================================= */
.crm-users-shell{
  display:grid;
  grid-template-columns:340px minmax(0,1fr);
  min-height:calc(100vh - 155px);
  border:1px solid #e6e6e6;
  border-radius:18px;
  overflow:hidden;
  background:#fff;
}

.crm-user-list-pane{
  display:flex;
  min-width:0;
  flex-direction:column;
  border-right:1px solid #e8e8e8;
  background:#fafafa;
}

.crm-list-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:18px;
  border-bottom:1px solid #e8e8e8;
  background:#fff;
}

.crm-list-head h2{
  margin:0;
  font-size:20px;
}

.crm-list-head span{
  color:#888;
  font-size:11px;
}

.crm-search-box{
  position:relative;
  padding:12px 14px 8px;
}

.crm-search-box>span{
  position:absolute;
  left:27px;
  top:50%;
  transform:translateY(-40%);
}

.crm-search-box .input{
  padding-left:38px;
  background:#fff;
}

.crm-quick-filters{
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  gap:5px;
  padding:0 14px 8px;
}

.crm-quick-filters button{
  border:1px solid #ddd;
  border-radius:9px;
  padding:8px 5px;
  background:#fff;
  cursor:pointer;
  font-size:11px;
  font-weight:800;
}

.crm-quick-filters button.active{
  border-color:#111;
  background:#111;
  color:#fff;
}

.crm-role-filter{
  width:calc(100% - 28px);
  margin:0 14px 10px;
  background:#fff;
}

.crm-user-list{
  display:grid;
  align-content:start;
  gap:4px;
  padding:0 8px 12px;
  overflow:auto;
}

.crm-user-item{
  display:grid;
  grid-template-columns:46px minmax(0,1fr) auto;
  gap:10px;
  align-items:center;
  width:100%;
  border:1px solid transparent;
  border-radius:13px;
  padding:10px;
  background:transparent;
  text-align:left;
  cursor:pointer;
  transition:.16s ease;
}

.crm-user-item:hover{
  background:#fff;
  border-color:#e5e5e5;
}

.crm-user-item.selected{
  border-color:#111;
  background:#fff;
  box-shadow:0 5px 16px rgba(0,0,0,.06);
}

.crm-avatar{
  display:grid;
  place-items:center;
  width:44px;
  height:44px;
  border-radius:50%;
  background:hsl(var(--avatar-hue),70%,92%);
  color:hsl(var(--avatar-hue),60%,32%);
  font-weight:900;
}

.crm-user-copy{
  display:grid;
  min-width:0;
  gap:2px;
}

.crm-user-copy strong,
.crm-user-copy span{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.crm-user-copy small{
  color:#555;
  font-size:10px;
  font-weight:800;
}

.crm-user-copy span{
  color:#888;
  font-size:11px;
}

.crm-user-side{
  display:grid;
  justify-items:end;
  gap:8px;
}

.crm-user-percent{
  font-size:11px;
  font-weight:900;
}

.crm-status-dot{
  width:9px;
  height:9px;
  border-radius:50%;
}

.crm-status-dot.active{background:#1a9a52}
.crm-status-dot.blocked{background:#d70012}

.crm-empty-list{
  padding:30px 16px;
  text-align:center;
  color:#888;
}

.crm-detail-pane{
  position:relative;
  min-width:0;
  background:#fff;
}

.crm-detail-empty{
  display:grid;
  place-items:center;
  text-align:center;
}

.crm-detail-empty>div>span{
  font-size:60px;
}

.crm-profile-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
  padding:24px 26px;
  border-bottom:1px solid #e8e8e8;
}

.crm-profile-identity{
  display:flex;
  align-items:center;
  min-width:0;
  gap:16px;
}

.crm-avatar-large{
  width:72px;
  height:72px;
  flex:0 0 auto;
  font-size:23px;
}

.crm-profile-identity h2{
  margin:0 0 4px;
  font-size:25px;
}

.crm-profile-identity>div>span{
  color:#777;
}

.crm-profile-badges{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin-top:9px;
}

.crm-profile-quick-stats{
  display:grid;
  grid-template-columns:90px 90px minmax(150px,1fr);
  gap:8px;
  min-width:360px;
}

.crm-profile-quick-stats>div{
  display:grid;
  align-content:center;
  gap:2px;
  min-height:65px;
  padding:9px 10px;
  border:1px solid #e9e9e9;
  border-radius:12px;
  background:#fafafa;
}

.crm-profile-quick-stats strong{
  overflow:hidden;
  font-size:15px;
  text-overflow:ellipsis;
}

.crm-profile-quick-stats span{
  color:#888;
  font-size:10px;
}

.crm-profile-tabs{
  display:flex;
  gap:6px;
  padding:10px 18px;
  border-bottom:1px solid #e8e8e8;
  background:#fcfcfc;
  overflow-x:auto;
}

.crm-profile-tabs button{
  display:grid;
  justify-items:center;
  gap:3px;
  min-width:76px;
  border:0;
  border-radius:11px;
  padding:8px 10px;
  background:transparent;
  cursor:pointer;
}

.crm-profile-tabs button>span{
  font-size:18px;
}

.crm-profile-tabs button small{
  font-size:9px;
  font-weight:800;
}

.crm-profile-tabs button.active{
  background:#111;
  color:#fff;
}

.crm-detail-content{
  padding:20px;
}

.crm-overview-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}

.crm-metric-card,
.crm-panel-card{
  border:1px solid #e8e8e8;
  border-radius:15px;
  padding:18px;
  background:#fff;
}

.crm-metric-card{
  display:grid;
  align-content:start;
  gap:8px;
  min-height:155px;
}

.crm-metric-card>span{
  color:#777;
  font-size:12px;
  font-weight:800;
}

.crm-metric-card>strong{
  font-size:34px;
}

.crm-metric-card>small{
  color:#888;
}

.crm-date-value{
  font-size:18px!important;
}

.crm-wide{
  grid-column:1/-1;
}

.crm-section-title{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
  margin-bottom:14px;
}

.crm-section-title h3{
  margin:0;
}

.crm-section-title span{
  color:#888;
  font-size:11px;
}

.crm-activity-list,
.crm-training-list,
.crm-certificates-list{
  display:grid;
  gap:8px;
}

.crm-activity-list>div,
.crm-training-list>div,
.crm-certificates-list>article{
  display:flex;
  align-items:center;
  gap:10px;
  padding:11px;
  border:1px solid #eee;
  border-radius:11px;
}

.crm-activity-list>div>span{
  color:#148147;
  font-weight:900;
}

.crm-training-list>div{
  display:grid;
  grid-template-columns:24px minmax(0,1fr) auto;
}

.crm-training-list>div.completed{
  border-color:#d5efdf;
  background:#f2fbf6;
}

.crm-training-list small{
  color:#888;
}

.crm-certificates-list>article{
  justify-content:space-between;
}

.crm-certificates-list article>div{
  display:grid;
  gap:2px;
}

.crm-certificates-list article span,
.crm-certificates-list article small{
  color:#777;
}

.crm-form{
  display:grid;
  gap:14px;
}

.crm-form label{
  display:grid;
  gap:6px;
  font-size:12px;
  font-weight:800;
}

.crm-warning-box{
  padding:12px;
  border:1px solid #ffe0a3;
  border-radius:11px;
  background:#fff9e9;
  color:#735000;
  font-size:12px;
}

.crm-large-progress{
  height:13px;
}

.crm-timeline{
  position:relative;
  display:grid;
  gap:0;
  padding-left:12px;
}

.crm-timeline::before{
  content:"";
  position:absolute;
  left:18px;
  top:7px;
  bottom:7px;
  width:2px;
  background:#e7e7e7;
}

.crm-timeline-item{
  position:relative;
  display:grid;
  grid-template-columns:22px minmax(0,1fr);
  gap:10px;
  padding:0 0 18px;
}

.crm-timeline-dot{
  position:relative;
  z-index:1;
  width:14px;
  height:14px;
  margin-top:2px;
  border:3px solid #fff;
  border-radius:50%;
  box-shadow:0 0 0 1px #ddd;
}

.crm-timeline-dot.login{background:#2c6dcc}
.crm-timeline-dot.lesson{background:#1a9a52}

.crm-timeline-item>div{
  display:grid;
  gap:2px;
}

.crm-timeline-item small{
  color:#888;
}

.crm-mobile-close{
  display:none;
}

@media(max-width:1100px){
  .crm-users-shell{
    grid-template-columns:290px minmax(0,1fr);
  }

  .crm-profile-header{
    align-items:flex-start;
    flex-direction:column;
  }

  .crm-profile-quick-stats{
    width:100%;
    min-width:0;
  }

  .crm-overview-grid{
    grid-template-columns:1fr 1fr;
  }

  .crm-wide{
    grid-column:1/-1;
  }
}

@media(max-width:780px){
  .crm-users-shell{
    display:block;
    min-height:auto;
    overflow:visible;
    border:0;
    background:transparent;
  }

  .crm-user-list-pane{
    min-height:calc(100vh - 165px);
    border:1px solid #e5e5e5;
    border-radius:16px;
  }

  .crm-detail-pane{
    position:fixed;
    inset:0;
    z-index:9000;
    display:none;
    overflow:auto;
    background:#fff;
  }

  .crm-detail-pane.mobile-open{
    display:block;
  }

  .crm-mobile-close{
    position:fixed;
    right:14px;
    top:14px;
    z-index:2;
    display:grid;
    place-items:center;
    width:38px;
    height:38px;
    border:0;
    border-radius:50%;
    background:#111;
    color:#fff;
    font-size:24px;
  }

  .crm-profile-header{
    padding-top:66px;
  }

  .crm-profile-quick-stats{
    grid-template-columns:1fr 1fr;
  }

  .crm-profile-quick-stats>div:last-child{
    grid-column:1/-1;
  }

  .crm-overview-grid{
    grid-template-columns:1fr;
  }

  .crm-wide{
    grid-column:auto;
  }

  .crm-detail-content{
    padding:14px;
  }
}


/* V17.1 — CRM UX Polish */
.crm-overview-polished .crm-quick-actions-card{grid-column:1/-1}
.crm-course-cards{display:grid;gap:12px}
.crm-course-cards.compact{grid-template-columns:repeat(2,minmax(0,1fr))}
.crm-course-card{border:1px solid #e7e7e7;border-radius:14px;padding:14px;background:#fff}
.crm-course-card-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:10px}
.crm-course-card-head>div{display:grid;gap:3px}
.crm-course-card-head span{color:#777;font-size:11px}
.crm-course-card-head b{font-size:20px}
.crm-text-link,.crm-inline-link{border:0;background:transparent;color:#b90012;font-weight:800;cursor:pointer;padding:9px 0 0;text-align:left}
.crm-course-details{padding:0;overflow:hidden}
.crm-course-details>summary{list-style:none;cursor:pointer;padding:14px}
.crm-course-details>summary::-webkit-details-marker{display:none}
.crm-course-detail-body{display:grid;gap:13px;padding:0 14px 14px;border-top:1px solid #eee}
.crm-course-module h4{margin:13px 0 7px}
.crm-readable-lesson{display:grid;grid-template-columns:20px 1fr;gap:8px;padding:7px 9px;border-radius:9px;background:#f6f6f6}
.crm-readable-lesson.completed{background:#edf9f2;color:#167a43}
.crm-readonly-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.crm-readonly-grid>div{display:grid;gap:4px;padding:14px;border:1px solid #e8e8e8;border-radius:12px;background:#fafafa}
.crm-readonly-grid span{color:#777;font-size:11px}
.crm-certificate-cards{display:grid;gap:10px}
.crm-certificate-card{display:grid;grid-template-columns:52px minmax(0,1fr) auto auto;align-items:center;gap:12px;padding:13px;border:1px solid #e7e7e7;border-radius:13px}
.crm-certificate-icon{display:grid;place-items:center;width:48px;height:48px;border-radius:12px;background:#fff3f4;font-size:23px}
.crm-certificate-card>div:nth-child(2){display:grid;gap:3px}
.crm-certificate-card span,.crm-certificate-card small{color:#777}
.crm-quick-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.crm-quick-actions button{border:1px solid #e2e2e2;border-radius:11px;padding:12px;background:#fafafa;cursor:pointer;font-weight:800;text-align:left}
.crm-quick-actions button:hover{border-color:#111;background:#fff}
.crm-event-subtitle{color:#666;font-size:11px}
.crm-inline-link{padding-top:3px;font-size:11px}
@media(max-width:1050px){
  .crm-course-cards.compact{grid-template-columns:1fr}
  .crm-quick-actions{grid-template-columns:1fr 1fr}
}
@media(max-width:680px){
  .crm-readonly-grid{grid-template-columns:1fr}
  .crm-certificate-card{grid-template-columns:48px 1fr}
  .crm-certificate-card>.certificate-status,.crm-certificate-card>.btn{grid-column:2}
  .crm-quick-actions{grid-template-columns:1fr}
}


/* V17.2 — Integracja Kursy ↔ Certyfikaty */
.course-certificate-settings{
  display:grid;
  gap:13px;
  margin-bottom:16px;
  padding:14px;
  border:1px solid #ead7d9;
  border-radius:14px;
  background:#fffafb;
}
.course-certificate-settings-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
}
.course-certificate-settings-head>div{
  display:grid;
  gap:3px;
}
.course-certificate-settings-head span{
  color:#777;
  font-size:11px;
}
.course-certificate-state{
  border-radius:999px;
  padding:6px 9px;
  font-size:11px!important;
  font-weight:900;
}
.course-certificate-state.enabled{
  background:#e8f8ef;
  color:#167a43!important;
}
.course-certificate-state.disabled{
  background:#f0f0f0;
  color:#777!important;
}
.course-certificate-settings-form{
  display:grid;
  gap:10px;
}
.course-certificate-settings-form>label:not(.check){
  display:grid;
  gap:5px;
  font-size:12px;
  font-weight:800;
}
.course-certificate-panel{
  display:grid;
  grid-template-columns:54px minmax(0,1fr) auto;
  align-items:center;
  gap:14px;
  margin-bottom:14px;
}
.course-certificate-panel-icon{
  display:grid;
  place-items:center;
  width:52px;
  height:52px;
  border-radius:14px;
  background:#fff0f1;
  font-size:26px;
}
.course-certificate-panel>div:nth-child(2){
  display:grid;
  gap:3px;
}
.course-certificate-panel span,
.course-certificate-panel small{
  color:#777;
}
.course-certificate-panel.earned{
  border-color:#cdebd9;
  background:#f6fcf8;
}
.course-certificate-panel.ready{
  border-color:#f0d48d;
  background:#fffaf0;
}
.course-certificate-panel.pending{
  border-color:#e5e5e5;
}
.course-certificate-panel-actions{
  display:flex!important;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:8px;
}
@media(max-width:760px){
  .course-certificate-panel{
    grid-template-columns:48px 1fr;
  }
  .course-certificate-panel-actions,
  .course-certificate-panel>button,
  .course-certificate-panel>.certificate-status{
    grid-column:2;
    justify-content:flex-start;
  }
}


/* V17.2.1 — Certyfikaty UX Polish */
.course-certificate-settings{padding:0;overflow:hidden}
.course-certificate-settings>summary{list-style:none;cursor:pointer;padding:14px}
.course-certificate-settings>summary::-webkit-details-marker{display:none}
.course-certificate-summary-side{display:flex;align-items:center;gap:10px}
.course-certificate-chevron{font-size:20px;transition:transform .2s ease}
.course-certificate-settings[open] .course-certificate-chevron{transform:rotate(180deg)}
.course-certificate-settings-body{display:grid;gap:14px;padding:0 14px 14px;border-top:1px solid #ead7d9}
.course-certificate-kpi-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding-top:14px}
.course-certificate-kpi-grid article{display:grid;gap:4px;padding:11px;border:1px solid #eee;border-radius:11px;background:#fff}
.course-certificate-kpi-grid span{color:#777;font-size:10px}
.course-certificate-kpi-grid strong{font-size:15px}
.course-certificate-main-grid{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(220px,.6fr);gap:14px}
.course-certificate-requirements{display:grid;gap:8px;margin:0;padding:12px;border:1px solid #eee;border-radius:11px}
.course-certificate-requirements legend{padding:0 5px;font-weight:900;font-size:12px}
.course-certificate-template-card{display:grid;align-content:start;gap:10px;padding:12px;border:1px solid #eee;border-radius:13px;background:#fff}
.course-certificate-template-preview{display:grid;place-items:center;min-height:150px;border:1px dashed #ddd;border-radius:10px;overflow:hidden;background:#fafafa}
.course-certificate-template-preview img{width:100%;height:160px;object-fit:contain}
.course-certificate-template-placeholder{font-size:44px}
.course-certificate-template-card>div:nth-child(2){display:grid;gap:3px}
.course-certificate-template-card span{color:#777;font-size:10px}
.course-certificate-template-actions{display:grid;gap:7px}
.course-cert-preview-modal{position:fixed;inset:0;z-index:10000;display:grid;place-items:center;padding:24px}
.course-cert-preview-modal.hidden{display:none}
.course-cert-preview-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.55)}
.course-cert-preview-window{position:relative;z-index:1;width:min(900px,95vw);padding:20px;border-radius:18px;background:#fff;box-shadow:0 30px 90px rgba(0,0,0,.3)}
.course-cert-preview-close{position:absolute;right:10px;top:10px;width:36px;height:36px;border:0;border-radius:50%;background:#111;color:#fff;font-size:23px;cursor:pointer}
.course-cert-preview-sheet{display:grid;justify-items:center;align-content:center;gap:11px;aspect-ratio:1.414/1;padding:8%;border:2px solid #d70012;background:#fff center/cover no-repeat;text-align:center}
.course-cert-preview-sheet h2,.course-cert-preview-sheet h3,.course-cert-preview-sheet p{margin:0}
.course-cert-preview-sheet>strong{font-family:Georgia,serif;font-size:34px;color:#d70012}
.course-cert-preview-brand{font-weight:900;letter-spacing:2px;color:#d70012}
.course-cert-preview-window>p{text-align:center;color:#777;font-size:11px}
@media(max-width:900px){
  .course-certificate-main-grid{grid-template-columns:1fr}
}
@media(max-width:650px){
  .course-certificate-kpi-grid{grid-template-columns:1fr}
  .course-cert-preview-window{padding:12px}
  .course-cert-preview-sheet>strong{font-size:24px}
}


/* V17.2.2 — Dopracowanie konfiguracji certyfikatu */
.course-cert-list-badge{
  display:inline-flex;
  align-items:center;
  margin-left:6px;
  padding:3px 7px;
  border-radius:999px;
  font-size:9px;
  font-weight:900;
}
.course-cert-list-badge.enabled{background:#e8f8ef;color:#167a43}
.course-cert-list-badge.disabled{background:#f0f0f0;color:#777}

.course-certificate-config-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(300px,.9fr);
  gap:12px;
}

.course-certificate-config-card{
  display:grid;
  align-content:start;
  gap:13px;
  padding:14px;
  border:1px solid #e8e8e8;
  border-radius:14px;
  background:#fff;
}

.course-certificate-config-card-head{
  display:flex;
  align-items:flex-start;
  gap:10px;
}

.course-certificate-config-card-head>span{
  display:grid;
  place-items:center;
  width:28px;
  height:28px;
  flex:0 0 auto;
  border-radius:9px;
  background:#111;
  color:#fff;
  font-size:12px;
  font-weight:900;
}

.course-certificate-config-card-head>div{
  display:grid;
  gap:3px;
}

.course-certificate-config-card-head small{
  color:#777;
  line-height:1.35;
}

.course-certificate-switch-row,
.course-certificate-number-row{
  display:flex!important;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  padding:11px;
  border:1px solid #eee;
  border-radius:11px;
  background:#fafafa;
  cursor:pointer;
}

.course-certificate-switch-row.locked{
  background:#f4f4f4;
  cursor:default;
}

.course-certificate-switch-row>span,
.course-certificate-number-row>span{
  display:grid;
  gap:3px;
}

.course-certificate-switch-row small,
.course-certificate-number-row small{
  color:#777;
  font-weight:400;
  line-height:1.3;
}

.course-certificate-switch-row input[type="checkbox"]{
  width:42px;
  height:23px;
  flex:0 0 auto;
  appearance:none;
  border-radius:999px;
  background:#ccc;
  cursor:pointer;
  position:relative;
  transition:.18s ease;
}

.course-certificate-switch-row input[type="checkbox"]::after{
  content:"";
  position:absolute;
  width:17px;
  height:17px;
  left:3px;
  top:3px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 1px 4px rgba(0,0,0,.22);
  transition:.18s ease;
}

.course-certificate-switch-row input[type="checkbox"]:checked{
  background:#d70012;
}

.course-certificate-switch-row input[type="checkbox"]:checked::after{
  transform:translateX(19px);
}

.course-certificate-switch-row input[type="checkbox"]:disabled{
  opacity:.55;
  cursor:not-allowed;
}

.course-certificate-condition-list{
  display:grid;
  gap:8px;
}

.course-certificate-number-row>div{
  display:flex;
  align-items:center;
  gap:7px;
  width:94px;
}

.course-certificate-number-row .input{
  width:70px;
  text-align:center;
}

.course-certificate-template-section{
  grid-row:span 1;
}

.course-certificate-template-large-preview{
  display:grid;
  place-items:center;
  min-height:250px;
  border:1px dashed #d6d6d6;
  border-radius:12px;
  overflow:hidden;
  background:#fafafa;
}

.course-certificate-template-large-preview img{
  width:100%;
  height:280px;
  object-fit:contain;
  background:#fff;
}

.course-certificate-template-name{
  display:grid;
  gap:3px;
}

.course-certificate-template-name span{
  color:#777;
  font-size:10px;
}

.course-certificate-template-actions{
  display:grid;
  grid-template-columns:1fr;
  gap:7px;
}

.course-certificate-save-bar{
  grid-column:1/-1;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:15px;
  padding:13px 14px;
  border:1px solid #ead7d9;
  border-radius:13px;
  background:#fff6f7;
}

.course-certificate-save-bar>div{
  display:grid;
  gap:3px;
}

.course-certificate-save-bar span{
  color:#777;
  font-size:11px;
}

@media(max-width:1250px){
  .course-certificate-config-grid{
    grid-template-columns:1fr 1fr;
  }
  .course-certificate-template-section{
    grid-column:1/-1;
  }
}

@media(max-width:760px){
  .course-certificate-config-grid{
    grid-template-columns:1fr;
  }
  .course-certificate-template-section{
    grid-column:auto;
  }
  .course-certificate-save-bar{
    flex-direction:column;
    align-items:stretch;
  }
  .course-certificate-template-large-preview{
    min-height:190px;
  }
  .course-certificate-template-large-preview img{
    height:210px;
  }
}


/* V17.3 — Certyfikat jako wysuwany kreator */
.course-certificate-compact-card{
  display:grid;
  grid-template-columns:54px minmax(0,1fr) auto auto;
  align-items:center;
  gap:14px;
  margin-bottom:16px;
  padding:14px;
  border:1px solid #ead7d9;
  border-radius:14px;
  background:#fffafb;
}

.course-certificate-compact-icon{
  display:grid;
  place-items:center;
  width:52px;
  height:52px;
  border-radius:14px;
  background:#fff0f1;
  font-size:25px;
}

.course-certificate-compact-copy{
  min-width:0;
}

.course-certificate-compact-copy>div{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
}

.course-certificate-compact-copy p{
  margin:4px 0 0;
  color:#777;
  font-size:11px;
}

.course-certificate-compact-kpis{
  display:flex;
  align-items:center;
  gap:8px;
}

.course-certificate-compact-kpis>div{
  display:grid;
  gap:2px;
  min-width:90px;
  padding:9px 10px;
  border:1px solid #eee;
  border-radius:11px;
  background:#fff;
}

.course-certificate-compact-kpis strong{
  font-size:13px;
}

.course-certificate-compact-kpis span{
  color:#888;
  font-size:9px;
}

.course-certificate-drawer{
  position:fixed;
  inset:0;
  z-index:12000;
  visibility:hidden;
  pointer-events:none;
}

.course-certificate-drawer.open{
  visibility:visible;
  pointer-events:auto;
}

.course-certificate-drawer-backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.48);
  opacity:0;
  transition:opacity .22s ease;
}

.course-certificate-drawer.open .course-certificate-drawer-backdrop{
  opacity:1;
}

.course-certificate-drawer-panel{
  position:absolute;
  right:0;
  top:0;
  bottom:0;
  display:grid;
  grid-template-rows:auto auto minmax(0,1fr);
  width:min(780px,94vw);
  background:#fff;
  box-shadow:-22px 0 65px rgba(0,0,0,.2);
  transform:translateX(100%);
  transition:transform .24s ease;
}

.course-certificate-drawer.open .course-certificate-drawer-panel{
  transform:translateX(0);
}

body.course-certificate-drawer-open{
  overflow:hidden;
}

.course-certificate-drawer-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:18px;
  padding:22px 24px 18px;
  border-bottom:1px solid #e9e9e9;
}

.course-certificate-drawer-header h2{
  margin:5px 0 3px;
}

.course-certificate-drawer-header p{
  margin:0;
  color:#777;
  font-size:12px;
}

.course-certificate-drawer-close{
  display:grid;
  place-items:center;
  width:38px;
  height:38px;
  flex:0 0 auto;
  border:0;
  border-radius:50%;
  background:#111;
  color:#fff;
  cursor:pointer;
  font-size:24px;
}

.course-certificate-drawer-tabs{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:6px;
  padding:10px 18px;
  border-bottom:1px solid #e9e9e9;
  background:#fafafa;
}

.course-certificate-drawer-tabs button{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  border:0;
  border-radius:10px;
  padding:10px;
  background:transparent;
  cursor:pointer;
}

.course-certificate-drawer-tabs button.active{
  background:#111;
  color:#fff;
}

.course-certificate-drawer-form{
  display:grid;
  grid-template-rows:minmax(0,1fr) auto;
  min-height:0;
}

.course-certificate-drawer-content{
  min-height:0;
  padding:20px;
  overflow:auto;
}

.course-cert-tab-panel{
  display:none;
}

.course-cert-tab-panel.active{
  display:grid;
  gap:14px;
}

.course-certificate-drawer-section{
  display:grid;
  gap:13px;
}

.course-certificate-drawer-section h3{
  margin:0;
}

.course-certificate-template-drawer-preview{
  display:grid;
  place-items:center;
  min-height:390px;
  border:1px dashed #d6d6d6;
  border-radius:14px;
  overflow:hidden;
  background:#fafafa;
}

.course-certificate-template-drawer-preview img{
  width:100%;
  height:430px;
  object-fit:contain;
  background:#fff;
}

.course-certificate-drawer-footer{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  padding:14px 18px;
  border-top:1px solid #e9e9e9;
  background:#fff;
  box-shadow:0 -8px 22px rgba(0,0,0,.04);
}

.course-certificate-drawer-footer>div:first-child{
  display:grid;
  gap:2px;
}

.course-certificate-drawer-footer span{
  color:#777;
  font-size:10px;
}

.course-certificate-drawer-footer>div:last-child{
  display:flex;
  gap:8px;
}

@media(max-width:920px){
  .course-certificate-compact-card{
    grid-template-columns:52px minmax(0,1fr) auto;
  }

  .course-certificate-compact-kpis{
    grid-column:2/-1;
    justify-content:flex-start;
  }
}

@media(max-width:650px){
  .course-certificate-compact-card{
    grid-template-columns:48px 1fr;
  }

  .course-certificate-compact-kpis,
  .course-certificate-compact-card>.btn{
    grid-column:1/-1;
  }

  .course-certificate-compact-kpis{
    display:grid;
    grid-template-columns:1fr 1fr;
  }

  .course-certificate-drawer-panel{
    width:100vw;
  }

  .course-certificate-drawer-header{
    padding:18px 16px 14px;
  }

  .course-certificate-drawer-tabs{
    padding:8px;
  }

  .course-certificate-drawer-tabs strong{
    display:none;
  }

  .course-certificate-drawer-tabs button span{
    font-size:20px;
  }

  .course-certificate-drawer-content{
    padding:14px;
  }

  .course-certificate-template-drawer-preview{
    min-height:240px;
  }

  .course-certificate-template-drawer-preview img{
    height:280px;
  }

  .course-certificate-drawer-footer{
    align-items:stretch;
    flex-direction:column;
  }

  .course-certificate-drawer-footer>div:last-child{
    display:grid;
    grid-template-columns:1fr 1fr;
  }
}


/* V17.4 — Silnik warunków certyfikacji */
.course-certificate-requirements-panel{align-items:flex-start}
.course-certificate-condition-statuses{display:flex;flex-wrap:wrap;gap:7px;margin-top:7px}
.course-certificate-condition-statuses span{display:inline-flex;align-items:center;padding:5px 8px;border-radius:999px;font-size:10px;font-weight:900}
.course-certificate-condition-statuses .passed{background:#e8f8ef;color:#167a43}
.course-certificate-condition-statuses .missing{background:#fff0f1;color:#b90012}
.course-certificate-missing-list{display:grid;gap:4px;margin:8px 0 0;padding-left:18px;color:#a10010;font-size:11px}


/* =========================================================
   V17.4.1 — RESPONSYWNOŚĆ PANELU ADMINISTRATORA
   ========================================================= */

/* Kolumny mogą się faktycznie kurczyć — bez wypychania strony. */
.admin-workspace,
.admin-card,
.admin-card *,
.course-certificate-compact-card,
.course-certificate-compact-card *{
  min-width:0;
  box-sizing:border-box;
}

/* Typowy laptop 1536 / 1440: 2 kolumny zamiast 3 zbyt wąskich. */
@media(max-width:1600px){
  .admin-workspace{
    grid-template-columns:minmax(300px,.82fr) minmax(430px,1.18fr) !important;
    gap:12px !important;
  }
  .admin-workspace>.admin-card:nth-child(3){
    grid-column:1/-1;
    min-height:auto;
  }

  .course-certificate-compact-card{
    grid-template-columns:48px minmax(0,1fr) !important;
    gap:10px !important;
  }
  .course-certificate-compact-kpis{
    grid-column:1/-1 !important;
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    width:100%;
  }
  .course-certificate-compact-card>.btn{
    grid-column:1/-1 !important;
    width:100%;
  }
  .course-certificate-compact-copy p,
  .course-certificate-compact-kpis strong{
    overflow-wrap:anywhere;
  }
}

/* Mniejsze laptopy / zoom 110–125%. */
@media(max-width:1280px){
  .app{
    grid-template-columns:220px minmax(0,1fr) !important;
  }
  .sidebar{
    padding-left:10px !important;
    padding-right:10px !important;
  }
  .admin-workspace{
    grid-template-columns:1fr !important;
  }
  .admin-workspace>.admin-card{
    grid-column:1 !important;
    min-height:auto !important;
  }
  .admin-card{
    padding:12px !important;
  }
  .admin-card-head{
    align-items:flex-start;
    flex-wrap:wrap;
  }
}

/* Tablet / mały notebook. */
@media(max-width:900px){
  .app{
    grid-template-columns:1fr !important;
  }
  .sidebar{
    position:relative !important;
    height:auto !important;
  }
  .side-bottom{
    position:static !important;
    margin-top:16px;
  }
  .admin-workspace{
    grid-template-columns:1fr !important;
  }
}

/* Pola formularzy nie mogą rozszerzać kolumn. */
.admin-workspace input,
.admin-workspace select,
.admin-workspace textarea,
.admin-workspace button{
  max-width:100%;
}

.admin-workspace select,
.admin-workspace input,
.admin-workspace textarea{
  min-width:0;
}

/* Długie nazwy kursów i modułów nie rozwalają siatki. */
.course-row,
.course-row *,
.tree-module,
.tree-module *,
.tree-lesson,
.tree-lesson *{
  min-width:0;
}
.course-row strong,
.tree-module-title,
.lesson-admin-title{
  overflow-wrap:anywhere;
}

/* Drawer certyfikatu pozostaje w viewport. */
@media(max-width:1600px){
  .course-certificate-drawer-panel{
    width:min(760px,94vw) !important;
  }
}
@media(max-width:720px){
  .course-certificate-drawer-panel{
    width:100vw !important;
  }
}

/* Ostateczny bezpiecznik — brak poziomego rozjeżdżania strony. */
html,body{max-width:100%;overflow-x:hidden}
.main,#view{min-width:0;max-width:100%;overflow-x:hidden}


/* =========================================================
   V17.5.0 — SYSTEM-WIDE RESPONSIVE + MOBILE
   ========================================================= */

:root{
  --mobile-nav-height:72px;
  --safe-bottom:env(safe-area-inset-bottom,0px);
}

html{
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
}

body{
  min-width:0;
}

button,
a,
input,
select,
textarea{
  -webkit-tap-highlight-color:transparent;
}

button,
.btn,
.icon-btn,
.nav button,
.mobile-nav button{
  touch-action:manipulation;
}

/* ---- Globalna elastyczność ---- */
#app,
.content,
#view,
.card,
.grid,
.layout,
.form-grid,
.table-wrap,
.certificate-module,
.certificate-view,
.certificate-panel,
.certificate-workspace,
.lesson-shell,
.crm-users-shell,
.admin-workspace{
  min-width:0;
  max-width:100%;
}

.card,
.course,
.lesson,
.block,
.course-row,
.tree-module,
.certificate-list-row,
.crm-panel-card{
  overflow-wrap:anywhere;
}

.input,
select,
textarea{
  min-width:0;
  max-width:100%;
}

/* ---- Desktop / średni laptop ---- */
@media(max-width:1500px){
  .content{
    padding:24px 22px 84px;
  }

  .grid-3{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .grid-3 > .course:last-child:nth-child(odd){
    grid-column:auto;
  }

  .topbar h1{
    font-size:27px;
  }

  .certificate-list-row{
    grid-template-columns:minmax(170px,1.4fr) minmax(120px,.8fr) auto !important;
  }

  .certificate-row-actions{
    grid-column:1/-1;
    justify-content:flex-end;
  }

  .certificate-workspace{
    grid-template-columns:minmax(180px,.34fr) minmax(0,1fr) !important;
  }
}

/* ---- Mały laptop / duży zoom ---- */
@media(max-width:1180px){
  .app{
    grid-template-columns:220px minmax(0,1fr);
  }

  .content{
    padding:20px 18px 84px;
  }

  .grid-3,
  .grid-2{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .layout{
    grid-template-columns:1fr;
  }

  .layout > *{
    min-width:0;
  }

  .certificate-tabs{
    overflow-x:auto;
    overscroll-behavior-x:contain;
    scrollbar-width:thin;
  }

  .certificate-tab{
    flex:0 0 auto;
    white-space:nowrap;
  }

  .certificate-workspace{
    grid-template-columns:1fr !important;
  }

  .certificate-template-list{
    position:static !important;
  }

  .certificate-template-items{
    display:flex !important;
    gap:8px;
    overflow-x:auto;
    padding-bottom:4px;
  }

  .certificate-template-row{
    min-width:210px;
    flex:0 0 auto;
  }

  .certificate-template-editor{
    min-width:0;
  }

  .certificate-designer-grid,
  .certificate-designer-shell{
    min-width:0;
  }

  .certificate-sheet{
    max-width:100%;
  }

  .lesson-shell{
    grid-template-columns:240px minmax(0,1fr);
  }

  .crm-users-shell{
    grid-template-columns:280px minmax(0,1fr);
  }
}

/* ---- Tablet / mobilny tryb aplikacji ---- */
@media(max-width:960px){
  body{
    background:#f6f6f7;
  }

  .app{
    display:block;
    min-height:100dvh;
  }

  .sidebar{
    display:none !important;
  }

  .content{
    width:100%;
    padding:14px 12px calc(var(--mobile-nav-height) + 22px + var(--safe-bottom));
  }

  .topbar{
    position:sticky;
    top:0;
    z-index:16;
    margin:-14px -12px 14px;
    padding:12px 14px;
    background:rgba(248,248,248,.95);
    border-bottom:1px solid var(--line);
    backdrop-filter:blur(14px);
  }

  .topbar h1{
    max-width:60vw;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:22px;
  }

  .user-chip{
    max-width:42vw;
    padding:6px 8px;
  }

  .user-chip span{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:12px;
  }

  .avatar{
    width:30px;
    height:30px;
    flex:0 0 auto;
  }

  .grid-3,
  .grid-2,
  .layout,
  .form-grid{
    grid-template-columns:1fr !important;
  }

  .span-2{
    grid-column:auto !important;
  }

  .card{
    border-radius:17px;
    padding:16px;
  }

  .metric{
    font-size:30px;
  }

  .section-title{
    margin:20px 0 11px;
    align-items:flex-start;
    flex-direction:column;
  }

  .brush-title{
    max-width:100%;
    padding:8px 13px;
    font-size:13px;
  }

  .toolbar,
  .preview-bar,
  .lesson-actions,
  .wizard-actions,
  .automation-actions{
    display:grid !important;
    grid-template-columns:1fr 1fr;
    width:100%;
  }

  .toolbar > *,
  .preview-bar > *,
  .lesson-actions > *,
  .wizard-actions > *,
  .automation-actions > *{
    width:100%;
  }

  .mobile-nav{
    display:grid !important;
    grid-template-columns:repeat(5,1fr);
    position:fixed;
    left:0;
    right:0;
    bottom:0;
    z-index:9000;
    min-height:var(--mobile-nav-height);
    padding:6px 6px calc(6px + var(--safe-bottom));
    border-top:1px solid #ddd;
    background:rgba(255,255,255,.97);
    box-shadow:0 -10px 30px rgba(0,0,0,.07);
    backdrop-filter:blur(16px);
  }

  .mobile-nav button{
    display:grid;
    place-items:center;
    align-content:center;
    gap:3px;
    min-height:54px;
    padding:5px 2px;
    border:0;
    border-radius:12px;
    background:transparent;
    color:#555;
    font-weight:850;
  }

  .mobile-nav button span{
    font-size:20px;
    line-height:1;
  }

  .mobile-nav button small{
    font-size:9px;
    line-height:1;
  }

  .mobile-nav button.active{
    background:var(--soft);
    color:var(--red);
  }

  /* Kursy */
  .course{
    border-radius:18px;
  }

  .cover{
    height:132px;
    padding:15px;
    font-size:19px;
  }

  .course-body{
    padding:14px;
  }

  /* Lekcja */
  .lesson-shell{
    display:block;
  }

  .lesson-sidebar{
    position:static;
    max-height:none;
    margin-bottom:12px;
  }

  .lesson-sidebar h3{
    display:none;
  }

  .lesson-nav-module{
    margin-bottom:7px;
  }

  .lesson-main .video{
    min-height:0 !important;
  }

  .video,
  .custom-video-player{
    border-radius:14px;
  }

  .video-controls{
    flex-wrap:wrap;
  }

  .video-volume{
    display:none;
  }

  /* Certyfikaty */
  .certificate-panel-head{
    align-items:flex-start !important;
    flex-direction:column;
    gap:10px;
  }

  .certificate-panel-head > div:last-child,
  .certificate-panel-head > button{
    width:100%;
  }

  .certificate-panel-head .btn{
    width:100%;
  }

  .certificate-list-row{
    display:grid !important;
    grid-template-columns:20px minmax(0,1fr) auto !important;
    gap:9px !important;
    align-items:start !important;
  }

  .certificate-list-main{
    min-width:0;
  }

  .certificate-list-row > div:nth-of-type(2){
    grid-column:2;
  }

  .certificate-list-row > .certificate-status{
    grid-column:3;
    grid-row:1;
  }

  .certificate-row-actions{
    grid-column:2/-1 !important;
    display:grid !important;
    grid-template-columns:1fr 1fr;
    justify-content:stretch !important;
  }

  .certificate-row-actions .icon-btn{
    width:100%;
    text-align:center;
  }

  .certificate-workspace{
    display:block !important;
  }

  .certificate-template-list{
    margin-bottom:12px;
  }

  .certificate-template-items{
    display:flex !important;
    overflow-x:auto;
    gap:8px;
  }

  .certificate-template-row{
    min-width:190px;
  }

  .certificate-designer-toolbar{
    align-items:stretch !important;
    flex-direction:column;
  }

  .designer-toolbar-actions{
    display:grid !important;
    grid-template-columns:1fr 1fr;
  }

  .certificate-designer-properties,
  .designer-properties-grid,
  .template-assets{
    grid-template-columns:1fr 1fr !important;
  }

  .certificate-sheet{
    transform-origin:top left;
  }

  .certificate-generator-wizard,
  .certificate-form{
    min-width:0;
  }

  /* Admin */
  .admin-workspace{
    display:grid !important;
    grid-template-columns:1fr !important;
  }

  .admin-card{
    grid-column:1 !important;
    min-height:0 !important;
  }

  .admin-card-head{
    flex-wrap:wrap;
    align-items:flex-start;
  }

  .type-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .tree-module-head,
  .tree-lesson,
  .course-row-top{
    align-items:flex-start;
  }

  .tree-actions{
    justify-content:flex-start;
  }

  .course-certificate-compact-card{
    grid-template-columns:48px minmax(0,1fr) !important;
  }

  .course-certificate-compact-kpis,
  .course-certificate-compact-card > .btn{
    grid-column:1/-1 !important;
  }

  /* CRM */
  .crm-users-shell{
    display:block;
    min-height:0;
    border:0;
    background:transparent;
  }

  .crm-user-list-pane{
    border:1px solid var(--line);
    border-radius:16px;
    overflow:hidden;
  }

  .crm-detail-pane{
    position:fixed;
    inset:0;
    z-index:10000;
    display:none;
    overflow:auto;
    background:#fff;
  }

  .crm-detail-pane.mobile-open{
    display:block;
  }

  .crm-profile-header{
    padding:64px 16px 16px;
  }

  .crm-profile-tabs{
    position:sticky;
    top:0;
    z-index:4;
    padding:8px;
    background:#fff;
  }

  .crm-detail-content{
    padding:12px;
  }

  /* Tabele */
  .table-wrap{
    margin-left:-2px;
    margin-right:-2px;
    border-radius:12px;
  }

  .table{
    min-width:720px;
  }
}

/* ---- Telefon ---- */
@media(max-width:620px){
  .content{
    padding-left:9px;
    padding-right:9px;
  }

  .topbar{
    margin-left:-9px;
    margin-right:-9px;
    padding-left:11px;
    padding-right:11px;
  }

  .topbar h1{
    font-size:19px;
  }

  .user-chip span{
    display:none;
  }

  .card{
    padding:13px;
    border-radius:15px;
  }

  .btn,
  .input,
  select,
  textarea{
    min-height:44px;
  }

  .toolbar,
  .preview-bar,
  .lesson-actions,
  .wizard-actions,
  .automation-actions,
  .designer-toolbar-actions{
    grid-template-columns:1fr !important;
  }

  .type-grid{
    grid-template-columns:1fr 1fr;
  }

  .certificate-tabs{
    gap:4px !important;
  }

  .certificate-tab{
    padding:8px 10px !important;
  }

  .certificate-tab span{
    display:block;
  }

  .certificate-row-actions{
    grid-template-columns:1fr !important;
  }

  .certificate-designer-properties,
  .designer-properties-grid,
  .template-assets{
    grid-template-columns:1fr !important;
  }

  .certificate-template-row{
    min-width:165px;
  }

  .certificate-sheet{
    font-size:85%;
  }

  .course-certificate-drawer-panel{
    width:100vw !important;
    max-width:100vw !important;
  }

  .course-certificate-drawer-tabs strong{
    display:none;
  }

  .course-certificate-drawer-tabs button span{
    font-size:20px;
  }

  .course-certificate-drawer-footer{
    padding-bottom:calc(10px + var(--safe-bottom));
  }

  .crm-profile-quick-stats{
    grid-template-columns:1fr 1fr !important;
  }

  .crm-overview-grid{
    grid-template-columns:1fr !important;
  }

  .crm-readonly-grid{
    grid-template-columns:1fr !important;
  }

  .crm-quick-actions{
    grid-template-columns:1fr !important;
  }
}

/* ---- Panel "Więcej" na urządzeniach mobilnych ---- */
.mobile-more-sheet{
  position:fixed;
  inset:0;
  z-index:11000;
}

.mobile-more-backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.45);
}

.mobile-more-panel{
  position:absolute;
  left:8px;
  right:8px;
  bottom:calc(var(--mobile-nav-height) + 8px + var(--safe-bottom));
  max-height:min(70dvh,560px);
  overflow:auto;
  padding:10px 12px 12px;
  border:1px solid rgba(0,0,0,.08);
  border-radius:22px;
  background:#fff;
  box-shadow:0 24px 70px rgba(0,0,0,.2);
}

.mobile-more-handle{
  width:42px;
  height:4px;
  margin:0 auto 10px;
  border-radius:999px;
  background:#ddd;
}

.mobile-more-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:4px 4px 12px;
}

.mobile-more-header > div{
  display:grid;
  gap:3px;
}

.mobile-more-header span{
  color:#777;
  font-size:11px;
}

.mobile-more-close{
  display:grid;
  place-items:center;
  width:38px;
  height:38px;
  flex:0 0 auto;
  border:0;
  border-radius:50%;
  background:#111;
  color:#fff;
  font-size:24px;
}

.mobile-admin-nav{
  display:grid;
  gap:7px;
  padding:6px 0 10px;
  border-top:1px solid #eee;
}

.mobile-admin-nav button,
.mobile-more-logout{
  display:flex;
  align-items:center;
  gap:11px;
  width:100%;
  min-height:50px;
  padding:10px 12px;
  border:1px solid #eee;
  border-radius:13px;
  background:#fafafa;
  text-align:left;
  font-weight:850;
}

.mobile-admin-nav button.active{
  border-color:#ffd1d5;
  background:var(--soft);
  color:var(--red);
}

.mobile-more-logout{
  color:#a8000e;
  background:#fff4f5;
}

body.mobile-sheet-open{
  overflow:hidden;
}

@media(min-width:961px){
  .mobile-more-sheet{
    display:none !important;
  }
}

/* ---- Safe areas i orientacja pozioma telefonu ---- */
@media(max-width:960px) and (orientation:landscape) and (max-height:600px){
  .mobile-nav{
    min-height:58px;
    padding-top:3px;
    padding-bottom:calc(3px + var(--safe-bottom));
  }

  .mobile-nav button{
    min-height:44px;
  }

  .mobile-nav button span{
    font-size:17px;
  }

  .mobile-more-panel{
    max-height:62dvh;
  }

  .topbar{
    padding-top:8px;
    padding-bottom:8px;
  }
}

/* ---- Dostępność dotykowa ---- */
@media(pointer:coarse){
  .btn,
  .icon-btn,
  .nav button,
  .lesson-nav-item,
  .type-tile,
  .certificate-tab{
    min-height:44px;
  }

  input[type="checkbox"],
  input[type="radio"]{
    min-width:20px;
    min-height:20px;
  }
}


/* =========================================================
   V17.5.1 — HOTFIX RESPONSIVE
   Naprawa ściskania treści przy zoomie 125–150%
   ========================================================= */

/*
  Poprzednia wersja próbowała utrzymać 3 kolumny zbyt długo.
  Przy zoomie przeglądarki 140% viewport CSS ma znacznie mniej
  pikseli, dlatego struktura kursu była ściskana do kilkudziesięciu px.
*/

/* Nigdy nie pozwalaj dzieciom głównego panelu admina wyjść poza kolumnę. */
.admin-workspace > *,
.admin-grid > *,
.admin-layout > *,
.admin-columns > *,
.admin-panel-grid > *{
  min-width:0 !important;
  width:auto !important;
  max-width:100% !important;
}

/* Certyfikat: tekst ma dostać realną szerokość, a KPI i przycisk mogą zejść niżej. */
.course-certificate-compact-card{
  min-width:0 !important;
}

.course-certificate-compact-copy{
  min-width:0 !important;
  width:100% !important;
}

.course-certificate-compact-copy strong,
.course-certificate-compact-copy p{
  word-break:normal !important;
  overflow-wrap:break-word !important;
  hyphens:none !important;
}

.course-certificate-compact-kpis{
  min-width:0 !important;
}

.course-certificate-compact-kpis > div{
  min-width:0 !important;
}

/* Już poniżej 1500 CSS px przechodzimy na 2 kolumny.
   To obejmuje typowe 1920px przy zoomie 125–140%. */
@media(max-width:1500px){
  .admin-workspace,
  .admin-grid,
  .admin-layout,
  .admin-columns,
  .admin-panel-grid{
    grid-template-columns:minmax(310px,.82fr) minmax(430px,1.18fr) !important;
    gap:12px !important;
    align-items:start !important;
  }

  .admin-workspace > :nth-child(3),
  .admin-grid > :nth-child(3),
  .admin-layout > :nth-child(3),
  .admin-columns > :nth-child(3),
  .admin-panel-grid > :nth-child(3){
    grid-column:1/-1 !important;
  }

  .course-certificate-compact-card{
    grid-template-columns:50px minmax(220px,1fr) !important;
    align-items:center !important;
  }

  .course-certificate-compact-kpis{
    grid-column:1/-1 !important;
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    width:100% !important;
  }

  .course-certificate-compact-card > .btn{
    grid-column:1/-1 !important;
    width:100% !important;
  }
}

/* Poniżej 1150 CSS px panel administratora jest jednokolumnowy.
   Nie próbujemy już ściskać dwóch rozbudowanych edytorów obok siebie. */
@media(max-width:1150px){
  .admin-workspace,
  .admin-grid,
  .admin-layout,
  .admin-columns,
  .admin-panel-grid{
    grid-template-columns:minmax(0,1fr) !important;
  }

  .admin-workspace > *,
  .admin-grid > *,
  .admin-layout > *,
  .admin-columns > *,
  .admin-panel-grid > *{
    grid-column:1 !important;
  }

  .course-certificate-compact-card{
    grid-template-columns:52px minmax(0,1fr) auto !important;
  }

  .course-certificate-compact-kpis{
    grid-column:2/-1 !important;
  }

  .course-certificate-compact-card > .btn{
    grid-column:1/-1 !important;
  }
}

/* Tablet / mobile: zawsze jedna kolumna i pełna szerokość. */
@media(max-width:960px){
  .course-certificate-compact-card{
    grid-template-columns:48px minmax(0,1fr) !important;
  }

  .course-certificate-compact-kpis,
  .course-certificate-compact-card > .btn{
    grid-column:1/-1 !important;
  }

  .course-certificate-compact-kpis{
    grid-template-columns:1fr 1fr !important;
  }

  /* Selecty z długimi nazwami nie mogą poszerzać ekranu. */
  select,
  .input{
    width:100% !important;
    min-width:0 !important;
  }

  option{
    max-width:100%;
  }
}

/* Na bardzo wąskich telefonach KPI również jeden pod drugim. */
@media(max-width:430px){
  .course-certificate-compact-kpis{
    grid-template-columns:1fr !important;
  }
}


/* V17.6 — Certyfikacja domknięta */
.automation-summary-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  margin:12px 0;
}
.automation-summary-grid>div{
  display:grid;
  gap:3px;
  padding:11px;
  border:1px solid #e8e8e8;
  border-radius:11px;
  background:#fff;
}
.automation-summary-grid strong{
  font-size:20px;
}
.automation-summary-grid span{
  color:#777;
  font-size:10px;
}
.automation-blocked-list{
  margin-top:10px;
  border:1px solid #f0d9dc;
  border-radius:11px;
  background:#fff9fa;
}
.automation-blocked-list summary{
  cursor:pointer;
  padding:10px 12px;
  font-weight:900;
}
.automation-blocked-list>div{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
  padding:8px 12px;
  border-top:1px solid #f4e5e7;
}
.automation-blocked-list span{
  color:#a30010;
  font-size:10px;
}
@media(max-width:900px){
  .automation-summary-grid{
    grid-template-columns:1fr 1fr;
  }
}
@media(max-width:520px){
  .automation-summary-grid{
    grid-template-columns:1fr;
  }
  .automation-blocked-list>div{
    grid-template-columns:1fr;
  }
}


/* V17.7 — Edycja wystawionego certyfikatu + PDF A4 */
.certificate-pdf-render-host{
  position:fixed;
  left:-100000px;
  top:0;
  width:1123px;
  height:794px;
  overflow:visible;
  pointer-events:none;
  background:#fff;
  z-index:-1;
}

.certificate-pdf-render-host .certificate-sheet{
  width:1123px !important;
  height:794px !important;
  max-width:none !important;
  min-width:1123px !important;
  min-height:794px !important;
  margin:0 !important;
  box-shadow:none !important;
  transform:none !important;
}

.issued-certificate-edit-modal{
  position:fixed;
  inset:0;
  z-index:13000;
  display:grid;
  place-items:center;
  padding:20px;
}

.issued-certificate-edit-backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.5);
}

.issued-certificate-edit-panel{
  position:relative;
  z-index:1;
  width:min(780px,96vw);
  max-height:92dvh;
  overflow:auto;
  padding:20px;
  border-radius:18px;
  background:#fff;
  box-shadow:0 28px 90px rgba(0,0,0,.28);
}

.issued-certificate-edit-panel>header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  margin-bottom:16px;
}

.issued-certificate-edit-panel h3{
  margin:7px 0 3px;
}

.issued-certificate-edit-panel p{
  margin:0;
  color:#777;
  font-size:11px;
}

.issued-certificate-edit-close{
  display:grid;
  place-items:center;
  width:38px;
  height:38px;
  flex:0 0 auto;
  border:0;
  border-radius:50%;
  background:#111;
  color:#fff;
  cursor:pointer;
  font-size:24px;
}

.issued-certificate-edit-note{
  padding:11px 12px;
  border:1px solid #e8e8e8;
  border-radius:11px;
  background:#fafafa;
  color:#666;
  font-size:11px;
}

.issued-certificate-edit-actions{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  margin-top:14px;
}

@media(max-width:620px){
  .issued-certificate-edit-modal{
    align-items:end;
    padding:0;
  }

  .issued-certificate-edit-panel{
    width:100vw;
    max-height:94dvh;
    border-radius:20px 20px 0 0;
    padding:16px 12px calc(16px + env(safe-area-inset-bottom,0px));
  }

  .issued-certificate-edit-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
  }
}


/* V17.7.1 — PDF fidelity 1:1 */
.certificate-pdf-render-host{
  position:fixed !important;
  left:-20000px !important;
  top:0 !important;
  width:1123px !important;
  height:794px !important;
  min-width:1123px !important;
  min-height:794px !important;
  max-width:none !important;
  overflow:visible !important;
  opacity:1 !important;
  visibility:visible !important;
  pointer-events:none !important;
  z-index:-1000 !important;
  background:#fff !important;
}

.certificate-pdf-render-host .certificate-sheet{
  position:relative !important;
  display:block !important;
  width:1123px !important;
  height:794px !important;
  min-width:1123px !important;
  min-height:794px !important;
  max-width:1123px !important;
  max-height:794px !important;
  margin:0 !important;
  padding:0 !important;
  transform:none !important;
  zoom:1 !important;
  box-shadow:none !important;
  overflow:hidden !important;
  background-color:#fff;
}

.certificate-pdf-render-host .certificate-frame{
  width:100% !important;
  height:100% !important;
  min-width:100% !important;
  min-height:100% !important;
  transform:none !important;
}

/* Reguły mobile/zoom nie mogą modyfikować układu eksportu. */
@media(max-width:2000px){
  .certificate-pdf-render-host .certificate-sheet,
  .certificate-pdf-render-host .certificate-frame{
    transform:none !important;
    max-width:none !important;
  }
}


/* V17.7.6 — PDF zachowuje natywne proporcje fontów */
.certificate-pdf-exact-host{
  position:fixed!important;
  left:-30000px!important;
  top:0!important;
  overflow:visible!important;
  pointer-events:none!important;
  opacity:1!important;
  visibility:visible!important;
  z-index:-9999!important;
  background:#fff!important;
}
.certificate-pdf-exact-host .certificate-sheet{
  transform:none!important;
  zoom:1!important;
  box-shadow:none!important;
  overflow:hidden!important;
}


/* =========================================================
   V18.0 — CENTRUM POWIADOMIEŃ I AKTYWNOŚCI
   ========================================================= */
.topbar-actions{
  display:flex;
  align-items:center;
  gap:9px;
  min-width:0;
}
.notification-bell{
  position:relative;
  display:grid;
  place-items:center;
  width:46px;
  height:46px;
  flex:0 0 auto;
  border:1px solid var(--line);
  border-radius:50%;
  background:#fff;
  cursor:pointer;
  font-size:20px;
  box-shadow:0 5px 16px rgba(0,0,0,.04);
}
.notification-bell:hover{background:#fff7f8}
.notification-badge{
  position:absolute;
  top:-4px;
  right:-5px;
  display:grid;
  place-items:center;
  min-width:19px;
  height:19px;
  padding:0 5px;
  border:2px solid #fff;
  border-radius:999px;
  background:var(--red);
  color:#fff;
  font-size:9px;
  font-style:normal;
  font-weight:950;
  line-height:1;
}
.notification-drawer{
  position:fixed;
  inset:0;
  z-index:14000;
  visibility:hidden;
  pointer-events:none;
}
.notification-drawer.open{
  visibility:visible;
  pointer-events:auto;
}
.notification-drawer-backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.42);
  opacity:0;
  transition:opacity .2s ease;
}
.notification-drawer.open .notification-drawer-backdrop{opacity:1}
.notification-drawer-panel{
  position:absolute;
  top:0;
  right:0;
  bottom:0;
  display:grid;
  grid-template-rows:auto auto minmax(0,1fr);
  width:min(520px,96vw);
  background:#f8f8f9;
  box-shadow:-24px 0 75px rgba(0,0,0,.2);
  transform:translateX(100%);
  transition:transform .22s ease;
}
.notification-drawer.open .notification-drawer-panel{transform:translateX(0)}
body.notification-drawer-open{overflow:hidden}
.notification-drawer-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:15px;
  padding:20px 20px 15px;
  border-bottom:1px solid #e7e7e7;
  background:#fff;
}
.notification-drawer-header h2{margin:8px 0 0;font-size:25px}
.notification-drawer-close{
  display:grid;
  place-items:center;
  width:40px;
  height:40px;
  border:0;
  border-radius:50%;
  background:#111;
  color:#fff;
  cursor:pointer;
  font-size:25px;
}
.notification-drawer-toolbar{
  display:grid;
  gap:9px;
  padding:10px 14px;
  border-bottom:1px solid #e7e7e7;
  background:#fff;
}
.notification-tabs{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:6px;
}
.notification-tabs button{
  min-height:40px;
  border:0;
  border-radius:10px;
  background:#f2f2f3;
  cursor:pointer;
  font-weight:900;
}
.notification-tabs button.active{background:#111;color:#fff}
.notification-toolbar-actions{
  display:flex;
  justify-content:flex-end;
  gap:7px;
  flex-wrap:wrap;
}
.notification-text-btn,
.notification-mini-btn{
  border:0;
  background:transparent;
  cursor:pointer;
  color:#555;
  font-size:10px;
  font-weight:900;
}
.notification-text-btn:hover{color:var(--red)}
.notification-list{
  min-height:0;
  overflow:auto;
  padding:12px;
}
.notification-items{display:grid;gap:8px}
.notification-row{
  display:grid;
  grid-template-columns:42px minmax(0,1fr) 20px;
  align-items:start;
  gap:10px;
  width:100%;
  padding:12px;
  border:1px solid #e8e8e8;
  border-radius:14px;
  background:#fff;
  cursor:pointer;
  text-align:left;
  transition:transform .12s ease,border-color .12s ease,box-shadow .12s ease;
}
.notification-row:hover{
  transform:translateY(-1px);
  border-color:#ddd;
  box-shadow:0 8px 24px rgba(0,0,0,.05);
}
.notification-row.unread{
  border-color:#ffd8dc;
  background:#fff8f9;
}
.notification-row-icon{
  display:grid;
  place-items:center;
  width:42px;
  height:42px;
  border-radius:12px;
  background:#f4f4f4;
  font-size:20px;
}
.notification-row.unread .notification-row-icon{background:#ffecef}
.notification-row-content{display:grid;gap:4px;min-width:0}
.notification-row-top{display:flex;align-items:center;gap:7px;min-width:0}
.notification-row-top strong{font-size:12px;overflow-wrap:anywhere}
.notification-unread-dot{
  width:7px;
  height:7px;
  flex:0 0 auto;
  border-radius:50%;
  background:var(--red);
}
.notification-row-message{
  color:#555;
  font-size:11px;
  line-height:1.45;
  overflow-wrap:anywhere;
}
.notification-row-meta{color:#999;font-size:9px}
.notification-row-arrow{align-self:center;color:#aaa;font-size:24px}
.notification-empty{
  display:grid;
  place-items:center;
  gap:5px;
  padding:55px 20px;
  text-align:center;
  color:#777;
}
.notification-empty>span{font-size:35px}
.notification-empty p{margin:0;font-size:11px}
.notification-admin-composer{
  display:grid;
  gap:10px;
  margin-bottom:12px;
  padding:13px;
  border:1px solid #ffd8dc;
  border-radius:15px;
  background:#fff;
}
.notification-composer-title{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}
.notification-composer-title strong{font-size:13px}
.notification-mini-btn{font-size:22px}
.notification-admin-composer form{display:grid;gap:9px}
.notification-admin-composer label{display:grid;gap:5px;font-size:10px;font-weight:900}
.mobile-more-notifications{
  position:relative;
  display:flex;
  align-items:center;
  gap:11px;
  width:100%;
  min-height:50px;
  margin-bottom:9px;
  padding:10px 12px;
  border:1px solid #eee;
  border-radius:13px;
  background:#fff;
  text-align:left;
  font-weight:850;
}
.mobile-more-notifications .notification-badge{
  position:static;
  margin-left:auto;
  border:0;
}
@media(max-width:960px){
  .notification-bell{width:40px;height:40px;font-size:18px}
  .notification-drawer-panel{width:min(520px,100vw)}
}
@media(max-width:620px){
  .notification-drawer-panel{width:100vw}
  .notification-drawer-header{padding:16px 13px 12px}
  .notification-drawer-header h2{font-size:21px}
  .notification-drawer-toolbar{padding:8px}
  .notification-list{padding:8px 8px calc(var(--mobile-nav-height) + var(--safe-bottom) + 10px)}
  .notification-row{grid-template-columns:38px minmax(0,1fr) 16px;padding:10px;gap:8px}
  .notification-row-icon{width:38px;height:38px}
  .notification-toolbar-actions{display:grid;grid-template-columns:1fr 1fr}
  .notification-text-btn{min-height:34px;border-radius:8px;background:#f6f6f6}
}

.course-assigned{border-color:#ffd0d5!important;box-shadow:0 10px 28px rgba(238,20,43,.07)}
.course-assignment-badges,.crm-assignment-badges{display:flex;gap:5px;flex-wrap:wrap;margin-top:7px}
.course-assignment-badge,.course-required-badge,.crm-assignment-badges em{display:inline-flex;align-items:center;padding:4px 7px;border-radius:999px;background:#fff;color:#111;font-size:9px;font-weight:950;font-style:normal}
.course-required-badge,.crm-assignment-badges em.required{background:var(--red);color:#fff}.crm-assignment-badges em.due{background:#fff8df;color:#855d00}
.course-card-meta-row{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap}.course-due-date{color:#a0000e;font-size:10px;font-weight:900}.course-assignment-note{display:block;margin-top:8px;padding:8px 9px;border-radius:9px;background:#fff5f6;color:#7d2028;font-size:10px}.assigned-section-title>div{display:grid;gap:4px}.assigned-section-title small{color:#777;font-size:10px}.assigned-course-grid{margin-bottom:22px}
.crm-course-actions{display:flex;gap:7px;flex-wrap:wrap;margin-top:10px}.crm-course-actions .btn-danger{border:1px solid #ffd0d5;background:#fff5f6;color:#b00012}
.crm-assignment-modal{position:fixed;inset:0;z-index:15000;display:grid;place-items:center;padding:20px}.crm-assignment-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.5)}.crm-assignment-panel{position:relative;z-index:1;width:min(650px,96vw);max-height:92dvh;overflow:auto;padding:20px;border-radius:20px;background:#fff;box-shadow:0 28px 90px rgba(0,0,0,.27)}.crm-assignment-panel>header{display:flex;justify-content:space-between;gap:15px;align-items:flex-start;margin-bottom:16px}.crm-assignment-panel h3{margin:8px 0 3px;font-size:21px}.crm-assignment-panel p{margin:0;color:#777;font-size:10px}.crm-assignment-close{display:grid;place-items:center;width:40px;height:40px;flex:0 0 auto;border:0;border-radius:50%;background:#111;color:#fff;cursor:pointer;font-size:25px}#crmAssignmentForm{display:grid;gap:12px}#crmAssignmentForm>label,.crm-assignment-grid>label{display:grid;gap:5px;font-size:10px;font-weight:900}.crm-assignment-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.crm-assignment-check{grid-template-columns:auto 1fr!important;align-items:center;align-content:center;padding:12px;border:1px solid #e7e7e7;border-radius:12px}.crm-assignment-check input{width:20px;height:20px}.crm-assignment-existing{padding:9px 10px;border-radius:10px;background:#fff7df;color:#715000;font-size:10px;font-weight:800}.crm-assignment-actions{display:flex;justify-content:flex-end;gap:8px}
@media(max-width:620px){.crm-assignment-modal{align-items:end;padding:0}.crm-assignment-panel{width:100vw;max-height:94dvh;padding:16px 12px calc(16px + env(safe-area-inset-bottom,0px));border-radius:22px 22px 0 0}.crm-assignment-grid{grid-template-columns:1fr}.crm-assignment-actions{display:grid;grid-template-columns:1fr 1fr}}


/* V18.1.1 — countdown terminów */
.course-countdown-badge{
  display:inline-flex;
  align-items:center;
  min-height:22px;
  padding:4px 7px;
  border-radius:999px;
  background:#f4f4f4;
  color:#333;
  font-size:9px;
  font-weight:950;
}
.course-countdown-badge.soon{background:#fff8df;color:#795600}
.course-countdown-badge.warning{background:#fff1d9;color:#8a4c00}
.course-countdown-badge.urgent,
.course-countdown-badge.today{background:#ffe5e7;color:#a00010}
.course-countdown-badge.overdue{background:#b00012;color:#fff}

.course-countdown-line{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  margin:8px 0 2px;
  padding:8px 9px;
  border-radius:10px;
  background:#f6f6f6;
  font-size:10px;
}
.course-countdown-line span{color:#777}
.course-countdown-line.soon{background:#fff9e7;color:#795600}
.course-countdown-line.warning{background:#fff2df;color:#8a4c00}
.course-countdown-line.urgent,
.course-countdown-line.today{background:#fff0f1;color:#a00010}
.course-countdown-line.overdue{background:#b00012;color:#fff}
.course-countdown-line.overdue span{color:#fff}
.course-overdue{border-color:#b00012!important}

.crm-assignment-badges em.countdown{background:#f2f2f2;color:#333}
.crm-assignment-badges em.countdown.soon{background:#fff8df;color:#795600}
.crm-assignment-badges em.countdown.warning{background:#fff1d9;color:#8a4c00}
.crm-assignment-badges em.countdown.urgent,
.crm-assignment-badges em.countdown.today{background:#ffe5e7;color:#a00010}
.crm-assignment-badges em.countdown.overdue{background:#b00012;color:#fff}

@media(max-width:620px){
  .course-countdown-line{
    align-items:flex-start;
    flex-direction:column;
  }
}


/* =========================================================
   V18.2 — GRUPY + MASOWE PRZYPISYWANIE
   ========================================================= */
.crm-list-management{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:6px;
}
.crm-list-management button{
  min-height:38px;
  padding:8px;
  border:1px solid #ececec;
  border-radius:10px;
  background:#fff;
  cursor:pointer;
  font-size:9px;
  font-weight:900;
}
.crm-list-management button:hover{background:#fff6f7;border-color:#ffd8dc}
.crm-list-management span{
  display:inline-grid;
  place-items:center;
  min-width:17px;
  height:17px;
  margin-left:3px;
  border-radius:999px;
  background:#eee;
  font-size:8px;
}

.crm-groups-modal{
  position:fixed;
  inset:0;
  z-index:15500;
  display:grid;
  place-items:center;
  padding:18px;
}
.crm-groups-backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.52);
}
.crm-groups-panel,
.crm-bulk-panel{
  position:relative;
  z-index:1;
  width:min(1120px,97vw);
  max-height:94dvh;
  overflow:hidden;
  border-radius:22px;
  background:#f8f8f9;
  box-shadow:0 30px 100px rgba(0,0,0,.3);
}
.crm-bulk-panel{
  width:min(850px,97vw);
  overflow:auto;
  padding-bottom:15px;
}
.crm-groups-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
  padding:18px 20px;
  border-bottom:1px solid #e6e6e6;
  background:#fff;
}
.crm-groups-header h2{margin:7px 0 3px;font-size:23px}
.crm-groups-header p{margin:0;color:#777;font-size:10px}
.crm-groups-layout{
  display:grid;
  grid-template-columns:290px minmax(0,1fr);
  height:min(760px,calc(94dvh - 95px));
}
.crm-group-list{
  min-height:0;
  overflow:auto;
  padding:12px;
  border-right:1px solid #e6e6e6;
  background:#fff;
}
.crm-group-cards{display:grid;gap:7px;margin-top:10px}
.crm-group-card{
  border:1px solid #e8e8e8;
  border-radius:12px;
  background:#fff;
  overflow:hidden;
}
.crm-group-card.active{border-color:#ffbac1;box-shadow:0 7px 18px rgba(238,20,43,.06)}
.crm-group-main{
  display:grid;
  gap:2px;
  width:100%;
  padding:10px;
  border:0;
  background:transparent;
  cursor:pointer;
  text-align:left;
}
.crm-group-main strong{font-size:11px}
.crm-group-main span{color:#777;font-size:9px}
.crm-group-card-actions{
  display:grid;
  grid-template-columns:1fr 1fr auto;
  gap:4px;
  padding:0 7px 7px;
}
.crm-group-card-actions button{
  min-height:28px;
  border:0;
  border-radius:7px;
  background:#f4f4f4;
  cursor:pointer;
  font-size:8px;
  font-weight:850;
}
.crm-group-card-actions button:hover{background:#ffeef0}
.crm-group-workspace{
  min-width:0;
  min-height:0;
  overflow:auto;
  padding:16px;
}
.crm-group-form,
.crm-group-report{
  display:grid;
  gap:13px;
}
.crm-group-form>label,
.crm-group-report>label,
#crmBulkAssignmentForm>label,
.crm-bulk-grid>label{
  display:grid;
  gap:5px;
  font-size:10px;
  font-weight:900;
}
.crm-member-toolbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}
.crm-member-toolbar>div{display:flex;gap:5px;flex-wrap:wrap}
.crm-member-toolbar strong{font-size:11px}
.crm-member-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:6px;
  max-height:430px;
  overflow:auto;
  padding:2px;
}
.crm-member-check{
  display:grid;
  grid-template-columns:auto 34px minmax(0,1fr);
  align-items:center;
  gap:8px;
  padding:8px;
  border:1px solid #e9e9e9;
  border-radius:10px;
  background:#fff;
  cursor:pointer;
}
.crm-member-check:has(input:checked){
  border-color:#ffbec5;
  background:#fff7f8;
}
.crm-member-check input{width:17px;height:17px}
.crm-member-check .crm-avatar{width:34px;height:34px}
.crm-member-check>span:last-child{display:grid;gap:2px;min-width:0}
.crm-member-check strong{font-size:10px;overflow-wrap:anywhere}
.crm-member-check small{color:#777;font-size:8px;overflow-wrap:anywhere}

.crm-group-report-metrics{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
}
.crm-group-report-metrics article{
  display:grid;
  gap:3px;
  padding:11px;
  border:1px solid #e8e8e8;
  border-radius:12px;
  background:#fff;
}
.crm-group-report-metrics strong{font-size:21px}
.crm-group-report-metrics span{color:#777;font-size:9px}
.crm-group-report-toolbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.crm-group-report-users{
  display:grid;
  gap:6px;
}
.crm-report-user{
  display:grid;
  grid-template-columns:38px minmax(0,1fr) auto;
  align-items:center;
  gap:9px;
  padding:8px 10px;
  border:1px solid #e9e9e9;
  border-radius:10px;
  background:#fff;
}
.crm-report-user .crm-avatar{width:38px;height:38px}
.crm-report-user>div{display:grid;gap:2px;min-width:0}
.crm-report-user strong{font-size:10px}
.crm-report-user small{color:#777;font-size:8px}
.crm-report-status{
  padding:5px 7px;
  border-radius:999px;
  font-size:8px;
  font-weight:950;
}
.crm-report-status.completed{background:#e9f8ee;color:#167239}
.crm-report-status.incomplete{background:#fff0f1;color:#a00010}

#crmBulkAssignmentForm{
  display:grid;
  gap:12px;
  padding:16px 20px;
}
.crm-bulk-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.crm-bulk-member-grid{max-height:360px}
.crm-bulk-summary{
  padding:9px 10px;
  border-radius:10px;
  background:#fff7df;
  color:#705000;
  font-size:9px;
}

@media(max-width:800px){
  .crm-groups-modal{align-items:end;padding:0}
  .crm-groups-panel,
  .crm-bulk-panel{
    width:100vw;
    max-height:95dvh;
    border-radius:22px 22px 0 0;
  }
  .crm-groups-layout{
    grid-template-columns:1fr;
    height:auto;
    max-height:calc(95dvh - 90px);
    overflow:auto;
  }
  .crm-group-list{
    max-height:250px;
    border-right:0;
    border-bottom:1px solid #e6e6e6;
  }
  .crm-member-grid{grid-template-columns:1fr}
  .crm-group-report-metrics{grid-template-columns:1fr 1fr}
}
@media(max-width:520px){
  .crm-bulk-grid{grid-template-columns:1fr}
  .crm-group-report-toolbar{align-items:stretch}
  .crm-group-report-toolbar>.btn{width:100%}
  .crm-report-user{grid-template-columns:34px minmax(0,1fr)}
  .crm-report-status{grid-column:2}
}


/* V18.2.1 — systemowe potwierdzenia zawsze nad modalami funkcjonalnymi */
.crm-groups-modal{z-index:15500!important;}
.system-modal{z-index:30010!important;}
.system-modal-actions{z-index:30010!important;}
.system-modal-body{z-index:30010!important;}
.system-modal-cancel{z-index:30010!important;}
.system-modal-close{z-index:30010!important;}
.system-modal-confirm{z-index:30010!important;}
.system-modal-error{z-index:30010!important;}
.system-modal-field{z-index:30010!important;}
.system-modal-header{z-index:30010!important;}
.system-modal-icon{z-index:30010!important;}
.system-modal-label{z-index:30010!important;}
#modalCourseDescription{z-index:30010!important;}
#modalCourseTitle{z-index:30010!important;}
#systemModalTitle{z-index:30010!important;}

body > .modal-overlay,
body > .dialog-overlay,
body > .ui-dialog-overlay,
body > [role="alertdialog"]{
  z-index:30010!important;
}


/* =========================================================
   V18.3 — DO ZROBIENIA / KONTYNUUJ
   ========================================================= */
.todo-section{
  display:grid;
  gap:10px;
  margin-bottom:22px;
  padding:14px;
  border:1px solid #ececec;
  border-radius:18px;
  background:#fff;
  box-shadow:0 9px 28px rgba(0,0,0,.035);
}
.todo-section-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}
.todo-section-head>div{display:grid;gap:5px}
.todo-section-head h2{
  margin:0;
  font-size:18px;
  line-height:1.15;
}
.todo-section-count,
.todo-done-icon{
  display:grid;
  place-items:center;
  min-width:38px;
  height:38px;
  padding:0 10px;
  border-radius:12px;
  background:var(--red);
  color:#fff;
  font-size:15px;
  font-weight:950;
}
.todo-done-icon{background:#168242}
.todo-all-done{
  border-color:#d9efdf;
  background:#f9fffb;
}
.todo-list{display:grid;gap:8px}
.todo-card{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:12px;
  padding:11px;
  border:1px solid #e9e9e9;
  border-radius:14px;
  background:#fff;
}
.todo-card.overdue{border-color:#efadb4;background:#fff8f9}
.todo-card.today{border-color:#f4bcc1;background:#fff9f9}
.todo-card.urgent{border-color:#f3c7a2;background:#fffbf6}
.todo-card.warning{border-color:#f1d8a6;background:#fffdf8}
.todo-card-main{
  display:grid;
  grid-template-columns:42px minmax(0,1fr);
  align-items:start;
  gap:10px;
  min-width:0;
}
.todo-card-icon{
  display:grid;
  place-items:center;
  width:42px;
  height:42px;
  border-radius:12px;
  background:#f4f4f4;
  font-size:19px;
}
.todo-card-content{display:grid;gap:6px;min-width:0}
.todo-card-top{
  display:flex;
  align-items:center;
  gap:7px;
  flex-wrap:wrap;
}
.todo-card-top strong{
  font-size:12px;
  overflow-wrap:anywhere;
}
.todo-required{
  padding:3px 6px;
  border-radius:999px;
  background:#111;
  color:#fff;
  font-size:8px;
  font-weight:950;
}
.todo-card-meta{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  color:#777;
  font-size:9px;
}
.todo-countdown{font-weight:950;color:#444}
.todo-countdown.overdue,
.todo-countdown.today{color:#af0012}
.todo-countdown.urgent{color:#b64b00}
.todo-countdown.warning,
.todo-countdown.soon{color:#806000}
.todo-progress-row{
  display:grid;
  grid-template-columns:minmax(80px,1fr) auto;
  align-items:center;
  gap:7px;
}
.todo-progress-track{
  height:6px;
  overflow:hidden;
  border-radius:999px;
  background:#ededed;
}
.todo-progress-track i{
  display:block;
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg,#ed1028,#ff4050);
}
.todo-progress-row>span{
  min-width:28px;
  text-align:right;
  font-size:9px;
  font-weight:900;
}
.todo-note{
  color:#777;
  font-size:9px;
  line-height:1.35;
}
.todo-continue-btn{
  min-width:105px;
  white-space:nowrap;
}
@media(max-width:680px){
  .todo-card{
    grid-template-columns:1fr;
  }
  .todo-continue-btn{
    width:100%;
  }
  .todo-section-head h2{font-size:16px}
}

/* V18.3.1 — zwarty panel Do zrobienia */
.todo-section{max-width:1100px}
.todo-list{grid-template-columns:repeat(auto-fit,minmax(min(100%,420px),1fr))}
.todo-card{min-height:92px}
.todo-card-main{align-items:center}
.todo-progress-track{max-width:520px}
@media(min-width:1200px){
  .todo-section:has(.todo-list > .todo-card:only-child){max-width:760px}
}


/* =========================================================
   V18.4 — INTELIGENTNE KONTYNUUJ
   ========================================================= */
.todo-last-activity{
  color:#666!important;
  font-weight:750;
}
.todo-last-activity::before{
  content:"🕘 ";
}
.todo-card-meta span{
  display:inline-flex;
  align-items:center;
}
.todo-card-content .todo-card-meta{
  row-gap:4px;
}
@media(max-width:620px){
  .todo-card-meta{
    display:grid;
    grid-template-columns:1fr;
  }
}


/* =========================================================
   V18.5 — PANEL ADMINISTRATORA SZKOLEŃ
   ========================================================= */
.training-report-shell{
  display:grid;
  gap:12px;
}
.training-report-kpis{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:8px;
}
.training-report-kpis article{
  display:grid;
  gap:4px;
  padding:13px;
  border:1px solid #e8e8e8;
  border-radius:14px;
  background:#fff;
}
.training-report-kpis article.danger{
  border-color:#f0b7bd;
  background:#fff7f8;
}
.training-report-kpis article.success{
  border-color:#cfe8d7;
  background:#f8fff9;
}
.training-report-kpis span{
  color:#777;
  font-size:9px;
}
.training-report-kpis strong{
  font-size:24px;
}
.training-report-card{
  overflow:hidden;
  border:1px solid #e8e8e8;
  border-radius:17px;
  background:#fff;
}
.training-report-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:16px;
  border-bottom:1px solid #eee;
}
.training-report-head>div{
  display:grid;
  gap:4px;
}
.training-report-head h2{
  margin:0;
  font-size:20px;
}
.training-report-head p{
  margin:0;
  color:#777;
  font-size:10px;
}
.training-report-filters{
  display:grid;
  grid-template-columns:minmax(240px,1.4fr) repeat(5,minmax(130px,.7fr));
  gap:7px;
  padding:11px 14px;
  border-bottom:1px solid #eee;
  background:#fafafa;
}
.training-report-search{
  display:flex;
  align-items:center;
  gap:7px;
  min-height:42px;
  padding:0 11px;
  border:1px solid #ddd;
  border-radius:10px;
  background:#fff;
}
.training-report-search input{
  width:100%;
  min-width:0;
  border:0;
  outline:0;
  background:transparent;
  font:inherit;
}
.training-report-counter{
  padding:8px 15px;
  border-bottom:1px solid #eee;
  color:#777;
  font-size:9px;
}
.training-report-table{
  min-width:0;
}
.training-report-table-head,
.training-report-row{
  display:grid;
  grid-template-columns:minmax(200px,1.35fr) minmax(190px,1.2fr) minmax(120px,.8fr) minmax(130px,.8fr) minmax(105px,.65fr) minmax(120px,.75fr) 72px;
  align-items:center;
  gap:10px;
}
.training-report-table-head{
  padding:9px 14px;
  border-bottom:1px solid #eee;
  background:#f7f7f7;
  color:#777;
  font-size:8px;
  font-weight:900;
  text-transform:uppercase;
}
.training-report-table-body{
  display:grid;
}
.training-report-row{
  padding:10px 14px;
  border-bottom:1px solid #f0f0f0;
}
.training-report-row:hover{
  background:#fcfcfc;
}
.training-report-person{
  display:grid;
  grid-template-columns:38px minmax(0,1fr);
  align-items:center;
  gap:8px;
  min-width:0;
}
.training-report-avatar{
  display:grid;
  place-items:center;
  width:38px;
  height:38px;
  border-radius:50%;
  background:#eef4ff;
  color:#315c9a;
  font-size:11px;
  font-weight:950;
}
.training-report-person>div,
.training-report-course{
  display:grid;
  gap:2px;
  min-width:0;
}
.training-report-person strong,
.training-report-course strong{
  font-size:10px;
  overflow-wrap:anywhere;
}
.training-report-person small,
.training-report-course small{
  color:#777;
  font-size:8px;
  overflow-wrap:anywhere;
}
.training-report-person em{
  color:#a00010;
  font-size:7px;
  font-style:normal;
}
.training-report-progress{
  display:grid;
  gap:5px;
}
.training-report-progress-head{
  display:flex;
  justify-content:space-between;
  gap:6px;
  font-size:9px;
}
.training-report-progress-head span{
  color:#777;
}
.training-report-progress-track{
  height:6px;
  overflow:hidden;
  border-radius:999px;
  background:#ededed;
}
.training-report-progress-track i{
  display:block;
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg,#ed1028,#ff4453);
}
.training-report-deadline{
  display:grid;
  gap:3px;
}
.training-report-deadline strong{
  font-size:9px;
}
.training-report-deadline span{
  color:#777;
  font-size:8px;
}
.training-report-deadline span.overdue,
.training-report-deadline span.today{
  color:#af0012;
  font-weight:900;
}
.training-report-deadline span.urgent{
  color:#b44e00;
  font-weight:900;
}
.training-report-status{
  display:inline-flex;
  align-items:center;
  gap:3px;
  width:max-content;
  padding:5px 7px;
  border-radius:999px;
  font-size:8px;
  font-weight:950;
}
.training-report-status.completed{
  background:#e9f8ee;
  color:#167239;
}
.training-report-status.overdue{
  background:#b00012;
  color:#fff;
}
.training-report-status.in-progress{
  background:#fff6df;
  color:#765300;
}
.training-report-status.not-started{
  background:#f1f1f1;
  color:#555;
}
.training-report-cert{
  border:0;
  background:transparent;
  font-size:8px;
}
.training-report-cert.active{
  cursor:pointer;
  color:#9b0010;
  font-weight:900;
}
.training-report-cert.none{
  color:#aaa;
}
.training-report-actions{
  display:flex;
  justify-content:flex-end;
  gap:4px;
}
.training-report-action{
  display:grid;
  place-items:center;
  width:30px;
  height:30px;
  border:1px solid #e7e7e7;
  border-radius:8px;
  background:#fff;
  cursor:pointer;
}
.training-report-action:hover{
  border-color:#ffbcc3;
  background:#fff5f6;
}
.training-report-empty{
  display:grid;
  place-items:center;
  gap:4px;
  padding:55px 20px;
  color:#777;
  text-align:center;
}
.training-report-empty>span{
  font-size:35px;
}
.training-report-empty p{
  margin:0;
  font-size:10px;
}

@media(max-width:1500px){
  .training-report-kpis{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
  .training-report-filters{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
  .training-report-search{
    grid-column:1 / -1;
  }
  .training-report-table{
    overflow-x:auto;
  }
  .training-report-table-head,
  .training-report-row{
    min-width:1050px;
  }
}
@media(max-width:760px){
  .training-report-kpis{
    grid-template-columns:1fr 1fr;
  }
  .training-report-head{
    align-items:stretch;
    flex-direction:column;
  }
  .training-report-head>.btn{
    width:100%;
  }
  .training-report-filters{
    grid-template-columns:1fr;
  }
  .training-report-search{
    grid-column:auto;
  }
}


/* V18.5.1 — raport UX */
.training-report-kpis button{
  display:grid;
  gap:4px;
  padding:13px;
  border:1px solid #e8e8e8;
  border-radius:14px;
  background:#fff;
  text-align:left;
  cursor:pointer;
}
.training-report-kpis button:hover{
  transform:translateY(-1px);
  border-color:#d7d7d7;
  box-shadow:0 7px 18px rgba(0,0,0,.04);
}
.training-report-kpis button.danger{
  border-color:#f0b7bd;
  background:#fff7f8;
}
.training-report-kpis button.success{
  border-color:#cfe8d7;
  background:#f8fff9;
}
.training-report-kpis button span{
  color:#777;
  font-size:10px;
}
.training-report-kpis button strong{
  font-size:25px;
}
.training-report-head-actions{
  display:flex;
  gap:7px;
  flex-wrap:wrap;
}
.training-report-row{
  min-height:58px;
  font-size:11px;
}
.training-report-row.row-overdue{
  background:#fff3f4;
  border-left:4px solid #b00012;
}
.training-report-row.row-urgent{
  background:#fffaf0;
  border-left:4px solid #e0a000;
}
.training-report-countdown span{
  display:inline-flex;
  width:max-content;
  padding:5px 7px;
  border-radius:999px;
  font-size:9px;
  font-weight:900;
  background:#f2f2f2;
  color:#555;
}
.training-report-countdown span.overdue{
  background:#b00012;
  color:#fff;
}
.training-report-countdown span.today,
.training-report-countdown span.urgent{
  background:#ffe6e9;
  color:#a00010;
}
.training-report-countdown span.warning{
  background:#fff3dc;
  color:#825400;
}
.training-report-person strong,
.training-report-course strong{
  font-size:11px;
}
.training-report-person small,
.training-report-course small{
  font-size:9px;
}
.training-report-table-head,
.training-report-row{
  grid-template-columns:minmax(210px,1.35fr) minmax(200px,1.2fr) minmax(125px,.8fr) minmax(105px,.65fr) minmax(120px,.75fr) minmax(110px,.7fr) minmax(120px,.75fr) 72px;
}
@media(max-width:1500px){
  .training-report-table-head,
  .training-report-row{
    min-width:1180px;
  }
}
@media(max-width:760px){
  .training-report-head-actions{
    display:grid;
    grid-template-columns:1fr;
  }
}


/* =========================================================
   V18.6 — HISTORIA AKTYWNOŚCI I AUDYT
   ========================================================= */
.crm-history-panel{
  display:grid;
  gap:13px;
}
.crm-history-kpis{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:7px;
}
.crm-history-kpis article{
  display:grid;
  gap:3px;
  padding:10px;
  border:1px solid #e9e9e9;
  border-radius:11px;
  background:#fff;
}
.crm-history-kpis strong{
  font-size:20px;
}
.crm-history-kpis span{
  color:#777;
  font-size:8px;
}
.crm-history-filters{
  display:flex;
  gap:5px;
  flex-wrap:wrap;
}
.crm-history-filters button{
  min-height:31px;
  padding:5px 9px;
  border:1px solid #e7e7e7;
  border-radius:999px;
  background:#fff;
  cursor:pointer;
  font-size:8px;
  font-weight:900;
}
.crm-history-filters button.active{
  border-color:#111;
  background:#111;
  color:#fff;
}
.crm-audit-timeline{
  display:grid;
  gap:7px;
}
.crm-audit-item{
  display:grid!important;
  grid-template-columns:42px minmax(0,1fr);
  gap:10px;
  align-items:start;
  padding:10px!important;
  border:1px solid #ebebeb;
  border-radius:12px;
  background:#fff;
}
.crm-audit-icon{
  display:grid;
  place-items:center;
  width:42px;
  height:42px;
  border-radius:12px;
  background:#f4f4f4;
  font-size:17px;
}
.crm-audit-icon.lesson,
.crm-audit-icon.quiz_passed,
.crm-audit-icon.certificate{
  background:#edf9f1;
}
.crm-audit-icon.quiz_failed,
.crm-audit-icon.certificate_revoked{
  background:#fff0f1;
}
.crm-audit-icon.permissions_updated,
.crm-audit-icon.profile_updated{
  background:#f2efff;
}
.crm-audit-icon.course_assigned,
.crm-audit-icon.course_assignment_updated,
.crm-audit-icon.assignment{
  background:#fff8e2;
}
.crm-audit-copy{
  display:grid;
  gap:4px;
  min-width:0;
}
.crm-audit-title-row{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:8px;
}
.crm-audit-title-row strong{
  font-size:10px;
  overflow-wrap:anywhere;
}
.crm-audit-title-row em{
  flex:0 0 auto;
  padding:3px 6px;
  border-radius:999px;
  background:#f3f3f3;
  color:#666;
  font-size:7px;
  font-style:normal;
  font-weight:900;
}
.crm-audit-meta{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.crm-audit-meta small{
  color:#888;
  font-size:8px;
}
.crm-audit-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.crm-history-empty{
  display:grid;
  place-items:center;
  gap:4px;
  padding:35px 15px;
  color:#777;
}
.crm-history-empty span{
  font-size:28px;
}
@media(max-width:650px){
  .crm-history-kpis{
    grid-template-columns:1fr 1fr;
  }
  .crm-audit-title-row{
    flex-direction:column;
  }
}


/* =========================================================
   V18.8 — UŻYTKOWNICY, KONTA I UPRAWNIENIA
   ========================================================= */
.crm-add-user-modal{
  position:fixed;
  inset:0;
  z-index:16000;
  display:grid;
  place-items:center;
  padding:18px;
}
.crm-add-user-backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.52);
}
.crm-add-user-panel{
  position:relative;
  z-index:1;
  width:min(760px,97vw);
  max-height:94dvh;
  overflow:auto;
  padding:20px;
  border-radius:22px;
  background:#fff;
  box-shadow:0 30px 100px rgba(0,0,0,.3);
}
.crm-add-user-panel>header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:15px;
  margin-bottom:17px;
}
.crm-add-user-panel h2{
  margin:8px 0 4px;
  font-size:22px;
}
.crm-add-user-panel>header p{
  margin:0;
  color:#777;
  font-size:10px;
}
#crmAddUserForm{
  display:grid;
  gap:13px;
}
.crm-add-user-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.crm-add-user-grid label{
  display:grid;
  gap:5px;
  font-size:10px;
  font-weight:900;
}
.crm-add-user-grid label>small{
  color:#777;
  font-weight:500;
  line-height:1.4;
}
.crm-add-user-grid .span-2{
  grid-column:1 / -1;
}
.crm-password-input-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:7px;
}
.crm-password-input-row .btn{
  white-space:nowrap;
}
.crm-add-user-security{
  display:grid;
  grid-template-columns:34px minmax(0,1fr);
  gap:9px;
  padding:10px 11px;
  border:1px solid #dfe8f7;
  border-radius:12px;
  background:#f7faff;
}
.crm-add-user-security>span{
  font-size:20px;
}
.crm-add-user-security>div{
  display:grid;
  gap:2px;
}
.crm-add-user-security strong{
  font-size:10px;
}
.crm-add-user-security small{
  color:#68758b;
  font-size:8px;
  line-height:1.45;
}
.crm-role-access{
  display:grid;
  gap:8px;
  padding:11px 12px;
  border:1px solid #ececec;
  border-radius:12px;
  background:#fafafa;
}
.crm-role-access>strong{
  font-size:10px;
}
.crm-role-access>div{
  display:flex;
  gap:5px;
  flex-wrap:wrap;
}
.crm-role-access span{
  display:inline-flex;
  align-items:center;
  min-height:24px;
  padding:4px 7px;
  border-radius:999px;
  background:#fff;
  border:1px solid #e7e7e7;
  color:#555;
  font-size:8px;
  font-weight:800;
}
.crm-role-access.compact{
  padding:8px;
}
.crm-permission-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.crm-created-user-card{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin:13px 0;
}
.crm-created-user-card>div{
  display:grid;
  gap:4px;
  padding:11px;
  border:1px solid #e9e9e9;
  border-radius:12px;
  background:#fafafa;
}
.crm-created-user-card span{
  color:#777;
  font-size:8px;
}
.crm-created-user-card strong{
  font-size:11px;
  overflow-wrap:anywhere;
}
.crm-temp-password{
  font-family:Consolas,Monaco,monospace;
  color:#a00010;
  letter-spacing:.03em;
}
.crm-test-account-note{
  display:grid;
  gap:4px;
  margin:10px 0 15px;
  padding:12px;
  border:1px solid #d8ecdE;
  border-radius:12px;
  background:#f7fff9;
}
.crm-test-account-note strong{
  font-size:11px;
}
.crm-test-account-note span{
  color:#52645a;
  font-size:9px;
  line-height:1.5;
}
@media(max-width:620px){
  .crm-add-user-modal{
    align-items:end;
    padding:0;
  }
  .crm-add-user-panel{
    width:100vw;
    max-height:95dvh;
    padding:16px 12px calc(16px + env(safe-area-inset-bottom,0px));
    border-radius:22px 22px 0 0;
  }
  .crm-add-user-grid{
    grid-template-columns:1fr;
  }
  .crm-add-user-grid .span-2{
    grid-column:auto;
  }
  .crm-created-user-card{
    grid-template-columns:1fr;
  }
  .crm-password-input-row{
    grid-template-columns:1fr;
  }
  .crm-permission-actions{
    display:grid;
    grid-template-columns:1fr;
  }
}


/* =========================================================
   V18.8.1 — ZARZĄDZANIE KONTAKTEM I USUWANIE
   ========================================================= */
.crm-danger-zone{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  margin-top:14px;
  padding:12px;
  border:1px solid #f0b8bd;
  border-radius:12px;
  background:#fff7f8;
}
.crm-danger-zone>div{
  display:grid;
  gap:3px;
}
.crm-danger-zone strong{
  color:#a00010;
  font-size:10px;
}
.crm-danger-zone span{
  max-width:700px;
  color:#7e5156;
  font-size:8px;
  line-height:1.45;
}
.crm-danger-zone .btn-danger{
  flex:0 0 auto;
  border:1px solid #c90018;
  background:#c90018;
  color:#fff;
}
.crm-no-assigned-courses{
  display:grid;
  place-items:center;
  gap:5px;
  padding:35px 15px;
  border:1px dashed #dedede;
  border-radius:12px;
  background:#fafafa;
  text-align:center;
}
.crm-no-assigned-courses>span{
  font-size:29px;
}
.crm-no-assigned-courses strong{
  font-size:11px;
}
.crm-no-assigned-courses p{
  max-width:520px;
  margin:0;
  color:#777;
  font-size:9px;
}
@media(max-width:650px){
  .crm-danger-zone{
    align-items:stretch;
    flex-direction:column;
  }
  .crm-danger-zone .btn-danger{
    width:100%;
  }
}


/* =========================================================
   V18.8.2 — SZCZEGÓŁOWE UPRAWNIENIA + PIERWSZE LOGOWANIE
   ========================================================= */
.permission-hidden{
  display:none!important;
}
.crm-permission-editor{
  display:grid;
  gap:10px;
  padding:12px;
  border:1px solid #e8e8e8;
  border-radius:13px;
  background:#fafafa;
}
.crm-permission-editor-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
}
.crm-permission-editor-head>div{
  display:grid;
  gap:3px;
}
.crm-permission-editor-head strong{
  font-size:11px;
}
.crm-permission-editor-head span{
  color:#777;
  font-size:8px;
}
.crm-permission-editor-head em{
  padding:4px 7px;
  border-radius:999px;
  background:#111;
  color:#fff;
  font-size:8px;
  font-style:normal;
  font-weight:900;
}
.crm-permission-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:7px;
}
.crm-permission-item{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  align-items:start;
  gap:8px;
  padding:9px;
  border:1px solid #e6e6e6;
  border-radius:10px;
  background:#fff;
  cursor:pointer;
}
.crm-permission-item.enabled{
  border-color:#cfe3d6;
  background:#f8fff9;
}
.crm-permission-item input{
  width:18px;
  height:18px;
  margin-top:1px;
}
.crm-permission-item>span{
  display:grid;
  gap:2px;
}
.crm-permission-item strong{
  font-size:9px;
}
.crm-permission-item small{
  color:#777;
  font-size:8px;
  line-height:1.35;
}

.force-password-modal{
  position:fixed;
  inset:0;
  z-index:50000;
  display:grid;
  place-items:center;
  padding:16px;
}
.force-password-backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.7);
  backdrop-filter:blur(3px);
}
.force-password-panel{
  position:relative;
  z-index:1;
  width:min(480px,96vw);
  padding:24px;
  border-radius:22px;
  background:#fff;
  box-shadow:0 30px 100px rgba(0,0,0,.35);
}
.force-password-icon{
  display:grid;
  place-items:center;
  width:52px;
  height:52px;
  margin-bottom:10px;
  border-radius:15px;
  background:#fff0f1;
  font-size:25px;
}
.force-password-panel h2{
  margin:9px 0 6px;
  font-size:23px;
}
.force-password-panel>p{
  margin:0 0 15px;
  color:#666;
  font-size:10px;
  line-height:1.5;
}
#forcePasswordChangeForm{
  display:grid;
  gap:10px;
}
#forcePasswordChangeForm label{
  display:grid;
  gap:5px;
  font-size:9px;
  font-weight:900;
}
#forcePasswordChangeForm>small{
  color:#777;
  font-size:8px;
}
.force-password-error{
  padding:8px 9px;
  border-radius:9px;
  background:#fff0f1;
  color:#a00010;
  font-size:9px;
  font-weight:800;
}
#forcePasswordLogout{
  margin-top:8px;
}
@media(max-width:650px){
  .crm-permission-grid{
    grid-template-columns:1fr;
  }
  .crm-permission-editor-head{
    flex-direction:column;
  }
}


/* =========================================================
   V18.9 — ZAPROSZENIA DO KONTA
   ========================================================= */
.crm-invite-option{
  display:grid!important;
  grid-template-columns:auto minmax(0,1fr);
  align-items:start;
  gap:10px!important;
  padding:11px 12px;
  border:1px solid #d8e8dc;
  border-radius:12px;
  background:#f8fff9;
}
.crm-invite-option>input{
  width:19px;
  height:19px;
  margin-top:2px;
}
.crm-invite-option>span{
  display:grid;
  gap:3px;
}
.crm-invite-option strong{
  font-size:10px;
}
.crm-invite-option small{
  color:#607267;
  font-size:8px;
  line-height:1.45;
}
.crm-invite-ok{
  color:#13743a!important;
}
.crm-invite-error{
  color:#ae0013!important;
}
.user-invite-status{
  display:inline-flex;
  align-items:center;
  min-height:20px;
  padding:3px 6px;
  border-radius:999px;
  background:#fff4d8;
  color:#795400;
  font-size:7px;
  font-weight:900;
}
.user-invite-status.failed{
  background:#fff0f1;
  color:#a00010;
}


/* =========================================================
   V18.9.1 — WŁASNA STRONA AKTYWACJI KONTA
   ========================================================= */
html.account-action-mode,
body.account-action-mode{
  min-height:100%;
  background:
    radial-gradient(circle at 20% 10%, rgba(237,16,40,.08), transparent 28%),
    linear-gradient(145deg,#fafafa,#f3f3f4);
}
body.account-action-mode{
  min-height:100vh;
  margin:0;
}
.account-action-page{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:28px 16px;
  box-sizing:border-box;
  font-family:Arial,Helvetica,sans-serif;
}
.account-action-card{
  width:min(480px,100%);
  padding:28px;
  box-sizing:border-box;
  border:1px solid #e8e8e8;
  border-radius:24px;
  background:#fff;
  box-shadow:0 28px 80px rgba(0,0,0,.10);
}
.account-action-logo{
  display:block;
  width:150px;
  max-width:55%;
  height:auto;
  margin:0 auto 22px;
}
.account-action-card .brush-title{
  display:inline-flex;
  margin-bottom:9px;
}
.account-action-card h1{
  margin:0 0 8px;
  font-size:27px;
  line-height:1.12;
}
.account-action-card>p{
  margin:0 0 17px;
  color:#666;
  font-size:12px;
  line-height:1.55;
}
.account-action-login{
  display:grid;
  gap:4px;
  margin:14px 0;
  padding:11px 12px;
  border:1px solid #e8e8e8;
  border-radius:12px;
  background:#fafafa;
}
.account-action-login span{
  color:#777;
  font-size:9px;
}
.account-action-login strong{
  font-size:11px;
  overflow-wrap:anywhere;
}
.account-action-form{
  display:grid;
  gap:11px;
}
.account-action-form label{
  display:grid;
  gap:5px;
  font-size:10px;
  font-weight:900;
}
.account-password-field{
  display:grid;
  grid-template-columns:minmax(0,1fr) 42px;
}
.account-password-field .input{
  border-radius:10px 0 0 10px;
}
.account-password-field button{
  border:1px solid #ddd;
  border-left:0;
  border-radius:0 10px 10px 0;
  background:#fafafa;
  cursor:pointer;
}
.account-password-rules{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
}
.account-password-rules span{
  padding:4px 7px;
  border-radius:999px;
  background:#f2f2f2;
  color:#666;
  font-size:8px;
}
.account-action-error{
  padding:9px 10px;
  border-radius:10px;
  background:#fff0f1;
  color:#a00010;
  font-size:9px;
  font-weight:800;
}
.account-action-icon{
  display:grid;
  place-items:center;
  width:56px;
  height:56px;
  margin:0 auto 16px;
  border-radius:50%;
  font-size:27px;
  font-weight:950;
}
.account-action-icon.success{
  background:#eaf8ef;
  color:#15733a;
}
.account-action-icon.error{
  background:#fff0f1;
  color:#ad0013;
}
.account-action-card.success{
  text-align:center;
}
.account-action-card.success .account-action-login{
  text-align:left;
}
.account-action-muted{
  color:#888!important;
  font-size:10px!important;
}
.account-action-spinner{
  width:30px;
  height:30px;
  margin:4px auto 16px;
  border:3px solid #eee;
  border-top-color:#ed1028;
  border-radius:50%;
  animation:accountActionSpin .8s linear infinite;
}
@keyframes accountActionSpin{
  to{transform:rotate(360deg)}
}
@media(max-width:520px){
  .account-action-page{
    align-items:end;
    padding:0;
  }
  .account-action-card{
    width:100%;
    padding:24px 18px calc(24px + env(safe-area-inset-bottom,0px));
    border-radius:24px 24px 0 0;
  }
}


/* =========================================================
   V19.0 — FINAL MOBILE POLISH / RELEASE CANDIDATE
   ========================================================= */
.mobile-lesson-list-toggle{
  display:none;
}

:root{
  --app-mobile-nav-height:72px;
  --app-safe-top:env(safe-area-inset-top,0px);
  --app-safe-right:env(safe-area-inset-right,0px);
  --app-safe-bottom:env(safe-area-inset-bottom,0px);
  --app-safe-left:env(safe-area-inset-left,0px);
}

html{
  width:100%;
  min-width:0;
  overflow-x:hidden;
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
}

body{
  width:100%;
  min-width:0;
  overflow-x:hidden;
  overscroll-behavior-x:none;
}

img,
video,
iframe,
canvas,
svg{
  max-width:100%;
}

input,
select,
textarea,
button{
  max-width:100%;
  box-sizing:border-box;
}

/* Desktop/tablet resilience — never squeeze major app columns below usable width. */
.content,
#view,
.lesson-main,
.crm-detail-pane,
.admin-card,
.certificate-view,
.training-report-card{
  min-width:0;
}

@media(max-width:1280px){
  .content{
    padding-left:20px;
    padding-right:20px;
  }

  .admin-workspace{
    grid-template-columns:minmax(280px,.9fr) minmax(0,1.2fr) !important;
  }

  .admin-workspace > :nth-child(3){
    grid-column:1 / -1;
  }

  .crm-overview-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .crm-overview-grid .crm-wide{
    grid-column:1 / -1;
  }
}

/* ---------- VIDEO: preserve the real frame instead of cropping it ---------- */
.video.custom-video-player>video,
.video.custom-video-player.player-fullscreen>video,
.video.custom-video-player:fullscreen>video,
.video.custom-video-player:-webkit-full-screen>video{
  object-fit:contain!important;
  object-position:center center!important;
  image-rendering:auto!important;
  background:#000!important;
}

.video.custom-video-player.player-fullscreen{
  width:var(--player-vw,100vw)!important;
  height:var(--player-vh,100dvh)!important;
  max-width:none!important;
  max-height:none!important;
  inset:0!important;
  border-radius:0!important;
  background:#000!important;
  grid-template-rows:minmax(0,1fr) 5px max(54px,calc(54px + var(--app-safe-bottom)))!important;
}

.video.custom-video-player.player-fullscreen>.video-controls{
  height:auto!important;
  min-height:54px!important;
  padding:
    7px
    max(10px,var(--app-safe-right))
    max(7px,var(--app-safe-bottom))
    max(10px,var(--app-safe-left))!important;
  gap:7px!important;
  flex-wrap:nowrap!important;
  overflow:hidden!important;
}

.video.custom-video-player.player-fullscreen>.video-progress-static{
  height:5px!important;
  min-height:5px!important;
}

.video.custom-video-player.player-fullscreen .video-spacer{
  min-width:0;
  flex:1 1 auto;
}

html.player-fullscreen-open,
body.player-fullscreen-open{
  position:fixed!important;
  inset:0!important;
  width:100%!important;
  height:100%!important;
  overflow:hidden!important;
  background:#000!important;
}

@media(max-width:960px){
  .video.custom-video-player{
    width:100%;
    margin:0;
    border-radius:14px;
  }

  .video.custom-video-player>video{
    width:100%!important;
    height:auto!important;
    aspect-ratio:16/9!important;
    object-fit:contain!important;
  }

  .video.custom-video-player>.video-controls{
    display:grid!important;
    grid-template-columns:auto auto minmax(82px,auto) 1fr auto auto!important;
    align-items:center!important;
    gap:6px!important;
    width:100%!important;
    min-height:52px!important;
    padding:7px 8px!important;
    flex-wrap:nowrap!important;
  }

  .video.custom-video-player .video-control-btn{
    min-width:42px;
    min-height:40px;
    padding:7px 9px;
    white-space:nowrap;
  }

  .video.custom-video-player #videoPlayBtn{
    min-width:92px;
  }

  .video.custom-video-player .video-time{
    min-width:82px;
    overflow:hidden;
    font-size:11px;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  .video.custom-video-player .video-volume{
    display:none!important;
  }

  .video.custom-video-player.player-fullscreen>.video-controls{
    display:grid!important;
    grid-template-columns:auto auto minmax(90px,auto) 1fr auto auto!important;
  }

  .video.custom-video-player.player-fullscreen .video-control-btn{
    min-height:40px!important;
    padding:6px 9px!important;
    font-size:13px!important;
  }

  .video.custom-video-player.player-fullscreen #videoPlayBtn{
    min-width:88px;
  }

  .video.custom-video-player.player-fullscreen .video-time{
    font-size:11px!important;
  }

  .external-video{
    width:100%;
    aspect-ratio:16/9;
    min-height:0!important;
  }

  .external-video iframe{
    width:100%!important;
    height:100%!important;
  }
}

@media(max-width:560px){
  .video.custom-video-player>.video-controls{
    grid-template-columns:auto minmax(86px,1fr) auto auto!important;
  }

  .video.custom-video-player #videoBackBtn{
    font-size:0;
  }
  .video.custom-video-player #videoBackBtn::after{
    content:"↶10s";
    font-size:12px;
  }

  .video.custom-video-player .video-time{
    grid-column:1 / -1;
    grid-row:2;
    width:100%;
    min-width:0;
    padding:0 3px 2px;
    text-align:left;
  }

  .video.custom-video-player .video-spacer{
    display:none;
  }

  .video.custom-video-player.player-fullscreen>.video-controls{
    grid-template-columns:auto minmax(82px,1fr) auto auto!important;
  }

  .video.custom-video-player.player-fullscreen .video-time{
    grid-column:auto;
    grid-row:auto;
    width:auto;
    min-width:74px;
    padding:0;
  }

  .video.custom-video-player.player-fullscreen #videoBackBtn{
    font-size:0!important;
  }
  .video.custom-video-player.player-fullscreen #videoBackBtn::after{
    content:"↶10s";
    font-size:12px!important;
  }
}

@media(orientation:landscape) and (max-height:600px){
  .video.custom-video-player.player-fullscreen{
    grid-template-rows:minmax(0,1fr) 4px max(48px,calc(48px + var(--app-safe-bottom)))!important;
  }

  .video.custom-video-player.player-fullscreen>.video-controls{
    min-height:48px!important;
    padding-top:4px!important;
    padding-bottom:max(4px,var(--app-safe-bottom))!important;
  }
}

/* ---------- MOBILE APP SHELL ---------- */
@media(max-width:960px){
  body{
    padding-left:var(--app-safe-left);
    padding-right:var(--app-safe-right);
  }

  .app{
    display:block!important;
    min-height:100dvh;
  }

  .sidebar{
    display:none!important;
  }

  .content{
    width:100%;
    padding:
      calc(12px + var(--app-safe-top))
      12px
      calc(var(--app-mobile-nav-height) + 28px + var(--app-safe-bottom))!important;
  }

  .topbar{
    position:sticky;
    top:0;
    z-index:8000;
    min-height:58px;
    margin:-12px -12px 14px!important;
    padding:
      max(10px,var(--app-safe-top))
      max(12px,var(--app-safe-right))
      10px
      max(12px,var(--app-safe-left))!important;
    border-bottom:1px solid rgba(0,0,0,.06);
    background:rgba(255,255,255,.95);
    backdrop-filter:blur(14px);
    -webkit-backdrop-filter:blur(14px);
  }

  .topbar h1{
    min-width:0;
    max-width:min(68vw,520px);
    overflow:hidden;
    font-size:21px!important;
    line-height:1.15;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  .topbar-actions{
    flex:0 0 auto;
    gap:6px;
  }

  .user-chip{
    padding:5px!important;
  }

  .user-chip span{
    display:none!important;
  }

  .avatar{
    width:36px;
    height:36px;
  }

  .notification-bell{
    min-width:42px;
    min-height:42px;
  }

  .mobile-nav{
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    min-height:var(--app-mobile-nav-height)!important;
    padding:
      5px
      max(5px,var(--app-safe-right))
      max(5px,var(--app-safe-bottom))
      max(5px,var(--app-safe-left))!important;
  }

  .mobile-nav button{
    min-width:0;
    min-height:56px!important;
    overflow:hidden;
  }

  .mobile-nav button small{
    max-width:100%;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  .mobile-more-panel{
    width:100%;
    max-height:min(80dvh,720px);
    padding-bottom:max(16px,var(--app-safe-bottom));
  }

  .notification-drawer-panel{
    width:min(100%,520px)!important;
    max-width:100%!important;
  }

  /* Dashboard/course cards */
  .grid-3,
  .grid-2,
  .dashboard-grid,
  .dashboard-metrics,
  .course-grid,
  .assigned-course-grid{
    grid-template-columns:1fr!important;
  }

  .todo-section{
    max-width:none!important;
  }

  .todo-list{
    grid-template-columns:1fr!important;
  }

  .todo-card{
    min-height:0!important;
  }

  .todo-card-main{
    align-items:stretch!important;
    flex-direction:column;
  }

  .todo-card .btn,
  .todo-card button{
    width:100%;
  }

  /* Course/lesson */
  .lesson-shell{
    display:block!important;
  }

  .mobile-lesson-list-toggle{
    position:sticky;
    top:62px;
    z-index:6;
    display:flex!important;
    align-items:center;
    justify-content:center;
    gap:8px;
    width:100%;
    min-height:46px;
    margin:0 0 8px;
    border:1px solid #e5e5e5;
    border-radius:12px;
    background:rgba(255,255,255,.98);
    box-shadow:0 5px 16px rgba(0,0,0,.05);
    color:#222;
    font-weight:900;
  }

  .lesson-sidebar{
    display:none!important;
    position:relative!important;
    max-height:55dvh!important;
    margin:0 0 10px!important;
    padding:10px!important;
    overflow:auto!important;
    border-radius:14px!important;
  }

  .lesson-sidebar.mobile-open{
    display:block!important;
  }

  .lesson-sidebar h3{
    display:block!important;
    margin:2px 0 10px;
    font-size:15px;
  }

  .lesson-nav-item{
    min-height:46px;
    padding:10px!important;
  }

  .lesson-main{
    width:100%;
  }

  .lesson-stage{
    padding:12px!important;
  }

  .lesson-stage-item{
    min-width:0;
  }

  .lesson-actions,
  .quiz-actions{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:8px!important;
  }

  .lesson-actions .btn,
  .quiz-actions .btn{
    width:100%;
    min-height:46px;
  }

  .quiz-shell{
    width:100%;
    max-width:none;
  }

  .quiz-answer{
    min-height:52px;
    padding:13px!important;
  }

  /* forms */
  .form-grid,
  .crm-form .grid-2,
  .certificate-form .grid-2,
  .designer-properties-grid,
  .template-assets{
    grid-template-columns:1fr!important;
  }

  .span-2{
    grid-column:auto!important;
  }

  input.input,
  select.input,
  textarea.input{
    min-height:46px;
    font-size:16px!important; /* prevents iOS zoom */
  }

  textarea.input{
    min-height:110px;
  }

  .btn,
  .icon-btn{
    min-height:44px;
  }

  /* CRM users */
  .crm-users-shell{
    display:block!important;
    min-height:0!important;
  }

  .crm-user-list-pane{
    width:100%!important;
    min-width:0!important;
  }

  .crm-detail-pane{
    inset:0!important;
    padding-bottom:calc(var(--app-mobile-nav-height) + var(--app-safe-bottom))!important;
  }

  .crm-profile-header{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:12px!important;
    padding:
      calc(54px + var(--app-safe-top))
      14px
      14px!important;
  }

  .crm-profile-identity{
    align-items:flex-start!important;
  }

  .crm-profile-quick-stats{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    width:100%!important;
  }

  .crm-profile-tabs{
    top:0!important;
    padding:7px!important;
  }

  .crm-profile-tabs button{
    min-width:68px!important;
  }

  .crm-detail-content{
    padding:10px!important;
  }

  .crm-overview-grid{
    grid-template-columns:1fr!important;
  }

  .crm-overview-grid .crm-wide{
    grid-column:auto!important;
  }

  .crm-quick-actions{
    grid-template-columns:1fr 1fr!important;
  }

  .crm-created-user-card,
  .crm-add-user-grid,
  .crm-permission-grid{
    grid-template-columns:1fr!important;
  }

  /* Certificates */
  .certificate-tabs{
    flex-wrap:nowrap!important;
    overflow-x:auto;
    scroll-snap-type:x proximity;
    -webkit-overflow-scrolling:touch;
  }

  .certificate-tab{
    flex:0 0 auto;
    scroll-snap-align:start;
  }

  .certificate-list-row{
    grid-template-columns:14px minmax(0,1fr) auto!important;
  }

  .certificate-row-actions{
    grid-template-columns:1fr 1fr!important;
  }

  .certificate-preview-panel{
    min-width:0;
  }

  .certificate-sheet{
    width:100%!important;
    max-width:100%!important;
    margin-left:auto!important;
    margin-right:auto!important;
  }

  /* Admin */
  .admin-workspace,
  .admin-grid,
  .admin-layout,
  .admin-columns,
  .admin-panel-grid{
    display:grid!important;
    grid-template-columns:1fr!important;
  }

  .admin-card{
    min-height:0!important;
    width:100%!important;
  }

  .admin-card-head,
  .course-row-top,
  .tree-module-head,
  .tree-lesson{
    flex-wrap:wrap!important;
  }

  .tree-actions,
  .course-row-actions{
    width:100%;
  }

  /* PDF */
  .pdf-material .pdf-viewer{
    height:68dvh!important;
    min-height:420px!important;
  }
}

/* ---------- PHONE ---------- */
@media(max-width:620px){
  .content{
    padding-left:8px!important;
    padding-right:8px!important;
  }

  .topbar{
    margin-left:-8px!important;
    margin-right:-8px!important;
  }

  .topbar h1{
    font-size:18px!important;
    max-width:60vw;
  }

  .card,
  .crm-panel-card,
  .crm-metric-card{
    padding:12px!important;
    border-radius:14px!important;
  }

  .brush-title{
    padding:7px 11px!important;
    font-size:11px!important;
  }

  .course .cover{
    height:118px!important;
    padding:13px!important;
    font-size:18px!important;
  }

  .course-body{
    padding:12px!important;
  }

  .crm-profile-quick-stats strong{
    font-size:13px!important;
  }

  .crm-profile-quick-stats span{
    font-size:8px!important;
  }

  .crm-quick-actions{
    grid-template-columns:1fr!important;
  }

  .certificate-row-actions{
    grid-template-columns:1fr!important;
  }

  .pdf-material .pdf-viewer{
    height:64dvh!important;
    min-height:360px!important;
  }

  .system-modal-actions{
    grid-template-columns:1fr!important;
  }
}

/* ---------- TRAINING REPORT AS MOBILE CARDS ---------- */
@media(max-width:760px){
  .training-report-kpis{
    grid-template-columns:1fr 1fr!important;
  }

  .training-report-filters{
    grid-template-columns:1fr!important;
  }

  .training-report-table{
    overflow:visible!important;
  }

  .training-report-table-head{
    display:none!important;
  }

  .training-report-table-body{
    display:grid!important;
    gap:10px!important;
    padding:10px!important;
  }

  .training-report-row{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:10px!important;
    min-width:0!important;
    padding:12px!important;
    border:1px solid #e8e8e8!important;
    border-radius:14px!important;
    background:#fff;
  }

  .training-report-row.row-overdue{
    border-left:4px solid #b00012!important;
  }

  .training-report-row.row-urgent{
    border-left:4px solid #e0a000!important;
  }

  .training-report-row>[data-mobile-label]{
    display:grid;
    gap:5px;
    min-width:0;
  }

  .training-report-row>[data-mobile-label]::before{
    content:attr(data-mobile-label);
    color:#8a8a8a;
    font-size:8px;
    font-weight:900;
    text-transform:uppercase;
  }

  .training-report-person,
  .training-report-course,
  .training-report-progress{
    grid-column:1 / -1;
  }

  .training-report-actions{
    justify-content:flex-start!important;
  }
}

/* Touch devices */
@media(pointer:coarse){
  button,
  .btn,
  .icon-btn,
  .lesson-nav-item,
  .quiz-answer,
  .certificate-tab{
    touch-action:manipulation;
  }

  button,
  .btn,
  .icon-btn{
    min-height:44px;
  }
}

/* Standalone/home-screen mode */
@media(display-mode:standalone){
  .topbar{
    padding-top:max(12px,var(--app-safe-top))!important;
  }
}


/* =========================================================
   V19.0.1 — LOGO MOBILE + PODGLĄD HASŁA + TWARDY LOGOUT
   ========================================================= */

.login-mobile-logo{
  display:none;
}

.login-password-field{
  position:relative;
}

.login-password-field .input{
  padding-right:58px;
}

.login-password-toggle{
  position:absolute;
  top:50%;
  right:7px;
  display:grid;
  place-items:center;
  width:42px;
  height:42px;
  min-height:42px!important;
  padding:0;
  transform:translateY(-50%);
  border:0;
  border-radius:11px;
  background:transparent;
  color:#555;
  cursor:pointer;
  font-size:20px;
  line-height:1;
}

.login-password-toggle:hover,
.login-password-toggle:focus-visible{
  background:#f4f4f5;
  outline:none;
}

/* Druga warstwa zabezpieczenia interfejsu po wylogowaniu.
   Nawet gdyby pojedynczy element zachował stan z poprzedniej sesji,
   cała prywatna część pozostaje niewidoczna. */
body.session-logged-out #app,
body.session-logged-out .mobile-nav,
body.session-logged-out .mobile-more-sheet,
body.session-logged-out .notification-drawer{
  display:none!important;
}

#app.hidden{
  display:none!important;
}

@media(max-width:960px){
  .login{
    min-height:100dvh;
  }

  .login-panel{
    min-height:100dvh;
    grid-template-columns:minmax(0,1fr);
    align-content:center;
    gap:24px;
    padding:max(26px,env(safe-area-inset-top,0px)) 22px max(30px,env(safe-area-inset-bottom,0px));
  }

  .login-mobile-logo{
    display:block;
    width:min(420px,78vw);
    margin:0 auto;
    padding:13px 18px;
    border:1px solid var(--line);
    border-radius:22px;
    background:#fff;
    box-shadow:0 12px 34px rgba(17,17,17,.08);
  }

  .login-mobile-logo img{
    width:100%;
    height:auto;
  }

  .login-box{
    width:min(450px,100%);
    margin:0 auto;
  }
}

@media(max-width:620px){
  .login-panel{
    gap:18px;
    padding:max(18px,env(safe-area-inset-top,0px)) 16px max(22px,env(safe-area-inset-bottom,0px));
  }

  .login-mobile-logo{
    width:min(330px,82vw);
    padding:10px 14px;
    border-radius:18px;
  }

  .login-box h2{
    font-size:29px;
  }
}


/* =========================================================
   V19.4.0 — HISTORIA SPA + RAPORT KURSU + PLAYER CLEANUP
   ========================================================= */

.course-training-report-compact-card{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto auto;
  align-items:center;
  gap:14px;
  margin:0 0 14px;
  padding:15px 16px;
  border:1px solid #e6e6e8;
  border-radius:18px;
  background:linear-gradient(135deg,#fff 0%,#fafafa 100%);
}

.course-training-report-compact-icon{
  display:grid;
  place-items:center;
  width:46px;
  height:46px;
  border-radius:14px;
  background:#f3f3f4;
  font-size:24px;
}

.course-training-report-compact-copy{
  min-width:0;
}

.course-training-report-compact-copy strong{
  display:block;
  margin-bottom:4px;
  font-size:15px;
}

.course-training-report-compact-copy p{
  margin:0;
  color:#707075;
  font-size:12px;
  line-height:1.45;
}

.course-training-report-compact-tags{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:6px;
}

.course-training-report-compact-tags span{
  padding:6px 8px;
  border:1px solid #e4e4e6;
  border-radius:999px;
  background:#fff;
  color:#606066;
  font-size:10px;
  font-weight:800;
  white-space:nowrap;
}

.training-report-context{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin:14px 0 2px;
  padding:13px 14px;
  border:1px solid #e5e5e7;
  border-radius:14px;
  background:#fafafa;
}

.training-report-context>div{
  display:grid;
  gap:2px;
}

.training-report-context span,
.training-report-context small{
  color:#77777d;
  font-size:10px;
}

.training-report-context strong{
  font-size:14px;
}

.account-created-status{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  margin:16px 0;
}

.account-created-status>div{
  display:grid;
  place-items:center;
  gap:5px;
  min-height:76px;
  padding:10px 8px;
  border:1px solid #e5e5e7;
  border-radius:14px;
  background:#fafafa;
  text-align:center;
}

.account-created-status span{
  display:grid;
  place-items:center;
  width:26px;
  height:26px;
  border-radius:50%;
  background:#111;
  color:#fff;
  font-weight:900;
}

.account-created-status strong{
  font-size:11px;
}

@media(max-width:1100px){
  .course-training-report-compact-card{
    grid-template-columns:auto minmax(0,1fr) auto;
  }

  .course-training-report-compact-tags{
    grid-column:2 / -1;
    justify-content:flex-start;
  }
}

@media(max-width:760px){
  .course-training-report-compact-card{
    grid-template-columns:auto minmax(0,1fr);
    align-items:start;
  }

  .course-training-report-compact-tags,
  .course-training-report-compact-card>.btn{
    grid-column:1 / -1;
  }

  .course-training-report-compact-card>.btn{
    width:100%;
  }

  .training-report-context{
    align-items:stretch;
    flex-direction:column;
  }

  .training-report-context .btn{
    width:100%;
  }

  .account-created-status{
    grid-template-columns:1fr;
  }

  .account-created-status>div{
    min-height:58px;
    grid-template-columns:auto 1fr;
    justify-items:start;
    text-align:left;
  }
}


/* =========================================================
   V19.4.0 — STATUS AKTYWACJI KONTA W KARCIE UŻYTKOWNIKA
   ========================================================= */
.crm-account-activation{
  flex:1 1 470px;
  min-width:410px;
  max-width:620px;
  display:grid;
  gap:6px;
  padding:9px 10px;
  border:1px solid #ececec;
  border-radius:13px;
  background:#fcfcfc;
}
.crm-account-activation-title{
  color:#8a8a8a;
  font-size:9px;
  font-weight:850;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.crm-account-activation-steps{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:6px;
}
.crm-account-activation-step{
  display:grid;
  grid-template-columns:24px minmax(0,1fr);
  align-items:center;
  gap:7px;
  min-width:0;
  padding:6px 7px;
  border:1px solid #e7e7e7;
  border-radius:10px;
  background:#fff;
}
.crm-account-activation-icon{
  display:grid;
  place-items:center;
  width:24px;
  height:24px;
  border-radius:50%;
  background:#f0f0f0;
  color:#777;
  font-size:11px;
  font-weight:950;
}
.crm-account-activation-copy{
  display:grid;
  gap:1px;
  min-width:0;
}
.crm-account-activation-copy small{
  color:#8b8b8b;
  font-size:8px;
  line-height:1.1;
}
.crm-account-activation-copy strong{
  overflow:hidden;
  color:#555;
  font-size:9px;
  line-height:1.2;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.crm-account-activation-step.done{
  border-color:#d9ecdf;
  background:#fbfffc;
}
.crm-account-activation-step.done .crm-account-activation-icon{
  background:#e1f5e7;
  color:#17823b;
}
.crm-account-activation-step.done .crm-account-activation-copy strong{
  color:#176f35;
}
.crm-account-activation-step.error{
  border-color:#f3d1d5;
  background:#fffafb;
}
.crm-account-activation-step.error .crm-account-activation-icon{
  background:#fbe3e6;
  color:#b61f30;
}
.crm-account-activation-step.error .crm-account-activation-copy strong{
  color:#a51d2c;
}
@media(max-width:1300px){
  .crm-profile-header{
    flex-wrap:wrap;
  }
  .crm-account-activation{
    order:3;
    flex-basis:100%;
    width:100%;
    max-width:none;
    min-width:0;
  }
}
@media(max-width:780px){
  .crm-account-activation{
    width:100%;
    min-width:0;
    padding:8px;
  }
  .crm-account-activation-steps{
    grid-template-columns:1fr;
  }
  .crm-account-activation-copy small{
    font-size:10px;
  }
  .crm-account-activation-copy strong{
    font-size:11px;
    white-space:normal;
  }
}

/* V19.4.0 — Choreografie */
.choreo-page-head{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin-bottom:18px}
.choreo-page-head h2{font-size:30px;margin:18px 0 7px}.choreo-page-head p{margin:0}
.choreo-toolbar{display:grid;grid-template-columns:minmax(240px,1.5fr) repeat(5,minmax(135px,.72fr));gap:10px;align-items:center;padding:14px}
.choreo-search{position:relative}.choreo-search>span{position:absolute;left:13px;top:50%;transform:translateY(-50%);z-index:1}.choreo-search .input{padding-left:39px}
.choreo-library-meta{display:flex;align-items:baseline;gap:6px;margin:16px 2px 10px;color:var(--muted)}.choreo-library-meta strong{font-size:21px;color:var(--ink)}
.choreo-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:17px}
.choreo-card{background:#fff;border:1px solid var(--line);border-radius:22px;overflow:hidden;cursor:pointer;transition:.18s;box-shadow:0 4px 16px rgba(0,0,0,.035)}
.choreo-card:hover{transform:translateY(-2px);box-shadow:var(--shadow)}
.choreo-cover{min-height:190px;padding:16px 18px;color:#fff;display:flex;flex-direction:column;justify-content:space-between;position:relative;overflow:hidden}
.choreo-cover:after{content:"";position:absolute;width:170px;height:170px;border:38px solid rgba(255,255,255,.1);border-radius:50%;right:-60px;bottom:-74px}
.choreo-cover.dance{background:linear-gradient(145deg,#bf0011,#ff4150)}.choreo-cover.ballet{background:linear-gradient(145deg,#7b456c,#db8bbd)}.choreo-cover.kpop{background:linear-gradient(145deg,#25213f,#a643bc)}.choreo-cover.cheer{background:linear-gradient(145deg,#a32b00,#ff8a00)}
.choreo-cover-top{display:flex;justify-content:space-between;gap:10px;align-items:flex-start;position:relative;z-index:1}.choreo-cover-top>span{font-size:11px;font-weight:950;text-transform:uppercase;letter-spacing:.35px;background:rgba(255,255,255,.17);border:1px solid rgba(255,255,255,.24);padding:6px 8px;border-radius:999px}
.choreo-publication.published{background:rgba(14,119,71,.88)!important}.choreo-publication.draft{background:rgba(29,29,29,.6)!important}.choreo-publication.archived{background:rgba(107,107,107,.75)!important}
.choreo-cover>div:last-child{position:relative;z-index:1}.choreo-cover-icon{font-size:35px;margin-bottom:7px}.choreo-cover strong{display:block;font-size:23px;line-height:1.08;max-width:90%}
.choreo-card-body{padding:17px}.choreo-card-body p{min-height:42px;color:var(--muted);font-size:13px;line-height:1.55;margin:12px 0}.choreo-tags{display:flex;gap:6px;flex-wrap:wrap}.choreo-tags span{font-size:11px;font-weight:850;padding:5px 8px;border-radius:999px;background:#f4f4f5;color:#525258}
.choreo-card-assets{display:flex;gap:8px;flex-wrap:wrap;padding:11px 0;border-top:1px solid #f0f0f0}.choreo-card-assets span{font-size:12px;font-weight:850}.choreo-card-assets .ready{color:#176e47}.choreo-card-assets .missing{color:#999}
.choreo-learning-row,.choreo-admin-card-row{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:10px}.choreo-admin-card-row>span{font-size:12px;color:var(--muted);font-weight:800}.choreo-admin-card-row .btn{padding:8px 11px;font-size:12px}
.choreo-learning-badge{display:inline-flex;align-items:center;gap:6px;padding:7px 9px;border-radius:999px;font-size:12px;font-weight:950}.choreo-learning-badge.not-started{background:#f2f2f3;color:#6a6a70}.choreo-learning-badge.learning{background:#fff3d8;color:#8b5a00}.choreo-learning-badge.mastered{background:#eaf9f0;color:#0f7042}.choreo-watched{font-size:12px;color:var(--muted);font-weight:800}
.choreo-empty>div{font-size:48px}.choreo-empty h2{color:var(--ink);margin-bottom:6px}

.choreo-back{border:0;background:transparent;padding:0;color:#555;font-weight:900;cursor:pointer;margin-bottom:17px}.choreo-back:hover{color:var(--red)}
.choreo-detail-head{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin-bottom:18px}.choreo-detail-head h2{font-size:34px;margin:13px 0 7px}.choreo-detail-head p{margin:0;color:var(--muted);max-width:850px;line-height:1.6}
.choreo-detail-layout{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(280px,.55fr);gap:18px;align-items:start}.choreo-detail-layout>aside{position:sticky;top:16px}
.choreo-section-title{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-bottom:14px}.choreo-section-title>div{display:flex;align-items:center;gap:10px}.choreo-section-title>div>span{font-size:29px}.choreo-section-title strong,.choreo-section-title small{display:block}.choreo-section-title small{color:var(--muted);margin-top:3px}
.choreo-player-wrap{background:#0d0d0d;border-radius:18px;overflow:hidden}.choreo-player-wrap video{width:100%;display:block;max-height:72vh;background:#000;object-fit:contain}.choreo-player-tools{display:flex;gap:9px;align-items:flex-end;flex-wrap:wrap;margin-top:12px}.choreo-player-tools label{margin:0;min-width:135px}.choreo-player-tools label .input{margin-top:6px;padding:9px 11px}.choreo-player-tools .btn.active{border-color:var(--red);background:var(--soft);color:var(--red)}
.choreo-watch-progress{height:8px;background:#ececef;border-radius:999px;overflow:hidden;margin:14px 0 6px}.choreo-watch-progress i{display:block;height:100%;background:linear-gradient(90deg,var(--red),var(--red2));transition:width .2s ease}
.choreo-music-card{margin-top:18px}.choreo-music-card audio{display:block;width:100%;margin:8px 0 12px}.choreo-music-actions{display:flex;justify-content:flex-end}.choreo-download-disabled{display:inline-flex;align-items:center;gap:6px;padding:9px 11px;border-radius:11px;background:#f4f4f5;color:#666;font-size:12px;font-weight:800}
.choreo-no-media{display:grid;place-items:center;gap:8px;min-height:180px;border:1px dashed #d7d7da;border-radius:16px;color:var(--muted);background:#fafafa}.choreo-no-media span{font-size:36px}
.choreo-info-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:18px}.choreo-info-card{display:flex;gap:13px}.choreo-info-card:last-child:nth-child(odd){grid-column:1/-1}.choreo-info-icon{font-size:28px}.choreo-info-card h3{margin:2px 0 8px}.choreo-info-card p{margin:0;color:#555;line-height:1.65}
.choreo-status-card .brush-title,.choreo-admin-detail-card .brush-title{font-size:12px}.choreo-status-hero{display:flex;align-items:center;gap:10px;padding:18px 0 8px}.choreo-status-hero>span{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;font-size:22px;background:#f3f3f4}.choreo-status-hero strong{font-size:23px}.choreo-status-hero.mastered>span{background:#eaf9f0;color:#0f7042}.choreo-status-hero.learning>span{background:#fff3d8;color:#8b5a00}.choreo-status-date{display:block;margin-top:10px;color:var(--muted)}.choreo-admin-detail-meta{display:grid;gap:8px;font-size:13px}

.choreo-modal{position:fixed;inset:0;z-index:9500;display:grid;place-items:center;padding:20px}.choreo-modal-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.48);backdrop-filter:blur(5px)}.choreo-editor{position:relative;width:min(980px,100%);max-height:94vh;overflow:auto;background:#fff;border-radius:24px;box-shadow:0 30px 90px rgba(0,0,0,.25)}body.choreo-modal-open{overflow:hidden}
.choreo-editor-header{position:sticky;top:0;z-index:3;display:flex;justify-content:space-between;align-items:flex-start;gap:14px;padding:20px 22px 16px;background:rgba(255,255,255,.97);border-bottom:1px solid var(--line);backdrop-filter:blur(14px)}.choreo-editor-header h2{margin:13px 0 0}.choreo-editor-close{width:40px;height:40px;border:1px solid var(--line);border-radius:50%;background:#fff;font-size:26px;cursor:pointer}
.choreo-editor-form{padding:0 22px 22px}.choreo-editor-section{padding:21px 0;border-bottom:1px solid #ededee}.choreo-editor-section h3{margin:0 0 10px}.choreo-upload-grid{display:grid;grid-template-columns:1fr 1fr;gap:13px}.choreo-upload-box{border:1px dashed #d5d5d8;border-radius:16px;padding:13px;background:#fbfbfb}.choreo-upload-head{display:flex;justify-content:space-between;gap:10px;margin-bottom:10px}.choreo-upload-head span{font-size:11px;color:var(--muted);overflow-wrap:anywhere;text-align:right}.choreo-upload-progress{height:8px;background:#e9e9eb;border-radius:999px;overflow:hidden;margin-top:10px}.choreo-upload-progress i{display:block;height:100%;width:0;background:linear-gradient(90deg,var(--red),var(--red2));transition:width .18s ease}
.choreo-switch-row{display:flex;gap:11px;align-items:flex-start;margin-top:14px;padding:13px;border:1px solid var(--line);border-radius:14px;background:#fff}.choreo-switch-row.primary{background:#fff7f8;border-color:#ffd5d9}.choreo-switch-row input{width:19px;height:19px;margin-top:2px}.choreo-switch-row span,.choreo-switch-row strong,.choreo-switch-row small{display:block}.choreo-switch-row small{color:var(--muted);margin-top:4px;line-height:1.45}
.choreo-selective-access{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:12px;transition:.2s}.choreo-selective-access.disabled{opacity:.38;pointer-events:none}.choreo-access-column{border:1px solid var(--line);border-radius:16px;padding:13px}.choreo-access-column h4{margin:0 0 4px}.choreo-access-column>p{margin:0 0 10px;color:var(--muted);font-size:12px}.choreo-access-list{display:grid;gap:5px;max-height:245px;overflow:auto;padding-right:4px}.choreo-access-item{display:flex;gap:8px;align-items:flex-start;margin:0;padding:8px;border-radius:10px;font-size:12px}.choreo-access-item:hover{background:#fafafa}.choreo-access-item input{margin-top:2px}.choreo-access-empty,.choreo-access-info{padding:13px;border-radius:13px;background:#f6f6f7;color:#666;font-size:12px;line-height:1.5}.choreo-access-info{margin-top:12px}
.choreo-editor-footer{display:flex;justify-content:space-between;align-items:center;gap:12px;padding-top:18px}.choreo-editor-footer>div{display:flex;gap:9px}

.mobile-more-notifications[data-view="profile"]{border-bottom:1px solid var(--line)}

@media(max-width:1280px){.choreo-toolbar{grid-template-columns:repeat(3,minmax(0,1fr))}.choreo-search{grid-column:1/-1}.choreo-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:900px){.choreo-detail-layout{grid-template-columns:1fr}.choreo-detail-layout>aside{position:static}.choreo-info-grid{grid-template-columns:1fr}.choreo-info-card:last-child:nth-child(odd){grid-column:auto}}
@media(max-width:760px){
  .choreo-page-head,.choreo-detail-head{flex-direction:column}.choreo-page-head h2{font-size:25px}.choreo-detail-head h2{font-size:29px}.choreo-page-head .btn,.choreo-detail-head .btn{width:100%}
  .choreo-toolbar{grid-template-columns:1fr 1fr;padding:11px}.choreo-search{grid-column:1/-1}.choreo-grid{grid-template-columns:1fr}.choreo-cover{min-height:165px}.choreo-cover strong{font-size:21px}
  .choreo-player-tools{display:grid;grid-template-columns:1fr 1fr}.choreo-player-tools label{grid-column:1/-1;width:100%}.choreo-player-tools .btn{width:100%}
  .choreo-modal{padding:0;place-items:stretch}.choreo-editor{width:100%;max-height:100dvh;border-radius:0}.choreo-editor-header{padding:15px}.choreo-editor-form{padding:0 15px 18px}.choreo-upload-grid,.choreo-selective-access{grid-template-columns:1fr}.choreo-editor-footer{align-items:stretch;flex-direction:column-reverse}.choreo-editor-footer>div{display:grid;grid-template-columns:1fr 1fr}.choreo-editor-footer>.btn{width:100%}
}
@media(max-width:480px){.choreo-toolbar{grid-template-columns:1fr}.choreo-search{grid-column:auto}.choreo-player-tools{grid-template-columns:1fr}.choreo-player-tools label{grid-column:auto}.choreo-editor-footer>div{grid-template-columns:1fr}}

/* V19.4.0 — autosave szkicu choreografii + audio MPEG */
.choreo-draft-notice{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:16px 0 0;padding:12px 14px;border:1px solid #bfe8d1;border-radius:14px;background:#f1fbf5;color:#175b39}
.choreo-draft-notice.subtle{border-color:#e5e5e8;background:#fafafa;color:#555}
.choreo-draft-notice strong,.choreo-draft-notice small{display:block}.choreo-draft-notice small{margin-top:3px;color:#65736b;line-height:1.45}
.choreo-draft-notice .btn{flex:0 0 auto;padding:8px 11px;font-size:12px}
.choreo-file-help{margin:9px 2px 0;color:var(--muted);font-size:11px;line-height:1.45}
@media(max-width:760px){.choreo-draft-notice{align-items:flex-start;flex-direction:column}.choreo-draft-notice .btn{width:100%}}


/* V19.4.0 — Choreografie PRO */
.choreo-toolbar{grid-template-columns:minmax(240px,1.5fr) repeat(6,minmax(125px,.72fr))}
.choreo-head-actions,.choreo-detail-admin-actions{display:flex;gap:9px;flex-wrap:wrap;justify-content:flex-end}
.choreo-summary-strip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:14px 0}
.choreo-summary-strip>button,.choreo-summary-strip>div{border:1px solid var(--line);border-radius:15px;background:#fff;padding:12px 14px;display:flex;align-items:baseline;gap:7px;text-align:left}
.choreo-summary-strip>button{cursor:pointer}.choreo-summary-strip>button:hover{border-color:#efc5c9;background:#fffafb}
.choreo-summary-strip strong{font-size:22px}.choreo-summary-strip span{font-size:12px;color:var(--muted);font-weight:800}
.choreo-card-flags{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin-top:3px}
.choreo-new-badge{font-size:10px;font-weight:950;letter-spacing:.4px;color:#fff;background:var(--red);border-radius:999px;padding:5px 8px}
.choreo-deadline,.choreo-detail-deadline{font-size:11px;font-weight:900;border-radius:999px;padding:5px 8px;background:#f3f3f4;color:#666}
.choreo-deadline.overdue,.choreo-detail-deadline.overdue{background:#ffe8eb;color:#a31525}.choreo-deadline.today,.choreo-detail-deadline.today{background:#fff0d9;color:#8a5500}.choreo-deadline.soon,.choreo-detail-deadline.soon{background:#fff7df;color:#7a5b00}
.choreo-detail-deadline{display:inline-flex;margin-top:10px}
.choreo-favorite-btn{margin-left:auto;width:34px;height:34px;border:1px solid var(--line);background:#fff;border-radius:50%;display:grid;place-items:center;font-size:20px;cursor:pointer;color:#777}
.choreo-favorite-btn.active{color:#d69b00;background:#fff9df;border-color:#f2d77b}.choreo-favorite-btn.large{width:42px;height:42px;font-size:25px;margin:0}
.choreo-title-row{display:flex;gap:10px;align-items:center}.choreo-title-row h2{margin-right:auto}
.choreo-player-wrap video.mirrored{transform:scaleX(-1)}
.choreo-media-tabs{display:flex;gap:7px;overflow:auto;padding:1px 0 10px;scrollbar-width:thin}
.choreo-media-tabs button{white-space:nowrap;border:1px solid var(--line);border-radius:999px;background:#fff;padding:8px 10px;font-size:12px;font-weight:850;cursor:pointer}
.choreo-media-tabs button.active{border-color:#f1aeb5;background:#fff1f3;color:#a80012}
.choreo-chapters{margin-top:13px;padding:12px;border:1px solid var(--line);border-radius:15px;background:#fafafa}
.choreo-chapters>strong{display:block;margin-bottom:8px}.choreo-chapters>div{display:flex;gap:7px;flex-wrap:wrap}
.choreo-chapters button{border:1px solid #dedee1;background:#fff;border-radius:10px;padding:8px 10px;cursor:pointer;font-weight:800;font-size:12px}
.choreo-chapters button span{color:var(--red);margin-right:6px}
.choreo-music-actions{align-items:center;gap:10px;flex-wrap:wrap}.choreo-music-actions>span:first-child{margin-right:auto;font-weight:850;font-size:12px}
.choreo-existing-assets{display:flex;gap:7px;flex-wrap:wrap;padding:10px 12px;background:#fafafa;border:1px solid var(--line);border-radius:14px;margin-bottom:10px}
.choreo-existing-assets strong{width:100%;font-size:12px}.choreo-existing-assets span{background:#fff;border:1px solid var(--line);border-radius:999px;padding:6px 8px;font-size:11px}
.choreo-media-label-row{margin:10px 0}.choreo-media-label-row label{display:block}.choreo-multi-select{min-height:80px}
.choreo-settings-editor{width:min(1040px,100%)}.choreo-settings-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;padding-top:20px}
.choreo-settings-grid label{margin:0}.choreo-settings-grid textarea{margin-top:6px;resize:vertical}.choreo-settings-grid small{display:block;color:var(--muted);margin-top:5px}
.choreo-settings-note{margin-top:15px;padding:11px 13px;border-radius:12px;background:#f6f6f7;color:#666;font-size:12px}
.choreo-report-editor{width:min(1120px,100%)}.choreo-report-toolbar{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding:15px 22px;border-bottom:1px solid var(--line)}
.choreo-report-list{padding:8px 22px 22px;display:grid;gap:7px}.choreo-report-row{display:grid;grid-template-columns:minmax(180px,1.4fr) minmax(140px,.8fr) auto minmax(145px,.7fr);gap:12px;align-items:center;padding:11px 12px;border:1px solid var(--line);border-radius:13px}
.choreo-report-person strong,.choreo-report-person small{display:block}.choreo-report-person small{color:var(--muted);margin-top:3px}.choreo-report-progress{display:flex;gap:8px;align-items:center}.choreo-report-progress>span{height:7px;background:#ececef;border-radius:999px;overflow:hidden;flex:1}.choreo-report-progress i{display:block;height:100%;background:linear-gradient(90deg,var(--red),var(--red2))}
.choreo-version-card{margin-top:14px}.choreo-version-card .brush-title{font-size:12px}.choreo-version-list{display:grid;gap:8px;margin-top:12px}.choreo-version-list>div{display:grid;grid-template-columns:auto 1fr;gap:2px 8px;padding-bottom:8px;border-bottom:1px solid #eee}.choreo-version-list strong{color:var(--red)}.choreo-version-list small{grid-column:2;color:var(--muted)}
.choreo-preview-editor{width:min(850px,100%)}.choreo-preview-content{padding:20px}.choreo-preview-content video{width:100%;max-height:65vh;background:#000;border-radius:16px}.choreo-preview-content audio{width:100%;margin-top:15px}.choreo-preview-content .choreo-tags{margin:14px 0}
@media(max-width:1280px){.choreo-toolbar{grid-template-columns:repeat(3,minmax(0,1fr))}.choreo-search{grid-column:1/-1}}
@media(max-width:900px){.choreo-summary-strip{grid-template-columns:repeat(2,minmax(0,1fr))}.choreo-report-row{grid-template-columns:1fr 1fr}.choreo-settings-grid{grid-template-columns:1fr}}
@media(max-width:760px){
  .choreo-head-actions,.choreo-detail-admin-actions{width:100%;display:grid;grid-template-columns:1fr}
  .choreo-detail-admin-actions .btn{width:100%}
  .choreo-player-tools.pro{grid-template-columns:repeat(2,minmax(0,1fr))}
  .choreo-media-tabs{margin-inline:-2px}
  .choreo-report-toolbar{grid-template-columns:1fr;padding:12px 15px}.choreo-report-list{padding:8px 15px 18px}.choreo-report-row{grid-template-columns:1fr}
}

/* V19.4.0 — UX choreografii: kompaktowy player, chipy słowników, sezony */
.choreo-dictionary-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;padding-top:18px}
.choreo-dictionary-card{border:1px solid var(--line);border-radius:17px;background:#fff;padding:14px;min-width:0}
.choreo-dictionary-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:11px}
.choreo-dictionary-head h3{margin:0 0 4px;font-size:15px}.choreo-dictionary-head small{display:block;color:var(--muted);line-height:1.4}
.choreo-dictionary-head>span{flex:0 0 auto;padding:5px 8px;border-radius:999px;background:#f3f3f4;color:#666;font-size:10px;font-weight:900}
.choreo-dictionary-list{display:flex;flex-wrap:wrap;gap:7px;min-height:42px;align-content:flex-start}
.choreo-dictionary-chip{display:flex;align-items:center;gap:6px;max-width:100%;padding:6px 7px;border:1px solid #dedee2;border-radius:12px;background:#fafafa;cursor:grab;transition:.15s}
.choreo-dictionary-chip:hover{border-color:#efb8be;background:#fffafb}.choreo-dictionary-chip.dragging{opacity:.45;transform:scale(.98)}
.choreo-dictionary-drag{color:#aaa;font-weight:900;letter-spacing:-2px;user-select:none}.choreo-dictionary-chip>strong{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:240px}
.choreo-dictionary-chip>div{display:flex;gap:2px;margin-left:auto}.choreo-dictionary-chip button{width:25px;height:25px;border:0;border-radius:7px;background:#fff;color:#666;cursor:pointer;font-weight:950;line-height:1}
.choreo-dictionary-chip button:hover{background:#eee}.choreo-dictionary-chip button.remove:hover{background:#ffe9ec;color:#a90013}
.choreo-dictionary-add{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px;margin-top:11px}.choreo-dictionary-add .input{margin:0;min-width:0}.choreo-dictionary-add .btn{white-space:nowrap}
.choreo-dictionary-empty{width:100%;padding:10px 11px;border:1px dashed #ddd;border-radius:11px;color:#999;font-size:11px;background:#fafafa}

.choreo-season-checks{display:flex;flex-wrap:wrap;gap:7px;margin-top:6px;min-height:42px;padding:7px;border:1px solid var(--line);border-radius:12px;background:#fff}
.choreo-season-chip{position:relative;margin:0;cursor:pointer}.choreo-season-chip input{position:absolute;opacity:0;pointer-events:none}
.choreo-season-chip span{display:inline-flex;align-items:center;justify-content:center;min-height:32px;padding:6px 10px;border:1px solid #dedee2;border-radius:999px;background:#fafafa;color:#555;font-size:11px;font-weight:900;transition:.15s}
.choreo-season-chip input:checked+span{border-color:#e03b4b;background:#fff0f2;color:#a60012;box-shadow:inset 0 0 0 1px #e03b4b}
.choreo-season-chip input:focus-visible+span{outline:2px solid #111;outline-offset:2px}

.choreo-player-tools.pro.compact{display:grid;grid-template-columns:minmax(125px,155px) repeat(5,minmax(82px,auto)) minmax(100px,1fr);gap:7px;align-items:end;margin-top:10px}
.choreo-player-tools.pro.compact .choreo-rate-control{min-width:0;margin:0}.choreo-player-tools.pro.compact .choreo-rate-control>span{display:block;font-size:11px;font-weight:900;margin-bottom:4px;color:#555}
.choreo-player-tools.pro.compact .choreo-rate-control .input{height:38px;margin:0;padding:6px 9px;font-weight:850}
.choreo-player-tools.pro.compact .btn{min-height:38px;width:auto;padding:7px 9px;border-radius:10px;font-size:11px;display:inline-flex;align-items:center;justify-content:center;gap:5px;white-space:nowrap}

@media(max-width:900px){
  .choreo-dictionary-grid{grid-template-columns:1fr}
  .choreo-player-tools.pro.compact{grid-template-columns:repeat(4,minmax(0,1fr))}
  .choreo-player-tools.pro.compact .choreo-rate-control{grid-column:span 2}
}
@media(max-width:760px){
  .choreo-video-card{padding:12px}.choreo-section-title{margin-bottom:10px}
  .choreo-player-wrap{border-radius:14px}.choreo-player-wrap video{max-height:60vh}
  .choreo-player-tools.pro.compact{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin-top:8px}
  .choreo-player-tools.pro.compact .choreo-rate-control{grid-column:span 2}
  .choreo-player-tools.pro.compact .choreo-rate-control>span{font-size:10px;margin-bottom:3px}
  .choreo-player-tools.pro.compact .choreo-rate-control .input{height:40px;font-size:12px}
  .choreo-player-tools.pro.compact .btn{width:100%;min-width:0;min-height:40px;padding:6px 4px;font-size:11px;border-radius:10px}
  .choreo-player-tools.pro.compact #choreoMirrorBtn,.choreo-player-tools.pro.compact #choreoLoopBtn{grid-column:span 1}
  .choreo-chapters{padding:9px;margin-top:9px}.choreo-chapters>strong{font-size:11px}.choreo-chapters>div{flex-wrap:nowrap;overflow:auto;padding-bottom:2px}.choreo-chapters button{flex:0 0 auto;padding:7px 8px;font-size:10px}
  .choreo-watch-progress{margin-top:10px}
  .choreo-dictionary-card{padding:12px}.choreo-dictionary-chip>strong{max-width:190px}.choreo-dictionary-add{grid-template-columns:1fr}.choreo-dictionary-add .btn{width:100%}
}
@media(max-width:390px){
  .choreo-player-tools.pro.compact{grid-template-columns:repeat(3,minmax(0,1fr))}
  .choreo-player-tools.pro.compact .choreo-rate-control{grid-column:span 1}
  .choreo-player-tools.pro.compact #choreoMirrorBtn,.choreo-player-tools.pro.compact #choreoLoopBtn{grid-column:span 1}
  .choreo-player-tools.pro.compact .btn span{font-size:10px}
}


@media(max-width:680px){
  .choreo-player-tools.pro.compact{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
  .choreo-player-tools.pro.compact .choreo-rate-control{grid-column:span 1}
  .choreo-player-tools.pro.compact #choreoMirrorBtn{grid-column:span 1}
  .choreo-player-tools.pro.compact #choreoLoopBtn{grid-column:1/-1}
}


/* =========================================================
   V19.4.0 — MOBILE UI POLISH / BALLETINO BRAND SHELL
   ========================================================= */
.topbar-brand{display:flex;align-items:center;gap:12px;min-width:0}
.topbar-mobile-logo{display:none}

@media(max-width:960px){
  :root{--app-mobile-nav-height:70px}
  body{background:#f7f7f8}
  body.choreo-filters-open{overflow:hidden}

  .content{
    padding:0 10px calc(var(--app-mobile-nav-height) + 20px + var(--app-safe-bottom))!important;
  }

  /* Stały, wspólny header marki na każdej podstronie */
  .topbar{
    min-height:66px!important;
    margin:0 -10px 14px!important;
    padding:max(8px,var(--app-safe-top)) max(12px,var(--app-safe-right)) 8px max(12px,var(--app-safe-left))!important;
    border-bottom:1px solid #ececef!important;
    background:rgba(255,255,255,.97)!important;
    box-shadow:0 5px 18px rgba(24,24,28,.035);
    backdrop-filter:blur(18px)!important;
    -webkit-backdrop-filter:blur(18px)!important;
  }
  .topbar-brand{display:grid;grid-template-columns:auto;gap:1px;min-width:0}
  .topbar-mobile-logo{display:block;width:112px;height:33px;object-fit:contain;object-position:left center}
  .topbar h1{
    display:block!important;
    max-width:150px!important;
    margin:0!important;
    color:#727278;
    font-size:10px!important;
    font-weight:850!important;
    line-height:1.1!important;
    letter-spacing:.02em;
  }
  .topbar-actions{gap:7px!important}
  .notification-bell,.user-chip{box-shadow:none!important;border-color:#e7e7ea!important;background:#fff!important}
  .notification-bell{width:41px!important;height:41px!important;min-width:41px!important;min-height:41px!important}
  .avatar{width:34px!important;height:34px!important}

  /* Dolna nawigacja bardziej lekka i aplikacyjna */
  .mobile-nav{
    min-height:var(--app-mobile-nav-height)!important;
    padding:5px max(7px,var(--app-safe-right)) max(5px,var(--app-safe-bottom)) max(7px,var(--app-safe-left))!important;
    border-top:1px solid #ececef!important;
    background:rgba(255,255,255,.985)!important;
    box-shadow:0 -8px 26px rgba(20,20,24,.055)!important;
  }
  .mobile-nav button{
    min-height:56px!important;
    border-radius:15px!important;
    gap:2px!important;
    color:#606066!important;
    transition:background .15s,color .15s,transform .15s;
  }
  .mobile-nav button:active{transform:scale(.97)}
  .mobile-nav button span{font-size:20px!important}
  .mobile-nav button small{font-size:9px!important;font-weight:900!important}
  .mobile-nav button.active{background:#fff1f3!important;color:#b80014!important}

  /* Wspólny rytm stron */
  #view{padding-bottom:6px}
  .section-title{margin:18px 4px 9px!important;gap:5px!important}
  .brush-title{padding:7px 11px!important;border-radius:11px!important;font-size:10px!important;letter-spacing:.035em!important}
  .card{border-color:#e8e8eb!important;box-shadow:0 2px 10px rgba(18,18,22,.025)!important}

  /* DASHBOARD: dwie metryki obok siebie, ERP jako pełna szerokość */
  body[data-academy-view="dashboard"] #view>.grid.grid-3:first-child{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:9px!important;
  }
  body[data-academy-view="dashboard"] #view>.grid.grid-3:first-child>.card{
    min-height:112px;
    padding:14px!important;
  }
  body[data-academy-view="dashboard"] #view>.grid.grid-3:first-child>.card:nth-child(3){grid-column:1/-1;min-height:90px}
  body[data-academy-view="dashboard"] #view>.grid.grid-3:first-child .metric{font-size:30px!important;line-height:1.05}
  body[data-academy-view="dashboard"] #view>.grid.grid-3:first-child .muted{font-size:12px}
  .todo-section{margin-top:12px!important;padding:14px!important;border-radius:18px!important}
  .todo-section-head{margin-bottom:11px!important}
  .todo-section-head h2{font-size:17px!important;line-height:1.2!important;margin-top:3px!important}
  .todo-section-count{width:38px!important;height:38px!important;font-size:17px!important;border-radius:12px!important}
  .todo-card{padding:12px!important;border-radius:15px!important}
  .todo-card-main{gap:9px!important}
  .todo-card-icon{width:42px!important;height:42px!important;font-size:20px!important}
  .todo-card-top strong{font-size:14px!important}
  .todo-card-meta{gap:4px 8px!important;font-size:10px!important}
  .todo-card .todo-continue-btn{min-height:42px!important;margin-top:8px!important}

  /* KURSY: krótsze karty i lepsza hierarchia */
  body[data-academy-view="courses"] .grid.grid-3,
  body[data-academy-view="dashboard"] .assigned-course-grid{
    gap:12px!important;
  }
  .course{
    overflow:hidden!important;
    border-radius:18px!important;
    box-shadow:0 4px 15px rgba(30,30,34,.035)!important;
  }
  .course .cover{
    min-height:0!important;
    height:auto!important;
    padding:17px 16px!important;
    font-size:20px!important;
    line-height:1.15!important;
  }
  .course .cover>.course-assignment-badges{margin-top:10px!important;gap:5px!important}
  .course-assignment-badge,.course-required-badge,.course-countdown-badge{font-size:9px!important;padding:5px 7px!important}
  .course-body{padding:13px 15px 15px!important}
  .course-card-meta-row{margin-bottom:8px!important}
  .course-body>.muted{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;margin:7px 0!important;font-size:11px!important;line-height:1.45!important}
  .course-countdown-line{padding:9px 10px!important;margin:8px 0!important;border-radius:11px!important}
  .course-countdown-line strong{font-size:11px!important}.course-countdown-line span{font-size:10px!important}
  .course-body>strong{font-size:14px!important}
  .course-empty-state{min-height:210px!important;padding:28px 16px!important}
  .course-empty-state>div{font-size:38px!important}.course-empty-state h3{font-size:18px!important;margin:8px 0!important}.course-empty-state p{font-size:12px!important}

  /* CERTYFIKATY: mniej pustej przestrzeni */
  body[data-academy-view="certificates"] .certificate-module{gap:12px!important}
  body[data-academy-view="certificates"] .certificate-tabs{padding:8px!important;border-radius:16px!important}
  body[data-academy-view="certificates"] .certificate-tab{min-height:45px!important;padding:9px 13px!important;border-radius:12px!important}
  body[data-academy-view="certificates"] .certificate-panel-head{margin-bottom:10px!important}
  body[data-academy-view="certificates"] .certificate-panel-head p{font-size:12px!important}
  body[data-academy-view="certificates"] .empty{min-height:205px!important;padding:28px 16px!important}
  body[data-academy-view="certificates"] .empty>div{font-size:42px!important}
  body[data-academy-view="certificates"] .empty h2,body[data-academy-view="certificates"] .empty h3{font-size:18px!important;margin:8px 0!important}

  /* WIĘCEJ: marka zamiast tekstowego, ciężkiego nagłówka */
  .mobile-more-panel{border-radius:26px 26px 0 0!important;padding:10px 14px max(15px,var(--app-safe-bottom))!important}
  .mobile-more-header{padding:8px 4px 13px!important}
  .mobile-more-brand{display:flex!important;align-items:center!important;gap:11px!important;min-width:0}
  .mobile-more-brand>img{width:98px;height:36px;object-fit:contain;object-position:left center;flex:0 0 auto}
  .mobile-more-brand>div{display:grid;gap:2px;min-width:0}
  .mobile-more-brand strong{font-size:12px!important}.mobile-more-brand span{font-size:10px!important;color:#777!important}
  .mobile-more-close{width:42px!important;height:42px!important}
  .mobile-more-notifications,.mobile-admin-nav button,.mobile-more-logout{min-height:54px!important;border-radius:14px!important;font-size:14px!important}

  /* CHOREOGRAFIE — nagłówek i statystyki */
  .choreo-page-head{gap:10px!important;margin:2px 2px 12px!important}
  .choreo-page-head h2{font-size:25px!important;line-height:1.12!important;margin:13px 0 5px!important}
  .choreo-page-head p{font-size:12px!important;line-height:1.45!important}
  .choreo-summary-strip{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:6px!important;margin:10px 0!important}
  .choreo-summary-strip>button,.choreo-summary-strip>div{min-width:0!important;display:grid!important;gap:1px!important;padding:9px 7px!important;border-radius:13px!important;text-align:center!important}
  .choreo-summary-strip strong{font-size:19px!important}.choreo-summary-strip span{font-size:9px!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

  /* CHOREOGRAFIE — wyszukiwarka + filtry jako bottom sheet */
  .choreo-toolbar{display:block!important;padding:10px!important;border-radius:18px!important}
  .choreo-filter-top{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px;align-items:center}
  .choreo-search{grid-column:auto!important}
  .choreo-search .input{height:45px!important;margin:0!important;padding-left:38px!important;border-radius:13px!important;font-size:14px!important}
  .choreo-filters-btn{display:inline-flex!important;align-items:center!important;gap:5px!important;height:45px!important;min-height:45px!important;padding:0 12px!important;border-radius:13px!important;white-space:nowrap}
  .choreo-filters-btn strong{font-size:12px}.choreo-filters-btn i{font-style:normal;display:none}
  .choreo-active-filters{display:flex;gap:6px;overflow-x:auto;margin-top:8px;padding:1px 1px 2px;scrollbar-width:none}
  .choreo-active-filters::-webkit-scrollbar{display:none}
  .choreo-active-filter{flex:0 0 auto;border:1px solid #f0c8cd;background:#fff4f5;color:#9d1422;border-radius:999px;padding:6px 8px;font-size:9px;font-weight:850}
  .choreo-active-filter span{color:#777;font-weight:750}.choreo-active-filter strong{color:#9d1422}

  .choreo-filter-sheet{position:fixed;inset:0;z-index:12000;display:block;visibility:hidden;pointer-events:none}
  .choreo-filter-sheet.open{visibility:visible;pointer-events:auto}
  .choreo-filter-backdrop{position:absolute;inset:0;width:100%;height:100%;border:0;background:rgba(18,18,22,.46);opacity:0;transition:opacity .2s}
  .choreo-filter-sheet.open .choreo-filter-backdrop{opacity:1}
  .choreo-filter-panel{position:absolute;left:0;right:0;bottom:0;max-height:min(82dvh,700px);overflow:auto;padding:8px 14px max(14px,var(--app-safe-bottom));border-radius:25px 25px 0 0;background:#fff;box-shadow:0 -18px 55px rgba(0,0,0,.18);transform:translateY(102%);transition:transform .23s ease}
  .choreo-filter-sheet.open .choreo-filter-panel{transform:translateY(0)}
  .choreo-filter-header{position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 1px 12px;background:#fff}
  .choreo-filter-header>div{display:grid;gap:2px}.choreo-filter-header small{font-size:9px;font-weight:950;color:#d70012;letter-spacing:.05em}.choreo-filter-header strong{font-size:20px}
  .choreo-filter-close{width:40px;height:40px;border:1px solid #e7e7ea;border-radius:50%;background:#fff;font-size:24px;line-height:1}
  .choreo-filter-controls{display:grid!important;grid-template-columns:1fr 1fr!important;gap:10px!important}
  .choreo-filter-controls label{display:grid;gap:5px;margin:0;min-width:0}.choreo-filter-controls label>span{font-size:10px;font-weight:900;color:#64646a}
  .choreo-filter-controls .input{height:46px!important;margin:0!important;border-radius:12px!important;font-size:13px!important;padding:8px 10px!important}
  .choreo-filter-footer{position:sticky;bottom:0;display:grid;grid-template-columns:.72fr 1.28fr;gap:8px;margin:13px -1px 0;padding:10px 1px 0;background:linear-gradient(to top,#fff 78%,rgba(255,255,255,.8))}
  .choreo-filter-footer .btn{min-height:47px!important;border-radius:13px!important}

  /* CHOREOGRAFIE — bardziej zwarte karty */
  .choreo-library-meta{margin:13px 3px 8px!important}.choreo-library-meta strong{font-size:18px!important}.choreo-library-meta span{font-size:11px!important}
  .choreo-grid{gap:12px!important}
  .choreo-card{border-radius:18px!important;box-shadow:0 4px 14px rgba(20,20,24,.035)!important}
  .choreo-cover{min-height:128px!important;padding:13px 15px!important}
  .choreo-cover:after{width:130px!important;height:130px!important;border-width:29px!important;right:-48px!important;bottom:-58px!important}
  .choreo-cover-top>span{padding:5px 7px!important;font-size:9px!important}
  .choreo-cover-icon{font-size:26px!important;margin-bottom:4px!important}
  .choreo-cover strong{font-size:20px!important;line-height:1.08!important}
  .choreo-card-body{padding:13px 14px!important}
  .choreo-tags{gap:5px!important}.choreo-tags span{padding:5px 7px!important;font-size:9px!important}
  .choreo-card-body p{min-height:0!important;margin:9px 0!important;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;font-size:11px!important;line-height:1.45!important}
  .choreo-card-assets{padding:9px 0!important;gap:7px!important}.choreo-card-assets span{font-size:10px!important}
  .choreo-card-flags{margin-top:7px!important}.choreo-favorite-btn{width:36px!important;height:36px!important}
  .choreo-learning-row{margin-top:8px!important}.choreo-learning-badge{padding:6px 8px!important;font-size:10px!important}.choreo-watched{font-size:10px!important}

  /* Szczegół choreografii */
  .choreo-detail-head{gap:8px!important;margin-bottom:12px!important}.choreo-detail-head h2{font-size:25px!important;margin:8px 0 5px!important}.choreo-detail-head p{font-size:12px!important;line-height:1.45!important}
  .choreo-video-card,.choreo-music-card,.choreo-info-card,.choreo-status-card{border-radius:17px!important}
  .choreo-section-title>div>span{font-size:24px!important}.choreo-section-title strong{font-size:15px!important}.choreo-section-title small{font-size:10px!important}

  /* Formularze/modale — mniej masywne */
  .choreo-editor-header{padding:13px 14px 11px!important}.choreo-editor-header h2{font-size:20px!important;margin-top:8px!important}.choreo-editor-form{padding:0 13px 15px!important}.choreo-editor-section{padding:16px 0!important}.choreo-editor-section h3{font-size:15px!important}
}

@media(min-width:961px){
  .choreo-filter-top{display:contents}
  .choreo-filters-btn,.choreo-active-filters,.choreo-filter-backdrop,.choreo-filter-header,.choreo-filter-footer{display:none!important}
  .choreo-filter-sheet{display:contents!important;visibility:visible!important;pointer-events:auto!important}
  .choreo-filter-panel{display:contents!important}
  .choreo-filter-controls{display:contents!important}
  .choreo-filter-controls label{display:contents!important}
  .choreo-filter-controls label>span{display:none!important}
}

@media(max-width:430px){
  .topbar-mobile-logo{width:104px}
  .choreo-filter-controls{grid-template-columns:1fr!important}
  .choreo-summary-strip{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body[data-academy-view="dashboard"] #view>.grid.grid-3:first-child>.card{padding:12px!important}
}

/* =========================================================
   V19.4.0 — RAPORTY CHOREOGRAFII + WSPÓLNE DO ZROBIENIA
   ========================================================= */
.choreo-overview-report-editor{max-width:1180px}
.choreo-overview-metrics{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;padding:14px 16px 4px}
.choreo-overview-metrics>div{display:grid;gap:2px;padding:13px 14px;border:1px solid #ececef;border-radius:14px;background:#fff}
.choreo-overview-metrics strong{font-size:24px;line-height:1}.choreo-overview-metrics span{font-size:11px;color:#6e6e74;font-weight:750}
.choreo-overview-metrics .danger{border-color:#f0b9bf;background:#fff6f7}.choreo-overview-metrics .danger strong{color:#c40013}
.choreo-overview-toolbar{padding:12px 16px;grid-template-columns:minmax(220px,1.5fr) 1fr 1fr}
.choreo-overview-list{display:grid;gap:8px;padding:0 16px 18px}
.choreo-overview-row{display:grid;grid-template-columns:minmax(220px,1.4fr) minmax(420px,2fr) auto;gap:14px;align-items:center;padding:12px 14px;border:1px solid #ececef;border-radius:14px;background:#fff}
.choreo-overview-title{display:grid;gap:3px}.choreo-overview-title strong{font-size:14px}.choreo-overview-title small{font-size:10px;color:#777}
.choreo-overview-stats{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:5px}
.choreo-overview-stats span{display:grid;gap:1px;padding:7px 6px;border-radius:9px;background:#f7f7f8;text-align:center;font-size:9px;color:#6a6a70;font-weight:750}
.choreo-overview-stats b{font-size:14px;color:#111}.choreo-overview-stats .mastered{background:#eefaf3;color:#197346}.choreo-overview-stats .danger{background:#fff0f2;color:#b40013}.choreo-overview-stats .danger b{color:#b40013}
.unified-todo-section .todo-section-head small{display:block;margin-top:4px;color:#777;font-size:11px;font-weight:600}
.unified-todo-section .choreography-dashboard-todo .todo-required{background:#fff0f2;color:#b40013}

@media(max-width:760px){
  .choreo-head-actions{display:flex!important;flex-wrap:wrap!important;gap:6px!important}
  .choreo-head-actions .btn{min-height:40px!important;padding:8px 10px!important;font-size:10px!important}
  .choreo-overview-report-editor{max-width:none!important}
  .choreo-overview-metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;padding:10px 12px 4px}
  .choreo-overview-metrics>div{padding:10px 11px}.choreo-overview-metrics strong{font-size:20px}.choreo-overview-metrics span{font-size:9px}
  .choreo-overview-toolbar{display:grid!important;grid-template-columns:1fr!important;gap:7px!important;padding:10px 12px!important}
  .choreo-overview-list{padding:0 12px 16px;gap:8px}
  .choreo-overview-row{grid-template-columns:1fr;gap:9px;padding:11px 12px}
  .choreo-overview-stats{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
  .choreo-overview-row>.btn{width:100%}
  .unified-todo-section .todo-section-head{align-items:flex-start!important}
  .unified-todo-section .todo-section-head h2{font-size:20px!important;line-height:1.15!important}
}
.choreo-report-editor .choreo-report-toolbar{grid-template-columns:1.25fr repeat(3,minmax(0,1fr))}
@media(max-width:760px){.choreo-report-editor .choreo-report-toolbar{grid-template-columns:1fr!important}}

/* V19.6.0 — zarządzanie przeczytanymi powiadomieniami */
.notification-delete-read{
  color:#a4101c;
}
.notification-delete-read:hover:not(:disabled){
  color:var(--red);
  text-decoration:underline;
}
.notification-text-btn:disabled{
  opacity:.38;
  cursor:not-allowed;
}
@media (max-width:720px){
  .notification-toolbar-actions{
    justify-content:stretch;
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:7px;
  }
  .notification-toolbar-actions .notification-text-btn{
    min-height:38px;
    padding:8px 10px;
    border:1px solid #e8e8e8;
    border-radius:10px;
    background:#fff;
    font-size:11px;
  }
  .notification-toolbar-actions .notification-delete-read{
    border-color:#ffd6da;
    background:#fff7f8;
  }
  .notification-toolbar-actions #notificationAdminAction:not(.hidden){
    grid-column:1 / -1;
  }
}

/* V19.6.0 — stan połączenia / odporność produkcyjna */
.network-status{position:fixed;left:50%;top:max(12px,env(safe-area-inset-top));transform:translateX(-50%);z-index:5000;display:flex;align-items:center;gap:10px;max-width:min(720px,calc(100vw - 28px));padding:11px 16px;border:1px solid #e0ad57;border-radius:14px;background:#fff7e9;color:#6e4300;box-shadow:0 12px 34px rgba(0,0,0,.16);font-size:13px}.network-status strong{white-space:nowrap}.network-status.hidden{display:none}@media(max-width:760px){.network-status{top:calc(env(safe-area-inset-top) + 8px);width:calc(100vw - 24px);align-items:flex-start;flex-direction:column;gap:2px;padding:10px 13px}.network-status strong{white-space:normal}.network-status span{font-size:12px;line-height:1.35}}


/* V20.1.0 — poprawki testerów */
[data-home-logo]{cursor:pointer}
.profile-quick-btn{appearance:none;-webkit-appearance:none;border:0;background:transparent;font:inherit;color:inherit;cursor:pointer}
.profile-quick-btn:focus-visible,[data-home-logo]:focus-visible{outline:3px solid rgba(215,0,18,.22);outline-offset:3px}
.profile-self-shell{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px}
.profile-self-card{min-height:0}
.profile-self-identity{display:flex;align-items:center;gap:16px;margin-top:18px}
.profile-self-avatar{width:62px;height:62px;border-radius:50%;display:grid;place-items:center;background:var(--soft);color:var(--red);font-weight:900;font-size:24px}
.profile-self-identity h2{margin:0 0 3px}.profile-self-identity p{margin:0 0 8px;color:#6a6a6a}.profile-self-role{display:inline-flex;padding:5px 9px;border-radius:999px;background:#f5f5f5;font-size:12px;font-weight:850}
.profile-self-list{display:grid;margin-top:15px}.profile-self-list>div{display:flex;justify-content:space-between;gap:16px;padding:13px 0;border-bottom:1px solid var(--line)}.profile-self-list>div:last-child{border-bottom:0}.profile-self-list span{color:#777}.profile-self-list strong{text-align:right}.profile-self-note{margin-top:12px}
.choreo-native-controls{display:grid;grid-template-columns:auto auto minmax(100px,1fr) auto auto;align-items:center;gap:8px;padding:10px;background:#111;color:#fff;border-radius:0 0 16px 16px}
.choreo-control-btn{border:0;border-radius:10px;background:#2a2a2a;color:#fff;min-height:38px;padding:8px 11px;font-weight:850;cursor:pointer}.choreo-control-btn.icon{min-width:42px;padding:8px}.choreo-time-label{font-variant-numeric:tabular-nums;font-size:12px;white-space:nowrap;color:#eee}.choreo-seek{width:100%;accent-color:#e00016}.choreo-player-wrap video{display:block;width:100%;border-radius:16px 16px 0 0;background:#000}.choreo-player-wrap video.mirrored{transform:scaleX(-1)}
.choreo-player-wrap:fullscreen{background:#000;display:flex;flex-direction:column;justify-content:center}.choreo-player-wrap:fullscreen video{max-height:calc(100vh - 62px);object-fit:contain;border-radius:0}.choreo-player-wrap:fullscreen .choreo-native-controls{border-radius:0}
@media(max-width:960px){.profile-self-shell{grid-template-columns:1fr}.choreo-native-controls{grid-template-columns:auto 1fr auto auto}.choreo-time-label{grid-column:1/-1;grid-row:2;text-align:center}.choreo-seek{grid-column:2;grid-row:1}.choreo-control-btn{font-size:12px;padding:8px}.choreo-player-tools.pro.compact{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important}.choreo-player-tools.pro.compact>#choreoMirrorBtn{width:100%}}

/* ==========================================================================
   V20.1.0 — Onboarding instruktora / umowa szkoleniowa
   ========================================================================== */
.onboarding-shell{max-width:980px;margin:0 auto;padding:10px 0 80px}.onboarding-hero{background:linear-gradient(135deg,#fff,#fff8f8);border:1px solid #eee;border-radius:24px;padding:28px 30px;margin-bottom:20px;box-shadow:0 14px 38px rgba(20,20,20,.06)}.onboarding-hero h1{margin:8px 0 8px;font-size:34px}.onboarding-hero>p{max-width:760px;margin:0;color:#666;line-height:1.6}.onboarding-progress{display:flex;align-items:center;gap:10px;margin-top:26px}.onboarding-progress>div{display:flex;align-items:center;gap:8px;color:#9b9b9b;font-size:13px}.onboarding-progress>div span{width:30px;height:30px;border-radius:999px;display:grid;place-items:center;background:#ececee;font-weight:900}.onboarding-progress>div.active{color:#111}.onboarding-progress>div.active span{background:#ed1028;color:white}.onboarding-progress>div.done{color:#17783e}.onboarding-progress>div.done span{background:#e8f7ee;color:#17783e}.onboarding-progress>i{height:2px;flex:1;background:#e5e5e7;max-width:90px}.onboarding-card{background:#fff;border:1px solid #e8e8ea;border-radius:24px;padding:28px 30px;box-shadow:0 12px 32px rgba(20,20,20,.05)}.onboarding-card h2{margin:8px 0 8px;font-size:27px}.onboarding-form-card .muted,.onboarding-agreement-card .muted{line-height:1.6}.onboarding-import-note{background:#f3faf6;border:1px solid #d6efdf;color:#225a37;padding:13px 15px;border-radius:13px;margin:18px 0}.onboarding-data-form{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:22px}.onboarding-data-form label{display:flex;flex-direction:column;gap:7px;font-size:13px;font-weight:800}.onboarding-data-form .span-2{grid-column:span 2}.onboarding-data-form small{font-weight:500;color:#7d7d82;line-height:1.45}.onboarding-pesel-input{font-variant-numeric:tabular-nums;letter-spacing:.08em}.onboarding-confirm-check{flex-direction:row!important;align-items:flex-start!important;gap:10px!important;background:#fafafa;border:1px solid #ececef;padding:13px 15px;border-radius:13px;font-weight:600!important;line-height:1.45}.onboarding-confirm-check input{margin-top:3px;flex:0 0 auto}.onboarding-card-head{display:flex;justify-content:space-between;align-items:flex-start;gap:18px}.agreement-preview-loading,.agreement-preview-error{min-height:220px;display:flex;align-items:center;justify-content:center;gap:12px;border:1px dashed #ddd;border-radius:18px;margin:22px 0;background:#fafafa;color:#777}.agreement-preview-error{flex-direction:column;color:#a12222}.agreement-preview-box{margin:22px 0;max-height:65vh;overflow:auto;border:1px solid #dedee2;border-radius:18px;background:#ececf0;padding:18px}.agreement-document{width:min(760px,100%);box-sizing:border-box;background:#fff;margin:0 auto;padding:44px 48px;color:#181818;font-family:Arial,Helvetica,sans-serif;line-height:1.58;box-shadow:0 4px 18px rgba(0,0,0,.08)}.agreement-document h1{font-size:23px;text-align:center;margin:6px 0 4px}.agreement-version{text-align:center;color:#777;font-size:12px;margin-bottom:28px}.agreement-doc-brand{text-align:center;color:#ed1028;font-weight:900;letter-spacing:.1em;font-size:12px}.agreement-party{border-left:3px solid #ed1028;padding:10px 14px;background:#fafafa;margin:8px 0 18px}.agreement-section h2{font-size:16px;margin:26px 0 8px}.agreement-section p{font-size:13.5px;margin:7px 0;text-align:justify}.agreement-integrity{margin-top:30px;padding:13px 15px;border:1px solid #ddd;background:#fafafa;display:grid;gap:4px;font-size:10px;word-break:break-all}.agreement-integrity strong{font-size:12px}.agreement-acceptance-panel{display:grid;gap:12px;margin-top:20px}.agreement-otp-row{display:grid;grid-template-columns:auto minmax(180px,240px);gap:14px;align-items:end}.agreement-otp-row label{font-size:12px;font-weight:800;display:grid;gap:6px}.agreement-otp-row input{text-align:center;letter-spacing:.22em;font-size:18px;font-weight:800}.agreement-form-note{font-size:11px;color:#85858a;line-height:1.45;text-align:center;margin:0}.onboarding-success-card{text-align:center;padding:42px 30px}.onboarding-success-icon{margin:0 auto 14px;width:64px;height:64px;border-radius:999px;display:grid;place-items:center;background:#e8f7ee;color:#17783e;font-size:34px;font-weight:900}.onboarding-success-meta{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:24px auto;max-width:760px}.onboarding-success-meta>div{background:#fafafa;border:1px solid #ececee;border-radius:14px;padding:14px;display:grid;gap:5px}.onboarding-success-meta span{font-size:11px;color:#777}.onboarding-success-meta strong{font-size:13px;word-break:break-word}.onboarding-success-actions{display:flex;justify-content:center;gap:10px;flex-wrap:wrap}.agreement-pdf-host{position:fixed;left:-10000px;top:0;width:794px;background:#fff;z-index:-1}.agreement-pdf-host .agreement-document{width:794px;box-shadow:none;border:none}
@media(max-width:720px){.onboarding-shell{padding:0 0 100px}.onboarding-hero,.onboarding-card{border-radius:18px;padding:20px 18px}.onboarding-hero h1{font-size:27px}.onboarding-progress{gap:5px;align-items:flex-start}.onboarding-progress>div{flex-direction:column;text-align:center;gap:5px;flex:1;font-size:10px}.onboarding-progress>div span{width:27px;height:27px}.onboarding-progress>i{margin-top:13px}.onboarding-data-form{grid-template-columns:1fr;gap:13px}.onboarding-data-form .span-2{grid-column:span 1}.onboarding-card-head{display:block}.onboarding-card-head .btn{margin-top:10px}.agreement-preview-box{padding:7px;margin-left:-5px;margin-right:-5px;max-height:58vh}.agreement-document{padding:28px 22px}.agreement-document h1{font-size:20px}.agreement-section p{font-size:12.5px}.agreement-otp-row{grid-template-columns:1fr}.agreement-otp-row .btn{width:100%}.onboarding-success-meta{grid-template-columns:1fr}.onboarding-success-actions{display:grid}.onboarding-success-actions .btn{width:100%}}

/* Import Excel + ustawienia umowy */
.crm-list-management{flex-wrap:wrap}.crm-import-panel{max-width:920px}.crm-import-template-note{display:grid;gap:5px;background:#f7f7f8;border:1px solid #e7e7e9;border-radius:14px;padding:14px 16px;margin:4px 0 14px}.crm-import-template-note span{font-size:12px;color:#666;line-height:1.5}.crm-import-file{display:grid;gap:8px;font-size:13px;font-weight:800;border:1px dashed #ccc;border-radius:14px;padding:18px;margin:8px 0}.crm-import-file input{font-weight:500}.crm-import-preview-head{display:flex;justify-content:space-between;margin-top:18px}.crm-import-preview{overflow:auto;border:1px solid #e6e6e8;border-radius:14px;margin:8px 0 14px}.crm-import-preview table{border-collapse:collapse;width:100%;min-width:680px}.crm-import-preview th,.crm-import-preview td{padding:10px 12px;border-bottom:1px solid #eee;text-align:left;font-size:12px}.crm-import-preview th{background:#fafafa}.crm-import-preview small{display:block;padding:8px 12px;color:#777}.crm-import-invite{margin:10px 0}.crm-import-summary{background:#eef9f2;border:1px solid #d6efdf;color:#24623b;border-radius:14px;padding:16px;display:grid;gap:4px}.crm-import-summary.has-errors{background:#fff8eb;border-color:#f3dfb6;color:#7b5621}.crm-import-errors{max-height:260px;overflow:auto;margin-top:12px;border:1px solid #eee;border-radius:12px}.crm-import-errors>div{padding:9px 12px;border-bottom:1px solid #eee;display:flex;gap:12px}.crm-import-errors span{color:#7b2525}.crm-agreement-config-panel{max-width:760px}

/* V20.1.0 — wzór importu Excel */
.crm-import-template-download{display:flex;align-items:center;justify-content:space-between;gap:16px;border:1px solid #f0d5d8;background:#fff7f8;border-radius:14px;padding:14px 16px;margin:0 0 14px}.crm-import-template-download>div{display:grid;gap:4px}.crm-import-template-download span{font-size:12px;color:#666;line-height:1.45}.crm-import-template-btn{white-space:nowrap;text-decoration:none}@media(max-width:640px){.crm-import-template-download{align-items:stretch;flex-direction:column}.crm-import-template-btn{width:100%;justify-content:center;text-align:center}}


/* V20.1.0 — import użytkowników: potwierdzenie zawsze nad modalem importu */
.crm-add-user-modal .system-modal-overlay{z-index:30000}

/* === V20.1.0: rozszerzone dane użytkowników === */
.crm-section-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.crm-custom-checkbox{display:flex!important;align-items:center;gap:10px;padding:12px;border:1px solid #e7e7e7;border-radius:12px;font-weight:800}.crm-custom-checkbox input{width:20px;height:20px}
.crm-modal{position:fixed;inset:0;z-index:32000;display:grid;place-items:center;padding:18px}.crm-modal-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.52);backdrop-filter:blur(2px)}.crm-modal-card{position:relative;z-index:1;width:min(920px,96vw);max-height:92dvh;overflow:auto;background:#fff;border-radius:20px;padding:20px;box-shadow:0 30px 90px rgba(0,0,0,.28)}.crm-modal-card>header{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;padding-bottom:14px;border-bottom:1px solid #eee}.crm-modal-card>header h3{margin:7px 0 4px;font-size:21px}.crm-modal-card>header p{margin:0;color:#777;font-size:11px}.crm-modal-close{border:0;background:#111;color:#fff;width:40px;height:40px;border-radius:50%;font-size:24px;cursor:pointer}.crm-profile-fields-list{display:grid;gap:9px;margin:16px 0}.crm-profile-field-row{display:grid;grid-template-columns:minmax(180px,1.2fr) 150px 185px 205px auto;gap:8px;align-items:center;padding:9px;border:1px solid #ececec;border-radius:13px;background:#fafafa}.crm-mini-check{display:flex;align-items:center;gap:7px;font-size:10px;font-weight:800}.crm-mini-check input{width:18px;height:18px}.crm-profile-fields-actions{display:flex;justify-content:space-between;gap:10px;padding-top:12px;border-top:1px solid #eee}.profile-self-section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}.profile-self-edit-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:14px}
@media(max-width:850px){.crm-profile-field-row{grid-template-columns:1fr 130px}.crm-profile-field-row .crm-mini-check{grid-column:span 1}.crm-profile-field-row>button{grid-column:span 2}.crm-modal{align-items:end;padding:0}.crm-modal-card{width:100vw;max-height:94dvh;border-radius:22px 22px 0 0;padding:16px 14px calc(18px + env(safe-area-inset-bottom,0px))}.crm-profile-fields-actions{position:sticky;bottom:0;background:#fff;padding-bottom:4px}}

/* V20.1.0 — User data sections + editable field schema */
.crm-data-sections{display:grid;gap:16px;margin-top:14px}.crm-data-section{border:1px solid #ececec;border-radius:16px;padding:14px;background:#fff}.crm-data-section-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-end;margin-bottom:10px}.crm-data-section-head strong{font-size:13px}.crm-data-section-head span{font-size:10px;color:#8a8a8a}.crm-edit-section{margin:0 0 18px;padding:14px;border:1px solid #ececec;border-radius:15px;background:#fafafa}.crm-edit-section h4{margin:0 0 10px;font-size:13px}.crm-name-pair{display:grid;grid-template-columns:1fr 1fr;gap:8px}.crm-field-manager-section{margin:16px 0 20px}.crm-field-manager-heading{display:flex;justify-content:space-between;align-items:flex-end;margin-bottom:8px}.crm-field-manager-heading>div{display:grid;gap:2px}.crm-field-manager-heading strong{font-size:13px}.crm-field-manager-heading span{font-size:10px;color:#777}.crm-profile-field-row{grid-template-columns:auto minmax(150px,1fr) 135px 130px 170px 190px 120px auto}.crm-system-field-row{grid-template-columns:auto minmax(150px,1fr) 135px 120px 170px 190px 120px auto}.crm-field-order{display:flex;gap:3px}.crm-field-order button{width:27px;height:27px;border:1px solid #ddd;border-radius:8px;background:#fff;cursor:pointer;font-weight:900}.crm-field-lock{font-size:9px;color:#777;font-weight:800;white-space:nowrap}.crm-profile-fields-add{padding-top:8px}.profile-self-sections{display:grid;gap:16px}.profile-self-subsection{display:grid;gap:8px}.profile-self-subsection h3{font-size:13px;margin:0;color:#202124}.crm-profile-fields-actions>.muted{align-self:center}
@media(max-width:1050px){.crm-profile-field-row,.crm-system-field-row{grid-template-columns:auto 1fr 130px 130px}.crm-profile-field-row .crm-mini-check,.crm-system-field-row .crm-mini-check{grid-column:auto}.crm-profile-field-row>button,.crm-field-lock{grid-column:auto}}
@media(max-width:850px){.crm-data-section-head{align-items:flex-start;flex-direction:column;gap:2px}.crm-profile-field-row,.crm-system-field-row{grid-template-columns:auto 1fr}.crm-profile-field-row>*,.crm-system-field-row>*{min-width:0}.crm-profile-field-row .input,.crm-system-field-row .input{grid-column:2}.crm-profile-field-row .crm-mini-check,.crm-system-field-row .crm-mini-check{grid-column:1 / -1}.crm-profile-field-row>button[data-delete-profile-field],.crm-field-lock{grid-column:1 / -1}.crm-name-pair{grid-template-columns:1fr}.crm-profile-fields-actions{align-items:center}.crm-profile-fields-actions>.muted{display:none}}

/* V20.1.0 — profile fields manager + import warnings */
.crm-profile-fields-modal{width:min(1320px,96vw);overflow-x:hidden}
.crm-profile-fields-modal .crm-profile-field-row,.crm-profile-fields-modal .crm-system-field-row{grid-template-columns:auto minmax(170px,1fr) 155px repeat(4,minmax(118px,auto)) auto}
.crm-profile-fields-modal .crm-profile-fields-list{overflow-x:hidden}
.crm-profile-fields-modal .crm-mini-check{white-space:nowrap}
.crm-import-warnings{display:grid;gap:8px;margin:10px 0 0}
.crm-import-warnings>div{display:grid;gap:3px;padding:10px 12px;border:1px solid #f4d28a;background:#fff9e9;border-radius:12px}
.crm-import-warnings strong{font-size:11px;color:#8a5a00}.crm-import-warnings span{font-size:11px;color:#6b5a36}
@media(max-width:850px){.crm-profile-fields-modal{width:100vw}.crm-profile-fields-modal .crm-profile-field-row,.crm-profile-fields-modal .crm-system-field-row{grid-template-columns:auto 1fr}.crm-profile-fields-modal .crm-mini-check{white-space:normal}}


/* =========================================================
   V20.1.0 — TESTER HOTFIX: admin course studio + replay
   ========================================================= */
/* Karta raportu nie może ściskać tekstu do jednej litery w wąskiej kolumnie. */
.course-training-report-compact-card{
  grid-template-columns:46px minmax(0,1fr) !important;
  align-items:start !important;
}
.course-training-report-compact-copy{
  min-width:0 !important;
}
.course-training-report-compact-copy strong,
.course-training-report-compact-copy p{
  word-break:normal !important;
  overflow-wrap:break-word !important;
  hyphens:none !important;
}
.course-training-report-compact-tags,
.course-training-report-compact-card > .btn{
  grid-column:1 / -1 !important;
}
.course-training-report-compact-tags{
  justify-content:flex-start !important;
}
.course-training-report-compact-card > .btn{
  width:100% !important;
}
/* Ikona replay pochodzi wyłącznie z markup — bez pseudo-elementów. */
.video-replay-btn::before{content:none !important;}
.video-replay-icon{display:inline-block;line-height:1;}


/* V20.1.0 HOTFIX 9 — certyfikaty mobile + kanoniczny podgląd */
.certificate-list-date{
  white-space:nowrap;
  overflow-wrap:normal!important;
  word-break:normal!important;
  color:#666;
  font-size:12px;
}

.certificate-responsive-preview{
  position:relative;
  width:100%;
  max-width:1123px;
  margin:16px auto 0;
  overflow:hidden;
  background:#fff;
}

.certificate-responsive-preview .certificate-sheet{
  margin:0!important;
}

@media(max-width:620px){
  .certificate-list-row{
    grid-template-columns:16px minmax(0,1fr) auto!important;
    grid-template-areas:
      "dot main status"
      ". date date"
      ". actions actions"!important;
    align-items:start!important;
    gap:9px 10px!important;
    padding:14px 12px!important;
    overflow-wrap:normal!important;
  }

  .certificate-list-row>.certificate-status-dot{
    grid-area:dot!important;
    margin-top:6px;
  }

  .certificate-list-row>.certificate-list-main{
    grid-area:main!important;
  }

  .certificate-list-row>.certificate-status{
    grid-area:status!important;
    grid-column:auto!important;
    grid-row:auto!important;
    align-self:start;
  }

  .certificate-list-row>.certificate-list-date{
    grid-area:date!important;
    padding-top:3px;
  }

  .certificate-list-row>.certificate-row-actions{
    grid-area:actions!important;
    grid-column:auto!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:8px!important;
  }

  .certificate-row-actions .icon-btn{
    min-height:46px;
    display:flex;
    align-items:center;
    justify-content:center;
  }

  .public-verification-page{
    padding:14px!important;
  }

  .verification-result{
    padding:18px 14px!important;
    border-radius:18px!important;
  }
}


/* V20.1.0 HOTFIX 10 — podgląd certyfikatu jako modal */
.certificate-preview-modal{
  position:fixed;
  inset:0;
  z-index:50000;
  display:grid;
  place-items:center;
  padding:18px;
}
.certificate-preview-backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.58);
  backdrop-filter:blur(3px);
}
.certificate-preview-modal-card{
  position:relative;
  z-index:1;
  width:min(1180px,calc(100vw - 36px));
  max-height:94dvh;
  overflow:hidden;
  display:grid;
  grid-template-rows:auto auto minmax(0,1fr);
  background:#fff;
  border-radius:22px;
  box-shadow:0 28px 90px rgba(0,0,0,.34);
}
.certificate-preview-modal-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  padding:18px 20px 12px;
  border-bottom:1px solid #eee;
}
.certificate-preview-modal-head>div{display:grid;gap:6px}
.certificate-preview-modal-head strong{font-size:15px}
.certificate-preview-modal-close{
  width:42px;
  height:42px;
  border:0;
  border-radius:50%;
  background:#111;
  color:#fff;
  font-size:27px;
  line-height:1;
  cursor:pointer;
}
.certificate-preview-modal-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  padding:12px 20px;
  border-bottom:1px solid #eee;
}
.certificate-preview-modal-body{
  min-height:0;
  overflow:auto;
  padding:14px 20px 24px;
  background:#f3f3f5;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}

@media(max-width:620px){
  .certificate-list-row>.certificate-row-actions{
    width:100%!important;
    justify-self:stretch!important;
  }
  .certificate-list-row>.certificate-row-actions .icon-btn{
    width:100%!important;
    min-width:0!important;
  }

  .certificate-preview-modal{
    align-items:end;
    padding:0;
  }
  .certificate-preview-modal-card{
    width:100vw;
    max-height:96dvh;
    border-radius:22px 22px 0 0;
    padding-bottom:env(safe-area-inset-bottom,0px);
  }
  .certificate-preview-modal-head{
    padding:15px 14px 10px;
  }
  .certificate-preview-modal-actions{
    padding:10px 14px;
    display:grid;
    grid-template-columns:1fr;
  }
  .certificate-preview-modal-actions .btn{
    width:100%;
  }
  .certificate-preview-modal-body{
    padding:10px 10px 22px;
  }
  .certificate-preview-modal-close{
    width:40px;
    height:40px;
    flex:0 0 auto;
  }
}


/* V20.1.0 HOTFIX 11 — stabilny układ akcji certyfikatu na telefonie */
@media(max-width:620px){
  .certificate-list-row{
    grid-template-columns:16px minmax(0,1fr) auto!important;
    grid-template-areas:none!important;
  }

  .certificate-list-row>.certificate-status-dot{
    grid-column:1!important;
    grid-row:1!important;
  }

  .certificate-list-row>.certificate-list-main{
    grid-column:2!important;
    grid-row:1!important;
    min-width:0!important;
  }

  .certificate-list-row>.certificate-status{
    grid-column:3!important;
    grid-row:1!important;
  }

  .certificate-list-row>.certificate-list-date{
    grid-column:2 / -1!important;
    grid-row:2!important;
    width:auto!important;
    min-width:0!important;
    white-space:nowrap!important;
  }

  .certificate-list-row>.certificate-row-actions{
    grid-column:1 / -1!important;
    grid-row:3!important;
    width:100%!important;
    min-width:0!important;
    justify-self:stretch!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap:8px!important;
    margin-top:4px!important;
  }

  .certificate-list-row>.certificate-row-actions>.icon-btn{
    box-sizing:border-box!important;
    width:100%!important;
    max-width:none!important;
    min-width:0!important;
    min-height:48px!important;
    padding:11px 14px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    text-align:center!important;
    white-space:normal!important;
    overflow-wrap:normal!important;
    word-break:normal!important;
    font-size:14px!important;
    line-height:1.25!important;
    text-decoration:none!important;
  }
}


/* V20.1.0 HOTFIX 12 — pakiet choreografii: 2 filmy + śpiewnik PDF */
.choreo-package-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:12px}
.choreo-package-slot{border:1px solid var(--line);border-radius:16px;padding:12px;background:#fff}
.choreo-package-slot-head{display:flex;align-items:center;gap:10px;margin-bottom:10px}.choreo-package-slot-head>span{font-size:24px}.choreo-package-slot-head>div{display:grid;gap:2px}.choreo-package-slot-head small{color:var(--muted);overflow-wrap:anywhere}
.choreo-songbook-file{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px;border:1px solid var(--line);border-radius:14px;background:#fff}.choreo-songbook-file>div:first-child{display:flex;align-items:center;gap:10px}.choreo-songbook-file>div:first-child>span{font-size:30px}.choreo-songbook-file small{display:block;color:var(--muted);margin-top:3px;overflow-wrap:anywhere}.choreo-songbook-actions{display:flex;gap:8px;flex-wrap:wrap}
@media(max-width:720px){.choreo-package-grid{grid-template-columns:1fr}.choreo-songbook-file{align-items:flex-start;flex-direction:column}.choreo-songbook-actions{width:100%;display:grid;grid-template-columns:1fr}.choreo-songbook-actions .btn{width:100%}}


/* V20.1.0 HOTFIX 13 — śpiewnik obraz/PDF + egzaminy choreografii */
.choreo-exam-editor-settings{
  margin-top:12px;
  padding:14px;
  border:1px solid #ececf0;
  border-radius:16px;
  background:#fafafa;
  transition:opacity .18s ease;
}
.choreo-exam-editor-settings.disabled{
  opacity:.45;
  pointer-events:none;
}
.choreo-exam-card{display:grid;gap:12px}
.choreo-exam-card.passed{border-color:#bbf7d0;background:#f0fdf4}
.choreo-exam-card.submitted{border-color:#fde68a;background:#fffbeb}
.choreo-exam-card.resubmit{border-color:#fecaca;background:#fff7f7}
.choreo-exam-card.ready{border-color:#ddd6fe;background:#faf8ff}
.choreo-exam-card.locked{opacity:.8}
.choreo-exam-hero{display:flex;gap:12px;align-items:flex-start}
.choreo-exam-hero>span{font-size:28px;line-height:1}
.choreo-exam-hero>div{display:grid;gap:4px}
.choreo-exam-hero strong{font-size:16px}
.choreo-exam-hero small{color:#666;line-height:1.4}
.choreo-exam-task{
  display:grid;
  gap:5px;
  padding:12px;
  border-radius:14px;
  background:#fff;
  border:1px solid #e9e9ed;
}
.choreo-exam-task>span{font-size:11px;text-transform:uppercase;font-weight:800;color:#777}
.choreo-exam-task>strong{font-size:15px}
.choreo-exam-instructions,.choreo-exam-note{
  margin:0;
  padding:11px 12px;
  border-radius:12px;
  background:#fff;
  border:1px solid #ececf0;
  line-height:1.5;
}
.choreo-exam-feedback{
  padding:12px;
  border-radius:12px;
  background:#fff1f2;
  border:1px solid #fecdd3;
}
.choreo-exam-feedback p{margin:5px 0 0;line-height:1.45}
.choreo-exam-upload{
  display:grid;
  gap:7px;
  padding:12px;
  border:1px dashed #c9c9d2;
  border-radius:14px;
  background:#fff;
}
.choreo-exam-upload>span{font-weight:800}
.choreo-exam-upload input{width:100%}
.choreo-exam-upload small{color:#666;line-height:1.4}
.choreo-exam-review-editor{width:min(1180px,calc(100vw - 32px))}
.choreo-exam-review-toolbar{
  display:flex;
  gap:8px;
  padding:14px 18px;
  border-bottom:1px solid #eee;
}
.choreo-exam-review-toolbar .input{max-width:280px}
.choreo-exam-review-summary{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  padding:14px 18px 0;
}
.choreo-exam-review-summary>div{
  border:1px solid #ececf0;
  border-radius:12px;
  padding:10px;
  background:#fff;
  display:grid;
  gap:2px;
}
.choreo-exam-review-summary strong{font-size:20px}
.choreo-exam-review-summary span{font-size:11px;color:#666}
.choreo-exam-review-list{
  padding:14px 18px 22px;
  overflow:auto;
  display:grid;
  gap:10px;
}
.choreo-exam-review-row{
  border:1px solid #e8e8ec;
  border-radius:16px;
  padding:14px;
  background:#fff;
  display:grid;
  gap:10px;
}
.choreo-exam-review-main{
  display:grid;
  grid-template-columns:minmax(180px,1fr) minmax(220px,1.4fr) auto;
  gap:12px;
  align-items:start;
}
.choreo-exam-review-person,.choreo-exam-review-task{display:grid;gap:3px}
.choreo-exam-review-person small,.choreo-exam-review-task small,.choreo-exam-review-task span{color:#666;font-size:11px}
.choreo-exam-review-status{
  padding:5px 9px;
  border-radius:999px;
  font-size:11px;
  font-weight:800;
  white-space:nowrap;
  background:#f1f1f3;
}
.choreo-exam-review-status.submitted{background:#fff3cd;color:#7a5300}
.choreo-exam-review-status.passed{background:#dcfce7;color:#166534}
.choreo-exam-review-status.resubmit{background:#fee2e2;color:#991b1b}
.choreo-exam-review-meta{display:flex;gap:14px;flex-wrap:wrap;font-size:11px;color:#666}
.choreo-exam-review-actions{display:flex;gap:8px}
.choreo-exam-review-form{
  display:grid;
  grid-template-columns:minmax(0,1fr) 160px;
  gap:10px;
  padding-top:10px;
  border-top:1px solid #eee;
}
.choreo-exam-review-form>div{
  grid-column:1 / -1;
  display:flex;
  justify-content:flex-end;
  gap:8px;
}

@media(max-width:760px){
  .choreo-exam-review-editor{
    width:100vw;
    max-height:96dvh;
    border-radius:22px 22px 0 0;
  }
  .choreo-exam-review-summary{grid-template-columns:repeat(2,minmax(0,1fr))}
  .choreo-exam-review-main{grid-template-columns:1fr}
  .choreo-exam-review-form{grid-template-columns:1fr}
  .choreo-exam-review-form>div{grid-column:auto;display:grid}
  .choreo-exam-review-actions .btn{width:100%}
}

.choreo-exam-mini{
  display:inline-flex;
  align-items:center;
  gap:4px;
  padding:5px 8px;
  border-radius:999px;
  font-size:10px;
  font-weight:800;
  background:#f3e8ff;
  color:#6b21a8;
}
.choreo-exam-mini.passed{background:#dcfce7;color:#166534}
.choreo-exam-mini.submitted{background:#fef3c7;color:#92400e}
.choreo-exam-mini.resubmit{background:#fee2e2;color:#991b1b}


/* V20.1.0 HOTFIX 14 — szybkie przypisywanie i Kosz choreografii */
.choreo-admin-card-row{align-items:center;flex-wrap:wrap}.choreo-assignment-summary{border:0;background:transparent;padding:6px 0;color:var(--muted);font-size:12px;font-weight:800;text-align:left;cursor:pointer}.choreo-assignment-summary:not(:disabled):hover{color:var(--red)}.choreo-assignment-summary:disabled{cursor:default}.choreo-admin-card-actions{display:flex;align-items:center;justify-content:flex-end;gap:6px;flex-wrap:wrap}.choreo-admin-card-actions .btn{padding:7px 10px;font-size:11px}.choreo-quick-modal{z-index:39000}.choreo-quick-modal .crm-modal-card{width:min(980px,96vw)}.choreo-quick-modal .choreo-quick-modal-wide{width:min(1120px,97vw)}.choreo-quick-modal-body{padding:16px 0 4px}.choreo-quick-modal-footer{position:sticky;bottom:-20px;display:flex;justify-content:flex-end;gap:8px;margin:16px -20px -20px;padding:14px 20px;background:#fff;border-top:1px solid #eee;border-radius:0 0 20px 20px}.choreo-quick-public{display:flex;align-items:flex-start;gap:10px;padding:13px 14px;border:1px solid #ececec;border-radius:14px;background:#fafafa;margin-bottom:12px}.choreo-quick-public input{width:19px;height:19px;margin-top:2px}.choreo-quick-public span{display:grid;gap:3px}.choreo-quick-public small{color:var(--muted)}.choreo-quick-search{display:flex;align-items:center;gap:8px;margin-bottom:12px}.choreo-quick-search .input{flex:1}.choreo-bulk-grid{display:grid;grid-template-columns:minmax(260px,.8fr) minmax(0,1.5fr);gap:14px}.choreo-bulk-choreographies{max-height:430px}.choreo-bulk-access{margin-top:0}
@media(max-width:760px){.choreo-admin-card-row{align-items:stretch}.choreo-assignment-summary{width:100%}.choreo-admin-card-actions{width:100%;display:grid;grid-template-columns:1fr 1fr}.choreo-admin-card-actions .btn{width:100%;min-height:42px}.choreo-bulk-grid{grid-template-columns:1fr}.choreo-selective-access{grid-template-columns:1fr}.choreo-quick-modal{align-items:end;padding:0}.choreo-quick-modal .crm-modal-card,.choreo-quick-modal .choreo-quick-modal-wide{width:100vw;max-height:94dvh;border-radius:22px 22px 0 0;padding:16px 14px calc(16px + env(safe-area-inset-bottom,0px))}.choreo-quick-modal-footer{bottom:calc(-16px - env(safe-area-inset-bottom,0px));margin:14px -14px calc(-16px - env(safe-area-inset-bottom,0px));padding:12px 14px calc(12px + env(safe-area-inset-bottom,0px));border-radius:0}.choreo-quick-modal-footer .btn{flex:1}}


/* HOTFIX16 — jawne oznaczenie środowiska testowego */
.environment-badge{
  display:inline-flex;align-items:center;justify-content:center;
  min-height:28px;padding:0 10px;border-radius:999px;
  background:#fff3cd;color:#7a5200;border:1px solid #f0c36d;
  font-size:11px;font-weight:900;letter-spacing:.08em;
}
.environment-badge.hidden{display:none!important}
.environment-staging .build-badge{
  border-color:#f0c36d;background:#fff8e1;color:#7a5200;
}
@media (max-width: 760px){
  .environment-badge{min-height:26px;padding:0 8px;font-size:9px}
}

/* HOTFIX17 — Biblioteka mediów + masowy upload */
.media-library-page{display:grid;gap:18px}.media-library-hero{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:22px;border:1px solid #ececef;border-radius:20px;background:#fff}.media-library-hero h2{margin:5px 0 6px}.media-library-hero p{margin:0;color:var(--muted);max-width:760px}.media-library-stats{display:grid;gap:3px;min-width:190px;text-align:right}.media-library-stats strong{font-size:16px}.media-library-stats small{color:var(--muted)}.media-upload-panel{padding:18px;border:1px solid #e7e7eb;border-radius:18px;background:#fbfbfc}.media-upload-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:14px}.media-upload-heading h3{margin:0 0 4px}.media-upload-heading p{margin:0;color:var(--muted);font-size:12px}.media-file-picker{cursor:pointer;white-space:nowrap}.media-total-progress{height:7px;background:#e9e9ec;border-radius:999px;overflow:hidden;margin:16px 0 10px}.media-total-progress i{display:block;width:0;height:100%;background:var(--red);transition:width .2s ease}.media-upload-summary{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}.media-upload-summary span{font-size:12px;color:var(--muted);font-weight:700}.media-upload-queue{display:grid;gap:8px;max-height:360px;overflow:auto}.media-queue-empty{padding:16px;border:1px dashed #d9d9dd;border-radius:12px;text-align:center;color:var(--muted);font-size:12px}.media-queue-row{display:grid;grid-template-columns:32px minmax(0,1fr) auto;gap:10px;align-items:center;padding:10px 12px;border:1px solid #ececef;border-radius:12px;background:#fff}.media-queue-icon{font-size:18px}.media-queue-copy{display:grid;gap:3px;min-width:0}.media-queue-copy strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.media-queue-copy small{font-size:10px;color:var(--muted)}.media-queue-progress{height:4px;background:#eee;border-radius:999px;overflow:hidden}.media-queue-progress i{display:block;height:100%;background:var(--red);transition:width .15s ease}.media-queue-status{font-size:11px;font-weight:800;color:#555;max-width:220px;text-align:right}.media-queue-row.error{border-color:#fecaca;background:#fffafa}.media-queue-row.ready{border-color:#bbf7d0;background:#fbfffc}.media-queue-row.duplicate{border-color:#fde68a;background:#fffdf5}.media-library-toolbar{display:grid;grid-template-columns:minmax(0,1fr) 210px;gap:10px}.media-library-search{position:relative}.media-library-search>span{position:absolute;left:12px;top:50%;transform:translateY(-50%)}.media-library-search .input{padding-left:38px}.media-asset-list{display:grid;gap:10px}.media-asset-card{display:grid;grid-template-columns:68px minmax(0,1fr) auto;gap:14px;align-items:center;padding:14px;border:1px solid #ececef;border-radius:16px;background:#fff}.media-asset-thumb{height:58px;border-radius:12px;background:#f3f3f5;display:grid;place-items:center;align-content:center;gap:2px}.media-asset-thumb span{font-size:22px}.media-asset-thumb small{font-size:9px;font-weight:900;color:#777}.media-asset-main{min-width:0;display:grid;gap:6px}.media-asset-title{display:flex;align-items:center;gap:8px;min-width:0}.media-asset-title strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.media-status{display:inline-flex;align-items:center;padding:4px 7px;border-radius:999px;font-size:9px;font-weight:900;white-space:nowrap;background:#f1f1f3;color:#555}.media-status.assigned{background:#dcfce7;color:#166534}.media-status.unassigned{background:#fef3c7;color:#92400e}.media-asset-meta{display:flex;gap:10px;flex-wrap:wrap;font-size:10px;color:var(--muted)}.media-asset-usage{font-size:11px;color:#555}.media-asset-actions{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}.media-picker-modal,.media-preview-modal{position:fixed;inset:0;z-index:41000;display:grid;place-items:center;padding:20px}.media-picker-backdrop{position:absolute;inset:0;border:0;background:rgba(15,15,18,.58);cursor:default}.media-picker-panel,.media-preview-panel{position:relative;width:min(820px,96vw);max-height:min(760px,92dvh);display:grid;grid-template-rows:auto auto minmax(0,1fr);background:#fff;border-radius:20px;box-shadow:0 26px 80px rgba(0,0,0,.28);overflow:hidden}.media-picker-panel header,.media-preview-panel header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:20px;border-bottom:1px solid #eee}.media-picker-panel header h3,.media-preview-panel header h3{margin:4px 0}.media-picker-panel header p{margin:0;color:var(--muted);font-size:11px}.media-picker-close{border:0;background:#f2f2f4;width:36px;height:36px;border-radius:50%;font-size:22px;cursor:pointer}.media-picker-search{display:flex;align-items:center;gap:8px;padding:12px 16px;border-bottom:1px solid #eee}.media-picker-search .input{flex:1}.media-picker-list{padding:10px;overflow:auto;display:grid;gap:7px}.media-picker-row{width:100%;display:grid;grid-template-columns:42px minmax(0,1fr) auto;align-items:center;gap:10px;text-align:left;border:1px solid #ececef;background:#fff;padding:11px;border-radius:13px;cursor:pointer}.media-picker-row:hover{border-color:#d7d7dc;background:#fafafa}.media-picker-icon{width:38px;height:38px;border-radius:10px;background:#f3f3f5;display:grid;place-items:center}.media-picker-copy{display:grid;gap:3px;min-width:0}.media-picker-copy strong,.media-picker-copy small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.media-picker-copy small{font-size:10px;color:var(--muted)}.media-picker-select{font-size:11px;font-weight:900;color:var(--red)}.media-picker-empty{padding:42px 20px;text-align:center;display:grid;gap:5px;color:var(--muted)}.media-picker-empty span{font-size:32px}.media-preview-panel{grid-template-rows:auto minmax(0,1fr);width:min(980px,96vw)}.media-preview-panel video{display:block;width:100%;max-height:76dvh;background:#000}.choreo-library-pick{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:8px 0}.choreo-library-pick small{font-weight:700;color:#555}.choreo-source-separator{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:10px;margin:7px 0}.choreo-source-separator:before,.choreo-source-separator:after{content:"";height:1px;background:#ececef;flex:1}.choreo-source-separator span{white-space:nowrap}
@media(max-width:760px){.media-library-hero,.media-upload-heading,.media-upload-summary{display:grid;grid-template-columns:1fr}.media-library-stats{text-align:left;min-width:0}.media-upload-heading .btn,.media-upload-summary .btn{width:100%}.media-library-toolbar{grid-template-columns:1fr}.media-asset-card{grid-template-columns:52px minmax(0,1fr)}.media-asset-thumb{height:50px}.media-asset-actions{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr}.media-asset-actions .btn{width:100%}.media-queue-row{grid-template-columns:28px minmax(0,1fr)}.media-queue-status{grid-column:2;text-align:left;max-width:none}.media-picker-modal,.media-preview-modal{align-items:end;padding:0}.media-picker-panel,.media-preview-panel{width:100vw;max-height:94dvh;border-radius:22px 22px 0 0}.media-picker-row{grid-template-columns:38px minmax(0,1fr)}.media-picker-select{grid-column:2}.media-preview-panel video{max-height:70dvh}}
.media-queue-status small{display:block;margin-top:3px;font-size:9px;color:#991b1b}.media-queue-retry{border:0;background:#fff1f2;color:#9f1239;border-radius:8px;padding:5px 8px;font-size:10px;font-weight:900;cursor:pointer}

/* HOTFIX19 — zaznaczanie wielu filmów + trwałe usuwanie z Biblioteki mediów */
.media-asset-card{grid-template-columns:30px 68px minmax(0,1fr) auto}
.media-asset-card.selected{border-color:#efb5bb;box-shadow:0 8px 24px rgba(215,0,18,.08);background:#fffafb}
.media-asset-select{display:grid;place-items:center;width:30px;height:36px;cursor:pointer}
.media-asset-select input{position:absolute;opacity:0;pointer-events:none}
.media-asset-select span{width:19px;height:19px;border:2px solid #cfcfd4;border-radius:6px;background:#fff;display:grid;place-items:center;transition:.15s ease}
.media-asset-select input:checked+span{border-color:var(--red);background:var(--red)}
.media-asset-select input:checked+span:after{content:"✓";color:#fff;font-size:12px;font-weight:900;line-height:1}
.media-bulk-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border:1px solid #e8e8ec;border-radius:14px;background:#fafafa;transition:.15s ease}
.media-bulk-actions.active{border-color:#f0c5c9;background:#fff8f8}
.media-bulk-left,.media-bulk-right{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.media-bulk-left strong{font-size:12px;min-width:110px}.media-bulk-actions .btn{padding:7px 10px;font-size:11px}
.media-bulk-actions button[hidden]{display:none!important}
@media(max-width:760px){.media-asset-card{grid-template-columns:30px 52px minmax(0,1fr)}.media-asset-actions{grid-column:1/-1}.media-bulk-actions{align-items:stretch;display:grid}.media-bulk-left,.media-bulk-right{display:grid;grid-template-columns:1fr 1fr}.media-bulk-left strong{grid-column:1/-1}.media-bulk-actions .btn{width:100%}}

/* HOTFIX21 — odporny upload Biblioteki mediów */
.media-upload-summary-actions{display:flex;align-items:center;gap:8px;justify-content:flex-end}.media-queue-cancel{border:0;background:#fff1f2;color:#9f1239;border-radius:8px;padding:5px 8px;font-size:10px;font-weight:900;cursor:pointer}.media-queue-cancel:disabled{opacity:.55;cursor:wait}.media-queue-row.cancelled{border-color:#fecdd3;background:#fff7f8}.media-retry-picker{cursor:pointer}.media-asset-card:has(.media-status):has([data-retry-interrupted-media]){border-color:#fed7aa;background:#fffdf8}
@media(max-width:760px){.media-upload-summary-actions{display:grid;grid-template-columns:1fr;gap:8px}.media-upload-summary-actions .btn{width:100%}}

/* HOTFIX22 — backendowy watchdog przerwanych uploadów; brak zmian wizualnych */

/* HOTFIX23 — bezpieczny render Panelu administratora przy szybkiej nawigacji i wolniejszych przeglądarkach */
