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

:root, [data-theme="dark"] {
  --teams-purple: #5059C9;
  --teams-purple-dark: #464EB8;
  --teams-bg: #242424;
  --teams-sidebar: #1E1E1E;
  --teams-panel: #2D2D2D;
  --teams-hover: #3D3D3D;
  --teams-border: #3B3B3B;
  --teams-text: #FFFFFF;
  --teams-text-secondary: #ADADAD;
  --teams-green: #6BB700;
  --teams-red: #C4314B;
  --teams-chat-bg: #1E1E1E;
}

[data-theme="light"] {
  --teams-purple: #5059C9;
  --teams-purple-dark: #464EB8;
  --teams-bg: #F5F5F5;
  --teams-sidebar: #E8E8E8;
  --teams-panel: #FFFFFF;
  --teams-hover: #E0E0E0;
  --teams-border: #D1D1D1;
  --teams-text: #242424;
  --teams-text-secondary: #616161;
  --teams-green: #107C10;
  --teams-red: #C4314B;
  --teams-chat-bg: #FFFFFF;
}

[data-theme="contrast"] {
  --teams-purple: #7B83EB;
  --teams-purple-dark: #6B71D8;
  --teams-bg: #000000;
  --teams-sidebar: #0A0A0A;
  --teams-panel: #1A1A1A;
  --teams-hover: #2A2A2A;
  --teams-border: #FFFFFF;
  --teams-text: #FFFFFF;
  --teams-text-secondary: #E0E0E0;
  --teams-green: #00FF00;
  --teams-red: #FF4444;
  --teams-chat-bg: #0A0A0A;
}

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--teams-bg);
  color: var(--teams-text);
  height: 100vh;
  overflow: hidden;
  transition: background 0.3s, color 0.3s;
}

body.font-small { font-size: 13px; }
body.font-medium { font-size: 15px; }
body.font-large { font-size: 17px; }

body.density-compact .chat-item,
body.density-compact .file-row,
body.density-compact .call-item { padding: 6px 10px; }

body.density-wide .chat-item,
body.density-wide .file-row,
body.density-wide .call-item { padding: 14px 12px; }

body.reduce-motion * { animation: none !important; transition: none !important; }

.app { display: flex; height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: 68px;
  background: var(--teams-sidebar);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-right: 1px solid var(--teams-border);
  z-index: 10;
}

