/* ============================================================
   RITM NAS — визуальная система в духе Synology DSM 7/8
   Плоские белые поверхности, тонкие линии, один синий акцент,
   размытые стёкла панелей. Эталон глазами Дитера Рамса:
   «меньше, но лучше».
   ============================================================ */

:root {
  /* токены дизайна */
  --radius: 8px;
  --titlebar-h: 40px;
  --toolbar-h: 36px;
  --side-w: 190px;
  --accent: #2b7bf3;
  --accent-dark: #1e63cf;
  --accent-soft: #e8f1fe;
  --bg: #f4f6fa;
  --card: #ffffff;
  --line: #e6ecf5;
  --text: #1c2434;
  --muted: #7c8aa5;
  --topbar-h: 52px;
  --shadow-win: 0 18px 50px rgba(10, 25, 60, .25);
  --shadow-win-active: 0 24px 64px rgba(10, 25, 60, .32);
  --shadow-panel: 0 12px 40px rgba(10, 25, 60, .18);
  --font: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overscroll-behavior: none; }
body {
  font-family: var(--font);
  color: var(--text);
  overflow: hidden;
  background: #0d1b33;
}
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input { font-family: inherit; }
[hidden] { display: none !important; }
svg { fill: currentColor; }
svg [fill="none"], svg [fill=none] { fill: none; stroke: currentColor; }

/* фокус-кольца — синие, 2px */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input:focus-visible, button:focus-visible { outline: none; }

/* ============ Экран загрузки ============ */
#boot-screen {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px;
  background: linear-gradient(165deg, #0d1b33 0%, #12264d 55%, #16305e 100%);
  color: #fff;
  transition: opacity .5s;
}
#boot-screen.fade { opacity: 0; pointer-events: none; }
.boot-name { font-size: 22px; font-weight: 600; letter-spacing: 5px; text-align: center; margin-top: 12px; }
/* тонкий прогресс-бар (элемент .boot-spinner превращён в трек, разметка не менялась) */
.boot-spinner {
  width: 220px; height: 3px; border-radius: 3px;
  border: 0; background: rgba(255, 255, 255, .18);
  overflow: hidden; position: relative; animation: none;
}
.boot-spinner::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 42%;
  border-radius: 3px; background: #fff;
  animation: bootslide 1.5s cubic-bezier(.45, .05, .55, .95) infinite;
}
@keyframes bootslide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(560%); }
}
@keyframes spin { to { transform: rotate(360deg); } }
.boot-hint { font-size: 13px; opacity: .72; letter-spacing: .3px; }

/* ============ Экран входа ============ */
#login-screen {
  position: fixed; inset: 0; z-index: 150;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(1100px 600px at 75% -10%, rgba(96, 156, 255, .5), transparent 60%),
    radial-gradient(900px 700px at 10% 110%, rgba(43, 123, 243, .45), transparent 55%),
    linear-gradient(165deg, #1a3c6e 0%, #122c54 50%, #0b1d3a 100%);
}
.login-card {
  width: 360px; padding: 34px 32px 22px;
  background: rgba(255, 255, 255, .98);
  border-radius: 12px; box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
  display: flex; flex-direction: column; align-items: center;
  animation: cardIn .4s cubic-bezier(.2, .8, .3, 1);
}
@keyframes cardIn { from { transform: translateY(14px); opacity: 0; } }
.login-avatar {
  width: 84px; height: 84px; border-radius: 50%; background: #fff; padding: 10px;
  margin-bottom: 12px; box-shadow: 0 10px 26px rgba(15, 40, 90, .28);
}
.login-user { font-size: 20px; font-weight: 600; }
.login-host { font-size: 12px; color: var(--muted); margin: 2px 0 20px; letter-spacing: 1px; }
#login-pass {
  width: 100%; height: 46px; padding: 0 14px; font-size: 15px;
  border: 1.5px solid #d4dce8; border-radius: var(--radius); outline: none; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
