* { box-sizing: border-box; }

:root {
  --bg: #eaf6e8;
  --card: #ffffff;
  --soft: #f6fbf5;
  --text: #142116;
  --muted: #64736a;
  --line: #dcebdd;
  --green: #166534;
  --green-bg: #dcfce7;
  --orange: #c2410c;
  --orange-bg: #ffedd5;
  --red: #991b1b;
  --red-bg: #fee2e2;
  --blue: #1d4ed8;
  --blue-bg: #e8f1ff;
  --dark: #143c20;
  --shadow: 0 18px 42px rgba(20, 80, 40, 0.12);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(41, 133, 63, 0.18), transparent 30%),
    radial-gradient(circle at 90% 8%, rgba(174, 220, 140, 0.22), transparent 28%),
    linear-gradient(135deg, #eef8ed 0%, var(--bg) 100%);
}

.app-shell {
  display: grid;
  grid-template-columns: 282px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px;
  border-right: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.66);
  backdrop-filter: blur(10px);
  box-shadow: 12px 0 38px rgba(20, 80, 40, 0.08);
}

.content {
  min-width: 0;
  padding: 24px;
}

.brand-block { margin-bottom: 18px; }

.brand {
  display: inline-flex;
  align-items: center;
  padding: 9px 16px;
  border-radius: 999px;
  background: #1f7a3a;
  color: white;
  font-weight: 850;
  box-shadow: 0 10px 24px rgba(31, 122, 58, 0.24);
}

.brand-subtitle {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.role-card {
  padding: 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid #e4efe4;
  margin-bottom: 18px;
}

.role-label {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 4px;
}

.role-value {
  font-size: 20px;
  font-weight: 850;
  color: var(--dark);
}

.side-nav {
  display: grid;
  gap: 8px;
}

.side-nav button,
.logout-btn {
  width: 100%;
  text-align: left;
  border: 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  color: #38513e;
  font-weight: 850;
  cursor: pointer;
}

.side-nav button.active {
  background: var(--dark);
  color: white;
}

.side-nav button[hidden] { display: none; }

.logout-btn {
  margin-top: 14px;
  color: var(--red);
  background: var(--red-bg);
  display: none;
}

.logout-btn.visible { display: block; }

.panel { display: none; }
.panel.active { display: block; }

.card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 28px;
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  max-width: 1180px;
}

.card + .card { margin-top: 16px; }

.hero-card {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.94), rgba(240,249,238,0.92)),
    radial-gradient(circle at 80% 0%, rgba(31,122,58,0.14), transparent 35%);
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.compact-top { margin-bottom: 12px; }

