/* Final readability layer for the light theme. Keep this file small and last. */
html.theme-light,
body.theme-light {
  color-scheme: light;
  --text: #121827;
  --text-soft: #273244;
  --muted: #647085;
  --muted-2: #8792a6;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-2: rgba(248, 250, 255, 0.92);
  --border: rgba(116, 130, 158, 0.24);
}

body.theme-light .main-shell,
body.theme-light .section,
body.theme-light .section.active,
body.theme-light .section-body {
  color: var(--text);
}

body.theme-light .card,
body.theme-light .accordion,
body.theme-light .dialogs-list-panel,
body.theme-light .chat-panel,
body.theme-light .dialogs-side-panel .accordion,
body.theme-light .clients-list-card,
body.theme-light .client-editor-card,
body.theme-light .users-list-card,
body.theme-light .user-editor-card,
body.theme-light .templates-list-card,
body.theme-light .template-editor-card,
body.theme-light .orders-list-card,
body.theme-light .order-editor-card,
body.theme-light .settings-card,
body.theme-light .calculator-card,
body.theme-light .calculator-test-panel,
body.theme-light .channel-card,
body.theme-light .channel-connect-card,
body.theme-light .channel-studio-card,
body.theme-light .channel-help-card,
body.theme-light .entity-item,
body.theme-light .mini-item {
  background: var(--panel) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

body.theme-light .topbar-title,
body.theme-light .panel-header h2,
body.theme-light .entity-title,
body.theme-light .client-list-title,
body.theme-light .user-list-title,
body.theme-light .template-list-title,
body.theme-light .order-list-title,
body.theme-light .channel-connect-title,
body.theme-light .channel-studio-title,
body.theme-light .channel-help-title,
body.theme-light .channel-qf-title,
body.theme-light .accordion-toggle span:first-child,
body.theme-light .mini-item-title,
body.theme-light .message-text,
body.theme-light .message-attachment-name,
body.theme-light .message-attachment-link {
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text) !important;
  opacity: 1 !important;
}

body.theme-light .label,
body.theme-light label,
body.theme-light .client-field .label,
body.theme-light .user-field .label,
body.theme-light .template-field .label,
body.theme-light .order-field .label,
body.theme-light .settings-field .label,
body.theme-light .calculator-field .label,
body.theme-light .channel-connect-label,
body.theme-light .channel-studio-label,
body.theme-light .span-2 > .label {
  color: #4b5568 !important;
  -webkit-text-fill-color: #4b5568 !important;
  opacity: 1 !important;
}

body.theme-light .muted,
body.theme-light .entity-subtitle,
body.theme-light .entity-meta,
body.theme-light .dialog-preview,
body.theme-light .dialog-date-right,
body.theme-light .dialog-compact-date,
body.theme-light .message-time,
body.theme-light .message-meta,
body.theme-light .mini-item-meta,
body.theme-light .client-list-phone,
body.theme-light .client-list-meta,
body.theme-light .user-list-login,
body.theme-light .user-list-meta,
body.theme-light .template-list-preview,
body.theme-light .template-list-meta,
body.theme-light .order-list-client,
body.theme-light .order-list-meta,
body.theme-light .channel-connect-text,
body.theme-light .channel-studio-help,
body.theme-light .channel-help-text,
body.theme-light .channel-help-meta,
body.theme-light .settings-field-hint,
body.theme-light .calculator-field-hint,
body.theme-light .kv span,
body.theme-light .kv-notes span {
  color: var(--muted) !important;
  -webkit-text-fill-color: var(--muted) !important;
  opacity: 1 !important;
}

body.theme-light .input,
body.theme-light .textarea,
body.theme-light input,
body.theme-light textarea,
body.theme-light select,
body.theme-light select.input,
body.theme-light .composer-textarea,
body.theme-light .composer-textarea-v2,
body.theme-light .channel-qf-input,
body.theme-light .channel-studio-input,
body.theme-light .preview-box,
body.theme-light .calculator-result-box,
body.theme-light #channel-logs {
  background: rgba(255, 255, 255, 0.98) !important;
  border-color: rgba(116, 130, 158, 0.30) !important;
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text) !important;
  opacity: 1 !important;
}

