:root{
  --bg:#0b1220;
  --text:#e8eefc;
  --muted:#9fb0d0;
  --line:rgba(255,255,255,0.10);
}
*{ box-sizing:border-box; }
html,body{ height:100%; margin:0; background:var(--bg); color:var(--text); font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Arial; }
.wrap{ max-width:1200px; margin:0 auto; padding:18px; }
.top{ display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:14px; }
.brand{ font-weight:700; letter-spacing:.4px; }
.nav a{ color:var(--muted); text-decoration:none; margin-left:12px; }
.nav a:hover{ color:var(--text); }
.main{ background:rgba(255,255,255,0.03); border:1px solid var(--line); border-radius:10px; padding:16px; }
.foot{ margin-top:14px; color:var(--muted); font-size:12px; }
h1{ margin:0 0 8px 0; font-size:22px; }
.muted{ color:var(--muted); }
.mono{ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }
.table-wrap{ overflow:auto; border:1px solid var(--line); border-radius:10px; }
table{ width:100%; border-collapse:collapse; min-width:1100px; }
th,td{ padding:10px 10px; border-bottom:1px solid var(--line); vertical-align:top; }
th{ text-align:left; color:var(--muted); font-weight:600; background:rgba(255,255,255,0.02); }
.badge{ display:inline-block; padding:2px 8px; border-radius:999px; font-size:12px; border:1px solid var(--line); }
.badge-active{ background:rgba(34,197,94,0.12); }
.badge-inactive{ background:rgba(234,179,8,0.12); }
.badge-deleted{ background:rgba(239,68,68,0.12); }
/* ===== Welcome & Login (v0.1) ===== */

.cover{
  min-height:70vh;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
}

.cover h1{
  font-size:48px;
  margin-bottom:10px;
}

.tagline{
  color:var(--muted);
  margin-bottom:30px;
}

.btn-primary{
  padding:14px 36px;
  border-radius:10px;
  background:#22c55e;
  color:#08130c;
  font-weight:600;
  text-decoration:none;
  border:none;
  cursor:pointer;
}

.login-box{
  max-width:360px;
  margin:60px auto;
  padding:24px;
  border-radius:14px;
  background:rgba(255,255,255,0.05);
  border:1px solid var(--line);
  text-align:center;
}

.login-box input{
  width:100%;
  padding:12px;
  margin:10px 0;
  border-radius:8px;
  border:1px solid var(--line);
  background:#0b1220;
  color:var(--text);
}

.link-back{
  display:inline-block;
  margin-top:12px;
  color:var(--muted);
  text-decoration:none;
}

/* ===== InsightCore v0.1 — Welcome/Login base ===== */

:root{
  --bg-image: url("/static/welcome1.jpg");
  --glass: rgba(10, 14, 22, 0.48);
  --glass-border: rgba(255,255,255,0.12);
  --accent: #22c55e;
}

