/* path: cabinet_httpdocs/public/assets/style.css */

/* =========================================================
 * AIRIS CABINET — GLOBAL STYLE (reference: modern dashboard)
 * Dark sidebar + light workspace + soft cards
 * ========================================================= */

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

/* IMPORTANT: убираем «скачки» из-за появления/исчезновения скроллбара */
html{
  scrollbar-gutter: stable;
}

body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background:#F3F4F6;
  color:#111827;

  /* стабильно держим вертикальный скролл */
  overflow-y: scroll;
}

/* Links */
a{ color:inherit; text-decoration:none; }

/* ---------- Tokens ---------- */
:root{
  /* Backgrounds */
  --bg-app:#F3F4F6;
  --bg-card:#FFFFFF;

  /* Text */
  --text:#111827;
  --muted:#6B7280;

  /* Borders / lines */
  --line:#E5E7EB;

  /* Sidebar (UPDATED) */
  --sb-bg:#1D1C22;
  --sb-bg-2:rgba(255,255,255,.06);
  --sb-text:rgba(255,255,255,.72);
  --sb-text-active:#FFFFFF;

  /* Primary button */
  --primary: var(--sb-bg);
  --primary-hover: #141318;

  /* Radii / shadow */
  --r-card:16px;
  --r-btn:12px;
  --shadow-card: 0 10px 30px rgba(0,0,0,.06);

  /* Spacing */
  --pad-page:24px;
}

/* ---------- Layout ---------- */
.app{ background:var(--bg-app); }

.layout{
  display:grid;
  grid-template-columns: 260px 1fr;
  min-height:100vh;

  /* IMPORTANT: чтобы контент не «толкал» сетку по ширине */
  min-width:0;
}

.main{
  /* IMPORTANT: предотвращает горизонтальные микросдвиги от длинных блоков */
  min-width:0;
}

/* ---------- Sidebar ---------- */
.sidebar{
  background:var(--sb-bg);
  color:var(--sb-text);
  padding:22px 16px;
  position:sticky;
  top:0;
  height:100vh;
}

.logo{
  height:44px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  letter-spacing:.08em;
  color:var(--sb-text-active);
  border-radius:14px;
  background:rgba(255,255,255,.06);
  margin-bottom:18px;
}

.nav{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-top:8px;
}

.nav a{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius:12px;
  color:var(--sb-text);
  font-size:14px;
  font-weight:500;
}

/* иконки в сайдбаре = цвет текста */
.nav a svg,
.nav a img{
  width:18px;
  height:18px;
  color:currentColor;
  fill:currentColor;
  opacity:.92;
}

.nav a:hover{
  background:rgba(255,255,255,.06);
  color:var(--sb-text-active);
}

.nav a.active{
  background:var(--sb-bg-2);
  color:var(--sb-text-active);
}

/* ---------- Main ---------- */
.main{
  padding:var(--pad-page);
}

.page{
  display:block;
}

/* ---------- Typography ---------- */
.h1{
  margin:0;
  font-size:28px;
  line-height:1.15;
  font-weight:700;
  letter-spacing:-0.02em;
}

.muted{
  color:var(--muted);
  font-size:13px;
  margin-top:6px;
}

/* ---------- Card ---------- */
.card{
  background:var(--bg-card);
  border-radius:var(--r-card);
  box-shadow:var(--shadow-card);
  padding:22px 24px;
  border:1px solid rgba(0,0,0,.03);
}

/* ---------- Page Head ---------- */
.pageHead{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin-bottom:18px;
}

.headActions{
  display:flex;
  gap:10px;
  align-items:center;
}

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;

  /* IMPORTANT: единая высота элементов тулбара (btn/select/search) */
  min-height:42px;

  padding:10px 14px;
  border-radius:var(--r-btn);
  font-size:14px;
  font-weight:600;
  border:1px solid var(--line);
  background:#fff;
  color:var(--text);
  cursor:pointer;
  user-select:none;
  line-height:1;
}

