:root{
  --bg:#0b0d10;
  --glass: rgba(20,22,30,.68);
  --stroke: rgba(255,255,255,.06);
  --text:#e9edf3;
  --muted:#aab2c6;
  --accent:#5a7cff;
  --accent2:#b35cff;
  --card: rgba(18,20,28,.75);
  --good:#38d37a;
}

/* Light theme overrides (set by html[data-theme="light"]) */
html[data-theme="light"]{
  --bg:#f5f7fb;
  --glass: rgba(255,255,255,.70);
  --stroke: rgba(0,0,0,.08);
  --text:#10131a;
  --muted:#55607a;
  --card: rgba(255,255,255,.78);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family: Inter, Segoe UI, system-ui, -apple-system, Arial, sans-serif;
  color:var(--text);
  background:
    radial-gradient(1200px 800px at 30% 15%, rgba(90,120,255,.25), transparent 60%),
    radial-gradient(900px 700px at 80% 65%, rgba(180,90,255,.22), transparent 55%),
    var(--bg);
  transition: background .35s ease, color .25s ease;
}

html[data-theme="light"] body{
  background:
    radial-gradient(1100px 760px at 25% 10%, rgba(90,120,255,.16), transparent 62%),
    radial-gradient(980px 760px at 80% 60%, rgba(180,90,255,.14), transparent 58%),
    var(--bg);
}

/* APP SHELL */
.ws-shell{ height:100vh; overflow:hidden; }

/* SIDEBAR */
.ws-side{
  position: fixed;
  top:0;
  left:0;
  height:100vh;
  width:78px;
  padding:14px 10px;

  display:flex;
  flex-direction:column;

  background: linear-gradient(180deg, rgba(20,22,30,.92), rgba(12,14,20,.98));
  border-right:1px solid var(--stroke);
  z-index:50;

  overflow:hidden;
  transition: width .25s ease, box-shadow .25s ease, background .35s ease, border-color .35s ease;
}

html[data-theme="light"] .ws-side{
  background: linear-gradient(180deg, rgba(255,255,255,.86), rgba(245,247,251,.96));
}

.ws-side--hover:hover{
  width:210px;
  box-shadow: 20px 0 80px rgba(0,0,0,.45);
}

.ws-brand{
  width:26px;
  height:26px;
  display:grid;
  place-items:center;
  margin: 14px auto 18px auto;
}

/* container inside sidebar */
.ws-side-body{
  flex:1;
  display:flex;
  flex-direction:column;
  gap:12px;
  padding-top: 4px;
}

/* NAV */
.ws-nav{
  display:flex;
  flex-direction:column;
  gap:12px;
  padding: 0 4px;
}

/* ✅ важно: flex + растягивание по ширине */
.ws-nav a,
.ws-nav-bottom a{
  width:100%;
  height:46px;
  border-radius:999px;

  display:flex;
  align-items:center;
  gap:12px;
  padding: 0 12px;

  text-decoration:none;
  color:#cfd6ff;
  background: rgba(20,22,30,.55);
  border:1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(14px);

  transition:
    transform .15s ease,
    background .15s ease,
    border-color .15s ease,
    box-shadow .15s ease,
    color .25s ease;
}

/* ✅ в свернутом сайдбаре иконки должны быть по центру (текст не должен "съедать" место) */
.ws-side--hover:not(:hover) .ws-nav a,
.ws-side--hover:not(:hover) .ws-nav-bottom a{
  width:52px;
  height:52px;
  margin: 0 auto;
  justify-content:center;
  padding:0;
  gap:0;
  display:flex;
}

/* в свернутом состоянии текст вообще не должен участвовать в лэйауте */
.ws-side--hover:not(:hover) .ws-label{ display:none; }

.ws-side--hover:hover .ws-nav a,
.ws-side--hover:hover .ws-nav-bottom a{
  justify-content:flex-start;
  padding:0 16px;
}

.ws-nav a:hover,
.ws-nav-bottom a:hover{
  transform: translateY(-1px);
  border-color: rgba(120,140,255,.35);
}

.ws-nav a.active,
.ws-nav-bottom a.active{
  background: rgba(90,110,255,.32);
  border-color: rgba(120,140,255,.45);
  box-shadow:
    0 0 0 1px rgba(120,140,255,.15),
    0 10px 30px rgba(90,120,255,.35);
}

