:root {
  --brand: #2457d6;
  --brand-dark: #183b96;
  --ink: #172033;
  --muted: #667085;
  --surface: #f5f7fb;
}

html {
  font-size: 14px;
}

body {
  background: var(--surface);
  color: var(--ink);
  min-height: 100vh;
}

.navbar-brand {
  font-family: var(--title-font-family, system-ui, -apple-system, "Segoe UI", sans-serif);
  font-weight: 800;
  letter-spacing: -.03em;
}

.app-title,
.app-title-font {
  font-family: var(--title-font-family, system-ui, -apple-system, "Segoe UI", sans-serif);
}

.app-version-badge {
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  color: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: .68rem;
  font-weight: 800;
  line-height: 1;
  padding: .28rem .45rem;
}

.sidebar {
  background: linear-gradient(180deg, var(--sidebar-color, #172033) 0%, #111827 100%);
  min-height: calc(100vh - 64px);
}

.bg-primary {
  background-color: var(--brand) !important;
}

.btn-primary {
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand-dark);
  --bs-btn-hover-border-color: var(--brand-dark);
}

.text-primary {
  color: var(--brand) !important;
}

.app-logo {
  height: 34px;
  max-width: 110px;
  object-fit: contain;
}

.login-logo {
  display: block;
  margin: 0 auto .85rem;
  max-height: 72px;
  max-width: 180px;
  object-fit: contain;
}

.login-brand {
  align-items: center;
  display: flex;
  flex-direction: column;
}

.settings-logo-preview {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: .75rem;
  height: 70px;
  object-fit: contain;
  padding: .4rem;
  width: 140px;
}

.sidebar .nav-link {
  align-items: center;
  color: #cbd5e1;
  display: flex;
  gap: .7rem;
  border-radius: .75rem;
  margin-bottom: .25rem;
  padding: .7rem .85rem;
}

.sidebar-nav {
  gap: .15rem;
}

.nav-group-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: .75rem;
  color: #cbd5e1;
  display: flex;
  gap: .7rem;
  margin-bottom: .25rem;
  padding: .7rem .85rem;
  text-align: left;
  width: 100%;
}

.nav-group-toggle:hover,
.nav-group-toggle:focus,
.nav-group-toggle.active {
  background: rgba(255,255,255,.1);
  color: #fff;
}

.nav-group-toggle .module-icon {
  font-size: 20px;
}

.nav-group-toggle span:nth-child(2) {
  flex: 1;
}

.nav-group-chevron {
  border-bottom: 2px solid currentColor;
  border-right: 2px solid currentColor;
  height: 8px;
  transform: rotate(45deg);
  transition: transform .18s ease;
  width: 8px;
}

.nav-group-toggle[aria-expanded="true"] .nav-group-chevron {
  transform: rotate(225deg);
}

.nav-submenu {
  border-left: 1px solid rgba(255,255,255,.12);
  margin: 0 0 .35rem 1.45rem;
  padding-left: .45rem;
}

.sidebar .nav-sub-link {
  font-size: .92rem;
  margin-bottom: .15rem;
  padding: .55rem .7rem;
}

.sidebar .nav-sub-link .module-icon {
  font-size: 17px;
}

.module-icon {
  flex-shrink: 0;
  font-size: 1.2em;
  line-height: 1;
}

.btn {
  align-items: center;
  display: inline-flex;
  gap: .4rem;
  justify-content: center;
}

.btn .button-icon {
  flex-shrink: 0;
  font-size: 1.05em;
  line-height: 1;
}

.sidebar .module-icon {
  font-size: 20px;
}

.page-title-with-icon {
  align-items: center;
  display: flex;
  gap: .65rem;
}

.page-title-with-icon .module-icon {
  color: var(--brand);
  font-size: 30px;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  background: rgba(255,255,255,.1);
  color: #fff;
}

.main-content {
  min-height: calc(100vh - 64px);
}

.card {
  border: 0;
  border-radius: 1rem;
  box-shadow: 0 8px 28px rgba(24, 39, 75, .06);
}

.stat-card {
  overflow: hidden;
  position: relative;
}

.stat-card-heading {
  align-items: center;
  display: flex;
  gap: .55rem;
  margin-bottom: .35rem;
}