body.theme-light input[readonly],
body.theme-light textarea[readonly],
body.theme-light .input[readonly],
body.theme-light #section-clients #client-id,
body.theme-light #section-users #user-id,
body.theme-light #section-templates #template-id,
body.theme-light #section-orders #order-id,
body.theme-light #section-channels #channel-id,
body.theme-light #section-channels #channel-code,
body.theme-light #section-channels #channel-status-input,
body.theme-light #client-id,
body.theme-light #user-id,
body.theme-light #template-id,
body.theme-light #order-id,
body.theme-light #channel-id,
body.theme-light #channel-code,
body.theme-light #channel-status-input {
  background: rgba(245, 248, 253, 0.98) !important;
  border-color: rgba(116, 130, 158, 0.24) !important;
  color: var(--muted) !important;
  -webkit-text-fill-color: var(--muted) !important;
  opacity: 1 !important;
}

body.theme-light #section-clients .client-field .input,
body.theme-light #section-clients .client-field .textarea,
body.theme-light #section-users .user-field .input,
body.theme-light #section-users .user-field .textarea,
body.theme-light #section-templates .template-field .input,
body.theme-light #section-templates .template-field .textarea,
body.theme-light #section-orders .order-field .input,
body.theme-light #section-orders .order-field .textarea,
body.theme-light #section-settings .settings-field .input,
body.theme-light #section-settings .settings-field .textarea,
body.theme-light #section-calculator .calculator-field .input,
body.theme-light #section-calculator .calculator-field .textarea,
body.theme-light #section-channels .channel-connect-field .input,
body.theme-light #section-channels .channel-connect-field .textarea,
body.theme-light #section-channels .channel-studio-field .input,
body.theme-light #section-channels .channel-studio-field .textarea,
body.theme-light #section-channels .channel-qf-input,
body.theme-light #section-channels .channel-studio-input {
  background: rgba(255, 255, 255, 0.98) !important;
  border-color: rgba(116, 130, 158, 0.30) !important;
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text) !important;
  opacity: 1 !important;
}

body.theme-light .input::placeholder,
body.theme-light .textarea::placeholder,
body.theme-light input::placeholder,
body.theme-light textarea::placeholder,
body.theme-light .composer-textarea::placeholder,
body.theme-light .composer-textarea-v2::placeholder {
  color: var(--muted-2) !important;
  -webkit-text-fill-color: var(--muted-2) !important;
  opacity: 1 !important;
}

body.theme-light .small-btn,
body.theme-light .secondary-btn,
body.theme-light .status-btn,
body.theme-light .quick-reply,
body.theme-light .quick-replies button,
body.theme-light .composer-icon-btn,
body.theme-light .composer-side-btn {
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: rgba(116, 130, 158, 0.28) !important;
  color: var(--text-soft) !important;
  -webkit-text-fill-color: var(--text-soft) !important;
}

body.theme-light .entity-item.active,
body.theme-light .dialog-compact-card.active,
body.theme-light .client-list-item.active,
body.theme-light .user-list-item.active,
body.theme-light .template-list-item.active,
body.theme-light .order-list-item.active,
body.theme-light .channel-card.active,
body.theme-light .channel-card.selected {
  background: #eaf3ff !important;
  border-color: rgba(96, 165, 250, 0.72) !important;
  color: var(--text) !important;
}

body.theme-light #section-dialogs .messages-list {
  background:
    radial-gradient(circle at 36% 0%, rgba(139, 92, 246, 0.08), transparent 36%),
    #f8fafc !important;
}

body.theme-light #section-dialogs .message-row.in .message.message-compact {
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: rgba(116, 130, 158, 0.22) !important;
  color: var(--text) !important;
}

