@font-face {
  font-family: "SFUIText";
  src: url("assets/fonts/sfuitext_regular.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --page: #F6F7FB;
  --shell: #F6F7FB;
  --sidebar: #FFFFFF;
  --sidebar-soft: #FFE4EE;
  --panel: #FFFFFF;
  --panel-soft: #F6F7FB;
  --ink: #1C1E21;
  --muted: #526177;
  --faint: #6B7280;
  --line: #EEF0F4;
  --line-strong: #E2E5EB;
  --purple: #E60067;
  --blue: #E60067;
  --green: #20C786;
  --green-soft: #E6FBF2;
  --red: #FF4D5E;
  --red-soft: #FFE4EE;
  --orange: #F59E0B;
  --orange-soft: #FEF3C7;
  --brand-primary: #E60067;
  --brand-primary-dark: #C2185B;
  --brand-primary-light: #FFE4EE;
  --brand-gradient-end: #D81B60;
  --shadow: 0 8px 30px rgba(28, 30, 33, 0.06), 0 2px 8px rgba(28, 30, 33, 0.04);
  --soft-shadow: 0 4px 20px rgba(230, 0, 103, 0.08);
  color-scheme: light;
  font-family: "Inter", "SF Pro Display", -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(230, 0, 103, 0.25) transparent;
}

html {
  min-height: 100%;
  background: var(--page);
  scroll-behavior: smooth;
}

html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(230, 0, 103, 0.25);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
  transition: background-color 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(230, 0, 103, 0.6);
  background-clip: content-box;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--page);
  color: var(--ink);
  letter-spacing: 0;
  overflow-x: hidden;
}

.workspace,
.livechat-thread-list,
.livechat-messages,
.table-wrap,
.category-tabs,
.nav-list,
.detail-panel,
.attachment-viewer-body {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

a {
  color: inherit;
}

/* Universal accessible keyboard focus ring (WCAG 2.4.7 & R-32) */
:focus-visible {
  outline: 2.5px solid #E60067 !important;
  outline-offset: 2px !important;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2.5px solid #E60067 !important;
  outline-offset: 2px !important;
}

body.dark-mode :focus-visible {
  outline: 2.5px solid #F43F5E !important;
  outline-offset: 2px !important;
}

.hidden {
  display: none !important;
}

.lucide,
[data-lucide] {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 1.55rem;
  line-height: 1.08;
}

h2 {
  color: var(--ink);
  font-size: 1.55rem;
  line-height: 1.12;
}

h3 {
  color: var(--ink);
  font-size: 0.96rem;
  line-height: 1.2;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 15%, rgba(230, 0, 103, 0.08), transparent 380px),
    var(--shell);
}

.auth-card {
  width: min(440px, 100%);
  padding: 32px 28px;
  background: #FFFFFF;
  border: 1px solid #EEF0F4;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(28, 30, 33, 0.08);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 0;
  object-fit: contain;
  background: transparent;
  box-shadow: none;
}

.brand-logo.small {
  width: 36px;
  height: 36px;
  border: 0;
  box-shadow: none;
}

.brand-row h1 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #1C1E21;
  margin: 0;
}

.brand-row p {
  color: #8E95A2;
  font-size: 0.82rem;
  margin: 2px 0 0;
}

.sidebar-brand span,
.muted,
.detail-empty span {
  color: var(--muted);
}

.field {
  display: grid;
  gap: 7px;
  margin-top: 18px;
}

.field span {
  color: #1C1E21;
  font-size: 0.86rem;
  font-weight: 700;
}

.field input,
.field textarea,
.field select,
.search-input,
.inline-form input,
#emailInput,
#passwordInput,
.auth-card input,
#loginForm input {
  width: 100%;
  min-height: 46px;
  border: 1.5px solid #EEF0F4 !important;
  border-radius: 12px;
  padding: 0 14px;
  background-color: #F6F7FB !important;
  background: #F6F7FB !important;
  color: #1C1E21 !important;
  -webkit-text-fill-color: #1C1E21 !important;
  caret-color: #E60067 !important;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

#emailInput::selection,
#passwordInput::selection,
.auth-card input::selection,
.field input::selection {
  background: #FFE4EE !important;
  color: #E60067 !important;
  -webkit-text-fill-color: #E60067 !important;
}

.field input::placeholder,
.field textarea::placeholder,
.search-input::placeholder,
.inline-form input::placeholder,
#emailInput::placeholder,
#passwordInput::placeholder {
  color: #8E95A2 !important;
  -webkit-text-fill-color: #8E95A2 !important;
  opacity: 1;
}

.field textarea {
  min-height: 120px;
  padding: 12px;
  resize: vertical;
}

