:root {
  --bg: #080b11;
  --surface: #0e131f;
  --surface-2: #141c2d;
  --surface-3: #1c273e;
  --rail-bg: #07090e;
  --border: #1e293b;
  --border-light: rgba(255, 255, 255, 0.08);
  --border-focus: #00c2ff;
  
  --teams-purple: #5b5fc7;
  --teams-purple-hover: #4f52b2;
  --teams-purple-light: rgba(91, 95, 199, 0.15);
  
  --cyan: #00c2ff;
  --cyan-glow: rgba(0, 194, 255, 0.25);
  --emerald: #10b981;
  --amber: #f59e0b;
  --rose: #ef4444;
  --purple: #a855f7;
  
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --radius: 10px;
  --radius-sm: 6px;
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body, html {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* 1. TEAMS GLOBAL HEADER */
.teams-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

.teams-header {
  height: 48px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
  z-index: 50;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: #fff;
  font-weight: 800;
  font-size: 16px;
}

.logo-box {
  background: linear-gradient(135deg, #00c2ff 0%, #5b5fc7 100%);
  color: #fff;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 900;
}

.logo-i { color: #fef08a; }
.brand-name { color: #38bdf8; font-weight: 800; }

.teams-pill {
  background: var(--teams-purple);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.vps-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

/* Global Search Bar */
.global-search-wrap {
  flex: 1;
  max-width: 480px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 10px;
  font-size: 12px;
  color: var(--text-dim);
  pointer-events: none;
}

.global-search-inp {
  width: 100%;
  height: 30px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: #fff;
  padding: 0 54px 0 30px;
  font-size: 12.5px;
  font-family: inherit;
  transition: all 0.2s;
}

.global-search-inp:focus {
  outline: none;
  border-color: var(--cyan);
  background: var(--surface-3);
  box-shadow: 0 0 0 2px var(--cyan-glow);
}

.search-shortcut {
  position: absolute;
  right: 8px;
  font-size: 10.5px;
  color: var(--text-dim);
  background: var(--surface-3);
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* Header Tools */
.header-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-top-meet {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--teams-purple) 0%, #4338ca 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-top-meet:hover {
  background: linear-gradient(135deg, #686dc9 0%, #4f46e5 100%);
  box-shadow: 0 0 12px rgba(91, 95, 199, 0.4);
}

.user-profile-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 10px 2px 3px;
}

.user-avatar-badge {
  position: relative;
}

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00c2ff, #7928ca);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}

.presence-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--surface);
}

.presence-dot.online { background: #10b981; }
.presence-dot.busy { background: #f59e0b; }
.presence-dot.leave { background: #a855f7; }

.user-dropdown {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.user-dropdown option, .user-dropdown optgroup {
  background: #111827;
  color: #f1f5f9;
}

.btn-iwork-link {
  color: #00c2ff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(0, 194, 255, 0.08);
  border: 1px solid rgba(0, 194, 255, 0.25);
  transition: all 0.2s;
}

.btn-iwork-link:hover {
  background: rgba(0, 194, 255, 0.18);
  border-color: #00c2ff;
}

/* 2. TEAMS MAIN CONTAINER */
.teams-container {
  display: flex;
  flex: 1;
  height: calc(100vh - 48px);
  overflow: hidden;
}

/* 3. TEAMS NAVIGATION RAIL (Cột icon bên trái ngoài cùng) */
.teams-rail {
  width: 68px;
  background: var(--rail-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
  gap: 4px;
  flex-shrink: 0;
  z-index: 30;
}

.rail-btn {
  width: 58px;
  height: 52px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
  text-decoration: none;
}

.rail-icon {
  font-size: 18px;
  margin-bottom: 2px;
}

.rail-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.rail-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}

.rail-btn.active {
  color: #00c2ff;
  background: rgba(0, 194, 255, 0.08);
}

.rail-btn.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  background: #00c2ff;
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 8px #00c2ff;
}

.rail-badge {
  position: absolute;
  top: 4px;
  right: 10px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 10px;
  line-height: 1.2;
}

.rail-divider {
  width: 36px;
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

/* 4. TEAMS SIDEBAR (DANH SÁCH KÊNH / DMs / LỊCH) */
.teams-sidebar {
  width: 270px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-view {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 12px;
}

.sidebar-title {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.btn-icon-sub {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.btn-icon-sub:hover {
  background: var(--surface-2);
  color: #fff;
}

.channel-group {
  margin-bottom: 16px;
}

.group-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-dim);
  padding: 6px 8px;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.4px;
}

.arrow-indicator {
  font-size: 9px;
  color: var(--text-dim);
}

.group-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chan-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}

.chan-item:hover {
  background: var(--surface-2);
  color: #fff;
}

.chan-item.active {
  background: var(--surface-3);
  color: #fff;
  border-color: rgba(0, 194, 255, 0.3);
  box-shadow: inset 3px 0 0 #00c2ff;
}

.chan-symbol {
  font-size: 14px;
  flex-shrink: 0;
}

.chan-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chan-badge-count {
  background: #f59e0b;
  color: #000;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 10px;
}

/* DM Users List */
.dm-users-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dm-user-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
}

.dm-user-item:hover {
  background: var(--surface-2);
}

.dm-user-item.active {
  background: var(--surface-3);
  border-color: rgba(0, 194, 255, 0.3);
}

.dm-avatar-wrap {
  position: relative;
}

.dm-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: #334155;
}

.dm-info {
  flex: 1;
  min-width: 0;
}

.dm-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dm-sub {
  font-size: 11px;
  color: var(--text-dim);
}

/* Activity Feed */
.activity-feed-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.activity-card {
  display: flex;
  gap: 10px;
  padding: 10px;
  background: var(--surface-2);
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
}

.activity-card.unread {
  border-color: rgba(0, 194, 255, 0.4);
  background: rgba(0, 194, 255, 0.05);
}

.act-icon { font-size: 18px; }
.act-title { font-size: 12px; font-weight: 700; color: #fff; }
.act-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.act-time { font-size: 10.5px; color: var(--text-dim); margin-top: 4px; }

/* Calendar Sidebar Box */
.meeting-sidebar-box {
  margin-bottom: 14px;
}

.meetings-sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meeting-card-side {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
}

.meet-tag {
  display: inline-block;
  background: var(--teams-purple-light);
  color: #a5b4fc;
  border: 1px solid var(--teams-purple);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  margin-bottom: 4px;
}

.meet-side-title {
  font-weight: 700;
  font-size: 12.5px;
  color: #fff;
}

.meet-side-time {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 3px;
}

.btn-join-meet-sm {
  margin-top: 8px;
  width: 100%;
  padding: 4px 8px;
  background: var(--teams-purple);
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

/* Sidebar Footer */
.sidebar-server-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.vps-info-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.vps-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00c2ff;
  box-shadow: 0 0 6px #00c2ff;
}

.vps-online-text {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* 5. TEAMS VIEWPORT (KHUNG CHÍNH) */
.teams-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  min-width: 0;
  position: relative;
}

/* Channel Header */
.channel-navbar {
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
  gap: 16px;
}

.chan-info {
  min-width: 0;
}

.chan-main-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chan-main-title h2 {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chan-star-icon {
  font-size: 13px;
  color: #fbbf24;
  cursor: pointer;
}

.chan-desc {
  font-size: 11.5px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Channel Tabs (Posts / Files / Tasks / About) */
.channel-tabs {
  display: flex;
  gap: 4px;
}

.chan-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 700;
  padding: 16px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.chan-tab:hover {
  color: #fff;
}

.chan-tab.active {
  color: #00c2ff;
  border-bottom-color: #00c2ff;
}

/* Channel Right Actions */
.channel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-meet-action {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--teams-purple) 0%, #00c2ff 100%);
  color: #fff;
  border: none;
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 194, 255, 0.25);
  transition: all 0.2s;
}

.btn-meet-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 16px rgba(0, 194, 255, 0.45);
}

.btn-header-tool {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
}

.btn-header-tool:hover {
  color: #fff;
  border-color: #475569;
}

/* 6. MESSAGES AREA */
.tab-content-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
}

.messages-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: auto;
}

/* TEAMS MESSAGE CARD */
.teams-msg {
  display: flex;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  position: relative;
  transition: background 0.15s;
}

.teams-msg:hover {
  background: rgba(255, 255, 255, 0.025);
}

.msg-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  background: #3b82f6;
  position: relative;
}

.msg-main {
  flex: 1;
  min-width: 0;
}

.msg-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.msg-sender {
  font-weight: 800;
  font-size: 13.5px;
  color: #fff;
}

.role-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.role-tag.bod { background: rgba(0, 194, 255, 0.2); color: #38bdf8; border: 1px solid #00c2ff; }
.role-tag.cs { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid #a855f7; }
.role-tag.leader { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid #f59e0b; }
.role-tag.staff { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid #10b981; }
.role-tag.qa { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid #ef4444; }
.role-tag.admin { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; border: 1px solid #94a3b8; }
.role-tag.bot { background: rgba(91, 95, 199, 0.25); color: #a5b4fc; border: 1px solid #5b5fc7; }

.msg-time {
  font-size: 11px;
  color: var(--text-dim);
}

/* Quoted Reply inside message */
.reply-quote-box {
  background: var(--surface-2);
  border-left: 3px solid var(--cyan);
  padding: 6px 10px;
  border-radius: 0 6px 6px 0;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.reply-quote-user {
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 2px;
}

.msg-body {
  color: #e2e8f0;
  font-size: 13.5px;
  line-height: 1.55;
  word-break: break-word;
}

/* Attachment inside message (3D render preview) */
.attachment-card {
  margin-top: 8px;
  max-width: 440px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-2);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}

.attachment-card:hover {
  transform: translateY(-2px);
  border-color: #00c2ff;
}

.attach-thumb-img {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  display: block;
}

.attach-meta {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.attach-name {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attach-size {
  font-size: 11px;
  color: var(--text-dim);
}

/* Teams Meeting Card inside message */
.meeting-invite-card {
  margin-top: 10px;
  max-width: 520px;
  background: linear-gradient(135deg, rgba(91, 95, 199, 0.25) 0%, rgba(0, 194, 255, 0.15) 100%);
  border: 1px solid rgba(91, 95, 199, 0.5);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.meeting-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.meeting-card-icon {
  font-size: 24px;
}

.meeting-card-title {
  font-size: 14.5px;
  font-weight: 800;
  color: #fff;
}

.meeting-card-body {
  font-size: 12.5px;
  color: #cbd5e1;
  margin-bottom: 12px;
  line-height: 1.5;
}

.btn-join-meeting {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--teams-purple) 0%, #00c2ff 100%);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 0 12px rgba(0, 194, 255, 0.35);
  transition: all 0.2s;
}

.btn-join-meeting:hover {
  box-shadow: 0 0 20px rgba(0, 194, 255, 0.6);
  transform: translateY(-1px);
}

/* Reactions on Message */
.msg-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.reaction-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
}

.reaction-pill:hover {
  border-color: #00c2ff;
  background: var(--surface-3);
}

.reaction-pill.reacted {
  background: rgba(0, 194, 255, 0.15);
  border-color: #00c2ff;
  color: #38bdf8;
}

.reaction-count {
  font-weight: 700;
  font-size: 11px;
}

/* Hover Action Bar on Message (Teams style) */
.msg-action-bar {
  position: absolute;
  top: -12px;
  right: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 8px;
  display: none;
  align-items: center;
  gap: 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  z-index: 10;
}

.teams-msg:hover .msg-action-bar {
  display: flex;
}

.action-btn-emoji {
  background: transparent;
  border: none;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: transform 0.1s;
}

.action-btn-emoji:hover {
  transform: scale(1.3);
}

.action-divider {
  width: 1px;
  height: 14px;
  background: var(--border);
  margin: 0 2px;
}

.action-btn-tool {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
}

.action-btn-tool:hover {
  color: #fff;
  background: var(--surface-3);
}

/* 7. COMPOSER */
.teams-composer {
  padding: 0 24px 16px;
  flex-shrink: 0;
}

.reply-indicator-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-2);
  border-left: 3px solid #00c2ff;
  border-radius: 6px 6px 0 0;
  padding: 6px 14px;
  margin-bottom: -1px;
  font-size: 12px;
}

.btn-cancel-reply {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
}

.btn-cancel-reply:hover { color: #fff; }

.composer-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 6px 12px;
}

.tool-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-btn:hover {
  background: var(--surface-3);
  color: #fff;
}

.tool-divider {
  width: 1px;
  height: 16px;
  background: var(--border);
  margin: 0 4px;
}

.composer-form {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 0 8px 8px;
  padding: 8px 12px;
  gap: 12px;
  align-items: flex-end;
}

#message-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  resize: none;
  outline: none;
  max-height: 140px;
}

.btn-send {
  background: linear-gradient(135deg, #00c2ff 0%, #0078d4 100%);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 16px;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 0 10px rgba(0, 194, 255, 0.3);
  transition: all 0.2s;
}

.btn-send:hover {
  box-shadow: 0 0 16px rgba(0, 194, 255, 0.6);
  transform: translateY(-1px);
}

/* 8. TAB PANELS (FILES, TASKS, ABOUT, LEAVES) */
.files-panel-wrapper, .tasks-panel-wrapper, .about-panel-wrapper {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.files-panel-header, .tasks-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.file-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
}

.file-box:hover {
  border-color: #00c2ff;
  transform: translateY(-2px);
}

.file-box img {
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.file-info {
  padding: 10px;
}

.file-title {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  font-size: 10.5px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Tasks list */
.tasks-list-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-item-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* About Card */
.about-card {
  max-width: 600px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}

.about-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12.5px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Leaves Panel */
.leaves-panel {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.leaves-wrapper {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.leave-form-card, .leave-history-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.quota-pill {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid #a855f7;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

.field span {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 5px;
}

.inp {
  width: 100%;
  height: 34px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: #fff;
  padding: 0 10px;
  font-family: inherit;
  font-size: 12.5px;
}

.inp:focus {
  outline: none;
  border-color: #00c2ff;
}

.btn-primary {
  background: linear-gradient(135deg, #00c2ff 0%, #0078d4 100%);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
}

.btn-secondary {
  background: var(--surface-2);
  color: #fff;
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary.sm { padding: 4px 10px; font-size: 11.5px; }

.btn-primary.full { width: 100%; }
.btn-secondary.full { width: 100%; }

.mt { margin-top: 12px; }
.mt-s { margin-top: 6px; }

/* Leaves table */
.tbl-wrap {
  overflow-x: auto;
}

.leaves-table {
  width: 100%;
  border-collapse: collapse;
}

.leaves-table th, .leaves-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}

.leaves-table th {
  color: var(--text-dim);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 11px;
}

.badge-status {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

.badge-status.approved { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-status.pending { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

/* 9. MODALS */
.modal-backdrop, .lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-box {
  width: 90%;
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.modal-head {
  padding: 14px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-head h3 { font-size: 14px; font-weight: 800; color: #fff; }

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
}

.modal-body {
  padding: 18px;
}

.modal-foot {
  padding: 12px 18px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Meet Modal Banner */
.meet-hero-banner {
  background: linear-gradient(135deg, rgba(91, 95, 199, 0.3) 0%, rgba(0, 194, 255, 0.2) 100%);
  border: 1px solid rgba(91, 95, 199, 0.4);
  padding: 14px;
  border-radius: 8px;
}

.meet-hero-title { font-weight: 800; font-size: 14px; color: #fff; }
.meet-hero-sub { font-size: 12px; color: #cbd5e1; margin-top: 4px; }

.link-row {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.btn-copy {
  padding: 0 12px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: #fff;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}

/* Sample Attachment Grid */
.samples-row {
  display: flex;
  gap: 10px;
}

.sample-thumb {
  width: 90px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
}

.sample-thumb:hover {
  border-color: #00c2ff;
}

/* Lightbox */
.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

#lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.8);
}

.lightbox-close {
  position: absolute;
  top: -36px;
  right: 0;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

.lightbox-caption {
  color: #fff;
  text-align: center;
  margin-top: 10px;
  font-weight: 700;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
}

.toast {
  background: #1e293b;
  color: #fff;
  border: 1px solid #334155;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  animation: slideIn 0.2s ease-out;
}

.toast.info { border-left: 4px solid #00c2ff; }
.toast.success { border-left: 4px solid #10b981; }

@keyframes slideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* ======================================================
   ADVANCED TEAMS & 3D STUDIO EXTENSIONS
   ====================================================== */

/* 1. PINNED MESSAGES BANNER */
.pinned-bar {
  background: linear-gradient(90deg, rgba(0, 194, 255, 0.12) 0%, rgba(91, 95, 199, 0.08) 100%);
  border-bottom: 1px solid rgba(0, 194, 255, 0.3);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
}

.pinned-left {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  flex: 1;
}

.pinned-badge-icon {
  font-size: 14px;
}

.pinned-title {
  color: var(--cyan);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.pinned-preview {
  color: #f1f5f9;
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pinned-meta {
  color: var(--text-dim);
  font-size: 11px;
  flex-shrink: 0;
}

.pinned-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-pinned-action {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-pinned-action:hover {
  background: var(--cyan);
  color: #000;
  border-color: var(--cyan);
}

.btn-pinned-action.danger:hover {
  background: var(--rose);
  color: #fff;
  border-color: var(--rose);
}

.pinned-tag {
  background: rgba(0, 194, 255, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(0, 194, 255, 0.4);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
}

.edited-tag {
  color: var(--text-dim);
  font-size: 10.5px;
  font-style: italic;
  margin-left: 6px;
}

/* 2. INTERACTIVE POLL CARD */
.poll-card {
  background: linear-gradient(145deg, #0d1527 0%, #0a0f1d 100%);
  border: 1px solid rgba(0, 194, 255, 0.25);
  border-radius: 10px;
  padding: 16px;
  margin-top: 10px;
  max-width: 580px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.poll-header {
  margin-bottom: 12px;
}

.poll-badge {
  display: inline-block;
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
}

.poll-question {
  color: #fff;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 4px;
}

.poll-meta {
  color: var(--text-muted);
  font-size: 11.5px;
}

.poll-options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.poll-opt-btn {
  position: relative;
  background: #131c31;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 14px;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.poll-opt-btn:hover {
  border-color: var(--cyan);
  transform: translateY(-1px);
}

.poll-opt-btn.voted {
  border-color: #00c2ff;
  background: #0f223f;
  box-shadow: 0 0 10px rgba(0, 194, 255, 0.15);
}

.poll-opt-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  background: linear-gradient(90deg, rgba(0, 194, 255, 0.18) 0%, rgba(91, 95, 199, 0.22) 100%);
  pointer-events: none;
  transition: width 0.4s ease;
  z-index: 1;
}

.poll-opt-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.poll-opt-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: transparent;
  flex-shrink: 0;
}

.poll-opt-btn.voted .poll-opt-check {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #000;
  font-weight: 800;
}

.poll-opt-text {
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 500;
}

.poll-opt-pct {
  position: relative;
  z-index: 2;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--mono);
  margin-left: 12px;
}

.poll-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-dim);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 8px;
}

.voted-tag {
  color: var(--emerald);
  font-weight: 600;
}

/* 3. RENDER 3D BEFORE / AFTER DUAL SLIDER */
.render-compare-container {
  background: #000;
  border: 1px solid rgba(0, 194, 255, 0.3);
  border-radius: 10px;
  overflow: hidden;
  max-width: 620px;
  margin-top: 10px;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.5);
}

.compare-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  user-select: none;
}

.compare-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.compare-overlay {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  overflow: hidden;
  z-index: 3;
}

.compare-overlay .compare-img {
  width: 620px;
  max-width: none;
}

.compare-badge {
  position: absolute;
  top: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  z-index: 5;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.before-badge {
  left: 12px;
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.5);
}

.after-badge {
  right: 12px;
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.5);
}

.compare-slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  z-index: 10;
  margin: 0;
}

.compare-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #00c2ff;
  pointer-events: none;
  z-index: 6;
  transform: translateX(-50%);
  box-shadow: 0 0 10px rgba(0, 194, 255, 0.8);
}

.compare-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  background: #00c2ff;
  color: #050b14;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 13px;
  box-shadow: 0 0 16px rgba(0, 194, 255, 0.9);
}

.compare-footer {
  background: #0b111e;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-compare-zoom {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-compare-zoom:hover {
  background: var(--cyan);
  color: #000;
  border-color: var(--cyan);
}

/* 4. SEARCH DROPDOWN RESULTS PANEL */
.global-search-wrap {
  position: relative;
}

.search-dropdown-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  min-width: 480px;
  max-width: 600px;
  max-height: 450px;
  background: #0c1220;
  border: 1px solid var(--border-focus);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  overflow-y: auto;
  z-index: 150;
  backdrop-filter: blur(12px);
}

.search-results-list {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.search-section-title {
  color: var(--text-dim);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 8px 2px;
}

.search-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.search-item:hover {
  background: rgba(0, 194, 255, 0.1);
}

.search-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.search-item-sender {
  color: #38bdf8;
  font-weight: 700;
  font-size: 12.5px;
}

.search-item-chan {
  color: var(--text-dim);
  font-size: 11px;
}

.search-item-text {
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-highlight {
  background: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 700;
}

/* 5. MODAL FORM GRIDS & ACTIONS */
.modal-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.compare-inputs-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cmp-box-col {
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-link-action {
  background: none;
  border: none;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  text-decoration: underline;
}

.btn-link-action:hover {
  color: #7dd3fc;
}

.poll-option-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #cbd5e1;
  cursor: pointer;
}

.checkbox-label input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Flash Highlight when jumping to message */
@keyframes flashHighlight {
  0% { background: rgba(0, 194, 255, 0.35); box-shadow: 0 0 20px rgba(0, 194, 255, 0.5); }
  100% { background: transparent; box-shadow: none; }
}

.flash-highlight {
  animation: flashHighlight 2s ease-out;
}

