:root {
  --bg-0: #040b16;
  --bg-1: #091729;
  --bg-2: #10243b;
  --glass: rgba(12, 28, 49, 0.74);
  --glass-strong: rgba(10, 24, 43, 0.9);
  --line: rgba(159, 215, 255, 0.17);
  --line-soft: rgba(159, 215, 255, 0.08);
  --txt: #eaf3ff;
  --muted: #98acc3;
  --accent: #67b8ff;
  --accent-2: #4ce1d4;
  --ok: #56d7bb;
  --warn: #f0be66;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  color: var(--txt);
  background:
    radial-gradient(1200px 600px at -10% -20%, #1b3760 0%, transparent 55%),
    radial-gradient(1000px 520px at 110% -10%, #0f3352 0%, transparent 50%),
    linear-gradient(155deg, var(--bg-0), var(--bg-1), var(--bg-2));
  font-family: "Segoe UI", "SF Pro Display", Tahoma, sans-serif;
}

.app-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
}

.sidebar {
  position: relative;
  border-right: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(7, 19, 35, 0.96), rgba(7, 18, 32, 0.9));
  backdrop-filter: blur(8px);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 16px;
}

.brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.brand h1 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.brand p {
  margin: 1px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu a {
  color: var(--txt);
  text-decoration: none;
  border: 1px solid transparent;
  padding: 10px 11px;
  border-radius: 10px;
  font-size: 0.92rem;
  background: rgba(255, 255, 255, 0.02);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.menu a:hover {
  border-color: var(--line);
  background: rgba(103, 184, 255, 0.08);
}

.menu a.active {
  border-color: rgba(103, 184, 255, 0.45);
  background: linear-gradient(135deg, rgba(103, 184, 255, 0.18), rgba(76, 225, 212, 0.12));
  color: #ffffff;
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 12px;
}

.settings-btn {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  color: #d7e8fb;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
}

.main {
  padding: 20px;
}

.glass {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--glass);
  box-shadow: 0 20px 42px rgba(3, 7, 15, 0.45);
  backdrop-filter: blur(12px);
  padding: 20px;
}

.page-title {
  margin: 0;
  font-size: 1.3rem;
}

.page-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.kpi {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
}

.kpi .value {
  font-size: 1.28rem;
  font-weight: 700;
}

.kpi .label {
  font-size: 0.84rem;
  color: var(--muted);
}

.cards {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.card {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  padding: 12px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.inline-row {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tag {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(103, 184, 255, 0.34);
  background: linear-gradient(135deg, rgba(103, 184, 255, 0.2), rgba(76, 225, 212, 0.13));
  color: #d5ecff;
  font-size: 0.8rem;
}

.status {
  display: inline-block;
  font-size: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
}

.status.planned {
  color: var(--warn);
}

.status.in-progress {
  color: var(--accent);
}

.status.done {
  color: var(--ok);
}

select,
button,
input {
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--txt);
  padding: 8px 10px;
  font-size: 0.9rem;
}

select option {
  background: #0d1f34;
  color: var(--txt);
}

button {
  border: 0;
  background: linear-gradient(135deg, #2f9dd8, #3d76dd);
  cursor: pointer;
  font-weight: 600;
}

.checkline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--txt);
}

.small-note {
  color: var(--muted);
  font-size: 0.84rem;
}

.monitoring-head {
  justify-content: space-between;
  align-items: flex-start;
}

.monitoring-grid {
  margin-top: 16px;
}

.monitor-shell {
  border-radius: 18px;
}

.monitor-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.monitor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.health-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 6px 10px;
  font-size: 0.78rem;
  color: #cfe8ff;
  background: rgba(255, 255, 255, 0.03);
}

.health-pill.ok {
  border-color: rgba(86, 215, 187, 0.45);
  color: #b8f4e5;
  background: rgba(86, 215, 187, 0.1);
}

.health-pill.bad {
  border-color: rgba(255, 122, 146, 0.45);
  color: #ffd0d8;
  background: rgba(255, 122, 146, 0.12);
}

.monitor-kpis {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.kpi-card {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.kpi-card .value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #f2f8ff;
}

.kpi-card .label {
  margin-top: 4px;
  font-size: 0.8rem;
  color: rgba(235, 245, 255, 0.8);
}

.kpi-blue {
  background: linear-gradient(135deg, rgba(58, 118, 219, 0.55), rgba(38, 89, 191, 0.35));
}

.kpi-purple {
  background: linear-gradient(135deg, rgba(133, 86, 219, 0.54), rgba(94, 61, 176, 0.34));
}

.kpi-green {
  background: linear-gradient(135deg, rgba(40, 171, 128, 0.55), rgba(27, 124, 95, 0.34));
}

.kpi-cyan {
  background: linear-gradient(135deg, rgba(41, 161, 210, 0.56), rgba(29, 124, 173, 0.34));
}

.monitor-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.monitor-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
}

.metric-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.metric-list li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.88rem;
  background: rgba(255, 255, 255, 0.02);
}

.metric-list li span {
  color: var(--muted);
}

.metric-list li strong {
  color: #d6ebff;
  text-align: right;
}

input[type="text"],
input[type="number"] {
  min-width: 180px;
}

pre {
  margin: 0;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, 0.22);
  color: #bdd7ee;
  font-size: 0.8rem;
  overflow: auto;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-theme {
  position: relative;
  overflow: hidden;
}

.login-theme::before,
.login-theme::after {
  content: "";
  position: absolute;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

.login-theme::before {
  top: -120px;
  left: -140px;
  background: rgba(53, 122, 186, 0.35);
}

.login-theme::after {
  bottom: -150px;
  right: -120px;
  background: rgba(48, 176, 166, 0.26);
}

.login-shell {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.login-brand-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  background:
    linear-gradient(145deg, rgba(18, 42, 72, 0.9), rgba(9, 26, 48, 0.78));
  box-shadow: 0 22px 60px rgba(2, 8, 18, 0.48);
}

.login-brand-icon {
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin-bottom: 14px;
}

.login-kicker {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8fd0ff;
}

.login-brand-panel h1 {
  margin: 10px 0 8px;
  font-size: clamp(1.55rem, 2vw, 2rem);
}

.login-brand-panel p {
  margin: 0;
  color: #b7cfe7;
  line-height: 1.5;
}

.login-badges {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.login-badges span {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(159, 215, 255, 0.26);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.78rem;
  color: #d8ecff;
}

.login-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--glass-strong);
  box-shadow: 0 22px 46px rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(10px);
  padding: 28px;
}

.login-card h2 {
  margin: 0 0 8px;
  font-size: 1.4rem;
}

.login-card p {
  margin: 0 0 14px;
  color: var(--muted);
}

.field {
  margin-bottom: 12px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  color: #d8e7f8;
  font-size: 0.86rem;
}

.msg {
  min-height: 20px;
  margin-top: 10px;
  font-size: 0.88rem;
}

.msg.ok {
  color: var(--ok);
}

.msg.err {
  color: #ff7a92;
}

.logout-btn {
  margin-top: 12px;
}

@media (max-width: 980px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .kpi-grid,
  .cards {
    grid-template-columns: 1fr;
  }

  .monitor-kpis,
  .monitor-grid-3 {
    grid-template-columns: 1fr;
  }

  .monitor-topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }
}
