/**
 * Theme overrides — light mode palette and toggle button.
 * Loaded last so it can override forced dark rules in rtl-fixes.css.
 */

/* ─── Dark default (explicit) ─── */
html[data-theme="dark"] {
  color-scheme: dark;
}

/* ─── Light mode tokens ─── */
html[data-theme="light"] {
  color-scheme: light;

  --admin-bg: rgba(255, 255, 255, 0.98);
  --admin-bg-elevated: #ffffff;
  --admin-bg-muted: rgba(15, 23, 42, 0.04);
  --admin-border: #e2e8f0;
  --admin-text: #1e293b;
  --admin-text-muted: #64748b;
  --admin-accent: #128c7e;
  --admin-accent-dark: #0f766e;
  --admin-success-bg: rgba(37, 211, 102, 0.12);
  --admin-success-border: rgba(37, 211, 102, 0.32);
  --admin-success-text: #15803d;
  --admin-error-bg: rgba(248, 81, 73, 0.1);
  --admin-error-border: rgba(248, 81, 73, 0.28);
  --admin-error-text: #b91c1c;
  --admin-warning-bg: rgba(251, 191, 36, 0.12);
  --admin-warning-border: rgba(251, 191, 36, 0.32);
  --admin-warning-text: #b45309;
  --admin-page-gradient: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #f8fafc 100%);
}

/* ─── Theme toggle button ─── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  padding: 0;
  border: 1px solid #30363d;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #e6edf3;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: rgba(37, 211, 102, 0.55);
  color: #25d366;
  outline: none;
  transform: translateY(-1px);
}

.theme-toggle__icon {
  font-size: 18px;
  line-height: 1;
}

html[data-theme="dark"] .theme-toggle__icon--light {
  display: none;
}

html[data-theme="light"] .theme-toggle__icon--dark {
  display: none;
}

html[data-theme="light"] .theme-toggle {
  border-color: #e2e8f0;
  background: #ffffff;
  color: #475569;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .theme-toggle:hover,
html[data-theme="light"] .theme-toggle:focus-visible {
  border-color: rgba(18, 140, 126, 0.45);
  color: #128c7e;
}

.top-nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.conversations-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.login-form-panel {
  position: relative;
}

.login-theme-toggle-wrap {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 5;
}

.auth-page .auth-wrapper {
  position: relative;
}

/* ─── Shell / layout (rtl-fixes overrides) ─── */
html[data-theme="light"],
html[data-theme="light"] body {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #f8fafc 100%) !important;
  color: #1e293b !important;
}

html[data-theme="light"] .app-wrapper nav {
  background: #ffffff !important;
  border-left-color: #e2e8f0 !important;
  box-shadow: -2px 0 18px rgba(15, 23, 42, 0.06) !important;
}

html[data-theme="light"] .app-logo,
html[data-theme="light"] .nav-profile,
html[data-theme="light"] .instance-selector-sidebar {
  border-bottom-color: #e2e8f0 !important;
}

html[data-theme="light"] .instance-selector-sidebar {
  border-color: #e2e8f0 !important;
  background: #f8fafc !important;
}

html[data-theme="light"] .instance-selector-sidebar label,
html[data-theme="light"] .instance-selector-sidebar label strong {
  color: #475569 !important;
}

html[data-theme="light"] .instance-selector-sidebar label small,
html[data-theme="light"] .sidebar-brand-caption {
  color: #64748b !important;
}

html[data-theme="light"] #instance-selector {
  border-color: #cbd5e1 !important;
  background-color: #ffffff !important;
  color: #1e293b !important;
}

html[data-theme="light"] #instance-selector option {
  background: #ffffff;
  color: #1e293b;
}

html[data-theme="light"] #connection-status-sidebar.conn-status-badge {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #64748b !important;
}

html[data-theme="light"] .nav-profile {
  border-color: #e2e8f0 !important;
  background: #f8fafc !important;
}

html[data-theme="light"] .nav-profile h6 {
  color: #1e293b !important;
}

html[data-theme="light"] .nav-profile p {
  color: #64748b !important;
}

html[data-theme="light"] .nav-profile .dropdown>a,
html[data-theme="light"] .nav-profile .nav-profile-settings-btn {
  border-color: #e2e8f0;
  background: #ffffff;
  color: #64748b;
}

html[data-theme="light"] .app-nav .main-nav>li>a {
  color: #475569 !important;
}

html[data-theme="light"] .app-nav .main-nav>li>a i {
  color: #64748b !important;
}

html[data-theme="light"] .app-nav .main-nav>li>a:hover {
  background: rgba(18, 140, 126, 0.08) !important;
  color: #0f766e !important;
}

html[data-theme="light"] .app-nav .main-nav>li.active>a,
html[data-theme="light"] .app-nav .main-nav>li.no-sub.active>a {
  background: linear-gradient(90deg, rgba(18, 140, 126, 0.14), rgba(18, 140, 126, 0.05)) !important;
  color: #0f766e !important;
}

/* Top nav */
html[data-theme="light"] .header-main.top-nav.top-nav--compact {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06) !important;
}

html[data-theme="light"] .top-nav--compact .top-nav-compact__title,
html[data-theme="light"] .header-left h5 {
  color: #1e293b !important;
}

html[data-theme="light"] .top-nav--compact .top-nav-compact__profile {
  color: #334155 !important;
}

html[data-theme="light"] .top-nav--compact .top-nav-compact__profile:hover,
html[data-theme="light"] .top-nav--compact .top-nav-compact__profile[aria-expanded="true"] {
  border-color: rgba(18, 140, 126, 0.25) !important;
  background: rgba(18, 140, 126, 0.08) !important;
}

html[data-theme="light"] .top-nav-compact__arrow {
  color: #94a3b8;
}

html[data-theme="light"] .header-toggle {
  border-color: #e2e8f0 !important;
  background: #f8fafc !important;
  color: #475569 !important;
}

/* Dropdowns */
html[data-theme="light"] .header-main .dropdown-menu,
html[data-theme="light"] .dropdown-menu,
html[data-theme="light"] .nav-profile .dropdown-menu,
html[data-theme="light"] .top-nav--compact .top-nav-compact__menu {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.1) !important;
}

html[data-theme="light"] .dropdown-item {
  color: #334155 !important;
}

/* Label / tag menu - light mode tweaks for better contrast and clarity */
html[data-theme="light"] .label-filter-dropdown-item-icon {
  border: 1px solid var(--admin-border) !important;
  background: var(--admin-bg) !important;
  color: var(--admin-text) !important;
  box-shadow: none !important;
}

html[data-theme="light"] .label-filter-dropdown-item-icon:hover,
html[data-theme="light"] .label-filter-dropdown-item-icon:focus {
  background: var(--admin-bg-elevated) !important;
  border-color: color-mix(in srgb, var(--admin-accent) 14%, var(--admin-border)) !important;
}

html[data-theme="light"] .label-filter-dropdown-item-icon.is-active {
  border-color: var(--admin-accent) !important;
  box-shadow: 0 0 0 4px rgba(18, 140, 126, 0.08) !important;
}

html[data-theme="light"] .label-filter-dropdown-item-icon .label-filter-check {
  background: var(--admin-accent) !important;
  border: 1px solid var(--admin-bg-elevated) !important;
  color: #fff !important;
}

html[data-theme="light"] .conversation-label-menu {
  background: var(--admin-bg-elevated) !important;
  border: 1px solid var(--admin-border) !important;
  color: var(--admin-text) !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06) !important;
}

html[data-theme="light"] .label-menu-title {
  color: var(--admin-text-muted) !important;
}

html[data-theme="light"] .conversation-label-menu .label-menu-pick {
  color: var(--admin-text) !important;
  background: transparent !important;
}

html[data-theme="light"] .conversation-label-menu .label-menu-pick:hover {
  background: var(--admin-bg-muted) !important;
}

html[data-theme="light"] .conversation-label-menu .label-menu-pick.is-active {
  background: var(--admin-success-bg) !important;
}

