/* Cre8Web Chat — Premium Slack-inspired UI layer */

:root {
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 999px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.14);
  --shadow-glow: 0 0 0 1px rgba(255, 212, 0, 0.35), 0 4px 20px rgba(255, 212, 0, 0.2);
  --sidebar-bg: #121316;
  --sidebar-hover: rgba(255, 255, 255, 0.08);
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --rail-bg: #0a0b0d;
  --main-bg: #ffffff;
  --main-surface: #f8f9fb;
  --main-text: #1d1c1d;
  --main-muted: #616061;
  --border: #e8e8e9;
  --border-strong: #d1d1d2;
  --composer-bg: #ffffff;
  --header-height: 60px;
  --font: 'Plus Jakarta Sans', 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  letter-spacing: -0.01em;
}

/* ——— Buttons (global) ——— */
.btn-primary,
.btn-secondary,
.btn-danger-outline,
.send-btn,
.toolbar-btn,
.header-action,
.icon-btn,
.rail-btn,
.section-add,
.notify-enable-btn {
  transition:
    background 0.2s var(--ease),
    color 0.2s var(--ease),
    border-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease),
    transform 0.15s var(--ease);
}

.btn-primary {
  width: auto;
  border-radius: var(--radius-sm);
  padding: 11px 20px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--main-text);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background: var(--main-surface);
  border-color: var(--main-muted);
}

.btn-danger-outline {
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.btn-sm {
  padding: 8px 14px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 700;
}

/* ——— Rail ——— */
.rail {
  padding: 14px 0;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
}

.rail-workspace {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, #1e1f24 0%, #0f1012 100%);
  border: 1px solid rgba(255, 212, 0, 0.25);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.rail-workspace:hover {
  transform: scale(1.04);
  box-shadow: var(--shadow-glow);
}

.rail-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
}

.rail-btn.active {
  box-shadow: var(--shadow-glow);
}

.rail-avatar {
  border-radius: var(--radius-sm);
  border: 2px solid rgba(255, 212, 0, 0.35);
  box-shadow: var(--shadow-sm);
}

.rail-avatar:hover {
  border-color: var(--brand-yellow);
  transform: scale(1.05);
}

/* ——— Sidebar ——— */
.sidebar {
  border-right: 1px solid var(--sidebar-border);
  box-shadow: none;
}

.sidebar-header {
  padding: 16px 14px 14px;
  border-bottom: 1px solid var(--sidebar-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
}

.sidebar-brand .workspace-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(90deg, #fff 0%, rgba(255, 255, 255, 0.85) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-logo {
  width: 52px;
  height: 52px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}

.icon-btn:hover {
  background: var(--sidebar-hover);
  border-color: rgba(255, 255, 255, 0.1);
}

.sidebar-search {
  margin: 10px 12px 6px;
  padding: 9px 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.sidebar-search:focus-within {
  border-color: rgba(255, 212, 0, 0.45);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2), 0 0 0 2px rgba(255, 212, 0, 0.15);
}

.section-head {
  padding: 8px 10px 4px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.section-add {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
}

.section-add:hover {
  background: var(--sidebar-hover);
}

.channel-list button.channel-item,
.channel-list a {
  margin: 1px 8px;
  padding: 7px 12px 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.channel-list button.channel-item.active,
.channel-list a.active {
  background: rgba(255, 212, 0, 0.14);
  color: #fff;
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--brand-yellow);
}

.channel-list button.channel-item:hover:not(.active),
.channel-list a:hover:not(.active) {
  background: var(--sidebar-hover);
  color: #fff;
}

/* unread uses badge only — selected row uses .active */

.channel-unread {
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.dm-list .channel-item .dm-avatar {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.admin-sidebar-link {
  margin: 8px 12px 12px;
  padding: 11px 14px !important;
  border-radius: var(--radius-sm) !important;
  font-weight: 700;
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.2s var(--ease);
}

.admin-sidebar-link:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow) !important;
}

.role-badge {
  border-radius: var(--radius-full);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: var(--shadow-xs);
}

.role-badge.sm {
  font-size: 9px;
  padding: 4px 8px;
}

/* ——— Main / Header ——— */
.main {
  background: var(--main-bg);
}

.chat-header {
  min-height: var(--header-height);
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.channel-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.member-avatars img {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-xs);
  border: 2px solid #fff;
  box-shadow: var(--shadow-xs);
}

.member-count {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  background: var(--main-surface);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

.header-action {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}

.header-action:hover {
  background: var(--main-surface);
  border-color: var(--border);
  color: var(--main-text);
}

.notify-bell-btn.enabled {
  box-shadow: var(--shadow-glow);
}

/* ——— Messages ——— */
.messages-wrap {
  background: linear-gradient(180deg, var(--main-surface) 0%, var(--main-bg) 120px);
  padding: 24px 0 16px;
}

.messages {
  max-width: 920px;
  padding: 0 28px;
}

.msg-group {
  padding: 6px 12px 6px 8px;
  margin-bottom: 2px;
  border-radius: var(--radius-md);
  transition: background 0.15s var(--ease);
}

.msg-group:hover {
  background: rgba(29, 28, 29, 0.04);
}

.msg-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs);
}

.msg-author {
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.02em;
}

.msg-time {
  font-size: 11px;
  font-weight: 600;
}

.msg-text {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--main-text);
}

.msg-attachment img {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: none;
}

.msg-file {
  border-radius: var(--radius-md);
  background: var(--main-surface);
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.2s var(--ease);
}

.msg-file:hover {
  box-shadow: var(--shadow-sm);
}

.date-divider span {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 14px;
  background: var(--main-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--main-muted);
}

.mention {
  background: rgba(255, 212, 0, 0.28);
  border-radius: var(--radius-xs);
  padding: 1px 6px;
}

.empty-chat {
  font-size: 14px;
  color: var(--main-muted);
  text-align: center;
  padding: 48px 24px;
}

/* ——— Composer ——— */
.composer-wrap {
  padding: 0 24px 24px;
}

.composer-toolbar {
  gap: 6px;
  margin-bottom: 8px;
  align-items: center;
}

.toolbar-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}