#login-pass:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(43, 123, 243, .35); }
#login-btn {
  width: 100%; height: 46px; margin-top: 14px;
  background: var(--accent);
  color: #fff; font-size: 15px; font-weight: 600;
  border-radius: var(--radius); box-shadow: 0 6px 16px rgba(43, 123, 243, .32);
  transition: background .18s ease-out, box-shadow .18s ease-out, transform .12s ease-out;
}
#login-btn:hover { background: var(--accent-dark); box-shadow: 0 8px 22px rgba(30, 99, 207, .42); }
#login-btn:active { transform: scale(.98); }
.login-forgot {
  margin-top: 12px; font-size: 12px; color: var(--muted); text-decoration: none;
  transition: color .15s;
}
.login-forgot:hover { color: var(--accent); }
.login-card-version {
  margin-top: 18px; padding-top: 12px; width: 100%; text-align: center;
  border-top: 1px solid var(--line);
  font-size: 11px; color: var(--muted); letter-spacing: .4px;
}
.login-hint { margin-top: 12px; font-size: 11.5px; color: var(--muted); min-height: 18px; }
.login-version { position: absolute; bottom: 16px; left: 20px; font-size: 12px; color: rgba(255, 255, 255, .55); }

/* ============ Обои рабочего стола ============ */
#desktop {
  position: fixed; inset: 0;
  background:
    radial-gradient(1200px 700px at 78% -10%, rgba(120, 175, 255, .36), transparent 62%),
    radial-gradient(900px 600px at 10% 108%, rgba(56, 128, 235, .32), transparent 60%),
    linear-gradient(180deg, #27518c 0%, #1e4279 34%, #17335f 62%, #0f2547 100%);
}
/* силуэты гор и озера — оригинальная инлайн-графика */
.desktop-scape {
  position: absolute; left: 0; right: 0; bottom: 0;
  width: 100%; height: 64%; pointer-events: none;
}
/* еле заметная текстура поверх градиента */
#desktop::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .025) 1px, transparent 1.4px);
  background-size: 26px 26px;
}

/* ============ Топ-панель / таскбар ============ */
#topbar {
  position: absolute; top: 0; left: 0; right: 0; height: var(--topbar-h); z-index: 90;
  display: flex; align-items: center; gap: 6px; padding: 0 10px;
  background: rgba(250, 252, 255, .82);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid rgba(120, 140, 175, .25);
}
#main-menu-btn {
  display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 12px;
  border-radius: var(--radius); font-size: 14px; font-weight: 600; color: var(--text);
  transition: background .15s, color .15s;
}
#main-menu-btn:hover { background: rgba(43, 123, 243, .12); color: var(--accent); }
#main-menu-btn svg { width: 20px; height: 20px; }

#taskbar { display: flex; align-items: center; gap: 4px; flex: 1; overflow: hidden; }
.task-btn {
  display: flex; align-items: center; gap: 8px;
  min-width: 46px; max-width: 190px; flex: 0 1 auto;
  height: 38px; padding: 0 12px; border-radius: var(--radius); font-size: 13px;
  color: var(--text); transition: background-color .18s ease-out, color .18s ease-out;
  white-space: nowrap; overflow: hidden;
  border-left: 3px solid transparent; /* резервируем место под индикатор активности */
}
.task-btn .t-label { overflow: hidden; text-overflow: ellipsis; }
.task-btn svg { width: 17px; height: 17px; flex: none; }
.task-btn:hover { background: rgba(0, 0, 0, .05); }
.task-btn.active {
  background: rgba(47, 111, 228, .14); color: var(--accent); font-weight: 600;
  border-left: 3px solid var(--accent);
}
.task-btn.min .t-label { opacity: .45; }

