.theme-toggle{min-width:42px;min-height:42px;display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:0 12px;border:1px solid #dbe2ea;border-radius:12px;background:#f8fafc;color:#334155;cursor:pointer;font:inherit;font-size:13px;font-weight:700}
.theme-toggle:disabled{opacity:.6;cursor:wait}
.theme-toggle-label{white-space:nowrap}

body[data-theme="dark"]{background:#0f172a!important;color:#e2e8f0!important;color-scheme:dark}
body[data-theme="dark"] .header{background:rgba(15,23,42,.94);border-color:#334155}
body[data-theme="dark"] .profile-card,
body[data-theme="dark"] .chat-item,
body[data-theme="dark"] .empty,
body[data-theme="dark"] .menu-panel,
body[data-theme="dark"] .modal-card{background:#1e293b;border-color:#334155;color:#e2e8f0}
body[data-theme="dark"] .icon-btn,
body[data-theme="dark"] .quick-btn,
body[data-theme="dark"] .close-menu,
body[data-theme="dark"] .modal-close,
body[data-theme="dark"] .search-wrapper input,
body[data-theme="dark"] .form-group input,
body[data-theme="dark"] .form-group textarea,
body[data-theme="dark"] .member-add-row input{background:#0f172a;border-color:#475569;color:#e2e8f0}
body[data-theme="dark"] .search-wrapper input::placeholder,
body[data-theme="dark"] .form-group input::placeholder,
body[data-theme="dark"] .form-group textarea::placeholder{color:#94a3b8}
body[data-theme="dark"] .menu-header{border-color:#334155}
body[data-theme="dark"] .menu-profile{background:linear-gradient(135deg,#263449,#312e45)}
body[data-theme="dark"] .menu-item{color:#cbd5e1}
body[data-theme="dark"] .menu-item:hover{background:#29364a;color:#93c5fd}
body[data-theme="dark"] .menu-icon{background:#334155}
body[data-theme="dark"] .menu-item:hover .menu-icon{background:#3b4c66}
body[data-theme="dark"] .brand-text span,
body[data-theme="dark"] .profile-name span,
body[data-theme="dark"] .menu-profile span,
body[data-theme="dark"] .section-title span,
body[data-theme="dark"] .chat-time,
body[data-theme="dark"] .chat-preview,
body[data-theme="dark"] .feedback-history-meta{color:#94a3b8}
body[data-theme="dark"] .feedback-history,
body[data-theme="dark"] .feedback-history-item,
body[data-theme="dark"] .member-list li,
body[data-theme="dark"] .contacts-list,
body[data-theme="dark"] .contacts-list li{border-color:#334155}
body[data-theme="dark"] .feedback-history-text,
body[data-theme="dark"] .empty strong,
body[data-theme="dark"] .form-group label,
body[data-theme="dark"] .modal-top h3{color:#e2e8f0}
body[data-theme="dark"] .contacts-list li{background:#1e293b}
body[data-theme="dark"] .status-notification-badge{border-color:#1e293b}

body[data-theme="dark"] .chat-app{background:#0f172a;color:#e2e8f0}
body[data-theme="dark"] .conversation-sidebar{background:#111c2f;border-color:#334155}
body[data-theme="dark"] .conversation-sidebar-header,
body[data-theme="dark"] .chat-header,
body[data-theme="dark"] .composer{background:#1e293b;border-color:#334155;color:#e2e8f0}
body[data-theme="dark"] .conversation-sidebar-header a,
body[data-theme="dark"] .back,
body[data-theme="dark"] .search-button,
body[data-theme="dark"] .menu-btn,
body[data-theme="dark"] .attach-label{background:#334155;color:#e2e8f0}
body[data-theme="dark"] .conversation-sidebar-search,
body[data-theme="dark"] .search-box,
body[data-theme="dark"] .search-box input,
body[data-theme="dark"] .group-search,
body[data-theme="dark"] #message,
body[data-theme="dark"] .member-item .info input,
body[data-theme="dark"] .known-contacts-search,
body[data-theme="dark"] .add-member-input{background:#0f172a;border-color:#475569;color:#e2e8f0}
body[data-theme="dark"] .conversation-sidebar-item:hover,
body[data-theme="dark"] .conversation-sidebar-item.active,
body[data-theme="dark"] .dropdown-menu .menu-item:hover,
body[data-theme="dark"] .message-menu button:hover{background:#334155}
body[data-theme="dark"] .messages{background:radial-gradient(circle at top,#1e293b,#0f172a);color:#e2e8f0}
body[data-theme="dark"] .message-row:not(.mine) .bubble,
body[data-theme="dark"] .message-menu,
body[data-theme="dark"] .message-menu button,
body[data-theme="dark"] .modal-content,
body[data-theme="dark"] .dropdown-menu,
body[data-theme="dark"] .incoming-alert{background:#1e293b;border-color:#475569;color:#e2e8f0}
body[data-theme="dark"] .mine .bubble{background:#1e3a5f;border-color:#315985;color:#e2e8f0}
body[data-theme="dark"] .document,
body[data-theme="dark"] .media-preview,
body[data-theme="dark"] .media-preview-thumb{background:#0f172a;border-color:#475569;color:#e2e8f0}
body[data-theme="dark"] #filePreview{background:#1e293b!important;color:#e2e8f0!important}
body[data-theme="dark"] #filePreview [data-preview-url]{color:#cbd5e1!important}
body[data-theme="dark"] #filePreview [data-preview-url] button{background:#7f1d1d!important;color:#fecaca!important}
body[data-theme="dark"] #filePreview > button{color:#fca5a5!important}
body[data-theme="dark"] .document-icon{background:#334155}
body[data-theme="dark"] .status,
body[data-theme="dark"] .conversation-sidebar-preview,
body[data-theme="dark"] .conversation-sidebar-time,
body[data-theme="dark"] .message-time,
body[data-theme="dark"] .attachment-meta,
body[data-theme="dark"] .info-label,
body[data-theme="dark"] .member-item .info span,
body[data-theme="dark"] .known-contact-number{color:#94a3b8}
body[data-theme="dark"] .date-separator,
body[data-theme="dark"] .last-message-tag{background:#1e293b;border-color:#475569;color:#93c5fd}
body[data-theme="dark"] .typing-bubble,
body[data-theme="dark"] .conversation-sidebar-empty{color:#cbd5e1}
body[data-theme="dark"] .info-row,
body[data-theme="dark"] .member-item,
body[data-theme="dark"] .contacts-list,
body[data-theme="dark"] .contacts-list li,
body[data-theme="dark"] .known-contacts,
body[data-theme="dark"] .known-contacts li,
body[data-theme="dark"] .selected-members,
body[data-theme="dark"] .selected-members li{border-color:#334155}
body[data-theme="dark"] .theme-toggle{background:#334155;border-color:#475569;color:#f8fafc}

body[data-theme="dark"] .page{color:#e2e8f0}
body[data-theme="dark"] .page .card{background:#1e293b;border-color:#334155;color:#e2e8f0}
body[data-theme="dark"] .page textarea,
body[data-theme="dark"] .page .media-preview,
body[data-theme="dark"] .page .media-preview-thumb,
body[data-theme="dark"] .page .media-remove,
body[data-theme="dark"] .page .media-picker-button{background:#0f172a;border-color:#475569;color:#e2e8f0}
body[data-theme="dark"] .page .media-picker{background:linear-gradient(135deg,#172554,#312e45);border-color:#475569}
body[data-theme="dark"] .page .media-picker-copy strong,
body[data-theme="dark"] .page .media-preview-name,
body[data-theme="dark"] .page .status-user{color:#e2e8f0}
body[data-theme="dark"] .page .media-picker-copy span,
body[data-theme="dark"] .page .media-preview-meta,
body[data-theme="dark"] .page .media-help,
body[data-theme="dark"] .page .form-footer,
body[data-theme="dark"] .page .status-section-title,
body[data-theme="dark"] .page .status-user-time,
body[data-theme="dark"] .page .status-user-preview{color:#94a3b8}
body[data-theme="dark"] .page .status-user{background:#1e293b;border-color:#334155}
body[data-theme="dark"] .page .status-user:hover{background:#29364a}
body[data-theme="dark"] .page .status-avatar{background:#334155;border-color:#1e293b;color:#e2e8f0}
body[data-theme="dark"] .page .status-count{background:#334155;color:#cbd5e1}
body[data-theme="dark"] .page textarea::placeholder{color:#94a3b8}
body[data-theme="dark"] .page .theme-toggle{background:#fff;color:#1e293b}

@media(max-width:600px){
    .theme-toggle{min-width:38px;min-height:38px;padding:0 9px;font-size:12px}
}