.sidebar-top { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.app-logo { margin-bottom: 16px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }

.nav-btn {
  width: 48px; height: 48px; border: none; background: transparent;
  color: var(--teams-text-secondary); border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.nav-btn:hover { background: var(--teams-hover); color: var(--teams-text); }
.nav-btn.active { background: var(--teams-purple); color: white; }

.sidebar-bottom { display: flex; flex-direction: column; align-items: center; gap: 4px; }

.user-avatar-small {
  width: 40px; height: 40px; border-radius: 50%; background: var(--teams-purple);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; cursor: pointer;
}

/* ===== MAIN ===== */
.main-content { flex: 1; display: flex; overflow: hidden; }
.view { display: flex; flex: 1; overflow: hidden; }

/* ===== PANEL SHARED ===== */
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 8px;
}
.panel-header h2 { font-size: 18px; font-weight: 600; }

.icon-btn {
  width: 36px; height: 36px; border: none; background: transparent;
  color: var(--teams-text-secondary); border-radius: 4px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.icon-btn:hover { background: var(--teams-hover); color: var(--teams-text); }

.search-box { padding: 8px 16px; }
.search-box input {
  width: 100%; padding: 8px 12px; background: var(--teams-bg);
  border: 1px solid var(--teams-border); border-radius: 4px;
  color: var(--teams-text); font-size: 14px; outline: none;
}
.search-box input:focus { border-color: var(--teams-purple); }
.search-box input::placeholder { color: var(--teams-text-secondary); }

/* ===== BUTTONS SHARED ===== */
.btn-primary {
  padding: 6px 16px; background: var(--teams-purple); color: white;
  border: none; border-radius: 4px; font-size: 13px; cursor: pointer; font-weight: 500;
}
.btn-primary:hover { background: var(--teams-purple-dark); }

.btn-secondary {
  padding: 6px 16px; background: var(--teams-hover); color: var(--teams-text);
  border: none; border-radius: 4px; font-size: 13px; cursor: pointer;
}
.btn-secondary:hover { background: var(--teams-border); }

.empty-state {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 16px; color: var(--teams-text-secondary);
}

/* ===== INPUT SHARED ===== */
.input-wrapper {
  display: flex; align-items: flex-end; gap: 8px; background: var(--teams-bg);
  border: 1px solid var(--teams-border); border-radius: 4px; padding: 8px;
}
.input-wrapper textarea {
  flex: 1; background: transparent; border: none; color: var(--teams-text);
  font-size: 14px; resize: none; outline: none; font-family: inherit; max-height: 100px;
}
.input-wrapper textarea::placeholder { color: var(--teams-text-secondary); }

.send-btn {
  width: 36px; height: 36px; border: none; background: transparent;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
}
.send-btn:hover { background: var(--teams-hover); }

/* ===== CHAT VIEW ===== */
.chat-list-panel {
  width: 320px; background: var(--teams-panel);
  border-right: 1px solid var(--teams-border); display: flex; flex-direction: column;
}

.chat-list { flex: 1; overflow-y: auto; padding: 4px 8px; }

.chat-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: 4px; cursor: pointer; transition: background 0.15s;
}
.chat-item:hover { background: var(--teams-hover); }
.chat-item.active { background: var(--teams-purple); }

.chat-item-avatar {
  width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 14px; font-weight: 600; flex-shrink: 0;
  position: relative;
}
.chat-item-avatar .online-dot {
  position: absolute; bottom: 0; right: 0; width: 12px; height: 12px;
  border-radius: 50%; border: 2px solid var(--teams-panel);
}
.online-dot.online { background: var(--teams-green); }
.online-dot.away { background: #FFAA44; }
.online-dot.offline { background: var(--teams-text-secondary); }

.chat-item-info { flex: 1; min-width: 0; }
.chat-item-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item-preview { font-size: 12px; color: var(--teams-text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.chat-item-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.chat-item-time { font-size: 11px; color: var(--teams-text-secondary); }
.unread-badge { width: 20px; height: 20px; border-radius: 50%; background: var(--teams-purple); color: white; font-size: 11px; display: flex; align-items: center; justify-content: center; font-weight: 600; }

.chat-area { flex: 1; display: flex; flex-direction: column; background: var(--teams-chat-bg); position: relative; }
.chat-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--teams-border); min-height: 52px; }
.chat-header-info { display: flex; align-items: center; gap: 12px; }
.contact-avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.chat-header-info h3 { font-size: 16px; font-weight: 600; }
.status-text { font-size: 12px; color: var(--teams-text-secondary); }
.chat-header-actions { display: flex; gap: 4px; }

.messages-container { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; }
.message { display: flex; gap: 8px; margin-bottom: 8px; padding: 4px 0; }
.message-avatar { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0; margin-top: 2px; }
.message-content { flex: 1; }
.message-header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.message-sender { font-size: 14px; font-weight: 600; }
.message-time { font-size: 11px; color: var(--teams-text-secondary); }
.message-text { font-size: 14px; line-height: 1.4; color: var(--teams-text); }
.message-user { flex-direction: row-reverse; }
.message-user .message-content { align-items: flex-end; }
.message-user .message-header { flex-direction: row-reverse; }
.message-edited { font-size: 10px; color: var(--teams-text-secondary); margin-left: 6px; font-style: italic; }
.message-reactions { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.message-reaction { font-size: 12px; padding: 2px 6px; background: var(--teams-bg); border: 1px solid var(--teams-border); border-radius: 12px; cursor: pointer; transition: background 0.15s; }
.message-reaction:hover { background: var(--teams-hover); }

.message-actions { display: none; gap: 2px; margin-top: 4px; }
.message:hover .message-actions { display: flex; }
.msg-action-btn { width: 28px; height: 28px; border: none; background: var(--teams-bg); border: 1px solid var(--teams-border); color: var(--teams-text-secondary); border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 14px; transition: all 0.15s; }
.msg-action-btn:hover { background: var(--teams-hover); color: var(--teams-text); border-color: var(--teams-purple); }
.message-date-divider { text-align: center; padding: 8px 0; font-size: 12px; color: var(--teams-text-secondary); }

/* Typing Indicator */
.typing-indicator { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.typing-bubble { display: flex; gap: 3px; align-items: center; background: var(--teams-hover); padding: 8px 12px; border-radius: 16px; }
.typing-dot { width: 6px; height: 6px; background: var(--teams-text-secondary); border-radius: 50%; animation: typingBounce 1.4s ease-in-out infinite; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-4px); opacity: 1; } }
.typing-text { font-size: 12px; color: var(--teams-text-secondary); font-style: italic; }

/* Reply Indicator */
.reply-indicator { padding: 0 16px; }
.reply-indicator-content { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--teams-bg); border: 1px solid var(--teams-border); border-left: 3px solid var(--teams-purple); border-radius: 4px; }
.reply-indicator-line { display: none; }
.reply-indicator-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.reply-indicator-sender { font-size: 11px; font-weight: 600; color: var(--teams-purple); }
.reply-indicator-text { font-size: 12px; color: var(--teams-text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reply-indicator-close { width: 24px; height: 24px; border: none; background: transparent; color: var(--teams-text-secondary); cursor: pointer; border-radius: 4px; display: flex; align-items: center; justify-content: center; }
.reply-indicator-close:hover { background: var(--teams-hover); color: var(--teams-text); }

.message-input-area { border-top: 1px solid var(--teams-border); padding: 0 16px 16px; }

/* ===== TEAMS VIEW ===== */
.teams-sidebar-panel { width: 280px; background: var(--teams-panel); border-right: 1px solid var(--teams-border); display: flex; flex-direction: column; }
.teams-search-box { padding: 8px 16px; }
.teams-search-box input { width: 100%; padding: 8px 12px; background: var(--teams-bg); border: 1px solid var(--teams-border); border-radius: 4px; color: var(--teams-text); font-size: 14px; outline: none; }
.teams-search-box input::placeholder { color: var(--teams-text-secondary); }

.teams-list { flex: 1; overflow-y: auto; padding: 4px 8px; }
.team-item { padding: 10px 12px; border-radius: 4px; cursor: pointer; transition: background 0.15s; display: flex; align-items: center; gap: 10px; }
.team-item:hover { background: var(--teams-hover); }
.team-item.active { background: var(--teams-purple); }
.team-icon { width: 36px; height: 36px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; color: white; flex-shrink: 0; }
.team-item-info { flex: 1; min-width: 0; }
.team-item-name { font-size: 14px; font-weight: 600; }
.team-item-desc { font-size: 12px; color: var(--teams-text-secondary); }

.teams-detail { flex: 1; display: flex; flex-direction: column; background: var(--teams-chat-bg); }
.teams-detail-header { padding: 12px 16px; border-bottom: 1px solid var(--teams-border); }
.teams-detail-header h2 { font-size: 16px; font-weight: 600; }
.teams-channel-count { font-size: 12px; color: var(--teams-text-secondary); }

.teams-channels { display: flex; gap: 4px; padding: 8px 16px; border-bottom: 1px solid var(--teams-border); overflow-x: auto; flex-shrink: 0; }
.channel-tab { padding: 6px 12px; border: none; background: transparent; color: var(--teams-text-secondary); border-radius: 4px; cursor: pointer; font-size: 13px; white-space: nowrap; }
.channel-tab:hover { background: var(--teams-hover); }
.channel-tab.active { background: var(--teams-purple); color: white; }

.teams-messages-container { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; }
.teams-input-area { border-top: 1px solid var(--teams-border); padding: 0 16px 16px; }

/* ===== CALENDAR VIEW ===== */
.calendar-sidebar { width: 300px; background: var(--teams-panel); border-right: 1px solid var(--teams-border); display: flex; flex-direction: column; overflow-y: auto; }
.mini-calendar { padding: 8px 16px; }
.mini-cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mini-cal-header h4 { font-size: 14px; font-weight: 600; }
.mini-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.mini-cal-day { font-size: 11px; padding: 4px; border-radius: 50%; cursor: pointer; }
.mini-cal-day:hover { background: var(--teams-hover); }
.mini-cal-day.today { background: var(--teams-purple); color: white; }
.mini-cal-day.other { color: var(--teams-text-secondary); opacity: 0.5; }
.mini-cal-day-header { font-size: 10px; color: var(--teams-text-secondary); padding: 4px; font-weight: 600; }

.my-day-section, .upcoming-section { padding: 12px 16px; border-top: 1px solid var(--teams-border); }
.my-day-section h4, .upcoming-section h4 { font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--teams-text-secondary); }
.my-day-content { display: flex; flex-direction: column; gap: 6px; }
.my-day-empty { font-size: 12px; color: var(--teams-text-secondary); }

.upcoming-events { display: flex; flex-direction: column; gap: 6px; }
.upcoming-event { padding: 8px; background: var(--teams-bg); border-radius: 4px; border-left: 3px solid var(--teams-purple); }
.upcoming-event-title { font-size: 13px; font-weight: 500; }
.upcoming-event-time { font-size: 11px; color: var(--teams-text-secondary); margin-top: 2px; }

.calendar-main { flex: 1; display: flex; flex-direction: column; background: var(--teams-chat-bg); }
.calendar-toolbar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--teams-border); flex-shrink: 0; }
.calendar-toolbar h2 { font-size: 16px; font-weight: 600; min-width: 200px; }
.calendar-view-toggle { display: flex; gap: 2px; margin-left: 8px; }
.cal-view-btn { padding: 4px 12px; border: none; background: transparent; color: var(--teams-text-secondary); border-radius: 4px; cursor: pointer; font-size: 12px; }
.cal-view-btn:hover { background: var(--teams-hover); }
.cal-view-btn.active { background: var(--teams-purple); color: white; }

/* Grid mensual */
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); padding: 8px 8px 4px; flex-shrink: 0; }
.cal-weekdays span { font-size: 11px; font-weight: 600; color: var(--teams-text-secondary); text-align: center; }
.cal-month-grid { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: 1fr; gap: 4px; padding: 0 8px 8px; min-height: 0; }
.cal-day {
  background: var(--teams-panel); border: 1px solid var(--teams-border); border-radius: 6px;
  padding: 4px; display: flex; flex-direction: column; gap: 3px; overflow: hidden; cursor: pointer;
  transition: border-color .15s;
}
.cal-day:hover { border-color: var(--teams-purple); }
.cal-day.other { opacity: 0.45; }
.cal-day-num { font-size: 12px; font-weight: 600; align-self: flex-end; }
.cal-day.today .cal-day-num {
  background: var(--teams-purple); color: #fff; border-radius: 50%;
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
}
.cal-event-pill {
  font-size: 11px; padding: 2px 6px; border-radius: 4px; background: var(--teams-purple); color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.cal-event-pill:hover { background: var(--teams-purple-dark); }
.cal-event-more { font-size: 10px; color: var(--teams-text-secondary); padding-left: 4px; }

/* Agenda */
.cal-agenda { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 6px; }
.cal-agenda-day-label { font-size: 12px; font-weight: 600; color: var(--teams-text-secondary); margin-top: 12px; }
.cal-agenda-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--teams-panel);
  border: 1px solid var(--teams-border); border-left: 3px solid var(--teams-purple); border-radius: 6px; cursor: pointer;
}
.cal-agenda-item:hover { border-color: var(--teams-purple); }
.cal-agenda-time { font-size: 12px; color: var(--teams-text-secondary); min-width: 96px; }
.cal-agenda-info { flex: 1; min-width: 0; }
.cal-agenda-title { font-size: 14px; font-weight: 600; }
.cal-agenda-meta { font-size: 12px; color: var(--teams-text-secondary); margin-top: 2px; }
.cal-agenda-empty { text-align: center; color: var(--teams-text-secondary); font-size: 13px; padding: 40px 16px; }

