/* =========================================================================
   Aquario ONE - Admin // Refined Glass design system (макет, dark theme)
   Один общий файл токенов и компонентов для всех страниц-макетов.
   ========================================================================= */

/* ---- Шрифт (Inter с системным фолбэком, работает и офлайн) ------------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* --- Фон / глубина --- */
  --bg-0:        #060a11;
  --bg-1:        #0a0f1a;
  --bg-2:        #0e1522;
  --bg-3:        #131c2c;

  /* --- Стекло --- */
  --glass:       rgba(255, 255, 255, 0.045);
  --glass-2:     rgba(255, 255, 255, 0.07);
  --glass-3:     rgba(255, 255, 255, 0.10);
  --glass-brand: rgba(0, 141, 210, 0.10);
  --stroke:      rgba(255, 255, 255, 0.09);
  --stroke-2:    rgba(255, 255, 255, 0.15);
  --stroke-soft: rgba(255, 255, 255, 0.05);

  /* --- Бренд (azure Aquario = #008DD2) --- */
  --brand:       #008DD2;
  --brand-600:   #0277b3;
  --brand-400:   #2ba6e8;
  --brand-300:   #59c1f6;
  --brand-200:   #9bd9fb;
  --cyan:        #22d3ee;
  --amber:       #f5b14a;   /* дозированное наследие amber */

  /* --- Текст --- */
  --text-1:      #e9f1f9;
  --text-2:      #9db0c5;
  --text-3:      #61748c;
  --text-on-brand: #04111c;

  /* --- Статусы --- */
  --ok:          #34d399;
  --warn:        #f5b14a;
  --danger:      #f76d6d;
  --info:        #4cb8f0;

  /* --- Радиусы --- */
  --r-xs: 7px;  --r-sm: 10px;  --r: 14px;  --r-lg: 18px;  --r-xl: 24px;  --r-pill: 999px;

  /* --- Тени / свечение --- */
  --shadow-1:  0 1px 2px rgba(0,0,0,.4);
  --shadow-2:  0 8px 24px -10px rgba(0,0,0,.6);
  --shadow-3:  0 24px 60px -18px rgba(0,0,0,.7);
  --glow-brand: 0 0 0 1px rgba(0,141,210,.35), 0 10px 34px -10px rgba(0,141,210,.5);
  --glow-soft:  0 0 30px -6px rgba(0,141,210,.35);

  /* --- Motion --- */
  --ease:        cubic-bezier(.22,.61,.36,1);
  --ease-out:    cubic-bezier(.16,1,.3,1);
  --spring:      cubic-bezier(.34,1.56,.64,1);
  --t-fast: .15s;  --t: .28s;  --t-slow: .5s;

  /* layout */
  --sidebar-w: 252px;
  --topbar-h: 64px;
}

/* ---- reset ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-1);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -.01em;
  overflow: hidden;
}
h1,h2,h3,h4 { margin: 0; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
::selection { background: rgba(0,141,210,.35); }

/* ---- Фоновая «атмосфера» (глубина под стеклом) ------------------------- */
.bg-ambient { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.bg-ambient .blob {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: .5; mix-blend-mode: screen;
  animation: drift 26s var(--ease) infinite alternate;
}
.bg-ambient .b1 { width: 620px; height: 620px; left: -160px; top: -180px;
  background: radial-gradient(circle, rgba(0,141,210,.55), transparent 65%); }
.bg-ambient .b2 { width: 540px; height: 540px; right: -120px; top: 120px;
  background: radial-gradient(circle, rgba(34,211,238,.40), transparent 65%); animation-delay: -8s; }
.bg-ambient .b3 { width: 460px; height: 460px; left: 38%; bottom: -200px;
  background: radial-gradient(circle, rgba(120,90,255,.30), transparent 65%); animation-delay: -14s; }
.bg-ambient .grid {
  position: absolute; inset: 0; opacity: .5;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 80%);
}
.bg-ambient .vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 120% 90% at 50% -10%, transparent 40%, rgba(0,0,0,.55));
}
/* Крупное «слово раздела» на фоне (под стеклом) - наследие legacy BackgroundBase.
   Очень блёкло, читается сквозь полупрозрачные панели = глубина и слои. */