body.theme-light #section-dialogs .message-row.out .message.message-compact {
  background: linear-gradient(135deg, #6d5dfc, #8b5cf6) !important;
  border-color: rgba(139, 92, 246, 0.32) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

body.theme-light #section-dialogs .message-row.out .message.message-compact * {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

body.theme-light .message-attachment,
body.theme-light .message-attachment-body,
body.theme-light .message-attachment-body.only-file-name,
body.theme-light .message-attachments-download-all {
  background: rgba(245, 248, 253, 0.96) !important;
  border-color: rgba(116, 130, 158, 0.26) !important;
  color: var(--text) !important;
}

/* Unified light theme contract. This file is loaded last; keep all fixes token-based. */
html.theme-light,
body.theme-light {
  --ui-bg: #f3f6fc;
  --ui-bg-soft: #eef3fb;
  --ui-surface: #ffffff;
  --ui-surface-soft: #f8faff;
  --ui-surface-muted: #eef3fb;
  --ui-border: #d8e0ec;
  --ui-border-strong: #bdc9db;
  --ui-text: #111827;
  --ui-text-soft: #273244;
  --ui-muted: #5f6f86;
  --ui-muted-soft: #7d8aa0;
  --ui-accent: #8b5cf6;
  --ui-accent-strong: #7444ee;
  --ui-accent-soft: #efe8ff;
  --ui-success: #16a34a;
  --ui-warning: #b7791f;
  --ui-danger: #dc2626;
  --ui-shadow: 0 18px 42px rgba(31, 41, 63, 0.10);

  --eva-bg-0: var(--ui-bg) !important;
  --eva-bg-1: var(--ui-bg-soft) !important;
  --eva-bg-2: #e8eef8 !important;
  --eva-panel: var(--ui-surface) !important;
  --eva-panel-2: var(--ui-surface-soft) !important;
  --eva-panel-3: var(--ui-surface-muted) !important;
  --eva-border: var(--ui-border) !important;
  --eva-border-2: rgba(139, 92, 246, 0.34) !important;
  --eva-text: var(--ui-text) !important;
  --eva-text-soft: var(--ui-text-soft) !important;
  --eva-muted: var(--ui-muted) !important;
  --eva-muted-2: var(--ui-muted-soft) !important;
  --eva-shadow: var(--ui-shadow) !important;
  --page-bg: var(--ui-bg) !important;
  --page-bg-2: var(--ui-bg-soft) !important;
  --card-bg: var(--ui-surface) !important;
  --card-bg-soft: var(--ui-surface-soft) !important;
  --card-border: var(--ui-border) !important;
  --panel: var(--ui-surface) !important;
  --panel-2: var(--ui-surface-soft) !important;
  --panel-soft: var(--ui-surface-soft) !important;
  --border: var(--ui-border) !important;
  --text: var(--ui-text) !important;
  --text-main: var(--ui-text) !important;
  --text-soft: var(--ui-text-soft) !important;
  --muted: var(--ui-muted) !important;
  --muted-2: var(--ui-muted-soft) !important;
  --text-muted-2: var(--ui-muted) !important;
  --composer-bg: var(--ui-surface) !important;
  --message-in: var(--ui-surface) !important;
  --message-out: #8260f6 !important;
}

body.theme-light {
  background:
    radial-gradient(circle at 55% -12%, rgba(139, 92, 246, 0.12), transparent 36%),
    radial-gradient(circle at 6% 100%, rgba(16, 185, 129, 0.08), transparent 30%),
    linear-gradient(180deg, var(--ui-bg-soft), var(--ui-bg)) !important;
  color: var(--ui-text) !important;
  -webkit-text-fill-color: initial !important;
}

body.theme-light::before {
  background-image: radial-gradient(rgba(87, 99, 128, 0.18) 1px, transparent 1px) !important;
  opacity: 1 !important;
}

body.theme-light .main-shell,
body.theme-light .section,
body.theme-light .section.active,
body.theme-light .section-layout,
body.theme-light .settings-layout,
body.theme-light .calculator-layout,
body.theme-light .dialogs-layout {
  color: var(--ui-text) !important;
  -webkit-text-fill-color: initial !important;
}

body.theme-light .topbar {
  background: rgba(255, 255, 255, 0.94) !important;
  border-color: var(--ui-border) !important;
  color: var(--ui-text) !important;
}

body.theme-light .topbar-right,
body.theme-light .brand-subtitle {
  color: var(--ui-muted) !important;
}

body.theme-light .card,
body.theme-light .accordion,
body.theme-light .list-column,
body.theme-light .editor-column,
body.theme-light .dialogs-list-panel,
body.theme-light .chat-panel,
body.theme-light .dialogs-side-panel .accordion,
body.theme-light .settings-card,
body.theme-light .calculator-card,
body.theme-light .calculator-test-panel,
body.theme-light .clients-list-card,
body.theme-light .client-editor-card,
body.theme-light .orders-list-card,
body.theme-light .order-editor-card,
body.theme-light .templates-list-card,
body.theme-light .template-editor-card,
body.theme-light .users-list-card,
body.theme-light .user-editor-card,
body.theme-light .channel-card,
body.theme-light .channel-connect-card,
body.theme-light .channel-studio-card,
body.theme-light .channel-help-card,
body.theme-light .entity-item,
body.theme-light .dialog-compact-card,
body.theme-light .mini-item,
body.theme-light .request-summary-card,
body.theme-light .client-brief-card,
body.theme-light .template-side-item,
body.theme-light .mini-order-card,
body.theme-light .template-attachments-list {
  background: rgba(255, 255, 255, 0.94) !important;
  border-color: var(--ui-border) !important;
  color: var(--ui-text) !important;
  box-shadow: var(--ui-shadow) !important;
  opacity: 1 !important;
}

body.theme-light .panel-header,
body.theme-light .accordion-toggle,
body.theme-light .request-subaccordion-toggle,
body.theme-light .clients-panel-header,
body.theme-light .orders-panel-header,
body.theme-light .templates-panel-header,
body.theme-light .users-panel-header,
body.theme-light .settings-panel-header,
body.theme-light .calculator-panel-header,
body.theme-light .calculator-test-header,
body.theme-light .channel-studio-head,
body.theme-light .channel-connect-head,
body.theme-light .chat-templates-header {
  background: linear-gradient(180deg, rgba(248, 250, 255, 0.96), rgba(255, 255, 255, 0.84)) !important;
  border-color: var(--ui-border) !important;
  color: var(--ui-text) !important;
}

body.theme-light .topbar-title,
body.theme-light .panel-header h2,
body.theme-light .section h1,
body.theme-light .section h2,
body.theme-light .entity-title,
body.theme-light .dialog-title-single-line,
body.theme-light .client-list-title,
body.theme-light .order-list-title,
body.theme-light .template-list-title,
body.theme-light .user-list-title,
body.theme-light .channel-connect-title,
body.theme-light .channel-studio-title,
body.theme-light .channel-help-title,
body.theme-light .channel-qf-title,
body.theme-light .settings-panel-header h2,
body.theme-light .calculator-panel-header h2,
body.theme-light .calculator-test-header h2,
body.theme-light .accordion-toggle span:first-child,
body.theme-light .request-subaccordion-toggle span:first-child,
body.theme-light .kv strong,
body.theme-light .kv-notes div,
body.theme-light .mini-item-title,
body.theme-light .chat-templates-title {
  color: var(--ui-text) !important;
  -webkit-text-fill-color: var(--ui-text) !important;
  opacity: 1 !important;
}

body.theme-light .label,
body.theme-light label,
body.theme-light .section .label,
body.theme-light .client-field .label,
body.theme-light .order-field .label,
body.theme-light .template-field .label,
body.theme-light .user-field .label,
body.theme-light .settings-field .label,
body.theme-light .calculator-field .label,
body.theme-light .channel-connect-label,
body.theme-light .channel-studio-label,
body.theme-light .channel-qf-label,
body.theme-light .span-2 > .label {
  color: var(--ui-muted) !important;
  -webkit-text-fill-color: var(--ui-muted) !important;
  opacity: 1 !important;
}

body.theme-light .muted,
body.theme-light .entity-subtitle,
body.theme-light .entity-meta,
body.theme-light .dialog-preview,
body.theme-light .dialog-compact-date,
body.theme-light .dialog-date-right,
body.theme-light .client-list-phone,
body.theme-light .client-list-meta,
body.theme-light .order-list-client,
body.theme-light .order-list-meta,
body.theme-light .template-list-preview,
body.theme-light .template-list-meta,
body.theme-light .user-list-login,
body.theme-light .user-list-meta,
body.theme-light .settings-panel-subtitle,
body.theme-light .settings-field-hint,
body.theme-light .calculator-panel-subtitle,
body.theme-light .calculator-field-hint,
body.theme-light .channel-connect-text,
body.theme-light .channel-studio-help,
body.theme-light .channel-help-text,
body.theme-light .channel-help-meta,
body.theme-light .message-time,
body.theme-light .message-meta,
body.theme-light .message-attachment-meta,
body.theme-light .mini-item-meta,
body.theme-light .kv span,
body.theme-light .kv-notes span {
  color: var(--ui-muted) !important;
  -webkit-text-fill-color: var(--ui-muted) !important;
  opacity: 1 !important;
}

body.theme-light input,
body.theme-light textarea,
body.theme-light select,
body.theme-light .input,
body.theme-light .textarea,
body.theme-light select.input,
body.theme-light .large-textarea,
body.theme-light .composer-textarea,
body.theme-light .composer-textarea-v2,
body.theme-light .channel-qf-input,
body.theme-light .channel-studio-input,
body.theme-light .preview-box,
body.theme-light .calculator-result-box,
body.theme-light #channel-logs,
body.theme-light #channel-logs pre {
  background: var(--ui-surface) !important;
  border-color: var(--ui-border-strong) !important;
  color: var(--ui-text) !important;
  -webkit-text-fill-color: var(--ui-text) !important;
  opacity: 1 !important;
}