/* фон */
html,body{
  background:
    linear-gradient(0deg, rgba(0,0,0,0.55), rgba(0,0,0,0.55)),
    var(--bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* бренд слева сверху */
.ic-brand{
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: .4px;
}

/* центрированный экран */
.ic-screen{
  min-height: 100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 72px 16px 28px;
}

.ic-hero{
  width: min(980px, 100%);
  text-align:center;
}

.ic-title{
  font-size: clamp(28px, 4.0vw, 54px);
  font-weight: 900;
  letter-spacing: 0.6px;
  margin: 0;
  text-shadow: 0 10px 40px rgba(0,0,0,0.55);
}

.ic-subtitle{
  margin-top: 10px;
  font-size: 18px;
  color: rgba(255,255,255,0.78);
}

.ic-divider{
  width: min(520px, 92%);
  height: 1px;
  margin: 18px auto;
  background: rgba(255,255,255,0.16);
}

/* кнопка */
.ic-btn{
  display:inline-block;
  padding: 12px 34px;
  border-radius: 14px;
  border: 1px solid rgba(34,197,94,0.35);
  background: linear-gradient(180deg, rgba(34,197,94,0.22), rgba(34,197,94,0.12));
  color: var(--text);
  font-weight: 900;
  text-decoration: none;
}
.ic-btn:hover{
  border-color: rgba(34,197,94,0.48);
  background: linear-gradient(180deg, rgba(34,197,94,0.28), rgba(34,197,94,0.14));
}

/* Welcome tweaks: text up, button down, hide top-left brand */
.no-brand .ic-brand{ display:none; }

.ic-screen-welcome{
  align-items: stretch; /* вместо строгого центра */
}

.ic-screen-welcome .ic-hero{
  display:flex;
  flex-direction:column;
  min-height: calc(100vh - 100px);
}

.ic-screen-welcome .ic-top{
  padding-top: 90px; /* заголовок выше */
}

.ic-screen-welcome .ic-bottom{
  margin-top: auto;         /* прижать к низу */
  padding-bottom: 70px;     /* отступ от нижнего края */
}

/* Login card */
.ic-screen-login{ align-items: center; }

.ic-card{
  width: min(520px, 92vw);
  background: rgba(10, 14, 22, 0.52);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  padding: 18px 18px 16px;
  backdrop-filter: blur(10px);
  box-shadow: 0 24px 90px rgba(0,0,0,0.55);
}

.ic-card-title{
  font-weight: 900;
  letter-spacing: .4px;
  font-size: 18px;
  margin: 2px 0 2px;
}

.ic-card-sub{
  color: rgba(255,255,255,0.72);
  font-size: 13px;
  margin-bottom: 12px;
}

.ic-error{
  margin: 10px 0 6px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(239,68,68,0.35);
  background: rgba(239,68,68,0.10);
  color: rgba(255,255,255,0.92);
  font-size: 13px;
}

.ic-form{ display:flex; flex-direction:column; gap: 10px; }

.ic-label{
  font-size: 12px;
  color: rgba(255,255,255,0.72);
  margin-top: 6px;
}

.ic-input{
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.92);
  padding: 0 12px;
  outline: none;
}

.ic-input:focus{
  border-color: rgba(34,197,94,0.45);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.10);
}

.ic-btn-block{ width: 100%; margin-top: 8px; }

.ic-link{
  display:inline-block;
  margin-top: 10px;
  color: rgba(255,255,255,0.72);
  text-decoration:none;
  font-size: 13px;
}
.ic-link:hover{ color: rgba(255,255,255,0.92); }

/* ===== FORCE: login card lower ===== */
.ic-screen.ic-screen-login{
  min-height: 100vh !important;
  display: flex !important;
  justify-content: center !important; /* горизонталь */
  align-items: flex-end !important;   /* вниз */
  padding-bottom: 2vh !important;    /* отступ от низа */
}

/* если у тебя где-то карточка/экран переопределяются — закрепим */
.ic-screen-login .ic-card{
  margin-bottom: 0 !important;
}

/* ===== Button text centered ===== */
.ic-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
}

.ic-btn-block{
  height: 46px; /* чтобы кнопка выглядела ровно */
}

/* ===== Login card header centering ===== */
.ic-card-header{
  text-align: center;
  margin-bottom: 26px;
}

.ic-card-header .title{
  font-size: 22px;
  font-weight: 600;
  margin: 0;
}

.ic-card-header .subtitle{
  margin-top: 6px;
  font-size: 14px;
  opacity: 0.85;
}

/* немного опускаем карточку вниз */
.ic-card{
  margin-top: 40px;
}

/* ===== FIX LOGIN LAYOUT (center + bottom) ===== */
body.login-page{
  min-height: 100vh;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-bottom: 48px;
  display: flex;
  justify-content: center;   /* центр по X */
  align-items: flex-end;     /* вниз по Y */
  padding-bottom: 12vh;      /* отступ от низа */
}

.login-wrap{
  width: 100%;
  display: flex;
  justify-content: center;
}

.ic-card{
  width: 420px;
  margin: 0 auto;
}

/* ===== InsightCore LOGIN (canonical) ===== */
body.login-page{
  min-height: 100vh;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-bottom: 48px;
  margin: 0;
  display: flex;
  justify-content: center;    /* центр по X */
  align-items: flex-end;      /* вниз по Y */
  padding: 0 18px 20vh 18px;  /* опустить вниз */
}

.login-stage{
  width: 100%;
  display: flex;
  justify-content: center;
}

.login-card{
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 420px;
  padding: 22px;
  align-self: center;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px;
  backdrop-filter: blur(6px);
  padding: 18px 18px 16px 18px;
}

.login-head{
  text-align: center; /* заголовок по центру карточки */
  margin-bottom: 14px;
}

.login-title{
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .2px;
  margin: 0;
}

.login-sub{
  margin-top: 6px;
  font-size: 13px;
  opacity: .85;
}