.toolbar-btn:hover {
  background: var(--main-surface);
  border-color: var(--border);
  color: var(--main-text);
}

.attach-file-btn {
  width: auto !important;
  height: 36px !important;
  padding: 0 14px !important;
  border-radius: var(--radius-sm) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  background: var(--main-surface) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-xs);
}

.attach-file-btn:hover {
  border-color: var(--brand-yellow) !important;
  background: rgba(255, 212, 0, 0.12) !important;
  box-shadow: var(--shadow-sm) !important;
}

.mention-hint {
  font-size: 12px;
  color: var(--main-muted);
  margin-left: auto;
}

.mention-hint kbd {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--main-surface);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
}

.composer {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  background: var(--composer-bg);
  box-shadow: var(--shadow-md);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.composer:focus-within {
  border-color: rgba(255, 212, 0, 0.6);
  box-shadow: var(--shadow-lg), 0 0 0 3px rgba(255, 212, 0, 0.12);
}

.composer textarea {
  font-size: 14.5px;
  line-height: 1.5;
  min-height: 24px;
}

.send-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-glow);
}

.send-btn:hover {
  transform: scale(1.06);
}

.send-btn:active {
  transform: scale(0.98);
}

.desktop-notify-banner {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.composer-emoji-anchor emoji-picker {
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-lg) !important;
  border: 1px solid var(--border) !important;
}

/* ——— Modals ——— */
.modal-overlay {
  background: rgba(10, 10, 12, 0.55);
  backdrop-filter: blur(6px);
}