body.theme-light input[readonly],
body.theme-light textarea[readonly],
body.theme-light .input[readonly],
body.theme-light #client-id,
body.theme-light #order-id,
body.theme-light #template-id,
body.theme-light #user-id,
body.theme-light #channel-id,
body.theme-light #channel-code,
body.theme-light #channel-status-input {
  background: var(--ui-surface-muted) !important;
  border-color: var(--ui-border) !important;
  color: var(--ui-muted) !important;
  -webkit-text-fill-color: var(--ui-muted) !important;
}

body.theme-light input::placeholder,
body.theme-light textarea::placeholder,
body.theme-light .input::placeholder,
body.theme-light .textarea::placeholder,
body.theme-light .composer-textarea::placeholder,
body.theme-light .composer-textarea-v2::placeholder {
  color: #8793a8 !important;
  -webkit-text-fill-color: #8793a8 !important;
  opacity: 1 !important;
}

body.theme-light select option {
  background: #ffffff !important;
  color: var(--ui-text) !important;
}

body.theme-light .small-btn,
body.theme-light .secondary-btn,
body.theme-light .status-btn,
body.theme-light .quick-reply,
body.theme-light .quick-reply-btn,
body.theme-light .quick-replies button,
body.theme-light .composer-icon-btn,
body.theme-light .composer-side-btn,
body.theme-light .chat-template-chip {
  background: var(--ui-surface-soft) !important;
  border-color: var(--ui-border-strong) !important;
  color: var(--ui-text-soft) !important;
  -webkit-text-fill-color: var(--ui-text-soft) !important;
  opacity: 1 !important;
}

