/* ═══════════════════════════════════════════════
   RZD THEME v6 — Vikunja
   ═══════════════════════════════════════════════ */

/* ── FONTS ───────────────────────────────────── */
@font-face{font-family:"RussianRail";src:url(/static/fonts/russianrail.otf) format("opentype");font-weight:700;font-display:swap}
@font-face{font-family:"FSRailway";src:url(/static/fonts/fsrailway.otf) format("opentype");font-weight:400;font-display:swap}
@font-face{font-family:"Quicksand";src:url(/static/fonts/russianrail.otf) format("opentype");font-weight:300 700;font-display:swap}
@font-face{font-family:"Open Sans";src:url(/static/fonts/open-sans-cyrillic-wght-normal.woff2) format("woff2-variations");font-weight:300 800;font-display:swap;unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:"Open Sans";src:url(/static/fonts/open-sans-cyrillic-ext-wght-normal.woff2) format("woff2-variations");font-weight:300 800;font-display:swap;unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}

/* ── COLORS ──────────────────────────────────── */
:root{
  --primary-h:0deg;--primary-s:79%;--primary-l:49%;
  --link-h:0deg;--link-s:79%;--link-l:49%;
  --radius:0px;--radius-small:0px;--radius-large:0px;
  --card-radius:0px;--tag-radius:2px;--input-radius:0px;
  --site-background:#F2F2F2;
  --family-primary:"FSRailway",Arial,sans-serif;
}

/* ── BORDER RADIUS ───────────────────────────── */
*,*::before,*::after{border-radius:0 !important}
.tag{border-radius:2px !important}

