html {
  font-size: 14px;
}

body {
  font-family: 'Roboto', Arial, sans-serif;
  background-color: #F7F5F3;
}

.lucide-icon {
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
}

.sidenav-toggle-icon-collapsed {
  display: none;
}

body.sidenav-collapsed .sidenav-toggle-icon-expanded {
  display: none;
}

body.sidenav-collapsed .sidenav-toggle-icon-collapsed {
  display: inline-block;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: #1DAA61;
  box-shadow: none;
  outline: none;
}

.btn,
.btn:hover,
.btn:active,
.btn.active,
.btn:first-child:active,
.btn.show {
  box-shadow: none !important;
  border-width: 1px !important;
}

.btn-outline-secondary {
  color: #000 !important;
  border-color: #000 !important;
  opacity: .75;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:active,
.btn-outline-secondary.active,
.btn-outline-secondary:first-child:active {
  color: #fff !important;
  background-color: #000 !important;
  border-color: #000 !important;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* --- Admin dashboard layout --- */

:root {
  --sidenav-width: 240px;
  --sidenav-collapsed-width: 72px;
  --sidenav-bg: #ffffff;
  --settings-subnav-width: 220px;
  --mdb-input-focus-border-color: #1DAA61;
  --mdb-input-focus-label-color: #1DAA61;
}

.app-sidenav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidenav-width);
  background-color: var(--sidenav-bg);
  color: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  z-index: 1030;
  transition: transform 0.25s ease-in-out, width 0.25s ease-in-out;
  -webkit-box-shadow: 0 2px 5px 0 rgba(0,0,0,.05),0 2px 10px 0 rgba(0,0,0,.05);
  box-shadow: 0 2px 5px 0 rgba(0,0,0,.05),0 2px 10px 0 rgba(0,0,0,.05);
}
.app-sidenav-title {
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
}

.app-sidenav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.app-sidenav-logo {
  height: 40px;
  width: 40px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.app-sidenav-stats {
  font-size: 0.8125rem;
  color: rgba(246, 246, 246, 0.55);
  line-height: 1.3;
}

.app-sidenav-stats-count {
  font-weight: 700;
  color: rgba(1, 152, 14, 0.85);
}

.login-logo {
  height: 96px;
  width: auto;
  border-radius: 12px;
}

.home-logo {
  height: 180px;
  width: auto;
  border-radius: 10px;
}

.app-sidenav-menu {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  flex: 1 1 auto;
  overflow-y: auto;
}

.app-sidenav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  margin: 0 0.5rem;
  color: rgba(214, 214, 214, 0.75);
  text-decoration: none;
  transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem; 
}

.app-sidenav-group-label {
  padding: 0.75rem 1.25rem 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(242, 242, 242, 0.45);
  white-space: nowrap;
}

.app-sidenav-link:hover {
  background-color: #1DAA61;
  color: #fff;  
}

.app-sidenav-link.active {
  background-color: #1DAA61;
  color: #fff; 
}

.app-sidenav-utility {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid rgba(241, 241, 241, 0.08) ;
  flex-shrink: 0;
}

.app-sidenav-utility-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: none;
  color: rgba(241, 241, 241, 0.65);
  text-decoration: none;
  border-radius: 0.5rem;
  transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
}

.app-sidenav-utility-link:hover {
  background-color: rgba(241, 241, 241, 0.06);
  color: rgba(241, 241, 241, 0.9);
}

.app-sidenav-utility-link-emphasis {
  background-color: #000;
  color: #fff;
}

.app-sidenav-utility-link-emphasis:hover {
  background-color: #222;
  color: #fff;
}

.app-content {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.has-sidenav .app-content {
  margin-left: var(--sidenav-width);
  transition: margin-left 0.25s ease-in-out;
}

body.has-settings-subnav.has-sidenav .app-content {
  margin-left: calc(var(--sidenav-width) + var(--settings-subnav-width));
}

.app-sidenav-link-text {
  white-space: nowrap;
}

.settings-subnav {
  position: fixed;
  top: 0;
  bottom: 0;
  left: var(--sidenav-width);
  width: var(--settings-subnav-width);
  background-color: #fff;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  overflow-y: auto;
  z-index: 1020;
  padding: 1.25rem 0;
  transition: left 0.25s ease-in-out;
}

.settings-subnav-header {
  padding: 0 1.25rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(0, 0, 0, 0.4);
}

.settings-subnav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.settings-subnav-link {
  display: block;
  padding: 0.6rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.7);
  text-decoration: none;
  border-right: 3px solid transparent;
}