.field select {
  appearance: none;
  padding-right: 34px;
  background-image:
    linear-gradient(45deg, transparent 50%, #8E95A2 50%),
    linear-gradient(135deg, #8E95A2 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 18px,
    calc(100% - 13px) 18px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.field input[type="file"] {
  padding: 9px 12px;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.search-input:focus,
.inline-form input:focus {
  border-color: #E60067 !important;
  background: #FFFFFF !important;
  box-shadow: 0 0 0 3px rgba(230, 0, 103, 0.16) !important;
}

/* Browser Autofill Styling (Chrome, Edge, Safari) */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
  -webkit-text-fill-color: #1C1E21 !important;
  -webkit-box-shadow: 0 0 0 1000px #FFFFFF inset !important;
  box-shadow: 0 0 0 1000px #FFFFFF inset !important;
  border-color: #E60067 !important;
  caret-color: #E60067 !important;
  transition: background-color 5000s ease-in-out 0s;
  font-family: inherit;
}

.search-shell {
  width: min(260px, 34vw);
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
}

.search-shell:focus-within {
  border-color: #E60067;
  box-shadow: 0 0 0 3px rgba(230, 0, 103, 0.14);
}

.search-shell .search-input {
  min-height: 38px;
  padding: 0;
  border: 0 !important;
  border-radius: 0;
  box-shadow: none !important;
  background: transparent !important;
}

.primary-button,
.secondary-button,
.nav-button,
.text-button,
.small-button {
  min-height: 40px;
  border-radius: 10px;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  white-space: nowrap;
}

.primary-button {
  width: 100%;
  margin-top: 20px;
  padding: 0 14px;
  background: linear-gradient(135deg, #E60067 0%, #D81B60 100%);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(230, 0, 103, 0.28);
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}

.primary-button:hover {
  background: linear-gradient(135deg, #C2185B 0%, #AD1457 100%);
  box-shadow: 0 10px 26px rgba(230, 0, 103, 0.4);
  transform: translateY(-2px);
}

.primary-button:active,
.secondary-button:active,
.small-button:active,
.nav-button:active {
  transform: scale(0.95) !important;
}

.primary-button.slim {
  width: auto;
  min-width: 98px;
  margin-top: 0;
}

.secondary-button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: #FFFFFF;
  color: var(--ink);
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(28, 30, 33, 0.03);
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}

.secondary-button.slim {
  min-width: 98px;
  margin-top: 0;
}

.secondary-button:hover,
.small-button:hover {
  border-color: #FFD0E2;
  background: #FFE4EE;
  color: #E60067;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(230, 0, 103, 0.12);
}

.secondary-button.danger,
.small-button.danger {
  color: var(--red);
  border-color: #ffd0db;
}

.secondary-button.danger:hover,
.small-button.danger:hover {
  background: #FFF1F2;
  border-color: #FECDD3;
  color: #E11D48;
}

.text-button {
  min-height: 32px;
  padding: 0 4px;
  background: transparent;
  color: #E60067;
  font-size: 0.82rem;
  font-weight: 900;
}

.form-message {
  min-height: 22px;
  margin-top: 12px;
  color: var(--red);
  font-size: 0.9rem;
}

.setup-box {
  display: grid;
  gap: 8px;
  margin: 22px 0;
  padding: 14px;
  background: var(--orange-soft);
  border: 1px solid #ffd98c;
  border-radius: 8px;
}

code {
  display: block;
  white-space: normal;
  word-break: break-word;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.9rem;
}

.app-shell {
  --sidebar-width: 68px;
  --detail-width: 318px;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  height: 100dvh;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  position: relative;
  background: #F6F7FB;
  border: 0;
  box-shadow: none;
  transition: grid-template-columns 0.24s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-shell.detail-open {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--detail-width);
}

@supports selector(:has(*)) {
  .app-shell:has(.detail-panel.has-content) {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--detail-width);
  }
}

.sidebar-toggle-btn,
.sidebar-close-btn,
.sidebar-backdrop {
  display: none !important;
}

.sidebar-brand-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sidebar-brand-main img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 8px;
  flex-shrink: 0;
  display: block;
}

.sidebar-brand-text {
  min-width: 0;
  overflow: hidden;
  transition: opacity 0.2s ease, width 0.2s ease;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sidebar-brand strong,
.sidebar-brand span {
  display: block;
  white-space: nowrap;
}

.sidebar-brand strong {
  color: #1C1E21;
  font-size: 0.88rem;
  line-height: 1.1;
  font-weight: 800;
}

.sidebar-brand span {
  color: #8E95A2;
  font-size: 0.72rem;
}

.nav-list {
  display: grid;
  gap: 5px;
}

.nav-group-label {
  margin: 10px 10px 2px;
  color: #8E95A2;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.nav-button {
  position: relative;
  width: 100%;
  justify-content: flex-start;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #64748B;
  font-weight: 750;
  font-size: 0.88rem;
  gap: 12px;
  display: flex;
  align-items: center;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-button span {
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.nav-button svg,
.nav-button i {
  color: #8E95A2;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  transition: color 0.2s ease, transform 0.2s ease;
}

/* Colorful Custom Hover & Active States per Nav Section */
.nav-button:hover {
  transform: translateX(2px);
}

.nav-button[data-view="dashboard"]:hover,
.nav-button[data-view="dashboard"].is-active {
  background: #FFE4EE;
  border-color: #FFD0E2;
  color: #E60067;
}
.nav-button[data-view="dashboard"].is-active svg,
.nav-button[data-view="dashboard"]:hover svg { color: #E60067; }

.nav-button[data-view="users"]:hover,
.nav-button[data-view="users"].is-active {
  background: #EFF6FF;
  border-color: #DBEAFE;
  color: #2563EB;
}
.nav-button[data-view="users"].is-active svg,
.nav-button[data-view="users"]:hover svg { color: #2563EB; }

.nav-button[data-view="rooms"]:hover,
.nav-button[data-view="rooms"].is-active {
  background: #F0F9FF;
  border-color: #E0F2FE;
  color: #0284C7;
}
.nav-button[data-view="rooms"].is-active svg,
.nav-button[data-view="rooms"]:hover svg { color: #0284C7; }

.nav-button[data-view="sos"]:hover,
.nav-button[data-view="sos"].is-active,
.nav-button[data-view="soslivechat"]:hover,
.nav-button[data-view="soslivechat"].is-active,
.nav-button[data-view="livemap"]:hover,
.nav-button[data-view="livemap"].is-active {
  background: #FFF1F2;
  border-color: #FFE4E6;
  color: #E11D48;
}
.nav-button[data-view="sos"].is-active svg,
.nav-button[data-view="sos"]:hover svg,
.nav-button[data-view="soslivechat"].is-active svg,
.nav-button[data-view="soslivechat"]:hover svg,
.nav-button[data-view="livemap"].is-active svg,
.nav-button[data-view="livemap"]:hover svg { color: #E11D48; }

.nav-button[data-view="reports"]:hover,
.nav-button[data-view="reports"].is-active {
  background: #FFF7ED;
  border-color: #FFEDD5;
  color: #EA580C;
}
.nav-button[data-view="reports"].is-active svg,
.nav-button[data-view="reports"]:hover svg { color: #EA580C; }

.nav-button[data-view="notices"]:hover,
.nav-button[data-view="notices"].is-active {
  background: #FFFBEB;
  border-color: #FEF3C7;
  color: #D97706;
}
.nav-button[data-view="notices"].is-active svg,
.nav-button[data-view="notices"]:hover svg { color: #D97706; }

.nav-button[data-view="livechat"]:hover,
.nav-button[data-view="livechat"].is-active {
  background: #ECFDF5;
  border-color: #D1FAE5;
  color: #059669;
}
.nav-button[data-view="livechat"].is-active svg,
.nav-button[data-view="livechat"]:hover svg { color: #059669; }

.nav-button[data-view="aichat"]:hover,
.nav-button[data-view="aichat"].is-active {
  background: #F5F3FF;
  border-color: #EDE9FE;
  color: #7C3AED;
}
.nav-button[data-view="aichat"].is-active svg,
.nav-button[data-view="aichat"]:hover svg { color: #7C3AED; }

.nav-button[data-view="highlights"]:hover,
.nav-button[data-view="highlights"].is-active {
  background: #FDF2F8;
  border-color: #FCE7F3;
  color: #DB2777;
}
.nav-button[data-view="highlights"].is-active svg,
.nav-button[data-view="highlights"]:hover svg { color: #DB2777; }

.nav-button[data-view="logs"]:hover,
.nav-button[data-view="logs"].is-active {
  background: #ECFEFF;
  border-color: #CFFAFE;
  color: #0891B2;
}
.nav-button[data-view="logs"].is-active svg,
.nav-button[data-view="logs"]:hover svg { color: #0891B2; }

.nav-button[data-view="admins"]:hover,
.nav-button[data-view="admins"].is-active {
  background: #EEF2FF;
  border-color: #E0E7FF;
  color: #4F46E5;
}
.nav-button[data-view="admins"].is-active svg,
.nav-button[data-view="admins"]:hover svg { color: #4F46E5; }

.nav-button.has-dot::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 12px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #E60067;
  box-shadow: 0 0 0 3px rgba(230, 0, 103, 0.2);
  transform: translateY(-50%);
}

/* ==========================================================================
   PERMANENT CLEAN SIDEBAR SYSTEM
   ========================================================================== */
.sidebar {
  grid-column: 1;
  position: relative;
  width: 68px;
  height: 100%;
  padding: 16px 8px;
  overflow-x: visible;
  overflow-y: hidden;
  background: #FFFFFF;
  border-right: 1px solid #EEF0F4;
  z-index: 50;
  display: flex;
  flex-direction: column;
  transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1), padding 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Centered logo in mini mode */
.sidebar .sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 14px;
  margin-bottom: 12px;
  border-bottom: 1px solid #EEF0F4;
}

.sidebar .sidebar-brand-main {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.sidebar .sidebar-brand-main img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  object-fit: contain;
}

.sidebar .sidebar-brand-text {
  display: none;
}

/* Centered mini section labels like OVERVIEW, MANAGE */
.sidebar .nav-group-label {
  display: block;
  font-size: 0.56rem;
  font-weight: 800;
  text-align: center;
  color: #8E95A2;
  letter-spacing: 0.06em;
  margin: 10px 0 4px;
  padding: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Centered icon buttons with rounded square pills */
.sidebar .nav-button {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  margin: 0 auto 4px;
  justify-content: center;
  align-items: center;
  border-radius: 12px;
  position: relative;
  transform: none !important;
  display: flex;
  cursor: pointer;
}

.sidebar .nav-button span {
  display: none;
}

.sidebar .nav-button svg,
.sidebar .nav-button i {
  width: 20px;
  height: 20px;
  margin: 0;
}

.sidebar .nav-button.has-dot::after {
  right: 4px;
  top: 4px;
  width: 6px;
  height: 6px;
  transform: none;
}

/* FLOATING BLACK TOOLTIP on mini buttons */
.sidebar .nav-button::before {
  content: attr(data-label);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) scale(0.92);
  transform-origin: left center;
  background: #111318;
  color: #FFFFFF;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  transition: opacity 0.16s cubic-bezier(0.4, 0, 0.2, 1), transform 0.16s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9999;
}

.sidebar .nav-button::after {
  content: "";
  position: absolute;
  left: calc(100% + 4px);
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: #111318;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9999;
}

.sidebar .nav-button:hover::before {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.sidebar .nav-button:hover::after {
  opacity: 1;
}

/* ==========================================================
   HOVER EXPANSION STATE (When cursor enters sidebar)
   ========================================================== */
.sidebar:hover {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 236px;
  padding: 18px 14px;
  background: #FFFFFF;
  box-shadow: 14px 0 40px rgba(28, 30, 33, 0.14), 0 0 0 1px #EEF0F4;
  z-index: 1000;
}

.sidebar:hover .sidebar-brand {
  padding: 0 4px 16px;
  justify-content: flex-start;
}

.sidebar:hover .sidebar-brand-main {
  justify-content: flex-start;
  width: auto;
}

.sidebar:hover .sidebar-brand-text {
  display: block !important;
  opacity: 1;
  animation: sidebar-fade-in 0.22s ease forwards;
}

.sidebar:hover .nav-group-label {
  display: block;
  text-align: left;
  font-size: 0.68rem;
  margin: 10px 10px 2px;
  padding: 0 4px;
  opacity: 1;
  animation: sidebar-fade-in 0.22s ease forwards;
}

.sidebar:hover .nav-button {
  width: 100%;
  height: auto;
  min-height: 40px;
  padding: 0 14px;
  justify-content: flex-start;
  margin: 0 0 4px;
  border-radius: 10px;
  transform: none;
}

.sidebar:hover .nav-button:hover {
  transform: translateX(2px) !important;
}

.sidebar:hover .nav-button span {
  display: inline-block !important;
  opacity: 1;
  animation: sidebar-fade-in 0.22s ease forwards;
}

.sidebar:hover .nav-button svg,
.sidebar:hover .nav-button i {
  width: 18px;
  height: 18px;
  margin-right: 12px;
}

.sidebar:hover .nav-button::before,
.sidebar:hover .nav-button::after {
  display: none !important;
}

@keyframes sidebar-fade-in {
  from { opacity: 0; transform: translateX(-4px); }
  to { opacity: 1; transform: translateX(0); }
}

.workspace {
  grid-column: 2 !important;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 24px 32px 48px;
  overflow-y: auto;
  background: #F6F7FB;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.topbar {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 4px;
  width: 100%;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-left h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: #1C1E21;
  line-height: 1.2;
  margin: 0;
}

.topbar-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #E60067;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #20C786;
  box-shadow: 0 0 0 4px rgba(32, 199, 134, 0.18);
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.8; }
}

.view-section {
  display: grid;
  gap: 20px;
  width: 100%;
}

/* ── Live Map: 100% edge-to-edge full map, remove topbar, toolbar, legend ── */
.workspace:has(#livemapView:not(.hidden)),
body.is-livemap-active .workspace {
  padding: 0 !important;
  gap: 0 !important;
  overflow: hidden !important;
  height: 100vh !important;
}

.workspace:has(#livemapView:not(.hidden)) .topbar,
body.is-livemap-active .topbar,
#livemapView .livemap-toolbar,
#livemapView .livemap-legend {
  display: none !important;
}

#livemapView:not(.hidden) {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  width: 100% !important;
  overflow: hidden !important;
  animation: none !important;
}

.livemap-container {
  flex: 1 1 100% !important;
  min-height: 0 !important;
  height: 100% !important;
  width: 100% !important;
  position: relative !important;
  background-color: #aad3df !important;
}

.livemap-container .leaflet-container {
  background-color: #aad3df !important;
  outline: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

body.dark-mode .livemap-container,
body.dark-mode .livemap-container .leaflet-container,
.dark-mode .livemap-container,
.dark-mode .livemap-container .leaflet-container {
  background-color: #1e293b !important;
}

/* ── Live Map Sidepanel & High Contrast Dark Mode ── */
.livemap-sidepanel {
  position: absolute;
  top: 0;
  right: 0;
  width: 320px;
  height: 100%;
  background: var(--surface, #ffffff);
  border-left: 1px solid var(--border, #e2e8f0);
  z-index: 410;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 20px rgba(0,0,0,0.18);
  transition: transform 0.2s ease;
}
.livemap-sidepanel.hidden {
  display: none !important;
}
.livemap-sidepanel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border, #e2e8f0);
}
.livemap-sidepanel-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text, #0f172a);
}
.livemap-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted, #64748b);
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
}
.livemap-close-btn:hover {
  background: var(--bg-hover, #f1f5f9);
  color: var(--text, #0f172a);
}
.livemap-sidepanel-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  font-size: 0.85rem;
}
.livemap-user-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border, #e2e8f0);
}
.livemap-user-avatar-wrap {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  overflow: hidden;
  border-width: 3px;
  border-style: solid;
  flex-shrink: 0;
  background: #FFE4EE;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.livemap-user-meta {
  min-width: 0;
  flex: 1;
}
.livemap-user-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text, #0f172a);
  line-height: 1.3;
  word-break: break-word;
}
.livemap-user-email {
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
  word-break: break-all;
  margin-top: 3px;
}
.livemap-detail-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 15px;
}
.livemap-detail-row label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}
.livemap-detail-row span {
  color: #0f172a;
  font-weight: 600;
  font-size: 0.94rem;
  word-break: break-word;
}
.livemap-detail-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  width: fit-content;
}
.livemap-detail-badge.online { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.livemap-detail-badge.recent { background: #fef9c3; color: #92400e; border: 1px solid #fde68a; }
.livemap-detail-badge.offline { background: #f1f5f9; color: #334155; border: 1px solid #cbd5e1; }
.livemap-detail-badge.sos { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.livemap-detail-badge.report { background: #ede9fe; color: #6d28d9; border: 1px solid #ddd6fe; }

/* ── Dark Mode Contrast Enhancements ── */
body.dark-mode .livemap-sidepanel,
.dark-mode .livemap-sidepanel {
  background: #182234 !important;
  border-color: #27354A !important;
  color: #F9FAFB !important;
}
body.dark-mode .livemap-sidepanel-header,
.dark-mode .livemap-sidepanel-header,
body.dark-mode .livemap-user-header,
.dark-mode .livemap-user-header {
  border-color: #27354A !important;
}
body.dark-mode .livemap-sidepanel-header h3,
.dark-mode .livemap-sidepanel-header h3,
body.dark-mode .livemap-user-name,
.dark-mode .livemap-user-name {
  color: #FFFFFF !important;
}
body.dark-mode .livemap-user-email,
.dark-mode .livemap-user-email {
  color: #CBD5E1 !important;
}
body.dark-mode .livemap-close-btn,
.dark-mode .livemap-close-btn {
  color: #CBD5E1 !important;
}
body.dark-mode .livemap-close-btn:hover,
.dark-mode .livemap-close-btn:hover {
  background: #27354A !important;
  color: #FFFFFF !important;
}
body.dark-mode .livemap-detail-row label,
.dark-mode .livemap-detail-row label {
  color: #94A3B8 !important;
}
body.dark-mode .livemap-detail-row span,
.dark-mode .livemap-detail-row span {
  color: #F9FAFB !important;
}
body.dark-mode .livemap-detail-badge.offline,
.dark-mode .livemap-detail-badge.offline {
  background: #27354A !important;
  color: #E2E8F0 !important;
  border: 1px solid #3B4D66 !important;
}
body.dark-mode .livemap-detail-badge.online,
.dark-mode .livemap-detail-badge.online {
  background: rgba(34, 197, 94, 0.22) !important;
  color: #4ADE80 !important;
  border: 1px solid rgba(34, 197, 94, 0.45) !important;
}
body.dark-mode .livemap-detail-badge.recent,
.dark-mode .livemap-detail-badge.recent {
  background: rgba(245, 158, 11, 0.22) !important;
  color: #FBBF24 !important;
  border: 1px solid rgba(245, 158, 11, 0.45) !important;
}
body.dark-mode .livemap-detail-badge.sos,
.dark-mode .livemap-detail-badge.sos {
  background: rgba(239, 68, 68, 0.28) !important;
  color: #F87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.55) !important;
}
body.dark-mode .livemap-detail-badge.report,
.dark-mode .livemap-detail-badge.report {
  background: rgba(139, 92, 246, 0.28) !important;
  color: #C084FC !important;
  border: 1px solid rgba(139, 92, 246, 0.55) !important;
}

.view-section:not(.hidden) {
  animation: view-fade-up 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes view-fade-up {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dashboard-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: -6px;
}

.dashboard-date-pill {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid #EEF0F4;
  border-radius: 10px;
  background: #FFFFFF;
  color: #1C1E21;
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(28, 30, 33, 0.04);
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dashboard-date-pill:hover {
  border-color: #FFD0E2;
  background: #FFE4EE;
  color: #E60067;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(230, 0, 103, 0.12);
}

.dashboard-range-select {
  min-height: 32px;
  border: 0;
  background: transparent;
  color: #1C1E21;
  font: inherit;
  font-weight: 700;
  outline: none;
  appearance: none;
  cursor: pointer;
}

.dashboard-range-select option {
  color: #1C1E21;
}

/* ==========================================================================
   COLORFUL METRIC CARDS SYSTEM WITH BALANCED GRID PROPORTIONS
   ========================================================================== */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  width: 100%;
}

.metric-card,
.panel,
.detail-panel {
  background: #FFFFFF;
  border: 1px solid #EEF0F4;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(28, 30, 33, 0.04);
  transition: transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.24s ease, border-color 0.24s ease;
}

.panel {
  padding: 24px 26px;
  animation: panel-fade-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.panel-header h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #1C1E21;
  margin: 0;
}

@keyframes panel-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.metric-card {
  position: relative;
  min-height: 128px;
  padding: 22px 26px;
  overflow: hidden;
  animation: dashboard-card-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes dashboard-card-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.stat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.metric-copy {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.metric-label {
  color: #64748B;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-card strong {
  color: #1C1E21;
  font-size: 2.1rem;
  line-height: 1.1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  transition: transform 0.2s ease;
}

.metric-trend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  width: max-content;
  transition: transform 0.2s ease;
}

.metric-trend svg {
  width: 13px;
  height: 13px;
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  animation: icon-float 4s ease-in-out infinite alternate;
}

@keyframes icon-float {
  0% { transform: translateY(0); }
  100% { transform: translateY(-3px); }
}

.stat-icon svg {
  width: 28px;
  height: 28px;
}

.metric-card:hover .stat-icon {
  transform: scale(1.12) rotate(4deg) !important;
}

/* Colorful Card 1: Users (Royal Blue / Indigo) */
.stat-card.purple,
.stat-card.blue {
  background: linear-gradient(135deg, #FFFFFF 0%, #F5F8FF 100%);
  border: 1px solid #DBEAFE;
}
.stat-card.purple:hover,
.stat-card.blue:hover {
  border-color: #93C5FD;
  box-shadow: 0 14px 32px rgba(37, 99, 235, 0.14);
  transform: translateY(-4px) scale(1.015);
}
.stat-card.purple strong,
.stat-card.blue strong {
  color: #1E3A8A;
}
.stat-card.purple .stat-icon,
.stat-card.blue .stat-icon {
  background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
  color: #FFFFFF;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.32);
}
.stat-card.purple .metric-trend,
.stat-card.blue .metric-trend {
  background: #EFF6FF;
  color: #2563EB;
}

/* Colorful Card 2: Communication (Emerald Mint) */
.stat-card.green {
  background: linear-gradient(135deg, #FFFFFF 0%, #F0FDF4 100%);
  border: 1px solid #D1FAE5;
}
.stat-card.green:hover {
  border-color: #6EE7B7;
  box-shadow: 0 14px 32px rgba(16, 185, 129, 0.14);
  transform: translateY(-4px) scale(1.015);
}
.stat-card.green strong {
  color: #064E3B;
}
.stat-card.green .stat-icon {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #FFFFFF;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.32);
}
.stat-card.green .metric-trend {
  background: #ECFDF5;
  color: #059669;
}

/* Colorful Card 3: Emergency (Vibrant Pink / Crimson) */
.stat-card.red,
.stat-card.pink {
  background: linear-gradient(135deg, #FFFFFF 0%, #FFF1F5 100%);
  border: 1px solid #FFE4EE;
}
.stat-card.red:hover,
.stat-card.pink:hover {
  border-color: #FFB3D1;
  box-shadow: 0 14px 32px rgba(230, 0, 103, 0.18);
  transform: translateY(-4px) scale(1.015);
}
.stat-card.red strong,
.stat-card.pink strong {
  color: #881337;
}
.stat-card.red .stat-icon,
.stat-card.pink .stat-icon {
  background: linear-gradient(135deg, #E60067 0%, #D81B60 100%);
  color: #FFFFFF;
  box-shadow: 0 8px 20px rgba(230, 0, 103, 0.38);
}
.stat-card.red .metric-trend,
.stat-card.pink .metric-trend {
  background: #FFE4EE;
  color: #E60067;
}

/* ==========================================================================
   COLORFUL CHARTS & BALANCED ANALYTICS GRID
   ========================================================================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.9fr);
  gap: 20px;
  width: 100%;
}

.chart-panel {
  min-height: 420px;
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 16px;
}

.line-chart {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chart-legend,
.feature-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.chart-legend {
  min-height: 28px;
  margin-bottom: 6px;
  padding-left: 0;
}

.chart-legend-item,
.feature-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 750;
  padding: 6px 14px;
  border-radius: 999px;
  background: #F8FAFC;
  border: 1px solid #EEF0F4;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.15);
}

.chart-svg {
  width: 100%;
  height: 310px;
  min-height: 280px;
  display: block;
  overflow: visible;
  animation: chart-fade-in 260ms ease both;
}

.chart-value-badge {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.chart-grid-line {
  stroke: #EEF2F6;
  stroke-width: 1;
  animation: chart-fade-in 320ms ease both;
}

.chart-axis-text {
  fill: #8E95A2;
  font-size: 11px;
  font-weight: 600;
}

.chart-x-label {
  text-anchor: middle;
}

.chart-line {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: chart-line-draw 720ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: calc(var(--line-index) * 90ms);
}

.chart-point {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: chart-point-in 320ms ease forwards;
  animation-delay: calc(260ms + (var(--point-index) * 42ms));
}

.feature-chart-layout {
  min-height: 280px;
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  padding: 8px 0;
}

.feature-chart {
  display: grid;
  place-items: center;
}

.donut-chart {
  width: 168px;
  height: 168px;
  display: grid;
  place-items: center;
  animation: chart-soft-pop 420ms ease both;
}

.donut-chart.is-empty {
  color: #EEF2F6;
}

.donut-svg {
  width: 168px;
  height: 168px;
  overflow: visible;
  transform: rotate(-90deg);
}

.donut-track {
  fill: none;
  stroke: #F1F5F9;
  stroke-width: 24;
}

.donut-segment {
  fill: none;
  stroke-width: 24;
  stroke-dashoffset: var(--dash-offset);
  animation: donut-segment-in 640ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--segment-index) * 90ms);
}

.donut-center {
  fill: #FFFFFF;
  stroke: #EEF0F4;
  stroke-width: 1;
}

.feature-legend {
  align-items: stretch;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.feature-legend-item {
  width: 100%;
  justify-content: space-between;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
}

.feature-legend-item strong {
  color: #1C1E21;
  font-size: 0.85rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}



@keyframes chart-fade-in {
  from {
    opacity: 0.55;
  }
  to {
    opacity: 1;
  }
}

@keyframes chart-line-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes chart-point-in {
  from {
    opacity: 0;
    transform: scale(0.55);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes chart-soft-pop {
  from {
    opacity: 0.55;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes donut-segment-in {
  from {
    opacity: 0;
    stroke-dashoffset: 100;
  }
  to {
    opacity: 1;
    stroke-dashoffset: var(--dash-offset);
  }
}

@media (prefers-reduced-motion: reduce) {
  .metric-card,
  .chart-svg,
  .chart-grid-line,
  .chart-line,
  .chart-point,
  .donut-chart,
  .donut-segment {
    animation: none !important;
  }

  .chart-line {
    stroke-dashoffset: 0;
  }

  .chart-point,
  .donut-segment {
    opacity: 1;
  }
}

.panel {
  min-width: 0;
  padding: 14px;
}

.panel-header {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.history-controls,
.page-size-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.history-controls {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.page-size-field {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #d5dcf2;
  border-radius: 8px;
  background: #f8faff;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.page-size-field select {
  min-height: 28px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 850;
  outline: none;
}

.category-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f8ff;
}

.category-tab {
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  font-size: 0.82rem;
  font-weight: 850;
  white-space: nowrap;
}

.category-tab:hover {
  background: #fff;
  color: var(--ink);
}

.category-tab.is-active {
  border-color: #cdd8ff;
  background: #fff;
  color: var(--blue);
  box-shadow: 0 7px 16px rgba(40, 61, 140, 0.1);
}

.category-tab-count {
  min-width: 22px;
  min-height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f3f5fb;
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 900;
}

.category-tab.is-active .category-tab-count {
  background: #eef2ff;
  color: var(--blue);
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.pagination-actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.composer-buttons {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.notification-form {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(180px, 1fr);
  gap: 12px;
}

.notification-form .field {
  margin-top: 0;
}

.notification-message-field,
.notification-actions {
  grid-column: 1 / -1;
}

.notification-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.livechat-panel {
  height: calc(100vh - 132px);
  height: calc(100dvh - 132px);
  max-height: calc(100vh - 132px);
  max-height: calc(100dvh - 132px);
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.ai-chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.livechat-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
}

.livechat-thread-pane,
.livechat-conversation {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.livechat-thread-pane {
  overflow: hidden;
}

.livechat-thread-list {
  height: 100%;
  overflow-y: auto;
  padding: 8px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.livechat-thread {
  width: 100%;
  min-height: 78px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  text-align: left;
}

.livechat-thread:hover,
.livechat-thread.is-active {
  border-color: #cdd8ff;
  background: #f8faff;
  box-shadow: 0 7px 16px rgba(40, 61, 140, 0.08);
}

.livechat-thread-main,
.livechat-thread-head {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.livechat-thread-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.livechat-thread-main span:not(.status-pill),
.livechat-thread-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.livechat-unread {
  width: 9px;
  height: 9px;
  margin-top: 6px;
  border-radius: 999px;
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(255, 63, 99, 0.12);
}

.livechat-conversation {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.ai-chat-panel .livechat-conversation {
  grid-template-rows: auto minmax(0, 1fr);
}

.livechat-thread-pane,
.livechat-thread-list,
.livechat-conversation,
.livechat-messages {
  min-height: 0;
}

.livechat-conversation-header {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.livechat-header-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.livechat-messages {
  min-height: 260px;
  overflow-y: auto;
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.livechat-message {
  display: flex;
}

.livechat-message.from-admin {
  justify-content: flex-end;
}

.livechat-message.from-user,
.livechat-message.from-ai {
  justify-content: flex-start;
}

.livechat-message.from-system {
  justify-content: center;
  margin: 10px 0;
}

.livechat-bubble {
  max-width: min(620px, 76%);
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 5px 14px rgba(20, 26, 54, 0.05);
}

.livechat-message.from-admin .livechat-bubble {
  border-color: #d7d1ff;
  background: #f0edff;
}

.livechat-message.from-ai .livechat-bubble {
  border-color: #38bdf8;
  background: #f0f9ff;
  color: #0369a1;
}

.livechat-message.from-system .livechat-bubble {
  border-color: rgba(230, 0, 103, 0.25);
  background: #fff1f6;
  color: #be185d;
  font-size: 0.88rem;
  text-align: center;
  max-width: min(560px, 85%);
}

.badge-ai-pill {
  display: inline-block;
  padding: 1px 6px;
  font-size: 0.65rem;
  font-weight: 800;
  border-radius: 999px;
  background: #0ea5e9;
  color: #ffffff;
  margin-left: 4px;
  vertical-align: middle;
}

.badge-system-pill {
  display: inline-block;
  padding: 1px 6px;
  font-size: 0.65rem;
  font-weight: 800;
  border-radius: 999px;
  background: #ec4899;
  color: #ffffff;
  margin-left: 4px;
  vertical-align: middle;
}

.livechat-sender,
.livechat-bubble time {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
}

.livechat-bubble p {
  margin: 4px 0;
  color: inherit;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.livechat-attachment {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  margin-top: 6px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 850;
  text-decoration: none;
}

.livechat-attachment span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.livechat-image-preview {
  display: block;
  max-width: min(360px, 100%);
  max-height: 280px;
  margin-top: 7px;
  border-radius: 8px;
  object-fit: contain;
  border: 1px solid var(--line);
  background: #fff;
}

.livechat-bubble time {
  text-align: right;
  font-weight: 700;
}

.livechat-reply-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.livechat-reply-form textarea {
  width: 100%;
  min-height: 44px;
  max-height: 130px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  outline: none;
}

.livechat-reply-form textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(54, 87, 255, 0.12);
}

.livechat-reply-actions {
  display: inline-flex;
  align-items: stretch;
  gap: 8px;
}

.livechat-attach-wrap {
  position: relative;
  display: inline-flex;
}

.livechat-attach-button {
  width: 48px;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--purple);
  color: #fff;
  box-shadow: 0 10px 22px rgba(109, 93, 252, 0.22);
}

.livechat-attach-button:hover {
  background: #5f50f0;
}

.livechat-attach-button .lucide {
  width: 19px;
  height: 19px;
}

.livechat-attach-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 30;
  width: 214px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: #171818;
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.28);
}

.livechat-attach-menu button {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  background: transparent;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 900;
}

.livechat-attach-menu button:hover,
.livechat-attach-menu button:focus-visible {
  background: #2b2d30;
  outline: none;
}

.livechat-attach-menu .lucide {
  width: 18px;
  height: 18px;
}

.livechat-attach-menu .attach-document .lucide {
  color: #7c5cff;
}

.livechat-attach-menu .attach-photo .lucide {
  color: #00a8ff;
}

.livechat-attach-menu .attach-camera .lucide,
.livechat-attach-menu .attach-calendar .lucide {
  color: #ff2f80;
}

.livechat-attach-menu .attach-audio .lucide {
  color: #ff722c;
}

.livechat-selected-attachment {
  grid-column: 1 / -1;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid #d7d1ff;
  border-radius: 8px;
  background: #f7f5ff;
  color: var(--muted);
  font-size: 0.82rem;
}

.livechat-selected-attachment span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.livechat-selected-attachment strong {
  color: var(--ink);
}

.livechat-selected-attachment button {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1;
}

.livechat-selected-attachment button:hover {
  background: #ebe7ff;
  color: var(--ink);
}

.livechat-empty {
  min-height: 180px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.livechat-empty.inline {
  min-height: 130px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #fff;
}

.livechat-empty strong {
  color: var(--ink);
}

.compact-list {
  display: grid;
  gap: 8px;
}

.list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.list-item strong,
.cell-main strong {
  display: block;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.list-item span,
.cell-main span,
.cell-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 12px;
  border-radius: 999px;
  background: #E8ECFF;
  color: #2563EB;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.status-pill.alert {
  background: #FFE4EE;
  color: #E60067;
  box-shadow: 0 0 0 0 rgba(230, 0, 103, 0.4);
  animation: sos-radar-pulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes sos-radar-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(230, 0, 103, 0.45);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(230, 0, 103, 0);
  }
}

.status-pill.warn {
  background: #FFF7ED;
  color: #EA580C;
}

.status-pill.good {
  background: #ECFDF5;
  color: #059669;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  animation: live-green-pulse 2.5s infinite ease-in-out;
}

.status-pill.neutral {
  background: #F1F5F9;
  color: #64748B;
  box-shadow: none;
  animation: none;
}

.user-filter-pills .small-button {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary, #64748b);
  transition: all 0.2s ease;
}

.user-filter-pills .small-button.is-active {
  background: var(--surface, #ffffff);
  color: var(--text-primary, #0f172a);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #EEF0F4;
  border-radius: 12px;
  margin-top: 14px;
  background: #FFFFFF;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

tbody tr {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s ease, box-shadow 0.2s ease;
}

th,
td {
  padding: 14px 18px;
  border-bottom: 1px solid #EEF0F4;
  text-align: left;
  vertical-align: middle;
  transition: all 0.2s ease;
}

th {
  color: #64748B;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
}

td {
  font-size: 0.9rem;
  color: #1C1E21;
}

tr:hover td {
  background: #FFF5F8;
}

tbody tr:hover {
  transform: translateX(4px);
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 230px;
}

.avatar {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #dfe5fb;
  background: #eef1ff;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 900;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar.avatar-default svg {
  width: 20px;
  height: 20px;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.small-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 850;
}

.small-button.is-current {
  border-color: #cdd8ff;
  background: #eef2ff;
  color: var(--blue);
}

.small-button .status-pill {
  pointer-events: none;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 14px;
}

.alert-text {
  color: var(--red);
}

.detail-panel {
  position: sticky;
  top: 0;
  height: calc(100vh - 16px);
  overflow: hidden;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
  box-shadow: none;
}

.detail-content {
  height: 100%;
  overflow-y: auto;
  padding: 16px 16px 22px;
}

.detail-resize-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -5px;
  width: 10px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: ew-resize;
  touch-action: none;
  z-index: 2;
}

.detail-resize-handle::after {
  content: "";
  position: absolute;
  top: 16px;
  bottom: 16px;
  left: 4px;
  width: 2px;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background 140ms ease;
}

.detail-resize-handle:hover::after,
.detail-resize-handle:focus-visible::after,
.detail-resize-handle.is-dragging::after {
  background: var(--blue);
}

.detail-resize-handle:focus-visible {
  outline: none;
}

body.detail-resizing {
  cursor: ew-resize;
  user-select: none;
}

.detail-panel.has-content {
  display: block !important;
}

.detail-empty {
  min-height: 220px;
  display: grid;
  place-content: center;
  gap: 6px;
  text-align: center;
}

.detail-empty strong {
  color: var(--ink);
}

.detail-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.detail-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.detail-title h3 {
  font-size: 1.02rem;
}

.detail-title .muted {
  display: block;
  max-width: 210px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-section {
  display: grid;
  gap: 8px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.detail-header + .detail-section {
  border-top: 0;
}

.detail-text {
  color: var(--ink);
  line-height: 1.48;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.report-attachment-grid {
  display: grid;
  gap: 8px;
}

.report-attachment-card {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--panel-soft);
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 850;
  text-decoration: none;
}

.report-attachment-button {
  cursor: pointer;
  text-align: left;
}

.report-attachment-button:hover {
  border-color: #cdd8ff;
  background: #f8faff;
}

.report-attachment-card span {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-attachment-card em {
  color: var(--blue);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 900;
}

.report-attachment-preview {
  width: 54px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: cover;
  background: #fff;
}

.attachment-viewer-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
}

.attachment-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 14, 28, 0.68);
  backdrop-filter: blur(4px);
}

.attachment-viewer-shell {
  position: relative;
  z-index: 1;
  width: min(940px, 100%);
  max-height: min(86vh, 760px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.attachment-viewer-header {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.attachment-viewer-header h3,
.attachment-viewer-header span {
  max-width: min(520px, 52vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-viewer-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.attachment-viewer-body {
  min-height: 320px;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 14px;
  background: #f5f7fc;
}

.attachment-viewer-image {
  max-width: 100%;
  max-height: calc(86vh - 124px);
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.attachment-viewer-media {
  width: 100%;
  max-height: calc(86vh - 124px);
  border-radius: 8px;
  background: #000;
}

.attachment-viewer-audio {
  width: min(640px, 100%);
}

.attachment-viewer-frame {
  width: 100%;
  height: min(70vh, 640px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.attachment-viewer-fallback {
  min-height: 220px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.attachment-viewer-fallback svg {
  width: 36px;
  height: 36px;
  color: var(--blue);
}

.kv {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  font-size: 0.86rem;
}

.kv span:first-child {
  color: var(--muted);
}

.kv span:last-child,
.kv a {
  color: var(--ink);
  font-weight: 750;
  overflow-wrap: anywhere;
}

.member-row,
.contact-row {
  display: grid;
  gap: 4px;
  padding: 10px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.member-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.member-row-head strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  background: #151a31;
  color: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

/* ==========================================================================
   HIGHLIGHTS / BANNER CAROUSEL MANAGER
   ========================================================================== */
.highlight-manager-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.highlight-creator-box {
  background: var(--panel-soft, #F8FAFC);
  border: 1px solid var(--line, #EEF0F4);
  border-radius: 16px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.creator-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink, #1C1E21);
  font-size: 0.95rem;
}

.highlight-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 1fr);
  gap: 28px;
  align-items: stretch;
}

.form-inputs-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 14px;
}

.form-actions-row {
  margin-top: 6px;
}

.form-upload-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
}

.upload-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #64748B;
}

.banner-upload-dropzone {
  display: flex;
  flex-direction: column;
  flex: 1;
  cursor: pointer;
  width: 100%;
  height: calc(100% - 24px);
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  height: 100%;
}

.banner-preview-box {
  width: 100%;
  max-width: 100%;
  flex: 1;
  min-height: 280px;
  margin: 0 auto;
  border: 2px dashed #CBD5E1;
  border-radius: 16px;
  background: #F8FAFC;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.02);
}

.banner-upload-dropzone:hover .banner-preview-box {
  border-color: #E60067;
  background: #FFF5F9;
  box-shadow: 0 4px 16px rgba(230, 0, 103, 0.08);
}

.banner-preview-box img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  display: block;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.banner-upload-dropzone:hover .banner-preview-box img {
  transform: scale(1.02);
}

.no-preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.panel-section-divider {
  padding-top: 14px;
  border-top: 1px solid #EEF0F4;
}

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title-wrap h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: #1C1E21;
}

.highlights-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 22px;
  padding: 10px 0 20px;
}

.highlight-item-card {
  background: var(--panel, #FFFFFF);
  border: 1px solid var(--line, #EEF0F4);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 14px rgba(28, 30, 33, 0.05);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}

.highlight-item-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(28, 30, 33, 0.11);
  border-color: #FFD0E2;
}

.highlight-item-card.is-hidden {
  opacity: 0.65;
  filter: grayscale(0.2);
}

.highlight-card-media {
  position: relative;
  width: 100%;
  height: 270px;
  background: #F1F5F9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 8px;
}

.hl-media-backdrop {
  position: absolute;
  inset: -15px;
  background-size: cover;
  background-position: center;
  filter: blur(22px) opacity(0.35) saturate(1.4);
  transform: scale(1.15);
  pointer-events: none;
  z-index: 0;
}

.highlight-card-media img {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  display: block;
}

.highlight-badges-row {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
  z-index: 2;
}

.hl-badge-order {
  background: rgba(17, 19, 24, 0.85);
  backdrop-filter: blur(8px);
  color: #FFFFFF;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.hl-badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  backdrop-filter: blur(8px);
}

.hl-badge-status.active {
  background: rgba(16, 185, 129, 0.9);
  color: #FFFFFF;
}

.hl-badge-status.hidden {
  background: rgba(100, 116, 139, 0.9);
  color: #FFFFFF;
}

.hl-badge-status .dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #FFFFFF;
}

.highlight-card-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  justify-content: space-between;
}

.highlight-card-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: #1C1E21;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.highlight-card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #2563EB;
  text-decoration: none;
  background: #EFF6FF;
  border: 1px solid #DBEAFE;
  padding: 4px 10px;
  border-radius: 8px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.highlight-card-link:hover {
  text-decoration: underline;
  background: #DBEAFE;
}

.highlight-card-nolink {
  font-size: 0.74rem;
  color: #94A3B8;
  font-style: italic;
}

.highlight-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #F1F5F9;
  margin-top: 4px;
}

.action-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 750;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.16s ease;
  background: #F1F5F9;
  color: #475569;
}

.action-pill-btn.success {
  background: #ECFDF5;
  border-color: #A7F3D0;
  color: #059669;
}

.action-pill-btn.success:hover {
  background: #10B981;
  color: #FFFFFF;
}

.action-pill-btn.muted {
  background: #F8FAFC;
  border-color: #E2E8F0;
  color: #64748B;
}

.action-pill-btn.muted:hover {
  background: #E2E8F0;
  color: #1E293B;
}

.action-pill-btn.danger {
  background: #FFF1F2;
  border-color: #FECDD3;
  color: #E11D48;
}

.action-pill-btn.danger:hover {
  background: #E11D48;
  color: #FFFFFF;
}

.empty-highlights-state {
  grid-column: 1 / -1;
  padding: 48px 24px;
  text-align: center;
  background: var(--panel-soft, #FFFFFF);
  border-radius: 16px;
  border: 2px dashed var(--line, #CBD5E1);
}

body.public-site-active {
  min-height: 100%;
  background: #F6F7FB;
  color: #1C1E21;
}

body.admin-site-active {
  min-height: 100%;
  background: #F6F7FB;
  color: #1C1E21;
}

@media (min-width: 861px) {
  body.admin-site-active {
    height: 100vh;
    overflow: hidden;
  }
}

.public-site {
  position: relative;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 12%, rgba(230, 0, 103, 0.08), transparent 480px),
    radial-gradient(circle at 85% 65%, rgba(255, 228, 238, 0.7), transparent 520px),
    linear-gradient(90deg, rgba(238, 240, 244, 0.8) 1px, transparent 1px),
    linear-gradient(180deg, rgba(238, 240, 244, 0.8) 1px, transparent 1px),
    #F6F7FB;
  background-size: auto, auto, 80px 80px, 80px 80px, auto;
  color: #1C1E21;
  animation: page-fade-in 280ms var(--ease-out) both;
}

.public-site::before,
.public-site::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.public-site::before {
  z-index: 0;
  background:
    linear-gradient(90deg, transparent 0%, rgba(230, 0, 103, 0.05) 46%, transparent 58%);
  opacity: 0.5;
  transform: translateX(-110%);
  animation: ambient-scan 9s var(--ease-in-out) infinite;
}

.public-site::after {
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(230, 0, 103, 0.015) 1px, transparent 1px),
    linear-gradient(180deg, rgba(230, 0, 103, 0.015) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 82%);
  animation: grid-drift 18s linear infinite;
}

.public-nav,
.download-hero,
.public-section {
  position: relative;
  z-index: 1;
}

.public-nav-wrapper {
  position: fixed;
  top: 22px;
  left: 0;
  right: 0;
  z-index: 1000;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  background: transparent;
  border: none;
  box-shadow: none;
}

.public-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  width: auto;
  margin: 0 auto;
  pointer-events: auto;
  background: transparent;
  border: none;
  animation: nav-enter 320ms var(--ease-out) both;
}

.pill-nav-dock {
  display: inline-flex;
  align-items: center;
  justify-self: center;
  gap: 4px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(238, 240, 244, 0.95);
  border-radius: 9999px;
  box-shadow:
    0 16px 36px rgba(28, 30, 33, 0.08),
    0 4px 14px rgba(230, 0, 103, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  transition: all 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}

.pill-nav-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 9999px;
  color: #64748B;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    background 0.3s cubic-bezier(0.32, 0.72, 0, 1),
    color 0.2s ease,
    padding 0.3s cubic-bezier(0.32, 0.72, 0, 1),
    box-shadow 0.3s cubic-bezier(0.32, 0.72, 0, 1),
    transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
  user-select: none;
  overflow: hidden;
}

.pill-nav-item svg,
.pill-nav-item i {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
  transition: transform 0.25s cubic-bezier(0.34, 1.4, 0.64, 1), color 0.2s ease;
}

.pill-nav-item span {
  display: inline-block;
  max-width: 0;
  opacity: 0;
  margin-left: 0;
  overflow: hidden;
  white-space: nowrap;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1;
  pointer-events: none;
  transform: translateX(-4px);
  transition:
    max-width 0.3s cubic-bezier(0.32, 0.72, 0, 1),
    opacity 0.22s cubic-bezier(0.32, 0.72, 0, 1),
    margin-left 0.3s cubic-bezier(0.32, 0.72, 0, 1),
    transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}

.pill-nav-item:not(.is-active):hover {
  color: #E60067;
  background: #FFE4EE;
  transform: translateY(-1px);
}

.pill-nav-item:not(.is-active):hover svg,
.pill-nav-item:not(.is-active):hover i {
  transform: scale(1.08);
  color: #E60067;
}

.pill-nav-item.is-active {
  background: linear-gradient(135deg, #E60067 0%, #D81B60 100%);
  color: #ffffff;
  padding: 8px 18px;
  box-shadow:
    0 0 24px rgba(230, 0, 103, 0.45),
    0 4px 14px rgba(230, 0, 103, 0.35);
  font-weight: 850;
  transform: scale(1.02);
}

.pill-nav-item.is-active span {
  max-width: 100px;
  opacity: 1;
  margin-left: 8px;
  transform: translateX(0);
}

.pill-nav-item.is-active svg,
.pill-nav-item.is-active i {
  color: #ffffff;
  stroke-width: 2.5;
}

.public-section,
.download-hero {
  scroll-margin-top: 80px;
}

.public-footer {
  width: 100%;
  border-top: 1px solid #EEF0F4;
  background: #FFFFFF;
  padding: 42px 0 36px;
  margin-top: 64px;
  position: relative;
  z-index: 1;
}

.footer-content {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  color: #64748B;
  font-size: 0.88rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #1C1E21;
  font-weight: 700;
}

.footer-brand img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.footer-admin-link {
  color: #E60067;
  text-decoration: none;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid #FFD0E2;
  background: #FFE4EE;
  transition: all 0.2s ease;
}

.footer-admin-link:hover {
  background: #E60067;
  border-color: #E60067;
  color: #fff;
}

.back-to-top-btn {
  display: none !important;
}

.katup-chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1001;
  font-family: inherit;
  pointer-events: none;
}

.katup-launcher-btn {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2.5px solid #FFFFFF;
  background: linear-gradient(135deg, #E60067 0%, #D81B60 100%);
  padding: 2px;
  cursor: pointer;
  pointer-events: auto;
  box-shadow:
    0 10px 30px rgba(28, 30, 33, 0.18),
    0 0 24px rgba(230, 0, 103, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.3s ease;
}

.katup-launcher-btn:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow:
    0 14px 36px rgba(28, 30, 33, 0.25),
    0 0 32px rgba(230, 0, 103, 0.7);
}

.katup-launcher-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  pointer-events: none;
}

.katup-launcher-glow {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid #E60067;
  opacity: 0.75;
  animation: katup-pulse 2.5s infinite ease-in-out;
  pointer-events: none;
}

@keyframes katup-pulse {
  0% { transform: scale(1); opacity: 0.75; }
  50% { transform: scale(1.18); opacity: 0; }
  100% { transform: scale(1); opacity: 0; }
}

.katup-chat-box {
  position: fixed;
  bottom: 94px;
  right: 24px;
  width: 375px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 120px);
  background: #FFFFFF;
  border: 1.5px solid #EEF0F4;
  border-radius: 22px;
  box-shadow:
    0 24px 60px rgba(28, 30, 33, 0.14),
    0 0 35px rgba(230, 0, 103, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(20px) scale(0.94);
  transform-origin: bottom right;
  transition: all 0.35s cubic-bezier(0.34, 1.3, 0.64, 1);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 1002;
}

.katup-chat-box.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.katup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(135deg, #E60067 0%, #D81B60 100%);
  border-bottom: 0;
}

.katup-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.katup-avatar-ring {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #FFFFFF;
  padding: 1px;
  flex-shrink: 0;
}

.katup-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.katup-online-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: #20C786;
  border: 2px solid #FFFFFF;
  border-radius: 50%;
}

.katup-info {
  display: flex;
  flex-direction: column;
}

.katup-title {
  font-size: 1.08rem;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.katup-badge-desc {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 600;
  margin-top: 2px;
}

.katup-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.katup-close-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.katup-lang-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #F6F7FB;
  border-bottom: 1px solid #EEF0F4;
  font-size: 0.76rem;
  color: #64748B;
  font-weight: 600;
}

.katup-lang-pills {
  display: inline-flex;
  gap: 6px;
}

.katup-lang-btn {
  background: #FFFFFF;
  border: 1px solid #EEF0F4;
  border-radius: 9999px;
  color: #64748B;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.katup-lang-btn:hover {
  background: #FFE4EE;
  border-color: #FFD0E2;
  color: #E60067;
}

.katup-lang-btn.is-active {
  background: #E60067;
  color: #ffffff;
  border-color: #E60067;
  font-weight: 800;
  box-shadow: 0 0 10px rgba(230, 0, 103, 0.35);
}

.katup-chat-messages {
  flex: 1;
  overflow-y: auto !important;
  overflow-x: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #F6F7FB;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  pointer-events: auto;
}

.katup-chat-messages::-webkit-scrollbar {
  width: 5px;
}

.katup-chat-messages::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 9999px;
}

.katup-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(230, 0, 103, 0.3);
  border-radius: 9999px;
}

.katup-chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(230, 0, 103, 0.6);
}

.katup-msg {
  display: flex;
  flex-direction: column;
  max-width: 86%;
  animation: katup-msg-in 0.26s cubic-bezier(0.34, 1.3, 0.64, 1) both;
}

@keyframes katup-msg-in {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.katup-msg-bot {
  align-self: flex-start;
}

.katup-msg-user {
  align-self: flex-end;
}

.katup-msg-bubble {
  padding: 12px 15px;
  border-radius: 16px 16px 16px 4px;
  font-size: 0.88rem;
  line-height: 1.48;
}

.katup-msg-bot .katup-msg-bubble {
  background: #FFFFFF;
  border: 1px solid #EEF0F4;
  color: #1C1E21;
  box-shadow: 0 2px 8px rgba(28, 30, 33, 0.04);
}

.katup-msg-user .katup-msg-bubble {
  background: linear-gradient(135deg, #E60067 0%, #D81B60 100%);
  color: #ffffff;
  font-weight: 600;
  border-radius: 16px 16px 4px 16px;
  box-shadow: 0 4px 14px rgba(230, 0, 103, 0.28);
}

.katup-helper-label {
  font-size: 0.72rem;
  color: #8E95A2;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

.katup-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.katup-pill-btn {
  background: #FFFFFF;
  border: 1px solid #EEF0F4;
  border-radius: 9999px;
  color: #1C1E21;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 13px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(28, 30, 33, 0.03);
  transition: all 0.2s cubic-bezier(0.34, 1.3, 0.64, 1);
  text-align: left;
}

.katup-pill-btn:hover {
  background: #FFE4EE;
  border-color: #FFD0E2;
  color: #E60067;
  transform: translateY(-1px);
}

.katup-input-bar {
  padding: 12px 14px;
  background: #FFFFFF;
  border-top: 1px solid #EEF0F4;
  display: flex;
  align-items: center;
  gap: 10px;
}

.katup-input-bar input {
  flex: 1;
  background: #F6F7FB;
  border: 1.5px solid #EEF0F4;
  border-radius: 9999px;
  color: #1C1E21;
  font-size: 0.86rem;
  padding: 10px 16px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.katup-input-bar input:focus {
  border-color: #E60067;
  background: #FFFFFF;
  box-shadow: 0 0 10px rgba(230, 0, 103, 0.2);
}

.katup-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #E60067 0%, #D81B60 100%);
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.katup-send-btn:hover {
  background: linear-gradient(135deg, #C2185B 0%, #AD1457 100%);
  transform: scale(1.06);
  box-shadow: 0 0 16px rgba(230, 0, 103, 0.5);
}

.katup-send-btn svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.5;
  color: #ffffff;
}

.katup-typing-indicator {
  display: inline-flex;
  gap: 5px;
  padding: 6px 10px;
  background: #FFFFFF;
  border: 1px solid #EEF0F4;
  border-radius: 12px;
  align-self: flex-start;
}

.katup-typing-indicator span {
  width: 6px;
  height: 6px;
  background: #E60067;
  border-radius: 50%;
  animation: katup-dot-bounce 1.3s infinite ease-in-out;
}

.katup-typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.katup-typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes katup-dot-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }
  40% { transform: translateY(-4px); opacity: 1; }
}

.public-brand,
.public-nav-links,
.hero-actions,
.release-strip {
  display: inline-flex;
  align-items: center;
}

.public-brand {
  gap: 10px;
  color: #1C1E21;
  font-weight: 800;
  text-decoration: none;
  transition: transform 160ms var(--ease-out), opacity 160ms var(--ease-out);
  will-change: transform;
}

.public-brand:active {
  transform: scale(0.97);
}

.public-brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  transition: transform 220ms var(--ease-out), filter 220ms var(--ease-out);
  will-change: transform;
}

@media (hover: hover) and (pointer: fine) {
  .public-brand:hover img {
    filter: drop-shadow(0 0 16px rgba(230, 0, 103, 0.35));
    transform: rotate(-4deg) scale(1.04);
  }
}

.public-nav-links {
  gap: 16px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.public-nav-links a {
  position: relative;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  color: #64748B;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  transition: color 160ms var(--ease-out), transform 160ms var(--ease-out);
  will-change: transform;
}

.public-nav-links a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 0;
  height: 2px;
  background: #E60067;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 180ms var(--ease-out);
}

.public-nav-links a:hover,
.public-nav-links a.is-active {
  color: #E60067;
}

.public-nav-links a:hover::after,
.public-nav-links a.is-active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.public-nav-links a:active {
  transform: scale(0.97);
}

.public-page {
  display: none;
}

.public-page.is-active {
  display: grid;
}

.download-hero {
  width: min(1180px, calc(100% - 32px));
  min-height: calc(100vh - 188px);
  margin: 0 auto;
  padding: 104px 0 54px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, 450px);
  align-items: center;
  gap: 54px;
}

.public-site-active .download-hero,
.public-site-active .public-section {
  animation: page-content-in 360ms var(--ease-out) both;
}

.hero-copy {
  display: grid;
  gap: 24px;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 420ms var(--ease-out), transform 420ms var(--ease-out);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.public-site-active .reveal.is-visible {
  animation: reveal-up 420ms var(--ease-out) both;
}

.surface-label {
  width: max-content;
  max-width: 100%;
  padding: 7px 14px;
  border: 1px solid #FFD0E2;
  border-radius: 999px;
  background: #FFE4EE;
  color: #E60067;
  font-size: 0.82rem;
  font-weight: 800;
  animation: label-enter 360ms var(--ease-out) both;
}

.hero-copy h1 {
  max-width: 780px;
  color: #1C1E21;
  font-size: clamp(3rem, 7vw, 6.7rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  font-weight: 900;
  clip-path: inset(0 0 0 0);
  animation: headline-reveal 520ms var(--ease-out) 80ms both;
}

.hero-copy p {
  max-width: 620px;
  color: #64748B;
  font-size: 1.08rem;
  line-height: 1.6;
  animation: reveal-up 420ms var(--ease-out) 160ms both;
}

.hero-actions {
  gap: 12px;
  flex-wrap: wrap;
}

.download-button,
.ghost-button {
  position: relative;
  min-height: 48px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 20px;
  font-weight: 850;
  text-decoration: none;
  overflow: hidden;
}

.download-button::before,
.ghost-button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.3) 42%, transparent 58%);
  transform: translateX(-120%);
  transition: transform 520ms var(--ease-out);
}

.download-button span,
.download-button svg,
.ghost-button span,
.ghost-button svg {
  position: relative;
  z-index: 1;
}

.download-button {
  background: linear-gradient(135deg, #E60067 0%, #D81B60 100%);
  color: #FFFFFF;
  box-shadow: 0 8px 24px rgba(230, 0, 103, 0.32);
  transition: transform 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
  will-change: transform;
}

.ghost-button {
  border: 1.5px solid #EEF0F4;
  background: #FFFFFF;
  color: #1C1E21;
  box-shadow: 0 4px 14px rgba(28, 30, 33, 0.04);
  transition: transform 160ms var(--ease-out), border-color 160ms var(--ease-out), background 160ms var(--ease-out);
  will-change: transform;
}

.download-button:active,
.ghost-button:active {
  transform: scale(0.97);
}

@media (hover: hover) and (pointer: fine) {
  .download-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(230, 0, 103, 0.42);
  }

  .download-button:hover::before,
  .ghost-button:hover::before {
    transform: translateX(120%);
  }

  .ghost-button:hover {
    border-color: #FFD0E2;
    background: #FFE4EE;
    color: #E60067;
    transform: translateY(-2px);
  }
}

.release-strip {
  gap: 10px;
  flex-wrap: wrap;
}

.release-strip span {
  padding: 8px 12px;
  border: 1px solid #EEF0F4;
  border-radius: 10px;
  background: #FFFFFF;
  color: #64748B;
  font-size: 0.82rem;
  font-weight: 750;
  box-shadow: 0 2px 6px rgba(28, 30, 33, 0.03);
  animation: reveal-up 360ms var(--ease-out) both;
}

.release-strip span:nth-child(1) { animation-delay: 120ms; }
.release-strip span:nth-child(2) { animation-delay: 180ms; }
.release-strip span:nth-child(3) { animation-delay: 240ms; }

.phone-stage {
  display: grid;
  place-items: center;
  isolation: isolate;
  position: relative;
}

.phone-image-wrapper {
  position: relative;
  width: min(440px, 94vw);
  max-width: 450px;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: phone-enter 520ms var(--ease-out) both, phone-float 4.8s var(--ease-in-out) 520ms infinite;
  will-change: transform;
}

.phone-app-img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 28px 60px rgba(230, 0, 103, 0.22)) drop-shadow(0 12px 28px rgba(28, 30, 33, 0.14));
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.phone-image-wrapper:hover .phone-app-img {
  transform: scale(1.02);
}

.phone-shell {
  position: relative;
  width: min(410px, 86vw);
  aspect-ratio: 0.49;
  padding: 22px 28px 18px;
  border: 6px solid #1C1E21;
  border-radius: 44px;
  background: #F6F7FB;
  box-shadow:
    0 34px 80px rgba(230, 0, 103, 0.12),
    0 16px 40px rgba(28, 30, 33, 0.1),
    0 0 0 1px #EEF0F4;
  overflow: hidden;
  transform: rotateX(4deg) rotateY(-6deg) rotateZ(-1deg);
  animation: phone-enter 520ms var(--ease-out) both, phone-float 5.6s var(--ease-in-out) 520ms infinite;
  will-change: transform;
}

.phone-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 9%, rgba(255, 255, 255, 0.12), transparent 12%),
    linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.15) 38%, transparent 56%);
  transform: translateX(-120%);
  animation: phone-sheen 4.8s var(--ease-in-out) infinite;
  pointer-events: none;
}

.phone-shell::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(238, 240, 244, 0.8);
  border-radius: 36px;
  opacity: 0.7;
  pointer-events: none;
}

.phone-status {
  position: relative;
  z-index: 2;
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #1C1E21;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0 4px;
}

.phone-camera-dot {
  position: absolute;
  left: 50%;
  top: 2px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #10151c;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.4);
  transform: translateX(-50%);
}

.phone-system-icons {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.phone-system-icons svg {
  width: 13px;
  height: 13px;
  stroke-width: 3;
}

.battery-shape {
  width: 18px;
  height: 9px;
  border-radius: 2px;
  background: #1C1E21;
  box-shadow: 3px 2px 0 -2px #1C1E21;
}

.phone-medical-panel {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  padding: 16px;
  border-radius: 26px;
  background: linear-gradient(135deg, #E60067 0%, #D81B60 100%);
  color: #FFFFFF;
  box-shadow: 0 10px 28px rgba(230, 0, 103, 0.35);
  animation: reveal-up 360ms var(--ease-out) 180ms both;
}

.phone-home-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.phone-avatar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.phone-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  display: grid;
  place-items: center;
  color: #FFFFFF;
}

.phone-avatar svg {
  width: 20px;
  height: 20px;
}

.phone-user-text strong {
  display: block;
  color: #FFFFFF;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.15;
}

.phone-user-text span {
  display: block;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.74rem;
  margin-top: 2px;
}

.phone-mail-button {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  border: 0;
  display: grid;
  place-items: center;
  color: #FFFFFF;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.phone-mail-button:hover {
  transform: scale(1.08);
}

.phone-mail-button svg {
  width: 17px;
  height: 17px;
}

.phone-medical-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.85);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.phone-medical-cards {
  display: grid;
  grid-template-columns: 1fr 1.35fr 1.15fr;
  gap: 8px;
}

.phone-med-card {
  background: #FFFFFF;
  border-radius: 14px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 56px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.med-title {
  font-size: 0.64rem;
  font-weight: 700;
  color: #64748B;
}

.med-value-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-top: 2px;
}

.med-value-row strong {
  font-size: 0.72rem;
  font-weight: 800;
  color: #1C1E21;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.med-warn-text {
  color: #D97706 !important;
  font-size: 0.66rem !important;
}

.med-cond-text {
  color: #2563EB !important;
  font-size: 0.68rem !important;
}

.med-icon {
  font-size: 0.82rem;
  line-height: 1;
  flex-shrink: 0;
}

.sos-orbit {
  position: relative;
  min-height: 240px;
  display: grid;
  place-items: center;
  margin: 8px 0 4px;
}

.orbit-ring {
  position: absolute;
  border: 1.5px solid rgba(230, 0, 103, 0.35);
  border-radius: 999px;
  background: rgba(230, 0, 103, 0.06);
  animation: orbit-pulse 2.8s var(--ease-out) infinite;
}

.ring-one {
  width: 160px;
  height: 160px;
}

.ring-two {
  width: 200px;
  height: 200px;
  animation-delay: 360ms;
}

.ring-three {
  width: 240px;
  height: 240px;
  animation-delay: 720ms;
}

.sos-core {
  position: relative;
  z-index: 1;
  width: 156px;
  height: 156px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #E60067 0%, #D81B60 100%);
  color: #FFFFFF;
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  box-shadow:
    0 0 0 16px rgba(230, 0, 103, 0.22),
    0 0 0 32px rgba(230, 0, 103, 0.12),
    0 0 0 48px rgba(230, 0, 103, 0.05),
    0 14px 34px rgba(230, 0, 103, 0.4);
  animation: sos-core-breathe 2.2s var(--ease-in-out) infinite;
}

.phone-chat-fab {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: #E60067;
  border: 0;
  display: grid;
  place-items: center;
  color: #FFFFFF;
  box-shadow: 0 8px 20px rgba(230, 0, 103, 0.4);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.phone-chat-fab:hover {
  transform: translateY(-50%) scale(1.08);
}

.phone-chat-fab svg {
  width: 22px;
  height: 22px;
}

.phone-sos-caption {
  position: relative;
  z-index: 1;
  margin: 0 0 18px;
  color: #64748B;
  font-size: 0.78rem;
  text-align: center;
  font-weight: 600;
}

.phone-feature-heading {
  position: relative;
  z-index: 1;
  margin-bottom: 10px;
  color: #1C1E21;
  font-size: 0.95rem;
  font-weight: 900;
}

.phone-feature-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 68px;
}

.phone-feature-tile {
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid #EEF0F4;
  border-radius: 18px;
  background: #FFFFFF;
  color: #1C1E21;
  box-shadow: 0 4px 14px rgba(28, 30, 33, 0.04);
}

.tile-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
}

