:root{
  --accent:#4f5dff;
  --accent-strong:#7a3cff;
  --cyan:#2ad4d0;
  --ink:#12163a;
  --text:#1c2250;
  --muted:#4f5a9a;
  --border:rgba(89,103,255,.22);
  --card:#fff;
  --radius:16px;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font:16px/1.55 "Manrope", sans-serif;
  color:var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(122,60,255,.12), transparent 34%),
    radial-gradient(circle at 90% 20%, rgba(42,212,208,.1), transparent 30%),
    linear-gradient(180deg, #f5f6ff 0%, #ebefff 45%, #f7f8ff 100%);
  min-height:100vh;
}
a{color:var(--accent-strong); text-decoration:none}
a:hover{color:var(--accent)}
.staff-wrap{width:min(1100px, 94vw); margin-inline:auto}
.staff-header{
  position:sticky; top:0; z-index:20;
  background:rgba(18,22,58,.92);
  border-bottom:1px solid rgba(170,190,255,.22);
  backdrop-filter:blur(12px);
  box-shadow:0 10px 28px rgba(12,16,48,.28);
}
.staff-header-inner{display:flex; align-items:center; justify-content:space-between; gap:14px; min-height:78px}
.staff-header-inner--nav{display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center}
.staff-logo{display:flex; align-items:center; gap:12px; color:#eef2ff; flex:0 0 auto}
.staff-logo:hover{color:#fff}
.staff-logo img{width:42px; height:auto; filter:drop-shadow(0 6px 14px rgba(20,30,90,.35))}
.staff-logo strong{display:block; letter-spacing:.04em}
.staff-logo small{display:block; color:rgba(200,210,255,.72); font-weight:600}
.staff-nav-slider{
  position:relative;
  min-width:0;
  height:56px;
  cursor:grab;
  user-select:none;
  touch-action:pan-y;
}
.staff-nav-slider.is-dragging{cursor:grabbing}
.staff-nav-viewport{
  overflow:hidden;
  height:100%;
  mask-image:linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent);
  -webkit-mask-image:linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent);
}
.staff-nav-track{
  display:flex;
  align-items:stretch;
  gap:10px;
  height:100%;
  width:max-content;
  will-change:transform;
}
.staff-nav-btn{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0 20px;
  min-width:132px;
  height:100%;
  border:1px solid rgba(170,190,255,.28);
  background:rgba(79,93,255,.18);
  color:#eef2ff;
  font-weight:700;
  font-size:15px;
  letter-spacing:.03em;
  white-space:nowrap;
  transition:background .2s ease, border-color .2s ease, box-shadow .2s ease, color .2s ease;
}
.staff-nav-btn:hover{
  color:#fff;
  background:rgba(79,93,255,.34);
  border-color:rgba(170,190,255,.55);
  box-shadow:0 10px 28px rgba(55,70,200,.28);
}
.staff-nav-btn.is-active{
  color:#fff;
  background:linear-gradient(145deg, rgba(79,93,255,.72), rgba(122,60,255,.72));
  border-color:rgba(180,200,255,.45);
  box-shadow:0 10px 28px rgba(55,70,200,.3);
}
.staff-nav-fade{display:none}
.staff-nav-exit{
  flex:0 0 auto;
  padding:12px 16px;
  border:1px solid rgba(170,190,255,.35);
  background:rgba(255,255,255,.08);
  color:#eef2ff;
  font-weight:700;
  font-size:14px;
  letter-spacing:.02em;
  transition:background .2s ease, border-color .2s ease, color .2s ease;
}
.staff-nav-exit:hover{
  color:#fff;
  background:rgba(229,83,75,.22);
  border-color:rgba(255,160,150,.45);
}
@media (max-width:720px){
  .staff-header-inner--nav{grid-template-columns:auto minmax(0,1fr); grid-template-rows:auto auto; gap:10px; padding-block:10px}
  .staff-nav-exit{grid-column:2; justify-self:end}
  .staff-nav-slider{grid-column:1 / -1; height:48px}
  .staff-nav-btn{min-width:112px; font-size:13px; padding:0 14px}
  .staff-logo small{display:none}
}
.staff-main{padding:36px 0 64px}
.staff-footer{padding:22px 0; color:#b8c4ff; background:linear-gradient(180deg,#171d52 0%, #12163a 100%); text-align:center; font-size:14px}

.eyebrow{margin:0 0 8px; color:var(--accent-strong); text-transform:uppercase; letter-spacing:.12em; font-size:12px; font-weight:700}
.eyebrow-link{color:inherit; text-decoration:none}
.eyebrow-link:hover{color:var(--ink); text-decoration:underline; text-underline-offset:3px}
.page-title{margin:0 0 10px; font-size:clamp(28px,4vw,40px); color:var(--ink); font-weight:800; line-height:1.15}
.muted{color:var(--muted)}
.card{
  background:linear-gradient(160deg,#fff 0%, #f0f2ff 100%);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:22px;
  box-shadow:0 10px 24px rgba(70,85,190,.08);
}
.card + .card{margin-top:16px}
.grid-2{display:grid; grid-template-columns:1.2fr .8fr; gap:16px}
@media (max-width:860px){.grid-2{grid-template-columns:1fr}}

.auth-card{max-width:480px; margin:40px auto}
@media (max-width:520px){
  .form .remember-label{white-space:normal}
  .auth-logo{width:56px}
}
.auth-title-row{
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  margin:0 0 12px;
}
.auth-card h1{margin:0; font-size:30px; color:var(--ink)}
.auth-logo{
  width:72px; height:auto; display:block; flex:0 0 auto;
  object-fit:contain;
  filter:drop-shadow(0 6px 14px rgba(55,70,180,.18));
}
.form{display:grid; gap:12px}
.form label{display:grid; gap:6px; font-weight:700; color:var(--ink); font-size:14px}
.form input:not([type="checkbox"]):not([type="radio"]),
.form select,
.form textarea{
  width:100%; border:1px solid var(--border); border-radius:12px;
  background:#fff; color:var(--ink); padding:12px 14px; font:inherit;
}
.form input:not([type="checkbox"]):not([type="radio"]):focus,
.form select:focus,
.form textarea:focus{
  outline:none; border-color:var(--cyan); box-shadow:0 0 0 3px rgba(42,212,208,.2);
}
.form-row{display:flex; align-items:center; gap:10px}
.form-row label{display:flex; align-items:center; gap:8px; font-weight:600; color:var(--muted)}
.form .remember-row{margin-top:2px}
.form .remember-label{
  display:flex; flex-direction:row; align-items:center; gap:10px;
  font-weight:600; color:var(--muted); white-space:nowrap;
}
.form .remember-label input[type="checkbox"]{
  width:18px; height:18px; margin:0; flex:0 0 auto;
  accent-color:var(--accent);
}
.form-actions{display:flex; gap:10px; flex-wrap:wrap; margin-top:4px}
.btn{
  appearance:none; border:0; border-radius:12px; cursor:pointer;
  background:linear-gradient(145deg, var(--accent), var(--accent-strong));
  color:#fff; font-weight:700; padding:12px 16px;
  box-shadow:0 10px 24px rgba(79,93,255,.28); display:inline-flex; align-items:center; gap:8px;
}
.btn:hover{filter:brightness(1.05); color:#fff}
.btn-ghost{background:#fff; color:var(--ink); border:1px solid var(--border); box-shadow:none}
.btn-ghost:hover{background:rgba(79,93,255,.08); color:var(--accent-strong); filter:none}
.btn-danger{background:linear-gradient(145deg,#f0716a,#c83b34)}
.btn-sm{padding:8px 12px; font-size:14px}

.alert{padding:12px 14px; border-radius:12px; margin:0 0 14px}
.alert-ok{background:rgba(31,169,113,.12); border:1px solid rgba(31,169,113,.4); color:#0e7a4e}
.alert-error{background:rgba(229,83,75,.1); border:1px solid rgba(229,83,75,.4); color:#a32d27}

.cabinet-tiles{display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin-top:18px}
@media (max-width:860px){.cabinet-tiles{grid-template-columns:1fr}}
.profile-grid{margin-top:14px}
.form-row-dates{display:grid; grid-template-columns:1fr 1fr; gap:12px}
@media (max-width:600px){.form-row-dates{grid-template-columns:1fr}}
.comms-tabs{display:flex; flex-wrap:wrap; gap:8px; margin:14px 0}
.comms-tab{
  padding:8px 12px; border-radius:999px; border:1px solid var(--border);
  background:#fff; color:var(--ink); font-weight:700; font-size:13px;
}
.comms-tab:hover,.comms-tab.active{background:rgba(79,93,255,.12); color:var(--accent-strong)}
.comms-status-filters{display:flex; flex-wrap:wrap; gap:8px; margin-bottom:4px}
.comms-list{display:flex; flex-direction:column; gap:10px}
.comms-item{border:1px solid var(--border); border-radius:12px; padding:12px; background:#fff}
.comms-item.is-new{background:rgba(79,93,255,.06); border-color:rgba(79,93,255,.35)}
.comms-item-head{display:flex; justify-content:space-between; gap:10px; align-items:flex-start; margin-bottom:4px}
.comms-item-text{margin:8px 0 0; white-space:pre-wrap}
.tile{
  display:block; padding:18px; border-radius:16px; border:1px solid var(--border);
  background:linear-gradient(160deg,#fff 0%, #edf0ff 100%);
  box-shadow:0 10px 24px rgba(70,85,190,.07);
  color:var(--ink); min-height:130px;
  transition:transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.tile:hover{transform:translateY(-2px); border-color:rgba(79,93,255,.4); color:var(--ink); box-shadow:0 14px 30px rgba(70,85,190,.14)}
.tile h3{margin:0 0 8px; font-size:18px}
.tile p{margin:0; color:var(--muted); font-size:14px; line-height:1.5}
.tile-static{cursor:default}
.tile-static:hover{transform:none}
.tile-actions{display:flex; flex-wrap:wrap; gap:8px; margin-top:14px}
.tile-actions .btn[aria-disabled="true"]{opacity:.45; pointer-events:none; cursor:not-allowed}
.tile-soon{opacity:.78}
.user-hello{margin:0 0 18px; color:var(--muted)}

.table{width:100%; border-collapse:collapse}
.table th,.table td{padding:12px 10px; border-bottom:1px solid rgba(89,103,255,.14); text-align:left; vertical-align:middle}
.table th{color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:.05em}
.actions{display:flex; gap:8px; flex-wrap:wrap}
.badge{display:inline-block; padding:3px 8px; border-radius:999px; background:rgba(79,93,255,.1); color:var(--accent-strong); font-size:12px; font-weight:700}
.card-title{margin:0 0 14px; font-size:20px; color:var(--ink)}
.subheading{margin:0 0 10px; font-size:15px; color:var(--ink)}
.tiny{font-size:12px}
.access-box{margin:0; padding:12px 14px; border:1px solid var(--border); border-radius:12px; background:#fff; display:grid; gap:4px}
.access-box legend{padding:0 6px; font-weight:700; color:var(--ink)}
.access-box > .muted{margin:2px 0 8px}
.check-line,.form label.check-line{
  display:flex !important;
  flex-direction:row;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  font-weight:600;
  color:var(--text);
  margin:0;
  padding:8px 0;
  border-bottom:1px solid rgba(89,103,255,.08);
}
.access-box .check-line:last-child{border-bottom:0; padding-bottom:0}
.form label.check-line input[type="checkbox"],
.check-line input[type="checkbox"]{
  order:2;
  width:18px;
  height:18px;
  margin:0;
  padding:0;
  flex:0 0 auto;
  accent-color:var(--accent);
  box-shadow:none;
  border-radius:4px;
  cursor:pointer;
}
.form label.check-line .check-label,
.check-line .check-label{
  order:1;
  flex:1;
  min-width:0;
  line-height:1.35;
}
.inline-form{margin:0}
.doc-list{display:flex; flex-direction:column; gap:12px}
.doc-item{
  display:flex; justify-content:space-between; gap:14px; align-items:flex-start;
  padding:12px; border:1px solid var(--border); border-radius:12px; background:#fff;
}
.doc-item p{margin:6px 0; color:var(--text); white-space:pre-wrap}
.rate-row{display:grid; grid-template-columns:1.4fr .6fr .8fr; gap:8px; margin-bottom:8px}
@media (max-width:700px){.rate-row{grid-template-columns:1fr}}
/* Library / publishing admin */
.lib-admin-head{display:flex; flex-wrap:wrap; gap:12px; align-items:center; justify-content:space-between; margin-bottom:14px}
.table-scroll{overflow:auto}
.lib-table img.lib-cover-thumb{width:48px; height:auto; border-radius:6px; display:block; background:#eef}
.logo-row{display:flex; flex-wrap:wrap; gap:12px; align-items:center; margin:6px 0}
.company-logo,.authors-brand-logo{max-width:180px; height:auto; border-radius:8px}
.toc-editor{padding:10px; border:1px solid var(--border); border-radius:12px; background:#fff}
.toc-rows{display:grid; gap:8px}
.toc-row{
  display:grid; grid-template-columns:36px 1fr 90px 36px; gap:8px; align-items:center;
  padding:4px 0; border-radius:8px; transition:background .12s, box-shadow .12s, opacity .12s;
}
.toc-row.is-dragging{opacity:.45; background:rgba(79,93,255,.06)}
.toc-row.is-drop-before{box-shadow:inset 0 2px 0 0 var(--accent)}
.toc-row.is-drop-after{box-shadow:inset 0 -2px 0 0 var(--accent)}
.toc-row-num,.toc-row-handle{
  text-align:center; font-size:13px; font-weight:800; color:var(--muted);
  cursor:grab; user-select:none; touch-action:none;
  padding:8px 4px; border-radius:8px; line-height:1;
}
.toc-row-handle:hover{background:rgba(79,93,255,.1); color:var(--accent-strong)}
.toc-row-handle:active,.toc-dragging .toc-row-handle{cursor:grabbing}
body.toc-dragging{cursor:grabbing; user-select:none}
.toc-row input{width:100%}
.bib-row{grid-template-columns:36px 1fr 36px !important}
.bib-text-input{
  width:100%; min-height:56px; resize:vertical; font:inherit;
  border:1px solid var(--border); border-radius:10px; padding:8px 10px; color:var(--ink); background:#fff
}
.bib-text-input:focus{outline:none; border-color:var(--cyan); box-shadow:0 0 0 3px rgba(42,212,208,.2)}
@media (max-width:700px){.toc-row{grid-template-columns:36px 1fr 72px 32px}.bib-row{grid-template-columns:36px 1fr 32px !important}}
.cover-frame{border:1px solid var(--border); border-radius:12px; padding:10px; background:#fff; text-align:center}

.calc-cards .calc-name-card{
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  min-height:120px;
  padding:24px 18px;
}
.calc-cards .calc-name-card h3{
  margin:0;
  font-size:18px;
  line-height:1.35;
}
.tile-create-calc{
  border-style:dashed;
  background:linear-gradient(160deg, rgba(79,93,255,.08), rgba(42,212,208,.08));
}
.tile-create-calc:hover{border-color:rgba(79,93,255,.55)}
.ucalc-studio{padding:0; overflow:hidden}
.ucalc-studio-head{padding:18px 18px 0}
.ucalc-studio-grid{display:grid; grid-template-columns:minmax(280px,360px) minmax(0,1fr); gap:0; min-height:520px}
.ucalc-studio-side{padding:16px 18px 20px; border-right:1px solid var(--border); background:linear-gradient(180deg,#fbfbff,#f5f6ff)}
.ucalc-studio-preview{display:flex; flex-direction:column; min-width:0; background:#fff}
.ucalc-preview-bar{display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 16px; border-bottom:1px solid var(--border)}
.ucalc-preview-frame{flex:1; overflow:auto; padding:16px; min-height:420px}
.ucalc-preview-empty{display:grid; place-items:center; min-height:360px; border:1px dashed var(--border); border-radius:12px; background:#fafbff}
.ucalc-advanced{margin:8px 0; border:1px solid var(--border); border-radius:10px; padding:8px 10px; background:#fff}
.ucalc-advanced summary{cursor:pointer; font-weight:700; font-size:13px; color:var(--accent-strong)}
.ucalc-advanced[open] summary{margin-bottom:8px}
@media (max-width:900px){
  .ucalc-studio-grid{grid-template-columns:1fr}
  .ucalc-studio-side{border-right:0; border-bottom:1px solid var(--border)}
}
.calc-workspace{display:grid; grid-template-columns:minmax(0,1fr) minmax(220px,280px); gap:16px; align-items:start; min-height:280px}
.calc-workspace--single{grid-template-columns:1fr; min-height:0}
.calc-main{min-width:0; padding:14px; border:1px solid var(--border); border-radius:14px; background:#fff; min-height:260px}
.calc-workspace--single .calc-main{border:0; padding:0; min-height:0; background:transparent}
.calc-placeholder{padding:28px 12px; text-align:center}
.calc-panel[hidden]{display:none !important}
.calc-list{display:flex; flex-direction:column; gap:8px; position:sticky; top:12px}
.calc-list-item{
  display:flex; flex-direction:column; gap:4px; align-items:flex-start; text-align:left;
  width:100%; padding:12px 14px; border:1px solid var(--border); border-radius:12px;
  background:#fff; color:var(--ink); cursor:pointer; transition:border-color .15s, background .15s, box-shadow .15s;
}
.calc-list-item:hover{border-color:rgba(79,93,255,.35); background:rgba(79,93,255,.04)}
.calc-list-item.is-active{border-color:rgba(79,93,255,.55); background:rgba(79,93,255,.08); box-shadow:0 0 0 1px rgba(79,93,255,.18)}
.calc-list-title{font-weight:700; font-size:14px; line-height:1.35}
.calc-list-meta{font-weight:600}
.calc-widget-mount{min-height:120px}
@media (max-width:900px){
  .calc-workspace{grid-template-columns:1fr}
  .calc-list{position:static; order:-1; flex-direction:row; flex-wrap:wrap}
  .calc-list-item{flex:1 1 180px}
}
.calc-block{margin-bottom:0; padding-bottom:0; border-bottom:0}
.calc-block:last-child{margin-bottom:0; padding-bottom:0; border-bottom:0}
.calc-result{margin-top:8px; padding:10px 12px; border-radius:10px; background:rgba(79,93,255,.08); color:var(--ink); font-weight:600; display:grid; gap:6px}
.calc-breakdown{display:flex; flex-wrap:wrap; gap:8px 14px; font-size:13px; font-weight:600; color:var(--muted)}
.calc-breakdown strong{color:var(--ink)}
.calc-min{display:inline; margin-left:4px; font-weight:600}
.calc-min-warn{color:#a32d27}
.calc-materials{margin-top:6px; padding:10px; border:1px solid var(--border); border-radius:12px; background:#fff; display:grid; gap:8px}
.calc-mat-title{margin:0; font-size:13px; font-weight:800; color:var(--accent-strong); text-transform:uppercase; letter-spacing:.04em}
.calc-mat-row{display:grid; grid-template-columns:1.4fr .7fr .7fr .6fr; gap:8px; align-items:end}
.calc-mat-name{display:flex; flex-direction:column; gap:2px; font-size:13px}
.calc-mat-auto{padding-bottom:8px}
.calc-mat-sum{padding-bottom:8px}
.calc-materials-editor{margin:8px 0 4px; padding:12px; border:1px solid var(--border); border-radius:12px; background:#fff}
.mat-edit-row{display:grid; grid-template-columns:1.4fr .5fr .6fr 1.1fr .6fr .6fr; gap:6px; margin-bottom:8px}
@media (max-width:900px){
  .calc-mat-row,.mat-edit-row{grid-template-columns:1fr 1fr}
}
.authors-info{color:var(--text); line-height:1.7; white-space:pre-wrap}
/* Forum / planner */
.forum-head{display:flex; flex-wrap:wrap; gap:12px; align-items:flex-end; justify-content:space-between; margin-bottom:6px}
.month-nav{display:flex; align-items:center; gap:8px; flex-wrap:wrap}
.calendar-card{margin-top:14px}
.calendar-month-title{margin:0 0 14px; font-size:clamp(28px,4vw,42px); color:var(--ink)}
.calendar-month-title span{color:var(--muted); font-weight:600; font-size:.55em}

/* Left year calendar (same frame as mini-chat) */
.has-year-nav.has-mini-chat .staff-wrap{width:min(980px, calc(92vw - 640px))}
.has-year-nav:not(.has-mini-chat) .staff-wrap{width:min(980px, calc(92vw - 320px))}
.has-year-nav.year-nav-collapsed.has-mini-chat .staff-wrap{width:min(980px, calc(92vw - 372px))}
.has-year-nav.year-nav-collapsed:not(.has-mini-chat) .staff-wrap{width:min(980px, calc(92vw - 72px))}
.has-year-nav.has-mini-chat.mini-chat-collapsed .staff-wrap{width:min(980px, calc(92vw - 372px))}
.has-year-nav.year-nav-collapsed.has-mini-chat.mini-chat-collapsed .staff-wrap{width:min(980px, calc(92vw - 72px))}
.year-nav{
  position:fixed; left:12px; top:84px; bottom:18px; width:300px; z-index:30;
  display:flex; flex-direction:column;
  background:rgba(245,246,255,.97); border:1px solid var(--border); border-radius:16px;
  box-shadow:0 16px 40px rgba(55,70,180,.18); backdrop-filter:blur(10px); overflow:hidden;
}
.year-nav-collapsed .year-nav{width:52px}
.year-nav-collapsed .year-nav-body,
.year-nav-collapsed .year-nav-title{display:none}
.year-nav-head{display:flex; align-items:center; justify-content:space-between; padding:10px 12px; border-bottom:1px solid var(--border); gap:8px}
.year-nav-title{display:flex; align-items:center; gap:6px; font-weight:800; color:var(--ink)}
.year-nav-ybtn{
  width:28px; height:28px; display:inline-flex; align-items:center; justify-content:center;
  border:1px solid var(--border); border-radius:8px; background:#fff; color:var(--ink); font-size:18px; line-height:1;
}
.year-nav-ybtn:hover{background:rgba(79,93,255,.08); color:var(--accent-strong)}
.year-nav-body{flex:1; overflow:auto; padding:10px; display:flex; flex-direction:column; gap:12px}
.ycal-month{background:#fff; border:1px solid var(--border); border-radius:12px; padding:8px}
.ycal-month.current{box-shadow:inset 0 0 0 2px rgba(79,93,255,.35)}
.ycal-month-title{display:block; font-size:13px; font-weight:800; color:var(--ink); margin-bottom:6px}
.ycal-month-title:hover{color:var(--accent-strong)}
.ycal-grid{display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:2px}
.ycal-head{text-align:center; font-size:9px; font-weight:700; color:var(--muted); padding:2px 0}
.ycal-day{
  aspect-ratio:1; display:flex; align-items:center; justify-content:center;
  font-size:10px; font-weight:700; color:var(--ink); border-radius:6px; text-decoration:none;
  line-height:1;
}
.ycal-day.empty{pointer-events:none}
.ycal-day:hover{background:rgba(79,93,255,.12); color:var(--accent-strong)}
.ycal-day.weekend{color:#6a74b8}
.ycal-day.holiday{color:#c83b34; background:rgba(229,83,75,.08)}
.ycal-day.today{box-shadow:inset 0 0 0 1.5px var(--cyan)}
.ycal-day.selected{background:linear-gradient(145deg, rgba(79,93,255,.22), rgba(122,60,255,.16)); color:var(--accent-strong)}
.ycal-day.has-tasks::after{
  content:""; width:3px; height:3px; border-radius:50%; background:var(--accent);
  position:absolute; bottom:2px;
}
.ycal-day.has-tasks{position:relative}
.cal-grid{display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:6px}
.cal-head{text-align:center; font-size:12px; font-weight:700; color:var(--muted); padding:4px}
.cal-cell{position:relative; min-height:72px; border:1px solid var(--border); border-radius:12px; background:#fff; color:var(--ink); padding:8px; display:flex; flex-direction:column; text-decoration:none; overflow:hidden}
.cal-cell.empty{background:transparent; border-color:transparent}
.cal-cell:hover{border-color:rgba(79,93,255,.45); color:var(--ink)}
.cal-cell.weekend{background:#f7f8ff}
.cal-cell.holiday{background:rgba(229,83,75,.08)}
.cal-cell.today{box-shadow:inset 0 0 0 2px var(--cyan)}
.cal-cell.selected{background:linear-gradient(145deg, rgba(79,93,255,.18), rgba(122,60,255,.12)); border-color:rgba(79,93,255,.5)}
.cal-cell.has-bday{min-height:88px}
.cal-num{font-weight:800; font-size:16px}
.cal-bdays{display:flex; flex-direction:column; gap:1px; margin-top:4px; min-width:0; pointer-events:auto}
.cal-bday-item{
  display:block; max-width:100%; font-size:10px; font-weight:700; line-height:1.2;
  color:#a32d70; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.cal-dot{width:8px; height:8px; border-radius:50%; background:var(--accent); margin-top:auto; flex-shrink:0}
.calendar-card{position:relative}
.cal-bday-popup{
  position:fixed; z-index:50; width:min(280px, calc(100vw - 24px));
  padding:12px 14px; border-radius:12px; border:1px solid var(--border);
  background:#fff; color:var(--ink);
  box-shadow:0 16px 40px rgba(55,70,180,.22);
  font-size:13px; line-height:1.45; pointer-events:none;
}
.cal-bday-popup[hidden]{display:none !important}
.cal-bday-popup strong{display:block; margin-bottom:8px; font-size:13px}
.cal-bday-popup ul{margin:0; padding-left:18px}
.cal-bday-popup li{margin:3px 0}
.cal-bday-popup .tiny{color:var(--muted)}
.kanban-head{display:flex; flex-wrap:wrap; gap:12px; align-items:center; justify-content:space-between; margin-bottom:14px}
.task-add-form{display:flex; gap:8px; flex-wrap:wrap}
.task-add-form input{min-width:220px; border:1px solid var(--border); border-radius:10px; padding:8px 10px; font:inherit}
.kanban{display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px}
.kanban-col{background:#fff; border:1px solid var(--border); border-radius:14px; padding:10px; min-height:220px}
.kanban-col h3{margin:0 0 10px; font-size:13px; text-transform:uppercase; letter-spacing:.04em; color:var(--accent-strong)}
.kanban-list{display:flex; flex-direction:column; gap:8px; min-height:140px; transition:background .15s ease, box-shadow .15s ease}
.kanban-list.drag-over{background:rgba(79,93,255,.08); box-shadow:inset 0 0 0 2px rgba(79,93,255,.25)}
.kanban-card{border:1px solid var(--border); border-radius:10px; padding:8px; background:linear-gradient(160deg,#fff,#f5f6ff); cursor:grab; user-select:none; touch-action:none}
.kanban-card:active{cursor:grabbing}
.kanban-card.dragging{opacity:.55; transform:scale(.98)}
.kanban-title{font-weight:700; margin-bottom:4px}
.kanban-moves{display:flex; flex-wrap:wrap; gap:4px; margin-top:6px}
.linkish{border:0; background:none; color:var(--accent-strong); cursor:pointer; font:inherit; font-size:12px; font-weight:700; padding:0}
.linkish.danger{color:var(--danger)}
.forum-feed{display:flex; flex-direction:column; gap:10px; max-height:420px; overflow:auto}
.forum-msg{border:1px solid var(--border); border-radius:12px; padding:10px 12px; background:#fff}
.forum-meta{display:flex; justify-content:space-between; gap:10px; margin-bottom:4px}
.forum-text{white-space:pre-wrap}

/* Mini chat */
.has-mini-chat .staff-wrap{width:min(980px, calc(92vw - 320px))}
.has-mini-chat.mini-chat-collapsed .staff-wrap{width:min(980px, calc(92vw - 72px))}
body.has-mini-chat{padding-right:0}
body.has-mini-chat.mini-chat-collapsed{/* место под узкую полоску чата */}
.mini-chat{
  position:fixed; right:12px; top:84px; bottom:18px; width:300px; z-index:30;
  display:flex; flex-direction:column;
  background:rgba(245,246,255,.97); border:1px solid var(--border); border-radius:16px;
  box-shadow:0 16px 40px rgba(55,70,180,.18); backdrop-filter:blur(10px); overflow:hidden;
}
.mini-chat-collapsed .mini-chat{width:56px; cursor:pointer}
.mini-chat-collapsed .mini-chat-list,
.mini-chat-collapsed .mini-chat-form,
.mini-chat-collapsed .mini-chat-emojis,
.mini-chat-collapsed .mini-chat-notify{display:none}
.mini-chat-collapsed .mini-chat-head{
  flex-direction:column;
  justify-content:flex-start;
  align-items:center;
  gap:10px;
  height:100%;
  border-bottom:0;
  padding:14px 6px;
}
.mini-chat-collapsed .mini-chat-head strong{
  writing-mode:vertical-rl;
  transform:rotate(180deg);
  font-size:13px;
  letter-spacing:.04em;
}
.mini-chat-collapsed .mini-chat-head-actions{flex-direction:column}
.mini-chat-badge{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:22px; height:22px; padding:0 6px; border-radius:999px;
  background:linear-gradient(135deg,var(--accent),var(--accent-strong));
  color:#fff; font-size:11px; font-weight:800; line-height:1;
}
.mini-chat-badge[hidden]{display:none !important}
.mini-chat-collapsed .mini-chat-badge{order:-1}
.mini-chat.has-unread{
  animation:miniChatUnreadBlink 1.05s ease-in-out infinite;
  border-color:rgba(79,93,255,.65);
}
@keyframes miniChatUnreadBlink{
  0%,100%{
    box-shadow:0 16px 40px rgba(55,70,180,.18), 0 0 0 0 rgba(79,93,255,0);
    background:rgba(245,246,255,.97);
  }
  50%{
    box-shadow:0 16px 40px rgba(55,70,180,.22), 0 0 0 7px rgba(79,93,255,.28);
    background:rgba(79,93,255,.18);
  }
}
.mini-chat-head{display:flex; align-items:center; justify-content:space-between; padding:10px 12px; border-bottom:1px solid var(--border); gap:8px}
.mini-chat-head-actions{display:flex; gap:6px; align-items:center}
.mini-chat-toggle,
.mini-chat-notify{border:0; background:#fff; border:1px solid var(--border); border-radius:8px; cursor:pointer; width:32px; height:32px}
.mini-chat-notify.is-on{background:rgba(79,93,255,.12); border-color:rgba(79,93,255,.45)}
.mini-chat-notify.is-off{opacity:.55}
.mini-chat-list{flex:1; overflow:auto; padding:10px; display:flex; flex-direction:column; gap:8px}
.mini-msg{background:#fff; border:1px solid var(--border); border-radius:12px; padding:8px; position:relative}
.mini-msg.mine{background:rgba(79,93,255,.08)}
.mini-msg.is-private{border-color:rgba(122,60,255,.45); box-shadow:inset 3px 0 0 rgba(122,60,255,.55)}
.mini-msg.is-call{
  background:linear-gradient(135deg, rgba(42,212,208,.16), rgba(79,93,255,.14));
  border-color:rgba(42,212,208,.5);
  animation:miniCallPulse 1.2s ease 2;
}
.mini-call-line{font-weight:800; color:#0f6e6a; font-size:14px}
.mini-dm-badge{
  display:inline-block; margin:0 0 6px; padding:2px 8px; border-radius:999px;
  background:rgba(122,60,255,.12); color:#5b2bb5; font-size:11px; font-weight:700;
}
@keyframes miniCallPulse{
  0%,100%{box-shadow:0 0 0 0 rgba(42,212,208,.0)}
  40%{box-shadow:0 0 0 6px rgba(42,212,208,.28)}
}
.mini-chat.is-ringing{
  animation:miniChatRing .35s ease 4;
}
@keyframes miniChatRing{
  0%,100%{transform:translateX(0)}
  25%{transform:translateX(-3px)}
  75%{transform:translateX(3px)}
}
.mini-call-btn{font-size:16px}
.mini-meta{display:flex; justify-content:space-between; gap:8px; font-size:11px; color:var(--muted); margin-bottom:4px; align-items:center}
.mini-meta-right{display:inline-flex; align-items:center; gap:4px; flex-shrink:0}
.mini-msg-del{
  border:0; background:transparent; color:#a33; cursor:pointer; width:22px; height:22px;
  border-radius:6px; line-height:1; font-size:16px; padding:0; opacity:.55;
}
.mini-msg-del:hover{opacity:1; background:rgba(180,40,40,.1)}
.mini-text{white-space:pre-wrap; font-size:14px}
.mini-file{display:block; margin-top:6px; font-size:13px}
.mini-file img{max-width:100%; border-radius:8px; display:block}
.mini-chat-form{border-top:1px solid var(--border); padding:8px; display:grid; gap:6px}
.mini-to-label{display:grid; gap:4px; font-size:11px; font-weight:700; color:var(--muted)}
.mini-to-label select{
  width:100%; border:1px solid var(--border); border-radius:10px; padding:8px 10px;
  font:inherit; color:var(--ink); background:#fff;
}
.mini-chat-form textarea{width:100%; border:1px solid var(--border); border-radius:10px; padding:8px; font:inherit; resize:none}
.mini-attach{
  display:flex; align-items:center; gap:8px; padding:8px 10px;
  border:1px dashed rgba(89,103,255,.45); border-radius:10px;
  background:rgba(79,93,255,.08); font-size:12px; color:var(--ink);
}
.mini-attach-ico{flex:0 0 auto}
.mini-attach-name{flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:600}
.mini-attach-clear{
  flex:0 0 auto; border:0; background:rgba(0,0,0,.06); width:24px; height:24px;
  border-radius:8px; cursor:pointer; font-size:16px; line-height:1; color:#a33;
}
.mini-attach-clear:hover{background:rgba(180,40,40,.12)}
.mini-chat-tools{display:flex; gap:6px; align-items:center}
.mini-file-btn{position:relative; overflow:hidden}
.mini-file-btn input{position:absolute; inset:0; opacity:0; cursor:pointer}
.mini-chat-emojis{display:none; flex-wrap:wrap; gap:4px; padding:6px 8px; border-top:1px solid var(--border); background:#fff; max-height:110px; overflow:auto}
.mini-chat-emojis.open{display:flex}
.emoji-item{border:0; background:transparent; cursor:pointer; font-size:18px; padding:2px}

@media (max-width:1400px){
  .has-year-nav.has-mini-chat .staff-wrap{width:min(980px, calc(92vw - 560px))}
  .year-nav{width:260px}
  .mini-chat{width:260px}
}
@media (max-width:1100px){
  .kanban{grid-template-columns:repeat(2,minmax(0,1fr))}
  .has-year-nav.has-mini-chat .staff-wrap,
  .has-year-nav:not(.has-mini-chat) .staff-wrap{width:min(980px, calc(92vw - 72px))}
  .has-mini-chat .staff-wrap{width:min(980px, calc(92vw - 280px))}
  .has-mini-chat.mini-chat-collapsed .staff-wrap{width:min(980px, calc(92vw - 72px))}
  .year-nav{
    position:fixed; left:8px; right:auto; top:auto; bottom:8px; width:48px; height:48px;
  }
  .year-nav-body, .year-nav-title{display:none}
  body:not(.year-nav-collapsed) .year-nav{
    left:8px; right:8px; top:72px; bottom:auto; width:auto; height:min(70vh, 560px); z-index:40;
  }
  body:not(.year-nav-collapsed) .year-nav-body,
  body:not(.year-nav-collapsed) .year-nav-title{display:flex}
  body:not(.year-nav-collapsed) .year-nav-body{flex-direction:column}
}
@media (max-width:900px){
  .has-mini-chat .staff-wrap,
  .has-mini-chat.mini-chat-collapsed .staff-wrap{width:min(980px, 92vw)}
  .mini-chat{position:fixed; right:8px; left:8px; top:auto; bottom:8px; width:auto; height:42vh; max-height:360px; z-index:40}
  .mini-chat-collapsed .mini-chat{height:48px; width:48px; left:auto; right:8px}
  .year-nav{bottom:64px}
}
@media (max-width:760px){
  .staff-header-inner{flex-wrap:wrap; padding:12px 0}
  .staff-nav{width:100%}
  .doc-item{flex-direction:column}
  .kanban{grid-template-columns:1fr}
  .cal-cell{min-height:48px; padding:6px}
}

/* HR library + personnel */
.hr-doc-list{display:grid; gap:12px}
.hr-doc-item{
  display:grid; gap:10px; padding:14px; border:1px solid var(--border); border-radius:14px;
  background:rgba(255,255,255,.72);
}
.hr-doc-item h3{margin:0 0 6px; font-size:16px; color:var(--ink)}
.hr-doc-item p{margin:6px 0 0; color:var(--muted); font-size:14px}
.hr-pill{
  display:inline-block; margin-top:4px; padding:3px 8px; border-radius:999px;
  background:rgba(79,93,255,.12); color:var(--accent-strong); font-size:11px; font-weight:700;
}
.hr-person-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
  margin-top:8px;
  align-items:stretch;
}
@media (max-width:960px){.hr-person-grid{grid-template-columns:1fr 1fr}}
@media (max-width:640px){.hr-person-grid{grid-template-columns:1fr}}
.hr-person-card{
  display:flex;
  flex-direction:column;
  min-height:100%;
  height:100%;
  margin:0;
}
.hr-person-card + .hr-person-card{margin-top:0}
.hr-person-card h3{margin:0 0 4px; font-size:18px; color:var(--ink); min-height:1.3em}
.hr-person-card > .muted.tiny{min-height:1.2em}
.hr-person-card.is-active{border-color:rgba(79,93,255,.55); box-shadow:0 14px 30px rgba(70,85,190,.16)}
.hr-person-meta{
  margin:12px 0 0;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px 12px;
  flex:1;
}
.hr-person-meta > div{display:grid; gap:2px; min-width:0}
.hr-person-meta dt{font-size:11px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted)}
.hr-person-meta dd{
  margin:0; font-size:14px; color:var(--ink); font-weight:600;
  min-height:1.35em; overflow-wrap:anywhere;
}
.hr-person-card .tile-actions{margin-top:auto; padding-top:14px}