.bg-ambient .word {
  position: absolute; left: calc(var(--sidebar-w) + 44px); bottom: 5vh;
  text-transform: uppercase; font-weight: 700; line-height: .84;
  letter-spacing: .02em; white-space: nowrap; user-select: none;
  color: rgba(150, 198, 240, 0.05); /* просто залитый текст, без -webkit-text-stroke (наложений нет) */
  -webkit-mask-image: linear-gradient(100deg, transparent, #000 15%, #000 72%, transparent);
  mask-image: linear-gradient(100deg, transparent, #000 15%, #000 72%, transparent);
}
.bg-ambient .word > div { font-size: clamp(72px, 10.5vw, 186px); }
@keyframes drift {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(60px,40px) scale(1.12); }
}

/* ========================================================================
   Каркас приложения (shell): сайдбар + топбар + контент
   ======================================================================== */
.app { position: relative; z-index: 1; height: 100vh; display: grid;
  grid-template-columns: var(--sidebar-w) 1fr; }

/* ---- Сайдбар ----------------------------------------------------------- */
.sidebar {
  margin: 12px 0 12px 12px;
  background: linear-gradient(180deg, var(--glass-2), var(--glass));
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  backdrop-filter: blur(11px) saturate(1.4);
  -webkit-backdrop-filter: blur(11px) saturate(1.4);
  box-shadow: var(--shadow-2);
  display: flex; flex-direction: column; overflow: hidden;
}
.sidebar__brand { display: flex; align-items: center; gap: 11px; padding: 18px 18px 14px; }
.sidebar__brand .mark {
  width: 38px; height: 38px; border-radius: 11px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: linear-gradient(145deg, rgba(0,141,210,.28), rgba(0,141,210,.05));
  border: 1px solid rgba(0,141,210,.4); box-shadow: var(--glow-soft);
}
.sidebar__brand .mark img { width: 24px; height: 24px; filter: brightness(0) invert(1); }
.sidebar__brand .name { font-weight: 800; font-size: 16px; letter-spacing: -.02em; }
.sidebar__brand .name span { color: var(--brand-300); }
.sidebar__brand .sub { font-size: 11px; color: var(--text-3); letter-spacing: .04em; text-transform: uppercase; }

.nav { padding: 6px 12px; overflow-y: auto; flex: 1; }
.nav__label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em;
  color: var(--text-3); padding: 14px 12px 7px; font-weight: 600; }
.nav__item {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; margin: 2px 0; border-radius: var(--r-sm);
  color: var(--text-2); cursor: pointer; font-weight: 500;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.nav__item svg { width: 19px; height: 19px; flex: 0 0 auto; opacity: .85; }
.nav__item .badge { margin-left: auto; }
.nav__item:hover { background: var(--glass); color: var(--text-1); }
.nav__item.active { color: var(--text-1); background: var(--glass-brand);
  box-shadow: inset 0 0 0 1px rgba(0,141,210,.28); }
.nav__item.active svg { opacity: 1; color: var(--brand-300); }
.nav__item.active::before {
  content: ''; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 3px;
  background: linear-gradient(var(--brand-300), var(--brand)); box-shadow: var(--glow-soft);
}

.sidebar__foot { padding: 12px; border-top: 1px solid var(--stroke-soft); }
.userchip { display: flex; align-items: center; gap: 11px; padding: 8px; border-radius: var(--r-sm);
  cursor: pointer; transition: background var(--t-fast); }
.userchip:hover { background: var(--glass); }
.avatar { width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center;
  font-weight: 700; font-size: 13px; color: var(--text-on-brand);
  background: linear-gradient(145deg, var(--brand-300), var(--brand)); }
.userchip .meta { line-height: 1.25; }
.userchip .meta b { font-size: 13px; font-weight: 600; }
.userchip .meta small { color: var(--text-3); font-size: 11px; }

/* ---- Главная колонка --------------------------------------------------- */
.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }

.topbar {
  height: var(--topbar-h); flex: 0 0 auto;
  display: flex; align-items: center; gap: 16px; padding: 0 22px;
}
.breadcrumb { display: flex; align-items: center; gap: 9px; color: var(--text-3); font-size: 13px; }
.breadcrumb b { color: var(--text-1); font-weight: 600; }
.breadcrumb svg { width: 15px; height: 15px; opacity: .5; }