.tile-icon.hospital {
  background: #E0F2FE;
  color: #0284C7;
}

.tile-icon.contact {
  background: #FFEDD5;
  color: #EA580C;
}

.tile-icon svg {
  width: 20px;
  height: 20px;
}

.phone-feature-tile strong {
  color: #1C1E21;
  font-size: 0.82rem;
  font-weight: 800;
  display: block;
}

.phone-feature-tile em {
  color: #64748B;
  font-size: 0.7rem;
  font-style: normal;
  line-height: 1.3;
  display: block;
}

.phone-bottom-nav {
  position: absolute;
  z-index: 3;
  left: 18px;
  right: 18px;
  bottom: 14px;
  min-height: 56px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  padding: 0 6px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #EEF0F4;
  box-shadow: 0 -8px 24px rgba(28, 30, 33, 0.08);
  backdrop-filter: blur(18px);
}

.phone-bottom-nav span {
  min-width: 0;
  min-height: 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #8E95A2;
  font-size: 0.62rem;
  font-weight: 700;
}

.phone-bottom-nav span svg {
  width: 16px;
  height: 16px;
}

.phone-bottom-nav span.is-active {
  border-radius: 999px;
  background: #FFE4EE;
  color: #E60067;
  padding: 2px 6px;
}

.phone-bottom-nav em {
  font-style: normal;
}