.settings-subnav-link:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

.settings-subnav-link.active {
  background-color: rgba(217, 253, 211, 0.6);
  border-right-color: #1DAA61;
  color: #178a4e;
  font-weight: 600;
}

@media (min-width: 992px) {
  body.sidenav-collapsed .app-sidenav {
    width: var(--sidenav-collapsed-width);
  }

  body.sidenav-collapsed.has-sidenav .app-content {
    margin-left: var(--sidenav-collapsed-width);
  }

  body.sidenav-collapsed.has-settings-subnav.has-sidenav .app-content {
    margin-left: calc(var(--sidenav-collapsed-width) + var(--settings-subnav-width));
  }

  body.sidenav-collapsed .settings-subnav {
    left: var(--sidenav-collapsed-width);
  }

  body.sidenav-collapsed .app-sidenav-brand {
    justify-content: center;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  body.sidenav-collapsed .app-sidenav-stats {
    display: none;
  }

  body.sidenav-collapsed .app-sidenav-link {
    justify-content: center;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  body.sidenav-collapsed .app-sidenav-link-text {
    display: none;
  }

  body.sidenav-collapsed .app-sidenav-group-label {
    display: none;
  }

  body.sidenav-collapsed .app-sidenav-utility {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 0.5rem;
  }

  body.sidenav-collapsed .app-sidenav-profile {
    justify-content: center;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

.app-sidenav-profile-wrap {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.app-sidenav-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  color: inherit;
  text-decoration: none;
}

.app-sidenav-profile:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

.app-sidenav-profile.dropdown-toggle::after {
  display: none;
}

.app-sidenav-profile-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-sidenav-profile-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-sidenav-profile-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
}

.app-sidenav-profile-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #22c55e;
  flex-shrink: 0;
}

.mobile-sidenav-fab {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1040;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background-color: #111827;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.app-main {
  flex: 1 0 auto;
  padding: 1rem;
}

@media (max-width: 991.98px) {
  .app-main {
    padding-top: 4.5rem;
  }
}

.app-footer {
  padding: 1rem;
  text-align: center;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background-color: #fff;
}

#sidenav-toggle {
  color: rgba(241, 241, 241, 0.65);
}

.login-page-bg {
  min-height: 100vh;
  background-color: #ffffff;
  background-image: url('/bg.jpg');
  background-size: 100%;
  background-position: center;
  background-repeat: no-repeat;
  padding: 2rem 1.5rem;
}

.login-content {
  width: 100%;
  max-width: 420px;
}

.login-hero-logo {
  max-height: 64px;
  width: auto;
  margin-bottom: 1.5rem;
}

.login-card {
  width: 100%;
  overflow: hidden;
  background-color: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0,0,0,0.08);
}

.login-alert-banner-error {
  background-color: #dc3545;
  color: #fff;
  font-weight: 600;
  text-align: center;
  padding: 0.85rem 1.25rem;
  margin: 1rem 0;
  border-radius: 0.5rem;
}

.login-alert-banner-success {
  background-color: #1DAA61;
  color: #fff;
  font-weight: 600;
  text-align: center;
  padding: 0.85rem 1.25rem;
  margin: 1rem 0;
  border-radius: 0.5rem;
}

.login-otp-input {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.5rem;
}

.login-input-group {
  position: relative;
}

.login-input-group .form-control {
  padding-right: 2.75rem;
  border-radius: 2rem;
}

