/* ============================================================
   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; }