.eyebrow {
  color: var(--green);
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

h1 {
  margin: 0 0 6px;
  font-size: 28px;
  letter-spacing: -0.03em;
  line-height: 1.14;
}

h2 {
  margin: 0 0 14px;
  font-size: 20px;
}

.sub, p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.badge {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

.online { background: var(--green-bg); color: var(--green); }
.offline { background: var(--red-bg); color: var(--red); }
.warning-badge { background: var(--orange-bg); color: var(--orange); }
.info-badge { background: var(--blue-bg); color: var(--blue); }

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.metric {
  min-height: 116px;
  border-radius: 22px;
  background: var(--soft);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid #edf4ea;
}

.label {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 14px;
}

.value {
  font-size: 31px;
  line-height: 1.05;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.value.small { font-size: 24px; }
.normal { color: var(--green); }
.warning { color: var(--orange); }
.danger { color: var(--red); }

.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.list { display: grid; gap: 12px; }

.row-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border-radius: 20px;
  background: var(--soft);
  border: 1px solid #edf4ea;
}

.row-title {
  margin-bottom: 5px;
  font-size: 18px;
  font-weight: 850;
}

.row-desc {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.process-line {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 12px;
  align-items: stretch;
}

.process-step {
  border-radius: 20px;
  background: var(--soft);
  border: 1px solid #edf4ea;
  padding: 16px;
}

.process-step strong {
  display: block;
  margin-bottom: 8px;
}

.process-step span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.process-arrow {
  display: flex;
  align-items: center;
  color: var(--green);
  font-size: 26px;
  font-weight: 850;
}

.docs-grid, .split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.box {
  background: var(--soft);
  border: 1px solid #edf4ea;
  border-radius: 20px;
  padding: 16px;
}

.box strong {
  display: block;
  margin-bottom: 12px;
  font-size: 17px;
}

.login-card {
  max-width: 680px;
}

.login-box {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  max-width: 420px;
}

.input-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #d8e6d8;
  background: white;
  color: var(--text);
  font-weight: 700;
  outline: none;
}

textarea {
  min-height: 76px;
  resize: vertical;
  margin-top: 10px;
}

.status-text {
  color: var(--muted);
  font-size: 14px;
}

.system-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.system-summary div {
  border-radius: 18px;
  background: var(--soft);
  border: 1px solid #edf4ea;
  padding: 14px;
}

.system-summary span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.system-summary strong {
  font-size: 17px;
}

.field {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.btn {
  border: 0;
  padding: 11px 14px;
  border-radius: 14px;
  background: var(--dark);
  color: white;
  font-weight: 850;
  cursor: pointer;
}

.btn.secondary {
  background: white;
  color: var(--dark);
  border: 1px solid #d8e6d8;
}

.btn.warning {
  background: var(--orange-bg);
  color: var(--orange);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 18px;
  margin-top: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--soft);
}

th, td {
  padding: 12px 14px;
  border-bottom: 1px solid #e3eee1;
  text-align: left;
  font-size: 14px;
  white-space: nowrap;
}

th { color: var(--muted); font-weight: 850; }
td { font-weight: 700; }

.event {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--soft);
  border: 1px solid #edf4ea;
}

.event-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #94a3b8;
}

.event-dot.success { background: var(--green); }
.event-dot.warning { background: var(--orange); }
.event-dot.danger { background: var(--red); }

.event-title { font-weight: 850; margin-bottom: 4px; }
.event-message { color: var(--muted); font-size: 14px; line-height: 1.4; }
.event-time { color: var(--muted); font-size: 13px; white-space: nowrap; }

.sparkline {
  width: 100%;
  height: 170px;
  background: var(--soft);
  border: 1px solid #edf4ea;
  border-radius: 22px;
  padding: 10px;
}

.preset-description { margin-top: 12px; }

.preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.preset-card {
  border-radius: 20px;
  background: var(--soft);
  border: 1px solid #edf4ea;
  padding: 16px;
}

.preset-card.active {
  border-color: rgba(22, 101, 52, 0.45);
  box-shadow: 0 10px 26px rgba(22, 101, 52, 0.12);
}

.preset-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.preset-name { font-weight: 850; font-size: 17px; }
.preset-text { color: var(--muted); font-size: 14px; line-height: 1.45; }
.preset-params { display: grid; gap: 6px; margin-top: 12px; color: var(--muted); font-size: 13px; }

.settings-split { margin-top: 14px; }

.links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.links a {
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 14px;
  color: var(--dark);
  background: white;
  border: 1px solid #d8e6d8;
  font-weight: 850;
  font-size: 14px;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,0.72);
  }

  .side-nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .side-nav button {
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
  }

  .content { padding: 14px; }

  .grid,
  .docs-grid,
  .split,
  .system-summary,
  .preset-grid,
  .process-line {
    grid-template-columns: 1fr;
  }

  .process-arrow { display: none; }

  .top,
  .row-card,
  .event,
  .preset-head {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .card {
    border-radius: 22px;
    padding: 18px;
  }

  h1 { font-size: 22px; }
  h2 { font-size: 18px; }
  .value { font-size: 28px; }
  .field { grid-template-columns: 1fr; }
  th, td { padding: 10px 12px; font-size: 13px; }
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
  background: linear-gradient(135deg, #1e7a3e 0%, #0f4f29 100%);
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(23, 84, 46, 0.18);
}

.sidebar-brand__logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  padding: 6px;
}

.sidebar-brand__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-brand__title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
  color: #ffffff;
}

.sidebar-brand__subtitle {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