.phone-home-indicator {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 6px;
  width: 64px;
  height: 4px;
  border-radius: 999px;
  background: #1C1E21;
  transform: translateX(-50%);
}

.feature-band {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 42px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.public-section .feature-band {
  width: 100%;
  margin-bottom: 0;
}

.feature-card {
  position: relative;
  min-height: 176px;
  padding: 22px;
  border: 1px solid #EEF0F4;
  border-radius: 16px;
  display: grid;
  align-content: start;
  gap: 14px;
  background: #FFFFFF;
  color: #64748B;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(28, 30, 33, 0.03);
  transition: transform 180ms var(--ease-out), border-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
  will-change: transform;
}

.feature-card::before,
.ops-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 24% 18%, rgba(230, 0, 103, 0.08), transparent 32%),
    linear-gradient(115deg, transparent 0 38%, rgba(255, 228, 238, 0.3) 46%, transparent 54% 100%);
  opacity: 0;
  transform: translateX(-18%);
  transition: opacity 240ms var(--ease-out), transform 360ms var(--ease-out);
  pointer-events: none;
}

.feature-card::after,
.ops-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #E60067, transparent);
  transform: translateX(-100%);
  transition: transform 260ms var(--ease-out);
}

.feature-card:active,
.ops-card:active {
  transform: scale(0.985);
}

@media (hover: hover) and (pointer: fine) {
  .feature-card:hover,
  .ops-card:hover {
    border-color: #FFD0E2;
    background: #FFFFFF;
    box-shadow: 0 12px 32px rgba(230, 0, 103, 0.08);
    transform: translateY(-3px);
  }

  .feature-card:hover::after,
  .ops-card:hover::after {
    transform: translateX(0);
  }

  .feature-card:hover::before,
  .ops-card:hover::before {
    opacity: 1;
    transform: translateX(0);
  }
}

.feature-card svg {
  width: 24px;
  height: 24px;
  color: #E60067;
  transition: transform 220ms var(--ease-out), filter 220ms var(--ease-out);
  will-change: transform;
}

@media (hover: hover) and (pointer: fine) {
  .feature-card:hover svg,
  .ops-card:hover svg {
    filter: drop-shadow(0 0 14px rgba(230, 0, 103, 0.35));
    transform: translateY(-2px) scale(1.06);
  }
}

.feature-card strong {
  color: #1C1E21;
  font-size: 1.05rem;
  font-weight: 800;
}

.feature-card span {
  line-height: 1.5;
}

.public-section {
  position: relative;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 74px 0;
}

.public-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: min(260px, 45%);
  height: 2px;
  background: linear-gradient(90deg, #E60067, transparent);
  transform-origin: left;
  animation: section-rule-in 520ms var(--ease-out) both;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(360px, 1fr);
  gap: 48px;
  align-items: start;
  border-top: 1px solid #EEF0F4;
}

.section-copy {
  display: grid;
  gap: 16px;
  animation: section-copy-in 460ms var(--ease-out) both;
}

.section-copy.centered {
  position: relative;
  max-width: 760px;
  margin: 0 auto 28px;
  text-align: center;
  justify-items: center;
}

.section-copy.centered::after {
  content: "";
  width: 74px;
  height: 2px;
  margin-top: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #E60067, transparent);
  animation: center-rule-in 540ms var(--ease-out) 120ms both;
}

.section-copy h2,
.release-panel h2 {
  max-width: 760px;
  color: #1C1E21;
  font-size: clamp(2rem, 4.5vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  font-weight: 900;
}

.section-copy p,
.release-panel p,
.flow-step p,
.ops-card p {
  color: #64748B;
  line-height: 1.6;
}

.flow-steps {
  display: grid;
  gap: 14px;
  animation: reveal-up 420ms var(--ease-out) 120ms both;
}

.flow-step {
  position: relative;
  min-height: 126px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 18px;
  padding: 20px;
  border: 1px solid #EEF0F4;
  border-radius: 16px;
  background: #FFFFFF;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(28, 30, 33, 0.03);
  animation: reveal-up 420ms var(--ease-out) both;
  transition: transform 180ms var(--ease-out), border-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
  will-change: transform;
}

.flow-step:active {
  transform: scale(0.985);
}

@media (hover: hover) and (pointer: fine) {
  .flow-step:hover {
    border-color: #FFD0E2;
    background: #FFFFFF;
    box-shadow: 0 12px 30px rgba(230, 0, 103, 0.08);
    transform: translateY(-3px);
  }
}

.flow-step::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 44px;
  width: 2px;
  background: linear-gradient(180deg, transparent, #FFD0E2, transparent);
  animation: connector-pulse 2.4s var(--ease-in-out) infinite;
}

.flow-step::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 0 42%, rgba(255, 228, 238, 0.3) 48%, transparent 55% 100%);
  opacity: 0;
  transform: translateX(-22%);
  transition: opacity 240ms var(--ease-out), transform 380ms var(--ease-out);
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .flow-step:hover::after {
    opacity: 1;
    transform: translateX(0);
  }
}

.flow-step > span {
  position: relative;
  z-index: 1;
  width: 44px;
  height: 44px;
  border: 1px solid #FFD0E2;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #FFE4EE;
  color: #E60067;
  font-size: 0.86rem;
  font-weight: 900;
  animation: step-token-in 420ms var(--ease-out) both;
}

.flow-step strong,
.ops-card strong {
  color: #1C1E21;
  font-size: 1.04rem;
  font-weight: 800;
}

.flow-step div {
  display: grid;
  gap: 8px;
}

.operations-section {
  border-top: 1px solid #EEF0F4;
}

.ops-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  animation: reveal-up 420ms var(--ease-out) 120ms both;
}

.ops-card {
  position: relative;
  min-height: 210px;
  padding: 22px;
  border: 1px solid #EEF0F4;
  border-radius: 16px;
  display: grid;
  align-content: start;
  gap: 14px;
  background: #FFFFFF;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(28, 30, 33, 0.03);
  animation: reveal-up 420ms var(--ease-out) both;
  transition: transform 180ms var(--ease-out), border-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
  will-change: transform;
}

.ops-card.wide {
  grid-column: span 2;
}

.ops-card > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ops-card svg {
  width: 22px;
  height: 22px;
  color: #E60067;
  transition: transform 220ms var(--ease-out), filter 220ms var(--ease-out);
  will-change: transform;
}

.mini-chart {
  height: 118px;
  display: flex;
  align-items: end;
  gap: 8px;
  padding: 14px;
  border: 1px solid #EEF0F4;
  border-radius: 12px;
  background: #F6F7FB;
}

.mini-chart span {
  flex: 1;
  min-width: 16px;
  border-radius: 8px 8px 2px 2px;
  background: linear-gradient(180deg, #E60067, rgba(230, 0, 103, 0.22));
  transform-origin: bottom;
  animation: chart-load 620ms var(--ease-out) both, chart-rise 1.8s var(--ease-in-out) 700ms infinite alternate;
}

.mini-chart span:nth-child(2n) {
  animation-delay: 140ms, 840ms;
}

.mini-chart span:nth-child(3n) {
  animation-delay: 260ms, 960ms;
}

.release-section {
  padding-top: 0;
  padding-bottom: 56px;
}

.release-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 32px;
  border: 1px solid #EEF0F4;
  border-radius: 20px;
  background: #FFFFFF;
  box-shadow: 0 10px 30px rgba(28, 30, 33, 0.05);
}

.release-panel > div {
  display: grid;
  gap: 14px;
}

.download-detail-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.download-detail-grid span {
  padding: 8px 12px;
  border: 1px solid #EEF0F4;
  border-radius: 8px;
  background: #F6F7FB;
  color: #64748B;
  font-size: 0.82rem;
  font-weight: 750;
}

@keyframes page-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes nav-enter {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ambient-scan {
  0%, 35% {
    transform: translateX(-110%);
  }
  70%, 100% {
    transform: translateX(110%);
  }
}

@keyframes grid-drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(80px, 80px, 0);
  }
}