/* Modal de reunión: fila de fecha/hora y botones */
.form-row { display: flex; gap: 10px; }
.form-row .form-group { flex: 1; }
.event-organizer { font-size: 12px; color: var(--teams-text-secondary); }
.btn-danger { padding: 6px 16px; background: var(--teams-red); color: #fff; border: none; border-radius: 4px; font-size: 13px; cursor: pointer; font-weight: 500; }
.btn-danger:hover { filter: brightness(1.1); }
.btn-join { padding: 6px 16px; background: var(--teams-green); color: #fff; border: none; border-radius: 4px; font-size: 13px; cursor: pointer; font-weight: 600; }
.btn-join:hover { filter: brightness(1.1); }

/* Miembros de grupo */
.rename-row { display: flex; gap: 8px; }
.rename-row input { flex: 1; }
.members-list { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; }
.member-row:hover { background: var(--teams-hover); }
.member-avatar { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: #fff; flex-shrink: 0; }
.member-info { flex: 1; min-width: 0; }
.member-name { font-size: 14px; font-weight: 600; }
.member-handle { font-size: 12px; color: var(--teams-text-secondary); }
.member-you { font-size: 11px; color: var(--teams-purple); font-weight: 600; }
.member-remove { border: none; background: transparent; color: var(--teams-text-secondary); cursor: pointer; width: 28px; height: 28px; border-radius: 4px; font-size: 18px; line-height: 1; }
.member-remove:hover:not(:disabled) { background: var(--teams-red); color: #fff; }
.member-remove:disabled { opacity: 0.3; cursor: default; }

/* Login de dos pasos (correo → código) */
.login-code-sent { font-size: 13px; color: var(--teams-text-secondary); margin-bottom: 14px; text-align: center; }
.login-code-sent strong { color: var(--teams-text); }
.login-code-input { text-align: center; font-size: 26px; letter-spacing: 10px; font-weight: 600; padding-left: 10px; }
.login-demo {
  background: rgba(255, 209, 102, 0.14); border: 1px solid #ffd166; border-radius: 6px;
  padding: 8px 10px; font-size: 12px; color: var(--teams-text); margin-bottom: 12px; text-align: center;
}
.login-links { display: flex; justify-content: space-between; margin-top: 12px; }
.login-link { background: none; border: none; color: var(--teams-purple); font-size: 12px; cursor: pointer; padding: 0; }
.login-link:hover { text-decoration: underline; }

.calendar-grid { flex: 1; overflow-y: auto; padding: 8px; }
.cal-day-header { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; margin-bottom: 4px; }
.cal-day-header span { text-align: center; font-size: 12px; color: var(--teams-text-secondary); padding: 8px 0; font-weight: 600; }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.cal-day { min-height: 100px; background: var(--teams-panel); padding: 4px 8px; border: 1px solid var(--teams-border); cursor: pointer; }
.cal-day:hover { border-color: var(--teams-purple); }
.cal-day.today { border-color: var(--teams-purple); background: rgba(80,89,201,0.1); }
.cal-day.other-month { opacity: 0.4; }
.cal-day-num { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.cal-day.today .cal-day-num { color: var(--teams-purple); background: var(--teams-purple); color: white; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.cal-event { font-size: 10px; padding: 2px 6px; border-radius: 2px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; color: white; }

.cal-month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.cal-month-day { min-height: 80px; background: var(--teams-panel); padding: 4px 8px; border: 1px solid var(--teams-border); cursor: pointer; }
.cal-month-day:hover { border-color: var(--teams-purple); }
.cal-month-day.today { background: rgba(80,89,201,0.1); border-color: var(--teams-purple); }
.cal-month-day.other-month { opacity: 0.4; }
.cal-month-day .cal-day-num { font-size: 11px; }

/* ===== CALLS VIEW ===== */
.calls-sidebar { width: 320px; background: var(--teams-panel); border-right: 1px solid var(--teams-border); display: flex; flex-direction: column; }

.group-call-section { padding: 12px 16px; border-bottom: 1px solid var(--teams-border); }
.group-call-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; background: var(--teams-purple); color: white; border: none;
  border-radius: 6px; font-size: 14px; font-weight: 500; cursor: pointer;
  transition: background 0.15s; margin-bottom: 10px;
}
.group-call-btn:hover { background: var(--teams-purple-dark); }

.group-call-teams { display: flex; flex-direction: column; gap: 4px; }
.group-call-team {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border-radius: 4px; cursor: pointer; transition: background 0.15s;
}
.group-call-team:hover { background: var(--teams-hover); }
.group-call-team-icon { width: 28px; height: 28px; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: white; flex-shrink: 0; }
.group-call-team-name { font-size: 13px; flex: 1; }
.group-call-team-count { font-size: 11px; color: var(--teams-text-secondary); }
.group-call-team-btn {
  width: 28px; height: 28px; border: none; background: transparent; color: var(--teams-text-secondary);
  border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.15s, background 0.15s;
}
.group-call-team:hover .group-call-team-btn { opacity: 1; }
.group-call-team-btn:hover { background: var(--teams-purple); color: white; }

.calls-tabs { display: flex; gap: 0; padding: 0 16px; border-bottom: 1px solid var(--teams-border); }
.calls-tab { flex: 1; padding: 10px; border: none; background: transparent; color: var(--teams-text-secondary); cursor: pointer; font-size: 13px; font-weight: 500; border-bottom: 2px solid transparent; }
.calls-tab:hover { color: var(--teams-text); }
.calls-tab.active { color: var(--teams-purple); border-bottom-color: var(--teams-purple); }

.calls-list { flex: 1; overflow-y: auto; padding: 4px 8px; }
.call-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 4px; cursor: pointer; transition: background 0.15s; }
.call-item:hover { background: var(--teams-hover); }
.call-avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.call-info { flex: 1; }
.call-name { font-size: 14px; font-weight: 500; }
.call-detail { font-size: 12px; color: var(--teams-text-secondary); margin-top: 2px; }
.call-actions { display: flex; gap: 4px; }
.call-action-btn { width: 32px; height: 32px; border: none; background: transparent; color: var(--teams-text-secondary); border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.call-action-btn:hover { background: var(--teams-hover); color: var(--teams-text); }
.call-action-btn.video-call:hover { color: var(--teams-green); }
.call-action-btn.audio-call:hover { color: var(--teams-green); }

.calls-detail { flex: 1; display: flex; flex-direction: column; background: var(--teams-chat-bg); }

/* ===== FILES VIEW ===== */
.files-sidebar { width: 240px; background: var(--teams-panel); border-right: 1px solid var(--teams-border); display: flex; flex-direction: column; }
.files-nav { padding: 4px 8px; display: flex; flex-direction: column; gap: 2px; }
.files-nav-btn { padding: 8px 12px; border: none; background: transparent; color: var(--teams-text-secondary); border-radius: 4px; cursor: pointer; text-align: left; font-size: 13px; transition: background 0.15s; }
.files-nav-btn:hover { background: var(--teams-hover); color: var(--teams-text); }
.files-nav-btn.active { background: rgba(80,89,201,0.15); color: var(--teams-purple); }

.files-main { flex: 1; display: flex; flex-direction: column; background: var(--teams-chat-bg); }
.files-toolbar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--teams-border); flex-shrink: 0; }
.files-breadcrumb { display: flex; align-items: center; gap: 4px; padding: 8px 16px; font-size: 13px; color: var(--teams-text-secondary); border-bottom: 1px solid var(--teams-border); flex-shrink: 0; }
.files-breadcrumb span { cursor: pointer; }
.files-breadcrumb span:hover { color: var(--teams-text); text-decoration: underline; }
.files-breadcrumb .bc-sep { cursor: default; opacity: 0.5; }
.files-breadcrumb .bc-current { color: var(--teams-text); font-weight: 600; }

.files-grid { flex: 1; overflow-y: auto; padding: 16px; }
.files-grid-header { display: grid; grid-template-columns: 1fr 120px 150px 100px; padding: 8px 12px; font-size: 12px; color: var(--teams-text-secondary); border-bottom: 1px solid var(--teams-border); font-weight: 600; }
.file-row { display: grid; grid-template-columns: 1fr 120px 150px 100px; padding: 8px 12px; border-radius: 4px; cursor: pointer; align-items: center; font-size: 13px; transition: background 0.15s; }
.file-row:hover { background: var(--teams-hover); }
.file-name { display: flex; align-items: center; gap: 8px; }
.file-icon { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; }
.folder-icon { color: #FFB900; }
.doc-icon { color: #185ABD; }
.sheet-icon { color: #107C10; }
.ppt-icon { color: #D24726; }
.img-icon { color: #0078D4; }
.file-size, .file-date, .file-owner { font-size: 12px; color: var(--teams-text-secondary); }

/* ===== SETTINGS VIEW ===== */
.settings-sidebar { width: 260px; background: var(--teams-panel); border-right: 1px solid var(--teams-border); display: flex; flex-direction: column; }
.settings-nav { padding: 4px 8px; display: flex; flex-direction: column; gap: 2px; }
.settings-nav-btn { padding: 8px 12px; border: none; background: transparent; color: var(--teams-text-secondary); border-radius: 4px; cursor: pointer; text-align: left; font-size: 13px; transition: background 0.15s; }
.settings-nav-btn:hover { background: var(--teams-hover); color: var(--teams-text); }
.settings-nav-btn.active { background: rgba(80,89,201,0.15); color: var(--teams-purple); }

.settings-main { flex: 1; overflow-y: auto; padding: 24px 32px; background: var(--teams-chat-bg); }
.settings-section { margin-bottom: 32px; }
.settings-section h3 { font-size: 18px; font-weight: 600; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--teams-border); }
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.settings-row-label { display: flex; flex-direction: column; gap: 2px; }
.settings-row-label span { font-size: 14px; }
.settings-row-label small { font-size: 12px; color: var(--teams-text-secondary); }

.toggle { width: 44px; height: 24px; background: #555; border-radius: 12px; cursor: pointer; position: relative; transition: background 0.2s; }
.toggle.on { background: var(--teams-purple); }
.toggle::after { content: ''; position: absolute; width: 18px; height: 18px; background: white; border-radius: 50%; top: 3px; left: 3px; transition: transform 0.2s; }
.toggle.on::after { transform: translateX(20px); }

.settings-select { padding: 6px 12px; background: var(--teams-bg); border: 1px solid var(--teams-border); border-radius: 4px; color: var(--teams-text); font-size: 13px; outline: none; }
.settings-select:focus { border-color: var(--teams-purple); }

.settings-profile { display: flex; align-items: center; gap: 16px; padding: 16px; background: var(--teams-panel); border-radius: 8px; margin-bottom: 16px; }
.settings-avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--teams-purple); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; }
.settings-profile-info h2 { font-size: 20px; font-weight: 600; }
.settings-profile-info p { font-size: 13px; color: var(--teams-text-secondary); }

/* ===== MEETING OVERLAY ===== */
.meeting-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--teams-bg); z-index: 1000; display: flex; flex-direction: column;
}
.meeting-header { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; background: var(--teams-panel); min-height: 48px; }
.meeting-title { display: flex; align-items: center; gap: 16px; }
.meeting-title span:first-child { font-size: 14px; font-weight: 600; }
.meeting-time { font-size: 13px; color: var(--teams-text-secondary); }
.meeting-rec { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--teams-red); font-weight: 500; }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teams-red); animation: recBlink 1s infinite; }
@keyframes recBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.meeting-header-actions { display: flex; gap: 4px; }

.icon-btn-light {
  width: 32px; height: 32px; border: none; background: transparent; color: var(--teams-text);
  border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.icon-btn-light:hover { background: rgba(255,255,255,0.1); }
.close-meeting:hover { background: var(--teams-red) !important; }

.meeting-body { flex: 1; display: flex; overflow: hidden; }

/* Video Grid */
.meeting-grid-container {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 16px; overflow: hidden;
}

.meeting-grid {
  display: grid;
  gap: 8px;
  width: 100%;
  height: 100%;
  max-width: 1400px;
}

.meeting-grid.grid-1 { grid-template-columns: 1fr; }
.meeting-grid.grid-2 { grid-template-columns: 1fr 1fr; }
.meeting-grid.grid-3 { grid-template-columns: repeat(3, 1fr); }
.meeting-grid.grid-4 { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(2, 1fr); }
.meeting-grid.grid-5,
.meeting-grid.grid-6 { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); }
.meeting-grid.grid-7,
.meeting-grid.grid-8,
.meeting-grid.grid-9 { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); }