.login-form{
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.login-label{
  font-size: 13px;
  opacity: .9;
  margin-top: 4px;
}

.login-input{
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(2, 6, 23, 0.35);
  color: rgba(255,255,255,0.92);
  outline: none;
}

.login-input:focus{
  border-color: rgba(34,197,94,0.55);
}

.login-btn{
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 12px;
  font-weight: 800;
  letter-spacing: .6px;
  display: inline-flex;      /* центрируем текст */
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: rgba(34,197,94,0.72);
  color: rgba(255,255,255,0.95);
  margin-top: 6px;
}

.login-back{
  display: inline-block;
  margin-top: 10px;
  text-decoration: none;
  opacity: .9;
}

/* если где-то в проекте есть "общие" стили для input/button — здесь мы их перебиваем */
body.login-page input, body.login-page button{
  min-height: 100vh;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-bottom: 48px;
}

/* =====================================================================
   InsightCore — LOGIN page hard override (fixes "green stretched button")
   ===================================================================== */
body.login-page{
  min-height: 100vh !important;
  display: flex !important;
  justify-content: center !important;
  align-items: flex-end !important;   /* ВНИЗ экрана */
  padding: 0 20px 70px !important;    /* отступ снизу (можно потом менять) */
}

.login-card{
  width: min(560px, 92vw) !important;
  display: block !important;          /* запрещаем flex на карточке */
}

.login-card form{
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
}

.login-card input,
.login-card select{
  height: 44px !important;
}

.login-card button{
  height: 48px !important;
  min-height: 48px !important;
  width: 100% !important;
  display: flex !important;
  align-items: center !important;     /* текст по центру по вертикали */
  justify-content: center !important; /* текст по центру по горизонтали */
  padding: 10px 16px !important;
  flex: 0 0 auto !important;          /* ЗАПРЕТ растяжения */
}


/* ===== LOGIN PAGE FINAL FIX ===== */
body.login-page{
  min-height: 100vh;
  margin: 0;
  display: block !important;
}

/* контейнер всей страницы */
.login-page .page{
  min-height: 100vh;
  position: relative;
}

/* карточка логина */
.login-card{
  position: absolute;
  left: 50%;
  bottom: 70px;              /* <<< ВНИЗ СТРАНИЦЫ */
  transform: translateX(-50%);
  width: min(560px, 92vw);
}

/* форма */
.login-card form{
  display: block;
}

/* поля */
.login-card input{
  height: 44px;
}

/* кнопка */
.login-card button{
  height: 48px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
}


/* ===== LOGIN: bottom-center, no flex tricks ===== */
body.login-page{ min-height:100vh; margin:0; display:block !important; }

body.login-page .page{
  min-height:100vh;
  position:relative;
}

/* ключевой момент: низ страницы */
body.login-page .login-card{
  position:absolute !important;
  left:50% !important;
  bottom:70px !important;
  transform:translateX(-50%) !important;
  width:min(560px, 92vw) !important;
}

/* нормальная кнопка, текст по центру */
body.login-page .login-card button{
  width:100%;
  height:48px;
  display:flex;
  align-items:center;
  justify-content:center;
}


/* ===============================
   LOGIN SCREEN — FINAL, SIMPLE
   =============================== */

body.login-page{
  margin:0;
  min-height:100vh;
  background: url("/static/welcome1.jpg") center / cover no-repeat;
}

/* экран */
.login-screen{
  position:relative;
  min-height:100vh;
}

/* карточка ВНИЗУ ЭКРАНА */
.login-card{
  position:absolute;
  left:50%;
  bottom:60px;
  transform:translateX(-50%);
  width:420px;
  max-width:90vw;

  background:rgba(15,23,42,0.65);
  border:1px solid rgba(255,255,255,0.15);
  border-radius:14px;
  padding:22px;
  color:#e8eefc;
}

/* заголовок */
.login-title h1{
  margin:0;
  text-align:center;
}

.login-title p{
  margin:6px 0 16px;
  text-align:center;
  opacity:.8;
  font-size:14px;
}

/* форма */
.login-card form{
  display:block;
}

.login-card label{
  font-size:13px;
  opacity:.8;
}

.login-card input{
  width:100%;
  height:42px;
  margin:6px 0 14px;
  padding:8px 10px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,0.2);
  background:rgba(255,255,255,0.05);
  color:#fff;
}