@keyframes page-content-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes label-enter {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes headline-reveal {
  from {
    opacity: 0;
    clip-path: inset(0 18% 0 0);
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    transform: translateY(0);
  }
}

@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes section-copy-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes section-rule-in {
  from {
    opacity: 0;
    transform: scaleX(0);
  }
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes center-rule-in {
  from {
    opacity: 0;
    transform: scaleX(0.45);
  }
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes phone-enter {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes phone-float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes phone-sheen {
  0%, 58% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(120%);
  }
}

@keyframes map-tile-pulse {
  0%, 100% {
    opacity: 0.48;
    transform: scale(1);
  }
  50% {
    opacity: 0.82;
    transform: scale(1.015);
  }
}

@keyframes dot-breathe {
  0%, 100% {
    transform: scale(1);
    opacity: 0.72;
  }
  50% {
    transform: scale(1.28);
    opacity: 1;
  }
}

@keyframes orbit-pulse {
  0% {
    opacity: 0.85;
    transform: scale(0.82);
  }
  100% {
    opacity: 0;
    transform: scale(1.22);
  }
}

@keyframes sos-core-breathe {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.035);
  }
}

@keyframes connector-pulse {
  0%, 100% {
    opacity: 0.4;
    transform: scaleY(0.72);
  }
  50% {
    opacity: 1;
    transform: scaleY(1);
  }
}

@keyframes step-token-in {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes chart-rise {
  from {
    transform: scaleY(0.72);
  }
  to {
    transform: scaleY(1);
  }
}

@keyframes chart-load {
  from {
    opacity: 0;
    transform: scaleY(0.18);
  }
  to {
    opacity: 1;
    transform: scaleY(0.86);
  }
}

.feature-card:nth-child(1),
.flow-step:nth-child(1),
.ops-card:nth-child(1) {
  animation-delay: 0ms;
}

.feature-card:nth-child(2),
.flow-step:nth-child(2),
.ops-card:nth-child(2) {
  animation-delay: 55ms;
}

.feature-card:nth-child(3),
.flow-step:nth-child(3),
.ops-card:nth-child(3) {
  animation-delay: 110ms;
}

.feature-card:nth-child(4),
.ops-card:nth-child(4) {
  animation-delay: 165ms;
}

.feature-card:nth-child(5) {
  animation-delay: 220ms;
}

.feature-card:nth-child(6) {
  animation-delay: 275ms;
}

.auth-screen {
  background:
    radial-gradient(circle at 50% 15%, rgba(230, 0, 103, 0.08), transparent 390px),
    #F6F7FB;
}

body:not(.dark-mode) .auth-card,
body:not(.dark-mode) .metric-card,
body:not(.dark-mode) .panel,
body:not(.dark-mode) .detail-panel,
body:not(.dark-mode) .search-shell,
body:not(.dark-mode) .secondary-button,
body:not(.dark-mode) .small-button,
body:not(.dark-mode) .category-tabs,
body:not(.dark-mode) .pagination-bar,
body:not(.dark-mode) .livechat-thread-pane,
body:not(.dark-mode) .livechat-conversation,
body:not(.dark-mode) .attachment-viewer-shell,
body:not(.dark-mode) .setup-box {
  border-color: #EEF0F4;
  background: #FFFFFF;
  color: #1C1E21;
  box-shadow: 0 4px 18px rgba(28, 30, 33, 0.03);
}

body:not(.dark-mode) .auth-card,
body:not(.dark-mode) .attachment-viewer-shell {
  border-color: #EEF0F4;
  background: #FFFFFF;
  backdrop-filter: blur(20px);
}

.brand-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 12px;
  display: block;
  flex-shrink: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.brand-logo.small {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 8px;
  display: block;
  flex-shrink: 0;
}

.app-shell {
  --sidebar-width: 68px;
  --detail-width: 318px;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  height: 100dvh;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #F6F7FB;
  box-shadow: none;
}

.sidebar {
  border-right: 1px solid #EEF0F4;
  background: #FFFFFF;
}

.workspace {
  background: #F6F7FB;
}

.detail-panel {
  border-left: 1px solid #EEF0F4;
}

h2,
h3,
.metric-card strong,
.list-item strong,
.cell-main strong,
.detail-empty strong,
.livechat-empty strong,
.kv span:last-child,
.kv a,
.feature-legend-item strong,
.dashboard-range-select,
.page-size-field select,
.dashboard-date-pill,
.secondary-button,
.small-button {
  color: #1C1E21;
}

.brand-row p,
.sidebar-brand span,
.muted,
.detail-empty span,
.field span,
.metric-label,
.metric-trend,
.list-item span,
.cell-main span,
.cell-meta,
th,
.chart-axis-text,
.category-tab,
.page-size-field,
.livechat-empty,
.kv span:first-child {
  color: #64748B;
}

body:not(.dark-mode) .field input,
body:not(.dark-mode) .field textarea,
body:not(.dark-mode) .field select,
body:not(.dark-mode) .search-input,
body:not(.dark-mode) .inline-form input,
body:not(.dark-mode) .category-tab,
body:not(.dark-mode) .livechat-thread,
body:not(.dark-mode) .livechat-conversation-header,
body:not(.dark-mode) .livechat-bubble,
body:not(.dark-mode) .list-item,
body:not(.dark-mode) .avatar,
body:not(.dark-mode) .member-row,
body:not(.dark-mode) .contact-row,
body:not(.dark-mode) .report-attachment-card,
body:not(.dark-mode) .attachment-viewer-body {
  border-color: #EEF0F4;
  background: #FFFFFF;
  color: #1C1E21;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.search-input:focus,
.inline-form input:focus,
.search-shell:focus-within {
  border-color: #E60067;
  box-shadow: 0 0 0 3px rgba(230, 0, 103, 0.16);
}

.primary-button,
.small-button.is-current,
.category-tab.is-active {
  background: linear-gradient(135deg, #E60067 0%, #D81B60 100%);
  color: #FFFFFF;
  box-shadow: 0 8px 24px rgba(230, 0, 103, 0.28);
}

.secondary-button:hover,
.small-button:hover,
.category-tab:hover,
tr:hover td,
.livechat-thread:hover,
.livechat-thread.is-active {
  border-color: #FFD0E2;
  background: #FFE4EE;
  color: #E60067;
}

.eyebrow {
  color: #E60067;
}

.eyebrow::before,
.nav-button.has-dot::after {
  background: #E60067;
  box-shadow: 0 0 0 4px rgba(230, 0, 103, 0.2);
}

.category-tab-count {
  background: #FFE4EE;
  color: #E60067;
  font-weight: 700;
}

.chart-grid-line,
.donut-track {
  stroke: #EEF0F4;
}

body.admin-site-active {
  --page: #F6F7FB;
  --shell: #F6F7FB;
  --panel: #FFFFFF;
  --panel-soft: #F6F7FB;
  --ink: #1C1E21;
  --muted: #64748B;
  --line: #EEF0F4;
  --line-strong: #E2E5EB;
}

body.admin-site-active:not(.dark-mode) .workspace,
body.admin-site-active:not(.dark-mode) .app-shell,
body.admin-site-active:not(.dark-mode) .auth-screen {
  background: #F6F7FB;
  color: #1C1E21;
}

body.admin-site-active:not(.dark-mode) .panel,
body.admin-site-active:not(.dark-mode) .metric-card,
body.admin-site-active:not(.dark-mode) .detail-panel,
body.admin-site-active:not(.dark-mode) .auth-card,
body.admin-site-active:not(.dark-mode) .search-shell,
body.admin-site-active:not(.dark-mode) .setup-box,
body.admin-site-active:not(.dark-mode) .livechat-thread-pane,
body.admin-site-active:not(.dark-mode) .livechat-conversation,
body.admin-site-active:not(.dark-mode) .attachment-viewer-shell {
  border-color: #EEF0F4;
  background: #FFFFFF;
  color: #1C1E21;
}

body.admin-site-active:not(.dark-mode) .panel-header,
body.admin-site-active:not(.dark-mode) .dashboard-toolbar {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

body.admin-site-active:not(.dark-mode) .page-size-field,
body.admin-site-active:not(.dark-mode) .category-tabs,
body.admin-site-active:not(.dark-mode) .pagination-bar,
body.admin-site-active:not(.dark-mode) .livechat-reply-form,
body.admin-site-active:not(.dark-mode) .livechat-empty.inline,
body.admin-site-active:not(.dark-mode) .attachment-viewer-body {
  border-color: #EEF0F4;
  background: #F6F7FB;
  color: #1C1E21;
  box-shadow: none;
}

body.admin-site-active:not(.dark-mode) .field input,
body.admin-site-active:not(.dark-mode) .field textarea,
body.admin-site-active:not(.dark-mode) .field select,
body.admin-site-active:not(.dark-mode) .search-input,
body.admin-site-active:not(.dark-mode) .inline-form input,
body.admin-site-active:not(.dark-mode) .livechat-reply-form textarea,
body.admin-site-active:not(.dark-mode) .page-size-field select {
  border-color: #EEF0F4;
  background: #FFFFFF;
  color: #1C1E21;
}

body.admin-site-active:not(.dark-mode) .field input::placeholder,
body.admin-site-active:not(.dark-mode) .field textarea::placeholder,
body.admin-site-active:not(.dark-mode) .search-input::placeholder,
body.admin-site-active:not(.dark-mode) .inline-form input::placeholder,
body.admin-site-active:not(.dark-mode) .livechat-reply-form textarea::placeholder {
  color: #8E95A2;
}

body.admin-site-active:not(.dark-mode) select option {
  background: #FFFFFF;
  color: #1C1E21;
}

body.admin-site-active:not(.dark-mode) .secondary-button,
body.admin-site-active:not(.dark-mode) .small-button,
body.admin-site-active:not(.dark-mode) .category-tab,
body.admin-site-active:not(.dark-mode) .livechat-thread,
body.admin-site-active:not(.dark-mode) .livechat-bubble,
body.admin-site-active:not(.dark-mode) .list-item,
body.admin-site-active:not(.dark-mode) .avatar,
body.admin-site-active:not(.dark-mode) .member-row,
body.admin-site-active:not(.dark-mode) .contact-row,
body.admin-site-active:not(.dark-mode) .report-attachment-card,
body.admin-site-active:not(.dark-mode) .livechat-selected-attachment,
body.admin-site-active:not(.dark-mode) .livechat-attachment {
  border-color: #EEF0F4;
  background: #FFFFFF;
  color: #1C1E21;
}

body.admin-site-active:not(.dark-mode) .secondary-button:hover,
body.admin-site-active:not(.dark-mode) .small-button:hover,
body.admin-site-active:not(.dark-mode) .category-tab:hover,
body.admin-site-active:not(.dark-mode) .livechat-thread:hover,
body.admin-site-active:not(.dark-mode) .livechat-thread.is-active,
body.admin-site-active:not(.dark-mode) .report-attachment-button:hover,
body.admin-site-active:not(.dark-mode) tr:hover td {
  border-color: #FFD0E2;
  background: #FFE4EE;
  color: #E60067;
}

body.admin-site-active:not(.dark-mode) .category-tab.is-active,
body.admin-site-active:not(.dark-mode) .small-button.is-current {
  border-color: #FFD0E2;
  background: #FFE4EE;
  color: #E60067;
  font-weight: 800;
}

body.admin-site-active:not(.dark-mode) .category-tab-count,
body.admin-site-active:not(.dark-mode) .status-pill {
  background: #FFE4EE;
  color: #E60067;
}

body.admin-site-active:not(.dark-mode) .category-tab.is-active .category-tab-count {
  background: #E60067;
  color: #FFFFFF;
}

body.admin-site-active:not(.dark-mode) .livechat-message.from-admin .livechat-bubble {
  border-color: #FFD0E2;
  background: #FFE4EE;
  color: #1C1E21;
}

body.admin-site-active:not(.dark-mode) .livechat-sender,
body.admin-site-active:not(.dark-mode) .livechat-bubble time,
body.admin-site-active:not(.dark-mode) .muted,
body.admin-site-active:not(.dark-mode) .cell-meta,
body.admin-site-active:not(.dark-mode) .cell-main span,
body.admin-site-active:not(.dark-mode) .list-item span {
  color: #8E95A2;
}

body.admin-site-active:not(.dark-mode) .cell-main strong,
body.admin-site-active:not(.dark-mode) .list-item strong,
body.admin-site-active:not(.dark-mode) .livechat-empty strong,
body.admin-site-active:not(.dark-mode) .detail-empty strong,
body.admin-site-active:not(.dark-mode) .kv span:last-child,
body.admin-site-active:not(.dark-mode) .detail-text,
body.admin-site-active:not(.dark-mode) td {
  color: #1C1E21;
}

body.admin-site-active:not(.dark-mode) th {
  color: #64748B;
  background: #F6F7FB;
}

body.admin-site-active:not(.dark-mode) .livechat-image-preview,
body.admin-site-active:not(.dark-mode) .report-attachment-preview,
body.admin-site-active:not(.dark-mode) .attachment-viewer-image,
body.admin-site-active:not(.dark-mode) .attachment-viewer-frame {
  border-color: #EEF0F4;
  background: #F6F7FB;
}

body.admin-site-active:not(.dark-mode) .livechat-selected-attachment strong {
  color: #1C1E21;
}

body.admin-site-active:not(.dark-mode) .livechat-selected-attachment button {
  color: #64748B;
}

body.admin-site-active:not(.dark-mode) .livechat-selected-attachment button:hover {
  background: #FFE4EE;
  color: #E60067;
}

/* ==========================================================================
   UNIVERSAL RESPONSIVE DESIGN SYSTEM (ALL DEVICES)
   ========================================================================== */

/* --- TABLETS & SMALL LAPTOPS (861px to 1200px) --- */
@media (min-width: 861px) and (max-width: 1200px) {
  .download-hero {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-top: 60px;
  }

  .phone-stage {
    max-width: 480px;
    margin: 0 auto;
  }

  .app-shell {
    grid-template-columns: 196px minmax(0, 1fr);
  }

  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  .feature-band,
  .split-section {
    gap: 28px;
  }
}

/* --- MOBILE & TABLET PORTRAIT (max-width: 860px) --- */
@media (max-width: 860px) {
  .download-hero,
  .feature-band,
  .split-section,
  .ops-grid,
  .release-panel {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .download-hero {
    min-height: auto;
    padding-top: 48px;
    padding-bottom: 24px;
  }

  .public-section {
    padding: 48px 0;
  }

  .hero-copy {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-copy h1 {
    font-size: clamp(2.4rem, 7vw, 3.2rem);
    line-height: 1.15;
  }

  .hero-copy p {
    max-width: 540px;
    margin: 0 auto 20px;
    font-size: 0.95rem;
  }

  .hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 420px;
  }

  .hero-actions .download-button,
  .hero-actions .ghost-button {
    flex: 1 1 180px;
    min-height: 48px;
  }

  .release-strip {
    justify-content: center;
    flex-wrap: wrap;
  }

  .phone-stage {
    width: 100%;
    max-width: 360px;
    margin: 20px auto 0;
  }

  .phone-shell {
    width: 100%;
    aspect-ratio: 0.48;
    transform: none;
    animation: phone-enter 400ms var(--ease-out) both;
  }

  .ops-card.wide {
    grid-column: span 1;
  }

  .release-panel .download-button {
    width: 100%;
  }

  /* Public Site Mobile Floating Bottom Dock */
  .public-site {
    padding-bottom: 96px;
  }

  .public-nav-wrapper {
    top: auto;
    bottom: 18px;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    z-index: 1000;
  }

  .public-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
  }

  .pill-nav-dock {
    gap: 4px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(238, 240, 244, 0.95);
    border-radius: 9999px;
    box-shadow:
      0 16px 40px rgba(28, 30, 33, 0.12),
      0 4px 12px rgba(230, 0, 103, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
  }

  .pill-nav-item {
    min-height: 38px;
    padding: 7px 12px;
    font-size: 0.82rem;
    color: #64748B;
  }

  .pill-nav-item.is-active {
    padding: 7px 16px;
    color: #FFFFFF;
    background: linear-gradient(135deg, #E60067 0%, #D81B60 100%);
  }

  /* Katup AI Widget on Mobile */
  .katup-chat-widget {
    bottom: 82px;
    right: 16px;
  }

  .katup-launcher-btn {
    width: 50px;
    height: 50px;
  }

  .katup-chat-box {
    position: fixed;
    inset: auto 12px 76px 12px;
    width: auto;
    max-width: 100%;
    height: min(72vh, 520px);
    border-radius: 20px;
  }

  /* Admin Dashboard Mobile Drawer Overhaul */
  html,
  body,
  body.admin-site-active,
  body.public-site-active {
    height: auto !important;
    min-height: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
  }

  .public-site {
    height: auto !important;
    min-height: 100vh !important;
    overflow: visible !important;
    padding-bottom: 96px !important;
  }

  .app-shell {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 100vh !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    overflow: visible !important;
    position: relative !important;
  }

  .sidebar-backdrop {
    display: block !important;
    position: fixed;
    inset: 0;
    background: rgba(28, 30, 33, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  }

  .app-shell.sidebar-open .sidebar-backdrop,
  .sidebar-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(290px, 84vw);
    height: 100dvh;
    background: #FFFFFF;
    border-right: 1px solid #EEF0F4;
    box-shadow: 16px 0 48px rgba(28, 30, 33, 0.12);
    z-index: 1200;
    padding: 20px 14px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(-105%);
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
  }

  .app-shell.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px 14px;
    margin-bottom: 12px;
    border-bottom: 1px solid #EEF0F4;
  }

  .sidebar-brand-main {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .sidebar-brand strong {
    font-size: 0.96rem;
    color: #1C1E21;
  }

  .sidebar-brand span {
    font-size: 0.72rem;
    color: #8E95A2;
  }

  .sidebar-close-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #F6F7FB;
    border: 1px solid #EEF0F4;
    color: #1C1E21;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .sidebar-close-btn:hover {
    background: #FFE4EE;
    color: #E60067;
  }

  .sidebar-collapse-btn {
    display: none !important;
  }

  .sidebar-close-btn svg,
  .sidebar-close-btn i {
    width: 18px;
    height: 18px;
  }

  .nav-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: visible;
  }

  .nav-group-label {
    display: block;
    margin: 14px 10px 4px;
    color: #8E95A2;
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }

  .nav-button {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    min-height: 44px;
    padding: 0 14px;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 10px;
    background: transparent;
    border: 1px solid transparent;
    color: #64748B;
    white-space: nowrap;
    transition: all 0.2s ease;
  }

  .nav-button:hover {
    background: #FFE4EE;
    color: #E60067;
  }

  .nav-button.is-active {
    background: #FFE4EE;
    border-color: #FFD0E2;
    color: #E60067;
    box-shadow: inset 3px 0 0 #E60067;
  }

  .nav-button svg,
  .nav-button i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
  }

  .nav-button.has-dot::after {
    position: static;
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-left: auto;
    background: #E60067;
  }

  .workspace {
    padding: 14px 12px 36px;
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .topbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 16px;
  }

  .topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .sidebar-toggle-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #FFFFFF;
    border: 1px solid #EEF0F4;
    color: #1C1E21;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(28, 30, 33, 0.04);
    transition: all 0.2s ease;
  }

  .sidebar-toggle-btn:hover {
    background: #FFE4EE;
    border-color: #FFD0E2;
    color: #E60067;
  }

  .sidebar-toggle-btn svg,
  .sidebar-toggle-btn i {
    width: 20px;
    height: 20px;
  }

  .topbar h2 {
    font-size: 1.4rem;
  }

  .topbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }

  .search-shell {
    width: 100%;
    flex: 1 1 100%;
    min-height: 40px;
  }

  .search-input {
    font-size: 16px;
  }

  .topbar-actions .secondary-button {
    flex: 1 1 calc(33.333% - 6px);
    min-width: 90px;
    min-height: 38px;
    padding: 6px 8px;
    font-size: 0.76rem;
    justify-content: center;
  }

  .metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
  }

  .metric-card {
    padding: 12px 10px;
    border-radius: 12px;
  }

  .metric-card strong {
    font-size: 1.35rem;
  }

  .metric-label {
    font-size: 0.74rem;
  }

  .dashboard-grid,
  .notification-form,
  .livechat-layout,
  .feature-chart-layout,
  .ops-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .table-shell {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 16px;
  }

  .data-table {
    width: 100%;
    min-width: 540px;
    border-collapse: collapse;
  }

  .data-table th,
  .data-table td {
    padding: 10px 12px;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .livechat-panel,
  .livechat-layout {
    min-height: 0;
    max-height: none;
  }

  .livechat-thread-list {
    max-height: 240px;
    overflow-y: auto;
  }

  .livechat-panel {
    min-height: 380px;
    max-height: 60vh;
  }

  .dashboard-toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .dashboard-date-pill {
    width: 100%;
    justify-content: space-between;
  }

  .detail-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    max-height: 85vh;
    border-radius: 20px 20px 0 0;
    border: 1px solid #EEF0F4;
    box-shadow: 0 -16px 48px rgba(28, 30, 33, 0.12);
    background: #FFFFFF;
    z-index: 1200;
    transform: translateY(105%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px 16px;
  }

  .detail-panel.has-content {
    transform: translateY(0);
  }
}

/* --- SMARTPHONES (max-width: 560px) --- */
@media (max-width: 560px) {
  .public-site {
    padding-bottom: 88px;
  }

  .public-nav-wrapper {
    bottom: 12px;
  }

  .pill-nav-dock {
    gap: 2px;
    padding: 4px 6px;
  }

  .pill-nav-item {
    min-height: 44px;
    padding: 8px 10px;
    font-size: 0.78rem;
  }

  .pill-nav-item.is-active {
    padding: 8px 14px;
  }

  .hero-copy h1 {
    font-size: clamp(2.1rem, 9vw, 2.7rem);
  }

  .hero-actions,
  .download-button,
  .ghost-button {
    width: 100%;
  }

  .topbar-actions .secondary-button {
    flex: 1 1 calc(50% - 4px);
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .composer-buttons {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .pagination-bar {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .pagination-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .livechat-conversation-header,
  .livechat-reply-form {
    grid-template-columns: 1fr;
  }

  .livechat-reply-actions {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 8px;
  }

  .livechat-reply-actions .primary-button.slim {
    width: 100%;
  }

  .livechat-attach-menu {
    right: auto;
    left: 0;
  }

  .livechat-conversation-header {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .livechat-header-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .livechat-bubble {
    max-width: 92%;
  }

  .flow-step {
    grid-template-columns: 1fr;
  }

  .flow-step::before {
    display: none;
  }

  .list-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .row-actions,
  .member-row-head {
    align-items: flex-start;
    justify-content: flex-start;
  }

  .member-row-head {
    flex-direction: column;
  }

  .kv {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .detail-header {
    grid-template-columns: 1fr;
  }
}

/* --- SMALL MOBILE / FOLDABLE COVERS (max-width: 380px) --- */
@media (max-width: 380px) {
  .pill-nav-dock {
    gap: 2px;
    padding: 3px 4px;
  }

  .pill-nav-item {
    min-height: 40px;
    padding: 6px 8px;
    font-size: 0.72rem;
  }

  .pill-nav-item svg,
  .pill-nav-item i {
    width: 14px;
    height: 14px;
  }

  .hero-copy h1 {
    font-size: 1.95rem;
  }

  .metric-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .topbar-actions .secondary-button {
    flex: 1 1 100%;
  }
}

/* --- ACCESSIBILITY: REDUCED MOTION --- */
@media (prefers-reduced-motion: reduce) {
  .public-site,
  .public-site::before,
  .public-site::after,
  .public-site-active .download-hero,
  .public-site-active .public-section,
  .public-section::before,
  .public-nav,
  .reveal,
  .public-brand,
  .public-brand img,
  .public-nav-links a,
  .surface-label,
  .hero-copy h1,
  .hero-copy p,
  .phone-shell,
  .phone-shell::before,
  .phone-shell::after,
  .phone-medical-panel,
  .phone-home-top,
  .phone-medical-card,
  .phone-medical-pills span,
  .phone-chat-button,
  .phone-feature-tile,
  .phone-bottom-nav,
  .orbit-ring,
  .sos-core,
  .release-strip span,
  .section-copy,
  .section-copy.centered::after,
  .mini-chart span,
  .download-button,
  .download-button::before,
  .ghost-button,
  .ghost-button::before,
  .feature-card,
  .feature-card::before,
  .feature-card::after,
  .feature-card svg,
  .flow-steps,
  .flow-step,
  .flow-step::before,
  .flow-step::after,
  .flow-step > span,
  .ops-grid,
  .ops-card::before,
  .ops-card::after,
  .ops-card {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }

  .reveal,
  .public-site,
  .phone-shell,
  .phone-medical-panel,
  .phone-home-top,
  .phone-medical-card,
  .phone-chat-button,
  .phone-feature-tile,
  .release-strip span {
    opacity: 1;
  }
}

/* --- VIDEO / VOICE CALL MODAL --- */
.video-call-modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: #000; z-index: 100050; display: flex; align-items: center; justify-content: center; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.video-call-container { position: relative; width: 100%; height: 100%; background: #111; overflow: hidden; display: flex; flex-direction: column; transition: border-radius 0.3s; }
.vc-minimize-btn { position: absolute; top: 24px; left: 24px; background: rgba(0,0,0,0.5); border: none; border-radius: 50%; width: 48px; height: 48px; color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 20; backdrop-filter: blur(4px); transition: background 0.2s; }
.vc-minimize-btn:hover { background: rgba(0,0,0,0.8); }
.video-container { position: relative; width: 100%; height: 100%; min-height: 0; }
.remote-video { width: 100%; height: 100%; object-fit: cover; }
.voice-call-panel { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: radial-gradient(circle at 50% 38%, rgba(54,87,255,0.34), transparent 34%), linear-gradient(145deg, #101322, #070912); color: #fff; z-index: 3; }
.voice-call-avatar-wrap { position: relative; width: 220px; height: 220px; display: grid; place-items: center; }
.voice-call-ring { position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,0.16); background: rgba(54,87,255,0.12); animation: voicePulse 2.2s ease-in-out infinite; }
.voice-call-ring.outer { width: 220px; height: 220px; }
.voice-call-ring.middle { width: 170px; height: 170px; animation-delay: 0.2s; }
.voice-call-avatar { position: relative; z-index: 1; width: 116px; height: 116px; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: #fff; font-size: 2.8rem; font-weight: 900; background-size: cover; background-position: center; box-shadow: 0 18px 46px rgba(0,0,0,0.38); }
.voice-call-panel strong { font-size: 2rem; max-width: min(520px, 80vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-call-panel span { color: #c5cbec; font-weight: 800; }
.video-call-modal.voice-mode .remote-video { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.video-call-modal.voice-mode .voice-call-panel { display: flex !important; }
.video-call-modal.voice-mode .local-video-wrapper,
.video-call-modal.voice-mode #vcCamBtn,
.video-call-modal.voice-mode #vcShareScreenBtn,
.video-call-modal.voice-mode #remoteCamOffIndicator { display: none !important; }
@keyframes voicePulse {
  0%, 100% { transform: scale(0.96); opacity: 0.72; }
  50% { transform: scale(1.04); opacity: 1; }
}
.local-video-wrapper { position: absolute; bottom: 100px; right: 24px; width: 480px; height: 270px; border-radius: 12px; border: 2px solid #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.5); z-index: 10; background: #222; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.local-video-inner { width: 100%; height: 100%; object-fit: cover; }
.local-mute-indicator { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; background: rgba(0,0,0,0.6); color: var(--red); border-radius: 50%; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.local-mute-indicator i { width: 16px; height: 16px; }
.local-cam-off-indicator { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #222; color: #fff; gap: 8px; font-weight: 500; }
.video-call-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.6); z-index: 5; pointer-events: none; }
.video-call-overlay h3 { color: #fff; font-size: 1.5rem; text-shadow: 0 2px 4px rgba(0,0,0,0.8); }
.video-call-controls { position: absolute; bottom: 0; left: 0; width: 100%; padding: 24px; display: flex; gap: 16px; justify-content: center; background: linear-gradient(to top, rgba(0,0,0,0.8), transparent); z-index: 15; }
.vc-control-btn { width: 56px; height: 56px; border-radius: 28px; background: rgba(255,255,255,0.2); border: 0; color: #fff; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(8px); cursor: pointer; transition: all 0.2s; }
.vc-control-btn:hover { background: rgba(255,255,255,0.3); transform: scale(1.05); }
.vc-control-btn.danger { background: var(--red); }
.vc-control-btn.danger:hover { background: var(--red-dark, #D4001E); }
.vc-bottom-sheet { position: absolute; bottom: 0; left: 0; width: 100%; background: var(--panel); border-radius: 24px 24px 0 0; padding: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 20; transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 -8px 24px rgba(0,0,0,0.2); }
.vc-bottom-sheet.show { transform: translateY(0); }
.vc-menu-btn { display: flex; align-items: center; gap: 16px; padding: 16px; width: 100%; background: transparent; border: none; color: var(--text-main); font-size: 1rem; font-weight: 500; cursor: pointer; border-radius: 12px; transition: background 0.2s; }
.vc-menu-btn:hover { background: var(--hover); }

.video-call-modal.floating { top: auto; left: auto; bottom: 24px; right: 24px; width: 320px; height: 180px; border-radius: 16px; box-shadow: 0 12px 48px rgba(0,0,0,0.6); cursor: pointer; z-index: 100060; }
.video-call-modal.floating .video-call-container { border-radius: 16px; pointer-events: none; }
.video-call-modal.floating .vc-minimize-btn,
.video-call-modal.floating .video-call-controls,
.video-call-modal.floating .vc-bottom-sheet,
.video-call-modal.floating .local-video-wrapper,
.video-call-modal.floating .video-call-overlay { display: none !important; }
.video-call-modal.floating.voice-mode .voice-call-panel { display: flex !important; }
.video-call-modal.floating.voice-mode .voice-call-avatar-wrap { width: 80px; height: 80px; }
.video-call-modal.floating.voice-mode .voice-call-ring { display: none; }
.video-call-modal.floating.voice-mode .voice-call-avatar { width: 54px; height: 54px; font-size: 1.4rem; }
.video-call-modal.floating.voice-mode .voice-call-panel strong,
.video-call-modal.floating.voice-mode .voice-call-panel span { display: none; }

.vc-floating-info { display: none; position: absolute; bottom: 0; left: 0; width: 100%; padding: 12px; background: linear-gradient(to top, rgba(0,0,0,0.9), transparent); color: #fff; align-items: center; gap: 8px; z-index: 5; }
.video-call-modal.floating .vc-floating-info { display: flex; }
.vc-floating-avatar { width: 28px; height: 28px; border-radius: 50%; background-color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 600; color: #fff; background-size: cover; background-position: center; border: 1px solid rgba(255,255,255,0.2); }
.vc-floating-name { font-size: 0.9rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 4px rgba(0,0,0,0.8); }
.vc-menu-btn i { color: var(--muted); }

@media (max-width: 560px) {
  .local-video-wrapper {
    width: 140px;
    height: 180px;
    bottom: 88px;
    right: 14px;
  }

  .vc-control-btn {
    width: 48px;
    height: 48px;
  }

  .video-call-controls {
    gap: 10px;
    padding: 16px;
  }
}

/* ==========================================================================
   RESQTAP ADMIN AUTH SCREEN - PURPLE WAVE & 3D CHARACTER DESIGN
   ========================================================================== */

.auth-screen,
body.admin-site-active .auth-screen {
  min-height: 100vh;
  width: 100%;
  margin: 0;
  padding: 0;
  position: relative;
  background-color: #FFFFFF !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  align-items: stretch !important;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* When on admin route, ensure public site is hidden immediately */
html.admin-route-loading #publicSite,
html.admin-route-loading .public-site,
html.has-admin-session #publicSite,
html.has-admin-session .public-site,
body.admin-site-active #publicSite,
body.admin-site-active .public-site {
  display: none !important;
}

/* Enforce strict hidden specificity so deniedScreen, authScreen, appShell, and loader properly hide when requested */
.auth-screen.hidden,
body.admin-site-active .auth-screen.hidden,
#authScreen.hidden,
#deniedScreen.hidden,
#appShell.hidden,
#adminRouteLoader.hidden {
  display: none !important;
}

/* Admin Route Loader */
.admin-route-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #F6F7FB;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

html.dark-mode .admin-route-loader,
body.dark-mode .admin-route-loader {
  background-color: #0F172A;
  color: #F1F5F9;
}

.admin-loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.admin-loader-ring {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-loader-ring::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 3px solid rgba(230, 0, 103, 0.15);
  border-top-color: #E60067;
  animation: adminLoaderSpin 1s linear infinite;
}

.admin-loader-logo {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: contain;
  animation: adminLoaderPulse 2s ease-in-out infinite;
}

.admin-loader-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #1C1E21;
  letter-spacing: -0.01em;
}

html.dark-mode .admin-loader-title,
body.dark-mode .admin-loader-title {
  color: #F8FAFC;
}

.admin-loader-text {
  font-size: 0.88rem;
  color: #64748B;
  font-weight: 500;
}

html.dark-mode .admin-loader-text,
body.dark-mode .admin-loader-text {
  color: #94A3B8;
}

@keyframes adminLoaderSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes adminLoaderPulse {
  0%, 100% { transform: scale(1); opacity: 0.95; }
  50% { transform: scale(1.05); opacity: 1; }
}

html.has-admin-session #adminRouteLoader,
html:not(.admin-route-loading) #adminRouteLoader {
  display: none !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Top Pink Wave Banner */
.auth-top-banner {
  position: relative;
  width: 100%;
  min-height: 260px;
  background: linear-gradient(135deg, #B80053 0%, #E60067 50%, #FF2E88 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 38px;
  padding-bottom: 50px;
  box-sizing: border-box;
  overflow: hidden;
}

.auth-banner-particles {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 18% 25%, rgba(255, 255, 255, 0.25) 1.5px, transparent 2px),
    radial-gradient(circle at 78% 30%, rgba(255, 255, 255, 0.3) 1.5px, transparent 2px),
    radial-gradient(circle at 45% 65%, rgba(255, 255, 255, 0.2) 2px, transparent 2.5px),
    radial-gradient(circle at 88% 70%, rgba(255, 255, 255, 0.22) 1.5px, transparent 2px);
  background-size: 260px 220px;
  opacity: 0.95;
  pointer-events: none;
}

.auth-banner-content {
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: authFadeDown 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-brand-logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-banner-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.25));
  animation: authLogoPop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.auth-banner-brand-name {
  font-size: 2.1rem;
  font-weight: 900;
  color: #FFFFFF;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.auth-welcome-text {
  font-size: 1.55rem;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.auth-banner-desc {
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  margin: 2px 0 0;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Bottom Curve of Banner */
.auth-banner-wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 55px;
  z-index: 1;
  pointer-events: none;
  animation: authWaveIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Main Area below banner with subtle grid lines */
.auth-main-area {
  position: relative;
  width: 100%;
  flex: 1;
  background-color: #FFFFFF;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0 20px 70px;
  box-sizing: border-box;
}

.auth-grid-canvas {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(to right, rgba(226, 232, 240, 0.6) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(226, 232, 240, 0.6) 1px, transparent 1px);
  background-size: 54px 54px;
  pointer-events: none;
}

/* Layout container - Perfectly Centered & Positioned close to header */
.auth-layout-container {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: -85px auto 0;
  max-width: 450px;
  width: 100%;
}

/* The Login Card Box */
.auth-card-box,
body.admin-site-active .auth-card-box {
  width: 100% !important;
  max-width: 450px !important;
  margin: 0 auto !important;
  background: #FFFFFF !important;
  border-radius: 20px !important;
  padding: 38px 36px 32px !important;
  box-shadow: 
    0 22px 50px -10px rgba(230, 0, 103, 0.15),
    0 4px 18px rgba(0, 0, 0, 0.05),
    0 0 0 1px rgba(226, 232, 240, 0.9) !important;
  box-sizing: border-box !important;
  position: relative;
  z-index: 6;
  animation: authCardUp 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

.auth-card-heading {
  text-align: center;
  margin-bottom: 24px;
}

.auth-card-title {
  font-size: 2.1rem !important;
  font-weight: 800 !important;
  color: #1E1B4B !important;
  margin: 0 !important;
  letter-spacing: -0.01em !important;
}

.auth-card-desc {
  font-size: 0.85rem !important;
  color: #64748B !important;
  margin: 6px 0 0 !important;
  font-weight: 500;
}

.auth-fields-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.auth-input-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
}

.auth-field-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.auth-field-box input,
#loginForm #emailInput,
#loginForm #passwordInput,
body.admin-site-active #loginForm #emailInput,
body.admin-site-active #loginForm #passwordInput {
  width: 100% !important;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 14px !important;
  background-color: #FFFFFF !important;
  background: #FFFFFF !important;
  border: 1.5px solid #E2E8F0 !important;
  border-radius: 9px !important;
  font-size: 0.9rem !important;
  color: #1E293B !important;
  -webkit-text-fill-color: #1E293B !important;
  box-shadow: none !important;
  outline: none !important;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box !important;
}

.auth-field-box.password-box input,
#loginForm #passwordInput {
  padding-right: 40px !important;
}

.auth-field-box input:hover,
#loginForm #emailInput:hover,
#loginForm #passwordInput:hover {
  border-color: #CBD5E1 !important;
}

.auth-field-box input:focus,
#loginForm #emailInput:focus,
#loginForm #passwordInput:focus {
  border-color: #E60067 !important;
  box-shadow: 0 0 0 3px rgba(230, 0, 103, 0.16) !important;
}

.auth-field-box input::placeholder,
#loginForm #emailInput::placeholder,
#loginForm #passwordInput::placeholder {
  color: #94A3B8 !important;
  -webkit-text-fill-color: #94A3B8 !important;
  font-weight: 400;
}

.auth-eye-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #94A3B8;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}

.auth-eye-btn:hover {
  color: #475569;
}

.auth-eye-btn svg {
  width: 16px;
  height: 16px;
}

.auth-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 0.8rem;
}

.auth-remember-me {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #64748B;
  cursor: pointer;
  user-select: none;
  font-size: 0.82rem;
}

.auth-remember-me input[type="checkbox"],
#loginForm input[type="checkbox"],
.auth-card input[type="checkbox"] {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  accent-color: #E60067 !important;
  cursor: pointer;
  margin: 0 !important;
  padding: 0 !important;
  border: 1.5px solid #CBD5E1 !important;
  border-radius: 4px !important;
  box-shadow: none !important;
  background: #FFFFFF !important;
}

.auth-forgot-link {
  color: #E60067;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.8rem;
  transition: color 0.15s;
}

.auth-forgot-link:hover {
  color: #B80053;
  text-decoration: underline;
}

/* Wide Pink Login Button */
.auth-login-action-btn,
body.admin-site-active #loginButton.auth-login-action-btn {
  width: 100% !important;
  height: 44px !important;
  min-height: 44px !important;
  margin-top: 22px !important;
  background: linear-gradient(135deg, #E60067 0%, #C2185B 100%) !important;
  border: 0 !important;
  border-radius: 9px !important;
  color: #FFFFFF !important;
  font-size: 0.96rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  box-shadow: 0 6px 18px -2px rgba(230, 0, 103, 0.42) !important;
  transition: all 0.2s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.auth-login-action-btn:hover,
body.admin-site-active #loginButton.auth-login-action-btn:hover {
  background: linear-gradient(135deg, #FF1F7E 0%, #D81B60 100%) !important;
  box-shadow: 0 8px 24px -2px rgba(230, 0, 103, 0.55) !important;
  transform: translateY(-1px) !important;
}

.auth-login-action-btn:active,
body.admin-site-active #loginButton.auth-login-action-btn:active {
  transform: translateY(0) scale(0.99) !important;
  box-shadow: 0 4px 12px rgba(230, 0, 103, 0.35) !important;
}

.auth-login-action-btn:disabled,
body.admin-site-active #loginButton.auth-login-action-btn:disabled {
  opacity: 0.7 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

#authMessage {
  min-height: 0;
  margin: 0;
  padding: 0;
  text-align: center;
  font-size: 0.84rem;
  font-weight: 600;
  color: #E11D48;
  transition: all 0.25s ease;
}

#authMessage:not(:empty) {
  margin-top: 14px;
  padding: 10px 14px;
  background: #FFF1F4;
  border: 1px solid rgba(225, 29, 72, 0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-sub-links {
  margin-top: 18px;
  display: flex;
  justify-content: center;
}

.auth-back-to-site {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #94A3B8;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s;
}

.auth-back-to-site:hover {
  color: #E60067;
}

.auth-back-to-site svg {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   AUTH BOTTOM PINK DECORATIONS
   ========================================================================== */
.auth-bottom-decorations {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 180px;
  pointer-events: none;
  overflow: hidden;
  z-index: 2;
}

/* Bottom Pink Wave */
.auth-bottom-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 70px;
  z-index: 1;
  pointer-events: none;
  animation: authBottomWaveIn 1s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

/* ==========================================================================
   AUTH ENTRANCE ANIMATIONS (REFRESH / LOAD)
   ========================================================================== */
@keyframes authFadeDown {
  0% {
    opacity: 0;
    transform: translateY(-24px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes authLogoPop {
  0% {
    opacity: 0;
    transform: scale(0.6) rotate(-8deg);
  }
  70% {
    transform: scale(1.08) rotate(2deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes authCardUp {
  0% {
    opacity: 0;
    transform: translateY(32px) scale(0.97);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes authWaveIn {
  0% {
    opacity: 0;
    transform: translateY(12px) scaleY(0.6);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scaleY(1);
  }
}

@keyframes authBottomWaveIn {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .auth-bottom-decorations {
    height: 120px;
  }
}

@media (max-width: 768px) {
  .auth-top-banner {
    padding-top: 36px;
    min-height: 230px;
  }
  .auth-layout-container {
    margin-top: -75px;
  }
  .auth-card-box {
    padding: 28px 22px 24px !important;
  }
}

/* ==========================================================================
   SIDEBAR DANGER BUTTON (SIGN OUT)
   ========================================================================== */
.sidebar .nav-button.nav-button-danger {
  color: #E11D48 !important;
}
.sidebar .nav-button.nav-button-danger svg,
.sidebar .nav-button.nav-button-danger i {
  color: #E11D48 !important;
}
.sidebar .nav-button.nav-button-danger:hover {
  background: #FFF1F2 !important;
  border-color: #FFE4E6 !important;
  color: #BE123C !important;
}
.sidebar .nav-button.nav-button-danger:hover svg,
.sidebar .nav-button.nav-button-danger:hover i {
  color: #BE123C !important;
}

/* ==========================================================================
   THEME TOGGLE BUTTON
   ========================================================================== */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.theme-toggle-btn i,
.theme-toggle-btn svg {
  width: 17px;
  height: 17px;
  color: #64748B;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease;
}
.theme-toggle-btn:hover i,
.theme-toggle-btn:hover svg {
  transform: rotate(20deg) scale(1.12);
  color: #E60067;
}

/* ==========================================================================
   RESQTAP ADMIN DARK MODE SYSTEM
   ========================================================================== */
:root.dark-mode,
html.dark-mode,
body.dark-mode {
  --page: #0B0F17;
  --shell: #0B0F17;
  --sidebar: #111827;
  --sidebar-soft: rgba(230, 0, 103, 0.16);
  --panel: #111827;
  --panel-soft: #182234;
  --ink: #F9FAFB;
  --muted: #94A3B8;
  --faint: #64748B;
  --line: #1F2937;
  --line-strong: #374151;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.35);
  --soft-shadow: 0 4px 20px rgba(230, 0, 103, 0.15);
  color-scheme: dark;
}

html.dark-mode {
  background: #0B0F17 !important;
}

body.dark-mode {
  background: #0B0F17 !important;
  color: #F9FAFB !important;
}

/* App Shell & Workspace in Dark Mode */
body.dark-mode .app-shell,
body.dark-mode .workspace,
body.dark-mode.admin-site-active .workspace,
body.dark-mode.admin-site-active .app-shell {
  background: #0B0F17 !important;
  color: #F9FAFB !important;
}

/* Sidebar in Dark Mode */
body.dark-mode .sidebar {
  background: #111827 !important;
  border-right-color: #1F2937 !important;
}

body.dark-mode .sidebar:hover {
  background: #111827 !important;
  box-shadow: 14px 0 40px rgba(0, 0, 0, 0.55), 0 0 0 1px #1F2937 !important;
}

body.dark-mode .sidebar .sidebar-brand {
  border-bottom-color: #1F2937 !important;
}

body.dark-mode .sidebar-brand strong {
  color: #F9FAFB !important;
}

body.dark-mode .sidebar-brand span {
  color: #94A3B8 !important;
}

body.dark-mode .sidebar .nav-group-label {
  color: #64748B !important;
}

body.dark-mode .sidebar .nav-button {
  color: #94A3B8 !important;
}

body.dark-mode .sidebar .nav-button svg,
body.dark-mode .sidebar .nav-button i {
  color: #94A3B8 !important;
}

body.dark-mode .sidebar .nav-button:hover {
  background: #182234 !important;
  border-color: #27354A !important;
  color: #F9FAFB !important;
}

body.dark-mode .sidebar .nav-button:hover svg,
body.dark-mode .sidebar .nav-button:hover i {
  color: #F9FAFB !important;
}

/* Sidebar Danger Button in Dark Mode */
body.dark-mode .sidebar .nav-button.nav-button-danger {
  color: #F87171 !important;
}
body.dark-mode .sidebar .nav-button.nav-button-danger svg,
body.dark-mode .sidebar .nav-button.nav-button-danger i {
  color: #F87171 !important;
}
body.dark-mode .sidebar .nav-button.nav-button-danger:hover {
  background: rgba(239, 68, 68, 0.18) !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
  color: #FCA5A5 !important;
}
body.dark-mode .sidebar .nav-button.nav-button-danger:hover svg,
body.dark-mode .sidebar .nav-button.nav-button-danger:hover i {
  color: #FCA5A5 !important;
}

/* Sidebar Nav Button Active States in Dark Mode */
body.dark-mode .nav-button[data-view="dashboard"].is-active,
body.dark-mode .nav-button[data-view="dashboard"]:hover {
  background: rgba(230, 0, 103, 0.18) !important;
  border-color: rgba(230, 0, 103, 0.4) !important;
  color: #FF4081 !important;
}
body.dark-mode .nav-button[data-view="dashboard"].is-active svg,
body.dark-mode .nav-button[data-view="dashboard"]:hover svg { color: #FF4081 !important; }

body.dark-mode .nav-button[data-view="users"].is-active,
body.dark-mode .nav-button[data-view="users"]:hover {
  background: rgba(37, 99, 235, 0.18) !important;
  border-color: rgba(37, 99, 235, 0.4) !important;
  color: #60A5FA !important;
}
body.dark-mode .nav-button[data-view="users"].is-active svg,
body.dark-mode .nav-button[data-view="users"]:hover svg { color: #60A5FA !important; }

body.dark-mode .nav-button[data-view="rooms"].is-active,
body.dark-mode .nav-button[data-view="rooms"]:hover {
  background: rgba(2, 132, 199, 0.18) !important;
  border-color: rgba(2, 132, 199, 0.4) !important;
  color: #38BDF8 !important;
}
body.dark-mode .nav-button[data-view="rooms"].is-active svg,
body.dark-mode .nav-button[data-view="rooms"]:hover svg { color: #38BDF8 !important; }

body.dark-mode .nav-button[data-view="sos"].is-active,
body.dark-mode .nav-button[data-view="sos"]:hover,
body.dark-mode .nav-button[data-view="soslivechat"].is-active,
body.dark-mode .nav-button[data-view="soslivechat"]:hover,
body.dark-mode .nav-button[data-view="livemap"].is-active,
body.dark-mode .nav-button[data-view="livemap"]:hover {
  background: rgba(225, 29, 72, 0.18) !important;
  border-color: rgba(225, 29, 72, 0.4) !important;
  color: #FB7185 !important;
}
body.dark-mode .nav-button[data-view="sos"].is-active svg,
body.dark-mode .nav-button[data-view="sos"]:hover svg,
body.dark-mode .nav-button[data-view="soslivechat"].is-active svg,
body.dark-mode .nav-button[data-view="soslivechat"]:hover svg,
body.dark-mode .nav-button[data-view="livemap"].is-active svg,
body.dark-mode .nav-button[data-view="livemap"]:hover svg { color: #FB7185 !important; }

body.dark-mode .nav-button[data-view="reports"].is-active,
body.dark-mode .nav-button[data-view="reports"]:hover {
  background: rgba(234, 88, 12, 0.18) !important;
  border-color: rgba(234, 88, 12, 0.4) !important;
  color: #FB923C !important;
}
body.dark-mode .nav-button[data-view="reports"].is-active svg,
body.dark-mode .nav-button[data-view="reports"]:hover svg { color: #FB923C !important; }

body.dark-mode .nav-button[data-view="notices"].is-active,
body.dark-mode .nav-button[data-view="notices"]:hover {
  background: rgba(217, 119, 6, 0.18) !important;
  border-color: rgba(217, 119, 6, 0.4) !important;
  color: #FBBF24 !important;
}
body.dark-mode .nav-button[data-view="notices"].is-active svg,
body.dark-mode .nav-button[data-view="notices"]:hover svg { color: #FBBF24 !important; }

body.dark-mode .nav-button[data-view="livechat"].is-active,
body.dark-mode .nav-button[data-view="livechat"]:hover {
  background: rgba(5, 150, 105, 0.18) !important;
  border-color: rgba(5, 150, 105, 0.4) !important;
  color: #34D399 !important;
}
body.dark-mode .nav-button[data-view="livechat"].is-active svg,
body.dark-mode .nav-button[data-view="livechat"]:hover svg { color: #34D399 !important; }

body.dark-mode .nav-button[data-view="aichat"].is-active,
body.dark-mode .nav-button[data-view="aichat"]:hover {
  background: rgba(124, 58, 237, 0.18) !important;
  border-color: rgba(124, 58, 237, 0.4) !important;
  color: #A78BFA !important;
}
body.dark-mode .nav-button[data-view="aichat"].is-active svg,
body.dark-mode .nav-button[data-view="aichat"]:hover svg { color: #A78BFA !important; }

body.dark-mode .nav-button[data-view="highlights"].is-active,
body.dark-mode .nav-button[data-view="highlights"]:hover {
  background: rgba(219, 39, 119, 0.18) !important;
  border-color: rgba(219, 39, 119, 0.4) !important;
  color: #F472B6 !important;
}
body.dark-mode .nav-button[data-view="highlights"].is-active svg,
body.dark-mode .nav-button[data-view="highlights"]:hover svg { color: #F472B6 !important; }

body.dark-mode .nav-button[data-view="logs"].is-active,
body.dark-mode .nav-button[data-view="logs"]:hover {
  background: rgba(8, 145, 178, 0.18) !important;
  border-color: rgba(8, 145, 178, 0.4) !important;
  color: #22D3EE !important;
}
body.dark-mode .nav-button[data-view="logs"].is-active svg,
body.dark-mode .nav-button[data-view="logs"]:hover svg { color: #22D3EE !important; }

body.dark-mode .nav-button[data-view="admins"].is-active,
body.dark-mode .nav-button[data-view="admins"]:hover {
  background: rgba(79, 70, 229, 0.18) !important;
  border-color: rgba(79, 70, 229, 0.4) !important;
  color: #818CF8 !important;
}
body.dark-mode .nav-button[data-view="admins"].is-active svg,
body.dark-mode .nav-button[data-view="admins"]:hover svg { color: #818CF8 !important; }

/* Topbar & Search in Dark Mode */
body.dark-mode .topbar-left h2 {
  color: #F9FAFB !important;
}

body.dark-mode .search-shell {
  background: #111827 !important;
  border-color: #1F2937 !important;
  color: #94A3B8 !important;
}
body.dark-mode .search-shell:focus-within {
  border-color: #E60067 !important;
  box-shadow: 0 0 0 3px rgba(230, 0, 103, 0.25) !important;
}
body.dark-mode .search-shell .search-input {
  color: #F9FAFB !important;
}
body.dark-mode .search-shell .search-input::placeholder {
  color: #64748B !important;
}

/* Secondary & Danger Buttons in Dark Mode */
body.dark-mode .secondary-button,
body.dark-mode .small-button,
body.dark-mode.admin-site-active .secondary-button,
body.dark-mode.admin-site-active .small-button {
  background: #161F30 !important;
  border-color: #27354A !important;
  color: #E2E8F0 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25) !important;
}

body.dark-mode .secondary-button:hover,
body.dark-mode .small-button:hover,
body.dark-mode.admin-site-active .secondary-button:hover,
body.dark-mode.admin-site-active .small-button:hover {
  background: #1E293B !important;
  border-color: #38BDF8 !important;
  color: #38BDF8 !important;
  box-shadow: 0 6px 16px rgba(56, 189, 248, 0.15) !important;
}

body.dark-mode .secondary-button.danger,
body.dark-mode .small-button.danger,
body.dark-mode.admin-site-active .secondary-button.danger,
body.dark-mode.admin-site-active .small-button.danger {
  background: rgba(239, 68, 68, 0.12) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  color: #F87171 !important;
}

body.dark-mode .secondary-button.danger:hover,
body.dark-mode .small-button.danger:hover,
body.dark-mode.admin-site-active .secondary-button.danger:hover,
body.dark-mode.admin-site-active .small-button.danger:hover {
  background: rgba(239, 68, 68, 0.24) !important;
  border-color: #EF4444 !important;
  color: #FCA5A5 !important;
}

/* Theme Toggle Button Specifics in Dark Mode */
body.dark-mode .theme-toggle-btn i,
body.dark-mode .theme-toggle-btn svg {
  color: #FBBF24 !important;
}
body.dark-mode .theme-toggle-btn:hover {
  background: rgba(245, 158, 11, 0.15) !important;
  border-color: rgba(245, 158, 11, 0.4) !important;
  color: #FBBF24 !important;
}
body.dark-mode .theme-toggle-btn:hover i,
body.dark-mode .theme-toggle-btn:hover svg {
  transform: rotate(45deg) scale(1.12);
  color: #FDE047 !important;
}

/* Panels, Metric Cards & Detail Panels in Dark Mode */
body.dark-mode .panel,
body.dark-mode .metric-card,
body.dark-mode .detail-panel,
body.dark-mode .setup-box,
body.dark-mode .livechat-thread-pane,
body.dark-mode .livechat-conversation,
body.dark-mode .attachment-viewer-shell,
body.dark-mode.admin-site-active .panel,
body.dark-mode.admin-site-active .metric-card,
body.dark-mode.admin-site-active .detail-panel,
body.dark-mode.admin-site-active .setup-box,
body.dark-mode.admin-site-active .livechat-thread-pane,
body.dark-mode.admin-site-active .livechat-conversation,
body.dark-mode.admin-site-active .attachment-viewer-shell {
  background: #111827 !important;
  border-color: #1F2937 !important;
  color: #F9FAFB !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35) !important;
}

body.dark-mode .panel-header h3,
body.dark-mode .metric-card strong,
body.dark-mode .cell-main strong,
body.dark-mode .list-item strong,
body.dark-mode .detail-empty strong,
body.dark-mode .livechat-empty strong,
body.dark-mode .kv span:last-child {
  color: #F9FAFB !important;
}

body.dark-mode .dashboard-date-pill,
body.dark-mode.admin-site-active .dashboard-date-pill {
  background: #161F30 !important;
  border-color: #27354A !important;
  color: #F9FAFB !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
}
body.dark-mode .dashboard-date-pill:hover,
body.dark-mode.admin-site-active .dashboard-date-pill:hover {
  background: #1E293B !important;
  border-color: #38BDF8 !important;
  color: #38BDF8 !important;
}
body.dark-mode .dashboard-date-pill i,
body.dark-mode .dashboard-date-pill svg,
body.dark-mode.admin-site-active .dashboard-date-pill i,
body.dark-mode.admin-site-active .dashboard-date-pill svg {
  color: #94A3B8 !important;
}

body.dark-mode .dashboard-range-select,
body.dark-mode.admin-site-active .dashboard-range-select {
  background: transparent !important;
  border: 0 !important;
  color: #F9FAFB !important;
  outline: none !important;
  box-shadow: none !important;
}
body.dark-mode .dashboard-range-select option,
body.dark-mode.admin-site-active .dashboard-range-select option {
  background: #161F30 !important;
  color: #F9FAFB !important;
}

/* Stat cards dark gradient */
body.dark-mode .stat-card.purple,
body.dark-mode .stat-card.blue {
  background: linear-gradient(135deg, #131B2E 0%, #1A2744 100%) !important;
  border-color: #1E3A8A !important;
}

/* Tables in Dark Mode */
body.dark-mode .table-shell,
body.dark-mode .table-wrap {
  border-color: #1F2937 !important;
  background: #111827 !important;
}

body.dark-mode table,
body.dark-mode .data-table {
  background: #111827 !important;
}

body.dark-mode th,
body.dark-mode.admin-site-active th {
  background: #161F30 !important;
  color: #94A3B8 !important;
  border-bottom: 1px solid #1F2937 !important;
}

body.dark-mode td,
body.dark-mode.admin-site-active td {
  color: #E2E8F0 !important;
  border-bottom: 1px solid #1F2937 !important;
}

body.dark-mode tr:hover td,
body.dark-mode.admin-site-active tr:hover td {
  background: #1A2438 !important;
  color: #FFFFFF !important;
}

/* Tabs & Pagination in Dark Mode */
body.dark-mode .category-tabs,
body.dark-mode .pagination-bar,
body.dark-mode .page-size-field,
body.dark-mode.admin-site-active .category-tabs,
body.dark-mode.admin-site-active .pagination-bar,
body.dark-mode.admin-site-active .page-size-field {
  background: #161F30 !important;
  border-color: #1F2937 !important;
  color: #F9FAFB !important;
}

body.dark-mode .category-tab,
body.dark-mode.admin-site-active .category-tab {
  color: #94A3B8 !important;
}

body.dark-mode .category-tab:hover,
body.dark-mode.admin-site-active .category-tab:hover {
  background: #1E293B !important;
  color: #F9FAFB !important;
}

body.dark-mode .category-tab.is-active,
body.dark-mode.admin-site-active .category-tab.is-active {
  background: rgba(230, 0, 103, 0.2) !important;
  border-color: rgba(230, 0, 103, 0.4) !important;
  color: #FF4081 !important;
}

/* Forms and Inputs in Dark Mode */
body.dark-mode .field input,
body.dark-mode .field textarea,
body.dark-mode .field select,
body.dark-mode .inline-form input,
body.dark-mode .page-size-field select,
body.dark-mode.admin-site-active .field input,
body.dark-mode.admin-site-active .field textarea,
body.dark-mode.admin-site-active .field select,
body.dark-mode.admin-site-active .inline-form input,
body.dark-mode.admin-site-active .page-size-field select {
  background: #141C2C !important;
  border-color: #243048 !important;
  color: #F9FAFB !important;
}

body.dark-mode .field input:focus,
body.dark-mode .field textarea:focus,
body.dark-mode .field select:focus {
  border-color: #E60067 !important;
  box-shadow: 0 0 0 3px rgba(230, 0, 103, 0.25) !important;
}

/* Livechat in Dark Mode */
body.dark-mode .livechat-thread,
body.dark-mode.admin-site-active .livechat-thread {
  background: #111827 !important;
  border-color: #1F2937 !important;
  color: #F9FAFB !important;
}

body.dark-mode .livechat-thread:hover,
body.dark-mode .livechat-thread.is-active,
body.dark-mode.admin-site-active .livechat-thread:hover,
body.dark-mode.admin-site-active .livechat-thread.is-active {
  background: #182234 !important;
  border-color: #27354A !important;
}

body.dark-mode .livechat-bubble,
body.dark-mode.admin-site-active .livechat-bubble {
  background: #1A2438 !important;
  border-color: #27354A !important;
  color: #F9FAFB !important;
}

body.dark-mode .livechat-message.from-admin .livechat-bubble,
body.dark-mode.admin-site-active .livechat-message.from-admin .livechat-bubble {
  background: rgba(230, 0, 103, 0.18) !important;
  border-color: rgba(230, 0, 103, 0.35) !important;
  color: #FCE7F3 !important;
}

body.dark-mode .livechat-message.from-ai .livechat-bubble,
body.dark-mode.admin-site-active .livechat-message.from-ai .livechat-bubble {
  background: rgba(14, 165, 233, 0.16) !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
  color: #bae6fd !important;
}

body.dark-mode .livechat-message.from-system .livechat-bubble,
body.dark-mode.admin-site-active .livechat-message.from-system .livechat-bubble {
  background: rgba(236, 72, 153, 0.15) !important;
  border-color: rgba(236, 72, 153, 0.35) !important;
  color: #fbcfe8 !important;
}

body.dark-mode .livechat-reply-form,
body.dark-mode.admin-site-active .livechat-reply-form {
  background: #161F30 !important;
  border-color: #1F2937 !important;
}

body.dark-mode .livechat-reply-form textarea,
body.dark-mode.admin-site-active .livechat-reply-form textarea {
  background: #111827 !important;
  border-color: #243048 !important;
  color: #F9FAFB !important;
}

/* Livechat Header in Dark Mode */
body.dark-mode .livechat-conversation-header,
body.dark-mode.admin-site-active .livechat-conversation-header {
  background: #161F30 !important;
  border-bottom: 1px solid #1F2937 !important;
  color: #F9FAFB !important;
}

body.dark-mode .livechat-conversation-header h3,
body.dark-mode.admin-site-active .livechat-conversation-header h3 {
  color: #F9FAFB !important;
}

body.dark-mode .livechat-conversation-header .muted,
body.dark-mode.admin-site-active .livechat-conversation-header .muted,
body.dark-mode #livechatSelectedSubtitle,
body.dark-mode #aiChatSelectedSubtitle {
  color: #94A3B8 !important;
}

/* Avatar in Dark Mode */
body.dark-mode .avatar,
body.dark-mode.admin-site-active .avatar {
  background: #182234 !important;
  border-color: #27354A !important;
  color: #94A3B8 !important;
}
body.dark-mode .avatar i,
body.dark-mode .avatar svg,
body.dark-mode.admin-site-active .avatar i,
body.dark-mode.admin-site-active .avatar svg {
  color: #94A3B8 !important;
}

/* Status Pill in Dark Mode */
body.dark-mode .status-pill,
body.dark-mode.admin-site-active .status-pill {
  background: rgba(230, 0, 103, 0.2) !important;
  border: 1px solid rgba(230, 0, 103, 0.35) !important;
  color: #FF4081 !important;
}

/* Livechat Empty State */
body.dark-mode .livechat-empty,
body.dark-mode.admin-site-active .livechat-empty,
body.dark-mode .detail-empty,
body.dark-mode.admin-site-active .detail-empty {
  color: #94A3B8 !important;
}

body.dark-mode .livechat-empty strong,
body.dark-mode.admin-site-active .livechat-empty strong,
body.dark-mode .detail-empty strong,
body.dark-mode.admin-site-active .detail-empty strong {
  color: #F9FAFB !important;
}

/* Charts & Legends in Dark Mode */
body.dark-mode .chart-grid-line {
  stroke: #1F2937 !important;
}
body.dark-mode .chart-axis-text {
  fill: #94A3B8 !important;
}

/* Donut Chart Center & Track */
body.dark-mode .donut-center,
body.dark-mode.admin-site-active .donut-center {
  fill: #111827 !important;
  stroke: #1F2937 !important;
}
body.dark-mode .donut-track,
body.dark-mode.admin-site-active .donut-track {
  stroke: #1F2937 !important;
}

/* Chart Legends (Usage Statistics Pills) */
body.dark-mode .chart-legend-item,
body.dark-mode.admin-site-active .chart-legend-item {
  background: #161F30 !important;
  border-color: #27354A !important;
  color: #E2E8F0 !important;
}
body.dark-mode .chart-legend-item:hover,
body.dark-mode.admin-site-active .chart-legend-item:hover {
  background: #1E293B !important;
  border-color: #38BDF8 !important;
  color: #FFFFFF !important;
}

/* Feature Legends (Feature Usage List Pills) */
body.dark-mode .feature-legend-item,
body.dark-mode.admin-site-active .feature-legend-item {
  background: #161F30 !important;
  border-color: #27354A !important;
  color: #E2E8F0 !important;
}
body.dark-mode .feature-legend-item strong,
body.dark-mode.admin-site-active .feature-legend-item strong {
  color: #F9FAFB !important;
}
body.dark-mode .feature-legend-item:hover,
body.dark-mode.admin-site-active .feature-legend-item:hover {
  background: #1E293B !important;
  border-color: #38BDF8 !important;
}

/* Panel Header & Dashboard Toolbar in Dark Mode */
body.dark-mode .panel-header,
body.dark-mode.admin-site-active .panel-header,
body.dark-mode .dashboard-toolbar,
body.dark-mode.admin-site-active .dashboard-toolbar {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* Metric Trends in Dark Mode */
body.dark-mode .stat-card.purple .metric-trend,
body.dark-mode .stat-card.blue .metric-trend {
  background: rgba(37, 99, 235, 0.2) !important;
  color: #60A5FA !important;
}
body.dark-mode .stat-card.green .metric-trend {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #34D399 !important;
}
body.dark-mode .stat-card.red .metric-trend,
body.dark-mode .stat-card.pink .metric-trend {
  background: rgba(225, 29, 72, 0.2) !important;
  color: #FB7185 !important;
}

/* Highlights Creator Box & Manager in Dark Mode */
body.dark-mode .highlight-creator-box,
body.dark-mode.admin-site-active .highlight-creator-box {
  background: #111827 !important;
  border-color: #1F2937 !important;
  color: #F9FAFB !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35) !important;
}

body.dark-mode .creator-header,
body.dark-mode.admin-site-active .creator-header,
body.dark-mode .creator-header strong,
body.dark-mode.admin-site-active .creator-header strong {
  color: #F9FAFB !important;
}

body.dark-mode .highlight-creator-box .field span,
body.dark-mode.admin-site-active .highlight-creator-box .field span,
body.dark-mode .upload-label,
body.dark-mode.admin-site-active .upload-label {
  color: #94A3B8 !important;
}

body.dark-mode .banner-preview-box,
body.dark-mode.admin-site-active .banner-preview-box {
  background: #0B0F17 !important;
  border-color: #27354A !important;
}

body.dark-mode .banner-upload-dropzone:hover .banner-preview-box,
body.dark-mode.admin-site-active .banner-upload-dropzone:hover .banner-preview-box {
  background: rgba(230, 0, 103, 0.08) !important;
  border-color: #E60067 !important;
}

body.dark-mode .no-preview-placeholder span,
body.dark-mode.admin-site-active .no-preview-placeholder span {
  color: #94A3B8 !important;
}

body.dark-mode .no-preview-placeholder small,
body.dark-mode.admin-site-active .no-preview-placeholder small {
  color: #64748B !important;
}

body.dark-mode .panel-section-divider,
body.dark-mode.admin-site-active .panel-section-divider {
  border-top-color: #1F2937 !important;
}

body.dark-mode .section-title-wrap h4,
body.dark-mode.admin-site-active .section-title-wrap h4 {
  color: #F9FAFB !important;
}

body.dark-mode .section-title-wrap i,
body.dark-mode .section-title-wrap svg,
body.dark-mode.admin-site-active .section-title-wrap i,
body.dark-mode.admin-site-active .section-title-wrap svg {
  color: #94A3B8 !important;
}

body.dark-mode .highlight-item-card,
body.dark-mode.admin-site-active .highlight-item-card {
  background: #111827 !important;
  border-color: #1F2937 !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4) !important;
}

body.dark-mode .highlight-card-media,
body.dark-mode.admin-site-active .highlight-card-media {
  background: #0B0F17 !important;
}

body.dark-mode .highlight-item-card:hover,
body.dark-mode.admin-site-active .highlight-item-card:hover {
  border-color: #E60067 !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6) !important;
}

body.dark-mode .highlight-card-title,
body.dark-mode.admin-site-active .highlight-card-title {
  color: #F9FAFB !important;
}

body.dark-mode .highlight-card-link,
body.dark-mode.admin-site-active .highlight-card-link {
  background: rgba(37, 99, 235, 0.16) !important;
  border-color: rgba(37, 99, 235, 0.35) !important;
  color: #60A5FA !important;
}

body.dark-mode .highlight-card-link:hover,
body.dark-mode.admin-site-active .highlight-card-link:hover {
  background: rgba(37, 99, 235, 0.28) !important;
  color: #93C5FD !important;
}

body.dark-mode .highlight-card-nolink,
body.dark-mode.admin-site-active .highlight-card-nolink {
  color: #64748B !important;
}

body.dark-mode .highlight-card-actions,
body.dark-mode.admin-site-active .highlight-card-actions {
  border-top-color: #1F2937 !important;
}

body.dark-mode .action-pill-btn,
body.dark-mode.admin-site-active .action-pill-btn {
  background: #161F30 !important;
  border-color: #27354A !important;
  color: #94A3B8 !important;
}

body.dark-mode .action-pill-btn.muted,
body.dark-mode.admin-site-active .action-pill-btn.muted {
  background: #161F30 !important;
  border-color: #27354A !important;
  color: #94A3B8 !important;
}

body.dark-mode .action-pill-btn.muted:hover,
body.dark-mode.admin-site-active .action-pill-btn.muted:hover {
  background: #1E293B !important;
  border-color: #38BDF8 !important;
  color: #F9FAFB !important;
}

body.dark-mode .action-pill-btn.success,
body.dark-mode.admin-site-active .action-pill-btn.success {
  background: rgba(16, 185, 129, 0.16) !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
  color: #34D399 !important;
}

body.dark-mode .action-pill-btn.success:hover,
body.dark-mode.admin-site-active .action-pill-btn.success:hover {
  background: rgba(16, 185, 129, 0.3) !important;
  color: #6EE7B7 !important;
}

body.dark-mode .action-pill-btn.danger,
body.dark-mode.admin-site-active .action-pill-btn.danger {
  background: rgba(239, 68, 68, 0.16) !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
  color: #F87171 !important;
}

body.dark-mode .action-pill-btn.danger:hover,
body.dark-mode.admin-site-active .action-pill-btn.danger:hover {
  background: rgba(239, 68, 68, 0.3) !important;
  color: #FCA5A5 !important;
}

body.dark-mode .empty-highlights-state,
body.dark-mode.admin-site-active .empty-highlights-state {
  background: #111827 !important;
  border-color: #27354A !important;
  color: #94A3B8 !important;
}

body.dark-mode .empty-highlights-state strong,
body.dark-mode.admin-site-active .empty-highlights-state strong {
  color: #F9FAFB !important;
}

/* Admins & Members List Rows in Dark Mode */
body.dark-mode .member-row,
body.dark-mode .list-item,
body.dark-mode .contact-row,
body.dark-mode.admin-site-active .member-row,
body.dark-mode.admin-site-active .list-item,
body.dark-mode.admin-site-active .contact-row {
  background: #141C2C !important;
  border-color: #1F2937 !important;
  color: #F9FAFB !important;
}
body.dark-mode .member-row:hover,
body.dark-mode .list-item:hover,
body.dark-mode .contact-row:hover,
body.dark-mode.admin-site-active .member-row:hover,
body.dark-mode.admin-site-active .list-item:hover,
body.dark-mode.admin-site-active .contact-row:hover {
  background: #182234 !important;
}
body.dark-mode .member-row strong,
body.dark-mode .list-item strong,
body.dark-mode.admin-site-active .member-row strong,
body.dark-mode.admin-site-active .list-item strong {
  color: #F9FAFB !important;
}
body.dark-mode .member-row span,
body.dark-mode .list-item span,
body.dark-mode.admin-site-active .member-row span,
body.dark-mode.admin-site-active .list-item span {
  color: #94A3B8 !important;
}

/* Inline Empty States (AI Chat & Livechat Thread List) */
body.dark-mode .livechat-empty.inline,
body.dark-mode .livechat-empty,
body.dark-mode.admin-site-active .livechat-empty.inline,
body.dark-mode.admin-site-active .livechat-empty {
  background: #141C2C !important;
  border-color: #1F2937 !important;
  color: #94A3B8 !important;
}
body.dark-mode .livechat-empty.inline strong,
body.dark-mode .livechat-empty strong,
body.dark-mode.admin-site-active .livechat-empty.inline strong,
body.dark-mode.admin-site-active .livechat-empty strong {
  color: #F9FAFB !important;
}

/* Filter Category Tabs (Logs, Notices) in Dark Mode */
body.dark-mode .category-tab,
body.dark-mode.admin-site-active .category-tab {
  background: #182234 !important;
  border-color: #27354A !important;
  color: #E2E8F0 !important;
}
body.dark-mode .category-tab:hover,
body.dark-mode.admin-site-active .category-tab:hover {
  background: #1E293B !important;
  border-color: #38BDF8 !important;
  color: #FFFFFF !important;
}
body.dark-mode .category-tab.is-active,
body.dark-mode.admin-site-active .category-tab.is-active {
  background: rgba(230, 0, 103, 0.22) !important;
  border-color: rgba(230, 0, 103, 0.45) !important;
  color: #FF4081 !important;
}
body.dark-mode .category-tab-count,
body.dark-mode.admin-site-active .category-tab-count {
  background: rgba(230, 0, 103, 0.3) !important;
  color: #FF4081 !important;
}
body.dark-mode .category-tab.is-active .category-tab-count,
body.dark-mode.admin-site-active .category-tab.is-active .category-tab-count {
  background: #E60067 !important;
  color: #FFFFFF !important;
}

/* Attachment Viewer & Report Cards in Dark Mode */
body.dark-mode .report-attachment-card,
body.dark-mode.admin-site-active .report-attachment-card {
  background: #161F30 !important;
  border-color: #1F2937 !important;
  color: #F9FAFB !important;
}

body.dark-mode .report-attachment-button:hover,
body.dark-mode.admin-site-active .report-attachment-button:hover {
  background: #1E293B !important;
  border-color: #38BDF8 !important;
}

body.dark-mode .report-attachment-preview,
body.dark-mode.admin-site-active .report-attachment-preview {
  background: #111827 !important;
  border-color: #1F2937 !important;
}

body.dark-mode .attachment-viewer-body,
body.dark-mode.admin-site-active .attachment-viewer-body {
  background: #0B0F17 !important;
}

body.dark-mode .attachment-viewer-header,
body.dark-mode.admin-site-active .attachment-viewer-header {
  background: #111827 !important;
  border-bottom-color: #1F2937 !important;
}

body.dark-mode .attachment-viewer-image,
body.dark-mode.admin-site-active .attachment-viewer-image {
  background: #0B0F17 !important;
}

body.dark-mode .attachment-viewer-frame,
body.dark-mode.admin-site-active .attachment-viewer-frame {
  background: #0B0F17 !important;
}

body.dark-mode .livechat-image-preview,
body.dark-mode.admin-site-active .livechat-image-preview {
  background: #0B0F17 !important;
  border-color: #1F2937 !important;
}

body.dark-mode .livechat-selected-attachment,
body.dark-mode.admin-site-active .livechat-selected-attachment {
  background: #161F30 !important;
  border-color: #1F2937 !important;
}
body.dark-mode .livechat-selected-attachment strong,
body.dark-mode.admin-site-active .livechat-selected-attachment strong {
  color: #F9FAFB !important;
}
body.dark-mode .livechat-selected-attachment button,
body.dark-mode.admin-site-active .livechat-selected-attachment button {
  color: #94A3B8 !important;
}
body.dark-mode .livechat-selected-attachment button:hover,
body.dark-mode.admin-site-active .livechat-selected-attachment button:hover {
  background: rgba(230, 0, 103, 0.2) !important;
  color: #FF4081 !important;
}

/* ==========================================================================
   SOS EMERGENCY ALARM BANNER (30s LIVE ALARM)
   ========================================================================== */
.sos-alarm-banner {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #e11d48, #be123c);
  color: #ffffff;
  border-radius: 9999px;
  box-shadow: 0 10px 32px rgba(225, 29, 72, 0.45), 0 0 0 2.5px rgba(255, 255, 255, 0.4);
  animation: sosBannerPulse 1.2s infinite ease-in-out;
  max-width: 92vw;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  user-select: none;
}
.sos-alarm-banner.hidden {
  display: none !important;
}
@keyframes sosBannerPulse {
  0%, 100% {
    transform: translateX(-50%) scale(1);
    box-shadow: 0 10px 32px rgba(225, 29, 72, 0.45), 0 0 0 2.5px rgba(255, 255, 255, 0.4);
  }
  50% {
    transform: translateX(-50%) scale(1.025);
    box-shadow: 0 14px 44px rgba(225, 29, 72, 0.75), 0 0 0 5px rgba(255, 255, 255, 0.65);
  }
}
.sos-alarm-icon {
  font-size: 24px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: sosIconWiggle 0.45s infinite alternate ease-in-out;
}
@keyframes sosIconWiggle {
  from { transform: rotate(-14deg) scale(0.95); }
  to { transform: rotate(14deg) scale(1.1); }
}
.sos-alarm-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.sos-alarm-title {
  font-weight: 800;
  font-size: 0.88rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.sos-alarm-subtitle {
  font-size: 0.76rem;
  opacity: 0.95;
  font-weight: 500;
}
.sos-alarm-timer {
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  letter-spacing: 0.5px;
}
.sos-alarm-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sos-alarm-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 9999px;
  border: none;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}
.sos-alarm-btn-serve {
  background: #10b981;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
  font-weight: 700;
}
.sos-alarm-btn-serve:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.45);
}
.sos-alarm-btn-serve.is-served {
  background: #047857 !important;
  color: #a7f3d0 !important;
  cursor: default !important;
  opacity: 0.95;
  box-shadow: none !important;
  transform: none !important;
}
.sos-alarm-btn-view {
  background: #ffffff;
  color: #be123c;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}
.sos-alarm-btn-view:hover {
  background: #fff1f2;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
}
.sos-alarm-btn-mute {
  background: rgba(0, 0, 0, 0.28);
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
}
.sos-alarm-btn-mute:hover {
  background: rgba(0, 0, 0, 0.48);
}

.leaflet-marker-icon {
  overflow: visible !important;
}
.lm-marker-wrap {
  position: relative !important;
  overflow: visible !important;
}
.lm-avatar-frame {
  position: relative !important;
  z-index: 1 !important;
}
.lm-sos-badge {
  position: absolute !important;
  bottom: -18px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  background: #ef4444 !important;
  color: #ffffff !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  padding: 2.5px 8px !important;
  border-radius: 9999px !important;
  border: 2px solid #ffffff !important;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.6) !important;
  letter-spacing: 0.8px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  z-index: 99999 !important;
  pointer-events: none !important;
  display: block !important;
}

/* ==========================================================================
   FLOATING SOS CASE UPDATE MODAL (RESERVE / SERVE SOS CASE)
   ========================================================================== */
.sos-case-modal {
  position: fixed;
  inset: 0;
  z-index: 100005;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.sos-case-modal.hidden {
  display: none !important;
}
.sos-case-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.sos-case-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 580px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPopIn 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalPopIn {
  from {
    opacity: 0;
    transform: scale(0.93) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.sos-case-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.08), rgba(244, 63, 94, 0.03));
  border-bottom: 1px solid var(--line);
}
.sos-case-header-main {
  display: flex;
  align-items: center;
  gap: 14px;
}
.sos-case-badge-pulse {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #ffe4ee;
  color: #e60067;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 14px rgba(230, 0, 103, 0.25);
  flex-shrink: 0;
}
.dark-mode .sos-case-badge-pulse {
  background: rgba(230, 0, 103, 0.2);
  color: #ff4081;
}
.sos-case-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.25;
}
.sos-case-subtitle {
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.sos-case-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.sos-case-close-btn:hover {
  background: var(--line);
  color: #e11d48;
}
.sos-case-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: 70vh;
  overflow-y: auto;
}
.sos-case-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sos-case-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.sos-case-steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.sos-case-step-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 10px 6px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--panel-soft);
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
}
.sos-case-step-btn .step-num {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  transition: all 0.18s ease;
}
.sos-case-step-btn .step-text strong {
  display: block;
  font-size: 0.82rem;
  color: var(--ink);
  line-height: 1.2;
}
.sos-case-step-btn .step-text span {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 2px;
}
.sos-case-step-btn:hover {
  border-color: #3b82f6;
  background: var(--panel);
}
.sos-case-step-btn.is-active {
  border-color: #e11d48;
  background: linear-gradient(180deg, rgba(225, 29, 72, 0.08), rgba(225, 29, 72, 0.02));
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.18);
}
.sos-case-step-btn.is-active .step-num {
  background: #e11d48;
  color: #ffffff;
}
.sos-case-step-btn.is-active .step-text strong {
  color: #e11d48;
}
.sos-case-quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}
.sos-tag-chip {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s ease;
}
.sos-tag-chip:hover {
  background: #ffe4ee;
  border-color: #f43f5e;
  color: #e11d48;
}
.dark-mode .sos-tag-chip:hover {
  background: rgba(225, 29, 72, 0.2);
  border-color: #f43f5e;
  color: #fda4af;
}
.sos-case-textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.88rem;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.45;
  transition: border-color 0.15s ease;
}
.sos-case-textarea:focus {
  outline: none;
  border-color: #e11d48;
  box-shadow: 0 0 0 2.5px rgba(225, 29, 72, 0.2);
}
.sos-case-quick-actions {
  display: flex;
  gap: 10px;
}
.sos-case-quick-actions button {
  flex: 1;
}
.sos-case-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: var(--panel-soft);
}
@keyframes caseAutoSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
.sos-case-autosave {
  margin-right: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #10b981;
  transition: all 0.2s ease;
  user-select: none;
}
.sos-case-autosave.is-saving {
  color: #38bdf8;
}
.sos-case-autosave.is-error {
  color: #f43f5e;
}
.sos-case-autosave svg {
  width: 15px;
  height: 15px;
}
.sos-case-autosave .spin {
  animation: caseAutoSpin 0.9s linear infinite;
}


/* Call Options Modal & Cards */
.call-options-card {
  max-width: 480px;
  width: 92%;
}
.call-options-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}
.call-option-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1.5px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}
.call-option-btn:hover {
  border-color: #e11d48;
  background: rgba(225, 29, 72, 0.04);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(225, 29, 72, 0.12);
}
.call-option-icon {
  width: 46px;
  height: 46px;
  min-width: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.call-video-btn .call-option-icon {
  background: linear-gradient(135deg, #e11d48, #be123c);
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.35);
}
.call-voice-btn .call-option-icon {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
}
.call-option-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.call-option-text strong {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}
.call-option-text span {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.35;
}
.call-option-arrow {
  width: 18px;
  height: 18px;
  color: var(--muted);
  transition: transform 0.2s ease;
}
.call-option-btn:hover .call-option-arrow {
  transform: translateX(4px);
  color: #e11d48;
}

/* Floating Incoming SOS Call Alert for Admin */
/* Floating Incoming SOS Call Alert for Admin */
.admin-call-alert {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999999;
  width: auto;
  max-width: calc(100vw - 32px);
  animation: slideDownFade 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translate(-50%, -24px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
.admin-call-alert-content {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(225, 29, 72, 0.45);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5), 0 0 24px rgba(225, 29, 72, 0.35);
  color: #fff;
  box-sizing: border-box;
}
.admin-call-pulse-avatar {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  background: #e11d48;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  animation: emergencyPulse 1.4s infinite ease-in-out;
}
@keyframes emergencyPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.7);
  }
  70% {
    box-shadow: 0 0 0 14px rgba(225, 29, 72, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(225, 29, 72, 0);
  }
}
.admin-call-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 140px;
  max-width: 220px;
}
.admin-call-caller-name {
  font-size: 0.96rem;
  font-weight: 800;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #ffffff;
}
.admin-call-desc {
  font-size: 0.78rem;
  color: #94a3b8;
  margin: 2px 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-call-actions {
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 10px !important;
  align-items: center !important;
  flex-shrink: 0 !important;
}
.call-accept-btn,
.call-decline-btn {
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  width: 124px !important;
  min-width: 124px !important;
  max-width: 124px !important;
  margin: 0 !important;
  padding: 0 12px !important;
  font-size: 0.84rem !important;
  font-weight: 700 !important;
  font-family: inherit !important;
  border-radius: 10px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
  line-height: 1 !important;
  text-decoration: none !important;
}
.call-accept-btn {
  background: #059669 !important;
  color: #ffffff !important;
  border: 1px solid #10b981 !important;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3) !important;
  transition: all 0.15s ease !important;
}
.call-accept-btn:hover {
  background: #047857 !important;
  border-color: #059669 !important;
}
.call-decline-btn {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
  border: 1px solid rgba(248, 113, 113, 0.35) !important;
  box-shadow: none !important;
  transition: all 0.15s ease !important;
}
.call-decline-btn:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: rgba(248, 113, 113, 0.5) !important;
}
.call-accept-btn i,
.call-decline-btn i,
.call-accept-btn svg,
.call-decline-btn svg {
  width: 16px !important;
  height: 16px !important;
  flex-shrink: 0 !important;
}

/* ==========================================================================
   SOS Livechat Dedicated Styles
   ========================================================================== */
.sos-livechat-panel {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 120px);
  min-height: 600px;
}

.sos-livechat-panel .livechat-layout {
  flex: 1;
  min-height: 0;
}

.sos-thread-search-wrap input:focus {
  outline: none;
  border-color: var(--danger, #e11d48) !important;
  box-shadow: 0 0 0 2px rgba(225, 29, 72, 0.2);
}

.livechat-bubble-row {
  display: flex;
  width: 100%;
  margin-bottom: 10px;
}

.livechat-bubble-row.is-admin {
  justify-content: flex-end;
}

.livechat-bubble-row.is-user {
  justify-content: flex-start;
}

body.dark-mode .livechat-bubble-row.is-user .livechat-bubble {
  background: #3B0716 !important;
  color: #FECDD3 !important;
  border-color: #831843 !important;
}

body.dark-mode .sos-thread-search-wrap input {
  background: #111827 !important;
  border-color: #374151 !important;
  color: #F9FAFB !important;
}

/* SOS Livechat Thread items */
.sos-livechat-panel .livechat-thread {
  border: 1px solid var(--border, #e2e8f0);
  background: #ffffff;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.sos-livechat-panel .livechat-thread:hover,
body.admin-site-active:not(.dark-mode) .sos-livechat-panel .livechat-thread:hover {
  background: #FFF5F6 !important;
  border-color: #FECDD3 !important;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.08) !important;
}

.sos-livechat-panel .livechat-thread.is-active,
body.admin-site-active:not(.dark-mode) .sos-livechat-panel .livechat-thread.is-active {
  background: #FFF1F2 !important;
  border-color: #FB7185 !important;
  box-shadow: 0 4px 16px rgba(225, 29, 72, 0.16) !important;
}

.sos-livechat-panel .livechat-thread.is-active::before,
body.admin-site-active:not(.dark-mode) .sos-livechat-panel .livechat-thread.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #E11D48 !important;
}

.sos-livechat-panel .livechat-thread.is-active .livechat-thread-head strong,
body.admin-site-active:not(.dark-mode) .sos-livechat-panel .livechat-thread.is-active .livechat-thread-head strong {
  color: #9F1239 !important;
}

/* Dark mode SOS livechat thread */
body.dark-mode .sos-livechat-panel .livechat-thread,
body.dark-mode.admin-site-active .sos-livechat-panel .livechat-thread {
  background: #111827 !important;
  border-color: #1F2937 !important;
  color: #F9FAFB !important;
}

body.dark-mode .sos-livechat-panel .livechat-thread:hover,
body.dark-mode.admin-site-active .sos-livechat-panel .livechat-thread:hover {
  background: rgba(225, 29, 72, 0.1) !important;
  border-color: rgba(225, 29, 72, 0.35) !important;
}

body.dark-mode .sos-livechat-panel .livechat-thread.is-active,
body.dark-mode.admin-site-active .sos-livechat-panel .livechat-thread.is-active {
  background: rgba(225, 29, 72, 0.22) !important;
  border-color: #E11D48 !important;
  box-shadow: 0 4px 18px rgba(225, 29, 72, 0.3) !important;
}

body.dark-mode .sos-livechat-panel .livechat-thread.is-active::before,
body.dark-mode.admin-site-active .sos-livechat-panel .livechat-thread.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #FB7185 !important;
}

body.dark-mode .sos-livechat-panel .livechat-thread.is-active .livechat-thread-head strong,
body.dark-mode.admin-site-active .sos-livechat-panel .livechat-thread.is-active .livechat-thread-head strong {
  color: #FFE4E6 !important;
}

/* ==========================================================================
   CUSTOM CLEAR DATABASE MODAL DIALOG
   ========================================================================== */
.clear-db-modal-card {
  max-width: 500px;
  width: 92%;
  margin: auto;
}

.clear-db-badge {
  background: #FFF1F2 !important;
  color: #E11D48 !important;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.25) !important;
}

.dark-mode .clear-db-badge {
  background: rgba(225, 29, 72, 0.2) !important;
  color: #FB7185 !important;
}

.clear-db-alert-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #FFF1F2;
  border: 1px solid #FECDD3;
  color: #9F1239;
}

.dark-mode .clear-db-alert-banner {
  background: rgba(225, 29, 72, 0.15) !important;
  border-color: rgba(225, 29, 72, 0.35) !important;
  color: #FDA4AF !important;
}

.clear-db-alert-banner svg,
.clear-db-alert-banner [data-lucide] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #E11D48;
  margin-top: 2px;
}

.clear-db-alert-banner strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 800;
  margin-bottom: 2px;
}

.clear-db-alert-banner p {
  font-size: 0.79rem;
  line-height: 1.4;
  margin: 0;
  opacity: 0.92;
}

.clear-db-breakdown {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.clear-db-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
}

.dark-mode .clear-db-item {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

.clear-db-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.clear-db-item-icon.trash {
  background: #FFE4E6;
  color: #E11D48;
}

.dark-mode .clear-db-item-icon.trash {
  background: rgba(225, 29, 72, 0.22);
  color: #FB7185;
}

.clear-db-item-icon.shield {
  background: #DCFCE7;
  color: #16A34A;
}

.dark-mode .clear-db-item-icon.shield {
  background: rgba(22, 163, 74, 0.22);
  color: #4ADE80;
}

.clear-db-item-text strong {
  display: block;
  font-size: 0.84rem;
  font-weight: 750;
  color: var(--ink);
  margin-bottom: 2px;
}

.clear-db-item-text p {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
  margin: 0;
}

.clear-db-item-text code {
  font-family: inherit;
  font-weight: 800;
  background: rgba(230, 0, 103, 0.1);
  color: #E60067;
  padding: 1px 5px;
  border-radius: 4px;
}

.dark-mode .clear-db-item-text code {
  background: rgba(230, 0, 103, 0.25);
  color: #FF4081;
}

.clear-db-btn-danger {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.clear-db-btn-danger:hover {
  background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.45);
}

.clear-db-btn-danger:active {
  transform: scale(0.96);
}

.clear-db-btn-danger:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.spin {
  animation: spin 0.8s linear infinite;
}










