:root {
  --megaplat-navy: #16324f;
  --megaplat-navy-light: #1f4e79;
  --megaplat-gold: #f0b429;
}

body {
  background-color: #f4f6f9;
  color: #1c2b3a;
}

.app-navbar {
  background-color: var(--megaplat-navy);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background-color: var(--megaplat-navy);
  color: #fff;
  font-weight: 700;
  font-size: 26px;
}

.brand-mark-sm {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 17px;
  background-color: var(--megaplat-navy-light);
}

.login-card {
  border: 0;
  border-radius: 18px;
}

.btn-primary {
  --bs-btn-bg: var(--megaplat-navy-light);
  --bs-btn-border-color: var(--megaplat-navy-light);
  --bs-btn-hover-bg: var(--megaplat-navy);
  --bs-btn-hover-border-color: var(--megaplat-navy);
  --bs-btn-active-bg: var(--megaplat-navy);
  --bs-btn-active-border-color: var(--megaplat-navy);
}

@media (hover: hover) and (min-width: 768px) {
  .dropdown-hover:hover > .dropdown-menu {
    display: block;
    margin-top: 0;
  }
}

.avatar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  background-color: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.5px;
  transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.avatar-btn:hover,
.avatar-btn:focus,
.avatar-btn.show {
  background-color: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.7);
}

.dropdown-menu {
  border: 0;
  border-radius: 12px;
  padding: 0.4rem;
}

.dropdown-item {
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
}

.badge-super {
  background-color: var(--megaplat-gold);
  color: #3b2c00;
  font-weight: 600;
  padding: 0.55em 0.9em;
  border-radius: 999px;
}

.log-date-col {
  width: 170px;
}

.customer-panel {
  border: 1px solid #e3e8ef;
  border-radius: 12px;
  padding: 1rem;
  background-color: #f8fafc;
  height: 100%;
}

.product-card {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0;
  background-color: #fff;
  border: 1px solid #e3e8ef;
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow 0.15s ease-in-out, border-color 0.15s ease-in-out, transform 0.15s ease-in-out;
}

.product-card:hover,
.product-card:focus {
  border-color: var(--megaplat-navy-light);
  box-shadow: 0 0.5rem 1.25rem rgba(22, 50, 79, 0.12);
  transform: translateY(-2px);
}

.product-card-media {
  position: relative;
}

.product-card-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
}

.product-card-img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background-color: #f1f4f8;
}

.product-card-body {
  padding: 0.9rem 1rem 1rem;
}

.product-card-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-detail-img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #e3e8ef;
  background-color: #f1f4f8;
}

.product-thumb-btn {
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  background: none;
}

.product-thumb-btn:hover,
.product-thumb-btn:focus {
  border-color: var(--megaplat-navy-light);
}

.product-thumb {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
}

.catalogue-card {
  border: 1px solid #e3e8ef;
  border-radius: 12px;
}

.catalogue-card-btn {
  width: 100%;
  text-align: left;
  background-color: #fff;
  padding: 0;
  transition: box-shadow 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.catalogue-card-btn:hover,
.catalogue-card-btn:focus {
  border-color: var(--megaplat-navy-light);
  box-shadow: 0 0.25rem 0.75rem rgba(22, 50, 79, 0.12);
}

.catalogue-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e3e8ef;
}

.catalogue-thumb-lg {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e3e8ef;
}

.item-image-box {
  text-align: center;
}

.row-click {
  cursor: pointer;
}

.perm-select {
  width: 150px;
}

dl.row dt {
  color: #61738a;
  font-weight: 500;
}

.chat-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1040;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-color: var(--megaplat-navy-light);
  color: #fff;
  box-shadow: 0 0.5rem 1rem rgba(22, 50, 79, 0.3);
}

.chat-fab:hover,
.chat-fab:focus {
  background-color: var(--megaplat-navy);
  color: #fff;
}

.chat-fab .badge {
  position: absolute;
  top: -2px;
  right: -2px;
}

.chat-offcanvas {
  width: min(440px, 100vw);
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
  min-height: 220px;
  max-height: calc(100vh - 18rem);
  padding: 0.25rem;
}

.chat-msg {
  max-width: 85%;
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  background-color: #eef2f7;
}

.chat-msg-mine {
  align-self: flex-end;
  background-color: #d9e8f7;
}

.chat-msg-meta {
  font-size: 0.75rem;
  color: #61738a;
  margin-bottom: 0.15rem;
}

.chat-msg-body {
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-empty {
  margin: auto;
  color: #61738a;
}

.list-group-item.msg-unread {
  border-left: 4px solid var(--megaplat-gold);
  background-color: #fffdf5;
}

.chat-divider {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.7rem;
}

.chat-divider::before,
.chat-divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid #d7dee8;
}

.stat-card {
  border: 0;
  border-radius: 14px;
  box-shadow: 0 0.35rem 1rem rgba(22, 50, 79, 0.08);
  transition: box-shadow 0.15s ease-in-out, transform 0.15s ease-in-out;
}

a:hover > .stat-card {
  box-shadow: 0 0.6rem 1.4rem rgba(22, 50, 79, 0.14);
  transform: translateY(-2px);
}

.stat-card-attention {
  box-shadow: 0 0.35rem 1rem rgba(217, 152, 12, 0.22);
  border-left: 4px solid var(--megaplat-gold);
}

.stat-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.stat-icon-navy {
  background-color: rgba(31, 78, 121, 0.12);
  color: var(--megaplat-navy-light);
}

.stat-icon-gold {
  background-color: rgba(240, 180, 41, 0.2);
  color: #8a6508;
}

.stat-icon-green {
  background-color: rgba(25, 135, 84, 0.12);
  color: #198754;
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.15;
  color: #1c2b3a;
}

.stat-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 0.35rem;
  border-radius: 50%;
  background-color: var(--megaplat-gold);
}
