:root {
  color: #17211f;
  background: #f3f7f5;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #17211f;
  --muted: #63736f;
  --soft: #f7faf8;
  --line: #dce8e3;
  --brand: #0f766e;
  --brand-dark: #10201d;
  --success-bg: #eaf8f1;
  --danger: #b42318;
  --shadow: 0 22px 60px rgba(23, 33, 31, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 10%, rgba(15, 118, 110, 0.12), transparent 28%),
    linear-gradient(135deg, #f7fbf9 0%, #edf6f2 52%, #f7f2ea 100%);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 850;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: #25332f;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--brand);
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 0.96;
}

h2 {
  margin-bottom: 0;
  color: var(--ink);
  font-size: 1.7rem;
}

h3 {
  margin-bottom: 0;
  color: var(--ink);
  font-size: 1rem;
}

label {
  display: grid;
  gap: 8px;
  color: #40504c;
  font-size: 0.88rem;
  font-weight: 850;
}

input {
  width: 100%;
  border: 1px solid #cbdad5;
  border-radius: 8px;
  padding: 13px 14px;
  color: var(--ink);
  background: #fbfdfc;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

input:focus {
  border-color: var(--brand);
  outline: 4px solid rgba(15, 118, 110, 0.13);
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.72fr);
  overflow: hidden;
  border: 1px solid rgba(16, 32, 29, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.login-copy {
  min-height: 520px;
  display: grid;
  align-content: space-between;
  padding: 36px;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(16, 32, 29, 0.96), rgba(15, 118, 110, 0.9)),
    radial-gradient(circle at 80% 10%, rgba(255, 255, 255, 0.18), transparent 32%);
}

.login-copy h1 {
  max-width: 520px;
  color: #fff;
}

.login-copy p:not(.eyebrow) {
  max-width: 560px;
  color: #d8e9e4;
  line-height: 1.65;
}

.login-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.login-stats span {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  padding: 9px 11px;
  color: #eef8f5;
  font-size: 0.8rem;
  font-weight: 850;
}

.login-panel {
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 36px;
  background: #fff;
}

.login-panel h2 {
  font-size: 2rem;
}

.login-panel button {
  width: 100%;
  min-height: 46px;
  margin-top: 2px;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 16px 30px rgba(15, 118, 110, 0.22);
}

.login-panel button:hover,
.toolbar button:not(.secondary):hover {
  background: #0b625c;
}

.form-status {
  min-height: 22px;
  margin: 0;
  color: var(--danger);
  font-weight: 850;
}

.dashboard-view {
  height: 100vh;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  overflow: hidden;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  color: #fff;
  padding: 22px 16px;
  background:
    linear-gradient(180deg, #10201d 0%, #132b27 52%, #0b1715 100%);
  box-shadow: 12px 0 36px rgba(16, 32, 29, 0.12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.brand.compact {
  margin-bottom: 0;
}

.brand span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #e4f7ef;
  color: var(--brand-dark);
  font-weight: 950;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  letter-spacing: 0;
}

.brand small {
  color: #b8c9c4;
  font-weight: 750;
}

.nav {
  display: grid;
  align-content: start;
  gap: 7px;
}

.nav button {
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  min-height: 42px;
  background: transparent;
  color: #dbe7e3;
  padding: 11px 12px;
  text-align: left;
}

.nav button::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 10px;
  border-radius: 999px;
  background: rgba(219, 231, 227, 0.38);
}

.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.nav button.active::before {
  background: #8de0c3;
  box-shadow: 0 0 0 4px rgba(141, 224, 195, 0.13);
}

.sidebar-note {
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  padding: 13px;
}

.sidebar-note span,
.sidebar-note strong {
  display: block;
}

.sidebar-note span {
  color: #b8c9c4;
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sidebar-note strong {
  margin-top: 5px;
  color: #fff;
  font-size: 0.92rem;
}

.content {
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 28px;
}

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

.topbar h1 {
  font-size: clamp(2rem, 3vw, 2.7rem);
}

.toolbar {
  display: flex;
  align-items: end;
  gap: 9px;
}

.toolbar button {
  min-height: 42px;
  background: var(--brand);
  color: #fff;
  padding: 10px 15px;
  box-shadow: 0 12px 22px rgba(15, 118, 110, 0.13);
}

.toolbar button.secondary {
  background: #fff;
  color: #25332f;
  box-shadow: none;
}

.status-pill {
  align-self: end;
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #566662;
  padding: 0 13px;
  font-weight: 950;
  box-shadow: 0 10px 24px rgba(23, 33, 31, 0.05);
}

.status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #a6b4b0;
}

.status-pill[data-state="live"] {
  border-color: #b9e6d6;
  background: var(--success-bg);
  color: var(--brand);
}

.status-pill[data-state="live"]::before {
  background: var(--brand);
}

.status-pill[data-state="offline"] {
  border-color: #f1c5bf;
  background: #fff4f2;
  color: var(--danger);
}

.status-pill[data-state="offline"]::before {
  background: var(--danger);
}

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 13px;
}

.metric,
.chart-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 34px rgba(23, 33, 31, 0.06);
}

.metric {
  position: relative;
  overflow: hidden;
  padding: 17px;
}

.metric::after {
  content: "";
  position: absolute;
  inset: auto 16px 0 16px;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, var(--brand), #7fcdb4);
  opacity: 0.75;
}

.metric span {
  color: #5f706c;
  font-size: 0.82rem;
  font-weight: 850;
}

.metric strong {
  display: block;
  margin-top: 9px;
  color: var(--ink);
  font-size: 1.9rem;
  line-height: 1;
}

.metric small {
  display: block;
  margin-top: 6px;
  color: #6d7b77;
  font-weight: 760;
}

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

.chart-card {
  padding: 17px;
}

.chart-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.chart-head h3 {
  margin: 0 0 5px;
}

.chart-head p {
  margin: 0;
  color: #667873;
  font-size: 0.9rem;
  line-height: 1.45;
}

.chart-head strong {
  color: var(--brand);
  font-size: 1.75rem;
}

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

.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #2d3d39;
  font-size: 0.88rem;
  font-weight: 850;
}