body.theme-light .primary-btn,
body.theme-light .composer-send,
body.theme-light .composer-send-v2 {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

body.theme-light .entity-item.active,
body.theme-light .dialog-compact-card.active,
body.theme-light .client-list-item.active,
body.theme-light .order-list-item.active,
body.theme-light .template-list-item.active,
body.theme-light .user-list-item.active,
body.theme-light .channel-card.active,
body.theme-light .channel-card.selected,
body.theme-light .channel-studio-card.is-active {
  background: linear-gradient(135deg, #f1eaff, #ffffff) !important;
  border-color: rgba(139, 92, 246, 0.58) !important;
  color: var(--ui-text) !important;
}

body.theme-light #section-dialogs .messages-list {
  background:
    radial-gradient(circle at 50% 0%, rgba(139, 92, 246, 0.10), transparent 38%),
    radial-gradient(rgba(87, 99, 128, 0.12) 1px, transparent 1px),
    #f8faff !important;
  background-size: auto, 24px 24px, auto !important;
}

body.theme-light #section-dialogs .message-row.in .message.message-compact,
body.theme-light #section-dialogs .message-row.in .message {
  background: var(--ui-surface) !important;
  border-color: var(--ui-border) !important;
  color: var(--ui-text) !important;
  -webkit-text-fill-color: initial !important;
}

body.theme-light #section-dialogs .message-row.out .message.message-compact,
body.theme-light #section-dialogs .message-row.out .message {
  background: linear-gradient(135deg, #8d67ff, #6f55e8) !important;
  border-color: rgba(111, 85, 232, 0.38) !important;
  color: #ffffff !important;
}

body.theme-light #section-dialogs .message-row.out .message.message-compact *,
body.theme-light #section-dialogs .message-row.out .message * {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