html[data-theme="light"] .ws-nav a,
html[data-theme="light"] .ws-nav-bottom a{
  background: rgba(255,255,255,.62);
  border:1px solid rgba(0,0,0,.08);
  color: rgba(16,19,26,.88);
}

html[data-theme="light"] .ws-nav a.active,
html[data-theme="light"] .ws-nav-bottom a.active{
  background: rgba(90,110,255,.16);
  border-color: rgba(90,110,255,.25);
  box-shadow:
    0 0 0 1px rgba(90,110,255,.10),
    0 12px 34px rgba(90,110,255,.18);
}

/* icon fixed width */
.ws-ico{
  font-size:18px;
  width:22px;
  min-width:22px;
  text-align:center;
  flex-shrink:0;
  line-height:1;
  display:block;
}

/* ✅ текст меню: ellipsis + занимает всё место */
.ws-label{
  flex:1;
  min-width:0;              /* критично для ellipsis в flex */
  max-width:0;              /* в свернутом состоянии не резервируем место под текст */
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  opacity:0;
  transform: translateX(-6px);
  font-size:13px;
  font-weight:700;
  letter-spacing: .1px;
  color: rgba(233,237,243,.95);
  pointer-events:none;
  transition: opacity .18s ease, transform .18s ease;
}

.ws-side--hover:hover .ws-label{
  opacity:1;
  transform: translateX(0);
  max-width:160px;
  pointer-events:auto;
}

/* bottom settings */
.ws-nav-bottom{
  margin-top:auto;
  padding: 0 4px 8px;
}

/* MAIN */
.ws-main{
  margin-left:78px;
  height:100vh;
  padding:22px;
  overflow:hidden;
  transition: margin-left .25s ease;
}
.ws-side--hover:hover ~ .ws-main{ margin-left:210px; }

/* WINDOW */
.ws-window{
  height:100%;
  border-radius:24px;
  background: var(--glass);
  border:1px solid var(--stroke);
  backdrop-filter: blur(20px);
  box-shadow: 0 40px 90px rgba(0,0,0,.45);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  transition: background .35s ease, border-color .35s ease;
}

/* TOP BAR */
.ws-top{
  height:54px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 16px;
  border-bottom:1px solid var(--stroke);
  transition: border-color .35s ease;
}

/* search */
.ws-search{
  width: 360px;
  height: 40px;
  display:flex;
  align-items:center;
  gap:10px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(12,14,20,.45);
  backdrop-filter: blur(14px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02);
  transition: background .35s ease, border-color .35s ease;
}

html[data-theme="light"] .ws-search{
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(0,0,0,.10);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.02);
}

.ws-search-ico{ color: rgba(233,237,243,.75); font-size: 16px; }

.ws-search-input{
  flex:1;
  height: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .2px;
}
.ws-search-input::placeholder{
  color: rgba(190,198,215,.55);
  font-weight: 600;
  letter-spacing: .25px;
}

/* CONTENT */
.ws-content{
  flex:1;
  overflow:auto;
  padding:18px 18px 26px;
}
.ws-content::-webkit-scrollbar{ width:10px; }
.ws-content::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.12);
  border-radius:999px;
}

/* HEADERS */
.ws-hrow{ display:flex; align-items:center; justify-content:space-between; gap:14px; }
.ws-title{ font-size:22px; font-weight:800; }
.ws-sub{ margin-top:4px; font-size:13px; color:var(--muted); }

.ws-hrow-actions{ display:flex; align-items:center; gap:10px; }

