
.avatar { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 11.5px; color: #fff; flex-shrink: 0; user-select: none; }
.avatar-sm { width: 25px; height: 25px; flex: 0 0 25px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 10.5px; color: #fff; flex-shrink: 0; user-select: none; }

/* Workspace */
.workspace { flex: 1; min-height: 0; display: flex; overflow: hidden; position: relative; }
.view-section { display: none; width: 100%; height: 100%; overflow: hidden; }
.view-section.active { display: flex; }

/* Left Sidebar */
.sidebar {
  width: 248px;
  background: var(--bg-subtle);
  border-right: 1px solid var(--border);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-shrink: 0;
  overflow-y: auto;
}
#view-calendar > .sidebar { width: 272px; }
.btn-compose {
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 5px rgba(2, 132, 199, 0.25);
}
.btn-compose:hover { background: var(--primary-hover); }

.nav-group-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  padding: 0 8px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-main); }
.nav-item.active { background: var(--nav-active-bg); color: var(--nav-active-text); font-weight: 600; }
.nav-item-left { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--border-strong);
  color: var(--text-main);
}
.nav-item.active .nav-badge { background: var(--primary); color: #fff; }
.label-dot, .tag-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* Verification Icons (Compact with Tooltip) */
.verif-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  cursor: help;
  flex-shrink: 0;
  background: var(--emerald-soft);
  color: var(--emerald);
}
.verif-verified { background: var(--emerald-soft); color: var(--emerald); }
.verif-unverified { background: var(--amber-soft); color: var(--amber); }
.verif-spoofed { background: var(--rose-soft); color: var(--rose); }

/* Middle Thread List */
.thread-list-pane {
  width: 480px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100%;
  overflow: hidden;
}
.pane-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pane-title-row, .pane-header-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pane-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.filter-pills { display: flex; gap: 5px; align-items: center; flex-wrap: nowrap; }
.filter-pill {
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.filter-pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.thread-items, .thread-list { flex: 1; overflow-y: auto; overflow-x: hidden; }
.thread-group-container { display: flex; flex-direction: column; }
.thread-children {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}
.thread-row {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  user-select: none;
  overflow: visible;
  position: relative;
}
.thread-row:hover,
.thread-row:focus-within {
  z-index: 30;
}
.thread-child-row {
  margin-left: 14px;
  border-left: 2px solid var(--primary);
  padding: 8px 12px 8px 10px;
  background: var(--bg-surface);
  font-size: 12px;
}
.thread-row:hover { background: var(--bg-subtle); }
.thread-row.selected { background: var(--bg-selected); box-shadow: inset 3px 0 0 var(--primary); }
.thread-row.unread .thread-sender, .thread-row.unread .thread-subject { font-weight: 700; color: var(--text-main); }
.unread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); display: inline-block; flex-shrink: 0; }
.thread-row-body { flex: 1; min-width: 0; }
.thread-top, .thread-row-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 1px; width: 100%; min-width: 0; }
.thread-sender-wrap { display: flex; align-items: center; gap: 5px; min-width: 0; }
.thread-sender {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}
.thread-sender-name, .thread-sender > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.thread-sender input[type="checkbox"] { opacity: 1; width: 14px; height: 14px; margin: 0; cursor: pointer; flex-shrink: 0; pointer-events: auto; }
.thread-meta { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.thread-date { font-size: 12px; color: var(--text-muted); flex-shrink: 0; white-space: nowrap; }
.thread-subject { font-size: 13.5px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; overflow: hidden; text-overflow: ellipsis; line-height: 1.35; margin-bottom: 2px; color: var(--text-main); }
.thread-snippet { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; }
.thread-badges { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.badge, .tag-pill {
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.badge-tag { background: var(--primary-soft); color: var(--primary); }
.badge-pgp { background: var(--emerald-soft); color: var(--emerald); }
.badge-whitelist { background: var(--purple-soft); color: var(--purple); }
.tag-Urgente { background: var(--rose-soft); color: var(--rose); }
.tag-Presupuesto { background: var(--emerald-soft); color: var(--emerald); }
.tag-Jurídico { background: var(--purple-soft); color: var(--purple); }
.tag-Acuerdos, .tag-Oficio, .tag-Sobera { background: var(--primary-soft); color: var(--primary); }
.tag-Operación { background: var(--amber-soft); color: var(--amber); }

/* Reading Pane */
.reading-pane { flex: 1; background: var(--bg-app); display: flex; flex-direction: column; height: 100%; overflow: hidden; min-width: 0; }
.reading-toolbar {
  background: var(--bg-surface);
  padding: 9px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: relative;
}

/* Account User Dropdown Menu */
.account-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1050;
  background: transparent;
}
.account-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1060;
  min-width: 220px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.account-menu-header {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.account-menu-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-menu-email {
  font-size: 11.5px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 1px;
}
.account-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}
.account-menu-item:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}
.account-menu-item.logout { color: #ef4444; }
.account-menu-item.logout:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}
.account-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}