body.theme-light #section-dialogs .message-row.in .message-text,
body.theme-light #section-dialogs .message-row.in .message-attachment-name,
body.theme-light #section-dialogs .message-row.in .message-attachment-link {
  color: var(--ui-text) !important;
  -webkit-text-fill-color: var(--ui-text) !important;
}

body.theme-light .message-attachment,
body.theme-light .message-attachment-body,
body.theme-light .message-attachment-body.only-file-name,
body.theme-light .message-attachments-download-all,
body.theme-light .composer-upload-list,
body.theme-light .composer-upload-item {
  background: var(--ui-surface-soft) !important;
  border-color: var(--ui-border) !important;
  color: var(--ui-text) !important;
  -webkit-text-fill-color: initial !important;
}

body.theme-light #section-dialogs .message-row.out .message-attachment,
body.theme-light #section-dialogs .message-row.out .message-attachment-body,
body.theme-light #section-dialogs .message-row.out .message-attachments-download-all {
  background: rgba(255, 255, 255, 0.16) !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
}

body.theme-light #section-dialogs .composer,
body.theme-light #section-dialogs .chat-templates-drawer,
body.theme-light #section-dialogs .composer-reply-bar {
  background: rgba(255, 255, 255, 0.96) !important;
  border-color: var(--ui-border) !important;
  color: var(--ui-text) !important;
}

body.theme-light .badge,
body.theme-light .status-badge,
body.theme-light .channel-status-badge,
body.theme-light .order-list-status,
body.theme-light .client-list-tag {
  -webkit-text-fill-color: currentColor !important;
  opacity: 1 !important;
}

body.theme-light .status-badge.ok,
body.theme-light .channel-status-badge.ok,
body.theme-light .badge-ok {
  background: #dcfce7 !important;
  border-color: #86efac !important;
  color: #166534 !important;
}

body.theme-light .status-badge.error,
body.theme-light .channel-status-badge.error,
body.theme-light .badge-error {
  background: #fee2e2 !important;
  border-color: #fca5a5 !important;
  color: #991b1b !important;
}

body.theme-light .status-badge.disabled,
body.theme-light .channel-status-badge.disabled,
body.theme-light .badge-disabled {
  background: #eef2f7 !important;
  border-color: #cbd5e1 !important;
  color: #475569 !important;
}

body.theme-light .request-person-card,
body.theme-light .request-subaccordion,
body.theme-light .client-tech-details,
body.theme-light .request-section,
body.theme-light .chat-templates-inline,
body.theme-light .template-attachments-actions {
  background: var(--ui-surface-soft) !important;
  border-color: var(--ui-border) !important;
  color: var(--ui-text) !important;
}

/* Light theme keeps the left navigation dark; lock its own contrast rules. */
body.theme-light .sidebar {
  background:
    radial-gradient(circle at 78% 4%, rgba(139, 92, 246, 0.16), transparent 26%),
    linear-gradient(180deg, #11141d 0%, #070a0f 100%) !important;
  border-right-color: rgba(255, 255, 255, 0.10) !important;
  color: #f4f4f7 !important;
  -webkit-text-fill-color: initial !important;
}

body.theme-light .sidebar .brand-title {
  color: #f4f4f7 !important;
  -webkit-text-fill-color: #f4f4f7 !important;
  opacity: 1 !important;
}

body.theme-light .sidebar .brand-title::first-letter {
  color: #a970ff !important;
  -webkit-text-fill-color: #a970ff !important;
}

body.theme-light .sidebar .brand-subtitle {
  color: rgba(212, 212, 220, 0.72) !important;
  -webkit-text-fill-color: rgba(212, 212, 220, 0.72) !important;
  opacity: 1 !important;
}

body.theme-light .sidebar .burger-btn {
  background: rgba(255, 255, 255, 0.035) !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
  color: #e7e7ec !important;
  -webkit-text-fill-color: #e7e7ec !important;
  box-shadow: none !important;
}

body.theme-light .sidebar .nav-btn {
  background: rgba(255, 255, 255, 0.035) !important;
  border-color: rgba(255, 255, 255, 0.10) !important;
  color: #e7e7ec !important;
  -webkit-text-fill-color: #e7e7ec !important;
  box-shadow: none !important;
  opacity: 1 !important;
}

body.theme-light .sidebar .nav-btn:hover {
  background: rgba(255, 255, 255, 0.07) !important;
  border-color: rgba(169, 112, 255, 0.34) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

body.theme-light .sidebar .nav-btn.active {
  background:
    linear-gradient(135deg, rgba(139, 92, 246, 0.38), rgba(89, 78, 255, 0.22)) !important;
  border-color: rgba(186, 143, 255, 0.72) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  box-shadow:
    0 0 0 1px rgba(186, 143, 255, 0.18) inset,
    0 16px 38px rgba(104, 72, 210, 0.24) !important;
}

/* Outgoing attachments sit inside a purple bubble, so keep them purple-tinted too. */
body.theme-light #section-dialogs .messages-list .message-row.out .message .message-attachment,
body.theme-light #section-dialogs .messages-list .message-row.out .message .message-attachment-body,
body.theme-light #section-dialogs .messages-list .message-row.out .message .message-attachment-body.only-file-name,
body.theme-light #section-dialogs .messages-list .message-row.out .message .message-attachments-download-all {
  background: rgba(255, 255, 255, 0.16) !important;
  border-color: rgba(255, 255, 255, 0.30) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

body.theme-light #section-dialogs .messages-list .message-row.out .message .message-attachment-name,
body.theme-light #section-dialogs .messages-list .message-row.out .message .message-attachment-link,
body.theme-light #section-dialogs .messages-list .message-row.out .message .message-attachment-name a {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  text-decoration-color: rgba(255, 255, 255, 0.82) !important;
}

body.theme-light #section-dialogs .messages-list .message-row.out .message .message-attachment-meta {
  color: rgba(255, 255, 255, 0.78) !important;
  -webkit-text-fill-color: rgba(255, 255, 255, 0.78) !important;
}

