﻿:root {
  color-scheme: dark;
  --bg: #071016;
  --panel: #0d1820;
  --panel-2: #111f2a;
  --line: rgba(255,255,255,.11);
  --text: #eef7ff;
  --muted: #8ea3b2;
  --accent: #35d0a1;
  --accent-2: #5aa7ff;
  --danger: #ff6b6b;
  --warn: #ffd166;
  --shadow: 0 24px 80px rgba(0,0,0,.38);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(130deg, rgba(53,208,161,.12), transparent 32%),
    linear-gradient(300deg, rgba(90,167,255,.11), transparent 34%),
    var(--bg);
  color: var(--text);
}

button, input, select { font: inherit; }
button {
  border: 0;
  border-radius: 8px;
  min-height: 42px;
  padding: 0 16px;
  color: #03120f;
  background: linear-gradient(135deg, var(--accent), #9af6d5);
  cursor: pointer;
  font-weight: 800;
}
button.secondary { background: #1b2d39; color: var(--text); border: 1px solid var(--line); }
button.danger { background: rgba(255,107,107,.16); color: #ffb3b3; border: 1px solid rgba(255,107,107,.3); }
button:disabled { opacity: .55; cursor: not-allowed; }

input, select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: rgba(255,255,255,.055);
  outline: none;
}
select {
  color-scheme: dark;
  background-color: #111f2a;
  color: var(--text);
}
select option {
  background-color: #111f2a;
  color: var(--text);
}
select option:checked,
select option:hover {
  background-color: #173244;
  color: var(--text);
}
input:focus, select:focus { border-color: rgba(53,208,161,.7); box-shadow: 0 0 0 3px rgba(53,208,161,.12); }
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }

.shell { min-height: 100vh; }
.login-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 440px);
  align-items: center;
  gap: 48px;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}
.brand-panel h1 { margin: 24px 0 10px; font-size: clamp(40px, 7vw, 88px); line-height: .95; letter-spacing: 0; }
.brand-panel p { color: var(--muted); font-size: 19px; max-width: 520px; }
.brand-mark {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #061016;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: var(--shadow);
}
.brand-logo-wrap {
  background: rgba(255,255,255,.92);
  padding: 10px;
  overflow: hidden;
}
.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.login-card, .panel {
  background: rgba(13,24,32,.82);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.login-card {
  display: grid;
  gap: 18px;
  padding: 28px;
}
.login-card h2 { margin: 3px 0 0; font-size: 26px; }
.eyebrow { color: var(--accent); font-size: 12px; text-transform: uppercase; font-weight: 900; letter-spacing: .08em; }
.error { min-height: 20px; color: #ffb3b3; margin: 0; font-size: 13px; }

.app-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}
.sidebar {
  border-right: 1px solid var(--line);
  background: rgba(7,16,22,.7);
  padding: 22px;
  display: grid;
  align-content: start;
  gap: 22px;
}
.sidebar .brand { display: flex; align-items: center; gap: 12px; font-weight: 900; }
.sidebar-logo-wrap {
  width: 54px;
  height: 54px;
  padding: 6px;
  box-shadow: 0 12px 34px rgba(0,0,0,.28);
}
.nav { display: grid; gap: 8px; }
.nav button {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
}
.nav button.active, .nav button:hover { background: rgba(255,255,255,.06); color: var(--text); border-color: var(--line); }
.main { padding: 28px; }
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}
.topbar h1 { margin: 0; font-size: 30px; }
.user-chip { color: var(--muted); font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17,31,42,.78);
  padding: 18px;
  display: grid;
  gap: 14px;
}
.card h3 { margin: 0; font-size: 20px; }
.meta { color: var(--muted); font-size: 13px; display: grid; gap: 3px; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 900; text-transform: uppercase; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.online .dot { background: var(--accent); box-shadow: 0 0 18px rgba(53,208,161,.8); }
.offline .dot { background: var(--danger); }
.unknown .dot { background: var(--warn); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 16px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
.equipment-table { min-width: 1180px; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
.table-wrap input,
.table-wrap select {
  min-width: 130px;
}
.equipment-table td:nth-child(4) input,
.equipment-table td:nth-child(5) input {
  min-width: 220px;
}
.equipment-table button {
  min-width: 92px;
}
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.permissions-block {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.035);
}
.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-right: 12px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}
.inline-check input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--accent);
}
.table-wrap input[type="password"] {
  min-width: 150px;
  margin-bottom: 8px;
}
.hidden { display: none !important; }

@media (max-width: 760px) {
  .login-view { grid-template-columns: 1fr; gap: 24px; padding: 30px 0; }
  .brand-panel h1 { font-size: 44px; }
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 5; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav { grid-template-columns: repeat(3, 1fr); }
  .main { padding: 18px; }
  .topbar { align-items: flex-start; flex-direction: column; }
}