.login-input-icon {
  position: absolute;
  top: 50%;
  right: 0.9rem;
  transform: translateY(-50%);
  color: rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.login-password-toggle {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  line-height: 0;
  display: inline-flex;
  cursor: pointer;
  pointer-events: auto;
}

.login-password-toggle:hover,
.login-password-toggle:focus {
  color: rgba(0, 0, 0, 0.65);
}

.login-submit-btn {
  border-radius: 2rem;
}

.public-page-header {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.public-page-logo {
  height: 48px;
  width: auto;
  border-radius: 8px;
}

.public-page-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  line-height: 1.7;
}

.public-page-main h1 {
  margin-bottom: 0.25rem;
}

.public-page-main h2 {
  margin-top: 2rem;
  font-size: 1.25rem;
}

.public-page-footer {
  padding: 1.5rem;
  text-align: center;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

@media (max-width: 991.98px) {
  .app-sidenav {
    transform: translateX(-100%);
  }

  .app-sidenav.show {
    transform: translateX(0);
  }

  body.has-sidenav .app-content {
    margin-left: 0;
  }

  .settings-subnav {
    position: static;
    width: 100%;
    height: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    border-right: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding: 0.75rem 1rem;
  }

  .settings-subnav-header {
    display: none;
  }

  .settings-subnav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .settings-subnav-link {
    border-left: none;
    border-radius: 0.4rem;
    padding: 0.4rem 0.75rem;
  }

  .settings-subnav-link.active {
    border-left: none;
  }

  body.has-settings-subnav.has-sidenav .app-content {
    margin-left: 0;
  }
}

/* --- Chat --- */

.chat-card {
  height: calc(100vh - 75px);
  min-height: 480px;
  overflow: hidden; 
}

.chat-layout {
  display: flex;
  height: 100%;
}

.chat-sidebar {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
}

.chat-sidebar-header {
  padding: 0.75rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.chat-conversation-list {
  flex: 1 1 auto;
  overflow-y: auto;
  margin: 0.5rem 0;
}

.chat-conversation-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem;
  text-decoration: none;
  color: inherit; 
  transition: background-color 0.15s ease-in-out;
  margin: 0 0.5rem;
  border-radius: 1rem;
}

.chat-conversation-item:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

.chat-conversation-item.active {
  background-color: rgba(217, 253, 211, 0.75);
}

.chat-conversation-info {
  flex: 1 1 auto;
  min-width: 0;
}

.chat-conv-agent { 
  font-size: 0.65rem;
  font-weight: 500;
}

.chat-thread-agent {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.chat-thread-panel {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-empty-state {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: rgba(0, 0, 0, 0.4);
}

.chat-thread-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.chat-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1rem;
  background-color: #f4f6f9;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chat-bubble-row {
  display: flex;
}

.chat-bubble-row.outbound {
  justify-content: flex-end;
}

.chat-bubble-row.inbound {
  justify-content: flex-start;
}

.chat-bubble {
  position: relative;
  max-width: 65%;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  background-color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.chat-bubble-row.outbound .chat-bubble {
  background-color: #dcf8c6;
  border-top-right-radius: 0;
}

.chat-bubble-row.inbound .chat-bubble {
  border-top-left-radius: 0;
}

.chat-bubble-row.inbound .chat-bubble::before {
  content: "";
  position: absolute;
  top: 0;
  left: -8px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 8px 8px 0;
  border-color: transparent #fff transparent transparent;
  filter: drop-shadow(-1px 1px 1px rgba(0, 0, 0, 0.1));
}

.chat-bubble-row.outbound .chat-bubble::before {
  content: "";
  position: absolute;
  top: 0;
  right: -8px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 0 8px 8px;
  border-color: transparent transparent transparent #dcf8c6;
  filter: drop-shadow(1px 1px 1px rgba(0, 0, 0, 0.1));
}

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

.chat-caption {
  margin-top: 0.25rem;
  font-size: 0.875rem;
}

.chat-bubble-meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
  color: rgba(0, 0, 0, 0.45);
  margin-top: 0.25rem;
}

.chat-status::after {
  content: '\2713';
}

.chat-status-delivered::after,
.chat-status-read::after {
  content: '\2713\2713';
}

.chat-status-read {
  color: #1976d2;
}

.chat-status-failed::after {
  content: '!';
  color: #dc4c64;
}

.chat-media-image {
  max-width: 260px;
  max-height: 260px;
  border-radius: 0.5rem;
  display: block;
}

.chat-media-video {
  max-width: 280px;
  border-radius: 0.5rem;
  display: block;
}

.chat-media-audio {
  max-width: 260px;
}

.chat-media-doc {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
  font-weight: 500;
}

.chat-media-error {
  font-size: 0.8125rem;
  color: rgba(0, 0, 0, 0.5);
  font-style: italic;
}

.chat-reply-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
  background-color: #FFF; 

}

.chat-reply-input.form-control {
  border-radius: 999px;
  border: none;
  padding: 0.6rem 1.1rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.chat-reply-send {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border: none;
  border-radius: 50%;
  background-color: #1DAA61;
  color: #fff;
}

.chat-reply-send:hover {
  background-color: #178a4e;
}

.chat-reply-locked {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
  background-color: #FFF;
}

.chat-reply-locked-text {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(0, 0, 0, 0.5);
  font-size: 0.875rem;
}

.chat-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: none;
  border-radius: 999px;
  padding: 0.45rem 1rem;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 500;
  flex-shrink: 0;
}
.reply-locked{
  background-color: #1DAA61;
}

.reply-locked:hover {
  background-color: #178a4e;
}

.reply-unlocked{
  background-color: #1d66aa;
}
.reply-unlocked:hover {
  background-color: #1d97aa;
}
@media (max-width: 767.98px) {
  .chat-sidebar {
    width: 100%;
  }
}

.chat-app-tabs {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
  background-color: #fff;
  border-radius: 0.5rem;
  padding: 0.4rem 0.6rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.chat-app-tabs-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.8125rem;
  color: rgba(0, 0, 0, 0.55);
  padding: 0 0.75rem 0 0.25rem;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  margin-right: 0.25rem;
}

.chat-app-tab {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: 0.4rem;
  text-decoration: none;
  color: rgba(0, 0, 0, 0.6);
  font-size: 0.8125rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
}

.chat-app-tab:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

.chat-app-tab.active {
  color: #16a34a;
  border-bottom-color: #16a34a;
  font-weight: 600;
  border-radius:unset;
}

.chat-app-tab-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #9ca3af;
  flex-shrink: 0;
}

.chat-app-tab.active .chat-app-tab-dot {
  background-color: #22c55e;
}

.chat-app-tab-phone {
  color: rgba(0, 0, 0, 0.45);
  font-weight: 400;
}

.chat-app-tabs-action {
  margin-left: auto;
  flex-shrink: 0;
}

.chat-app-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 0.35rem;
  border-radius: 999px;
  background-color: #22c55e;
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
}