html[data-theme="light"] .conversation-label-menu .label-menu-pick-icon {
  background: color-mix(in srgb, var(--label-color, #8696a0) 14%, transparent) !important;
  border: 1px solid color-mix(in srgb, var(--label-color, #8696a0) 40%, var(--admin-border)) !important;
}


html[data-theme="light"] .dropdown-item:hover {
  background: rgba(18, 140, 126, 0.1) !important;
  color: #0f766e !important;
}

/* Footer */
html[data-theme="light"] footer,
html[data-theme="light"] .app-content>footer.app-footer {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #64748b !important;
}

html[data-theme="light"] .app-footer__copyright,
html[data-theme="light"] .app-footer__version {
  color: #64748b !important;
}

html[data-theme="light"] .app-footer__copyright strong {
  color: #1e293b !important;
}

/* Cards, tables, forms */
html[data-theme="light"] .card {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06) !important;
}

html[data-theme="light"] .card-header {
  background: #f8fafc !important;
  border-bottom-color: #e2e8f0 !important;
}

html[data-theme="light"] .card-title,
html[data-theme="light"] .card h1,
html[data-theme="light"] .card h2,
html[data-theme="light"] .card h3,
html[data-theme="light"] .card h4,
html[data-theme="light"] .card h5,
html[data-theme="light"] .card h6,
html[data-theme="light"] .card-body,
html[data-theme="light"] .table,
html[data-theme="light"] .table th,
html[data-theme="light"] .table td,
html[data-theme="light"] .text-dark {
  color: #1e293b !important;
}

html[data-theme="light"] .text-muted,
html[data-theme="light"] small.text-muted,
html[data-theme="light"] .card small {
  color: #64748b !important;
}

html[data-theme="light"] .table> :not(caption)>*>* {
  border-bottom-color: #e2e8f0 !important;
  border-top-color: #e2e8f0 !important;
}

html[data-theme="light"] .table-hover>tbody>tr:hover>* {
  background: rgba(18, 140, 126, 0.06) !important;
}

html[data-theme="light"] .table-light,
html[data-theme="light"] .table-light>th,
html[data-theme="light"] .table-light>td,
html[data-theme="light"] thead.table-light th {
  background: #f8fafc !important;
  color: #1e293b !important;
  border-color: #e2e8f0 !important;
}

html[data-theme="light"] .form-control,
html[data-theme="light"] .form-select {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #1e293b !important;
}

html[data-theme="light"] .form-select option,
html[data-theme="light"] select.form-select option {
  background: #ffffff !important;
  color: #1e293b !important;
}

html[data-theme="light"] .form-control::placeholder {
  color: #94a3b8 !important;
}

html[data-theme="light"] .modal-content {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #1e293b !important;
}

html[data-theme="light"] .modal-header,
html[data-theme="light"] .modal-footer {
  border-color: #e2e8f0 !important;
}

html[data-theme="light"] .btn-outline-secondary {
  border-color: #cbd5e1 !important;
  color: #475569 !important;
}

html[data-theme="light"] .btn-outline-secondary:hover {
  background: #f1f5f9 !important;
  color: #1e293b !important;
}

/* Dashboard / admin page */
html[data-theme="light"] .dashboard-page {
  color: var(--admin-text);
}

html[data-theme="light"] .dashboard-page::before {
  background:
    radial-gradient(circle at 82% 10%, rgba(18, 140, 126, 0.08), transparent 26rem),
    radial-gradient(circle at 15% 75%, rgba(59, 130, 246, 0.05), transparent 24rem);
}

html[data-theme="light"] .dashboard-hero {
  border-color: rgba(18, 140, 126, 0.25);
  background:
    linear-gradient(115deg, rgba(18, 140, 126, 0.12), rgba(255, 255, 255, 0.98) 52%, rgba(248, 250, 252, 0.98)),
    var(--admin-bg-elevated);
  box-shadow: 0 22px 55px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .dashboard-online-dot {
  border-color: #ffffff;
}

html[data-theme="light"] .dashboard-online-label {
  color: #16a34a;
}

html[data-theme="light"] .admin-page,
html[data-theme="light"] .page-select-instance {
  color: var(--admin-text);
}

/* Instance selection: keep each option bright and legible in light mode. */
html[data-theme="light"] .page-select-instance .instance-selector-card {
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .page-select-instance .instance-card {
  background: #ffffff;
  border-color: #dbe4ee;
}

html[data-theme="light"] .page-select-instance .instance-card:hover {
  background: #f8fffd;
  border-color: rgba(18, 140, 126, .55);
  box-shadow: 0 8px 20px rgba(18, 140, 126, .12);
}

html[data-theme="light"] .page-select-instance .instance-card.is-selected {
  background: #effcf5;
  border-color: #128c7e;
}

html[data-theme="light"] .page-select-instance .instance-info code {
  border-color: #dbe4ee;
  background: #f8fafc;
  color: #334155;
}

html[data-theme="light"] .page-select-instance .btn-select:disabled {
  background: #cbd5e1;
  color: #64748b;
  opacity: 1;
}

/* Chat status events use a stable width and a soft, readable light surface. */
html[data-theme="light"] body.page-inbox .message-system-event {
  border-color: #c9e5df;
  background: #effaf7;
  color: #365d56;
  box-shadow: 0 3px 10px rgba(15, 118, 110, .08);
}

html[data-theme="light"] body.page-inbox .message-system-time {
  color: #6b827d;
  opacity: 1;
}

/* Conversation notes drawer */
html[data-theme="light"] body.page-inbox #notes-panel.notes-slide {
  background: #ffffff !important;
  color: #1e293b;
  border-color: #e2e8f0 !important;
  box-shadow: 4px 0 20px rgba(15, 23, 42, .10);
}

html[data-theme="light"] body.page-inbox #notes-panel .notes-header {
  background: #f8fafc !important;
  border-bottom-color: #e2e8f0 !important;
}

html[data-theme="light"] body.page-inbox #notes-panel .notes-header h6 {
  color: #1e293b !important;
}

html[data-theme="light"] body.page-inbox #close-notes {
  border-color: #e2e8f0 !important;
  background: #ffffff !important;
  color: #475569 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}

html[data-theme="light"] body.page-inbox #close-notes:hover {
  border-color: rgba(18, 140, 126, .38) !important;
  background: #effaf7 !important;
  color: #0f766e !important;
}

html[data-theme="light"] body.page-inbox #notes-panel .notes-body,
html[data-theme="light"] body.page-inbox #notes-panel .notes-footer {
  background: #ffffff !important;
}

html[data-theme="light"] body.page-inbox #notes-panel .notes-footer {
  border-top-color: #e2e8f0 !important;
}

html[data-theme="light"] body.page-inbox #notes-panel .notes-body .text-muted {
  color: #64748b !important;
}

html[data-theme="light"] body.page-inbox #notes-panel .note-item {
  border: 1px solid #dbe7e5;
  background: #f4fbf9;
  color: #334155;
}

html[data-theme="light"] body.page-inbox #notes-panel .note-meta {
  color: #64748b;
}

html[data-theme="light"] body.page-inbox #note-input {
  border-color: #cbd5e1 !important;
  background: #f8fafc !important;
  color: #1e293b !important;
}

html[data-theme="light"] body.page-inbox #note-input::placeholder {
  color: #94a3b8;
}

html[data-theme="light"] body.page-inbox #note-input:focus {
  border-color: #128c7e !important;
  box-shadow: 0 0 0 3px rgba(18, 140, 126, .12);
  outline: 0;
}

/* Conversation-row quick actions */
html[data-theme="light"] body.page-inbox .conversations-list .conv-actions {
  border: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 5px 14px rgba(15, 23, 42, .12);
}

html[data-theme="light"] body.page-inbox .conv-action-btn {
  border: 1px solid transparent;
}

html[data-theme="light"] body.page-inbox .conv-close-btn {
  border-color: #fecaca;
  background: #fff1f2;
  color: #dc2626;
}

html[data-theme="light"] body.page-inbox .conv-reopen-btn {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

html[data-theme="light"] body.page-inbox .conv-peek-btn {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #2563eb;
}

html[data-theme="light"] body.page-inbox .conv-close-btn:hover {
  background: #fee2e2;
}

html[data-theme="light"] body.page-inbox .conv-reopen-btn:hover {
  background: #dcfce7;
}

html[data-theme="light"] body.page-inbox .conv-peek-btn:hover {
  background: #dbeafe;
}

/* Message actions popover */
html[data-theme="light"] body.page-inbox .message-context-menu {
  border-color: #e2e8f0;
  background: #ffffff;
  color: #334155;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .16);
}

html[data-theme="light"] body.page-inbox .message-context-menu>button[data-action],
html[data-theme="light"] body.page-inbox .message-context-menu>button[data-admin-action] {
  color: #334155;
}

html[data-theme="light"] body.page-inbox .message-context-menu>button[data-action]:hover,
html[data-theme="light"] body.page-inbox .message-context-menu>button[data-action]:focus,
html[data-theme="light"] body.page-inbox .message-context-menu>button[data-admin-action]:hover,
html[data-theme="light"] body.page-inbox .message-context-menu>button[data-admin-action]:focus {
  background: #f1f5f9;
  color: #0f766e;
}

html[data-theme="light"] body.page-inbox .message-context-menu>button.text-danger,
html[data-theme="light"] body.page-inbox .message-context-menu>button[data-action="delete"] {
  color: #dc2626 !important;
}

html[data-theme="light"] body.page-inbox .message-context-menu>button[data-action="delete"]:hover {
  background: #fff1f2;
}

html[data-theme="light"] body.page-inbox .message-menu-btn {
  border: 1px solid #dbe4ee;
  background: rgba(255, 255, 255, .94);
  color: #475569 !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, .10);
}

html[data-theme="light"] body.page-inbox .message-menu-btn:hover,
html[data-theme="light"] body.page-inbox .message-menu-btn:focus-visible {
  border-color: rgba(18, 140, 126, .45);
  background: #effaf7;
  color: #0f766e !important;
}

/* Forward message dialog */
html[data-theme="light"] body.page-inbox #modal-forward-message .modal-body,
html[data-theme="light"] body.page-inbox #modal-forward-message .forward-conversation-list {
  background: #ffffff !important;
}

html[data-theme="light"] body.page-inbox #modal-forward-message .forward-search-row {
  border-bottom-color: #e2e8f0;
  background: #f8fafc;
}

html[data-theme="light"] body.page-inbox #modal-forward-message .forward-search-input {
  border-color: #cbd5e1 !important;
  background: #ffffff !important;
  color: #1e293b !important;
}

html[data-theme="light"] body.page-inbox #modal-forward-message .forward-search-input::placeholder,
html[data-theme="light"] body.page-inbox #modal-forward-message .forward-search-icon {
  color: #94a3b8;
}

html[data-theme="light"] body.page-inbox #modal-forward-message .btn-forward-new-number {
  border-color: rgba(18, 140, 126, .45);
  background: #effaf7;
  color: #0f8b77;
}

html[data-theme="light"] body.page-inbox #modal-forward-message .btn-forward-new-number:hover {
  border-color: #128c7e;
  background: #dcf7ef;
  color: #0b6b5d;
}

html[data-theme="light"] body.page-inbox #modal-forward-message .forward-message-preview {
  border-bottom-color: #e2e8f0;
  background: #f8fafc;
}

