/* ============================================================
   ARISDOC.CLOUD — Dashboard (app.html), Drivesphere-style workspace
   Extends styles.css (same tokens / neumorphism / glass).
   ============================================================ */
.app { display: grid; grid-template-columns: 300px 1fr; min-height: 100vh; }

/* ---- sidebar ---- */
.side { position: sticky; top: 0; height: 100vh; padding: 22px 18px; display: flex; flex-direction: column; gap: 16px;
  background: var(--surface); box-shadow: var(--nm-sm); }
.side__brand { display: flex; align-items: center; gap: 11px; font-family: var(--font-display); font-weight: 800;
  font-size: 17px; letter-spacing: -.02em; color: var(--text); text-decoration: none; padding: 4px; }
.side__brand b { color: var(--accent-ink); }
.side__nav { display: flex; flex-direction: column; gap: 4px; }
.side__lbl { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 12px 12px 4px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: var(--r-md); color: var(--muted);
  text-decoration: none; font-weight: 600; font-size: 14.5px; cursor: pointer; border: 0; background: transparent; width: 100%;
  font-family: var(--font-body); transition: all .2s var(--ease); text-align: left; }
.nav-item svg { width: 19px; height: 19px; flex: 0 0 auto; }
.nav-item:hover { color: var(--text); background: var(--surface-2); box-shadow: var(--nm-sm); }
.nav-item.active { color: var(--accent-ink); background: var(--surface); box-shadow: var(--nm-inset); }
.nav-item .count { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--faint); background: var(--surface-2);
  padding: 2px 8px; border-radius: 100px; box-shadow: var(--nm-sm); }
.side__storage { margin-top: auto; padding: 16px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--nm-inset); }
.side__storage .row { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 600; margin-bottom: 9px; }
.side__storage .row b { font-family: var(--font-display); }
.side__storage .bar { height: 7px; border-radius: 100px; background: rgba(47,107,255,.13); overflow: hidden; }
.side__storage .bar i { display: block; height: 100%; width: 68%; border-radius: 100px; background: var(--grad); }
.side__storage small { display: block; margin-top: 9px; color: var(--faint); font-size: 11.5px; }

/* ---- main ---- */
.main { padding: 22px 28px 40px; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.search { flex: 1; max-width: 460px; display: flex; align-items: center; gap: 11px; padding: 0 16px;
  border-radius: var(--r-md); background: var(--surface); box-shadow: var(--nm-inset); }
.search svg { width: 18px; height: 18px; color: var(--faint); }
.search input { flex: 1; border: 0; background: transparent; outline: none; font-family: var(--font-body); font-size: 14.5px;
  color: var(--text); padding: 12px 0; }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.icon-btn { width: 44px; height: 44px; border-radius: 14px; border: 0; cursor: pointer; display: grid; place-items: center;
  background: var(--surface); box-shadow: var(--nm-sm); color: var(--muted); transition: all .2s var(--ease); position: relative; }
.icon-btn:hover { color: var(--accent-ink); transform: translateY(-2px); box-shadow: var(--nm); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .badge { position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--grad); box-shadow: 0 0 0 3px var(--surface); }
.user { display: flex; align-items: center; gap: 11px; padding: 6px 14px 6px 6px; border-radius: 100px;
  background: var(--surface); box-shadow: var(--nm-sm); cursor: pointer; transition: all .2s var(--ease); }
.user:hover { box-shadow: var(--nm); transform: translateY(-1px); }
.user .ava { width: 34px; height: 34px; border-radius: 50%; background: var(--grad); display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 14px; font-family: var(--font-display); flex: 0 0 auto; }
.user .who { line-height: 1.15; }
.user .who b { font-size: 13.5px; font-weight: 700; display: block; }
.user .who small { font-size: 11.5px; color: var(--faint); }

.dash-hello { margin-bottom: 22px; }
.dash-hello h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(24px,3vw,32px); letter-spacing: -.03em; }
.dash-hello p { color: var(--muted); font-size: 15px; margin-top: 4px; }