.topbar-right { display: flex; align-items: center; gap: 2px; }
.topbar-right button {
  position: relative; width: 38px; height: 38px; border-radius: var(--radius);
  display: grid; place-items: center; color: #47536b; transition: background .15s, color .15s;
}
.topbar-right button:hover { background: rgba(43, 123, 243, .12); color: var(--accent); }
.topbar-right svg { width: 19px; height: 19px; }
#notif-dot {
  position: absolute; top: 7px; right: 7px; width: 8px; height: 8px;
  border-radius: 50%; background: #f0506e; border: 1.6px solid #fdfdff; display: none;
}
#notif-dot.on { display: block; }

/* ============ Иконки рабочего стола ============ */
#desktop-icons {
  position: absolute; top: calc(var(--topbar-h) + 18px); bottom: 18px;
  left: 18px; right: auto; z-index: 10;
  display: flex; flex-direction: column; flex-wrap: wrap; align-content: flex-start;
  gap: 10px;
  min-height: 480px; /* сетка не прыгает при перестроении иконок */
}
.d-icon {
  width: 96px; padding: 12px 6px 9px; border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, .5); font-size: 12.5px; text-align: center;
  transition: background .15s;
}
.d-icon:hover { background: rgba(255, 255, 255, .14); }
.d-icon .d-glyph {
  width: 56px; height: 56px; border-radius: 14px;
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .3);
  transition: box-shadow .15s, transform .15s;
}
.d-icon:hover .d-glyph { box-shadow: 0 10px 24px rgba(0, 0, 0, .38); transform: translateY(-1px); }
.d-icon .d-glyph svg { width: 28px; height: 28px; }

/* ============ Главное меню (launchpad) ============ */
#main-menu {
  position: absolute; top: calc(var(--topbar-h) + 8px); left: 10px; z-index: 95;
  width: 520px; max-width: calc(100vw - 40px);
  background: rgba(250, 252, 255, .94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 14px; box-shadow: var(--shadow-panel);
  display: flex; flex-direction: column; overflow: hidden;
  animation: menuIn .18s ease-out;
}
@keyframes menuIn { from { transform: translateY(-10px); opacity: 0; } }
.mm-search { position: relative; padding: 14px 16px 6px; }
.mm-search input {
  width: 100%; padding: 10px 12px 10px 38px; font-size: 14px;
  border: 1.5px solid #d9e1ee; border-radius: var(--radius); outline: none; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.mm-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(43, 123, 243, .3); }
.mm-search svg { position: absolute; left: 28px; top: 25px; width: 17px; height: 17px; color: var(--muted); }
#mm-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  padding: 12px 14px; max-height: 420px; overflow-y: auto;
  scrollbar-gutter: stable;
}
.mm-app {
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  padding: 16px 6px 13px; border-radius: 12px; font-size: 12.5px;
  transition: background-color .16s ease-out; color: var(--text);
}
.mm-app:hover { background: var(--accent-soft); }
.mm-app .mm-glyph {
  width: 56px; height: 56px; border-radius: 16px;
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 6px 14px rgba(20, 50, 110, .25);
}
.mm-app .mm-glyph svg { width: 28px; height: 28px; }
.mm-footer {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 10px 14px; border-top: 1px solid var(--line); background: rgba(240, 245, 252, .7);
}
.mm-footer button {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px;
  border-radius: var(--radius); font-size: 13px; color: #47536b; transition: background .15s, color .15s;
}
.mm-footer button:hover { background: rgba(43, 123, 243, .12); color: var(--accent); }
.mm-footer svg { width: 17px; height: 17px; }