html[data-theme="light"] body.page-inbox #modal-forward-message .forward-message-preview-icon {
  border-color: #cce7e1;
  background: #eaf9f5;
  color: #128c7e;
}

html[data-theme="light"] body.page-inbox #modal-forward-message .forward-message-preview-text {
  color: #1e293b;
}

html[data-theme="light"] body.page-inbox #modal-forward-message .forward-conv-item {
  border-bottom-color: #edf2f7;
  color: #334155;
}

html[data-theme="light"] body.page-inbox #modal-forward-message .forward-conv-item:hover:not(:disabled) {
  background: #f0faf7;
}

html[data-theme="light"] body.page-inbox #modal-forward-message .forward-conv-name {
  color: #1e293b;
}

html[data-theme="light"] body.page-inbox #modal-forward-message .forward-conv-number {
  color: #64748b;
}

html[data-theme="light"] body.page-inbox #modal-forward-message .forward-conv-preview,
html[data-theme="light"] body.page-inbox #modal-forward-message .forward-empty-state {
  color: #64748b;
}

html[data-theme="light"] body.page-inbox #modal-forward-message .forward-conversation-list {
  scrollbar-color: #cbd5e1 #ffffff;
}

html[data-theme="light"] body.page-inbox #modal-forward-message .forward-conversation-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
}

html[data-theme="light"] body.page-inbox .profile-avatar-modal .modal-body {
  background: #f8fafc;
}

html[data-theme="light"] body.page-inbox .header-rename-button {
  border-color: #dbe4ee;
  background: #ffffff;
  color: #64748b;
}

html[data-theme="light"] body.page-inbox .header-rename-button:hover,
html[data-theme="light"] body.page-inbox .header-rename-button:focus-visible {
  border-color: rgba(18, 140, 126, .45);
  background: #effaf7;
  color: #0f766e;
}

/* Quick templates dialog */
html[data-theme="light"] body.page-inbox #modal-quick-templates .modal-body,
html[data-theme="light"] body.page-inbox #modal-quick-templates .quick-templates-list {
  background: #ffffff !important;
}

html[data-theme="light"] body.page-inbox #modal-quick-templates .quick-templates-search-wrap,
html[data-theme="light"] body.page-inbox #modal-quick-templates .quick-templates-modal-footer {
  border-color: #e2e8f0;
  background: #f8fafc;
}

html[data-theme="light"] body.page-inbox #modal-quick-templates .quick-templates-modal-header .btn-close {
  filter: none;
  opacity: .65;
}

html[data-theme="light"] body.page-inbox #modal-quick-templates .quick-templates-modal-sub {
  color: #64748b;
}

html[data-theme="light"] body.page-inbox #modal-quick-templates .quick-templates-search-input {
  border-color: #cbd5e1;
  background: #ffffff;
  color: #1e293b;
}

html[data-theme="light"] body.page-inbox #modal-quick-templates .quick-templates-search-input::placeholder,
html[data-theme="light"] body.page-inbox #modal-quick-templates .quick-templates-search-icon,
html[data-theme="light"] body.page-inbox #modal-quick-templates .quick-templates-hint {
  color: #94a3b8;
}

html[data-theme="light"] body.page-inbox #modal-quick-templates .quick-template-item {
  border-bottom-color: #edf2f7;
  background: #ffffff;
}

html[data-theme="light"] body.page-inbox #modal-quick-templates .quick-template-item:hover {
  background: #f0faf7;
}

/* ─── Auth pages ─── */
html[data-theme="light"] body.auth-page {
  background: var(--admin-page-gradient);
  color: var(--admin-text);
}

html[data-theme="light"] .auth-page .auth-card {
  background: var(--admin-bg);
  border-color: var(--admin-border);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .auth-page h2.auth-heading {
  color: #1e293b;
}

html[data-theme="light"] .auth-page .auth-subtitle {
  color: #64748b;
}

html[data-theme="light"] .auth-page .form-floating .form-control {
  border-color: #cbd5e1;
  background: #ffffff;
  color: #1e293b;
}

html[data-theme="light"] .auth-page .form-floating .form-control:focus {
  background: #ffffff;
  color: #1e293b;
}

html[data-theme="light"] .auth-page .form-floating>.form-control:focus~label,
html[data-theme="light"] .auth-page .form-floating>.form-control:not(:placeholder-shown)~label {
  color: #64748b !important;
}

html[data-theme="light"] .auth-page .form-floating .form-control:-webkit-autofill,
html[data-theme="light"] .auth-page .form-floating .form-control:-webkit-autofill:hover,
html[data-theme="light"] .auth-page .form-floating .form-control:-webkit-autofill:focus,
html[data-theme="light"] .auth-page .form-floating .form-control:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
  -webkit-text-fill-color: #1e293b !important;
}

html[data-theme="light"] .auth-page .form-check-label {
  color: #475569;
}

html[data-theme="light"] .auth-page .auth-footer,
html[data-theme="light"] .auth-page .auth-footer p,
html[data-theme="light"] .auth-page .auth-footer a {
  color: #64748b;
}

html[data-theme="light"] .login-page {
  background: #f8fafc;
}

html[data-theme="light"] .login-form-panel {
  position: relative;
  background: #f8fafc;
}

html[data-theme="light"] .login-auth-card {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

/* Login showcase stays dark in both modes (brand panel) */
html[data-theme="light"] .login-showcase {
  color: #fff;
}

/* ─── Inbox light mode ─── */
html[data-theme="light"] body.page-inbox {
  --inbox-accent: #128c7e;
  --inbox-accent-strong: #0f766e;
  --inbox-surface: #ffffff;
  --inbox-raised: #f0f2f5;
  --inbox-border: rgba(15, 23, 42, 0.1);
  --inbox-muted: #667781;
  color-scheme: light;
}

html[data-theme="light"] body.page-inbox,
html[data-theme="light"] body.page-inbox .app-content,
html[data-theme="light"] body.page-inbox .chat-container {
  background: #efeae2 !important;
  color: #111b21 !important;
}

html[data-theme="light"] body.page-inbox .conversations-panel {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

html[data-theme="light"] body.page-inbox .conversations-header {
  background: #f0f2f5 !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] body.page-inbox .conversations-title-wrap h5 {
  color: #111b21 !important;
}

html[data-theme="light"] body.page-inbox .conversations-search-input,
html[data-theme="light"] body.page-inbox .conversations-search-box {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #111b21 !important;
}

html[data-theme="light"] body.page-inbox .conversation-item {
  border-bottom-color: #f0f2f5 !important;
}

html[data-theme="light"] body.page-inbox .conversation-item:hover,
html[data-theme="light"] body.page-inbox .conversation-item.active {
  background: #f5f6f6 !important;
}

html[data-theme="light"] body.page-inbox .conversation-item .conv-name,
html[data-theme="light"] body.page-inbox .conversation-item .conv-preview {
  color: #111b21 !important;
}

html[data-theme="light"] body.page-inbox .conversation-item .conv-time,
html[data-theme="light"] body.page-inbox .conversation-item .conv-meta {
  color: #667781 !important;
}

html[data-theme="light"] body.page-inbox .chat-panel {
  background: #efeae2 !important;
}

html[data-theme="light"] body.page-inbox .chat-header {
  background: #f0f2f5 !important;
  border-bottom-color: #e2e8f0 !important;
  color: #111b21 !important;
}

html[data-theme="light"] body.page-inbox .chat-header .chat-contact-name,
html[data-theme="light"] body.page-inbox .chat-header .chat-contact-status {
  color: #111b21 !important;
}

html[data-theme="light"] body.page-inbox .message-row.received .message-bubble {
  background: #ffffff !important;
  color: #111b21 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08) !important;
}

html[data-theme="light"] body.page-inbox .message-row.sent .message-bubble {
  background: #d9fdd3 !important;
  color: #111b21 !important;
}

html[data-theme="light"] body.page-inbox .message-time {
  color: #667781 !important;
}

html[data-theme="light"] body.page-inbox .chat-input-area,
html[data-theme="light"] body.page-inbox .message-composer {
  background: #f0f2f5 !important;
  border-top-color: #e2e8f0 !important;
}

html[data-theme="light"] body.page-inbox .message-input,
html[data-theme="light"] body.page-inbox #message-input,
html[data-theme="light"] body.page-inbox .composer-input {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #111b21 !important;
}

html[data-theme="light"] body.page-inbox .modal-content,
html[data-theme="light"] body.page-inbox .inbox-modal .modal-content {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #111b21 !important;
}

html[data-theme="light"] body.page-inbox .modal-header {
  background: #dbe1eb !important;
  border-bottom-color: #e2e8f0 !important;
  color: #111b21 !important;
}

html[data-theme="light"] body.page-inbox .btn-outline-secondary {
  border-color: #cbd5e1 !important;
  color: #475569 !important;
  background: #ffffff !important;
}

html[data-theme="light"] body.page-inbox .btn-outline-secondary:hover {
  background: #f1f5f9 !important;
  color: #1e293b !important;
}

html[data-theme="light"] body.page-inbox .chat-empty-state,
html[data-theme="light"] body.page-inbox .no-chat-selected {
  color: #667781 !important;
}

html[data-theme="light"] body.page-inbox footer {
  display: none !important;
}

html[data-theme="light"] .dashboard-hero h1 {
  color: #0c0c0c !important;
}

html[data-theme="light"] nav .app-nav .menu-title span {
  color: #0a0a0a !important;
}

html[data-theme="light"] .no-chat-features span {
  background-color: #efeae2 !important;
}

html[data-theme="light"] .no-chat-selected {
  background: linear-gradient(160deg, #efeae2 0%, #efeae2 60%, #efeae2 100%);
}

html[data-theme="light"] .conv-name,
html[data-theme="light"] .chat-header h6,
html[data-theme="light"] .message-text,
html[data-theme="light"] .message-time,
html[data-theme="light"] .no-chat-selected h4,
html[data-theme="light"] .no-chat-selected p,
html[data-theme="light"] .note-item,
html[data-theme="light"] .note-meta {
  color: #111b21 !important;
}

html[data-theme="light"] .btn i {
  color: #475569 !important;
}

html[data-theme="light"] .btn-inactive-filter-toggle {
  border-color: #cbd5e1 !important;
  color: #475569 !important;
  background: #ffffff !important;
}

html[data-theme="light"] .conversations-inactive-filter {
  border-color: #d8e1e8 !important;
  background: linear-gradient(145deg, #ffffff, #f4f7f9) !important;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .09) !important;
}

html[data-theme="light"] .inactive-filter-heading {
  color: #1e293b !important;
}

html[data-theme="light"] .inactive-filter-heading #btn-clear-inactive-filter {
  color: #0284c7 !important;
}

html[data-theme="light"] .inactive-filter-heading #btn-clear-inactive-filter:hover {
  background: #e0f2fe !important;
  color: #0369a1 !important;
}

html[data-theme="light"] .inactive-date-field>span,
html[data-theme="light"] .inactive-date-separator {
  color: #64748b !important;
}

html[data-theme="light"] .conversations-inactive-filter .inactive-date-field input {
  border-color: #cbd5e1 !important;
  background: #ffffff !important;
  color: #0f172a !important;
  color-scheme: light;
}

/* Campaign and scheduled-message modals. */
html[data-theme="light"] #modal-bulk-send .campaign-type-card,
html[data-theme="light"] #modal-schedule-message .campaign-type-card {
  border-color: #cbd5e1 !important;
  background: #f8fafc !important;
  color: #475569 !important;
}

html[data-theme="light"] #modal-bulk-send .campaign-type-card:hover,
html[data-theme="light"] #modal-schedule-message .campaign-type-card:hover {
  border-color: #94a3b8 !important;
  background: #f1f5f9 !important;
  color: #1e293b !important;
}