/* ---- stat cards ---- */
.cards { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 18px; margin-bottom: 8px; }
.card { padding: 22px; }
.card--storage { display: flex; align-items: center; gap: 22px; }
.card--storage .ring { --p: 68; width: 104px; height: 104px; }
.card--storage .ring b { font-size: 22px; }
.card__big { font-family: var(--font-display); font-weight: 700; font-size: 26px; letter-spacing: -.02em; }
.card__lbl { color: var(--faint); font-size: 12.5px; font-weight: 600; margin-top: 2px; }
.card__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card__head h3 { font-size: 14px; font-weight: 700; color: var(--muted); }
.card__ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: var(--grad-soft); color: var(--accent-ink); }
.card__ico svg { width: 21px; height: 21px; }
.card__list { display: grid; gap: 12px; }
.card__list .li { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.card__list .li .d { width: 9px; height: 9px; border-radius: 3px; background: var(--grad); flex: 0 0 auto; }
.card__list .li b { margin-left: auto; color: var(--text); font-family: var(--font-display); font-weight: 600; }
.spark { display: flex; align-items: flex-end; gap: 5px; height: 58px; margin-top: 10px; }
.spark i { flex: 1; border-radius: 5px 5px 0 0; background: var(--grad); opacity: .82; }

/* ---- files ---- */
.panel-head { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 16px; }
.panel-head h2 { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: -.02em; }
.seg-mini { display: flex; padding: 4px; gap: 3px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--nm-inset); }
.seg-mini button { border: 0; background: transparent; cursor: pointer; font-family: var(--font-body); font-weight: 700;
  font-size: 12.5px; color: var(--faint); padding: 8px 14px; border-radius: var(--r-sm); transition: all .2s var(--ease); }
.seg-mini button.active { color: #fff; background: var(--grad); box-shadow: 0 4px 12px rgba(47,107,255,.35); }

.filegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 16px; }
.fcard { position: relative; padding: 18px; cursor: pointer; transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.fcard:hover { transform: translateY(-5px); box-shadow: var(--nm), 0 22px 44px rgba(20,40,90,.10); }
.fcard__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.fcard__ico { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  background: var(--grad-soft); color: var(--accent-ink); }
.fcard__ico svg { width: 23px; height: 23px; }
.fcard__menu { color: var(--faint); cursor: pointer; }
.fcard h4 { font-size: 14.5px; font-weight: 700; margin-bottom: 4px; word-break: break-word; }
.fcard .meta { color: var(--faint); font-size: 12px; font-weight: 600; display: flex; gap: 8px; }
.tag { display: inline-flex; align-items: center; gap: 5px; margin-top: 13px; padding: 5px 11px; border-radius: 100px;
  font-size: 11px; font-weight: 700; background: var(--grad-soft); color: var(--accent-ink); }
.tag.sgn { background: rgba(33,186,90,.14); color: #18923f; }

/* ---- AI panel + activity ---- */
.split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; margin-top: 8px; }
.ai-panel { padding: 22px; }
.ai-panel h3, .act-panel h3 { font-family: var(--font-display); font-weight: 700; font-size: 17px; margin-bottom: 14px; display: flex; align-items: center; gap: 9px; }
.ai-panel h3 .spark-ic { width: 28px; height: 28px; border-radius: 9px; background: var(--grad); display: grid; place-items: center; color: #fff; }
.ai-panel h3 .spark-ic svg { width: 16px; height: 16px; }
.ai-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-md);
  background: var(--surface); box-shadow: var(--nm-inset); margin-bottom: 10px; }
.ai-row .dotc { width: 32px; height: 32px; border-radius: 9px; background: var(--grad-soft); display: grid; place-items: center; color: var(--accent-ink); flex: 0 0 auto; }
.ai-row .dotc svg { width: 17px; height: 17px; }
.ai-row .t { font-size: 13px; font-weight: 600; min-width: 0; }
.ai-row .t small { display: block; color: var(--faint); font-weight: 500; font-size: 11.5px; }
.ai-row .pct { margin-left: auto; font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--accent-ink); }

.act-panel { padding: 22px; }
.activity { display: grid; gap: 2px; }
.act { display: flex; gap: 13px; padding: 10px 2px; }
.act .av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto;
  background: var(--surface); box-shadow: var(--nm-sm); color: var(--accent-ink); font-weight: 800; font-size: 12px; font-family: var(--font-display); }
.act .txt { font-size: 13px; color: var(--muted); }
.act .txt b { color: var(--text); font-weight: 700; }
.act .txt small { display: block; color: var(--faint); font-size: 11px; margin-top: 1px; }

/* ---- user dropdown ---- */
.menu { position: absolute; top: 64px; right: 28px; z-index: 60; min-width: 224px; padding: 10px; opacity: 0; visibility: hidden;
  transform: translateY(-8px); transition: all .2s var(--ease); }
.menu.open { opacity: 1; visibility: visible; transform: none; }
.menu a, .menu button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 11px 13px; border: 0; cursor: pointer;
  background: transparent; border-radius: var(--r-sm); color: var(--text); font-family: var(--font-body); font-weight: 600; font-size: 14px; text-decoration: none; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--surface-2); }
