:root {
  --optima-primary: #0f4c5c;
  --optima-accent: #9a6a28;
  --optima-bg: #f4f6f7;
  --optima-ink: #1f2933;
}

body {
  background: var(--optima-bg);
  color: var(--optima-ink);
  min-width: 0;
}

.app-nav {
  background: var(--optima-primary);
}

.app-nav .navbar-brand,
.app-nav .nav-link {
  color: #fff;
}

.app-nav .nav-link:hover {
  color: #d8e8ec;
}

.nav-brand-logo {
  display: block;
  height: 30px;
  max-width: 154px;
  object-fit: contain;
  background: #fff;
  border-radius: 4px;
  padding: 3px 6px;
}

.app-shell {
  max-width: 1320px;
  padding: 28px 20px 48px;
}

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

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #123f4b;
  color: #fff;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.side-brand {
  padding: 18px 18px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.side-brand-logo {
  display: block;
  width: 100%;
  max-width: 184px;
  height: auto;
  background: #fff;
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 9px;
}

.side-brand-main {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.1;
}

.side-brand-sub,
.side-user {
  color: #c9d9de;
  font-size: 0.82rem;
}

.side-user {
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.side-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.side-section {
  color: #9fb6be;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  margin: 14px 8px 6px;
  text-transform: uppercase;
}

.side-link,
.side-logout {
  display: block;
  width: 100%;
  border-radius: 6px;
  color: #eef7f9;
  font-size: 0.92rem;
  line-height: 1.2;
  padding: 9px 10px;
  text-decoration: none;
}

.side-link:hover,
.side-link:focus {
  background: #1d5968;
  color: #fff;
}

.side-logout {
  margin: 10px;
  width: auto;
  background: #f8fafc;
  color: #123f4b;
  font-weight: 700;
  text-align: center;
}

.side-logout:hover,
.side-logout:focus {
  background: #dce8ec;
  color: #0b3039;
}

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

.mobile-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #123f4b;
  color: #fff;
  padding: 10px 12px;
}

.mobile-brand-logo {
  display: block;
  height: 28px;
  max-width: 142px;
  object-fit: contain;
  background: #fff;
  border-radius: 4px;
  padding: 3px 6px;
}

.app-offcanvas {
  background: #123f4b;
  color: #fff;
}

.app-offcanvas .btn-close {
  opacity: 1;
}

.auth-panel {
  max-width: 420px;
  margin: 8vh auto 0;
  padding: 28px;
  background: #fff;
  border: 1px solid #dce3e6;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(15, 76, 92, 0.08);
}

.auth-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.auth-logo {
  display: block;
  width: min(260px, 100%);
  height: auto;
}

.page-heading {
  margin-bottom: 18px;
}

.page-heading h1 {
  font-size: 1.75rem;
  margin-bottom: 4px;
}

.page-heading p {
  color: #667782;
  margin-bottom: 0;
}

.with-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.content-panel,
.metric-card {
  background: #fff;
  border: 1px solid #dce3e6;
  border-radius: 8px;
  padding: 18px;
}

.metric-label {
  color: #667782;
  font-size: 0.9rem;
  text-transform: capitalize;
}

.metric-value {
  font-size: 1.8rem;
  font-weight: 700;
  margin-top: 8px;
}

.btn-primary {
  background: var(--optima-primary);
  border-color: var(--optima-primary);
}

.btn-primary:hover {
  background: #0b3e4b;
  border-color: #0b3e4b;
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 8px;
}

.status-dot.ok {
  background: #16825d;
}

.status-dot.off {
  background: #a1aab2;
}

.invalid-hint {
  color: #b42318;
  font-size: 0.875rem;
  margin-top: 4px;
}

.detail-label {
  color: #667782;
  font-size: 0.85rem;
  margin-bottom: 2px;
}

.timeline-item {
  border-left: 3px solid var(--optima-primary);
  padding: 0 0 14px 12px;
  margin-left: 4px;
}

@media (max-width: 768px) {
  .app-layout {
    display: block;
  }

  .app-sidebar {
    display: none;
  }

  .mobile-topbar {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 1020;
  }

  .app-content {
    padding: 18px 14px 40px;
  }

  .with-actions {
    align-items: stretch;
    flex-direction: column;
  }
}