/* ============ Оверлей поиска ============ */
#search-overlay {
  position: absolute; inset: 0; z-index: 96;
  background: rgba(10, 22, 44, .45); backdrop-filter: blur(4px);
  display: flex; justify-content: center; padding-top: 90px;
}
.so-box {
  width: 480px; height: fit-content; max-height: 60vh;
  background: rgba(252, 253, 255, .98); border-radius: 12px;
  box-shadow: var(--shadow-panel); overflow: hidden; display: flex; flex-direction: column;
}
#so-input {
  padding: 15px 18px; font-size: 15px; border: 0; outline: none; border-bottom: 1px solid var(--line);
  background: transparent;
}
#so-results { overflow-y: auto; padding: 8px; }
.so-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 12px; border-radius: var(--radius); font-size: 14px; text-align: left;
  transition: background-color .16s ease-out;
}
.so-item:hover { background: var(--accent-soft); }
.so-item .mm-glyph { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex: none; }
.so-item .mm-glyph svg { width: 19px; height: 19px; }
.so-empty { padding: 22px; text-align: center; color: var(--muted); font-size: 13px; }

/* ============ Панель виджетов ============ */
#widget-panel {
  position: absolute; top: var(--topbar-h); right: 0; bottom: 0; z-index: 92;
  width: 300px; padding: 20px 18px;
  background: rgba(250, 252, 255, .88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-left: 1px solid rgba(120, 140, 175, .25);
  transform: translateX(105%); transition: transform .25s ease-out;
  will-change: transform;
  overflow-y: auto;
}
#widget-panel.open { transform: none; }
.wp-clock { text-align: center; color: var(--text); margin-bottom: 16px; }
#wp-time { font-size: 44px; font-weight: 200; letter-spacing: 1px; }
#wp-date { font-size: 13px; color: var(--muted); margin-top: 2px; }
.wp-section { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin: 18px 4px 8px; }
.wp-row { display: flex; align-items: center; gap: 10px; font-size: 13px; margin-bottom: 9px; }
.wp-row span { width: 42px; color: var(--muted); }
.wp-row b { width: 38px; text-align: right; font-weight: 600; font-size: 12.5px; }
.wp-bar { flex: 1; height: 7px; border-radius: 4px; background: #e2e9f4; overflow: hidden; }
.wp-bar i { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, #57a0ff, var(--accent)); transition: width .6s; }
#wp-ram { background: linear-gradient(90deg, #4fd0a5, #25b184); }
#wp-net { background: linear-gradient(90deg, #ffb35c, #f68b1f); }
.wp-vol { margin-bottom: 10px; font-size: 13px; }
.wp-vol .wpv-head { display: flex; justify-content: space-between; margin-bottom: 5px; }
.wp-vol .wpv-head b { font-weight: 600; }
.wp-vol .wp-bar i { background: linear-gradient(90deg, #57a0ff, var(--accent)); }

/* ============ Панель уведомлений ============ */
#notif-panel {
  position: absolute; top: calc(var(--topbar-h) + 8px); right: 10px; z-index: 95;
  width: 340px; max-height: 420px;
  background: rgba(252, 253, 255, .98); border-radius: 12px; box-shadow: var(--shadow-panel);
  display: flex; flex-direction: column; overflow: hidden;
  transform-origin: top right; transform: scale(.95); opacity: 0; pointer-events: none;
  transition: transform .18s ease-out, opacity .18s ease-out;
  will-change: transform, opacity;
}
#notif-panel.open { transform: none; opacity: 1; pointer-events: auto; }
.np-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 16px; font-weight: 600; font-size: 14px; border-bottom: 1px solid #e8edf6;
}
.np-head button { font-size: 12px; color: var(--accent); border-radius: 6px; padding: 4px 8px; }
.np-head button:hover { background: var(--accent-soft); }
#np-list { overflow-y: auto; scrollbar-gutter: stable; }
.np-item { display: flex; gap: 11px; padding: 12px 16px; border-bottom: 1px solid #f0f4fa; }
.np-item:last-child { border-bottom: 0; }
.np-glyph { width: 32px; height: 32px; border-radius: 9px; flex: none; display: grid; place-items: center; color: #fff; }
.np-glyph svg { width: 17px; height: 17px; }
.np-body { font-size: 13px; line-height: 1.45; }
.np-body b { display: block; }
.np-body span { color: var(--muted); font-size: 12px; }
.np-time { margin-left: auto; font-size: 11px; color: var(--muted); flex: none; }
.np-empty { padding: 26px; text-align: center; color: var(--muted); font-size: 13px; }

/* ============ Меню пользователя ============ */
#user-menu {
  position: absolute; top: calc(var(--topbar-h) + 8px); right: 10px; z-index: 95;
  width: 230px; padding: 8px;
  background: rgba(252, 253, 255, .98); border-radius: 12px; box-shadow: var(--shadow-panel);
  animation: menuIn .15s ease-out;
}
.um-name { padding: 10px 12px 12px; font-weight: 600; font-size: 14px; }
.um-name span { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
#user-menu button {
  display: block; width: 100%; text-align: left; padding: 9px 12px;
  border-radius: var(--radius); font-size: 13.5px; transition: background-color .16s ease-out, color .16s ease-out;
}
#user-menu button:hover { background: var(--accent-soft); color: var(--accent); }

/* ============ Окна ============ */
#windows-layer { position: absolute; inset: 0; pointer-events: none; }
.win {
  position: absolute; min-width: 420px; min-height: 280px;
  pointer-events: auto;
  background: var(--card); border-radius: 10px; border: 1px solid #dfe7f3;
  box-shadow: var(--shadow-win); display: flex; flex-direction: column; overflow: hidden;
  animation: winIn .18s ease-out;
}
@keyframes winIn { from { transform: scale(.96); opacity: 0; } }
.win.focused { box-shadow: var(--shadow-win-active); border-color: #cfdaf0; }
.win.maxed { border-radius: 0; border: 0; }
.win-titlebar {
  height: var(--titlebar-h); flex: none; display: flex; align-items: center; gap: 9px;
  padding: 0 6px 0 12px; background: #fff; user-select: none; cursor: default;
  border-bottom: 1px solid var(--line);
  transition: background-color .2s ease;
}
.win.focused .win-titlebar { background: #fff; }
.win-titlebar .wt-icon { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: #fff; flex: none; }
.win-titlebar .wt-icon svg { width: 14px; height: 14px; }
.win-titlebar .wt-label { font-size: 13px; font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-controls { display: flex; gap: 2px; }
.win-controls button {
  width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center;
  color: #7c8aa5; transition: background-color .16s ease-out, color .16s ease-out;
}
.win-controls button:hover { background: rgba(28, 36, 52, .07); color: var(--text); }
.win-controls .w-close:hover { background: #e5484d; color: #fff; }
.win-controls svg { width: 14px; height: 14px; }
/* дублирующий фикс невидимых иконок (основной — в разметке) */
.win-controls button svg * { fill: none; stroke: currentColor; }

/* snap-призрак при доводке окна к краю (элемент создаёт JS, класс — подстраховка) */
.snap-ghost {
  position: absolute; z-index: 5000; pointer-events: none;
  background: rgba(43, 123, 243, .18);
  border: 1.5px solid rgba(43, 123, 243, .55);
  border-radius: 10px; opacity: 0;
  transition: all .15s ease-out;
}

/* статусная строка окна (DSM-стиль) */
.win-status {
  flex: none; height: 28px; display: flex; align-items: center; gap: 18px;
  padding: 0 12px; background: var(--bg); border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted);
}
.win-status b { color: var(--text); font-weight: 600; }
.win-body { flex: 1; overflow: auto; background: #fff; position: relative; scrollbar-gutter: stable; }

/* ресайз-ручка */
.win .w-resize {
  position: absolute; right: 0; bottom: 0; width: 18px; height: 18px;
  cursor: nwse-resize; z-index: 5;
  background: linear-gradient(135deg, transparent 55%, rgba(90, 110, 150, .4) 55%, rgba(90, 110, 150, .4) 62%, transparent 62%, transparent 70%, rgba(90, 110, 150, .4) 70%, rgba(90, 110, 150, .4) 77%, transparent 77%);
}

/* ============ Общие элементы внутри приложений ============ */
.padded { padding: 18px; }
.btn {
  padding: 8px 16px; border-radius: var(--radius); font-size: 13px; font-weight: 600;
  background: var(--accent); color: #fff; transition: background .15s;
}
.btn:hover { background: var(--accent-dark); }
.btn.ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn:disabled { opacity: .45; cursor: default; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th {
  text-align: left; padding: 10px 12px; font-size: 11px; text-transform: uppercase;
  letter-spacing: .6px; color: #8a99b8; background: #f7f9fd; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 2; font-weight: 700;
}
table.grid td { padding: 11px 12px; border-bottom: 1px solid #eef2f8; }
table.grid tr:hover td { background: #f6f9fe; }
.pill { display: inline-block; padding: 2.5px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.pill.ok { background: #dcf5ea; color: #159a6c; }
.pill.warn { background: #fdf0d9; color: #c07f13; }
.pill.info { background: var(--accent-soft); color: var(--accent); }
.progress { height: 8px; border-radius: 5px; background: #e5ebf5; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, #57a0ff, var(--accent)); border-radius: 5px; transition: width .4s; }
.progress.warn i { background: linear-gradient(90deg, #ffc46b, #f5a623); }
.progress.crit i { background: linear-gradient(90deg, #ff8f8f, #e5484d); }
.muted { color: var(--muted); font-size: 12px; }
.section-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 14px;
}

/* ============ Файловая станция ============ */
.fs-wrap { display: flex; height: 100%; }
.fs-tree {
  width: var(--side-w); flex: none; background: var(--bg); border-right: 1px solid var(--line);
  padding: 10px 8px; overflow-y: auto; font-size: 13px;
}
.fs-tree .t-item {
  display: flex; align-items: center; gap: 7px; padding: 6px 9px;
  border-radius: 7px; cursor: pointer; white-space: nowrap; color: var(--text);
  transition: background-color .15s ease-out;
}
.fs-tree .t-item:hover { background: #eaf1fb; }
.fs-tree .t-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.fs-tree .t-item svg { width: 15px; height: 15px; flex: none; color: #8a99b8; }
.fs-tree .t-item.active svg { color: var(--accent); }
.fs-tree .t-kids { margin-left: 14px; border-left: 1px dashed #d8e1ef; padding-left: 5px; }
.fs-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.fs-toolbar {
  display: flex; align-items: center; gap: 6px; padding: 7px 12px;
  min-height: var(--toolbar-h);
  border-bottom: 1px solid var(--line); background: #fbfcfe;
}
.fs-toolbar button {
  display: flex; align-items: center; gap: 6px; padding: 7px 11px;
  border-radius: var(--radius); font-size: 12.5px; color: #47536b; transition: background-color .16s ease-out, color .16s ease-out;
}
.fs-toolbar button:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); }
.fs-toolbar button:disabled { opacity: .4; cursor: default; }
.fs-toolbar svg { width: 15px; height: 15px; }
.fs-crumbs { display: flex; align-items: center; gap: 2px; padding: 8px 14px; font-size: 12.5px; border-bottom: 1px solid #eef2f8; flex-wrap: wrap; }
.fs-crumbs button { padding: 3px 7px; border-radius: 6px; color: var(--muted); }
.fs-crumbs button:hover { background: var(--accent-soft); color: var(--accent); }
.fs-crumbs button.cur { color: var(--text); font-weight: 600; }
.fs-crumbs .sep { color: #b9c4d8; }
.fs-list { flex: 1; overflow: auto; scrollbar-gutter: stable; }
.fs-list td.name { display: flex; align-items: center; gap: 9px; font-weight: 500; }
.fs-list td.name svg { width: 17px; height: 17px; flex: none; }
.fs-list tr.dir { cursor: pointer; }

/* ============ Панель управления ============ */
.cp-wrap { display: flex; height: 100%; }
.cp-nav { width: var(--side-w); flex: none; background: var(--bg); border-right: 1px solid var(--line); padding: 10px 8px; overflow-y: auto; }
.cp-nav .c-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  border-radius: var(--radius); font-size: 13px; cursor: pointer; color: var(--text); width: 100%; text-align: left;
  transition: background-color .15s ease-out;
}
.cp-nav .c-item:hover { background: #eaf1fb; }
.cp-nav .c-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.cp-nav .c-item svg { width: 17px; height: 17px; flex: none; color: #8a99b8; }
.cp-nav .c-item.active svg { color: var(--accent); }
.cp-content { flex: 1; overflow-y: auto; padding: 20px 22px; scrollbar-gutter: stable; }
.cp-content h3 { font-size: 17px; margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: 200px 1fr; gap: 14px 18px; align-items: center; max-width: 640px; font-size: 13.5px; }
.form-grid label { color: var(--muted); }
.form-grid input, .form-grid select {
  padding: 9px 12px; border: 1.5px solid #d9e1ee; border-radius: var(--radius); outline: none; font-size: 13.5px; max-width: 320px;
  transition: border-color .15s, box-shadow .15s;
}
.form-grid input:focus, .form-grid select:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(43, 123, 243, .3); }

/* ============ Диспетчер хранения ============ */
.pool-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; background: var(--card); }
.pool-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.pool-head .p-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #57a0ff, var(--accent)); }
.pool-head .p-ic svg { width: 18px; height: 18px; }
.pool-head b { font-size: 14.5px; }
.pool-head .muted { margin-left: auto; }
.disk-row { display: flex; gap: 10px; flex-wrap: wrap; }
.disk {
  flex: 1; min-width: 150px; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; font-size: 12.5px;
  background: #fff;
}
.disk b { font-size: 13px; }
.disk .muted { display: block; margin: 3px 0 7px; }

/* ============ Центр пакетов ============ */
.pc-tabs { display: flex; gap: 4px; padding: 10px 14px 0; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.pc-tabs button { padding: 9px 15px; font-size: 13px; border-radius: 9px 9px 0 0; color: var(--muted); border-bottom: 2.5px solid transparent; transition: color .15s; }
.pc-tabs button.active { color: var(--accent); font-weight: 600; border-bottom-color: var(--accent); }
.pc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; padding: 16px; scrollbar-gutter: stable; }
.pkg {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 15px; background: var(--card);
  display: flex; flex-direction: column; gap: 9px;
}
.pkg-top { display: flex; gap: 11px; align-items: center; }
.pkg-glyph { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; color: #fff; flex: none; }
.pkg-glyph svg { width: 21px; height: 21px; }
.pkg-top b { font-size: 13.5px; display: block; }
.pkg-top .muted { font-size: 11.5px; }
.pkg p { font-size: 12.5px; color: #5a6780; line-height: 1.5; flex: 1; }
.pkg .btn { align-self: flex-start; padding: 6px 14px; font-size: 12px; }
.pkg .btn.installed { background: #dcf5ea; color: #159a6c; }
.pkg .progress { margin-top: 4px; }

/* ============ Монитор ресурсов ============ */
.rm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 16px; }
.rm-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--card); }
.rm-card h4 { font-size: 13px; margin-bottom: 10px; display: flex; justify-content: space-between; }
.rm-card h4 b { font-weight: 700; }
.rm-card canvas { width: 100%; height: 130px; display: block; }
.rm-legend { display: flex; gap: 16px; font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.rm-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }

/* ============ Экран питания ============ */
#power-screen {
  position: absolute; inset: 0; z-index: 180;
  background: #060c16; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
}
.power-text { font-size: 17px; opacity: .85; }
#power-on {
  padding: 10px 26px; border-radius: var(--radius); font-size: 14px;
  background: var(--accent); color: #fff; transition: background .15s;
}
#power-on:hover { background: var(--accent-dark); }

/* скроллбары — тонкие, серые, как в DSM */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c3cee2; border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #a3b3d1; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }
