/* =====================================================
   LK — Личный кабинет
   ===================================================== */

:root {
  --lk-bg: #f0f4f8;
  --lk-card: #ffffff;
  --lk-nav: #0a1628;
  --lk-primary: #1955a6;
  --lk-primary-hover: #143772;
  --lk-green: #6ede3b;
  --lk-text: #1a2a3a;
  --lk-text-2: #5a7090;
  --lk-text-3: #8a9ab0;
  --lk-border: #e0e8f0;
  --lk-danger: #e04040;
  --lk-radius: 10px;
  --lk-max-w: 960px;
}

*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  font-family:'Inter',sans-serif;
  background:var(--lk-bg);
  color:var(--lk-text);
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
}
a{color:var(--lk-primary);text-decoration:none}
a:hover{text-decoration:underline}
img{max-width:100%;display:block}

/* ── Nav ── */
.lk-nav{
  background:var(--lk-nav);
  padding:.8rem 0;
  position:sticky;top:0;z-index:100;
}
.lk-nav__inner{
  max-width:var(--lk-max-w);margin:0 auto;padding:0 20px;
  display:flex;align-items:center;justify-content:space-between;
}
.lk-nav__logo-img{height:16px;width:auto;filter:brightness(0) invert(1)}
.lk-nav__right{display:flex;align-items:center;gap:1rem}
.lk-nav__role{
  font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:.06em;
  color:var(--lk-green);
  background:rgba(110,222,59,0.12);
  padding:.2rem .6rem;border-radius:100px;
}
.lk-nav__user{font-size:.82rem;color:rgba(255,255,255,0.6)}
.lk-nav__logout{
  font-size:.8rem;color:rgba(255,255,255,0.4);
  transition:color .2s;
}
.lk-nav__logout:hover{color:#fff;text-decoration:none}

/* ── Main ── */
.lk-main{padding:2rem 0 4rem}
.lk-wrap{max-width:var(--lk-max-w);margin:0 auto;padding:0 20px}

/* ── Typography ── */
.lk-title{font-size:1.6rem;font-weight:800;margin-bottom:1.5rem;color:var(--lk-text)}
.lk-back{
  font-size:.85rem;color:var(--lk-text-2);
  display:inline-block;margin-bottom:.75rem;
}
.lk-back:hover{color:var(--lk-primary);text-decoration:none}
.lk-empty{color:var(--lk-text-3);font-size:.9rem;padding:1rem 0}

/* ── Page Header ── */
.lk-page-header{
  display:flex;flex-wrap:wrap;align-items:center;gap:.75rem;
  margin-bottom:1.5rem;
}
.lk-page-header .lk-back{margin-bottom:0;width:100%}
.lk-page-header .lk-title{margin-bottom:0;flex:1}

/* ── Buttons ── */
.lk-btn{
  display:inline-flex;align-items:center;gap:.4rem;
  padding:.55rem 1.2rem;border-radius:8px;border:1px solid var(--lk-border);
  background:var(--lk-card);color:var(--lk-text);
  font-size:.85rem;font-weight:600;cursor:pointer;
  transition:all .15s ease;text-decoration:none;
}
.lk-btn:hover{border-color:var(--lk-primary);color:var(--lk-primary);text-decoration:none}
.lk-btn--primary{
  background:var(--lk-primary);color:#fff;border-color:var(--lk-primary);
}
.lk-btn--primary:hover{background:var(--lk-primary-hover);color:#fff}
.lk-btn--small{padding:.35rem .8rem;font-size:.78rem}
.lk-btn--danger{color:var(--lk-danger);border-color:var(--lk-danger);background:transparent}
.lk-btn--danger:hover{background:var(--lk-danger);color:#fff}
.lk-btn--full{width:100%;justify-content:center;padding:.7rem}
.lk-btn--zoom{
  background:#2d8cff;color:#fff;border-color:#2d8cff;
  font-size:.95rem;padding:.7rem 1.5rem;margin-bottom:1.5rem;
}
.lk-btn--zoom:hover{background:#1a7ae0;color:#fff}

/* ── Tabs ── */
.lk-tabs-row{
  display:flex;align-items:center;justify-content:space-between;
  margin-bottom:2rem;
  border-bottom:2px solid var(--lk-border);
}
.lk-tabs{
  display:flex;gap:0;
  overflow-x:auto;
}
.lk-tab{
  padding:.75rem 1.25rem;
  font-size:.88rem;font-weight:600;color:var(--lk-text-2);
  border-bottom:2px solid transparent;
  margin-bottom:-2px;
  white-space:nowrap;
  transition:color .15s, border-color .15s;
  text-decoration:none;
}
.lk-tab:hover{color:var(--lk-primary);text-decoration:none}
.lk-tab--active{color:var(--lk-primary);border-bottom-color:var(--lk-primary)}
.lk-tabs-row .lk-btn{flex-shrink:0;margin-bottom:.5rem}

/* ── Banner Form ── */
.lk-banner-form{
  background:var(--lk-card);padding:1.25rem;
  border:1px solid var(--lk-border);border-radius:var(--lk-radius);
  margin-bottom:1.5rem;
}
.lk-banner-form h3{font-size:.95rem;font-weight:700;color:var(--lk-text)}

/* ── Banner ── */
.lk-banner{
  display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;
  padding:.75rem 1.25rem;margin-bottom:1.5rem;
  background:rgba(25,85,166,0.06);
  border:1px solid rgba(25,85,166,0.15);
  border-radius:var(--lk-radius);
  font-size:.9rem;color:var(--lk-text);
}
.lk-banner a{
  color:var(--lk-primary);font-weight:600;
  word-break:break-all;
}

/* ── Module ── */
.lk-module{margin-bottom:2rem}
.lk-module__header{
  font-size:1rem;font-weight:700;color:var(--lk-primary);
  padding:.75rem 1rem;
  background:rgba(25,85,166,0.06);
  border-radius:var(--lk-radius) var(--lk-radius) 0 0;
  border:1px solid var(--lk-border);border-bottom:none;
  display:flex;align-items:center;justify-content:space-between;
}
.lk-module__actions{display:flex;gap:.5rem}

/* ── Schedule / Lesson Row ── */
.lk-schedule{
  background:var(--lk-card);
  border:1px solid var(--lk-border);
  border-radius:0 0 var(--lk-radius) var(--lk-radius);
  overflow:hidden;
}
.lk-lesson{
  display:flex;align-items:center;gap:1rem;
  padding:.85rem 1rem;
  border-bottom:1px solid var(--lk-border);
  transition:background .1s;
}
.lk-lesson:last-child{border-bottom:none}
.lk-lesson:hover{background:rgba(25,85,166,0.02)}
.lk-lesson--locked{opacity:.5}
.lk-lesson--locked:hover{background:transparent}

.lk-lesson__date{
  flex-shrink:0;width:90px;text-align:center;
}
.lk-lesson__day{display:block;font-size:.6rem;color:var(--lk-text-3);text-transform:uppercase;letter-spacing:.03em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lk-lesson__datenum{font-size:.9rem;font-weight:700;color:var(--lk-text)}

.lk-lesson__body{flex:1;min-width:0}
.lk-lesson__title{
  font-weight:600;font-size:.9rem;color:var(--lk-primary);
}
.lk-lesson__title:hover{text-decoration:underline}
.lk-lesson__title--locked{color:var(--lk-text-3);cursor:default}
.lk-lesson__title--locked:hover{text-decoration:none}
.lk-lesson__desc{font-size:.8rem;color:var(--lk-text-2);margin-top:.2rem;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.lk-lesson__meta{
  flex-shrink:0;display:flex;align-items:center;gap:.75rem;
  font-size:.78rem;color:var(--lk-text-2);
}
.lk-lesson__format{
  padding:.15rem .5rem;border-radius:4px;font-weight:600;font-size:.7rem;
  text-transform:uppercase;letter-spacing:.04em;
}
.lk-lesson__format--online{background:rgba(45,140,255,0.1);color:#2d8cff}
.lk-lesson__format--offline{background:rgba(110,222,59,0.1);color:#3aad10}

/* ── Lesson Detail ── */
.lk-lesson-detail__meta{
  display:flex;flex-wrap:wrap;gap:.75rem;
  margin-bottom:1rem;font-size:.82rem;color:var(--lk-text-2);
}
.lk-lesson-detail__meta > span{
  display:flex;align-items:center;gap:.3rem;
}
.lk-lesson-detail__title{
  font-size:1.8rem;font-weight:800;margin-bottom:1rem;line-height:1.2;
}
.lk-lesson-detail__desc{
  font-size:1rem;color:var(--lk-text-2);margin-bottom:1.5rem;line-height:1.7;
}
.lk-lesson-detail__video{
  position:relative;padding-top:56.25%;margin-bottom:2rem;
  border-radius:var(--lk-radius);overflow:hidden;
  background:#000;
}
.lk-lesson-detail__video iframe{
  position:absolute;inset:0;width:100%;height:100%;border:none;
}
.lk-lesson-detail__notes{
  background:var(--lk-card);
  padding:2rem;border-radius:var(--lk-radius);
  border:1px solid var(--lk-border);
}

/* ── Content (rendered HTML) ── */
.lk-content{line-height:1.8;font-size:.95rem}
.lk-content h1,.lk-content h2,.lk-content h3{margin:1.5rem 0 .75rem;font-weight:700}
.lk-content h1{font-size:1.5rem}
.lk-content h2{font-size:1.25rem}
.lk-content h3{font-size:1.1rem}
.lk-content p{margin-bottom:1rem}
.lk-content ul,.lk-content ol{margin:0 0 1rem 1.5rem}
.lk-content img{max-width:100%;height:auto;border-radius:8px;margin:1rem 0}
.lk-content table{width:100%;border-collapse:collapse;margin:1rem 0}
.lk-content th,.lk-content td{
  border:1px solid var(--lk-border);padding:.5rem .75rem;text-align:left;
}
.lk-content th{background:var(--lk-bg);font-weight:600}

/* ── Tools ── */
.lk-tools{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:1rem}
.lk-tool-card{
  background:var(--lk-card);padding:1.25rem;
  border:1px solid var(--lk-border);border-radius:var(--lk-radius);
  transition:border-color .15s;
}
.lk-tool-card:hover{border-color:var(--lk-primary)}
.lk-tool-card__title{font-size:.95rem;font-weight:700;margin-bottom:.4rem}
.lk-tool-card__title a{color:var(--lk-primary)}
.lk-tool-card__desc{font-size:.85rem;color:var(--lk-text-2);line-height:1.6}

/* ── Locked Page ── */
.lk-locked{
  text-align:center;padding:4rem 1rem;
}
.lk-locked__icon{font-size:4rem;margin-bottom:1rem}
.lk-locked__title{font-size:1.5rem;font-weight:800;margin-bottom:.75rem}
.lk-locked__text{color:var(--lk-text-2);margin-bottom:2rem;font-size:1rem}

/* ── Forms ── */
.lk-form{max-width:700px}
.lk-form__field{margin-bottom:1rem}
.lk-form__field label{
  display:block;font-size:.82rem;font-weight:600;
  color:var(--lk-text-2);margin-bottom:.3rem;
}
.lk-form__field input,
.lk-form__field select,
.lk-form__field textarea{
  width:100%;padding:.55rem .75rem;
  border:1px solid var(--lk-border);border-radius:8px;
  font-family:inherit;font-size:.9rem;color:var(--lk-text);
  background:var(--lk-card);
  transition:border-color .15s;
}
.lk-form__field input:focus,
.lk-form__field select:focus,
.lk-form__field textarea:focus{
  outline:none;border-color:var(--lk-primary);
  box-shadow:0 0 0 3px rgba(25,85,166,0.1);
}
.lk-form__field--small{max-width:100px}
.lk-form__grid{display:grid;grid-template-columns:1fr 1fr 1fr 100px;gap:1rem}
.lk-form__actions{display:flex;gap:.75rem;margin-top:1.5rem}

/* ── Formset ── */
.lk-formset-item{
  padding:1.25rem;margin-bottom:1rem;
  background:var(--lk-card);border:1px solid var(--lk-border);
  border-radius:var(--lk-radius);
}
.lk-formset-item--new{border-style:dashed}
.lk-formset-row{display:grid;grid-template-columns:1fr 1fr 80px;gap:1rem}
.lk-formset-delete{
  display:flex;align-items:center;gap:.4rem;
  font-size:.8rem;color:var(--lk-danger);margin-top:.5rem;cursor:pointer;
}

/* ── Schedule Edit Actions ── */
.lk-schedule-actions{display:flex;gap:.75rem;margin-bottom:2rem}

/* ── Login ── */
.lk-login-page{
  background:var(--lk-nav);
  min-height:100vh;
  display:flex;align-items:center;justify-content:center;
}
.lk-login{width:100%;max-width:380px;padding:0 20px}
.lk-login__card{
  background:var(--lk-card);
  padding:2.5rem 2rem;border-radius:var(--lk-radius);
  box-shadow:0 20px 60px rgba(0,0,0,0.3);
}
.lk-login__logo{
  height:20px;width:auto;margin:0 auto 1.5rem;
  filter:brightness(0) saturate(100%) invert(22%) sepia(85%) saturate(1500%) hue-rotate(205deg);
}
.lk-login__title{
  font-size:1.3rem;font-weight:800;text-align:center;
  margin-bottom:1.5rem;color:var(--lk-text);
}
.lk-login__error{
  background:rgba(224,64,64,0.08);color:var(--lk-danger);
  padding:.6rem 1rem;border-radius:8px;font-size:.85rem;
  margin-bottom:1rem;text-align:center;
}

/* ── Attachments (presentation / document) ── */
.lk-attachment{margin-bottom:2rem}
.lk-attachment__header{
  display:flex;align-items:center;justify-content:space-between;gap:1rem;
  margin-bottom:.75rem;
}
.lk-attachment__title{
  font-size:1.1rem;font-weight:700;color:var(--lk-text);
}
.lk-attachment__preview{
  border:1px solid var(--lk-border);border-radius:var(--lk-radius);
  overflow:hidden;background:#f5f5f5;
}
.lk-attachment__preview iframe,
.lk-attachment__preview object,
.lk-attachment__preview embed{
  display:block;width:100%;height:600px;border:none;
}
.lk-attachment__hint{
  font-size:.85rem;color:var(--lk-text-3);
  padding:.75rem 1rem;
  background:var(--lk-card);border:1px solid var(--lk-border);
  border-radius:var(--lk-radius);
}

/* ── Form Section ── */
.lk-form-section{
  margin-bottom:1.5rem;
  border:1px solid var(--lk-border);border-radius:var(--lk-radius);
  overflow:hidden;
}
.lk-form-section__header{
  font-size:.82rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;
  color:var(--lk-text-2);
  background:var(--lk-bg);
  padding:.6rem 1rem;
  border-bottom:1px solid var(--lk-border);
}
.lk-form-section .lk-form__field{padding:0 1rem;margin-top:.75rem}
.lk-form-section .lk-form__field:last-child{padding-bottom:1rem}
.lk-form__file-current{
  margin-top:.4rem;font-size:.8rem;color:var(--lk-text-2);
}
.lk-form__file-current a{color:var(--lk-primary)}
.lk-form__error{font-size:.8rem;color:var(--lk-danger);margin-top:.25rem}
.lk-form__hint{font-size:.78rem;color:var(--lk-text-3);margin-top:.3rem}

/* ── Doc Formset Row ── */
.lk-doc-form-row{
  padding:1rem;border-bottom:1px solid var(--lk-border);
}
.lk-doc-form-row:last-child{border-bottom:none}
.lk-doc-form-row__fields{
  display:grid;grid-template-columns:1fr 1fr 80px;gap:1rem;
}
.lk-doc-form-row .lk-form__field{padding:0;margin-top:0}
.lk-doc-form-row__delete{margin:.5rem 0 0}

/* ── Homework ── */
.lk-hw-section-title{font-size:.9rem;font-weight:700;margin-bottom:.6rem;color:var(--lk-text)}
.lk-hw-uploaded{margin-bottom:1.5rem}
.lk-hw-files{list-style:none;display:flex;flex-direction:column;gap:.4rem}
.lk-hw-files li{
  display:flex;align-items:center;justify-content:space-between;gap:.75rem;
  padding:.45rem .75rem;
  background:var(--lk-card);border:1px solid var(--lk-border);border-radius:8px;
  font-size:.85rem;
}
.lk-hw-files a{color:var(--lk-primary)}
.lk-hw-delete{
  background:none;border:none;cursor:pointer;
  color:var(--lk-text-3);font-size:.9rem;padding:.1rem .3rem;
  transition:color .15s;flex-shrink:0;
}
.lk-hw-delete:hover{color:var(--lk-danger)}
.lk-hw-form{margin-top:.5rem}
.lk-hw-label{display:block;font-size:.82rem;font-weight:600;color:var(--lk-text-2);margin-bottom:.4rem}
.lk-hw-upload-row{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap}
.lk-hw-input{font-size:.85rem}

.lk-hw-table{width:100%;border-collapse:collapse;font-size:.88rem}
.lk-hw-table th,.lk-hw-table td{
  border:1px solid var(--lk-border);padding:.5rem .75rem;text-align:left;vertical-align:top;
}
.lk-hw-table th{background:var(--lk-bg);font-weight:600;color:var(--lk-text-2)}

/* ── Responsive ── */
@media(max-width:700px){
  .lk-form__grid{grid-template-columns:1fr 1fr}
  .lk-formset-row{grid-template-columns:1fr}
  .lk-lesson{flex-wrap:wrap;gap:.5rem}
  .lk-lesson__date{width:auto}
  .lk-lesson__meta{width:100%;justify-content:flex-start}
  .lk-lesson-detail__title{font-size:1.4rem}
  .lk-actions{flex-direction:column}
  .lk-nav__user{display:none}
}