html[data-theme="light"] #modal-bulk-send .campaign-type-card.is-active,
html[data-theme="light"] #modal-schedule-message .campaign-type-card.is-active {
  border-color: #4ade80 !important;
  background: #dcfce7 !important;
  color: #16a34a !important;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, .18) !important;
}

html[data-theme="light"] #modal-bulk-send .campaign-voice-wrap,
html[data-theme="light"] #modal-schedule-message .campaign-voice-wrap {
  border-color: #cbd5e1 !important;
  background: #f8fafc !important;
}

html[data-theme="light"] #modal-bulk-send .form-control,
html[data-theme="light"] #modal-bulk-send .form-select,
html[data-theme="light"] #modal-schedule-message .form-control,
html[data-theme="light"] #modal-schedule-message .form-select {
  border-color: #cbd5e1 !important;
  background-color: #ffffff !important;
  color: #0f172a !important;
}

html[data-theme="light"] #modal-bulk-send .form-control::placeholder,
html[data-theme="light"] #modal-schedule-message .form-control::placeholder {
  color: #94a3b8 !important;
  opacity: 1;
}

html[data-theme="light"] #modal-schedule-message input[type="datetime-local"] {
  color-scheme: light;
}

html[data-theme="light"] #modal-bulk-send input[type="file"],
html[data-theme="light"] #modal-schedule-message input[type="file"] {
  color: #475569 !important;
}

html[data-theme="light"] #modal-bulk-send input[type="file"]::file-selector-button,
html[data-theme="light"] #modal-schedule-message input[type="file"]::file-selector-button {
  background: #e2e8f0 !important;
  color: #334155 !important;
}

html[data-theme="light"] .conversations-header,
html[data-theme="light"] .conversations-filters,
html[data-theme="light"] .conversations-bulk-toolbar,
html[data-theme="light"] .chat-header,
html[data-theme="light"] .chat-footer {
  background: #f0f2f5 !important;
  border-color: #e2e8f0 !important;
}

html[data-theme="light"] .filter-btn {
  color: #475569 !important;
}

html[data-theme="light"] .conversations-list .conv-preview {
  background: #dddfe080 !important;
}

html[data-theme="light"] .conv-name,
html[data-theme="light"] .conv-assigned,
html[data-theme="light"] .conv-message,
html[data-theme="light"] .conv-time {
  color: #111b21 !important;
}

html[data-theme="light"] .chat-messages {
  background: linear-gradient(160deg, #efeae2 0%, #efeae2 60%, #efeae2 100%) !important;
}

html[data-theme="light"] body.page-inbox .chat-messages {
  scrollbar-color: #aebac1 transparent;
}

html[data-theme="light"] body.page-inbox .chat-messages::-webkit-scrollbar-thumb {
  background: #8696a0;
  border-color: #efeae2;
}

html[data-theme="light"] body.page-inbox .chat-messages::-webkit-scrollbar-thumb:hover {
  background: #6f7f89;
}

html[data-theme="light"] .chat-day-separator-label {
  background: #f6fbff !important;
  color: #111b21 !important;
}

html[data-theme="light"] .chat-focus-bar {
  background: #e2e8f0 !important;
  color: #111b21;
}

html[data-theme="light"] body.page-inbox .modal .modal-footer {
  background: #f0f2f5 !important;
  border-top-color: #e2e8f0 !important;
}

html[data-theme="light"] .voice-note-play {
  background: #f7f9fa !important;
  color: #111b21 !important;
  border: 1px solid #d7dde2;
}

/* Keep waveform and controls legible on light chat bubbles. */
html[data-theme="light"] .message-row.sent .voice-note {
  --voice-accent: #008069;
  --voice-wave: rgba(17, 27, 33, 0.34);
  --voice-wave-played: #008069;
  --voice-play-bg: #f7f9fa;
  --voice-play-fg: #111b21;
}

html[data-theme="light"] .message-row.received .voice-note {
  --voice-accent: #008069;
  --voice-wave: rgba(71, 85, 105, 0.62);
  --voice-wave-played: #008069;
}

html[data-theme="light"] .conversations-list .conversation-item .conv-avatar {
  box-shadow: 0 0 0 3px #fcfeff, 0 0 0 4px rgba(33, 192, 99, .42) !important;
}

html[data-theme="light"] body.page-inbox .modal .modal-body {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #111b21 !important;
}

html[data-theme="light"] body.page-inbox .modal .modal-header .modal-title {
  color: #111b21 !important;
}

html[data-theme="light"] .inbox-compose-modal-sub {
  color: rgb(37 36 36 / 78%);
}

html[data-theme="light"] body.page-inbox .modal .modal-header .modal-title i {
  color: #111b21 !important;
}

html[data-theme="light"] body.page-inbox .modal .form-label {
  color: #111b21 !important;
}

html[data-theme="light"] .message-media-caption {
  color: #111b21 !important;
}

/* ─── Instances light mode ─── */
html[data-theme="light"] .page-instances {
  color: #1e293b;
}

#addUserForm input[name="username"],
#addUserForm input[name="password"],
#addUserForm input[name="email"] {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #1e293b !important;
}

html[data-theme="light"] .message-reaction-chip {
  background: #f0f2f5 !important;
  color: #111b21 !important;
}

html[data-theme="light"] .page-instances .instances-hero {
  border-color: rgba(18, 140, 126, 0.18) !important;
  background:
    radial-gradient(circle at 8% 8%, rgba(18, 140, 126, 0.12), transparent 13rem),
    linear-gradient(115deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96) 58%, rgba(236, 253, 245, 0.72)) !important;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08) !important;
}

html[data-theme="light"] .page-instances .instances-hero::after {
  border-color: rgba(18, 140, 126, 0.08) !important;
}

html[data-theme="light"] body.page-inbox .chat-interface-shell {
  background: #ffffff !important;
}

html[data-theme="light"] .page-instances .instances-hero-eyebrow,
html[data-theme="light"] .page-instances .instances-hero-eyebrow i {
  color: #0f766e !important;
}

html[data-theme="light"] .page-instances .main-title,
html[data-theme="light"] .page-instances .admin-card-title,
html[data-theme="light"] .page-instances .instance-name,
html[data-theme="light"] .page-instances .instances-active-copy strong,
html[data-theme="light"] .page-instances .instances-form-section-title {
  color: #1e293b !important;
}

html[data-theme="light"] .page-instances .admin-page-subtitle,
html[data-theme="light"] .page-instances .admin-card-desc,
html[data-theme="light"] .page-instances .instance-meta,
html[data-theme="light"] .page-instances .instances-active-copy small,
html[data-theme="light"] .page-instances .instances-create-form .form-text,
html[data-theme="light"] .page-instances .instances-create-form .form-check-label .text-muted {
  color: #64748b !important;
}

html[data-theme="light"] .page-instances .instances-config-status,
html[data-theme="light"] .page-instances .instances-users-count,
html[data-theme="light"] .page-instances .instance-id-chip {
  border-color: #dbe4ee !important;
  background: #f8fafc !important;
  color: #475569 !important;
}

html[data-theme="light"] .page-instances .instances-config-status.is-ready {
  border-color: rgba(22, 163, 74, 0.26) !important;
  background: rgba(22, 163, 74, 0.1) !important;
  color: #15803d !important;
}

html[data-theme="light"] .page-instances .instances-config-status.is-missing {
  border-color: rgba(217, 119, 6, 0.28) !important;
  background: rgba(245, 158, 11, 0.12) !important;
  color: #b45309 !important;
}