.stat-icon {
  align-items: center;
  background: rgba(36,87,214,.1);
  border-radius: .65rem;
  color: var(--brand);
  display: inline-flex;
  flex: 0 0 auto;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.stat-icon .bi {
  font-size: 17px;
  line-height: 1;
}

.stat-card::after {
  border: 18px solid rgba(36,87,214,.08);
  border-radius: 50%;
  content: "";
  height: 105px;
  position: absolute;
  right: -30px;
  top: -35px;
  width: 105px;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
}

.text-bonus-orange {
  color: #f97316 !important;
}

.online-dot {
  background: #22c55e;
  border: 3px solid #dcfce7;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(34,197,94,.15);
  flex-shrink: 0;
  height: 13px;
  width: 13px;
}

.alias-card {
  background: linear-gradient(135deg, var(--brand), #6d5dfc);
  color: #fff;
}

.alias-value {
  background: rgba(255,255,255,.14);
  border: 1px dashed rgba(255,255,255,.65);
  border-radius: .8rem;
  font-size: clamp(1.05rem, 4vw, 1.55rem);
  font-weight: 800;
  letter-spacing: .04em;
  padding: 1rem;
  word-break: break-all;
}

.table > :not(caption) > * > * {
  padding: .85rem .7rem;
  vertical-align: middle;
}

.status-badge {
  border-radius: 999px;
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  padding: .35rem .65rem;
}

.login-shell {
  background:
    radial-gradient(circle at 15% 20%, rgba(109,93,252,.35), transparent 30%),
    radial-gradient(circle at 85% 75%, rgba(36,87,214,.38), transparent 30%),
    #111827;
  min-height: 100vh;
}

.login-card {
  max-width: 430px;
  width: 100%;
}

.form-control, .form-select {
  border-radius: .7rem;
  min-height: 44px;
}

.btn {
  border-radius: .7rem;
  font-weight: 600;
}

.notification-unread {
  border-left: 4px solid var(--brand);
  background: #f8faff;
}

.module-filters {
  font-size: .78rem;
}

.module-filters .form-label {
  font-size: .72rem;
  font-weight: 700;
  margin-bottom: .2rem;
}

.module-filters .form-control,
.module-filters .form-select {
  font-size: .76rem;
  min-height: 31px;
  padding-bottom: .25rem;
  padding-top: .25rem;
}

.module-filters .btn {
  font-size: .76rem;
}

@media (min-width: 1200px) {
  .credit-filter-field {
    flex: 0 0 115px;
    max-width: 115px;
  }

  .credit-filter-user,
  .credit-filter-reviewer {
    flex-basis: 155px;
    max-width: 155px;
  }

  .credit-filter-date {
    flex: 0 0 185px;
    max-width: 185px;
  }

  .credit-filter-actions {
    flex-wrap: nowrap !important;
    white-space: nowrap;
  }
}

.notification-bell {
  align-items: center;
  color: #fff;
  display: inline-flex;
  font-size: 1.35rem;
  height: 42px;
  justify-content: center;
  position: relative;
  text-decoration: none;
  width: 42px;
}

.notification-bell:hover,
.notification-bell:focus {
  color: #fff;
  transform: scale(1.08);
}

.notification-bell-new {
  animation: notification-ring .8s ease-in-out 2;
}

.agent-credit-icon {
  font-size: 27px;
  line-height: 1;
}

.notification-user-icon,
.notification-sound-icon {
  line-height: 1;
}

.notification-user-icon {
  font-size: 27px;
}

.notification-sound-icon {
  font-size: 22px;
}

.notification-sound-button {
  align-items: center;
  background: rgba(255,255,255,.14);
  border: 0;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 1rem;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.notification-sound-button:hover,
.notification-sound-button:focus {
  background: rgba(255,255,255,.25);
}

.notification-sound-button.sound-enabled {
  background: #16a34a;
}

@keyframes notification-ring {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(12deg); }
  75% { transform: rotate(-12deg); }
}

.notification-count {
  align-items: center;
  background: #dc2626;
  border: 2px solid #0d6efd;
  border-radius: 999px;
  color: #fff;
  display: flex;
  font-size: .65rem;
  font-weight: 800;
  height: 21px;
  justify-content: center;
  min-width: 21px;
  padding: 0 4px;
  position: absolute;
  right: 0;
  top: 0;
}

.mobile-home-button {
  display: none;
}

.whatsapp-float-button {
  align-items: center;
  background: #22c55e;
  border: 3px solid #fff;
  border-radius: 999px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 14px 34px rgba(22, 163, 74, .32);
  color: #fff;
  display: flex;
  font-size: .78rem;
  font-weight: 800;
  gap: .45rem;
  left: 18px;
  min-height: 54px;
  padding: .7rem 1rem;
  position: fixed;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  z-index: 1041;
}

.whatsapp-float-button:hover,
.whatsapp-float-button:focus {
  background: #16a34a;
  box-shadow: 0 18px 40px rgba(22, 163, 74, .4);
  color: #fff;
  transform: translateY(-2px);
}

.whatsapp-icon {
  line-height: 1;
}

.whatsapp-float-button .whatsapp-icon {
  font-size: 28px;
}

.whatsapp-icon-option {
  align-items: center;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  gap: .65rem;
  min-height: 72px;
  padding: .8rem;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
  width: 100%;
}

.whatsapp-icon-option:has(input:checked) {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .14);
}

.whatsapp-icon-option:hover {
  border-color: #22c55e;
  transform: translateY(-1px);
}

.whatsapp-icon-preview {
  align-items: center;
  background: #22c55e;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.whatsapp-icon-preview .whatsapp-icon {
  font-size: 24px;
}

.version-timeline {
  display: grid;
  gap: 1rem;
  position: relative;
}

.version-entry {
  display: grid;
  gap: .9rem;
  grid-template-columns: 18px 1fr;
  position: relative;
}

.version-entry:not(:last-child)::before {
  background: #e5e7eb;
  content: "";
  height: calc(100% + 1rem);
  left: 8px;
  position: absolute;
  top: 18px;
  width: 2px;
}

.version-dot {
  background: var(--brand);
  border: 3px solid #fff;
  border-radius: 999px;
  box-shadow: 0 0 0 3px rgba(36, 87, 214, .14);
  height: 18px;
  margin-top: .3rem;
  width: 18px;
  z-index: 1;
}

.version-entry-body {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 1rem;
}

.version-description {
  line-height: 1.55;
  white-space: normal;
}

@media (max-width: 767.98px) {
  body {
    padding-bottom: 86px;
  }

  .sidebar {
    min-height: auto;
  }
  .main-content {
    padding: 1rem !important;
  }
  .mobile-card-table thead {
    display: none;
  }
  .mobile-card-table,
  .mobile-card-table tbody,
  .mobile-card-table tr,
  .mobile-card-table td {
    display: block;
    width: 100%;
  }
  .mobile-card-table tr {
    border-bottom: 1px solid #e5e7eb;
    padding: .75rem 0;
  }
  .mobile-card-table td {
    border: 0;
    padding: .25rem .5rem;
  }
  .mobile-card-table td::before {
    color: var(--muted);
    content: attr(data-label);
    display: block;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
  }

  .mobile-home-button {
    align-items: center;
    background: var(--brand);
    border: 3px solid #fff;
    border-radius: 999px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    box-shadow: 0 10px 30px rgba(24, 59, 150, .35);
    color: #fff;
    display: flex;
    flex-direction: column;
    font-size: .7rem;
    font-weight: 700;
    height: 64px;
    justify-content: center;
    line-height: 1;
    position: fixed;
    right: 16px;
    text-decoration: none;
    width: 64px;
    z-index: 1040;
  }

  .mobile-home-button:hover,
  .mobile-home-button:focus,
  .mobile-home-button.active {
    background: var(--brand-dark);
    color: #fff;
    transform: translateY(-2px);
  }

  .mobile-home-icon {
    align-items: center;
    display: flex;
    line-height: 1;
    margin-bottom: .3rem;
  }

  .mobile-home-icon .button-icon {
    font-size: 27px;
  }

  .whatsapp-float-button {
    bottom: calc(16px + env(safe-area-inset-bottom));
    height: 64px;
    justify-content: center;
    left: 16px;
    min-height: 64px;
    min-width: 64px;
    padding: .7rem;
    width: 64px;
  }

  .whatsapp-float-button .whatsapp-icon {
    font-size: 31px;
  }
}