/* ── HEADER ──────────────────────────────────── */
header.navbar{padding:0 !important;border-bottom:3px solid #E21A1A !important;box-shadow:none !important}

/* ── LOGO (десктоп): margin 8px слева/сверху/снизу */
.logo-link>div,.logo-link>svg{display:none !important}
.logo-link{
  width:168px !important;min-width:168px !important;height:45px !important;
  margin:8px 16px 8px 8px !important;
  display:flex !important;align-items:center !important;
  background:url(/static/fonts/rzd_logo_new.png) no-repeat left center/contain !important;
  flex-shrink:0 !important;
}

/* ── МОБИЛЬНЫЙ САЙДБАР: логотип РЖД ─────────── */
.menu-container a.logo>div,
.menu-container a.logo>svg{display:none !important}
.menu-container a.logo{
  display:block !important;width:120px !important;height:36px !important;
  background:url(/static/fonts/rzd_logo_new.png) no-repeat left center/contain !important;
  margin:12px 0 12px 8px !important;
}

/* ── TYPOGRAPHY ──────────────────────────────── */
body{font-family:"FSRailway",Arial,sans-serif}
h1,h2,h3,
.title:not(.subtitle),
.modal-card-title,
.menu-label{
  font-family:"RussianRail",Arial,sans-serif !important;
  text-transform:uppercase;
  letter-spacing:0.04em;
}
.menu-label{font-size:.7rem !important}

/* Заголовки страниц — нормальный размер */
h1.project-title,span.project-title{
  font-family:"RussianRail",Arial,sans-serif !important;
  text-transform:uppercase;
  letter-spacing:0.04em;
}

/* ПЛИТКИ ПРОЕКТОВ на обзоре — меньше шрифт, не переносить */
.project-background span.project-title{
  font-size:0.75rem !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  max-width:100% !important;
}

/* ── НАВИГАЦИЯ: иконки ───────────────────────── */
.menu-list .menu-item-icon.icon{width:24px !important;height:16px !important;min-width:24px !important;flex-shrink:0 !important}
.menu-list .menu-item-icon.icon svg{width:1em !important;height:1em !important}

/* drag-handle: скрыть чтобы не смещало квадратик при hover */
.menu-item-icon.handle.drag-handle{opacity:0 !important;width:0 !important;min-width:0 !important;overflow:hidden !important;pointer-events:none !important}

/* ── ПРОЕКТНЫЕ ССЫЛКИ В САЙДБАРЕ ────────────── */
a.list-menu-link{padding-left:20px !important;align-items:center !important;display:flex !important}
.collapse-project-button-placeholder{display:none !important}

/* КВАДРАТИКИ: компактно, прижаты к тексту */
.color-bubble{width:8px !important;height:8px !important;flex-shrink:0 !important;border-radius:0 !important}
.color-bubble-wrapper{
  width:16px !important;min-width:16px !important;
  display:flex !important;align-items:center !important;justify-content:flex-start !important;
  flex-shrink:0 !important;margin-right:0 !important;
}

/* ── КВАДРАТИКИ В ЗАДАЧАХ ────────────────────── */
.single-task .color-bubble-wrapper,.task .color-bubble-wrapper{
  width:14px !important;min-width:14px !important;
  display:inline-flex !important;align-items:center !important;margin-right:3px !important;
  flex-shrink:0 !important;
}

/* ── АКТИВНЫЙ ПУНКТ ──────────────────────────── */
.menu-list a{border-left:3px solid transparent;transition:border-color .15s,background .15s}
.menu-list a.router-link-active,.menu-list a.is-active,a.list-menu-link.router-link-active{
  border-left:3px solid #E21A1A !important;
  background:rgba(226,26,26,.06) !important;
  color:#E21A1A !important;
}

/* ── КНОПКИ ──────────────────────────────────── */
.button.is-primary,.button.is-link{background:#E21A1A !important;border-color:#E21A1A !important;font-family:"RussianRail",Arial,sans-serif;letter-spacing:.05em}
.button.is-primary:hover,.button.is-link:hover{background:#C51515 !important;border-color:#C51515 !important}

/* ── ИНПУТЫ ──────────────────────────────────── */
.input:focus,.textarea:focus,.select select:focus{border-color:#E21A1A !important;box-shadow:0 0 0 2px rgba(226,26,26,.15) !important}

/* ── СКРЫВАЕМ ────────────────────────────────── */
a.menu-bottom-link{display:none !important}

/* ══════════════════════════════════════════════
   MOBILE ≤ 768px
   ══════════════════════════════════════════════ */
@media (max-width:768px){

  /* Лого меньше */
  .logo-link{width:100px !important;height:30px !important;margin:9px 8px 9px 8px !important}

  /* Заголовки */
  h1,h2{font-size:1rem !important;letter-spacing:0.02em !important;line-height:1.3 !important}

  /* Плитки */
  .project-background span.project-title{font-size:0.7rem !important}

  /* Список задач — не переносить */
  .single-task{
    flex-wrap:nowrap !important;align-items:center !important;
    padding:5px 4px !important;font-size:0.8rem !important;min-height:0 !important;
    overflow:hidden !important;
  }
  .single-task [class*="title"]{
    overflow:hidden !important;text-overflow:ellipsis !important;
    white-space:nowrap !important;min-width:0 !important;flex-shrink:1 !important;
  }
  /* Скрываем дату — экономим место */
  .single-task [class*="due"]{display:none !important}

  /* Метки */
  .tag{font-size:0.65rem !important;padding:1px 3px !important}

  /* Сайдбар */
  .menu-list a{padding:7px 6px 7px 12px !important;font-size:0.82rem !important}
  a.list-menu-link{padding-left:10px !important}
}

/* ── ДОП. ФИКСЫ ─────────────────────────────── */

/* Плитка проекта — uppercase сохраняем */
.project-background span.project-title{
  text-transform:uppercase !important;
}

/* Сайдбар-лого: НЕ показывать на десктопе */
@media (min-width:769px){
  .menu-container a.logo{display:none !important}
}
/* На мобилке — показываем РЖД */
@media (max-width:768px){
  .menu-container a.logo>div,.menu-container a.logo>svg{display:none !important}
  .menu-container a.logo{
    display:block !important;width:120px !important;height:36px !important;
    background:url(/static/fonts/rzd_logo_new.png) no-repeat left center/contain !important;
    margin:12px 0 12px 8px !important;
  }
}

/* ── ПЛИТКА ПРОЕКТА: шрифт + размер ──────────── */
.project-title {
  font-family: "RussianRail", Arial, sans-serif !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
}
.project-background {
  min-height: 100px !important;
  max-height: 140px !important;
}
.project-background .project-title,
.project-background [class*="title"] {
  font-size: 0.75rem !important;
  text-transform: uppercase !important;
  font-family: "RussianRail", Arial, sans-serif !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Плитка — ловим любой текстовый элемент внутри */
.project-background *:not(svg):not(path) {
  font-family: "RussianRail", Arial, sans-serif !important;
  text-transform: uppercase !important;
  font-size: 0.75rem !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Плитка — ещё меньше шрифт, убираем перенос принудительно */
.project-background,
.project-background > * {
  overflow: hidden !important;
}
.project-background *:not(svg):not(path) {
  font-size: 0.65rem !important;
  letter-spacing: 0.02em !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
}

/* ФИНАЛЬНЫЙ ФИКс ПЛИТОК:
   Не uppercase — они не заголовки страницы.
   Просто меньший шрифт, обычная капитализация. */
.project-background *:not(svg):not(path) {
  font-family: "FSRailway", Arial, sans-serif !important;
  text-transform: none !important;
  font-size: 0.8rem !important;
  letter-spacing: 0 !important;
  font-weight: 600 !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
}

/* ── ФИНАЛЬНЫЙ ФИКс ПЛИТКИ ───────────────────── */
/* div.project-title в .project-card — 24px → 0.85rem, без uppercase */
.project-card .project-title,
.project-card div.project-title {
  text-transform: none !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  font-family: "FSRailway", Arial, sans-serif !important;
  letter-spacing: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* ══════════════════════════════════════════════
   МОБИЛЬНЫЕ ФИКСЫ v2
   ══════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── ЛОГОТИП: только эмблема ─────────────── */
  .logo-link {
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
    margin: 12px 4px 12px 8px !important;
    background-size: auto 100% !important;
    background-position: left center !important;
  }

  /* ── ХЕДЕР: скрываем имя и стрелку ──────── */
  span.username { display: none !important; }
  .dropdown-icon { display: none !important; }
  /* Уменьшаем кнопку dropdown до размера аватара */
  .username-drop {
    padding: 0 !important;
    min-width: 0 !important;
    background: none !important;
    border: none !important;
  }
  .avatar { width: 32px !important; height: 32px !important; }

  /* ── ЗАДАЧИ: убираем лишнее ──────────────── */
  /* Название проекта */
  a.task-project { display: none !important; }

  /* Приоритет (Высокий, Низкий и т.д.) */
  [class*="priority"],
  .priority-label,
  [class*="prio-"] { display: none !important; }

  /* Иконка ≡ в конце строки */
  .project-task-icon { display: none !important; }

  /* Исполнитель: скрываем имя, оставляем только аватар */
  [class*="assignee"] span,
  [class*="assignee"] .username,
  [class*="user-avatar"] span { display: none !important; }
}

/* МОБИЛЬНЫЕ ФИКСЫ v3 */
@media (max-width: 768px) {
  /* Заголовки разделов — компактнее */
  h3 { font-size: 0.9rem !important; }

  /* Теги/метки не наследуют uppercase */
  .tag, .label { text-transform: none !important; }

  /* Имя исполнителя в задаче (denis, yarik) */
  .assignee, [class*="assignee"] { display: none !important; }
  
}

/* Убираем лого из шапки на мобилке совсем */
@media (max-width: 768px) {
  .logo-link { display: none !important; }
}