html[data-theme="light"] .page-instances .admin-card,
html[data-theme="light"] .page-instances .admin-modal {
  border-color: #e2e8f0 !important;
  background: #ffffff !important;
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.07) !important;
}

html[data-theme="light"] .page-instances .admin-card-header,
html[data-theme="light"] .page-instances .modal-header,
html[data-theme="light"] .page-instances .modal-footer {
  border-color: #e2e8f0 !important;
  background: linear-gradient(90deg, rgba(18, 140, 126, 0.07), rgba(248, 250, 252, 0.96)) !important;
}

html[data-theme="light"] .page-instances .instances-list-header>.d-flex>i,
html[data-theme="light"] .page-instances .instances-stat-icon,
html[data-theme="light"] .page-instances .instances-active-icon,
html[data-theme="light"] .page-instances .instances-form-section-title>span {
  border-color: rgba(18, 140, 126, 0.22) !important;
  background: rgba(18, 140, 126, 0.1) !important;
  color: #0f766e !important;
  box-shadow: none !important;
}

html[data-theme="light"] .page-instances .admin-stat {
  border-color: #e2e8f0 !important;
  background: #ffffff !important;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06) !important;
}

html[data-theme="light"] .page-instances .admin-stat-value {
  color: #0f172a !important;
}

html[data-theme="light"] .page-instances .admin-stat-label {
  color: #64748b !important;
}

html[data-theme="light"] .page-instances .instances-search-wrap i,
html[data-theme="light"] .page-instances .instances-input-wrap>i,
html[data-theme="light"] .page-instances .instances-select-wrap>i,
html[data-theme="light"] .page-instances .instances-create-form .form-text i {
  color: #0f766e !important;
}

html[data-theme="light"] .page-instances .instances-search-wrap .form-control,
html[data-theme="light"] .page-instances .instances-input-wrap .form-control,
html[data-theme="light"] .page-instances .instances-select-wrap .form-select {
  border-color: #cbd5e1 !important;
  background-color: #ffffff !important;
  color: #1e293b !important;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.02) !important;
}

html[data-theme="light"] .page-instances .instances-search-wrap .form-control:focus,
html[data-theme="light"] .page-instances .instances-input-wrap .form-control:focus,
html[data-theme="light"] .page-instances .instances-select-wrap .form-select:focus {
  border-color: rgba(18, 140, 126, 0.5) !important;
  background-color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(18, 140, 126, 0.12) !important;
}

html[data-theme="light"] .page-instances .instances-search-wrap .form-control::placeholder,
html[data-theme="light"] .page-instances .instances-input-wrap .form-control::placeholder {
  color: #94a3b8 !important;
}

html[data-theme="light"] .page-instances .instances-table-wrap {
  background: #f8fafc !important;
}

html[data-theme="light"] .page-instances .instances-table {
  --bs-table-bg: transparent;
  --bs-table-color: #1e293b;
  --bs-table-border-color: #e2e8f0;
  color: #1e293b !important;
}

html[data-theme="light"] .page-instances .instances-table thead th {
  color: #64748b !important;
  background: transparent !important;
}

html[data-theme="light"] .page-instances .instances-table tbody td {
  border-color: #e2e8f0 !important;
  background: #ffffff !important;
  color: #1e293b !important;
}

html[data-theme="light"] .page-instances .instances-table tbody tr:hover td {
  border-color: rgba(18, 140, 126, 0.24) !important;
  background: #f0fdfa !important;
}

html[data-theme="light"] .page-instances .instance-avatar {
  border-color: rgba(18, 140, 126, 0.24) !important;
  background: linear-gradient(145deg, rgba(18, 140, 126, 0.14), rgba(20, 184, 166, 0.08)) !important;
  color: #0f766e !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.7), 0 6px 16px rgba(15, 23, 42, 0.08) !important;
}

html[data-theme="light"] .page-instances .instance-meta code {
  color: #0f766e !important;
}

html[data-theme="light"] .page-instances .instances-pill {
  box-shadow: none !important;
}

html[data-theme="light"] .page-instances .instances-pill.is-waha,
html[data-theme="light"] .page-instances .instances-pill.is-active,
html[data-theme="light"] .page-instances .instances-pill.is-synced {
  border-color: rgba(22, 163, 74, 0.24) !important;
  background: rgba(22, 163, 74, 0.1) !important;
  color: #15803d !important;
}

html[data-theme="light"] .page-instances .instances-pill.is-meta,
html[data-theme="light"] .page-instances .instances-pill.is-gows {
  border-color: rgba(37, 99, 235, 0.22) !important;
  background: rgba(37, 99, 235, 0.09) !important;
  color: #1d4ed8 !important;
}

html[data-theme="light"] .page-instances .instances-pill.is-noweb {
  border-color: rgba(14, 116, 144, 0.22) !important;
  background: rgba(14, 116, 144, 0.09) !important;
  color: #0e7490 !important;
}

html[data-theme="light"] .page-instances .instances-pill.is-neutral,
html[data-theme="light"] .page-instances .instances-pill.is-inactive {
  border-color: #dbe4ee !important;
  background: #f1f5f9 !important;
  color: #64748b !important;
}

html[data-theme="light"] .page-instances .instances-pill.is-unsynced {
  border-color: rgba(217, 119, 6, 0.26) !important;
  background: rgba(245, 158, 11, 0.12) !important;
  color: #b45309 !important;
}

html[data-theme="light"] .page-instances .instances-form-section,
html[data-theme="light"] .page-instances .instances-active-control,
html[data-theme="light"] .page-instances .instances-users-box {
  border-color: #e2e8f0 !important;
  background: #f8fafc !important;
}

html[data-theme="light"] .page-instances .instances-create-form .instances-users-box .form-check-label {
  color: #334155 !important;
}

html[data-theme="light"] .page-instances .instances-create-form .instances-users-box .form-check:hover {
  background: rgba(18, 140, 126, 0.08) !important;
}

html[data-theme="light"] .page-instances .instances-create-submit>span {
  background: rgba(255, 255, 255, 0.28) !important;
}

html[data-theme="light"] .page-instances .instance-actions .btn-primary {
  background: linear-gradient(135deg, #16a34a, #0f766e) !important;
  color: #ffffff !important;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.18) !important;
}

html[data-theme="light"] .page-instances .instance-actions .btn-primary i {
  color: #ffffff !important;
}

html[data-theme="light"] .page-instances .instance-actions .btn-outline-danger {
  border-color: rgba(220, 38, 38, 0.28) !important;
  background: rgba(220, 38, 38, 0.06) !important;
  color: #b91c1c !important;
}

html[data-theme="light"] .page-instances .instance-actions .btn-outline-danger i {
  color: #b91c1c !important;
}

html[data-theme="light"] .page-instances .modal-title,
html[data-theme="light"] .page-instances .modal-title i,
html[data-theme="light"] .page-instances .modal-body,
html[data-theme="light"] .page-instances .form-label,
html[data-theme="light"] .page-instances .form-check-label {
  color: #1e293b !important;
}

/* ─── Admin detail pages light mode ─── */
html[data-theme="light"] .page-users,
html[data-theme="light"] .page-conversation-settings,
html[data-theme="light"] .page-quick-templates,
html[data-theme="light"] .page-labels,
html[data-theme="light"] .page-reports {
  color: #1e293b !important;
}

html[data-theme="light"] .page-users .admin-page-header,
html[data-theme="light"] .page-conversation-settings .admin-page-header,
html[data-theme="light"] .page-users .users-hero,
html[data-theme="light"] .page-reports .reports-hero,
html[data-theme="light"] .page-quick-templates .qt-hero,
html[data-theme="light"] .page-labels .labels-hero {
  border-color: rgba(37, 99, 235, 0.16) !important;
  background:
    radial-gradient(circle at 8% 8%, rgba(37, 99, 235, 0.11), transparent 13rem),
    linear-gradient(115deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96) 58%, rgba(239, 246, 255, 0.78)) !important;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08) !important;
}

html[data-theme="light"] .page-labels .labels-hero {
  border-color: rgba(124, 58, 237, 0.18) !important;
  background:
    radial-gradient(circle at 8% 8%, rgba(124, 58, 237, 0.12), transparent 13rem),
    linear-gradient(115deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96) 58%, rgba(245, 243, 255, 0.8)) !important;
}

html[data-theme="light"] .page-quick-templates .qt-hero {
  border-color: rgba(18, 140, 126, 0.18) !important;
  background:
    radial-gradient(circle at 8% 8%, rgba(18, 140, 126, 0.12), transparent 13rem),
    linear-gradient(115deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96) 58%, rgba(236, 253, 245, 0.75)) !important;
}

html[data-theme="light"] .page-users .users-hero::after,
html[data-theme="light"] .page-reports .reports-hero::after,
html[data-theme="light"] .page-quick-templates .qt-hero::after,
html[data-theme="light"] .page-labels .labels-hero::after {
  border-color: rgba(37, 99, 235, 0.07) !important;
}

html[data-theme="light"] .page-labels .labels-hero::after {
  border-color: rgba(124, 58, 237, 0.08) !important;
}

html[data-theme="light"] .page-users .main-title,
html[data-theme="light"] .page-conversation-settings .main-title,
html[data-theme="light"] .page-reports .main-title,
html[data-theme="light"] .page-quick-templates .qt-hero h1,
html[data-theme="light"] .page-labels .labels-hero h1,
html[data-theme="light"] .page-users .admin-card-title,
html[data-theme="light"] .page-conversation-settings .admin-card-title,
html[data-theme="light"] .page-reports .admin-card-title,
html[data-theme="light"] .page-users .admin-stat-value,
html[data-theme="light"] .page-users .user-name,
html[data-theme="light"] .page-reports .reports-employee strong,
html[data-theme="light"] .page-quick-templates .qt-summary-item strong,
html[data-theme="light"] .page-labels .labels-summary-item strong,
html[data-theme="light"] .page-labels .labels-table tbody strong {
  color: #1e293b !important;
}