body.theme-light #section-dialogs .messages-list .message-row.out .message .message-attachment:hover,
body.theme-light #section-dialogs .messages-list .message-row.out .message .message-attachments-download-all:hover {
  background: rgba(255, 255, 255, 0.24) !important;
  border-color: rgba(255, 255, 255, 0.42) !important;
}

/* Final light-theme fix for files sent by us: the filename pill was staying white. */
body.theme-light #section-dialogs .messages-list .message-row.out .message.out .message-attachments .message-attachment,
body.theme-light #section-dialogs .messages-list .message-row.out .message.out .message-attachments .message-attachment-body,
body.theme-light #section-dialogs .messages-list .message.out .message-attachments .message-attachment,
body.theme-light #section-dialogs .messages-list .message.out .message-attachments .message-attachment-body,
body.theme-light #section-dialogs .messages-list .message-row.out .message .message-attachments .message-attachment,
body.theme-light #section-dialogs .messages-list .message-row.out .message .message-attachments .message-attachment-body,
body.theme-light #section-dialogs .messages-list .message-row.out .message .message-attachments .message-attachment-body.only-file-name {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

body.theme-light #section-dialogs .messages-list .message-row.out .message.out .message-attachments .message-attachment-name,
body.theme-light #section-dialogs .messages-list .message.out .message-attachments .message-attachment-name,
body.theme-light #section-dialogs .messages-list .message-row.out .message.out .message-attachments .message-attachments-download-all,
body.theme-light #section-dialogs .messages-list .message.out .message-attachments .message-attachments-download-all,
body.theme-light #section-dialogs .messages-list .message-row.out .message .message-attachments .message-attachment-name,
body.theme-light #section-dialogs .messages-list .message-row.out .message .message-attachments .message-attachments-download-all {
  background: rgba(255, 255, 255, 0.18) !important;
  border: 1px solid rgba(255, 255, 255, 0.38) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  box-shadow: none !important;
}

body.theme-light #section-dialogs .messages-list .message-row.out .message.out .message-attachments .message-attachment-link,
body.theme-light #section-dialogs .messages-list .message.out .message-attachments .message-attachment-link,
body.theme-light #section-dialogs .messages-list .message-row.out .message.out .message-attachments .message-attachment-name a,
body.theme-light #section-dialogs .messages-list .message.out .message-attachments .message-attachment-name a,
body.theme-light #section-dialogs .messages-list .message-row.out .message .message-attachments .message-attachment-link,
body.theme-light #section-dialogs .messages-list .message-row.out .message .message-attachments .message-attachment-name a {
  background: transparent !important;
  border: 0 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  text-decoration-color: rgba(255, 255, 255, 0.86) !important;
}