/* Participant Tile */
.participant-tile {
  position: relative;
  background: var(--teams-panel);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  border: 2px solid transparent;
  transition: border-color 0.3s;
}

.participant-tile.speaking {
  border-color: var(--teams-green);
  box-shadow: 0 0 12px rgba(107, 183, 0, 0.2);
}

.participant-tile.pinned {
  border-color: var(--teams-purple);
}

.tile-video-off {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 100%;
}

.tile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 600;
  color: white;
}

.tile-video-sim {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #2D2D2D 0%, #3D3D3D 50%, #4D4D4D 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.tile-video-sim::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  opacity: 0.3;
}

.tile-name-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  z-index: 2;
}

.tile-name {
  font-size: 13px;
  font-weight: 500;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 6px;
}

.tile-you-badge {
  font-size: 10px;
  background: rgba(255,255,255,0.2);
  padding: 1px 5px;
  border-radius: 3px;
}

.tile-mic-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
}

.tile-mic-icon svg { width: 14px; height: 14px; }
.tile-mic-icon.muted svg { fill: var(--teams-red); }
.tile-mic-icon.unmuted svg { fill: var(--teams-green); }

.tile-speaking-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 2px;
  align-items: flex-end;
  height: 16px;
  z-index: 2;
}

.speak-bar {
  width: 3px;
  background: var(--teams-green);
  border-radius: 1px;
  animation: speakAnim 0.6s ease-in-out infinite alternate;
}
.speak-bar:nth-child(1) { animation-delay: 0s; height: 6px; }
.speak-bar:nth-child(2) { animation-delay: 0.15s; height: 12px; }
.speak-bar:nth-child(3) { animation-delay: 0.3s; height: 8px; }
.speak-bar:nth-child(4) { animation-delay: 0.1s; height: 14px; }

@keyframes speakAnim {
  0% { transform: scaleY(0.4); }
  100% { transform: scaleY(1); }
}

.tile-pin-btn {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(0,0,0,0.5);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 0.15s;
}

.participant-tile:hover .tile-pin-btn { display: flex; }
.tile-pin-btn:hover { background: rgba(80,89,201,0.8); }
.tile-pin-btn svg { width: 14px; height: 14px; }

/* Side Panel */
.meeting-side-panel {
  width: 340px;
  background: var(--teams-panel);
  border-left: 1px solid var(--teams-border);
  display: flex;
  flex-direction: column;
}

.meeting-panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--teams-border);
}

.meeting-panel-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--teams-text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
}

.meeting-panel-tab:hover { color: var(--teams-text); }
.meeting-panel-tab.active { color: var(--teams-purple); border-bottom-color: var(--teams-purple); }