html[data-theme="light"] .page-users .admin-page-subtitle,
html[data-theme="light"] .page-conversation-settings .admin-page-subtitle,
html[data-theme="light"] .page-reports .admin-page-subtitle,
html[data-theme="light"] .page-quick-templates .qt-hero p,
html[data-theme="light"] .page-labels .labels-hero p,
html[data-theme="light"] .page-users .admin-card-desc,
html[data-theme="light"] .page-conversation-settings .admin-card-desc,
html[data-theme="light"] .page-reports .admin-card-desc,
html[data-theme="light"] .page-users .admin-stat-label,
html[data-theme="light"] .page-users .user-meta,
html[data-theme="light"] .page-reports .reports-employee small,
html[data-theme="light"] .page-quick-templates .qt-summary-item small,
html[data-theme="light"] .page-labels .labels-summary-item small {
  color: #64748b !important;
}

html[data-theme="light"] .page-users .users-hero-eyebrow,
html[data-theme="light"] .page-reports .reports-eyebrow,
html[data-theme="light"] .page-quick-templates .qt-eyebrow,
html[data-theme="light"] .page-quick-templates .qt-eyebrow i {
  color: #1d4ed8 !important;
}

html[data-theme="light"] .page-quick-templates .qt-eyebrow,
html[data-theme="light"] .page-quick-templates .qt-eyebrow i {
  color: #0f766e !important;
}

html[data-theme="light"] .page-labels .labels-eyebrow,
html[data-theme="light"] .page-labels .labels-eyebrow i {
  color: #6d28d9 !important;
}

html[data-theme="light"] .page-users .admin-card,
html[data-theme="light"] .page-conversation-settings .admin-card,
html[data-theme="light"] .page-reports .admin-card,
html[data-theme="light"] .page-quick-templates .card,
html[data-theme="light"] .page-labels .card,
html[data-theme="light"] .page-quick-templates .modal-content,
html[data-theme="light"] .page-labels .modal-content {
  border-color: #e2e8f0 !important;
  background: #ffffff !important;
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.07) !important;
}

html[data-theme="light"] .page-users .admin-card-header,
html[data-theme="light"] .page-conversation-settings .admin-card-header,
html[data-theme="light"] .page-reports .admin-card-header,
html[data-theme="light"] .page-quick-templates .qt-list-header,
html[data-theme="light"] .page-labels .labels-list-header,
html[data-theme="light"] .page-quick-templates .modal-header,
html[data-theme="light"] .page-quick-templates .modal-footer,
html[data-theme="light"] .page-labels .modal-header,
html[data-theme="light"] .page-labels .modal-footer {
  border-color: #e2e8f0 !important;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.06), rgba(248, 250, 252, 0.96)) !important;
}

html[data-theme="light"] .page-labels .labels-list-header,
html[data-theme="light"] .page-labels .modal-header,
html[data-theme="light"] .page-labels .modal-footer {
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.07), rgba(248, 250, 252, 0.96)) !important;
}

html[data-theme="light"] .page-quick-templates .qt-list-header,
html[data-theme="light"] .page-quick-templates .modal-header,
html[data-theme="light"] .page-quick-templates .modal-footer {
  background: linear-gradient(90deg, rgba(18, 140, 126, 0.07), rgba(248, 250, 252, 0.96)) !important;
}

html[data-theme="light"] .page-users .users-view-tabs,
html[data-theme="light"] .page-users .users-search-wrap .form-control,
html[data-theme="light"] .page-users .users-form-section,
html[data-theme="light"] .page-users .users-active-control,
html[data-theme="light"] .page-users .users-edit-tabs,
html[data-theme="light"] .page-conversation-settings .admin-field-block,
html[data-theme="light"] .page-conversation-settings .admin-subsection,
html[data-theme="light"] .page-conversation-settings .admin-switch-list,
html[data-theme="light"] .page-reports .reports-deleted-toggle,
html[data-theme="light"] .page-quick-templates .qt-field-group.is-visible,
html[data-theme="light"] .page-quick-templates .qt-voice-preview-wrap,
html[data-theme="light"] .page-labels #label-preview {
  border-color: #e2e8f0 !important;
  background: #f8fafc !important;
  color: #1e293b !important;
}

html[data-theme="light"] .page-users .users-form-section-title,
html[data-theme="light"] .page-users .users-active-copy strong,
html[data-theme="light"] .page-users .users-edit-tabs .nav-link.active {
  color: #1e293b !important;
}

html[data-theme="light"] .page-users .users-active-copy small,
html[data-theme="light"] .page-users .users-options-count,
html[data-theme="light"] .page-users .users-form-section .form-text {
  color: #64748b !important;
}

html[data-theme="light"] .page-users .users-form-section-title>span,
html[data-theme="light"] .page-users .users-active-icon,
html[data-theme="light"] .page-users .users-list-header>.d-flex>i,
html[data-theme="light"] .page-users .users-create-card .admin-card-header>i {
  border-color: rgba(37, 99, 235, 0.22) !important;
  background: rgba(37, 99, 235, 0.09) !important;
  color: #1d4ed8 !important;
}

html[data-theme="light"] .page-users .users-create-form .form-control,
html[data-theme="light"] .page-users .users-create-form .form-select,
html[data-theme="light"] .page-users .users-modal-form .form-control,
html[data-theme="light"] .page-users .users-modal-form .form-select {
  border-color: #cbd5e1 !important;
  background-color: #ffffff !important;
  color: #1e293b !important;
}