.search {
  margin-left: 8px; display: flex; align-items: center; gap: 9px; min-width: 240px;
  background: var(--glass); border: 1px solid var(--stroke); border-radius: var(--r-pill);
  padding: 8px 14px; color: var(--text-3); transition: border var(--t-fast), box-shadow var(--t-fast);
}
.search:focus-within { border-color: rgba(0,141,210,.5); box-shadow: var(--glow-soft); }
.search svg { width: 16px; height: 16px; }
.search input { background: none; border: none; outline: none; color: var(--text-1); font-size: 13px; width: 100%; }
.search kbd { font-size: 10px; color: var(--text-3); border: 1px solid var(--stroke);
  border-radius: 5px; padding: 1px 5px; font-family: 'JetBrains Mono', monospace; }

.topbar__spacer { flex: 1; }

.content { flex: 1; overflow-y: auto; padding: 4px 22px 28px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 6px 0 20px; }
.page-head h1 { font-size: 26px; }
.page-head .desc { color: var(--text-2); margin-top: 5px; font-size: 13.5px; }

/* ========================================================================
   Атомы
   ======================================================================== */

/* стеклянная карточка */
.card {
  background: linear-gradient(180deg, var(--glass-2), var(--glass));
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  backdrop-filter: blur(8px) saturate(1.3);
  -webkit-backdrop-filter: blur(8px) saturate(1.3);
  box-shadow: var(--shadow-2);
  position: relative; overflow: hidden;
}
.card::after { /* верхний световой блик стекла */
  content: ''; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.22), transparent);
}
.card__pad { padding: 18px; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 18px; border-bottom: 1px solid var(--stroke-soft); }
.card__head h3 { font-size: 14.5px; }
.card__head .sub { color: var(--text-3); font-size: 12px; }

.card-hover { transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease); }
.card-hover:hover { transform: translateY(-3px); border-color: var(--stroke-2); box-shadow: var(--shadow-3), var(--glow-soft); }

/* кнопки */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  height: 38px; padding: 0 16px; border-radius: var(--r-sm); cursor: pointer;
  font-size: 13.5px; font-weight: 600; border: 1px solid transparent; position: relative; overflow: hidden;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
  color: var(--text-1); background: var(--glass-2); border-color: var(--stroke);
}
.btn svg { width: 17px; height: 17px; }
.btn:hover { background: var(--glass-3); border-color: var(--stroke-2); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn--primary { background: linear-gradient(145deg, var(--brand-400), var(--brand-600));
  color: #fff; border-color: rgba(0,141,210,.5); box-shadow: var(--glow-brand); }
.btn--primary:hover { box-shadow: var(--glow-brand), var(--glow-soft); filter: brightness(1.06); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--glass); color: var(--text-1); }
.btn--sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn--icon { width: 38px; padding: 0; }
.btn--icon.btn--sm { width: 32px; }

/* ripple слой (вставляется JS) */
.ripple { position: absolute; border-radius: 50%; transform: scale(0); pointer-events: none;
  background: rgba(255,255,255,.35); animation: ripple .6s var(--ease-out); }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }

/* чипы / теги */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px;
  border-radius: var(--r-pill); font-size: 12px; font-weight: 600;
  background: var(--glass-2); border: 1px solid var(--stroke); color: var(--text-2);
  transition: all var(--t-fast); cursor: default; }
.chip--brand { background: var(--glass-brand); border-color: rgba(0,141,210,.35); color: var(--brand-200); }
.chip--amber { background: rgba(245,177,74,.12); border-color: rgba(245,177,74,.3); color: var(--amber); }
.chip.is-click { cursor: pointer; }
.chip.is-click:hover { border-color: var(--stroke-2); color: var(--text-1); transform: translateY(-1px); }
.chip .x { opacity: .5; }  .chip .x:hover { opacity: 1; }