.meeting-panel-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.meeting-messages { flex: 1; overflow-y: auto; padding: 12px; }

.meeting-panel-people { flex: 1; overflow-y: auto; padding: 12px; display: none; }

.people-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 4px;
}
.people-list-item:hover { background: var(--teams-hover); }
.people-list-avatar { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: white; flex-shrink: 0; }
.people-list-info { flex: 1; }
.people-list-name { font-size: 13px; font-weight: 500; }
.people-list-role { font-size: 11px; color: var(--teams-text-secondary); }
.people-list-mic { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; }

.meeting-message { margin-bottom: 12px; }
.meeting-message-header { display: flex; align-items: baseline; gap: 6px; margin-bottom: 2px; }
.meeting-message-sender { font-size: 13px; font-weight: 600; }
.meeting-message-time { font-size: 11px; color: var(--teams-text-secondary); }
.meeting-message-text { font-size: 13px; line-height: 1.4; }

.meeting-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--teams-border); }
.meeting-input input { flex: 1; padding: 8px 12px; background: var(--teams-bg); border: 1px solid var(--teams-border); border-radius: 4px; color: var(--teams-text); font-size: 13px; outline: none; }
.meeting-input input:focus { border-color: var(--teams-purple); }
.meeting-input input::placeholder { color: var(--teams-text-secondary); }

/* Meeting Controls */
.meeting-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--teams-panel);
  border-top: 1px solid var(--teams-border);
}

.meeting-controls-left, .meeting-controls-right {
  flex: 1;
  display: flex;
  align-items: center;
}

.meeting-controls-right { justify-content: flex-end; }

.meeting-controls-center {
  display: flex;
  align-items: center;
  gap: 4px;
}

.meeting-controls-info { font-size: 12px; color: var(--teams-text-secondary); }

.control-separator {
  width: 1px;
  height: 32px;
  background: var(--teams-border);
  margin: 0 4px;
}

.control-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--teams-text);
  border-radius: 4px;
  cursor: pointer;
  min-width: 56px;
  transition: background 0.15s;
}
.control-btn:hover { background: rgba(255,255,255,0.1); }
.control-btn span { font-size: 10px; }
.control-btn.muted svg { color: var(--teams-red); }
.control-btn.active-share { background: rgba(80,89,201,0.3); }

