.app-body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f2f5f9;
  color: #081029;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.app-sidebar {
  background: linear-gradient(180deg, #1d2738 0%, #101826 100%);
  color: #cdd7f2;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  font-size: 15px;
  letter-spacing: 0.08em;
  font-weight: 600;
  line-height: 1.3;
  color: #ffffff;
  margin-bottom: 40px;
  text-transform: uppercase;
}

.sidebar-logo {
  display: inline-block;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: inherit;
  border-radius: 12px;
  text-decoration: none;
  background: transparent;
  transition: background 0.2s, color 0.2s;
}

.sidebar-link .icon {
  font-size: 18px;
  opacity: 0.8;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.sidebar-link.is-active {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-weight: 600;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
  display: grid;
  place-items: center;
  font-weight: 600;
  color: #ffffff;
}

.user-name {
  color: #ffffff;
  font-weight: 600;
  font-size: 15px;
}

.user-role {
  color: rgba(205, 215, 242, 0.7);
  font-size: 13px;
}

.logout-link {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  text-decoration: none;
  align-self: flex-start;
}

.logout-link:hover {
  text-decoration: underline;
}

.app-main {
  padding: 32px 40px;
  display: flex;
  flex-direction: column;
}

.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.main-title {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
  color: #0f1c3f;
}

.main-content {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.filter-bar select,
.filter-bar button {
  border-radius: 12px;
  border: 1px solid #d6ddea;
  padding: 10px 14px;
  font-size: 14px;
  background-color: #ffffff;
  color: #1e2a46;
}

.filter-bar button {
  background: #2563eb;
  color: #ffffff;
  border: none;
  font-weight: 600;
}

.filter-bar button:hover {
  background: #1d4ed8;
}

.filter-bar .btn-group .btn {
  border-radius: 12px;
  font-size: 14px;
  padding: 10px 14px;
}

.filter-bar .btn-group {
  display: flex;
  gap: 8px;
}

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

.kpi-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 10px 14px;
  box-shadow: 0 15px 35px rgba(15, 35, 95, 0.08);
}

.status-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 10px 14px;
  box-shadow: 0 15px 35px rgba(15, 35, 95, 0.08);
  border-left: 5px solid rgba(15, 35, 95, 0.12);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.status-card.status-ok {
  border-left-color: #16a34a;
}

.status-card.status-stale {
  border-left-color: #f59e0b;
}

.status-card.status-error {
  border-left-color: #dc2626;
}

.status-card.status-unknown {
  border-left-color: #64748b;
}

.status-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
}

.status-value {
  font-size: 18px;
  font-weight: 600;
  color: #0f1c3f;
}

.status-hint {
  font-size: 11px;
  color: #475569;
  line-height: 1.4;
}

.kpi-label {
  font-size: 11px;
  color: #6b7a99;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-value {
  font-size: 22px;
  font-weight: 600;
  color: #101c43;
}

.kpi-hint {
  margin-top: 3px;
  font-size: 11px;
  color: #7583a4;
}

.panel-row {
  display: grid;
  gap: 20px;
  margin-bottom: 20px;
}

.panel-row--apps {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.panel-row--websites {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.panel {
  background: #ffffff;
  border-radius: 22px;
  padding: 16px;
  box-shadow: 0 15px 35px rgba(15, 35, 95, 0.08);
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.panel-title {
  font-size: 15px;
  font-weight: 600;
  color: #0f1c3f;
  margin: 0;
}

.timeline-chart,
.top-apps-chart {
  width: 100%;
  min-height: 160px;
}

.apps-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.apps-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.app-name {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-dot,
.site-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.data-directory {
  background: #ffffff;
  border-radius: 18px;
  padding: 14px 18px;
  font-size: 13px;
  color: #455272;
  box-shadow: 0 15px 35px rgba(15, 35, 95, 0.08);
}

.data-directory code {
  background: rgba(37, 99, 235, 0.08);
  padding: 4px 6px;
  border-radius: 6px;
  color: #1d4ed8;
}

.table-card {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 15px 35px rgba(15, 35, 95, 0.08);
  overflow: hidden;
}

.table-card thead {
  background: #f0f4ff;
  color: #253560;
  font-size: 13px;
}

.table-card thead th {
  padding: 5px 10px;
}

.table-card tbody tr td {
  padding: 5px 10px;
  font-size: 11px;
  color: #27344d;
}

.alert {
  border-radius: 16px;
}

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .app-sidebar {
    position: sticky;
    top: 0;
    flex-direction: row;
    gap: 16px;
    padding: 20px 24px;
    align-items: center;
  }
  .sidebar-nav {
    flex-direction: row;
    gap: 8px;
  }
  .sidebar-link {
    padding: 10px 14px;
  }
  .sidebar-footer {
    display: none;
  }
}