.chat-search-group {
  position: relative;
}

.chat-search-icon {
  position: absolute;
  top: 50%;
  left: 0.85rem;
  transform: translateY(-50%);
  color: rgba(163, 163, 163, 0.9);
  pointer-events: none;
}

.chat-search-input.form-control {
  border-radius: 999px;
  padding: 0.5rem 0.5rem 0.5rem 2.25rem;
  box-shadow: none;
  background-color: #F6F5F4;
}

.chat-search-input.form-control:focus {
  border-color: #1DAA61;
  box-shadow: none;
}

.chat-filter-tabs {
  display: flex;
  gap: 0.4rem;
}

.chat-filter-tab {
  flex: 1 1 auto;
  text-align: center;
  padding: 0.3rem 0.4rem;
  border-radius:5rem; 
  color: rgba(0, 0, 0, 0.6);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid rgba(163, 163, 163, 0.5)
}

.chat-filter-tab:hover {
  background-color: rgba(0, 0, 0, 0.08);
}

.chat-filter-tab.active {
  background-color: #D9FDD3;
  color: #15603E;
  border-color: #B1CCAC;
}

.chat-tag-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 0.3rem;
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 30px;
}

.chat-tag-badge-sm {
  font-size: 0.625rem;
  padding: 0.1rem 0.4rem;
}

.dash-stat-card .card-body {
  padding: 1rem;
}

.dash-stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  color: #fff;
}

.dash-stat-icon-green { background-color: #22c55e; }
.dash-stat-icon-blue { background-color: #3b82f6; }
.dash-stat-icon-orange { background-color: #f59e0b; }
.dash-stat-icon-purple { background-color: #8b5cf6; }
.dash-stat-icon-teal { background-color: #06b6d4; }
.dash-stat-icon-amber { background-color: #eab308; }

.dash-stat-label {
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.55);
}

.dash-stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.3;
}

.dash-stat-change {
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.dash-stat-compare {
  font-size: 0.7rem;
  color: rgba(0, 0, 0, 0.45);
}

.dash-chart-wrap {
  position: relative;
  height: 260px;
}

.dash-donut-wrap {
  position: relative;
  height: 200px;
}

.dash-donut-wrap-sm {
  height: 160px;
}

.dash-legend-row {
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.65);
}

.dash-legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dash-legend-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  font-size: 0.8125rem;
}

.dash-legend-list li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.15rem 0;
}

.dash-legend-list-sm {
  font-size: 0.75rem;
}

.dash-legend-value {
  margin-left: auto;
  font-weight: 600;
}

.dash-live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #22c55e;
  margin-right: 0.25rem;
}

.dash-live-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.8125rem;
}

.dash-live-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.08);
}

.dash-live-list li:last-child {
  border-bottom: none;
}

.dash-live-list li span {
  margin-left: auto;
  font-weight: 700;
}

.dash-live-icon {
  color: rgba(0, 0, 0, 0.5);
}

