:root {
  --navy: #071b34;
  --midnight: #0b2746;
  --ink: #102033;
  --muted: #65748a;
  --line: #dce6ef;
  --soft: #f5f9fc;
  --teal: #15b8c5;
  --cyan: #38d5d5;
  --success: #168a5b;
  --warning: #b7791f;
  --danger: #c2414b;
  --white: #ffffff;
  --shadow: 0 18px 55px rgba(7, 27, 52, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(20px, 5vw, 72px);
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(220, 230, 239, 0.8);
  backdrop-filter: blur(14px);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.logo img {
  width: 160px;
  max-width: 42vw;
}

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

.nav a:hover {
  color: var(--navy);
}

.button,
button {
  border: 0;
  border-radius: 8px;
  padding: 11px 16px;
  background: var(--navy);
  color: var(--white);
  cursor: pointer;
  font-weight: 700;
  min-height: 42px;
}

.button.secondary,
button.secondary {
  color: var(--navy);
  background: #e8f7f8;
}

.button.ghost,
button.ghost {
  color: var(--navy);
  background: transparent;
  border: 1px solid var(--line);
}

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

.hero {
  min-height: 78vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  padding: clamp(48px, 8vw, 96px) clamp(20px, 5vw, 72px) 42px;
  background:
    linear-gradient(135deg, rgba(7, 27, 52, 0.96), rgba(10, 107, 120, 0.9)),
    radial-gradient(circle at 80% 10%, rgba(56, 213, 213, 0.25), transparent 32%);
  color: var(--white);
}

.hero h1 {
  margin: 0;
  max-width: 780px;
  font-size: clamp(40px, 7vw, 76px);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero p {
  max-width: 660px;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(17px, 2vw, 22px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-visual {
  display: grid;
  gap: 14px;
}

.status-panel,
.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.status-panel {
  color: var(--ink);
  padding: 20px;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.metric {
  padding: 14px;
  border-radius: 8px;
  background: #f4fbfc;
}

.metric strong {
  display: block;
  font-size: 24px;
  color: var(--navy);
}

.section {
  padding: 74px clamp(20px, 5vw, 72px);
  background: var(--white);
}

.section.alt {
  background: var(--soft);
}

.section h2 {
  margin: 0 0 12px;
  color: var(--navy);
  font-size: clamp(28px, 4vw, 44px);
}

.section > p {
  max-width: 740px;
  color: var(--muted);
  font-size: 18px;
}

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

.card {
  padding: 22px;
}

.card h3 {
  margin: 0 0 8px;
  color: var(--navy);
}

.card p {
  margin: 0;
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  color: #07505b;
  background: #dff8fa;
  font-size: 13px;
  font-weight: 700;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  background: var(--navy);
  color: var(--white);
  overflow: auto;
}

.sidebar .logo img {
  filter: brightness(0) invert(1);
}

.side-nav {
  display: grid;
  gap: 7px;
  margin-top: 28px;
}

.side-nav button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 10px 12px;
  color: rgba(255, 255, 255, 0.78);
  background: transparent;
  border: 1px solid transparent;
}

.side-nav button.active,
.side-nav button:hover {
  color: var(--white);
  background: rgba(56, 213, 213, 0.13);
  border-color: rgba(56, 213, 213, 0.25);
}

.main {
  min-width: 0;
  padding: 26px clamp(16px, 3vw, 38px);
}

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

.topbar h1 {
  margin: 0;
  color: var(--navy);
}

.user-chip {
  color: var(--muted);
  font-size: 14px;
}

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

.panel {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-header h2 {
  margin: 0;
  color: var(--navy);
  font-size: 22px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

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

th,
td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.status {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef4f8;
  color: var(--navy);
  font-weight: 700;
  font-size: 12px;
}

.status.active,
.status.live,
.status.connected,
.status.enabled {
  background: #ddf7ec;
  color: var(--success);
}

.status.warning,
.status.pending,
.status.open {
  background: #fff4db;
  color: var(--warning);
}

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

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: var(--white);
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #071b34, #0a6b78);
}

.auth-box {
  width: min(460px, 100%);
  padding: 28px;
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.tabs {
  display: flex;
  gap: 8px;
  margin: 22px 0;
}

.tabs button {
  flex: 1;
}

.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  max-width: min(420px, calc(100vw - 36px));
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--navy);
  color: var(--white);
  box-shadow: var(--shadow);
}

@media (max-width: 900px) {
  .nav {
    display: none;
  }

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

  .grid,
  .dashboard-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

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

  .side-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-actions,
  .topbar,
  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-row,
  .side-nav {
    grid-template-columns: 1fr;
  }
}