/* бейджи / точки статуса */
.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 700; letter-spacing: .01em; }
.badge--brand { background: rgba(0,141,210,.16); color: var(--brand-200); }
.badge--ok { background: rgba(52,211,153,.15); color: var(--ok); }
.badge--warn { background: rgba(245,177,74,.15); color: var(--warn); }
.badge--danger { background: rgba(247,109,109,.15); color: var(--danger); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot--ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot--warn { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.dot--danger { background: var(--danger); box-shadow: 0 0 8px var(--danger); }

/* статус-пилюля соединения */
.statepill { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 13px;
  border-radius: var(--r-pill); background: var(--glass); border: 1px solid var(--stroke);
  font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.statepill .pulse { position: relative; }
.statepill .pulse::after { content:''; position:absolute; inset:-4px; border-radius:50%;
  border:1px solid var(--ok); opacity:0; animation: pulse 2s var(--ease) infinite; }
@keyframes pulse { 0%{opacity:.7; transform:scale(.6);} 100%{opacity:0; transform:scale(1.6);} }

/* инпут */
.input { display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 13px;
  background: var(--glass); border: 1px solid var(--stroke); border-radius: var(--r-sm); color: var(--text-1);
  transition: border var(--t-fast), box-shadow var(--t-fast); }
.input:focus-within { border-color: rgba(0,141,210,.5); box-shadow: var(--glow-soft); }
.input input, .input select { background: none; border: none; outline: none; color: var(--text-1); width: 100%; font-size: 13.5px; }
.input svg { width: 16px; height: 16px; color: var(--text-3); }

/* переключатель */
.switch { width: 40px; height: 23px; border-radius: var(--r-pill); background: var(--glass-3);
  border: 1px solid var(--stroke); position: relative; cursor: pointer; transition: background var(--t); flex:0 0 auto; }
.switch::after { content:''; position:absolute; top:2px; left:2px; width:17px; height:17px; border-radius:50%;
  background:#fff; transition: transform var(--t) var(--spring); }
.switch.on { background: linear-gradient(145deg, var(--brand-400), var(--brand-600)); border-color: rgba(0,141,210,.5); }
.switch.on::after { transform: translateX(17px); }

/* сегментированный контрол / табы */
.segmented { display: inline-flex; gap: 3px; padding: 4px; background: var(--glass); border: 1px solid var(--stroke);
  border-radius: var(--r-sm); }
.segmented button { border: none; background: none; color: var(--text-2); font-weight: 600; font-size: 13px;
  padding: 6px 14px; border-radius: 8px; cursor: pointer; transition: all var(--t-fast); }
.segmented button:hover { color: var(--text-1); }
.segmented button.active { background: var(--glass-brand); color: var(--brand-200);
  box-shadow: inset 0 0 0 1px rgba(0,141,210,.3); }

.tabs { display: flex; gap: 4px; }
.tab { padding: 9px 15px; border-radius: var(--r-sm); color: var(--text-2); font-weight: 600; cursor: pointer;
  font-size: 13.5px; position: relative; transition: color var(--t-fast), background var(--t-fast); display:flex; align-items:center; gap:8px; }
.tab:hover { color: var(--text-1); background: var(--glass); }
.tab.active { color: var(--text-1); background: var(--glass-brand); box-shadow: inset 0 0 0 1px rgba(0,141,210,.28); }
.tab .count { font-size: 11px; color: var(--text-3); }
.tab.active .count { color: var(--brand-300); }

/* таблица */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; padding: 11px 14px; color: var(--text-3); font-weight: 600; font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--stroke); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--stroke-soft); color: var(--text-1); }
.table tbody tr { transition: background var(--t-fast); cursor: pointer; }
.table tbody tr:hover { background: var(--glass); }
.table tbody tr:last-child td { border-bottom: none; }
.t-mono { font-family: 'JetBrains Mono', monospace; color: var(--text-2); font-size: 12px; }

/* мини-полоса прогресса */
.meter { height: 6px; border-radius: var(--r-pill); background: var(--glass-3); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--brand), var(--cyan)); box-shadow: var(--glow-soft); }

/* утилиты */
.muted { color: var(--text-3); }  .dim { color: var(--text-2); }
.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.gap-6{gap:6px;} .gap-8{gap:8px;} .gap-12{gap:12px;} .gap-16{gap:16px;} .gap-20{gap:20px;}
.mt-4{margin-top:4px;} .mt-8{margin-top:8px;} .mt-12{margin-top:12px;} .mt-16{margin-top:16px;} .mt-20{margin-top:20px;} .mt-24{margin-top:24px;}
.grid { display: grid; gap: 16px; }
.fw-600{font-weight:600;} .fw-700{font-weight:700;}
.fs-12{font-size:12px;} .fs-13{font-size:13px;} .fs-22{font-size:22px;} .fs-28{font-size:28px;}

/* ========================================================================
   Motion: появление с задержкой (reveal), активируется через app.js
   ======================================================================== */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .55s var(--ease-out), transform .55s var(--ease-out); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
  .bg-ambient .blob { animation: none; }
}

/* тонкий скроллбар */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(0,141,210,.35); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,141,210,.55); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