.dash-footer-stats {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dash-heatmap {
  border-collapse: separate;
  border-spacing: 3px;
  font-size: 0.65rem;
  width: 100%;
}

.dash-heatmap th {
  font-weight: 600;
  color: rgba(0, 0, 0, 0.55);
  text-align: center;
  padding-bottom: 0.25rem;
}

.dash-heatmap-hour {
  white-space: nowrap;
  color: rgba(0, 0, 0, 0.55);
  font-size: 0.6rem;
  padding-right: 0.25rem;
}

.dash-heatmap-cell {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 3px;
  margin: 0 auto;
}

.dash-heatmap-legend {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  font-size: 0.7rem;
  color: rgba(0, 0, 0, 0.5);
}

.dash-heatmap-gradient {
  flex: 1 1 auto;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right, rgba(34, 197, 94, 0.08), rgba(34, 197, 94, 1));
}

.dash-mini-table {
  font-size: 0.8125rem;
}

.dash-agent-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dash-daterange-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.dash-bar-track {
  display: inline-block;
  width: 60px;
  height: 6px;
  border-radius: 3px;
  background-color: rgba(0, 0, 0, 0.08);
  overflow: hidden;
  vertical-align: middle;
  margin-right: 0.4rem;
}

.dash-bar-fill {
  height: 100%;
  background-color: #ef4444;
  border-radius: 3px;
}

.dash-bar-track-lg {
  width: 120px;
}

.dash-bar-fill-success {
  background-color: #22c55e;
}

.dash-type-toggle .btn {
  font-weight: 600;
}

.dash-info-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  background-color: rgba(245, 158, 11, 0.12);
  border-radius: 0.5rem;
  padding: 0.6rem 1rem;
  font-size: 0.8125rem;
}

.dash-info-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #f59e0b;
  flex-shrink: 0;
}

.dash-info-sep {
  color: rgba(0, 0, 0, 0.3);
}

.dash-channel-cost {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.5rem;
  padding: 0.85rem;
}

.dash-channel-cost-active {
  border-color: rgba(245, 158, 11, 0.4);
  background-color: rgba(245, 158, 11, 0.08);
}

.dash-channel-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #22c55e;
  margin-right: 0.4rem;
}

.dash-channel-dot-active {
  background-color: #f59e0b;
}

.dash-channel-cost-value {
  font-size: 1.35rem;
  font-weight: 700;
}

.dash-progress-track {
  height: 6px;
  border-radius: 3px;
  background-color: rgba(0, 0, 0, 0.08);
  overflow: hidden;
  margin: 0.5rem 0 0.35rem;
}

.dash-progress-fill {
  height: 100%;
  border-radius: 3px;
}