/* кнопка */
.login-card button{
  width:100%;
  height:46px;
  border:none;
  border-radius:10px;
  background:linear-gradient(90deg,#22c55e,#16a34a);
  color:#fff;
  font-weight:600;
  cursor:pointer;
}

/* назад */
.login-card .back{
  display:block;
  margin-top:12px;
  font-size:13px;
  color:#9fb0d0;
  text-decoration:none;
}


.page-dark {
  min-height: 100vh;
  background: #0b1220;
}

.login-wrapper {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-bottom: 60px;
}

.login-card {
  width: 420px;
  padding: 24px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}

.login-card label {
  display: block;
  margin-bottom: 14px;
  color: #cbd5e1;
}

.login-card input {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: none;
  background: rgba(255,255,255,.08);
  color: #fff;
}

.btn-primary {
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  border-radius: 10px;
  background: linear-gradient(135deg,#22c55e,#16a34a);
  color: #06210f;
  font-weight: 600;
  border: none;
  cursor: pointer;
}

.back-link {
  display: block;
  margin-top: 12px;
  text-align: center;
  color: #94a3b8;
  text-decoration: none;
}


/* === Shared background (welcome + login) === */
.page-bg {
  position: fixed;
  inset: 0;
  background-image: url(/static/welcome1.jpg);
  background-size: cover;
  background-position: center;
  z-index: -2;
}

.page-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 20, 0.65);
}

/* Login positioning */
.login-wrapper {
  position: relative;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-bottom: 60px;
}


/* --- Engineer Proxmox-like layout (minimal) --- */
.layout{display:flex;min-height:calc(100vh - 0px);gap:14px}
.sidebar{width:290px;background:rgba(0,0,0,.12);border:1px solid rgba(255,255,255,.08);border-radius:14px;padding:12px;position:sticky;top:12px;height:calc(100vh - 24px);overflow:auto}
.sidebar__title{font-weight:700;margin-bottom:10px}
.sidebar__label{font-size:12px;opacity:.75;margin:8px 0}
.tree{font-size:14px;line-height:1.35}
.tree__item{padding:6px 8px;border-radius:10px;opacity:.9}
.tree__item.is-active{background:rgba(255,255,255,.06)}
.tree__child{margin-left:10px;border-left:1px dashed rgba(255,255,255,.12);padding-left:10px;margin-top:6px}
.tree__link{display:block;padding:5px 8px;border-radius:10px;text-decoration:none;color:inherit;opacity:.9}
.tree__link:hover{background:rgba(255,255,255,.06)}

.main{flex:1}
.topbar{display:flex;align-items:center;justify-content:space-between;margin:6px 0 12px 0}
.topbar__title{font-size:18px;font-weight:700}
.topbar__actions{display:flex;gap:8px}

.kpi-row{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:10px}
.kpi{background:rgba(0,0,0,.10);border:1px solid rgba(255,255,255,.08);border-radius:14px;padding:10px}
.kpi__label{font-size:12px;opacity:.75}
.kpi__value{font-size:20px;font-weight:800;margin-top:2px}
.kpi--ok{border-color:rgba(34,197,94,.25)}
.kpi--warn{border-color:rgba(245,158,11,.25)}
.kpi--alarm{border-color:rgba(239,68,68,.25)}

.card{background:rgba(0,0,0,.10);border:1px solid rgba(255,255,255,.08);border-radius:14px;padding:12px}
.card__title{font-weight:700;margin-bottom:6px}

.cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:10px}
.alert-card{display:block;padding:12px;border-radius:14px;border:1px solid rgba(255,255,255,.10);text-decoration:none;color:inherit;background:rgba(255,255,255,.03)}
.alert-card__title{font-weight:700}
.alert-card__meta{opacity:.75;margin-top:4px}
.alert-card__hint{opacity:.6;margin-top:8px;font-size:12px}
.alert-card--warn{border-color:rgba(245,158,11,.35)}
.alert-card--alarm{border-color:rgba(239,68,68,.35)}
.alert-card--nolink{border-color:rgba(156,163,175,.35)}

.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.logbox{background:rgba(0,0,0,.25);border:1px solid rgba(255,255,255,.10);border-radius:12px;padding:10px;min-height:180px;max-height:260px;overflow:auto}

.row-grey{opacity:.7}
.row-warn{background:rgba(245,158,11,.08)}
.row-alarm{background:rgba(239,68,68,.08)}

/* ===== Engineer dashboard: full-width like Proxmox ===== */
body.engineer-page .wrap{
  max-width:none;
  margin:0;
  padding:12px;          /* небольшой аккуратный отступ как у Proxmox */
}
body.engineer-page .main{
  background:transparent; /* чтобы не было лишней "карточки-обертки" */
  border:0;
  padding:0;
}