.modal {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.modal-header {
  padding: 22px 28px;
  background: linear-gradient(180deg, var(--main-surface) 0%, #fff 100%);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s var(--ease);
}

.modal-close:hover {
  background: var(--main-surface);
  color: var(--main-text);
}

.modal-body input,
.modal-body textarea,
.modal-body select,
.auth-card input {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  padding: 11px 14px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.modal-body input:focus,
.modal-body textarea:focus,
.auth-card input:focus {
  border-color: var(--brand-yellow);
  box-shadow: 0 0 0 3px rgba(255, 212, 0, 0.2);
}

.input-prefix {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border-color: var(--border-strong);
}

.member-picker {
  border-radius: var(--radius-sm);
  background: var(--main-surface);
}

.people-list li button {
  border-radius: var(--radius-sm);
  transition: background 0.15s var(--ease);
}

.people-list li button:hover {
  background: var(--main-surface);
}

.profile-avatar-preview {
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  box-shadow: var(--shadow-md);
  background: linear-gradient(145deg, #f8f9fb 0%, #eef0f4 100%);
}

.profile-avatar-preview img {
  object-fit: contain !important;
}

/* Header account menu */
.header-user-menu {
  position: relative;
  margin-left: 4px;
}

.header-user-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px 4px 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--main-surface);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.header-user-btn:hover {
  border-color: var(--brand-yellow);
  box-shadow: var(--shadow-sm);
}

.header-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  object-fit: cover;
  display: block;
  background: #e8e8e9;
}

.header-user-chevron {
  color: var(--main-muted);
  flex-shrink: 0;
}

.header-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  overflow: hidden;
  padding: 6px 0;
}

.header-user-dropdown-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.header-user-dropdown-head img {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: #f0f1f3;
}

.header-user-dropdown-head strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
}

.header-user-dropdown-head span {
  display: block;
  font-size: 12px;
  color: var(--main-muted);
  margin-top: 2px;
  word-break: break-all;
}

.header-dropdown-item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: none;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: var(--main-text);
  cursor: pointer;
  transition: background 0.15s var(--ease);
}

.header-dropdown-item:hover {
  background: var(--main-surface);
}

.header-dropdown-item.danger {
  color: var(--danger);
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding-top: 12px;
}

.header-dropdown-item.danger:hover {
  background: rgba(224, 30, 90, 0.08);
}

/* ——— Search dropdown ——— */
.search-dropdown {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.search-item {
  padding: 12px 16px;
  transition: background 0.12s var(--ease);
}

.search-item:hover {
  background: var(--main-surface);
}

.mention-dropdown {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.mention-item {
  transition: background 0.12s var(--ease);
}

/* ——— Toast & notifications ——— */
.toast {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-weight: 600;
  border: 1px solid var(--border);
}

.notify-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  border-left-width: 4px;
  box-shadow: var(--shadow-lg);
}

.notify-enable-btn {
  border-radius: var(--radius-full);
  padding: 14px 24px;
  font-size: 14px;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-lg);
}

.notify-enable-btn:hover {
  transform: translateX(-50%) translateY(-2px);
}

/* ——— Right panel ——— */
.right-panel {
  background: var(--main-surface);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.04);
}

.right-panel-header h3 {
  font-weight: 800;
  letter-spacing: -0.02em;
}

.member-list-item img {
  border-radius: var(--radius-sm);
}

/* ——— Auth ——— */
.auth-page {
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(255, 212, 0, 0.12) 0%, transparent 55%),
    linear-gradient(160deg, #0a0a0a 0%, #141414 40%, #1a1608 100%);
}

.auth-card {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.auth-card h2 {
  letter-spacing: -0.03em;
}

.auth-card .btn-primary {
  width: 100%;
  margin-top: 20px;
  padding: 13px;
  border-radius: var(--radius-sm);
}

/* ——— Admin ——— */
.admin-page {
  background: var(--main-surface);
}

.admin-header {
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-xs);
}

.admin-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.admin-form {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.admin-table th {
  letter-spacing: 0.05em;
}

.table-user img {
  border-radius: var(--radius-xs);
}

/* ——— Scrollbars ——— */
.messages-wrap::-webkit-scrollbar-thumb,
.sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-full);
}

.sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
}

/* Profile sign out + modal actions */
.modal-footer .btn-primary {
  min-width: 100px;
}

.modal-footer .btn-secondary,
.modal-footer .btn-danger-outline {
  min-width: 88px;
}

#profileForm + .modal-footer,
.profile-modal ~ .modal-footer {
  gap: 10px;
}

.auth-note,
.auth-demo {
  font-size: 13px;
  line-height: 1.5;
}

.demo-accounts code {
  border-radius: var(--radius-xs);
  padding: 3px 8px;
  font-size: 12px;
}

/* ——— Sidebar header ——— */
.sidebar-brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.sidebar-brand-row .workspace-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  -webkit-text-fill-color: #fff;
  background: none;
  flex: 1;
  min-width: 0;
}

.sidebar-brand-row {
  margin-bottom: 0;
  align-items: center;
}

.sidebar-brand-row .btn-new-dm {
  margin-left: auto;
  background: rgba(255, 214, 0, 0.15);
  color: var(--brand-yellow);
}

.sidebar-brand-row .btn-new-dm:hover {
  background: rgba(255, 214, 0, 0.28);
}

.dm-list .channel-item {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.sidebar-scroll {
  overflow-x: hidden;
}

.sidebar-header {
  padding-bottom: 10px;
}

.sidebar-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.chat-type-pill {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.65);
  flex-shrink: 0;
}

.channel-item.chat-row {
  align-items: flex-start;
  gap: 8px;
}

.chat-item-meta {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 2px;
}

.chats-empty-main .home-welcome-card.compact {
  padding: 28px 24px;
}