html[data-theme="light"] .page-users .users-create-form .form-control:focus,
html[data-theme="light"] .page-users .users-create-form .form-select:focus,
html[data-theme="light"] .page-users .users-modal-form .form-control:focus,
html[data-theme="light"] .page-users .users-modal-form .form-select:focus {
  border-color: rgba(37, 99, 235, 0.46) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

html[data-theme="light"] .page-users .users-input-wrap>i,
html[data-theme="light"] .page-users .users-select-wrap>i,
html[data-theme="light"] .page-users .users-password-toggle {
  color: #64748b !important;
}

html[data-theme="light"] .page-users .users-input-wrap:focus-within>i,
html[data-theme="light"] .page-users .users-select-wrap:focus-within>i,
html[data-theme="light"] .page-users .users-password-toggle:hover {
  color: #1d4ed8 !important;
}

html[data-theme="light"] .page-users .users-create-submit>span {
  background: rgba(255, 255, 255, 0.28) !important;
}

html[data-theme="light"] .page-users .users-search-wrap i,
html[data-theme="light"] .page-reports .reports-field .form-label i,
html[data-theme="light"] .page-reports .reports-section-icon,
html[data-theme="light"] .page-quick-templates .qt-instance-pill>span,
html[data-theme="light"] .page-quick-templates .qt-summary-item>span {
  color: #1d4ed8 !important;
}

html[data-theme="light"] .page-quick-templates .qt-instance-pill>span,
html[data-theme="light"] .page-quick-templates .qt-summary-item>span {
  color: #0f766e !important;
}

html[data-theme="light"] .page-labels .labels-summary-item>span {
  color: #6d28d9 !important;
}

html[data-theme="light"] .page-users .users-table-wrap,
html[data-theme="light"] .page-reports .reports-table-wrap,
html[data-theme="light"] .page-quick-templates .qt-table-wrap,
html[data-theme="light"] .page-labels .labels-table-wrap {
  border-color: #e2e8f0 !important;
  background: #f8fafc !important;
}

html[data-theme="light"] .page-users .users-table,
html[data-theme="light"] .page-reports .reports-table,
html[data-theme="light"] .page-quick-templates .qt-table,
html[data-theme="light"] .page-labels .labels-table {
  --bs-table-bg: transparent;
  --bs-table-color: #1e293b;
  --bs-table-border-color: #e2e8f0;
  color: #1e293b !important;
}

html[data-theme="light"] .page-users .users-table thead th,
html[data-theme="light"] .page-reports .reports-table thead th,
html[data-theme="light"] .page-quick-templates .qt-table thead th,
html[data-theme="light"] .page-labels .labels-table thead th {
  color: #64748b !important;
  background: #f8fafc !important;
}

html[data-theme="light"] .page-users .users-table tbody td,
html[data-theme="light"] .page-reports .reports-table tbody td,
html[data-theme="light"] .page-quick-templates .qt-table tbody td,
html[data-theme="light"] .page-labels .labels-table tbody td {
  border-color: #e2e8f0 !important;
  background: #ffffff !important;
  color: #1e293b !important;
}

html[data-theme="light"] .page-users .users-table tbody tr:hover td,
html[data-theme="light"] .page-reports .reports-table tbody tr:not(.reports-total-row):hover td,
html[data-theme="light"] .page-quick-templates .qt-table tbody tr:hover td,
html[data-theme="light"] .page-labels .labels-table tbody tr:hover td {
  background: #f8fafc !important;
}

html[data-theme="light"] .page-users .users-table tbody tr:hover td:first-child {
  box-shadow: inset -3px 0 #2563eb !important;
}

/* ─── Group members modal & inbox compose modal light mode ─── */
html[data-theme="light"] .group-members-modal .modal-body {
  background: #ffffff !important;
}

html[data-theme="light"] .group-members-toolbar {
  padding: 12px 14px !important;
  background: #f0f2f5 !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .group-members-search-input {
  padding-right: 36px !important;
  border-radius: 999px !important;
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #111b21 !important;
}

html[data-theme="light"] .group-members-search-input::placeholder {
  color: #94a3b8 !important;
}

html[data-theme="light"] .group-members-search-input:focus {
  border-color: #128c7e !important;
  box-shadow: 0 0 0 3px rgba(18, 140, 126, 0.1) !important;
}

html[data-theme="light"] .group-members-search-wrap > i {
  color: #94a3b8 !important;
}

html[data-theme="light"] .group-members-count {
  align-self: flex-start !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #64748b !important;
  padding: 2px 10px !important;
  border-radius: 999px !important;
  border: 1px solid #cbd5e1 !important;
  background: rgba(18, 140, 126, 0.06) !important;
}

html[data-theme="light"] .group-members-list {
  max-height: min(58vh, 420px) !important;
  overflow-y: auto !important;
  padding: 6px 0 !important;
  scrollbar-width: thin !important;
  scrollbar-color: #cbd5e1 #ffffff !important;
}

html[data-theme="light"] .group-members-list::-webkit-scrollbar {
  width: 6px !important;
}

html[data-theme="light"] .group-members-list::-webkit-scrollbar-thumb {
  background: #cbd5e1 !important;
  border-radius: 999px !important;
}

html[data-theme="light"] .group-member-item {
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 10px 16px !important;
  border: 0 !important;
  background: transparent !important;
  color: #111b21 !important;
  text-align: right !important;
  cursor: pointer !important;
  transition: background 0.15s ease !important;
}

html[data-theme="light"] .group-member-item:hover:not(:disabled) {
  background: #f5f6f6 !important;
}

html[data-theme="light"] .group-member-item.is-disabled,
html[data-theme="light"] .group-member-item:disabled {
  cursor: default !important;
  opacity: 0.72 !important;
}

html[data-theme="light"] .group-member-name {
  display: inline-flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  font-size: 14.5px !important;
  font-weight: 600 !important;
  color: #111b21 !important;
}

html[data-theme="light"] .group-member-phone {
  font-size: 12px !important;
  color: #667781 !important;
  direction: ltr !important;
  unicode-bidi: plaintext !important;
}

html[data-theme="light"] .group-member-badge.is-admin {
  background: rgba(18, 140, 126, 0.12) !important;
  color: #0f766e !important;
  border: 1px solid rgba(18, 140, 126, 0.22) !important;
}

html[data-theme="light"] .group-member-action {
  width: 34px !important;
  height: 34px !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(18, 140, 126, 0.1) !important;
  color: #128c7e !important;
  flex: 0 0 auto !important;
}

html[data-theme="light"] .group-member-item.is-disabled .group-member-action {
  background: rgba(15, 23, 42, 0.05) !important;
  color: #cbd5e1 !important;
}

html[data-theme="light"] .group-members-empty {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  padding: 36px 20px !important;
  color: #94a3b8 !important;
  text-align: center !important;
  font-size: 13.5px !important;
}

html[data-theme="light"] .group-members-empty i {
  font-size: 1.8rem !important;
  color: #cbd5e1 !important;
}

html[data-theme="light"] .group-members-error {
  margin: 12px 14px !important;
  padding: 10px 12px !important;
  border-radius: 10px !important;
  background: rgba(251, 146, 60, 0.1) !important;
  border: 1px solid rgba(251, 146, 60, 0.25) !important;
  color: #d97706 !important;
  font-size: 13px !important;
}

/* Inbox compose modal light mode */
html[data-theme="light"] .inbox-compose-modal {
  border: none !important;
  border-radius: 14px !important;
  overflow: hidden !important;
  background: #ffffff !important;
}

html[data-theme="light"] .inbox-compose-modal-header {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  align-items: flex-start !important;
}

html[data-theme="light"] .inbox-phone-field .form-control {
  padding-right: 48px !important;
  padding-left: 14px !important;
  min-height: 46px !important;
  border-radius: 12px !important;
  font-size: 1.05rem !important;
  letter-spacing: 0.03em !important;
  font-weight: 600 !important;
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #111b21 !important;
}

html[data-theme="light"] .inbox-phone-field .form-control:focus {
  border-color: #128c7e !important;
  box-shadow: 0 0 0 3px rgba(18, 140, 126, 0.1) !important;
}

html[data-theme="light"] .inbox-phone-field-icon {
  position: absolute !important;
  top: 50% !important;
  right: 12px !important;
  transform: translateY(-50%) !important;
  width: 30px !important;
  height: 30px !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(18, 140, 126, 0.1) !important;
  color: #128c7e !important;
  pointer-events: none !important;
  z-index: 1 !important;
}

html[data-theme="light"] .inbox-compose-hint {
  display: flex !important;
  align-items: flex-start !important;
  gap: 8px !important;
  margin-top: 10px !important;
  padding: 10px 12px !important;
  border-radius: 10px !important;
  background: rgba(18, 140, 126, 0.06) !important;
  border: 1px solid rgba(18, 140, 126, 0.16) !important;
  color: #475569 !important;
  font-size: 12.5px !important;
  line-height: 1.45 !important;
}

html[data-theme="light"] .inbox-compose-hint i {
  color: #128c7e !important;
  margin-top: 1px !important;
  flex: 0 0 auto !important;
}

html[data-theme="light"] .inbox-compose-hint code {
  color: #128c7e !important;
  background: rgba(18, 140, 126, 0.1) !important;
  border-radius: 4px !important;
  padding: 1px 5px !important;
}

html[data-theme="light"] .inbox-compose-error {
  margin-top: 10px !important;
  padding: 10px 12px !important;
  border-radius: 10px !important;
  background: rgba(239, 68, 68, 0.1) !important;
  border: 1px solid rgba(239, 68, 68, 0.25) !important;
  color: #dc2626 !important;
  font-size: 13px !important;
}

html[data-theme="light"] .inbox-compose-modal-footer {
  gap: 8px !important;
  background: #f8fafc !important;
  border-top: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .inbox-compose-modal-footer .btn-success {
  background: #128c7e !important;
  border: none !important;
  font-weight: 600 !important;
  color: #ffffff !important;
}

html[data-theme="light"] .inbox-compose-modal-footer .btn-success:hover {
  background: #0f766e !important;
  filter: none !important;
}

html[data-theme="light"] .inbox-compose-modal-footer .btn-outline-secondary {
  border-color: #cbd5e1 !important;
  color: #475569 !important;
  background: #ffffff !important;
}

html[data-theme="light"] .inbox-compose-modal-footer .btn-outline-secondary:hover {
  background: #f8fafc !important;
  border-color: #a7d8de !important;
  color: #0f766e !important;
}
}

html[data-theme="light"] .page-users .users-pill,
html[data-theme="light"] .page-reports .reports-role,
html[data-theme="light"] .page-reports .reports-status,
html[data-theme="light"] .page-reports .reports-metric,
html[data-theme="light"] .page-quick-templates .qt-kind-badge,
html[data-theme="light"] .page-labels .labels-table .badge {
  border-color: #dbe4ee !important;
  background: #f1f5f9 !important;
  color: #475569 !important;
  box-shadow: none !important;
}

html[data-theme="light"] .page-users .users-pill.is-admin,
html[data-theme="light"] .page-reports .reports-role.is-admin {
  border-color: rgba(124, 58, 237, 0.22) !important;
  background: rgba(124, 58, 237, 0.09) !important;
  color: #6d28d9 !important;
}

html[data-theme="light"] .page-users .users-pill.is-agent,
html[data-theme="light"] .page-reports .reports-role.is-agent {
  border-color: rgba(37, 99, 235, 0.22) !important;
  background: rgba(37, 99, 235, 0.09) !important;
  color: #1d4ed8 !important;
}

html[data-theme="light"] .page-users .users-pill.is-active,
html[data-theme="light"] .page-reports .reports-status.is-active,
html[data-theme="light"] .page-reports .reports-metric.is-closed {
  border-color: rgba(22, 163, 74, 0.24) !important;
  background: rgba(22, 163, 74, 0.1) !important;
  color: #15803d !important;
}

html[data-theme="light"] .page-users .users-pill.is-inactive,
html[data-theme="light"] .page-reports .reports-status.is-inactive {
  border-color: #dbe4ee !important;
  background: #f1f5f9 !important;
  color: #64748b !important;
}

html[data-theme="light"] .page-users .users-pill.is-deleted,
html[data-theme="light"] .page-reports .reports-status.is-deleted {
  border-color: rgba(220, 38, 38, 0.24) !important;
  background: rgba(220, 38, 38, 0.08) !important;
  color: #b91c1c !important;
}

html[data-theme="light"] .page-reports .reports-metric.is-open {
  background: rgba(245, 158, 11, 0.12) !important;
  color: #b45309 !important;
}

html[data-theme="light"] .page-reports .reports-metric.is-sent {
  background: rgba(37, 99, 235, 0.09) !important;
  color: #1d4ed8 !important;
}

html[data-theme="light"] .page-reports .reports-total-row td {
  border-top-color: rgba(37, 99, 235, 0.2) !important;
  background: #eff6ff !important;
  color: #1e293b !important;
}

html[data-theme="light"] .page-users .user-avatar,
html[data-theme="light"] .page-reports .reports-employee>span,
html[data-theme="light"] .page-reports .reports-empty>span {
  border-color: rgba(37, 99, 235, 0.22) !important;
  background: rgba(37, 99, 235, 0.09) !important;
  color: #1d4ed8 !important;
}

html[data-theme="light"] .page-users .users-instances-box,
html[data-theme="light"] .page-conversation-settings .instances-users-box,
html[data-theme="light"] .page-conversation-settings .admin-help,
html[data-theme="light"] .page-conversation-settings .form-text {
  border-color: #e2e8f0 !important;
  background: #f8fafc !important;
  color: #64748b !important;
}

html[data-theme="light"] .page-users .users-instances-box .form-check:hover {
  background: rgba(37, 99, 235, 0.08) !important;
}

html[data-theme="light"] .page-quick-templates .qt-summary-item,
html[data-theme="light"] .page-labels .labels-summary-item,
html[data-theme="light"] .page-reports .report-stat,
html[data-theme="light"] .page-reports .reports-instance,
html[data-theme="light"] .page-quick-templates .qt-instance-pill {
  border-color: #e2e8f0 !important;
  background: #ffffff !important;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06) !important;
}

html[data-theme="light"] .page-reports .report-stat-label,
html[data-theme="light"] .page-reports .report-stat small,
html[data-theme="light"] .page-reports .reports-instance span,
html[data-theme="light"] .page-quick-templates .qt-instance-pill small {
  color: #64748b !important;
}

html[data-theme="light"] .page-reports .report-stat strong,
html[data-theme="light"] .page-reports .reports-instance strong,
html[data-theme="light"] .page-quick-templates .qt-instance-pill strong {
  color: #1e293b !important;
}

html[data-theme="light"] .page-quick-templates .qt-type-card {
  border-color: #e2e8f0 !important;
  background: #ffffff !important;
  color: #1e293b !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05) !important;
}

html[data-theme="light"] .page-quick-templates .qt-type-card:hover,
html[data-theme="light"] .page-quick-templates .qt-type-card.is-selected {
  border-color: rgba(18, 140, 126, 0.28) !important;
  background: #f0fdfa !important;
}

html[data-theme="light"] .page-quick-templates .qt-type-card .qt-type-title,
html[data-theme="light"] .page-quick-templates .modal-title,
html[data-theme="light"] .page-labels .modal-title {
  color: #1e293b !important;
}

html[data-theme="light"] .page-quick-templates .qt-type-card .qt-type-desc,
html[data-theme="light"] .page-quick-templates .qt-list-body>p,
html[data-theme="light"] .page-labels .labels-list-body>p,
html[data-theme="light"] .page-reports .reports-empty small {
  color: #64748b !important;
}

/* ─── Login light mode refinements ─── */
html[data-theme="light"] body.login-page {
  background: #f8fafc !important;
}

html[data-theme="light"] .login-page .login-form-panel {
  background:
    radial-gradient(circle at 15% 12%, rgba(18, 140, 126, 0.08), transparent 16rem),
    linear-gradient(135deg, #ffffff 0%, #f8fafc 62%, #eef7f5 100%) !important;
}

html[data-theme="light"] .login-page .login-auth-card {
  border-color: #e2e8f0 !important;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.1) !important;
}

html[data-theme="light"] .login-page .login-form-heading,
html[data-theme="light"] .login-page h2.auth-heading {
  color: #1e293b !important;
}

html[data-theme="light"] .login-page .auth-subtitle,
html[data-theme="light"] .login-page .auth-footer,
html[data-theme="light"] .login-page .auth-footer p,
html[data-theme="light"] .login-page .auth-help-link {
  color: #64748b !important;
}

html[data-theme="light"] .login-page .form-floating>label,
html[data-theme="light"] .login-page .form-check-label {
  color: #475569 !important;
}

html[data-theme="light"] .login-page .password-toggle-btn {
  color: #64748b !important;
}

html[data-theme="light"] .login-page .password-toggle-btn:hover,
html[data-theme="light"] .login-page .password-toggle-btn:focus {
  color: #0f766e !important;
  background: rgba(18, 140, 126, 0.08) !important;
}

html[data-theme="light"] .login-page .alert-danger {
  border-color: rgba(220, 38, 38, 0.22) !important;
  background: rgba(220, 38, 38, 0.08) !important;
  color: #b91c1c !important;
}

/* Users page final light-mode polish */
html[data-theme="light"] .page-users .users-stat {
  border-color: color-mix(in srgb, var(--users-stat-color) 24%, #e2e8f0) !important;
  background:
    radial-gradient(circle at 0 100%, color-mix(in srgb, var(--users-stat-color) 16%, transparent), transparent 6rem),
    linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.07) !important;
}

html[data-theme="light"] .page-users .users-stat:hover {
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.1) !important;
}

html[data-theme="light"] .page-users .users-stat .admin-stat-value {
  color: #0f172a !important;
}

html[data-theme="light"] .page-users .users-stat .admin-stat-label {
  color: #64748b !important;
}

html[data-theme="light"] .page-users .users-stat-icon {
  border-color: color-mix(in srgb, var(--users-stat-color) 28%, transparent) !important;
  background: color-mix(in srgb, var(--users-stat-color) 13%, #ffffff) !important;
  color: color-mix(in srgb, var(--users-stat-color) 75%, #0f172a) !important;
}

html[data-theme="light"] .page-users .users-create-card .admin-card-header {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.07), rgba(248, 250, 252, 0.96)) !important;
}

html[data-theme="light"] .page-users .users-create-form .form-label {
  color: #475569 !important;
}

html[data-theme="light"] .page-users .users-create-form .users-form-section,
html[data-theme="light"] .page-users .users-create-form .users-active-control,
html[data-theme="light"] .page-users .users-create-form .users-instances-box {
  border-color: #dbe4ee !important;
  background: #f8fafc !important;
}

html[data-theme="light"] .page-users .users-create-form .form-control,
html[data-theme="light"] .page-users .users-create-form .form-select,
html[data-theme="light"] .page-users .users-input-wrap .form-control,
html[data-theme="light"] .page-users .users-select-wrap .form-select {
  border-color: #cbd5e1 !important;
  background-color: #ffffff !important;
  color: #0f172a !important;
}

html[data-theme="light"] .page-users .users-create-form .form-control::placeholder {
  color: #94a3b8 !important;
}

html[data-theme="light"] .page-users .users-create-form .users-instances-box .form-check-label {
  color: #334155 !important;
}

html[data-theme="light"] .page-users .users-options-count {
  border-color: #dbe4ee !important;
  background: #ffffff !important;
  color: #475569 !important;
}

html[data-theme="light"] .page-users .users-view-tab {
  color: #475569 !important;
}

html[data-theme="light"] .page-users .users-view-tab.is-active {
  border-color: rgba(18, 140, 126, 0.24) !important;
  background: #0f766e !important;
  color: #ffffff !important;
  box-shadow: 0 6px 16px rgba(15, 118, 110, 0.18) !important;
}

html[data-theme="light"] .page-users .users-view-tab.is-active i {
  color: #ffffff !important;
}

html[data-theme="light"] .page-users .user-actions .btn-outline-warning {
  border-color: rgba(217, 119, 6, 0.36) !important;
  background: rgba(245, 158, 11, 0.08) !important;
  color: #b45309 !important;
}

html[data-theme="light"] .page-users .user-actions .btn-outline-warning i {
  color: #b45309 !important;
}

html[data-theme="light"] .page-users .user-actions .btn-outline-danger {
  border-color: rgba(220, 38, 38, 0.3) !important;
  background: rgba(220, 38, 38, 0.06) !important;
  color: #b91c1c !important;
}

html[data-theme="light"] .page-users .user-actions .btn-outline-danger i {
  color: #b91c1c !important;
}

html[data-theme="light"] .page-users .users-create-form .users-input-wrap>input.form-control,
html[data-theme="light"] .page-users .users-create-form .users-input-wrap.has-password-toggle>input.form-control,
html[data-theme="light"] .page-users .users-create-form .users-input-wrap.is-ltr>input.form-control {
  border-color: #cbd5e1 !important;
  background: #ffffff !important;
  background-color: #ffffff !important;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.02) !important;
}

html[data-theme="light"] .page-users .users-create-form .users-input-wrap>input.form-control:focus,
html[data-theme="light"] .page-users .users-create-form .users-input-wrap.has-password-toggle>input.form-control:focus,
html[data-theme="light"] .page-users .users-create-form .users-input-wrap.is-ltr>input.form-control:focus {
  border-color: rgba(37, 99, 235, 0.46) !important;
  background: #ffffff !important;
  background-color: #ffffff !important;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

html[data-theme="light"] .page-users .users-create-form .users-input-wrap>input.form-control::placeholder {
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
  opacity: 1 !important;
}

html[data-theme="light"] .page-users .users-create-form .users-input-wrap>input.form-control:-webkit-autofill,
html[data-theme="light"] .page-users .users-create-form .users-input-wrap>input.form-control:-webkit-autofill:hover,
html[data-theme="light"] .page-users .users-create-form .users-input-wrap>input.form-control:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
  -webkit-text-fill-color: #0f172a !important;
  caret-color: #0f172a !important;
}

html[data-theme="light"] .page-users .users-create-form .users-input-wrap>i,
html[data-theme="light"] .page-users .users-create-form .users-input-wrap .users-password-toggle,
html[data-theme="light"] .page-users .users-create-form .users-input-wrap .users-password-toggle i {
  color: #64748b !important;
}

html[data-theme="light"] .bulk-toolbar-actions .btn-outline-primary {
  border-color: #cbd5e1 !important;
  color: #475569 !important;
  background: #ffffff !important;
}

html[data-theme="light"] .admin-settings-actions {
  border-color: #e2e8f0 !important;
  background: linear-gradient(90deg, rgba(248, 250, 252, 0.96)) !important;
}

@media (max-width: 575px) {
  .login-theme-toggle-wrap {
    top: 12px;
    left: 12px;
  }

  .conversations-header-actions .theme-toggle {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    border-radius: 10px;
  }
}