.bar-track {
  height: 10px;
  margin-top: 7px;
  border-radius: 999px;
  background: #edf3f1;
  overflow: hidden;
}

.bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #6cc7ad);
}

.panel {
  margin-top: 16px;
  overflow: hidden;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 17px;
  border-bottom: 1px solid #e8efec;
  background: linear-gradient(180deg, #fff, #f9fcfb);
}

.panel-head p {
  margin: 0;
  color: #63736f;
  font-weight: 850;
}

.records {
  overflow: auto;
}

table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid #edf2f0;
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  font-size: 0.9rem;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fbfa;
  color: #50605c;
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

td {
  color: #25332f;
}

tbody tr:hover {
  background: #f8fbfa;
}

code {
  white-space: nowrap;
  color: #0b625c;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.mini-button {
  min-height: 30px;
  border: 1px solid #cfe0da;
  background: #f3faf7;
  color: #0b625c;
  padding: 6px 9px;
  font-size: 0.78rem;
  box-shadow: none;
}

.mini-button.danger {
  border-color: #f1c5bf;
  background: #fff4f2;
  color: var(--danger);
}

.mini-button:disabled {
  cursor: default;
  opacity: 0.5;
}

.empty {
  padding: 24px 17px;
  color: #5c6e69;
  font-weight: 850;
}

.empty.error {
  color: var(--danger);
}

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

  .login-copy {
    min-height: 340px;
  }

  .dashboard-view {
    height: auto;
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .sidebar {
    position: static;
    height: auto;
    overflow: visible;
  }

  .content {
    height: auto;
    overflow: visible;
  }

  .nav {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .sidebar-note {
    display: none;
  }

  .charts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .login-view,
  .content {
    padding: 18px;
  }

  .login-copy,
  .login-panel {
    padding: 24px;
  }

  .topbar {
    display: grid;
  }

  .toolbar {
    display: grid;
    width: 100%;
  }

  .status-pill,
  .toolbar button {
    width: 100%;
    justify-content: center;
  }
}