.mobile-back {
  display: none;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--surface-2, #f4f4f5);
  color: var(--text, #1d1c1d);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
}

.mobile-back:hover {
  background: #e8e8ea;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 24;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.sidebar-backdrop.visible {
  display: block;
  opacity: 1;
}

.rail-brand-letter {
  font-size: 14px;
  font-weight: 900;
  color: var(--brand-yellow);
  letter-spacing: -0.05em;
}

.app-shell.sidebar-collapsed .sidebar {
  width: 0;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: none;
}

.app-shell.sidebar-hidden .sidebar {
  display: none;
}

/* ——— Home welcome ——— */
.home-welcome {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  padding: 32px 20px;
}

.home-welcome-card {
  max-width: 520px;
  width: 100%;
  padding: 36px 32px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.home-greeting {
  font-size: 14px;
  color: var(--main-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.home-name {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  color: var(--main-text);
}

.home-datetime {
  padding: 16px 20px;
  background: var(--main-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

.home-date {
  font-size: 15px;
  font-weight: 700;
  color: var(--main-text);
  margin-bottom: 6px;
}

.home-time {
  font-size: 22px;
  font-weight: 800;
  color: var(--main-text);
  letter-spacing: -0.02em;
}

.home-tz {
  font-size: 12px;
  font-weight: 600;
  color: var(--main-muted);
}

.home-sub {
  font-size: 14px;
  color: var(--main-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

.home-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--main-muted);
}

.home-stats strong {
  display: block;
  font-size: 20px;
  color: var(--main-text);
  font-weight: 800;
}

.home-team-status {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: left;
}

.home-team-status-title {
  font-size: 15px;
  font-weight: 800;
  margin: 0 0 14px;
  color: var(--main-text);
}

.home-status-block {
  margin-bottom: 14px;
  padding: 12px 14px;
  background: var(--main-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.home-status-head {
  font-size: 13px;
  font-weight: 800;
  color: var(--main-text);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.home-status-count {
  font-size: 12px;
  font-weight: 700;
  color: #b8860b;
  background: rgba(255, 214, 0, 0.15);
  padding: 2px 8px;
  border-radius: 999px;
}

.home-status-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.home-status-person {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--main-text);
}

.home-status-person img {
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.home-status-empty {
  margin: 0;
  font-size: 12px;
  color: var(--main-muted);
  font-style: italic;
}

.home-status-quick {
  margin-bottom: 16px;
  padding: 12px 14px;
  background: rgba(255, 214, 0, 0.08);
  border: 1px solid rgba(255, 214, 0, 0.25);
  border-radius: var(--radius-md);
}

.home-status-quick-label {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--main-text);
}

.home-status-quick-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.home-quick-status-btn,
.home-status-set-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--main-text);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.home-quick-status-btn:hover,
.home-status-set-btn:hover {
  background: rgba(255, 214, 0, 0.2);
  border-color: rgba(255, 214, 0, 0.5);
}

.home-quick-status-btn:disabled,
.home-status-set-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.home-status-clickable {
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.home-status-clickable:hover,
.home-status-clickable:focus {
  outline: none;
  border-color: rgba(255, 214, 0, 0.55);
  background: rgba(255, 214, 0, 0.1);
  box-shadow: 0 0 0 2px rgba(255, 214, 0, 0.15);
}

.home-status-clickable.is-setting {
  opacity: 0.7;
  pointer-events: none;
}

.home-status-clear {
  border-color: rgba(46, 186, 118, 0.35);
  background: rgba(46, 186, 118, 0.06);
}

.home-status-clear:hover,
.home-status-clear:focus {
  border-color: rgba(46, 186, 118, 0.55);
  background: rgba(46, 186, 118, 0.12);
  box-shadow: 0 0 0 2px rgba(46, 186, 118, 0.15);
}

.home-status-tap-hint {
  margin: 10px 0 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--main-muted);
  text-align: center;
}

.home-status-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-status-duration {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: #b8860b;
  background: rgba(255, 214, 0, 0.12);
  padding: 2px 8px;
  border-radius: 999px;
}

.home-status-person {
  justify-content: space-between;
}

/* ——— Member chips (remove from group/project) ——— */
.member-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 4px;
  background: var(--main-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
}

.member-chip img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.chip-remove {
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(224, 30, 90, 0.12);
  color: var(--danger);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chip-remove:hover {
  background: var(--danger);
  color: #fff;
}

@media (max-width: 600px) {
  .modal {
    width: calc(100% - 24px);
    max-height: 85vh;
  }

  .modal-header,
  .modal-body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .modal-footer {
    flex-wrap: wrap;
    gap: 10px;
  }

  .modal-footer .btn-danger-outline {
    width: 100%;
    margin-right: 0;
    order: 3;
  }

  .member-chips {
    gap: 6px;
  }

  .member-chip-name {
    max-width: 90px;
  }
}

/* ——— Admin ——— */
.row-disabled {
  opacity: 0.65;
  background: #fafafa;
}

.status-disabled {
  color: var(--danger);
  font-weight: 700;
  font-size: 12px;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}

/* Member profile view */
.member-profile-top {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.member-profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.member-profile-top h3 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 6px;
}

.member-profile-status {
  font-size: 13px;
  color: var(--main-muted);
  margin-top: 6px;
}

.member-profile-section h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--main-muted);
  margin-bottom: 8px;
}

.member-profile-jd {
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  padding: 14px;
  background: var(--main-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.member-profile-jd.empty {
  color: var(--main-muted);
  font-style: italic;
}

.profile-view-trigger {
  cursor: pointer;
}

.profile-view-trigger:hover {
  opacity: 0.85;
}

.member-list-item.profile-view-trigger {
  display: flex;
  width: 100%;
  border: none;
  background: none;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.member-list-item.profile-view-trigger:hover {
  background: var(--main-surface);
}

.member-jd-preview {
  font-size: 12px;
  color: var(--main-muted);
  margin-top: 4px;
  line-height: 1.4;
}

.msg-author.profile-view-trigger:hover {
  text-decoration: underline;
  color: #9a7500;
}

/* Online / offline presence */
.item-label-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
}

.channel-list .item-label-col .item-label {
  width: 100%;
}

.team-presence {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}

.presence-online {
  color: var(--success);
}

.presence-offline {
  color: #888;
}

.member-profile-presence {
  font-size: 13px;
  font-weight: 700;
  margin-top: 4px;
}

.member-profile-presence.online {
  color: var(--success);
}

.member-profile-presence.offline {
  color: #888;
}

.channel-item .status-dot {
  width: 10px !important;
  height: 10px !important;
  flex-shrink: 0;
  margin-left: auto;
}

/* ——— Team activity group composer ——— */
.activity-composer-bar {
  padding: 10px 14px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 214, 0, 0.06);
}

.activity-composer-bar .activity-quick {
  padding: 0 0 8px;
}

.activity-composer-hint {
  margin: 0 0 4px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

.activity-composer-hint kbd {
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
}

.channel-item-activity .item-label {
  font-weight: 700;
  color: #f7d654;
}

.activity-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 8px 10px;
}

.activity-chip {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 8px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.activity-chip:hover {
  background: rgba(255, 214, 0, 0.15);
  border-color: rgba(255, 214, 0, 0.35);
}

.activity-compose {
  display: flex;
  gap: 6px;
  padding: 0 8px 8px;
}

.activity-compose input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 12px;
  font-family: inherit;
}

.activity-compose input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.activity-compose input:focus {
  outline: none;
  border-color: rgba(255, 214, 0, 0.45);
}

.activity-post-btn {
  flex-shrink: 0;
  padding: 8px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--brand-yellow);
  color: #141414;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}

.activity-hint {
  padding: 0 10px 8px;
  margin: 0;
  font-size: 10px;
}

.activity-hint kbd {
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
}

.activity-feed {
  list-style: none;
  margin: 0;
  padding: 0 6px 10px;
  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
}

.activity-item {
  display: flex;
  gap: 8px;
  padding: 8px;
  margin-bottom: 4px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
}

.activity-item.is-me {
  background: rgba(255, 214, 0, 0.08);
  border: 1px solid rgba(255, 214, 0, 0.12);
}

.activity-avatar {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.activity-body {
  min-width: 0;
  flex: 1;
}

.activity-meta {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
}

.activity-meta strong {
  color: #fff;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-time {
  color: rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
}

.activity-text {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 2px;
  line-height: 1.35;
  word-break: break-word;
}

.activity-empty {
  padding: 12px 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
}

.team-presence.team-activity-status,
.member-count.dm-presence.team-activity-status,
.team-activity-status {
  color: #f7d654 !important;
  font-weight: 700;
}

.member-profile-presence.team-activity-status {
  color: #f7d654 !important;
}

@media (max-width: 900px) {
  .sidebar-backdrop.visible {
    display: block;
  }

  .mobile-back:not(.hidden) {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .app-shell.chat-active-mobile .main {
    width: 100%;
  }

  .app-shell.chat-active-mobile .sidebar:not(.open) {
    transform: translateX(-100%);
  }

  .home-welcome {
    min-height: 40vh;
    padding: 20px 16px;
  }

  .home-welcome-card {
    padding: 24px 20px;
    border-radius: 16px;
  }

  .home-name {
    font-size: 1.75rem;
  }

  .home-stats {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .home-stats span {
    display: block;
    padding: 10px;
    background: #f8f8f9;
    border-radius: 10px;
  }

  .channel-title {
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: min(50vw, 200px);
  }
}

@media (max-width: 768px) {
  .sidebar-brand-row .workspace-name {
    font-size: 15px;
  }

  .composer-wrap {
    padding: 0 12px 16px;
  }

  .messages {
    padding: 0 16px;
  }

  .rail-btn span.rail-label {
    display: none;
  }
}

@media (max-width: 600px) {
  .sidebar {
    width: min(100vw, 320px) !important;
    max-width: calc(100vw - var(--rail-width));
  }


  .chat-type-pill {
    font-size: 9px;
    padding: 2px 5px;
  }
}