.control-btn.end-call {
  background: var(--teams-red);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  padding: 0;
  flex-direction: row;
  gap: 0;
  min-width: auto;
}
.control-btn.end-call span { display: none; }
.control-btn.end-call:hover { background: #E0405B; }

/* ===== MODAL ===== */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.6); z-index: 2000; display: flex; align-items: center; justify-content: center; }
.modal { background: var(--teams-panel); border-radius: 8px; width: 480px; max-height: 80vh; overflow-y: auto; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--teams-border); }
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-body { padding: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--teams-border); }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; color: var(--teams-text-secondary); }
.form-group input, .form-group textarea { width: 100%; padding: 8px 12px; background: var(--teams-bg); border: 1px solid var(--teams-border); border-radius: 4px; color: var(--teams-text); font-size: 14px; outline: none; font-family: inherit; }
.form-group input:focus, .form-group textarea:focus { border-color: var(--teams-purple); }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* ===== NOTES VIEW ===== */
.notes-sidebar {
  width: 300px; background: var(--teams-panel);
  border-right: 1px solid var(--teams-border);
  display: flex; flex-direction: column;
}
.notes-search-box { padding: 8px 16px; }
.notes-search-box input {
  width: 100%; padding: 8px 12px; background: var(--teams-bg);
  border: 1px solid var(--teams-border); border-radius: 4px;
  color: var(--teams-text); font-size: 14px; outline: none;
}
.notes-search-box input::placeholder { color: var(--teams-text-secondary); }
.notes-list { flex: 1; overflow-y: auto; padding: 4px 8px; }
.note-item {
  padding: 10px 12px; border-radius: 4px; cursor: pointer;
  transition: background 0.15s; margin-bottom: 2px;
}
.note-item:hover { background: var(--teams-hover); }
.note-item.active { background: var(--teams-purple); }
.note-item-title { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.note-item-preview { font-size: 12px; color: var(--teams-text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-item-time { font-size: 11px; color: var(--teams-text-secondary); margin-top: 4px; }
.note-item.active .note-item-title, .note-item.active .note-item-preview, .note-item.active .note-item-time { color: white; }

.notes-main { flex: 1; display: flex; flex-direction: column; background: var(--teams-chat-bg); position: relative; }
.notes-toolbar {
  display: flex; align-items: center; gap: 8px; padding: 8px 16px;
  border-bottom: 1px solid var(--teams-border); flex-shrink: 0;
}
.notes-toolbar-left { flex: 0 0 auto; }
.notes-toolbar-center { flex: 1; display: flex; gap: 2px; align-items: center; }
.notes-toolbar-right { flex: 0 0 auto; display: flex; gap: 4px; }
.note-title-input {
  background: transparent; border: none; color: var(--teams-text);
  font-size: 16px; font-weight: 600; outline: none; width: 220px;
}
.note-title-input::placeholder { color: var(--teams-text-secondary); }
.notes-tool-btn {
  width: 30px; height: 30px; border: none; background: transparent;
  color: var(--teams-text-secondary); border-radius: 4px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; transition: all 0.15s;
}
.notes-tool-btn:hover { background: var(--teams-hover); color: var(--teams-text); }
.notes-tool-btn.active { background: var(--teams-purple); color: white; }
.notes-tool-sep { width: 1px; height: 20px; background: var(--teams-border); margin: 0 4px; }

.notes-empty-state {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; color: var(--teams-text-secondary);
}

.notes-editor-area { flex: 1; overflow-y: auto; }
.notes-editor {
  flex: 1; padding: 24px 32px; overflow-y: auto;
  font-size: 15px; line-height: 1.6; color: var(--teams-text);
  outline: none; min-height: 400px;
}
.notes-editor:empty::before {
  content: 'Escribe tu nota aqui...';
  color: var(--teams-text-secondary);
}
.notes-editor h2 { font-size: 20px; font-weight: 600; margin: 16px 0 8px; }
.notes-editor blockquote {
  border-left: 3px solid var(--teams-purple); padding-left: 12px;
  margin: 8px 0; color: var(--teams-text-secondary); font-style: italic;
}

/* ===== WHITEBOARD ===== */
.whiteboard-canvas-wrap { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
#whiteboardCanvas {
  flex: 1; background: white; cursor: crosshair; touch-action: none;
}
.whiteboard-tools {
  display: flex; align-items: center; gap: 8px; padding: 8px 16px;
  background: var(--teams-panel); border-top: 1px solid var(--teams-border);
}
.whiteboard-tool-btn {
  padding: 5px 12px; border: 1px solid var(--teams-border);
  background: transparent; color: var(--teams-text);
  border-radius: 4px; cursor: pointer; font-size: 12px;
}
.whiteboard-tool-btn:hover { background: var(--teams-hover); }
.whiteboard-tool-btn.active { background: var(--teams-purple); color: white; border-color: var(--teams-purple); }
.whiteboard-tools input[type="color"] { width: 32px; height: 32px; border: none; cursor: pointer; }
.whiteboard-tools input[type="range"] { width: 100px; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #555; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #777; }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--teams-panel);
  color: var(--teams-text);
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  border: 1px solid var(--teams-border);
  z-index: 5000;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== NAV BADGE ===== */
.nav-btn-icon-wrap { position: relative; }
.nav-badge {
  position: absolute; top: -2px; right: -4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--teams-red); color: white;
  border-radius: 8px; font-size: 10px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}

/* ===== ACTIVITY VIEW ===== */
.activity-sidebar {
  width: 380px; background: var(--teams-panel);
  border-right: 1px solid var(--teams-border);
  display: flex; flex-direction: column;
}
.activity-filters { display: flex; gap: 4px; padding: 8px 16px; border-bottom: 1px solid var(--teams-border); overflow-x: auto; }
.activity-filter {
  padding: 5px 12px; border: none; background: transparent;
  color: var(--teams-text-secondary); border-radius: 16px;
  cursor: pointer; font-size: 12px; white-space: nowrap;
  transition: all 0.15s;
}
.activity-filter:hover { background: var(--teams-hover); color: var(--teams-text); }
.activity-filter.active { background: var(--teams-purple); color: white; }

.activity-list { flex: 1; overflow-y: auto; padding: 4px 8px; }
.activity-item {
  display: flex; gap: 12px; padding: 12px;
  border-radius: 6px; cursor: pointer; transition: background 0.15s;
  border-left: 3px solid transparent;
}
.activity-item:hover { background: var(--teams-hover); }
.activity-item.active { background: rgba(80,89,201,0.15); border-left-color: var(--teams-purple); }
.activity-item.unread { background: rgba(80,89,201,0.08); }
.activity-item.unread .activity-item-title { font-weight: 600; }

.activity-item-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: white; flex-shrink: 0;
  position: relative;
}
.activity-item-avatar .activity-type-icon {
  position: absolute; bottom: -2px; right: -2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--teams-panel); border: 1px solid var(--teams-border);
  display: flex; align-items: center; justify-content: center;
}
.activity-item-avatar .activity-type-icon svg { width: 10px; height: 10px; }

.activity-item-body { flex: 1; min-width: 0; }
.activity-item-title { font-size: 13px; color: var(--teams-text); line-height: 1.3; }
.activity-item-title strong { font-weight: 600; }
.activity-item-text { font-size: 12px; color: var(--teams-text-secondary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-item-time { font-size: 11px; color: var(--teams-text-secondary); margin-top: 4px; }

.activity-item-actions { display: flex; gap: 4px; margin-top: 6px; }
.activity-action-btn {
  padding: 3px 10px; border: 1px solid var(--teams-border);
  background: transparent; color: var(--teams-text-secondary);
  border-radius: 4px; font-size: 11px; cursor: pointer;
  transition: all 0.15s;
}
.activity-action-btn:hover { background: var(--teams-hover); color: var(--teams-text); border-color: var(--teams-purple); }
.activity-action-btn.primary { background: var(--teams-purple); color: white; border-color: var(--teams-purple); }
.activity-action-btn.primary:hover { background: var(--teams-purple-dark); }

.activity-detail { flex: 1; display: flex; flex-direction: column; background: var(--teams-chat-bg); }

/* ===== EMOJI PICKER ===== */
.emoji-picker {
  position: absolute; bottom: 50px; left: 0; width: 340px; background: var(--teams-panel);
  border: 1px solid var(--teams-border); border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 100; overflow: hidden;
}
.emoji-picker-tabs {
  display: flex; overflow-x: auto; border-bottom: 1px solid var(--teams-border);
  scrollbar-width: none;
}
.emoji-picker-tabs::-webkit-scrollbar { display: none; }
.emoji-tab {
  padding: 8px 12px; border: none; background: transparent; color: var(--teams-text-secondary);
  cursor: pointer; font-size: 11px; white-space: nowrap; border-bottom: 2px solid transparent;
}
.emoji-tab:hover { color: var(--teams-text); }
.emoji-tab.active { color: var(--teams-purple); border-bottom-color: var(--teams-purple); }
.emoji-picker-grid {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 8px;
  max-height: 200px; overflow-y: auto;
}
.emoji-btn {
  width: 100%; aspect-ratio: 1; border: none; background: transparent; font-size: 20px;
  cursor: pointer; border-radius: 4px; display: flex; align-items: center; justify-content: center;
}
.emoji-btn:hover { background: var(--teams-hover); transform: scale(1.2); }

/* ===== CONTEXT MENU ===== */
.ctx-menu {
  position: absolute; background: var(--teams-panel); border: 1px solid var(--teams-border);
  border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,0.4); z-index: 3000;
  min-width: 180px; padding: 4px; overflow: hidden;
}
.ctx-item {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 12px;
  border: none; background: transparent; color: var(--teams-text); font-size: 13px;
  cursor: pointer; border-radius: 4px; text-align: left;
}
.ctx-item:hover { background: var(--teams-hover); }
.ctx-item svg { flex-shrink: 0; }
.ctx-separator { height: 1px; background: var(--teams-border); margin: 4px 0; }
.ctx-profile-header {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  font-size: 13px;
}
.ctx-profile-avatar {
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 14px; font-weight: 600; color: white; flex-shrink: 0;
}

/* ===== THREAD PANEL ===== */
.thread-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 380px; background: var(--teams-panel);
  border-left: 1px solid var(--teams-border);
  display: flex; flex-direction: column; z-index: 20;
  box-shadow: -4px 0 16px rgba(0,0,0,0.2);
}
.thread-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--teams-border);
}
.thread-header h3 { font-size: 15px; font-weight: 600; }
.thread-original {
  padding: 12px 16px; border-bottom: 1px solid var(--teams-border);
  background: var(--teams-bg);
}
.thread-replies {
  flex: 1; overflow-y: auto; padding: 12px 16px;
}
.thread-reply {
  display: flex; gap: 8px; margin-bottom: 12px; padding: 8px 0;
}
.thread-reply .message-avatar { width: 28px; height: 28px; font-size: 11px; }
.thread-reply .message-sender { font-size: 13px; }
.thread-reply .message-time { font-size: 10px; }
.thread-reply .message-text { font-size: 13px; }
.thread-count {
  font-size: 12px; color: var(--teams-purple);
  cursor: pointer; padding: 2px 8px; margin-top: 4px;
  display: inline-flex; align-items: center; gap: 4px;
}
.thread-count:hover { text-decoration: underline; }
.thread-input { border-top: 1px solid var(--teams-border); padding: 12px; }

/* ===== DRAG & DROP ===== */
.chat-area.drag-over {
  position: relative;
}
.chat-area.drag-over::after {
  content: 'Suelta el archivo aqui';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(80,89,201,0.15); border: 2px dashed var(--teams-purple);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 600; color: var(--teams-purple); z-index: 50;
  border-radius: 4px; pointer-events: none;
}

/* ===== GLOBAL SEARCH ===== */
.search-modal {
  width: 640px; max-height: 80vh;
  background: var(--teams-panel); border-radius: 12px;
  display: flex; flex-direction: column;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  overflow: hidden;
}
.search-modal-header { padding: 16px 16px 0; }
.search-modal-input-wrap {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; background: var(--teams-bg);
  border: 1px solid var(--teams-border); border-radius: 8px;
}
.search-modal-input-wrap:focus-within { border-color: var(--teams-purple); }
.search-modal-input-wrap input {
  flex: 1; background: transparent; border: none;
  color: var(--teams-text); font-size: 16px; outline: none;
}
.search-modal-input-wrap input::placeholder { color: var(--teams-text-secondary); }
.search-shortcut {
  font-size: 11px; color: var(--teams-text-secondary);
  padding: 2px 6px; border: 1px solid var(--teams-border);
  border-radius: 4px; background: var(--teams-panel);
}

.search-modal-filters { display: flex; gap: 4px; padding: 12px 16px; overflow-x: auto; }
.search-filter {
  padding: 5px 14px; border: none; background: transparent;
  color: var(--teams-text-secondary); border-radius: 16px;
  cursor: pointer; font-size: 12px; white-space: nowrap;
  transition: all 0.15s;
}
.search-filter:hover { background: var(--teams-hover); color: var(--teams-text); }
.search-filter.active { background: var(--teams-purple); color: white; }

