/* DISTI: общая оболочка и компоненты в стиле прежнего фронта (disti.avowiz.com): белое боковое меню с логотипом LASER / DISTI, светлый фон #f1f4f8,
   фирменный цвет #4b39ef, бирюзовый #39d2c0, карточки rounded-2xl с тонкой рамкой, значки lucide, подписи ЗАГЛАВНЫМИ мелкими буквами. */
:root {
  --brand: #4b39ef; --brand-2: #39d2c0; --bg: #f1f4f8; --ink: #14181b;
  --g50: #f9fafb; --g100: #f3f4f6; --g200: #e5e7eb; --g300: #d1d5db; --g400: #9ca3af; --g500: #6b7280; --g600: #4b5563; --g700: #374151; --g900: #111827;
  --brand-05: #4b39ef0d; --brand-10: #4b39ef1a; --brand-20: #4b39ef33; --brand-soft: #eceafd;
  --green: #16a34a; --green-bg: #f0fdf4; --green-ink: #15803d; --amber: #d97706; --amber-bg: #fffbeb; --amber-ink: #b45309;
  --red: #dc2626; --red-bg: #fef2f2; --red-ink: #b91c1c; --blue: #2563eb; --blue-bg: #eff6ff;
  --side-w: 288px; --side-w-c: 80px; --r-xl: .75rem; --r-2xl: 1rem; --r-3xl: 1.5rem;
  --shadow-sm: 0 1px 3px 0 #0000001a, 0 1px 2px -1px #0000001a; --shadow-lg: 0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;
  --font: Inter, ui-sans-serif, system-ui, "Segoe UI", Roboto, Arial, "Noto Sans", sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.5; -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }
a { color: var(--brand); text-decoration: none; } a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
.ic { flex-shrink: 0; vertical-align: -.2em; }
* { scrollbar-width: thin; scrollbar-color: #c3c9d4 transparent; }

/* ---------------------------------------------------------------- оболочка */
.app { display: flex; height: 100vh; height: 100dvh; width: 100%; }
.side { width: var(--side-w); flex: 0 0 var(--side-w); background: #fff; border-right: 1px solid var(--g200); display: flex; flex-direction: column; transition: width .25s, flex-basis .25s; z-index: 40; }
.side-logo { height: 80px; display: flex; align-items: center; padding: 0 20px; border-bottom: 1px solid var(--g100); flex-shrink: 0; gap: 12px; text-decoration: none !important; }
.side-logo img { width: 42px; height: 42px; object-fit: contain; flex-shrink: 0; }
.side-logo .brand { font-size: 22px; font-weight: 900; letter-spacing: .12em; color: #121629; line-height: 1; }
.side-logo .brand-sub { font-size: 11px; font-weight: 600; letter-spacing: .3em; color: var(--g400); margin-top: 5px; }
.side-nav { flex: 1; padding: 22px 12px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 16px; padding: 12px; border-radius: var(--r-xl); color: var(--g500); font-weight: 600; font-size: 14px; text-decoration: none !important; transition: background .15s, color .15s; border: 1px solid transparent; white-space: nowrap; }
.nav-item .ic { color: var(--g400); }
.nav-item:hover { background: var(--g50); color: var(--g900); } .nav-item:hover .ic { color: var(--g600); }
.nav-item.on { background: var(--brand-05); color: var(--brand); box-shadow: var(--shadow-sm); border-color: var(--brand-10); } .nav-item.on .ic { color: var(--brand); }
.side-foot { border-top: 1px solid var(--g100); padding: 14px 16px 16px; flex-shrink: 0; }
.side-foot .ver { text-align: center; font-size: 10px; font-weight: 700; color: var(--g400); letter-spacing: .1em; margin-bottom: 10px; }
.who { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-xl); background: var(--g50); margin-bottom: 8px; min-width: 0; }
.who .av { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: 14px; flex-shrink: 0; text-transform: uppercase; }
.who .nm { min-width: 0; line-height: 1.2; } .who .nm b { display: block; font-size: 13px; color: var(--g900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .who .nm span { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--g400); }
.side-btns { display: flex; gap: 6px; margin-bottom: 8px; }
.side-btns > * { flex: 1; height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: var(--r-xl); border: 0; background: var(--g50); color: var(--g500); cursor: pointer; font-size: 12px; font-weight: 700; text-decoration: none !important; }
.side-btns > *:hover { background: var(--g100); color: var(--g900); }
#collapse { width: 100%; height: 40px; border: 0; border-radius: var(--r-xl); background: var(--g50); color: var(--g400); cursor: pointer; display: flex; align-items: center; justify-content: center; }
#collapse:hover { background: var(--g100); color: var(--g600); }
.side.collapsed { width: var(--side-w-c); flex-basis: var(--side-w-c); }
.side.collapsed .brand, .side.collapsed .brand-sub, .side.collapsed .nav-item span, .side.collapsed .who .nm, .side.collapsed .side-btns span, .side.collapsed .ver { display: none; }
.side.collapsed .side-logo { justify-content: center; padding: 0; } .side.collapsed .nav-item { justify-content: center; } .side.collapsed .who { justify-content: center; } .side.collapsed .side-btns { flex-direction: column; } .side.collapsed #collapse .ic { transform: rotate(180deg); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { height: 80px; flex-shrink: 0; background: #ffffffcc; backdrop-filter: blur(8px); border-bottom: 1px solid var(--g200); display: flex; align-items: center; gap: 16px; padding: 0 40px; position: relative; z-index: 30; }
.top h2 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.02em; color: var(--g900); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-right { display: flex; align-items: center; gap: 18px; }
#burger { display: none; width: 44px; height: 44px; border: 0; border-radius: var(--r-xl); background: var(--g50); color: var(--g600); cursor: pointer; align-items: center; justify-content: center; }
.search { position: relative; } .search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--g400); }
.search input { width: 256px; background: var(--g50); border: 1px solid var(--g200); border-radius: var(--r-xl) .5rem; border-radius: .5rem; padding: 8px 16px 8px 40px; font-size: 14px; outline: none; transition: box-shadow .15s, border-color .15s; }
.search input:focus { border-color: var(--brand-20); box-shadow: 0 0 0 2px var(--brand-20); }
.lang { display: inline-flex; background: var(--g100); border-radius: var(--r-xl); padding: 3px; gap: 2px; }
.lang button { border: 0; background: transparent; padding: 5px 10px; border-radius: .5rem; font-size: 11px; font-weight: 800; letter-spacing: .06em; color: var(--g500); cursor: pointer; }
.lang button.on { background: #fff; color: var(--brand); box-shadow: var(--shadow-sm); }
#lamps { display: flex; gap: 12px; }
.lamp { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--g400); }
.lamp i { width: 10px; height: 10px; border-radius: 50%; background: var(--g300); } .lamp.ok i { background: #22c55e; box-shadow: 0 0 0 3px #22c55e33; } .lamp.warn i { background: #f59e0b; box-shadow: 0 0 0 3px #f59e0b33; } .lamp.err i { background: #ef4444; box-shadow: 0 0 0 3px #ef444433; }
.content { flex: 1; min-height: 0; overflow: auto; padding: 40px; }
.content > .inner { max-width: 1280px; margin: 0 auto; }

/* ---------------------------------------------------------------- общие компоненты */
.card { background: #fff; border: 1px solid var(--g100); border-radius: var(--r-2xl); box-shadow: var(--shadow-sm); padding: 28px; }
.card.hl { border-color: var(--brand-20); }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.head-row h3 { margin: 0; font-size: 20px; font-weight: 700; color: var(--g900); text-transform: none; letter-spacing: 0; } .head-row p { margin: 4px 0 0; font-size: 14px; color: var(--g500); max-width: 900px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--g200); background: #fff; color: var(--g700); border-radius: var(--r-xl); padding: 8px 18px; font-size: 14px; font-weight: 700; cursor: pointer; transition: box-shadow .15s, background .15s, border-color .15s; text-decoration: none !important; }
.btn:hover { border-color: var(--brand-20); background: var(--g50); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: var(--shadow-lg); } .btn.primary:hover { background: #4130d8; box-shadow: 0 10px 15px -3px #4b39ef4d; }
.btn.danger { color: var(--red); border-color: #fecaca; background: #fff; } .btn.danger:hover { background: var(--red-bg); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: var(--g100); color: var(--g600); white-space: nowrap; }
.pill.ok { background: var(--green-bg); color: var(--green); } .pill.warn { background: var(--amber-bg); color: var(--amber-ink); } .pill.err { background: var(--red-bg); color: var(--red); } .pill.info { background: var(--blue-bg); color: var(--blue); } .pill.acc { background: var(--brand-soft); color: var(--brand); }
.lbl { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--g400); margin: 12px 0 8px; }
.muted { color: var(--g500); }
.stat { text-align: center; position: relative; overflow: hidden; }
.stat .k { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--g400); margin-bottom: 8px; }
.stat .v { font-size: 36px; font-weight: 800; letter-spacing: -.02em; color: var(--g900); line-height: 1.1; } .stat .v small { display: inline-block; margin-left: 12px; font-size: 14px; font-weight: 700; color: #22c55e; background: var(--green-bg); padding: 2px 10px; border-radius: 999px; vertical-align: middle; }
.grid { display: grid; gap: 28px; } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hist { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; height: 200px; padding-top: 16px; }
.hist .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.hist .bar-wrap { width: 100%; max-width: 48px; height: 130px; display: flex; flex-direction: column; justify-content: flex-end; border-radius: 12px 12px 0 0; }
.hist .bar-wrap.empty { background: #eef0ff80; border: 1px solid #e0e7ff; border-bottom: 0; }
.hist .bar { width: 100%; background: #5c4dff; border-radius: 12px 12px 0 0; box-shadow: 0 4px 12px #5c4dff66; min-height: 12px; }
.hist .cnt { font-size: 12px; font-weight: 800; color: var(--g500); margin-bottom: 6px; } .hist .dt { font-size: 10px; font-weight: 700; letter-spacing: .1em; color: var(--g500); margin-top: 14px; text-transform: uppercase; }
.tbl-wrap { background: #fff; border: 1px solid var(--g100); border-radius: var(--r-2xl); box-shadow: var(--shadow-sm); overflow: hidden; overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { padding: 16px 28px; text-align: left; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--g400); background: #f9fafb80; border-bottom: 1px solid var(--g100); white-space: nowrap; }
.tbl td { padding: 18px 28px; border-top: 1px solid var(--g100); vertical-align: middle; font-size: 14px; color: var(--g600); } .tbl tr:first-child td { border-top: 0; }
.tbl tbody tr:hover { background: #f9fafb80; } .tbl tr.click { cursor: pointer; }
.tbl td b { color: var(--g900); } .tbl .sub { font-size: 12px; color: var(--g500); } .tbl .r { text-align: right; }
.ibtn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; background: transparent; border-radius: .5rem; color: var(--g400); cursor: pointer; } .ibtn:hover { color: var(--brand); background: var(--g50); } .ibtn.red:hover { color: var(--red); }
.empty { padding: 48px 20px; text-align: center; color: var(--g400); font-style: italic; font-size: 14px; }
.spinner { width: 48px; height: 48px; border: 3px solid var(--g200); border-bottom-color: var(--brand); border-radius: 50%; animation: sp 1s linear infinite; margin: 60px auto; }
@keyframes sp { to { transform: rotate(360deg); } }
.inp { width: 100%; background: var(--g50); border: 1px solid var(--g200); border-radius: .5rem; padding: 10px 16px; font-size: 14px; outline: none; transition: box-shadow .15s, border-color .15s; }
.inp:focus { border-color: var(--brand-20); box-shadow: 0 0 0 2px var(--brand-20); }
.modal-bg { position: fixed; inset: 0; background: #00000080; display: grid; place-items: center; padding: 16px; z-index: 90; }
.modal-box { background: #fff; border-radius: var(--r-2xl); padding: 24px; width: 100%; max-width: 480px; box-shadow: 0 25px 50px -12px #00000040; }
.modal-box h2 { margin: 0 0 18px; font-size: 20px; font-weight: 900; color: var(--g900); }
.modal-box .row { display: grid; gap: 4px; margin-bottom: 12px; } .modal-box .acts { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
#side-scrim { display: none; }

/* ---------------------------------------------------------------- вход */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; width: 100%; }
.login-card { width: 100%; max-width: 440px; }
.login-card .logo { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; } .login-card .logo img { width: 56px; height: 56px; }
.login-card h1 { margin: 0 0 4px; font-size: 24px; font-weight: 800; color: var(--g900); } .login-card p { margin: 0 0 20px; color: var(--g500); font-size: 14px; }

/* ---------------------------------------------------------------- адаптивность */
.side-foot .rights { text-align: center; font-size: 10px; line-height: 1.3; color: var(--g400); margin: -4px 4px 10px; }
.side.collapsed .rights { display: none; }
@media (max-width: 1100px) {
  .side { width: var(--side-w-c); flex-basis: var(--side-w-c); }
  .side .brand, .side .brand-sub, .side .nav-item span, .side .who .nm, .side .side-btns span, .side .ver { display: none; }
  .side .side-logo { justify-content: center; padding: 0; } .side .nav-item { justify-content: center; } .side .who { justify-content: center; } .side .side-btns { flex-direction: column; }
  #collapse { display: none; }
  .top { padding: 0 24px; } .content { padding: 24px; } .g3 { grid-template-columns: 1fr; } .g2 { grid-template-columns: 1fr; } .search input { width: 180px; }
  #lamps .lamp span { display: none; }
}
@media (max-width: 720px) {
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; flex-basis: auto; transform: translateX(-100%); transition: transform .25s; }
  .side.open { transform: none; box-shadow: var(--shadow-lg); }
  .side.open .brand, .side.open .brand-sub, .side.open .nav-item span, .side.open .who .nm, .side.open .side-btns span, .side.open .ver { display: block; }
  .side.open .nav-item { justify-content: flex-start; } .side.open .side-btns { flex-direction: row; } .side.open .who { justify-content: flex-start; } .side.open .side-logo { justify-content: flex-start; padding: 0 20px; }
  #side-scrim.on { display: block; position: fixed; inset: 0; background: #00000066; z-index: 35; }
  #burger { display: inline-flex; } .top { padding: 0 14px; height: 64px; } .top h2 { font-size: 18px; } .search { display: none; } .content { padding: 14px; }
  .stat .v { font-size: 28px; }
}
@media print { .side, .top, .keys { display: none !important; } .content { padding: 0; } }