.btn:hover{ background:#F9FAFB; }

.btnPrimary{
  background:var(--primary);
  border-color:var(--primary);
  color:#fff;
}
.btnPrimary:hover{
  background:var(--primary-hover);
  border-color:var(--primary-hover);
}

/* icon button (for edit/delete, etc.) */
.btnIcon{
  padding:8px 10px;
  border-radius:999px;
  line-height:1;

  /* IMPORTANT: фиксируем размер, чтобы не «гуляло» */
  min-height:42px;
  min-width:42px;
}
.btnIcon img,
.btnIcon svg{
  display:block;
  width:18px;
  height:18px;
}

/* common icon image helper */
.iconImg{
  display:block;
}
.iconImg--muted{
  opacity:.78;
}

/* aliases for legacy/new markup in views */
.btnBase{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:42px;
  padding:10px 14px;
  border-radius:var(--r-btn);
  font-size:14px;
  font-weight:600;
  border:1px solid var(--line);
  background:#fff;
  color:var(--text);
  cursor:pointer;
  user-select:none;
  line-height:1;
}
.btnBase:hover{ background:#F9FAFB; }

/* legacy logout class support */
.logout{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:42px;
  padding:10px 14px;
  border-radius:var(--r-btn);
  border:1px solid var(--line);
  background:#fff;
  font-weight:600;
  font-size:14px;
  line-height:1;
}
.logout:hover{ background:#F9FAFB; }

/* =========================================================
 * TOPBAR — unified
 * - supports both .topbar and .topbarX (alias)
 * ========================================================= */

.topbar,
.topbarX{
  position:sticky;
  top:0;
  z-index:20;

  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;

  padding:0;
  margin-bottom:16px;

  background:transparent;
  border:none;
  border-radius:0;

  /* IMPORTANT: предотвращаем микродвижения от внутреннего контента */
  min-width:0;
}

/* if you still use .tbRow somewhere */
.tbRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  width:100%;
  min-width:0;
}

/* LEFT */
.tbLeft{ min-width:0; padding:14px 0 0 0; }

.tbTitle{
  font-size:18px;
  font-weight:800;
  letter-spacing:-0.02em;
  color:var(--text);
  line-height:1.1;
}

.tbSub{
  margin-top:4px;
  font-size:12px;
  color:var(--muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:56vw;
}

/* RIGHT */
.tbRight{
  display:flex;
  align-items:flex-start;
  justify-content:flex-end;
  padding:10px 0 0 0;
  gap:12px;
}

/* GROUP wrapper (make it transparent — NO background “pill”) */
.tbGroup{
  display:flex;
  align-items:center;
  gap:10px;

  padding:0;
  border-radius:18px;

  background:transparent;
  border:none;
  box-shadow:none;

  line-height:1;
}

/* USER (outer wrapper) */
.tbUser{
  display:flex;
  align-items:center;
  padding:0;
  height:auto;
  border-radius:10px;
  background:transparent;
  border:none;
  line-height:1;
}

/* User meta = visible “button” */
.tbUserMeta{
  display:flex;
  flex-direction:column;
  gap:1px;

  padding:10px 14px;
  height:44px;

  border-radius:14px;
  background:#fff;
  border:1px solid var(--line);
}

.tbUserName{
  font-weight:700;
  font-size:14px;
  color:var(--text);
  white-space:nowrap;
}

.tbUserRole{
  font-size:12px;
  font-weight:600;
  color:var(--muted);
  white-space:nowrap;
}

/* Logout button (same height as user meta) */
.tbLogout{
  display:inline-flex;
  align-items:center;
  justify-content:center;

  width:44px;
  height:44px;

  border-radius:14px;
  border:1px solid var(--line);
  background:#fff;
  text-decoration:none;
}

/* red icon (NOT border) via mask */
.tbLogoutIcon{
  width:20px;
  height:20px;

  background:#DC2626;
  display:block;

  -webkit-mask: url("/assets/icons/actions/logout.svg") no-repeat center / contain;
          mask: url("/assets/icons/actions/logout.svg") no-repeat center / contain;
}

.tbLogout:hover{ background:rgba(220,38,38,.08); border-color:rgba(220,38,38,.22); }
.tbLogout:hover .tbLogoutIcon{ background:#B91C1C; }

.tbUserMeta:hover{ background:#F9FAFB; }

/* mobile safety */
@media (max-width: 560px){
  .tbUserName{ max-width:160px; overflow:hidden; text-overflow:ellipsis; }
  .tbSub{ max-width:42vw; }
}

/* ---------- Tiles (Dashboard cards) ---------- */
.tiles{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap:14px;
}

.tile{
  background:#FAFAFA;
  border:1px solid var(--line);
  border-radius:14px;
  padding:16px 16px;
  transition: transform .06s ease, box-shadow .06s ease, background .06s ease;
}

.tile:hover{
  transform: translateY(-1px);
  background:#FFFFFF;
  box-shadow: 0 8px 20px rgba(0,0,0,.06);
}

.tileTitle{
  font-weight:700;
  font-size:15px;
  margin-bottom:6px;
  color:var(--text);
}

.tileText{
  font-size:13px;
  color:var(--muted);
  line-height:1.35;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px){
  .layout{ grid-template-columns: 86px 1fr; }
  .sidebar{ padding:18px 10px; }
  .logo{ font-size:12px; }
  .nav a{ justify-content:center; padding:10px 8px; }
  .nav a{ font-size:0; }
  .nav a::before{
    content:"•";
    font-size:18px;
    line-height:1;
    color:currentColor;
  }
}

/* Cut sidebar shell */
.sidebar.sidebarCut{
  background:transparent !important;
  padding:16px 0 16px 16px !important;
  height:100vh;
}
.sidebar.sidebarCut .sbShell{
  height:calc(100vh - 32px);
  background:var(--sb-bg);
  border-radius:22px;
  padding:18px 14px;
  box-shadow: 0 18px 40px rgba(0,0,0,.18);
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

/* Logo */
.sidebar.sidebarCut .sbLogoWide{
  color: rgba(255,255,255,.88);
  width: 100%;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 8px 14px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  overflow: hidden;
}

.sidebar.sidebarCut .sbLogoWide svg{
  display: block;
  width: 100%;
  max-width: 220px;
  height: 42px;
  overflow: hidden;
}

.sidebar.sidebarCut .sbLogoWide svg *{
  fill: currentColor !important;
  stroke: currentColor !important;
}

/* Icons */
.sidebar.sidebarCut .navIcon{
  width:18px;
  height:18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:currentColor;
  flex:0 0 18px;
}
.sidebar.sidebarCut .navIcon svg{
  width:18px;
  height:18px;
  display:block;
}
.sidebar.sidebarCut .navIcon svg *{
  fill:currentColor !important;
  stroke:currentColor !important;
}

/* =========================================================
 * FLASH (unified stack)
 * ========================================================= */

.flashStack{
  position: sticky;
  top: 0;
  z-index: 50;

  display: flex;
  flex-direction: column;
  gap: 10px;

  margin: 0 0 14px 0;
  padding: 0;
}

/* IMPORTANT: flash не должен менять геометрию страницы при появлении */
.flashStack:empty{ display:none; }

.flash{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;

  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-card);

  padding: 12px 12px;
  transition: opacity .18s ease, transform .18s ease;
}

.flashBody{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:0;
}

.flashTitle{
  font-weight:800;
  font-size:13px;
  letter-spacing:-0.01em;
  color: var(--text);
}

.flashMsg{
  font-size:13px;
  color: var(--muted);
  line-height:1.35;
  word-break: break-word;
}

.flashClose{
  width:32px;
  height:32px;
  flex:0 0 32px;

  display:inline-flex;
  align-items:center;
  justify-content:center;

  border-radius:10px;
  border:1px solid transparent;
  background:transparent;

  color: var(--muted);
  font-size:20px;
  line-height:1;
  cursor:pointer;
}
.flashClose:hover{
  background:#F9FAFB;
  border-color: rgba(0,0,0,.04);
  color: var(--text);
}

/* Type accents (minimal, without loud colors) */
.flash--success{ border-left: 4px solid rgba(16,185,129,.55); }
.flash--info{    border-left: 4px solid rgba(59,130,246,.55); }
.flash--error{   border-left: 4px solid rgba(239,68,68,.55); }

/* =========================================================
 * ERROR PAGES (403/404/500)
 * ========================================================= */

.errorPage{
  min-height: calc(100vh - 140px);
  display:flex;
  align-items:flex-start;
  justify-content:center;
  padding: 18px 0 40px;
}

.errorCard{
  width: min(760px, 100%);
  background: var(--bg-card);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(0,0,0,.04);
  padding: 26px 26px;
}

.errorCode{
  font-size: 52px;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
}

.errorTitle{
  margin-top: 10px;
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -0.02em;
  color: var(--text);
}

.errorText{
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.errorMeta{
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #FAFAFA;
}

.errorMetaRow{
  display:flex;
  gap:10px;
  padding: 4px 0;
  min-width:0;
}

.errorMetaKey{
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.errorMetaVal{
  min-width:0;
  font-size: 12px;
  color: var(--text);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.errorActions{
  margin-top: 16px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

.errorHint{
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
}

/* small screens */
@media (max-width: 560px){
  .errorCard{ padding: 20px 18px; }
  .errorCode{ font-size: 44px; }
  .errorMetaVal{ white-space: normal; word-break: break-word; }
}

/* =========================================================
 * TASKS — FULL UI STYLE
 * KPI + Tabs + Toolbar + Soft Table + Priority + Kanban + Pager
 * Namespaced: .tasksUi*
 * ========================================================= */

:root{
  /* Base */
  --tasks-accent: #CFEA63;
  --tasks-accentText: #111827;

  --tasks-soft:  rgba(255,255,255,.70);
  --tasks-soft2: rgba(255,255,255,.55);
  --tasks-soft3: rgba(255,255,255,.40);

  --tasks-border: rgba(17,24,39,.10);
  --tasks-muted:  rgba(17,24,39,.55);
  --tasks-shadow: 0 14px 34px rgba(0,0,0,.08);

  /* Priority colors (SOFT) */
  --prio-low-bg:   rgba(148,163,184,.18);
  --prio-low-bd:   rgba(148,163,184,.32);
  --prio-low-dot:  rgba(148,163,184,.85);

  --prio-med-bg:   rgba(59,130,246,.14);
  --prio-med-bd:   rgba(59,130,246,.28);
  --prio-med-dot:  rgba(59,130,246,.75);

  --prio-high-bg:  rgba(245,158,11,.16);
  --prio-high-bd:  rgba(245,158,11,.30);
  --prio-high-dot: rgba(245,158,11,.80);

  --prio-crit-bg:  rgba(239,68,68,.14);
  --prio-crit-bd:  rgba(239,68,68,.26);
  --prio-crit-dot: rgba(239,68,68,.75);
}

.tasksUi{ color: var(--text); }

/* KPI */
.tasksUiKpiGrid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap:12px;
  margin-bottom:14px;
  align-items:stretch;
  min-width:0;
}
@media (max-width:1100px){ .tasksUiKpiGrid{ grid-template-columns: repeat(2,1fr); } }
@media (max-width:640px){  .tasksUiKpiGrid{ grid-template-columns: 1fr; } }

.tasksUiKpiCard{
  background: var(--tasks-soft2);
  border:1px solid var(--tasks-border);
  border-radius:22px;
  box-shadow: var(--tasks-shadow);
  padding:14px 16px;

  display:flex;
  justify-content:space-between;
  align-items:stretch;
  gap:12px;

  /* IMPORTANT: стабильная высота KPI */
  min-height: 120px;

  /* IMPORTANT: чтобы внутренний контент не влиял на ширину сетки */
  min-width:0;
}

.tasksUiKpiLabel{
  font-size:12px;
  font-weight:700;
  color: var(--tasks-muted);
}
.tasksUiKpiValue{
  font-size:26px;
  font-weight:850;
  letter-spacing:-0.02em;
}

/* KPI color helpers (used by Projects and others) */
.kpiTotal{ color:#111827; }
.kpiInwork{ color:#2563EB; }
.kpiProgress{ color:#DC2626; }

/* Tabs */
.tasksUiTabsRow{
  background: var(--tasks-soft2);
  border:1px solid var(--tasks-border);
  border-radius:999px;
  padding:6px;
  display:flex;
  gap:6px;
  box-shadow: var(--shadow-card);
  min-width:0;
}
.tasksUiTab{
  border:0;
  background:transparent;
  color: var(--tasks-muted);
  border-radius:999px;
  padding:10px 14px;
  font-size:13px;
  font-weight:700;
  cursor:pointer;
}
.tasksUiTab:hover{ background:rgba(0,0,0,.03); color:var(--text); }
.tasksUiTab.isActive{
  background: rgba(255,255,255,.82);
  border:1px solid var(--tasks-border);
  color: var(--text);
  box-shadow: 0 8px 18px rgba(0,0,0,.06);
}

/* Toolbar (единый блок — без дублей ниже) */
.tasksUiToolbar{
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin:12px 0 14px;
  flex-wrap:wrap;
  min-width:0;
}

.tasksUiToolbarLeft,
.tasksUiToolbarRight{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  min-width:0;
}

.tasksUiToolbarLeft{
  flex: 1 1 auto;
}

.tasksUiToolbarRight{
  flex: 0 1 auto;
  justify-content:flex-end;
}

/* Search */
.tasksUiSearch{
  display:flex;
  align-items:center;
  gap:8px;
  background: rgba(255,255,255,.82);
  border:1px solid var(--tasks-border);
  border-radius:999px;
  padding:10px 12px;
  box-shadow: var(--shadow-card);

  /* IMPORTANT: стабильное поведение ширины */
  flex: 1 1 280px;
  min-width: 220px;
  max-width: 100%;
}
.tasksUiSearch input{
  border:0;
  background:transparent;
  outline:none;
  width:100%;
  font-size:13px;
  min-width:0;
}

/* Select */
.tasksUiSelect{
  -webkit-appearance:none;
  -moz-appearance:none;
  appearance:none;

  display:inline-flex;
  align-items:center;

  height:42px;
  line-height:20px;

  background: rgba(255,255,255,.82);
  border:1px solid var(--tasks-border);
  border-radius:999px;

  padding:10px 44px 10px 14px;
  font-size:13px;
  font-weight:600;
  color:var(--text);

  box-shadow: var(--shadow-card);
  cursor:pointer;

  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%),
    linear-gradient(to right, transparent, transparent);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%,
    calc(100% - 44px) 50%;
  background-size: 6px 6px, 6px 6px, 1px 18px;
  background-repeat:no-repeat;
}
.tasksUiSelect:focus{
  outline:none;
  box-shadow: 0 0 0 4px rgba(29,28,34,.12), var(--shadow-card);
  border-color: rgba(29,28,34,.35);
}
.tasksUiSelect option{ color: var(--text); }

/* На всякий случай: select внутри тулбара не должен раздувать ширину */
.tasksUiToolbarLeft .tasksUiSelect{
  flex: 0 1 190px;
  max-width: 260px;
  min-width: 160px;
}
.tasksUiToolbarLeft select{ min-width:0; }

/* Mobile toolbar layout */
@media (max-width:760px){
  .tasksUiToolbar{ flex-direction:column; }
  .tasksUiToolbarRight{ justify-content:flex-start; }
}

/* Soft Table */
.tasksUiTableCard{
  background: var(--tasks-soft3);
  border:1px solid var(--tasks-border);
  border-radius:26px;
  box-shadow: var(--tasks-shadow);
  padding:14px;
  min-width:0;
}

.tasksUiTable{
  width:100%;
  border-collapse:separate;
  border-spacing:0 10px;

  /* IMPORTANT: предотвращаем «гуляние» ширины столбцов */
  table-layout: fixed;
}

.tasksUiThead th{
  background: var(--tasks-soft2);
  border-top:1px solid var(--tasks-border);
  border-bottom:1px solid var(--tasks-border);
  padding:12px 14px;
  font-size:12px;
  font-weight:800;
  color: var(--tasks-muted);

  /* IMPORTANT: не даем заголовкам менять ширину */
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.tasksUiThead th:first-child{
  border-left:1px solid var(--tasks-border);
  border-radius:999px 0 0 999px;
}
.tasksUiThead th:last-child{
  border-right:1px solid var(--tasks-border);
  border-radius:0 999px 999px 0;
  text-align:right;
}

.tasksUiTbody td{
  background: rgba(255,255,255,.82);
  border-top:1px solid rgba(0,0,0,.06);
  border-bottom:1px solid rgba(0,0,0,.06);
  padding:12px 14px;
  font-size:13px;

  /* IMPORTANT: фиксируем содержимое ячеек */
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.tasksUiTbody td:first-child{
  border-left:1px solid rgba(0,0,0,.06);
  border-radius:16px 0 0 16px;
}
.tasksUiTbody td:last-child{
  border-right:1px solid rgba(0,0,0,.06);
  border-radius:0 16px 16px 0;
  text-align:right;
}
.tasksUiTbody tr:hover td{ background:rgba(255,255,255,.92); }

.tasksUiCellMuted{ color: var(--tasks-muted); }

/* Status */
.tasksUiStatus{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:7px 12px;
  border-radius:999px;
  border:1px solid var(--tasks-border);
  font-size:12px;
  font-weight:800;
  background: var(--tasks-soft2);
  max-width:100%;
}
.tasksUiDot{
  width:8px; height:8px;
  border-radius:999px;
  background:rgba(0,0,0,.30);
}
.tasksUiStatus.isInProgress{
  background: rgba(207,234,99,.55);
  border-color: rgba(207,234,99,.75);
}
.tasksUiStatus.isDone{
  background: rgba(160,230,220,.55);
  border-color: rgba(160,230,220,.75);
}
.tasksUiStatus.isOverdue{
  background: rgba(239,68,68,.16);
  border-color: rgba(239,68,68,.28);
}

/* Priority */
.tasksUiPriority{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:7px 12px;
  border-radius:999px;
  border:1px solid var(--tasks-border);
  font-size:12px;
  font-weight:850;
  max-width:100%;
}
.tasksUiPriorityDot{
  width:8px; height:8px;
  border-radius:999px;
}

.tasksUiPriority.isLow{
  background: var(--prio-low-bg);
  border-color: var(--prio-low-bd);
}
.tasksUiPriority.isLow .tasksUiPriorityDot{ background: var(--prio-low-dot); }

.tasksUiPriority.isMed{
  background: var(--prio-med-bg);
  border-color: var(--prio-med-bd);
}
.tasksUiPriority.isMed .tasksUiPriorityDot{ background: var(--prio-med-dot); }

.tasksUiPriority.isHigh{
  background: var(--prio-high-bg);
  border-color: var(--prio-high-bd);
}
.tasksUiPriority.isHigh .tasksUiPriorityDot{ background: var(--prio-high-dot); }

.tasksUiPriority.isCritical{
  background: var(--prio-crit-bg);
  border-color: var(--prio-crit-bd);
}
.tasksUiPriority.isCritical .tasksUiPriorityDot{ background: var(--prio-crit-dot); }

/* Kanban */
.tasksUiKanbanGrid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap:12px;
}
@media (max-width:1100px){ .tasksUiKanbanGrid{ grid-template-columns: repeat(2,1fr); } }
@media (max-width:640px){  .tasksUiKanbanGrid{ grid-template-columns: 1fr; } }

.tasksUiKanbanCol{
  background: rgba(243,244,246,.65);
  border:1px solid var(--line);
  border-radius:18px;
  padding:12px;
  min-width:0;
}
.tasksUiKanbanColHead{
  display:flex;
  justify-content:space-between;
  margin-bottom:10px;
  min-width:0;
}
.tasksUiKanbanColTitle{
  font-weight:850;
  font-size:13px;
}
.tasksUiKanbanColCount{
  font-weight:850;
  font-size:12px;
  color: var(--muted);
}

.tasksUiKanbanCard{
  background: rgba(255,255,255,.82);
  border:1px solid rgba(0,0,0,.06);
  border-radius:18px;
  padding:12px;
  box-shadow: 0 10px 22px rgba(0,0,0,.06);
  margin-bottom:10px;
  min-width:0;
}
.tasksUiKanbanCardTitle{
  font-size:13px;
  font-weight:850;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.tasksUiKanbanMeta{
  margin-top:10px;
  display:flex;
  justify-content:space-between;
  font-size:12px;
  color: var(--muted);
  gap:10px;
}

/* Pager */
.tasksUiPager{
  margin-top:14px;
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.tasksUiPagerShell{
  background: var(--tasks-soft2);
  border:1px solid var(--tasks-border);
  border-radius:999px;
  padding:6px;
  display:flex;
  align-items:center;
  gap:6px;
  box-shadow: var(--shadow-card);
}
.tasksUiPageBtn{
  border:0;
  background:transparent;
  cursor:pointer;

  display:inline-flex;
  align-items:center;
  justify-content:center;

  min-width:36px;
  height:36px;
  padding:0 12px;

  border-radius:999px;

  font-size:12px;
  font-weight:900;
  color: var(--tasks-muted);
}
.tasksUiPageBtn:hover{
  background: rgba(29,28,34,.06);
  color: var(--text);
}
.tasksUiPageBtn.isActive{
  background: var(--sb-bg);
  color: #fff;
}
.tasksUiPageArrow{
  width:36px;
  height:36px;

  display:inline-flex;
  align-items:center;
  justify-content:center;

  border-radius:999px;
  border:1px solid rgba(17,24,39,.12);
  background:rgba(255,255,255,.85);

  font-weight:900;
  color: var(--text);
}
.tasksUiPageArrow:hover{
  background: rgba(29,28,34,.06);
}

/* =========================================================
 * PROJECTS — module styles
 * Namespaced: .projectsUi .proj*
 * ========================================================= */

.projectsUi{ display:block; }

/* FIX: 3-я KPI в Projects должна быть колонкой, чтобы шкала была снизу */
.tasksUiKpiCard.projKpiProgress{
  flex-direction: column;
  align-items: stretch;
}
.tasksUiKpiCard.projKpiProgress .projProgBar{
  width:100%;
}

/* KPI: projects uses same grid, but has special spanning card on wide screens */
@media (min-width:1100px){
  .projectsUi .tasksUiKpiCard.projKpiProgress{ grid-column: 3 / span 2; }
}

/* Responsive behavior for projects KPI (keep consistent, but allow 1 col on small) */
@media (max-width: 980px){
  .projectsUi .tasksUiKpiGrid{ grid-template-columns: 1fr !important; }
}

/* Progress KPI inner */
.projProgRow{ display:flex; align-items:flex-end; justify-content:space-between; gap:12px; min-width:0; }
.projProgBar{
  margin-top:10px;
  height:14px;
  border-radius:999px;
  border:1px solid rgba(17,24,39,.10);
  background: rgba(220,38,38,.12);
  overflow:hidden;
}
.projProgFill{
  height:100%;
  border-radius:999px;
  background: rgba(220,38,38,.70);
}

/* Gantt shell: reuse tasks card */
.tasksUiTableCard.projGanttShell{ padding:14px; }
.projGanttRows{ display:flex; flex-direction:column; gap:10px; }

/* row layout */
.projRow{
  display:grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(260px, 1.25fr) auto;
  gap:12px;
  align-items:center;
  min-width:0;
}
@media (max-width: 980px){
  .projRow{ grid-template-columns: 1fr; }
}

/* meta card */
.projMeta{
  position:relative;
  padding:10px 12px;
  border:1px solid rgba(17,24,39,.08);
  border-radius:16px;
  background:#fff;
  box-shadow:var(--shadow-card);
  min-width:0;
  min-height:46px;
}
.projTitle{
  font-weight:950;
  font-size:16px;
  line-height:1.15;
  letter-spacing:-.02em;
  margin:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.projSub{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  margin-top:8px;
}

/* badges */
.projBadge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:950;
  border:1px solid rgba(17,24,39,.10);
  background:rgba(255,255,255,.7);
  line-height:1;
}
.projBadgeStatus{ background:rgba(37,99,235,.08); border-color:rgba(37,99,235,.18); color:#1d4ed8; }
.projBadgeDone{ background:rgba(22,163,74,.10); border-color:rgba(22,163,74,.18); color:#15803d; }
.projBadgeBacklog{ background:rgba(245,158,11,.10); border-color:rgba(245,158,11,.18); color:#b45309; }

/* owner pill */
.projOwner{
  position:absolute;
  top:8px; right:10px;
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:5px 10px;
  border-radius:999px;
  border:1px solid rgba(17,24,39,.10);
  background:rgba(255,255,255,.82);
  box-shadow:var(--shadow-card);
  font-weight:700;
  font-size:12px;
  color:rgba(17,24,39,.70);
  max-width:70%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.projOwner img{ display:block; width:16px; height:16px; opacity:.85; }

/* gantt bar */
.projBarWrap{
  position:relative;
  height:46px;
  width:100%;
  border-radius:18px;
  border:1px solid rgba(17,24,39,.08);
  background:#fff;
  box-shadow:var(--shadow-card);
  overflow:hidden;
  min-width:0;
}
.projGrid{
  position:absolute; inset:0;
  background-image: linear-gradient(to right, rgba(17,24,39,.06) 1px, transparent 1px);
  background-size: calc(100% / 8) 100%;
  opacity:.65;
}
.projToday{
  position:absolute; top:0; bottom:0;
  width:2px;
  background: rgba(220,38,38,.85);
  box-shadow: 0 0 0 6px rgba(220,38,38,.10);
}
.projBaseline{
  position:absolute; top:10px; height:26px;
  border-radius:999px;
  background: rgba(220,38,38,.14);
}
.projFill{
  position:absolute; top:9px; height:28px;
  border-radius:999px;
  background: rgba(220,38,38,.70);
}
.projBarText{
  position:absolute; inset:0;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  padding:0 12px;
  font-size:12px;
  font-weight:950;
  color: rgba(17,24,39,.78);
  pointer-events:none;
}
.projBarPill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:44px;
  height:26px;
  padding:0 10px;
  border-radius:999px;
  border:1px solid rgba(17,24,39,.10);
  background:rgba(255,255,255,.86);
}

/* actions */
.projActions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  padding:6px 0;
}
@media (max-width: 980px){
  .projActions{ justify-content:flex-start; padding:0; }
}

/* optional small tweak: projects search width */
.projectsUi .tasksUiSearch input{ width:280px; max-width:70vw; }

/* =========================================================
 * PROJECTS MODAL — unified modal styles
 * ========================================================= */

.projModalOverlay{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.28);
  z-index:999;
  padding:24px;

  /* IMPORTANT: overlay не должен «жрать» ширину/вызывать микродвижения */
  overflow:auto;
}

.projModalCard{
  max-width:760px;
  margin:40px auto;
  background:#fff;
  border:1px solid var(--line);
  border-radius:18px;
  box-shadow:var(--shadow-card);
  overflow:hidden;
}

.projModalHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  border-bottom:1px solid var(--line);
}

.projModalTitle{
  font-weight:950;
  letter-spacing:-.02em;
}

.projModalBody{
  padding:14px 16px;
}

.projFormRow2{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:12px;
}
@media (max-width:760px){
  .projFormRow2{ grid-template-columns: 1fr; }
}

.projFormRow3{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:12px;
  margin-top:12px;
}
@media (max-width:900px){
  .projFormRow3{ grid-template-columns: 1fr; }
}

.projFormLabel{
  margin:0 0 6px 0;
  font-weight:600;
  color:var(--muted);
  font-size:13px;
}

.projInput,
.projTextarea{
  width:100%;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#fff;
  font-size:14px;
}
.projInput{ font-weight:500; }
.projTextarea{
  font-weight:500;
  resize:vertical;
  min-height:110px;
}

.projFormHint{
  margin-top:6px;
  font-size:12px;
  color:var(--muted);
}

.projModalFooter{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:14px;
  padding-top:14px;
  border-top:1px solid var(--line);
}

/* =========================================================
 * GLOBAL: Primary actions should match sidebar color
 * ========================================================= */

.btnPrimary,
.tasksUiPrimaryBtn{
  background: var(--sb-bg);
  border-color: var(--sb-bg);
  color: #fff;
}
.btnPrimary:hover,
.tasksUiPrimaryBtn:hover{
  background: var(--primary-hover);
  border-color:var(--primary-hover);
}

/* =========================================================
 * STRUCTURE (Departments/Positions/Vacancies) — helpers
 * Purpose: remove inline styles in views, keep Tasks-like layout
 * ========================================================= */

/* --- tiny utilities --- */
.tc{ text-align:center !important; }
.tr{ text-align:right !important; }
.nowrap{ white-space:nowrap !important; }

/* Actions cell (right aligned, no wrap) */
.actionsCell{
  text-align:right !important;
  white-space:nowrap !important;
}

/* Group icon buttons with stable gap */
.actionsGap{
  display:inline-flex;
  align-items:center;
  gap:6px;
}

/* Icon button variant (we already have .btnIcon, but make it explicit) */
.btnIconRound{
  padding:8px 10px;
  border-radius:999px;
  line-height:1;

  /* IMPORTANT: фикс высота/ширина как у .btnIcon */
  min-height:42px;
  min-width:42px;
}
.btnIconRound img,
.btnIconRound svg{
  display:block;
  width:18px;
  height:18px;
}

/* Empty row tone helper */
.tableEmptyMuted{
  color: var(--tasks-muted);
}

/* Namespace for structure pages (optional wrapper) */
.structureUi{ display:block; }

/* (Optional) If in Departments the last TH should be right-aligned like Tasks */
.structureUi .tasksUiThead th:last-child{
  text-align:right;
}

/* (Optional) Center helper for header cells too */
.structureUi .tasksUiThead th.tc{ text-align:center; }
.structureUi .tasksUiTbody td.tc{ text-align:center; }

/* =========================================================
 * FINPLAN UI PATCH (Plan/FOT)
 * Добавляет недостающие паттерны: filtersGrid, kpiRow, details sections
 * ========================================================= */

/* Form fields */
.field { display:flex; flex-direction:column; gap:6px; min-width:0; }
.label { font-size:12px; font-weight:600; color:var(--muted); }
.input, .select, .textarea {
  width:100%;
  min-width:0;
  height:38px;
  padding:8px 10px;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--panel);
  color:var(--text);
  outline:none;
}
.textarea { height:auto; min-height:90px; padding:10px; }
.input:focus, .select:focus, .textarea:focus {
  border-color:rgba(99,102,241,.55);
  box-shadow:0 0 0 3px rgba(99,102,241,.18);
}

/* Filters layout */
.filtersRow { display:block; }
.filtersGrid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:12px;
  align-items:end;
}
@media (max-width: 1100px){
  .filtersGrid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px){
  .filtersGrid{ grid-template-columns: 1fr; }
}
.filtersActions{
  display:flex;
  gap:10px;
  margin-top:12px;
  justify-content:flex-start;
  flex-wrap:wrap;
}

/* KPI cards */
.kpiRow{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:12px;
}
@media (max-width: 1100px){
  .kpiRow{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px){
  .kpiRow{ grid-template-columns: 1fr; }
}
.kpi{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px;
  box-shadow: var(--shadow-soft);
}
.kpiLabel{ font-size:12px; font-weight:600; color:var(--muted); margin-bottom:6px; }
.kpiValue{ font-size:18px; font-weight:800; letter-spacing:.2px; }

/* Details sections (type -> category -> month) */
.section, .subSection, .subSection2{
  border:1px solid var(--border);
  border-radius:16px;
  background:var(--panel);
  margin:10px 0;
  overflow:hidden;
  box-shadow: var(--shadow-soft);
}
.sectionTitle, .subSectionTitle, .subSectionTitle2{
  list-style:none;
  cursor:pointer;
  padding:12px 14px;
  font-weight:800;
}
.subSectionTitle{ font-weight:700; }
.subSectionTitle2{ font-weight:700; }

.section > summary::-webkit-details-marker,
.subSection > summary::-webkit-details-marker,
.subSection2 > summary::-webkit-details-marker { display:none; }

.section > summary,
.subSection > summary,
.subSection2 > summary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  border-bottom:1px solid var(--border);
  background: linear-gradient(180deg, rgba(0,0,0,.03), rgba(0,0,0,0));
}
.section[open] > summary,
.subSection[open] > summary,
.subSection2[open] > summary{
  border-bottom:1px solid var(--border);
}

.tableWrap{ overflow:auto; }
.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  font-size:13px;
}
.table thead th{
  text-align:left;
  padding:10px 10px;
  color:var(--muted);
  font-weight:700;
  border-bottom:1px solid var(--border);
  background: rgba(0,0,0,.02);
}
.table tbody td{
  padding:10px 10px;
  border-bottom:1px solid var(--border);
  vertical-align:top;
}
.taRight{ text-align:right; }

/* Badges */
.badge{
  display:inline-flex;
  align-items:center;
  padding:4px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
  border:1px solid var(--border);
  background:rgba(0,0,0,.03);
}
.badgeOk{
  border-color:rgba(16,185,129,.25);
  background:rgba(16,185,129,.10);
}
.badgeBase{
  border-color:rgba(100,116,139,.25);
  background:rgba(100,116,139,.10);
}

/* patch: make btnXs реально маленьким (перебить min-height:42px у .btn/.btnBase) */
.btnXs{
  height:30px;
  min-height:30px;   /* ВАЖНО */
  padding:6px 10px;
  border-radius:12px;
  font-size:12px;
  line-height:1;
}


/* =========================================================
 * UI STANDARD — shared helpers (remove inline styles in views)
 * Added for Finplan/Docs/HR/etc. to match Tasks UI canon
 * ========================================================= */

/* Compact button for row actions (keeps toolbar/button height logic intact) */
.btnSm{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:36px;
  padding:8px 12px;
  border-radius:12px;
  font-size:13px;
  font-weight:700;
  border:1px solid var(--line);
  background:#fff;
  color:var(--text);
  cursor:pointer;
  user-select:none;
  line-height:1;
}
.btnSm:hover{ background:#F9FAFB; }

/* Table scroll wrapper (use instead of inline overflow:auto) */
.tableWrap{
  overflow:auto;
  -webkit-overflow-scrolling: touch;
  min-width:0;
}

/* Card header row (title left, meta right) — use inside .card */
.cardHeadRow{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:10px;
  margin-bottom:12px;
  min-width:0;
}
.cardHeadTitle{
  font-size:15px;
  font-weight:850;
  letter-spacing:-0.01em;
  color:var(--text);
  min-width:0;
}
.cardHeadMeta{
  font-size:13px;
  color:var(--muted);
  white-space:nowrap;
  min-width:0;
}

/* Input icon box (avoid emoji drift; consistent sizing) */
.inputIcon{
  display:inline-flex;
  width:18px;
  height:18px;
  align-items:center;
  justify-content:center;
  opacity:.72;
  flex:0 0 18px;
}

/* Fixed-width period inputs for toolbar (prevents layout "jump") */
.periodRow{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  min-width:0;
}
.periodInput{
  flex:0 0 220px;
  min-width:220px;
}

/* Numeric cell emphasis (use instead of inline style on Net) */
.cellPos{ font-weight:700; }
.cellNeg{ color:#DC2626; font-weight:850; }

/* Optional: reusable padding variant (instead of inline padding tweaks) */
.cardPad18{ padding:18px 18px; }

/* Optional: right-aligned action group inside table cell */
.rowActions{
  display:flex;
  gap:8px;
  justify-content:flex-end;
  align-items:center;
  flex-wrap:wrap;
}