.search-modal-results { flex: 1; overflow-y: auto; padding: 8px; max-height: 400px; }
.search-empty { padding: 32px; text-align: center; color: var(--teams-text-secondary); font-size: 14px; }
.search-result-item {
  display: flex; gap: 12px; padding: 10px 12px;
  border-radius: 6px; cursor: pointer; transition: background 0.15s;
}
.search-result-item:hover { background: var(--teams-hover); }
.search-result-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: white; flex-shrink: 0;
}
.search-result-icon.type-team { border-radius: 6px; }
.search-result-body { flex: 1; min-width: 0; }
.search-result-title { font-size: 13px; font-weight: 500; }
.search-result-text { font-size: 12px; color: var(--teams-text-secondary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-meta { font-size: 11px; color: var(--teams-text-secondary); margin-top: 4px; }
.search-result-highlight { background: rgba(80,89,201,0.3); border-radius: 2px; padding: 0 2px; }
.search-section-header {
  padding: 8px 12px; font-size: 12px; font-weight: 600;
  color: var(--teams-text-secondary); text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== SCROLLBAR (custom) ===== */
.emoji-picker-grid::-webkit-scrollbar { width: 4px; }
.emoji-picker-grid::-webkit-scrollbar-thumb { background: #555; border-radius: 2px; }

/* ============================================================= */
/* ===== ChatProMax — extensiones del cliente web real ========= */
/* ============================================================= */

/* ---- Pantalla de login ---- */
.login-overlay {
  position: fixed; inset: 0; z-index: 4000;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 30% 20%, #2b2f6b 0%, var(--teams-bg) 55%);
}
.login-card {
  width: 380px; max-width: calc(100vw - 32px);
  background: var(--teams-panel); border: 1px solid var(--teams-border);
  border-radius: 14px; padding: 32px 28px; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: loginIn 0.35s ease;
}
@keyframes loginIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.login-brand .login-logo {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
  background: var(--teams-purple); display: flex; align-items: center; justify-content: center;
}
.login-brand h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; }
.login-brand .pro { color: var(--teams-purple); }
.login-sub { font-size: 13px; color: var(--teams-text-secondary); margin: 0 0 22px 2px; }
.login-field { margin-bottom: 14px; }
.login-field label { display: block; font-size: 12px; font-weight: 600; color: var(--teams-text-secondary); margin-bottom: 5px; }
.login-field input {
  width: 100%; padding: 11px 13px; background: var(--teams-bg);
  border: 1px solid var(--teams-border); border-radius: 7px;
  color: var(--teams-text); font-size: 14px; outline: none; font-family: inherit;
}
.login-field input:focus { border-color: var(--teams-purple); }
.login-btn {
  width: 100%; margin-top: 8px; padding: 12px; border: none; border-radius: 7px;
  background: var(--teams-purple); color: white; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: background 0.15s;
}
.login-btn:hover { background: var(--teams-purple-dark); }
.login-btn:disabled { opacity: 0.6; cursor: progress; }
.login-error { color: var(--teams-red); font-size: 12px; margin-top: 10px; min-height: 16px; }
.login-hint { font-size: 11px; color: var(--teams-text-secondary); margin-top: 16px; text-align: center; line-height: 1.5; }

/* ---- Barra de estado de conexión ---- */
.conn-banner {
  position: fixed; top: 0; left: 68px; right: 0; z-index: 1500;
  padding: 6px 16px; font-size: 12px; font-weight: 500; text-align: center;
  color: white; transform: translateY(-100%); transition: transform 0.25s;
}
.conn-banner.show { transform: none; }
.conn-banner.reconnecting { background: #B7791F; }
.conn-banner.disconnected { background: var(--teams-red); }
.conn-banner.connected { background: var(--teams-green); }

/* ---- Ticks de estado de mensaje (✓ / ✓✓ / leído) ---- */
.msg-status { font-size: 11px; margin-left: 6px; color: var(--teams-text-secondary); }
.msg-status.read { color: var(--teams-purple); font-weight: 600; }

/* ---- Avatar del usuario actual en la barra ---- */
.user-avatar-small { overflow: hidden; }

/* ---- Estado vacío de módulos por venir ---- */
.soon-state {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 14px; color: var(--teams-text-secondary); text-align: center; padding: 24px;
}
.soon-state .soon-badge {
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--teams-purple); background: rgba(80,89,201,0.15);
  padding: 4px 10px; border-radius: 12px;
}
.soon-state h3 { font-size: 18px; font-weight: 600; color: var(--teams-text); }
.soon-state p { font-size: 13px; max-width: 360px; line-height: 1.5; }

/* ---- Selección de usuario en "nuevo chat" ---- */
.user-pick-list { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow-y: auto; margin-top: 6px; }
.user-pick {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: 6px; cursor: pointer; border: 1px solid transparent;
}
.user-pick:hover { background: var(--teams-hover); }
.user-pick.selected { background: rgba(80,89,201,0.18); border-color: var(--teams-purple); }
.user-pick-avatar { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: white; flex-shrink: 0; position: relative; }
.user-pick-info { flex: 1; min-width: 0; }
.user-pick-name { font-size: 14px; font-weight: 500; }
.user-pick-handle { font-size: 12px; color: var(--teams-text-secondary); }
.user-pick-check { color: var(--teams-purple); opacity: 0; }
.user-pick.selected .user-pick-check { opacity: 1; }

/* ---- Avatar con punto de estado ---- */
.user-avatar-wrap { position: relative; width: 40px; height: 40px; cursor: pointer; }
.user-status-dot {
  position: absolute; bottom: -1px; right: -1px; width: 13px; height: 13px;
  border-radius: 50%; border: 2px solid var(--teams-sidebar); background: var(--teams-text-secondary);
}
.user-status-dot.online { background: var(--teams-green); }
.user-status-dot.busy   { background: var(--teams-red); }
.user-status-dot.away   { background: #FFAA44; }
.user-status-dot.offline{ background: var(--teams-text-secondary); }

/* ---- Menú de estado (anclado abajo-izquierda, sobre el avatar) ---- */
#statusMenu { position: fixed; bottom: 60px; left: 14px; width: 220px; }
.status-swatch { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.status-swatch.online { background: var(--teams-green); }
.status-swatch.busy   { background: var(--teams-red); }
.status-swatch.away   { background: #FFAA44; }

/* ---- Puntos de presencia adicionales (ocupado) en listas ---- */
.online-dot.busy { background: var(--teams-red); }

/* ---- Cabecera de canal ---- */
.channel-tab .channel-hash { opacity: 0.6; margin-right: 2px; }

/* =====================================================================
   Llamadas WebRTC (overlay + modal de entrante)
   ===================================================================== */
.call-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: #1c1c28;
  display: flex;
  flex-direction: column;
}

.call-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  color: #fff;
  background: rgba(0, 0, 0, 0.25);
}
.call-topbar-info { display: flex; flex-direction: column; gap: 2px; }
.call-peer-name { font-size: 16px; font-weight: 600; }
.call-status { font-size: 12px; color: #c9c9d4; }
.call-timer { font-size: 14px; font-variant-numeric: tabular-nums; color: #e6e6ef; }

.call-stage {
  position: relative;
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 40%, #2a2a3d 0%, #16161f 100%);
}

.call-remote-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

/* Escenario de solo audio */
.call-audio-stage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #fff;
}
.call-audio-avatar {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 46px;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.06);
  animation: callPulse 2.4s ease-in-out infinite;
}
.call-audio-name { font-size: 22px; font-weight: 600; }
.call-audio-sub { font-size: 13px; color: #b9b9c8; }

/* Picture-in-picture local */
.call-local-wrap {
  position: absolute;
  right: 20px;
  bottom: 20px;
  width: 210px;
  height: 140px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #000;
}
.call-local-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* espejo, como en Teams */
}
.call-local-camoff {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 600;
  color: #fff;
}

/* Controles */
.call-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.25);
}
.call-ctrl-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  transition: background 0.15s, transform 0.1s;
}
.call-ctrl-btn:hover { background: rgba(255, 255, 255, 0.24); }
.call-ctrl-btn:active { transform: scale(0.94); }
.call-ctrl-btn.off { background: var(--teams-red); }
.call-ctrl-btn.active { background: var(--teams-purple); }
.call-ctrl-btn.hangup { background: var(--teams-red); }
.call-ctrl-btn.hangup:hover { background: #a62840; }

/* Modal de llamada entrante */
.incoming-call-card {
  background: var(--teams-panel);
  border: 1px solid var(--teams-border);
  border-radius: 16px;
  padding: 30px 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  min-width: 280px;
}
.incoming-avatar {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 600;
  color: #fff;
  animation: callPulse 1.6s ease-in-out infinite;
}
.incoming-name { font-size: 19px; font-weight: 600; color: var(--teams-text); }
.incoming-text { font-size: 13px; color: var(--teams-text-secondary); margin-bottom: 8px; }
.incoming-actions { display: flex; gap: 40px; }
.incoming-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: transform 0.1s, filter 0.15s;
}
.incoming-btn:active { transform: scale(0.94); }
.incoming-btn.accept { background: var(--teams-green); }
.incoming-btn.reject { background: var(--teams-red); }
.incoming-btn.accept svg { animation: callShake 1.2s ease-in-out infinite; }

@keyframes callPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(80, 89, 201, 0.45); }
  50%      { box-shadow: 0 0 0 14px rgba(80, 89, 201, 0); }
}
@keyframes callShake {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-12deg); }
  75% { transform: rotate(12deg); }
}