/* pill button (как на "втором скрине" в светлой теме) */
.ws-pillbtn{
  display:inline-flex;
  align-items:center;
  gap:10px;
  height:34px;
  padding:0 14px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(20,22,30,.55);
  color:var(--text);
  cursor:pointer;
  backdrop-filter: blur(14px);
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.ws-pillbtn:hover{ transform: translateY(-1px); border-color: rgba(120,140,255,.35); }
.ws-pillbtn i{ font-size:14px; opacity:.95; }

html[data-theme="light"] .ws-pillbtn{
  background: rgba(255,255,255,.7);
  border:1px solid rgba(0,0,0,.08);
  color: rgba(16,19,26,.88);
}

/* SECTIONS */
.ws-section{ margin-top:22px; }
.ws-sec-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.ws-sec-title{ font-weight:800; font-size:14px; }
.ws-sec-more{ font-size:12px; color:#cfd6ff; opacity:.85; text-decoration:none; }

/* RAIL */
.ws-rail-wrap{ position:relative; }
.ws-rail{
  display:flex;
  gap:12px;
  overflow-x:auto;
  padding-bottom:10px;
  -ms-overflow-style:none;
  scrollbar-width:none;
  scroll-behavior:auto;
  overscroll-behavior-x: contain;
}
.ws-rail::-webkit-scrollbar{ display:none; }

.ws-rail-fade-right,
.ws-rail-fade-left{
  position:absolute; top:0; bottom:10px; width:70px;
  pointer-events:none; border-radius:18px;
  opacity:0; transition: opacity .18s ease;
}
.ws-rail-fade-right{ right:0; background: linear-gradient(90deg, transparent, rgba(11,13,16,.62)); }
.ws-rail-fade-left{ left:0; background: linear-gradient(270deg, transparent, rgba(11,13,16,.62)); }
.ws-rail-wrap.has-left .ws-rail-fade-left{ opacity:1; }
.ws-rail-wrap.has-right .ws-rail-fade-right{ opacity:1; }

/* arrows */
.ws-rail-btn{
  position:absolute;
  top:105px;
  width:44px;
  height:44px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(12,14,20,.55);
  color:var(--text);
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  backdrop-filter: blur(14px);
  z-index:5;

  opacity:0;
  pointer-events:none;
  transform: scale(.98);
  transition: opacity .16s ease, transform .16s ease, background .15s ease, border-color .15s ease;
}
.ws-rail-btn--right{ right:6px; }
.ws-rail-btn--left{ left:6px; }
.ws-rail-btn:hover{ background: rgba(20,22,30,.78); border-color: rgba(120,140,255,.45); }
.ws-rail-wrap.ws-inited:hover .ws-rail-btn.ws-show{
  opacity:1;
  pointer-events:auto;
  transform: scale(1);
}

/* CARD */
.ws-card{
  width:150px;
  flex:0 0 auto;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(18,20,28,.75);
  overflow:hidden;
  position:relative;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
  will-change: transform;
}
.ws-card:hover{
  border-color: rgba(120,140,255,.35);
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
}
.ws-poster{
  height:210px;
  background: linear-gradient(135deg, rgba(90,120,255,.30), rgba(180,90,255,.22));
  display:flex; align-items:center; justify-content:center;
  font-weight:800;
  color: rgba(255,255,255,.65);
  transform: scale(1);
  transition: transform .22s ease;
  will-change: transform;
}
.ws-poster img{ width:100%; height:100%; object-fit:cover; display:block; }
.ws-card:hover .ws-poster{ transform: scale(1.045); }
.ws-badges{ position:absolute; top:10px; left:10px; display:flex; gap:8px; z-index:2; }
.ws-badge{
  padding:4px 8px; border-radius:999px; font-size:11px;
  background: rgba(10,12,16,.55);
  border:1px solid rgba(255,255,255,.08);
}
.ws-rate{
  position:absolute; top:10px; right:10px;
  padding:4px 8px; border-radius:999px; font-size:11px;
  background: rgba(10,12,16,.55);
  border:1px solid rgba(80,255,160,.25);
  color: var(--good);
  z-index:2;
}
.ws-card-body{ padding:10px 10px 12px; }
.ws-name{ font-weight:800; font-size:12.5px; line-height:1.15; }
.ws-meta{ margin-top:6px; font-size:11.5px; color:var(--muted); }

/* SETTINGS / PANELS */
.ws-panel{
  max-width: 720px;
  border-radius: 22px;
  border:1px solid var(--stroke);
  background: var(--card);
  padding: 16px;
  transition: background .35s ease, border-color .35s ease, color .25s ease;
}
.ws-panel + .ws-panel{ margin-top: 14px; }
.ws-panel-title{ font-weight: 900; font-size: 14px; letter-spacing: .1px; }
.ws-panel-sub{ margin-top:6px; color: var(--muted); font-size: 13px; }
.ws-item{
  margin-top: 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 18px;
  border:1px solid rgba(255,255,255,.07);
  background: rgba(12,14,20,.22);
  transition: background .35s ease, border-color .35s ease;
}
html[data-theme="light"] .ws-item{
  border-color: rgba(0,0,0,.07);
  background: rgba(255,255,255,.55);
}
.ws-item-left{ min-width: 0; }
.ws-item-label{ font-weight: 850; font-size: 13px; }
.ws-item-hint{ margin-top:4px; color: var(--muted); font-size: 12.5px; }

/* Settings fields */
.ws-field{ margin-top: 14px; }
.ws-field-label{ font-weight: 850; font-size: 13px; }
.ws-field-hint{ margin-top:6px; color: var(--muted); font-size: 12.5px; }
.ws-input{
  width:100%;
  height:40px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(12,14,20,.35);
  color: var(--text);
  padding: 0 12px;
  outline:none;
  transition: background .25s ease, border-color .25s ease;
}
html[data-theme="light"] .ws-input{
  border-color: rgba(0,0,0,.10);
  background: rgba(255,255,255,.70);
}
.ws-input:focus{ border-color: rgba(120,140,255,.45); }
.ws-input--area{ height:auto; padding: 10px 12px; resize: vertical; line-height: 1.35; }

/* Switch */
.ws-switch{ position: relative; width: 54px; height: 30px; flex:0 0 auto; }
.ws-switch input{ opacity:0; width:0; height:0; }
.ws-slider{
  position:absolute; inset:0;
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.10);
  cursor:pointer;
  transition: background .25s ease, border-color .25s ease;
}
html[data-theme="light"] .ws-slider{
  background: rgba(0,0,0,.06);
  border-color: rgba(0,0,0,.10);
}
.ws-slider::before{
  content:"";
  position:absolute;
  width: 24px;
  height: 24px;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 8px 22px rgba(0,0,0,.30);
  transition: transform .25s ease;
}
.ws-switch input:checked + .ws-slider::before{
  transform: translate(24px, -50%);
}
.ws-searchbox{ position:relative; width: 420px; height: 40px; display:flex; align-items:center; gap:10px; padding:0 14px; border-radius:14px; border:1px solid rgba(255,255,255,.08); background: rgba(12,14,20,.45); backdrop-filter: blur(14px); }
.ws-search-dd{ position:absolute; top:46px; left:0; right:0; background: rgba(12,14,20,.92); border:1px solid rgba(255,255,255,.10); border-radius:16px; padding:10px; z-index:50; box-shadow: 0 24px 60px rgba(0,0,0,.55); }
.ws-search-tabs{ display:flex; gap:8px; margin-bottom:10px; }
.ws-tab{ height:32px; padding:0 10px; border-radius:10px; border:1px solid rgba(255,255,255,.10); background: rgba(18,20,28,.55); color: rgba(233,237,243,.85); cursor:pointer; font-weight:800; font-size:12px; }
.ws-tab--active{ background: rgba(90,110,255,.35); border-color: rgba(120,140,255,.45); }
.ws-search-item{ width:100%; text-align:left; padding:10px 10px; border-radius:12px; border:1px solid rgba(255,255,255,.06); background: rgba(18,20,28,.45); cursor:pointer; margin-top:8px; }
.ws-search-item:hover{ border-color: rgba(120,140,255,.35); }
.ws-search-title{ font-weight:900; color: rgba(233,237,243,.95); font-size:13px; }
.ws-search-meta{ color: rgba(190,198,215,.65); font-size:12px; margin-top:2px; }
.ws-brand-logo{width:22px;height:22px;display:block;filter:drop-shadow(0 10px 24px rgba(90,120,255,.35));}

/* DLE template layout helpers */
.container{ max-width: 1200px; margin: 0 auto; padding: 18px; }
.info{ margin: 12px 0; }
.content{ margin: 12px 0 20px 0; }
/* header/footer from template */
.header, .footer{ border:1px solid var(--stroke); background: var(--glass); border-radius: 18px; padding: 14px 16px; backdrop-filter: blur(14px); }
.nav{ display:flex; flex-wrap:wrap; gap:10px; }
.nav a{ text-decoration:none; color:var(--text); padding:8px 12px; border-radius:999px; border:1px solid var(--stroke); background: rgba(255,255,255,.04); }
.nav a:hover{ filter: brightness(1.08); }
.card{ border:1px solid var(--stroke); background: var(--card); border-radius: 18px; padding: 16px; box-shadow: 0 18px 50px rgba(0,0,0,.22); }