.menu svg { width: 17px; height: 17px; color: var(--faint); }
.menu hr { border: 0; border-top: 1px solid rgba(20,40,90,.08); margin: 7px 4px; }
.menu .danger { color: #d4342a; }
.menu .danger svg { color: #d4342a; }

/* ---- responsive ---- */
@media (max-width: 1080px) { .cards { grid-template-columns: 1fr 1fr; } .card--storage { grid-column: 1 / -1; } .split { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: -280px; z-index: 80; width: 264px; transition: left .3s var(--ease); }
  .side.open { left: 0; }
  .main { padding: 16px; }
  .cards { grid-template-columns: 1fr; }
  .menu { right: 16px; }
  .search { max-width: none; }
}
.side__toggle { display: none; }
@media (max-width: 860px) { .side__toggle { display: grid; } }

/* fix: длинный левый nav должен прокручиваться, не упираясь в блок хранилища */
.side__nav { flex: 1 1 auto; overflow-y: auto; min-height: 0; }
.side__nav::-webkit-scrollbar { width: 6px; }
.side__nav::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 4px; }

/* компактный сайдбар — вместить больше пунктов меню */
.side { gap: 9px; padding: 16px 14px; }
.side__nav { gap: 2px; }
.nav-item { padding: 8px 12px; }
.side__lbl { padding: 8px 12px 2px; }
.side__storage { padding: 12px 14px; }
.side__storage .row { margin-bottom: 6px; }
.side__storage small { margin-top: 6px; }

/* ============================================================
   FLUENT 2 — Рабочее пространство (Ф4, 29.11.2026). Ядро:
   fluent-tokens.css?v=2. Нейтральный канвас, белые панели r8,
   акцент кобальт, ИИ — Copilot-градиент. Команды не тронуты.
   ============================================================ */
body { background: var(--fl-canvas); font-family: var(--fl-font); }
:root[data-theme="dark"] body { background: var(--fl-canvas); }
.bg-fx, .grain { display: none; }
.main { padding: 24px 32px 48px; }

/* текст на канвасе — тёмный (канвас теперь светлый) */
.dash-hello h1 { color: var(--fl-text); }
.dash-hello p { color: var(--fl-text-2); }
.panel-head h2 { color: var(--fl-text); }

/* сайдбар — белая панель r8 с волосяной границей */
.side {
  top: 14px; height: calc(100vh - 28px);
  margin: 14px 0 14px 14px;
  padding: 18px 14px;
  background: var(--fl-surface);
  border-radius: var(--fl-r-lg);
  border: 1px solid var(--fl-stroke);
  box-shadow: var(--fl-elev-2);
}
.side__brand { font-family: var(--fl-font); font-weight: 700; }
.brand__mark { border-radius: var(--fl-r-md); background: var(--accent); box-shadow: none; }
.nav-item { border-radius: var(--fl-r-sm); }
.nav-item:hover { background: var(--fl-surface-hover); box-shadow: none; color: var(--fl-text); }
.nav-item.active { background: var(--accent-weak); color: var(--accent-ink); box-shadow: none; }
.nav-item .count { background: var(--fl-surface-2); color: var(--fl-text-2); box-shadow: none; }
.side__storage { background: var(--fl-surface-2); box-shadow: none; border-radius: var(--fl-r-md); }
.side__storage .bar { background: var(--fl-stroke); }
.side__storage .bar i { background: var(--accent-2); }
.side__nav::-webkit-scrollbar-thumb { background: var(--fl-stroke); }

/* главное действие — акцент приложения (кобальт), Fluent-кнопка */
.side__new {
  background: var(--accent);
  box-shadow: none;
  border-radius: var(--fl-r-sm);
}
.side__new:hover { background: var(--accent-press); transform: none; box-shadow: none; }

/* верхняя панель — белые чипы Fluent */
.search { background: var(--fl-surface); box-shadow: inset 0 0 0 1px var(--fl-stroke); border-radius: var(--fl-r-sm); }
.icon-btn { background: var(--fl-surface); box-shadow: none; border-radius: var(--fl-r-sm); border: 1px solid var(--fl-stroke); }
.icon-btn:hover { color: var(--accent-ink); background: var(--fl-surface-hover); box-shadow: none; }
.icon-btn .badge { background: var(--ai-solid); box-shadow: 0 0 0 2px var(--fl-surface); }
.user { background: var(--fl-surface); box-shadow: none; border: 1px solid var(--fl-stroke); }
.user .ava { background: var(--accent); font-family: var(--fl-font); }
.lang { background: var(--fl-surface-2); box-shadow: none; }
.lang button.active { background: var(--accent); box-shadow: none; }
.orgsw__btn { background: var(--fl-surface); border: 1px solid var(--fl-stroke); box-shadow: none; border-radius: var(--fl-r-sm); }
.orgsw__ava { background: var(--accent); }
.orgsw__menu { background: var(--fl-surface); border: 1px solid var(--fl-stroke); border-radius: var(--fl-r-lg); box-shadow: var(--fl-elev-16); }
.orgsw__item:hover, .orgsw__item.active { background: var(--fl-surface-hover); }

/* карточки — белые панели Fluent r8 */
.cards { gap: 20px; }
.card { border-radius: var(--fl-r-lg); border: 1px solid var(--fl-stroke); box-shadow: var(--fl-elev-2); }
.card__ico, .fcard__ico {
  width: 38px; height: 38px;
  border-radius: var(--fl-r-md);
  background: var(--accent-weak); color: var(--accent);
}
.ring { background: conic-gradient(var(--accent-2) calc(var(--p)*1%), var(--fl-stroke) 0); }
.ring::after { background: var(--fl-surface); box-shadow: none; }
.spark i { background: var(--accent-2); }
.card__list .li .d { background: var(--accent-2); }
.act .av { background: var(--accent-weak); color: var(--accent-ink); box-shadow: none; }

/* чипы типов файлов: DOCX синий · XLSX зелёный · PPTX оранжевый · PDF красный */
.fcard { border-radius: var(--fl-r-lg); border: 1px solid var(--fl-stroke); box-shadow: var(--fl-elev-1); }
.fcard__ico[data-ext="doc"] { background: #eff6fc; color: #0f6cbd; }
.fcard__ico[data-ext="xls"] { background: #e6f2df; color: #107c41; }
.fcard__ico[data-ext="ppt"] { background: #fdf0e6; color: #c43e1c; }
.fcard__ico[data-ext="pdf"] { background: #fdf3f4; color: #b10e1c; }
.tag { background: var(--fl-surface-2); color: var(--fl-text-2); }
.tag.sgn { background: var(--fl-ok-bg); color: var(--fl-ok); }
.fcard__sign { background: var(--fl-surface-2); }
.fcard__sign:hover { background: var(--accent); }

/* ИИ: Copilot-акцент (сплошной; градиент только на .ai-cta) */
.ai-spark {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: var(--fl-r-sm);
  font-size: 15px; color: #fff; background: var(--ai-grad);
}
.ai-panel h3 .spark-ic { background: var(--ai-grad); box-shadow: none; }
.ai-row .dotc {
  width: 36px; height: 36px;
  border-radius: var(--fl-r-md);
  background: var(--ai-weak); color: var(--ai-solid);
}
.ai-row .pct { color: var(--ai-solid); font-family: var(--fl-font); }
.ask-box .btn--primary { background: var(--ai-solid); box-shadow: none; }
.ask-box .btn--primary:hover { background: var(--ai-solid); filter: brightness(1.06); box-shadow: none; }

/* диалоги — центральные карточки Fluent */
.wf-dlg, .sg-dlg, .ag-dlg {
  background: var(--fl-surface);
  border: 1px solid var(--fl-stroke);
  border-radius: var(--fl-r-lg);
  box-shadow: var(--fl-elev-28);
}
.wf-dlg-bg, .sg-dlg-bg, .ag-dlg-bg { background: rgba(0, 0, 0, .4); }
.wf-btn { background: var(--accent); border-radius: var(--fl-r-sm); }
.wf-btn.ghost { background: var(--fl-surface-2); color: var(--fl-text); }
.sg-go { background: var(--accent); border-radius: var(--fl-r-sm); }
.sg-cancel { background: var(--fl-surface-2); color: var(--fl-text); box-shadow: none; }
.ag-go { background: var(--ai-solid); border-radius: var(--fl-r-sm); }
.ag-cancel { background: var(--fl-surface-2); color: var(--fl-text); box-shadow: none; }
.ag-run { background: var(--ai-solid); border-radius: var(--fl-r-sm); }
.ag-ico { background: var(--ai-solid); }

/* статусы: цвет + текст */
.ast.pending { background: var(--fl-info-bg); color: var(--fl-info); }
.ast.approved { background: var(--fl-ok-bg); color: var(--fl-ok); }
.ast.rejected { background: var(--fl-danger-bg); color: var(--fl-danger); }
.set-tab.active { background: var(--accent); }

/* узкая рабочая область (эквивалент системного масштаба 125–150%) */
@media (max-width: 1100px) {
  .search { max-width: 280px; min-width: 0; }
  .search input { min-width: 0; }
  .user .who { display: none; }
  .orgsw__txt { display: none; }
  .topbar { gap: 10px; }
  .topbar__right { gap: 8px; }
}

/* мобильная раскладка */
@media (max-width: 860px) {
  .side {
    top: 0; height: 100vh; margin: 0;
    border-radius: 0; width: 264px;
    border: 0;
  }
  .main { padding: 16px; }
}