/* =====================================================================
   Detallitos "en vivo" (webinar): reacciones, emojis flotantes,
   aplausómetro, confeti y selector de emojis.
   ===================================================================== */

/* Capa de efectos: no bloquea clics */
#fx { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 2500; }
.float-emoji {
  position: absolute; bottom: 90px; will-change: transform, opacity;
  animation: floatUp var(--dur, 3s) ease-out forwards;
}
@keyframes floatUp {
  0%   { transform: translate(0, 0) scale(.6); opacity: 0; }
  15%  { opacity: 1; }
  100% { transform: translate(var(--dx, 0), -85vh) scale(1.3); opacity: 0; }
}
.confetti {
  position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px;
  will-change: transform; animation: confettiFall var(--dur, 2.5s) linear forwards;
}
@keyframes confettiFall {
  0%   { transform: translateY(-12px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(105vh) rotate(var(--rot, 720deg)); opacity: 1; }
}

/* Aplausómetro flotante (aparece con las reacciones) */
.applause-meter {
  position: fixed; top: 68px; left: 50%; transform: translateX(-50%);
  z-index: 2600; display: flex; align-items: center; gap: 8px;
  background: var(--teams-panel); border: 1px solid var(--teams-border);
  border-radius: 999px; padding: 6px 12px; box-shadow: 0 6px 20px rgba(0,0,0,.28);
}
.applause-label { font-size: 18px; line-height: 1; }
.applause-track { width: 140px; height: 10px; border-radius: 6px; background: var(--teams-hover); overflow: hidden; }
.applause-fill { height: 100%; width: 0%; border-radius: 6px; background: linear-gradient(90deg, #ffd166, #ff6b6b); transition: width .15s linear; }

/* Barra de reacciones rápidas */
.reaction-bar { display: flex; gap: 6px; padding: 8px 0 0; }
.reaction-bar button {
  font-size: 20px; line-height: 1; padding: 4px 12px; border: 1px solid var(--teams-border);
  border-radius: 999px; background: var(--teams-bg); cursor: pointer; transition: transform .08s ease;
}
.reaction-bar button:hover { transform: scale(1.18); }
.reaction-bar button:active { transform: scale(.85); }

/* Botón y panel de emojis (nombre propio para no chocar con .emoji-btn del picker muerto) */
.input-emoji-btn {
  border: none; background: transparent; font-size: 20px; cursor: pointer;
  line-height: 1; padding: 0 6px; align-self: center; flex: 0 0 auto;
}
.input-emoji-btn:hover { filter: brightness(1.2); }
.emoji-panel {
  position: fixed; z-index: 2700; display: none; grid-template-columns: repeat(8, 1fr); gap: 2px;
  background: var(--teams-panel); border: 1px solid var(--teams-border); border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,.35); padding: 8px; width: 300px; max-height: 220px; overflow-y: auto;
}
.emoji-panel.open { display: grid; }
.emoji-panel button { border: none; background: none; font-size: 20px; padding: 4px; border-radius: 6px; cursor: pointer; }
.emoji-panel button:hover { background: var(--teams-hover); }

/* Contador de usuarios en línea */
.online-count { font-size: 12px; font-weight: 500; color: var(--teams-green); }

/* =====================================================================
   Responsive — celular / tablet
   El rail lateral se vuelve barra inferior; los dos paneles (lista+detalle)
   pasan a una sola columna con navegación "lista → conversación → atrás".
   ===================================================================== */

/* Los botones "atrás" sólo existen en móvil */
.mobile-back { display: none; }

@media (max-width: 768px) {
  /* Alto real del viewport móvil (evita saltos con la barra del navegador) */
  body { height: 100vh; height: 100dvh; }
  .app { flex-direction: column; height: 100vh; height: 100dvh; }

  /* ----- Rail lateral → barra de navegación inferior ----- */
  .sidebar {
    order: 2;
    width: 100%;
    height: 58px;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    padding: 0 6px;
    border-right: none;
    border-top: 1px solid var(--teams-border);
    flex-shrink: 0;
  }
  .app-logo { display: none; }
  .sidebar-top { flex-direction: row; align-items: center; gap: 2px; }
  .sidebar-nav { flex-direction: row; gap: 2px; }
  .sidebar-bottom { flex-direction: row; align-items: center; gap: 2px; }
  .nav-btn { width: 44px; height: 44px; }
  .user-avatar-small { width: 36px; height: 36px; }

  .main-content { order: 1; flex: 1; min-height: 0; }

  /* ----- Dos paneles → una sola columna ----- */
  .chat-list-panel,
  .teams-sidebar-panel {
    width: 100%;
    border-right: none;
  }
  .chat-area,
  .teams-detail { display: none; }

  #view-chat.chat-open .chat-list-panel { display: none; }
  #view-chat.chat-open .chat-area { display: flex; }
  #view-teams.team-open .teams-sidebar-panel { display: none; }
  #view-teams.team-open .teams-detail { display: flex; }

  /* Botón de volver visible y header de equipos en fila */
  .mobile-back { display: flex; margin-left: -6px; }
  .teams-detail-header { display: flex; align-items: center; gap: 8px; }

  /* ----- Densidad y toque ----- */
  .messages-container,
  .teams-messages-container { padding: 12px; }
  .panel-header { padding: 14px 14px 8px; }
  .chat-header { padding: 10px 12px; }

  /* Inputs a 16px: evita el zoom automático de iOS al enfocar */
  .search-box input,
  .teams-search-box input,
  .input-wrapper textarea,
  .modal-body input,
  .login-field input { font-size: 16px; }

  /* ----- Modales y login a ancho de pantalla ----- */
  .modal-overlay { padding: 12px; }
  .modal { width: 100%; max-width: 480px; max-height: 88vh; }
  .login-card { width: 92%; max-width: 400px; }

  /* ----- Overlay de llamada ----- */
  .call-topbar { padding: 12px 16px; }
  .call-local-wrap { width: 104px; height: 148px; right: 12px; bottom: 12px; }
  .call-controls { gap: 12px; padding: 16px; }
  .call-ctrl-btn { width: 48px; height: 48px; }
  .call-audio-avatar { width: 104px; height: 104px; font-size: 38px; }
  .incoming-actions { gap: 28px; }
}

/* Ajuste fino para teléfonos estrechos */
@media (max-width: 380px) {
  .sidebar { height: 54px; }
  .nav-btn { width: 40px; height: 40px; }
  .chat-item-avatar { width: 38px; height: 38px; }
}