.dash-progress-fill-success { background-color: #22c55e; }
.dash-progress-fill-active { background-color: #f59e0b; }
.dash-progress-fill-danger { background-color: #ef4444; }

.dash-grand-total-card {
  background-color: #1e293b;
  color: #fff;
}

.dash-grand-total-card .text-body-secondary {
  color: rgba(255, 255, 255, 0.6) !important;
}

.contacts-layout {
  align-items: stretch;
  height: calc(100vh - 170px);
  min-height: 480px;
}

.contacts-main {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.contacts-main .card {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.contacts-main .card-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.contacts-table-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.contacts-table-scroll thead th {
  position: sticky;
  top: 0;
  background-color: #fff;
  z-index: 1;
}

@media (max-width: 767.98px) {
  .contacts-layout {
    flex-direction: column;
    height: auto;
  }

  .contacts-main {
    min-height: 480px;
  }
}

.bg-badge-read {
  background-color: #F1F5F9;
  color: #6A778E;
}

.wa-preview-sticky {
  position: sticky;
  top: 1rem;
}

.wa-preview-wrap {
  background-color: #e9dfd3;
  background-image: radial-gradient(rgba(0, 0, 0, 0.035) 1px, transparent 1px);
  background-size: 16px 16px;
  border-radius: 0.5rem;
  padding: 2rem 1rem;
  min-height: 360px;
  display: flex;
  align-items: flex-start;
}

.wa-preview-bubble {
  position: relative;
  background-color: #fff;
  border-radius: 0.5rem;
  border-top-left-radius: 0;
  padding: 0.75rem 0.9rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  font-size: 0.875rem;
  width: 100%;
  word-break: break-word;
}

.wa-preview-bubble::before {
  content: "";
  position: absolute;
  top: 0;
  left: -8px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 8px 8px 0;
  border-color: transparent #fff transparent transparent;
  filter: drop-shadow(-1px 1px 1px rgba(0, 0, 0, 0.1));
}

.wa-preview-header {
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.wa-preview-body {
  white-space: normal;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.wa-preview-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  color: rgba(0, 0, 0, 0.45);
  font-size: 0.75rem;
}
.border-none {
  border: none !important;
}

/* --- Templates browser --- */

.templates-layout {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.templates-sidebar {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 1rem;
  height: calc(100vh - 2rem);
  overflow: hidden;
}

.templates-sidebar-header {
  padding: 0.75rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.tpl-list {
  flex: 1 1 auto;
  overflow-y: auto;
}

.tpl-list-item {
  display: block;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: background-color 0.15s ease-in-out;
}

.tpl-list-item:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

.tpl-list-item.active {
  background-color: rgba(217, 253, 211, 0.75);
}

.tpl-list-name {
  font-size: 0.9rem;
}

.tpl-list-meta {
  font-size: 0.75rem;
}

.tpl-list-snippet {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.templates-detail {
  flex: 1 1 auto;
  min-width: 0;
}

.tpl-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.tpl-badge-category {
  background-color: #ede9fe;
  color: #6d28d9;
}

.tpl-badge-tag {
  background-color: #fce7f3;
  color: #be185d;
}

.tpl-badge-status-approved {
  background-color: #dcfce7;
  color: #15803d;
}

.tpl-badge-status-pending {
  background-color: #fef3c7;
  color: #b45309;
}

.tpl-badge-status-rejected {
  background-color: #fee2e2;
  color: #b91c1c;
}

.tpl-badge-status-neutral {
  background-color: #f3f4f6;
  color: #374151;
}

.tpl-detail-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: rgba(0, 0, 0, 0.45);
  margin-bottom: 0.15rem;
}

.tpl-detail-value {
  font-size: 0.9rem;
  font-weight: 500;
}

.tpl-body-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.tpl-var-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  background-color: #f3f4f6;
  color: #374151;
  font-size: 0.8rem;
  font-weight: 700;
}

.tpl-cost-row {
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.tpl-cost-row:last-of-type {
  border-bottom: none;
}

.tpl-cost-row-active {
  background-color: rgba(29, 170, 97, 0.06);
  margin: 0 -0.5rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  border-radius: 0.375rem;
}

@media (max-width: 991.98px) {
  .templates-layout {
    flex-direction: column;
  }

  .templates-sidebar {
    width: 100%;
    position: static;
    height: auto;
    max-height: 420px;
  }
}

/* --- User management --- */

.user-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.user-kpi-card {
  background-color: #fff;
  border-radius: 0.5rem;
  padding: 1.25rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.user-kpi-card-primary {
  background-color: #111827;
  color: #fff;
}

.user-kpi-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.user-kpi-card-primary .user-kpi-value {
  color: #fff;
}

.user-kpi-label {
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: 0.25rem;
}

.user-kpi-card-primary .user-kpi-label {
  color: rgba(255, 255, 255, 0.85);
}

.user-kpi-sub {
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.45);
  margin-top: 0.15rem;
}

.user-kpi-card-primary .user-kpi-sub {
  color: rgba(255, 255, 255, 0.55);
}

.user-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.user-breakdown-card {
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.user-breakdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.user-breakdown-header-phone {
  font-weight: 400;
  font-size: 0.8125rem;
  color: rgba(0, 0, 0, 0.45);
}

.user-breakdown-body {
  padding: 0 0.5rem 0.5rem;
}

.user-breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
}

.user-breakdown-row:nth-child(odd) {
  background-color: rgba(0, 0, 0, 0.025);
}

.user-breakdown-empty {
  padding: 1rem;
  font-size: 0.8125rem;
  color: rgba(0, 0, 0, 0.4);
}

.user-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  background-color: #fff;
  border-radius: 0.5rem;
  padding: 0.6rem 0.85rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.user-filter-search {
  flex: 1 1 240px;
  min-width: 200px;
}

.user-filter-tabs {
  display: flex;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.04);
  border-radius: 0.4rem;
  padding: 0.2rem;
  flex-shrink: 0;
}

.user-filter-tab {
  padding: 0.35rem 0.85rem;
  border-radius: 0.3rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.55);
  text-decoration: none;
  white-space: nowrap;
}

.user-filter-tab:hover {
  color: rgba(0, 0, 0, 0.8);
}

.user-filter-tab.active {
  background-color: #111827;
  color: #fff;
}

.user-filter-count {
  font-size: 0.8125rem;
  color: rgba(0, 0, 0, 0.45);
  flex-shrink: 0;
  margin-left: auto;
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.user-status-dot {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
}

.user-status-dot::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #9ca3af;
}

.user-status-dot.active::before {
  background-color: #22c55e;
}

.user-status-dot.active {
  color: #15803d;
}

.user-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  background: none;
  color: rgba(0, 0, 0, 0.45);
  border-radius: 0.35rem;
}

.user-action-btn:hover {
  background-color: rgba(0, 0, 0, 0.06);
  color: rgba(0, 0, 0, 0.75);
}

.user-action-btn.text-danger:hover {
  background-color: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

.user-inbox-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.6rem;
}

.user-inbox-card {
  position: relative;
  display: block;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 0.5rem;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s ease-in-out, background-color 0.15s ease-in-out;
}

.user-inbox-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.user-inbox-card-name {
  font-weight: 700;
  font-size: 0.875rem;
}

.user-inbox-card-phone {
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.45);
}

.user-inbox-card:has(input:checked) {
  border-color: #1DAA61;
  background-color: rgba(29, 170, 97, 0.06);
}

.user-inbox-card:has(input:checked) .user-inbox-card-name {
  color: #178a4e;
}

@media (max-width: 991.98px) {
  .user-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .user-breakdown-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575.98px) {
  .user-kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Broadcast --- */

.broadcast-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.broadcast-kpi-card {
  background-color: #fff;
  border-radius: 0.5rem;
  padding: 1.25rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.broadcast-kpi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
}

.broadcast-kpi-icon-blue {
  background-color: #dbeafe;
  color: #2563eb;
}

.broadcast-kpi-icon-green {
  background-color: #dcfce7;
  color: #16a34a;
}

.broadcast-kpi-icon-gray {
  background-color: transparent;
  color: rgba(0, 0, 0, 0.4);
  margin-bottom: 0.5rem;
}

.broadcast-kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.broadcast-kpi-label {
  font-size: 0.8125rem;
  color: rgba(0, 0, 0, 0.55);
  margin-top: 0.15rem;
}

.broadcast-openrate-bar {
  width: 70px;
  height: 6px;
  border-radius: 999px;
  background-color: rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.broadcast-openrate-fill {
  height: 100%;
  background-color: #22c55e;
  border-radius: 999px;
}

@media (max-width: 991.98px) {
  .broadcast-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 575.98px) {
  .broadcast-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.broadcast-schedule-toggle {
  display: inline-flex;
  gap: 0.5rem;
}

.broadcast-target-box {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.5rem;
  overflow: hidden;
}

.broadcast-target-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background-color: rgba(0, 0, 0, 0.03);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: rgba(0, 0, 0, 0.5);
}

.broadcast-target-body {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.broadcast-target-summary {
  padding: 0.6rem 1rem;
  background-color: rgba(217, 253, 211, 0.6);
  color: #178a4e;
  font-size: 0.875rem;
  font-weight: 500;
}

/* --- Switch (Uiverse.io by Galahhad) --- */

.switch {
  /* switch */
  --switch-width: 46px;
  --switch-height: 24px;
  --switch-bg: rgb(131, 131, 131);
  --switch-checked-bg: rgb(0, 218, 80);
  --switch-offset: calc((var(--switch-height) - var(--circle-diameter)) / 2);
  --switch-transition: all .2s cubic-bezier(0.27, 0.2, 0.25, 1.51);
  /* circle */
  --circle-diameter: 18px;
  --circle-bg: #fff;
  --circle-shadow: 1px 1px 2px rgba(146, 146, 146, 0.45);
  --circle-checked-shadow: -1px 1px 2px rgba(163, 163, 163, 0.45);
  --circle-transition: var(--switch-transition);
  /* icon */
  --icon-transition: all .2s cubic-bezier(0.27, 0.2, 0.25, 1.51);
  --icon-cross-color: var(--switch-bg);
  --icon-cross-size: 6px;
  --icon-checkmark-color: var(--switch-checked-bg);
  --icon-checkmark-size: 10px;
  /* effect line */
  --effect-width: calc(var(--circle-diameter) / 2);
  --effect-height: calc(var(--effect-width) / 2 - 1px);
  --effect-bg: var(--circle-bg);
  --effect-border-radius: 1px;
  --effect-transition: all .2s ease-in-out;
}

.switch input {
  display: none;
}

.switch {
  display: inline-block;
}

.switch svg {
  transition: var(--icon-transition);
  position: absolute;
  height: auto;
}

.switch .checkmark {
  width: var(--icon-checkmark-size);
  color: var(--icon-checkmark-color);
  transform: scale(0);
}

.switch .cross {
  width: var(--icon-cross-size);
  color: var(--icon-cross-color);
}

.switch .slider {
  box-sizing: border-box;
  width: var(--switch-width);
  height: var(--switch-height);
  background: var(--switch-bg);
  border-radius: 999px;
  display: flex;
  align-items: center;
  position: relative;
  transition: var(--switch-transition);
  cursor: pointer;
}

.switch .circle {
  width: var(--circle-diameter);
  height: var(--circle-diameter);
  background: var(--circle-bg);
  border-radius: inherit;
  box-shadow: var(--circle-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--circle-transition);
  z-index: 1;
  position: absolute;
  left: var(--switch-offset);
}

.switch .slider::before {
  content: "";
  position: absolute;
  width: var(--effect-width);
  height: var(--effect-height);
  left: calc(var(--switch-offset) + (var(--effect-width) / 2));
  background: var(--effect-bg);
  border-radius: var(--effect-border-radius);
  transition: var(--effect-transition);
}

/* actions */

.switch input:checked + .slider {
  background: var(--switch-checked-bg);
}

.switch input:checked + .slider .checkmark {
  transform: scale(1);
}

.switch input:checked + .slider .cross {
  transform: scale(0);
}

.switch input:checked + .slider::before {
  left: calc(100% - var(--effect-width) - (var(--effect-width) / 2) - var(--switch-offset));
}

.switch input:checked + .slider .circle {
  left: calc(100% - var(--circle-diameter) - var(--switch-offset));
  box-shadow: var(--circle-checked-shadow);
}

/* --- General settings --- */

.settings-unit-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.5rem;
  background-color: rgba(0, 0, 0, 0.03);
  margin-bottom: 0.5rem;
}

.settings-unit-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #22c55e;
  flex-shrink: 0;
}

.settings-unit-name {
  flex: 1 1 auto;
  font-size: 0.9rem;
  color: #1d4ed8;
  font-weight: 500;
}

.settings-unit-delete {
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.15s ease-in-out;
}

.settings-unit-row:hover .settings-unit-delete {
  opacity: 1;
}

/* --- Material-style multi-select (chips + checkbox dropdown) --- */

.mdb-multiselect {
  position: relative;
}

.mdb-multiselect-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: calc(1.5em + 0.75rem + 2px);
  padding: 0.375rem 0.75rem;
  border: 1px solid #ced4da;
  border-radius: 0.5rem;
  background-color: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.mdb-multiselect-control:hover {
  border-color: #adb5bd;
}

.mdb-multiselect.open .mdb-multiselect-control {
  border-color: #1DAA61;
  box-shadow: 0 0 0 0.15rem rgba(29, 170, 97, 0.15);
}

.mdb-multiselect-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex: 1 1 auto;
  min-width: 0;
}

.mdb-multiselect-placeholder {
  color: var(--bs-secondary-color, #6c757d);
  font-size: 0.875rem;
}

.mdb-multiselect-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background-color: rgba(29, 170, 97, 0.12);
  color: #157a45;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.mdb-multiselect-chip-remove {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  opacity: 0.7;
}

.mdb-multiselect-chip-remove:hover {
  opacity: 1;
}

.mdb-multiselect-caret {
  flex-shrink: 0;
  color: var(--bs-secondary-color, #6c757d);
  transition: transform 0.15s ease-in-out;
}

.mdb-multiselect.open .mdb-multiselect-caret {
  transform: rotate(180deg);
}

.mdb-multiselect-panel {
  display: none;
  position: absolute;
  z-index: 1050;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background-color: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  padding: 0.25rem 0;
}

.mdb-multiselect.open .mdb-multiselect-panel {
  display: block;
}

.mdb-multiselect-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.875rem;
}

.mdb-multiselect-option:hover {
  background-color: rgba(29, 170, 97, 0.08);
}

.mdb-multiselect-option.selected {
  color: #157a45;
  font-weight: 500;
}

.mdb-multiselect-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1.5px solid #adb5bd;
  border-radius: 3px;
  flex-shrink: 0;
  color: #fff;
}

.mdb-multiselect-option.selected .mdb-multiselect-check {
  background-color: #1DAA61;
  border-color: #1DAA61;
}