@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&display=swap");

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  font-family: "Nunito", sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 22px;
  color: #1f2937;
  -webkit-font-smoothing: antialiased;
  background-color: #f3f6ff;
}

a {
  text-decoration: none;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.boxy {
  background-color: #fff;
  box-shadow: 0 4px 18px rgba(55, 72, 140, 0.08);
  border-radius: 10px;
  border: 1px solid rgba(147, 165, 255, 0.18);
  padding: 10px;
}

.boxy-small {
  background-color: #fff;
  box-shadow: 0 2px 8px rgba(55, 72, 140, 0.1);
  border-radius: 8px;
  border: 0;
  padding: 5px;
}

/* Top navigation */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  border-bottom: 1px solid rgba(147, 165, 255, 0.22);
  box-shadow: 0 4px 20px rgba(55, 72, 140, 0.06);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 1600px;
  margin: 0 auto;
  padding: 12px 20px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  flex-shrink: 0;
}

.topbar-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  padding: 4px;
  box-shadow: 0 2px 10px rgba(55, 72, 140, 0.1);
}

.topbar-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.topbar-brand-text strong {
  font-size: 1rem;
  font-weight: 800;
  color: #111827;
}

.topbar-brand-text span {
  font-size: 0.78rem;
  font-weight: 600;
  color: #6782e5;
}

.topbar-toggle {
  display: none;
  margin-left: auto;
  width: 40px;
  height: 40px;
  border: 1px solid #d7def8;
  border-radius: 10px;
  background: #f8faff;
  color: #374151;
  font-size: 1.4rem;
  cursor: pointer;
}

.topbar-collapse {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  gap: 20px;
  min-width: 0;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  color: #6b7280;
  font-size: 0.92rem;
  font-weight: 700;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.topbar-nav-link i {
  font-size: 1rem;
}

.topbar-nav-link:hover {
  background: #f3f6ff;
  color: #6782e5;
}

.topbar-nav-link.active {
  background: linear-gradient(135deg, rgba(103, 130, 229, 0.14), rgba(147, 165, 255, 0.18));
  color: #4f63c7;
  box-shadow: inset 0 0 0 1px rgba(103, 130, 229, 0.18);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  padding: 6px 8px 6px 6px;
  border-radius: 999px;
  background: #f8faff;
  border: 1px solid #e4e9ff;
}

.user-avatar {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #5b73e8 0%, #93a5ff 100%);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow:
    0 0 0 2px #fff,
    0 4px 12px rgba(91, 115, 232, 0.35);
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}

.user-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.user-company {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6782e5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: none;
  border-radius: 999px;
  background: #fff;
  color: #dc3545;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.btn-logout:hover {
  background: #fef2f2;
  color: #b91c1c;
}

.btn-logout i {
  font-size: 1rem;
}

/* Page layout */
.page-main {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px;
}

.main-content {
  background-color: #fff;
  padding: 25px 15px 15px;
  border-radius: 12px;
  min-height: calc(100vh - 120px);
}

.main-content.custom-bg {
  background-color: transparent;
  padding: 0;
  box-shadow: none;
  border: none;
}

.nav-tabs .nav-link {
  font-weight: 600;
  color: rgba(0, 0, 0, 0.6);
}

.nav-tabs .nav-link.active {
  color: #6782e5;
}

.iconic {
  box-shadow: 0 4px 12px rgba(55, 72, 140, 0.12);
  border: none;
}

@media (max-width: 991.98px) {
  .topbar-inner {
    flex-wrap: wrap;
    padding: 12px 16px;
  }

  .topbar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .topbar-collapse {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    padding-top: 8px;
    border-top: 1px solid #eef2ff;
  }

  .topbar-collapse.show {
    display: flex;
  }

  .topbar-nav {
    width: 100%;
  }

  .topbar-nav-link {
    width: 100%;
  }

  .topbar-user {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
  }

  .user-meta {
    flex: 1;
  }

  .user-name,
  .user-company {
    max-width: none;
  }

  .page-main {
    padding: 14px;
  }
}

@media (max-width: 575.98px) {
  .topbar-brand-text span {
    display: none;
  }

  .user-meta {
    display: none;
  }

  .topbar-user {
    width: auto;
    margin-left: auto;
    padding: 4px;
    gap: 6px;
  }
}
