/**
 * Envelark Webmail Client Stylesheet
 * 4-column desktop layout (Sidebar, Message List, Reading Pane, Intelligence Rail)
 * + Global macOS Topbar & Mobile responsiveness.
 */

/* ==========================================================================
   Envelark Warm Editorial Custom Scrollbars (Linen & Forest Green Palette)
   ========================================================================== */
html, body, * {
  scrollbar-width: thin;
  scrollbar-color: rgba(21, 46, 34, 0.22) transparent;
}

button, input, select, textarea {
  font-family: inherit;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(21, 46, 34, 0.18);
  border-radius: 999px;
  transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--brand-accent, #9c4d30);
}

::-webkit-scrollbar-thumb:active {
  background: var(--brand-primary, #152E22);
}

::-webkit-scrollbar-corner {
  background: transparent;
}

/* ==========================================================================
   Root Layout & Containers
   ========================================================================== */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

body.app-layout {
  height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
}

.app-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  background-color: var(--brand-background, #FAF7F2);
  position: relative;
  font-family: var(--font-body, 'Plus Jakarta Sans', system-ui, sans-serif);
  color: var(--brand-text, #2D3748);
}

.app-workspace-body {
  display: flex;
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  position: relative;
}

.app-workspace-body > main {
  flex: 1 1 0%;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

/* ==========================================================================
   Global macOS-Style Topbar
   ========================================================================== */
.app-global-topbar {
  height: 52px;
  background: #FAF7F2;
  border-bottom: 1px solid var(--brand-border, #E2D9CC);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  flex-shrink: 0;
  z-index: 200;
  user-select: none;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-shrink: 0;
}

.mac-window-dots {
  display: flex;
  align-items: center;
  gap: 7px;
}

.mac-window-dots .dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
  cursor: pointer;
  transition: opacity var(--transition-fast, 0.15s ease);
}

.mac-window-dots .dot:hover {
  opacity: 0.8;
}

.dot-close {
  background-color: #ED6A5E;
}

.dot-minimize {
  background-color: #F4BF4F;
}

.dot-maximize {
  background-color: #61C554;
}

.topbar-brand-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  text-decoration: none;
}

.topbar-brand-img {
  height: 28px;
  width: auto;
}

.mobile-menu-trigger {
  display: none;
  background: none;
  border: none;
  color: var(--brand-primary, #152E22);
  cursor: pointer;
  padding: 10px;
  min-width: 44px;
  min-height: 44px;
}

.mobile-menu-trigger .icon {
  width: 22px;
  height: 22px;
}

.topbar-center {
  flex: 1;
  max-width: 540px;
  margin: 0 1.5rem;
}

.topbar-search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.topbar-search-box input {
  width: 100%;
  height: 34px;
  padding: 0 2.8rem 0 2.25rem;
  background: #FFFFFF;
  border: 1px solid var(--brand-border, #E2D9CC);
  border-radius: 9999px;
  font-size: 0.84rem;
  font-family: inherit;
  color: var(--brand-text, #2D3748);
  outline: none;
  transition: border-color var(--transition-fast, 0.15s), box-shadow var(--transition-fast, 0.15s);
}

.topbar-search-box input:focus {
  border-color: var(--brand-primary, #152E22);
  box-shadow: 0 0 0 2px rgba(21, 46, 34, 0.1);
}

.topbar-search-box input::placeholder {
  color: var(--brand-muted, #555C56);
  font-size: 0.82rem;
}

.topbar-search-box .search-icon-pos {
  position: absolute;
  left: 0.8rem;
  width: 15px;
  height: 15px;
  color: var(--brand-muted, #555C56);
  pointer-events: none;
}

.topbar-kbd-chip {
  position: absolute;
  right: 0.75rem;
  background: #FAF7F2;
  border: 1px solid var(--brand-border, #E2D9CC);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.72rem;
  color: var(--brand-text, #19241E);
  font-family: var(--font-mono, monospace);
  font-weight: 500;
  pointer-events: none;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.topbar-icon-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-text, #2D3748);
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition-fast, 0.15s), color var(--transition-fast, 0.15s);
  text-decoration: none;
}

.topbar-icon-btn:hover {
  background: rgba(21, 46, 34, 0.06);
  color: var(--brand-primary, #152E22);
}

.topbar-icon-btn .icon {
  width: 18px;
  height: 18px;
}

.topbar-user-badge {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  background: var(--brand-primary, #152E22);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  margin-left: 0.25rem;
  font-family: inherit;
}

/* ==========================================================================
   Column 1: Left Navigation Rail (.app-sidebar)
   ========================================================================== */
.app-sidebar {
  width: 240px;
  background-color: #FAF7F2;
  border-right: 1px solid var(--brand-border, #E2D9CC);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  user-select: none;
  z-index: 100;
  overflow: hidden;
}

.sidebar-compose-box {
  padding: 1rem 0.85rem 0.5rem;
}

.btn-compose-brand {
  width: 100%;
  height: 38px;
  border-radius: 9999px;
  background: var(--brand-primary, #152E22);
  color: #FFFFFF;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(21, 46, 34, 0.15);
  transition: background var(--transition-fast, 0.15s), transform var(--transition-fast, 0.15s);
}

.btn-compose-brand:hover {
  background: var(--brand-primary-light, #1F3D2E);
  transform: translateY(-1px);
}

.btn-compose-brand .compose-icon {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

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

.nav-section-title {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #3F4943;
  padding: 0.5rem 0.5rem 0.25rem;
}

.nav-item-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.42rem 0.6rem;
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--brand-text, #2D3748);
  text-decoration: none;
  transition: background-color var(--transition-fast, 0.15s), color var(--transition-fast, 0.15s);
}

.nav-item-link:hover {
  background-color: rgba(21, 46, 34, 0.05);
  color: var(--brand-primary, #152E22);
}

.nav-item-link.active {
  background-color: rgba(21, 46, 34, 0.08);
  font-weight: 600;
  color: var(--brand-primary, #152E22) !important;
}

.nav-item-icon-text {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.nav-item-icon-text .icon {
  width: 16px;
  height: 16px;
  color: currentColor;
  opacity: 0.85;
  stroke-width: 1.9;
}

.sidebar-counter-chip {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--brand-muted, #555C56);
  background: rgba(21, 46, 34, 0.06);
  padding: 1px 6px;
  border-radius: 9999px;
}

.add-workspace-btn {
  background: none;
  border: none;
  width: 100%;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.sidebar-promo-card {
  position: relative;
  margin-top: auto;
  border-radius: 10px;
  background: #EAE3D6;
  padding: 1rem;
  overflow: hidden;
  border: 1px solid rgba(21, 46, 34, 0.08);
}

.promo-leaf-bg {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 95px;
  height: 95px;
  background-image: url('/assets/images/sidebar-leaf-bg.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: right bottom;
  opacity: 0.65;
  pointer-events: none;
}

.promo-card-content {
  position: relative;
  z-index: 2;
}

.promo-eyebrow {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-accent, #9c4d30);
  margin-bottom: 0.25rem;
}

.promo-card-title {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-primary, #152E22);
  text-decoration: none;
  line-height: 1.35;
}

.promo-card-title .icon {
  width: 13px;
  height: 13px;
  stroke-width: 2.2;
  transition: transform var(--transition-fast, 0.15s);
}

.promo-card-title:hover .icon {
  transform: translateX(3px);
}

/* ==========================================================================
   Mailbox Main View Container (.app-mail-layout)
   ========================================================================== */
.app-mail-layout {
  display: flex;
  flex: 1;
  min-width: 0;
  position: relative;
  overflow: hidden;
  height: 100%;
}

/* ==========================================================================
   Column 2: Message List (.app-message-list)
   ========================================================================== */
.app-message-list {
  width: 330px;
  background-color: #FAF7F2;
  border-right: 1px solid var(--brand-border, #E2D9CC);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.list-tabs-header {
  min-height: 52px;
  height: auto;
  padding: 4px 0.5rem 4px 0.85rem;
  border-bottom: 1px solid var(--brand-border, #E2D9CC);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: #FAF7F2;
  flex-shrink: 0;
}

.tabs-scroll-group {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  overflow-x: auto;
  flex: 1;
  min-width: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tabs-scroll-group::-webkit-scrollbar {
  display: none;
}

.list-filter-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  min-height: 44px;
  height: 44px;
  box-sizing: border-box;
  font-size: 0.78rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--brand-muted, #555C56);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9999px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  outline: none;
  transition: all var(--transition-fast, 0.15s);
}

.list-filter-tab:hover {
  color: var(--brand-primary, #152E22);
  background: rgba(21, 46, 34, 0.06);
}

.list-filter-tab.active {
  background: #FFFFFF;
  color: var(--brand-primary, #152E22);
  font-weight: 600;
  border-color: rgba(21, 46, 34, 0.12);
  box-shadow: 0 1px 3px rgba(21, 46, 34, 0.08);
}

.list-view-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.sort-selector {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--brand-text, #2D3748);
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  border: 1px solid transparent;
  user-select: none;
  transition: all var(--transition-fast, 0.15s);
}

.sort-selector:hover {
  background: rgba(21, 46, 34, 0.05);
  border-color: var(--brand-border-subtle, #EFE7DB);
}

.sort-selector .chevron-icon {
  width: 12px;
  height: 12px;
}

.list-icon-btn {
  background: none;
  border: none;
  color: var(--brand-muted, #555C56);
  cursor: pointer;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background-color var(--transition-fast, 0.15s), color var(--transition-fast, 0.15s);
}

.list-icon-btn:hover {
  background-color: rgba(21, 46, 34, 0.06);
  color: var(--brand-primary, #152E22);
}

.list-icon-btn .icon {
  width: 16px;
  height: 16px;
}

.list-scroll-area {
  flex: 1;
  overflow-y: auto;
  background: #FAF7F2;
}

.message-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(21, 46, 34, 0.06);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: background-color var(--transition-fast, 0.12s);
  background: #FAF7F2;
}

.message-row:hover {
  background-color: #F3ECE1;
}

.message-row.active {
  background-color: #EDE6DC;
  border-left: 3px solid var(--brand-primary, #152E22);
  padding-left: calc(1rem - 3px);
}

.row-avatar-col {
  flex-shrink: 0;
  margin-top: 2px;
}

.row-avatar-bubble {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.row-body-col {
  flex: 1;
  min-width: 0;
}

.row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 2px;
}

.row-sender {
  font-weight: 600;
  font-size: 0.84rem;
  color: var(--brand-primary, #152E22);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-time {
  font-size: 0.72rem;
  color: var(--brand-muted, #555C56);
  flex-shrink: 0;
}

.row-subject-line {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 2px;
}

.row-subject-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brand-text, #2D3748);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.attach-clip-icon {
  width: 12px;
  height: 12px;
  color: var(--brand-muted, #555C56);
  flex-shrink: 0;
  transform: rotate(45deg);
}

.row-snippet {
  font-size: 0.76rem;
  color: var(--brand-muted, #555C56);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.35rem;
}

.row-tags {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.empty-inbox-state,
.empty-conversation-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--brand-muted, #555C56);
}

.empty-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(21, 46, 34, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.empty-icon-box .icon {
  width: 24px;
  height: 24px;
  color: var(--brand-primary, #152E22);
}

.empty-inbox-state h3,
.empty-conversation-state h3 {
  font-family: var(--font-heading, 'Playfair Display', serif);
  font-size: 1.25rem;
  color: var(--brand-primary, #152E22);
  margin-bottom: 0.5rem;
}

.empty-inbox-state p,
.empty-conversation-state p {
  font-size: 0.85rem;
  max-width: 320px;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

/* ==========================================================================
   Column 3: Reading Pane (.app-reading-pane)
   ========================================================================== */
.app-reading-pane {
  flex: 1;
  background-color: #FFFFFF;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.pane-action-bar {
  height: 44px;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--brand-border, #E2D9CC);
  background-color: #FAF7F2;
  flex-shrink: 0;
}

.action-bar-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pane-icons-group {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.pane-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-muted, #555C56);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background var(--transition-fast, 0.12s), color var(--transition-fast, 0.12s);
}

.pane-icon-btn:hover {
  background: rgba(21, 46, 34, 0.06);
  color: var(--brand-primary, #152E22);
}

.pane-icon-btn .icon {
  width: 16px;
  height: 16px;
  stroke-width: 1.8;
}

.action-bar-right {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.pane-content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1.75rem 2.25rem;
  background: #FFFFFF;
}

.thread-subject-title {
  font-family: var(--font-heading, 'Playfair Display', serif);
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--brand-primary, #152E22);
  margin: 0 0 1.5rem;
  line-height: 1.25;
}

.thread-sender-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--brand-border-subtle, #EFE7DB);
}

.sender-info-cluster {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.sender-avatar-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.88rem;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

.sender-text-lines {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sender-name-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sender-full-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--brand-primary, #152E22);
}

.sender-email-address {
  font-size: 0.8rem;
  color: var(--brand-muted, #555C56);
}

.sender-timestamp {
  font-size: 0.78rem;
  color: var(--brand-muted, #555C56);
  margin-left: 0.25rem;
}

.recipient-toggle-line {
  font-size: 0.76rem;
  color: var(--brand-muted, #555C56);
  display: flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
}

.recipient-toggle-line .down-arrow {
  width: 11px;
  height: 11px;
}

.sender-quick-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.thread-body-text {
  font-size: 0.94rem;
  line-height: 1.65;
  color: var(--brand-text, #2D3748);
  margin-bottom: 2rem;
}

.thread-body-text p {
  margin-bottom: 1rem;
}

.thread-body-text ul,
.thread-body-text ol {
  margin-bottom: 1rem;
  padding-left: 1.25rem;
}

.thread-body-text li {
  margin-bottom: 0.35rem;
}

/* Gmail-style Thread List Attachment Chips */
.row-attachments-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.4rem;
  margin-bottom: 0.2rem;
}

.row-att-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #FFFFFF;
  border: 1px solid var(--brand-border, #E2D9CC);
  border-radius: 9999px;
  padding: 2px 8px 2px 4px;
  font-size: 0.72rem;
  color: var(--brand-text, #2D3748);
  max-width: 220px;
  transition: all 0.15s ease;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.row-att-chip:hover {
  background: #FAF7F2;
  border-color: var(--brand-primary, #152E22);
  color: var(--brand-primary, #152E22);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(21, 46, 34, 0.08);
}

.row-att-chip .chip-badge {
  font-size: 0.6rem;
  font-weight: 700;
  color: #FFFFFF;
  padding: 1px 5px;
  border-radius: 9999px;
  letter-spacing: 0.03em;
  line-height: 1.2;
}

.row-att-chip .chip-fname {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

/* Attachments Section in Reading Pane */
.attachments-section {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--brand-border-subtle, #EFE7DB);
}

.attachments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.att-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand-primary, #152E22);
}

.att-header-left .attach-clip-icon {
  width: 15px;
  height: 15px;
  color: var(--brand-muted, #555C56);
}

.att-meta-bullet {
  color: var(--brand-border, #E2D9CC);
}

.att-sec-verified {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #22543D;
  font-size: 0.74rem;
  font-weight: 600;
  background: rgba(47, 133, 90, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
}

.att-sec-verified .icon {
  width: 12px;
  height: 12px;
}

.att-header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.att-action-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--brand-primary, #152E22);
  text-decoration: none;
  padding: 3px 8px;
  border-radius: 6px;
  background: #FFFFFF;
  border: 1px solid var(--brand-border, #E2D9CC);
  transition: all 0.15s ease;
}

.att-action-link:hover {
  background: #FAF7F2;
  border-color: var(--brand-primary, #152E22);
  color: var(--brand-primary, #152E22);
}

.att-action-link .icon {
  width: 13px;
  height: 13px;
}

.att-count-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--brand-muted, #555C56);
}

.attachments-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.att-preview-card {
  border: 1px solid var(--brand-border, #E2D9CC);
  border-radius: 8px;
  overflow: hidden;
  background: #FAF7F2;
  cursor: pointer;
  transition: transform var(--transition-fast, 0.12s), box-shadow var(--transition-fast, 0.12s);
}

.att-preview-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(21, 46, 34, 0.08);
}

.att-thumb-box {
  height: 100px;
  background: #F3ECE1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--brand-border, #E2D9CC);
  position: relative;
}

.att-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.att-generic-icon .icon {
  width: 32px;
  height: 32px;
  color: var(--brand-muted, #555C56);
  stroke-width: 1.5;
}

/* Gmail-style Interactive Hover Overlay */
.att-hover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 34, 25, 0.85);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 10;
}

.att-preview-card:hover .att-hover-overlay {
  opacity: 1;
  pointer-events: auto;
}

.att-overlay-btn.btn-preview {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #FFFFFF;
  color: var(--brand-primary, #152E22);
  border: none;
  border-radius: 9999px;
  padding: 4px 12px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  transition: transform 0.12s ease, background 0.12s ease;
}

.att-overlay-btn.btn-preview:hover {
  background: #FAF7F2;
  transform: scale(1.04);
}

.att-overlay-btn .icon {
  width: 13px;
  height: 13px;
}

.att-overlay-actions-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.att-overlay-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.att-overlay-icon-btn:hover {
  background: #FFFFFF;
  color: var(--brand-primary, #152E22);
  border-color: #FFFFFF;
  transform: scale(1.1);
}

.att-overlay-icon-btn .icon {
  width: 13px;
  height: 13px;
}

.att-footer-info {
  padding: 0.65rem 0.75rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.att-type-badge {
  font-size: 0.62rem;
  font-weight: 700;
  color: #FFFFFF;
  padding: 2px 5px;
  border-radius: 3px;
  letter-spacing: 0.03em;
  flex-shrink: 0;
  margin-top: 1px;
}

.att-name-size {
  flex: 1;
  min-width: 0;
}

.att-filename {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand-text, #2D3748);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.att-size-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 2px;
}

.att-size {
  font-size: 0.72rem;
  color: var(--brand-muted, #555C56);
}

.att-verified-badge {
  font-size: 0.65rem;
  font-weight: 600;
  color: #22543D;
  background: rgba(47, 133, 90, 0.08);
  padding: 1px 5px;
  border-radius: 3px;
}

/* Gmail-style Search Suggestion Chips */
.search-operator-chips {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 6px 12px;
  min-height: 56px;
  box-sizing: border-box;
  background: #FAF7F2;
  border-bottom: 1px solid var(--brand-border-subtle, #EFE7DB);
}

.search-op-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0 14px;
  min-height: 44px;
  height: 44px;
  box-sizing: border-box;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--brand-muted, #555C56);
  background: #FFFFFF;
  border: 1px solid var(--brand-border, #E2D9CC);
  border-radius: 9999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s ease;
}

.search-op-chip:hover,
.search-op-chip.active {
  background: var(--brand-primary, #152E22);
  color: #FFFFFF;
  border-color: var(--brand-primary, #152E22);
}

.search-op-chip .icon {
  width: 11px;
  height: 11px;
}

/* Bottom Quick Reply Bar */
.thread-bottom-reply-bar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 2rem;
  padding: 0.85rem 1.15rem;
  background: #FAF7F2;
  border: 1px solid var(--brand-border, #E2D9CC);
  border-radius: 10px;
}

.reply-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-primary, #152E22);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.reply-buttons-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.btn-reply-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 8px 16px;
  min-height: 44px;
  border-radius: 9999px;
  background: #FFFFFF;
  border: 1px solid var(--brand-border, #E2D9CC);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brand-primary, #152E22);
  cursor: pointer;
  outline: none;
  box-shadow: 0 1px 2px rgba(21, 46, 34, 0.05);
  transition: all var(--transition-fast, 0.15s);
}

.btn-reply-pill:hover {
  background: #FFFFFF;
  border-color: var(--brand-primary, #152E22);
  box-shadow: 0 3px 8px rgba(21, 46, 34, 0.1);
  transform: translateY(-1px);
}

.btn-reply-pill .icon {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}

/* ==========================================================================
   Column 4: Right Intelligence Rail (.app-intel-rail)
   ========================================================================== */
.app-intel-rail {
  width: 280px;
  background-color: #FAF7F2;
  border-left: 1px solid var(--brand-border, #E2D9CC);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 1.25rem 1rem;
  gap: 1.25rem;
  transition: opacity 0.2s ease;
}

.app-intel-rail.collapsed {
  display: none !important;
}

.intel-rail-toggle-btn.active {
  color: var(--brand-primary, #152E22);
  background: rgba(21, 46, 34, 0.08);
}

.intel-block {
  background: #FFFFFF;
  border: 1px solid var(--brand-border, #E2D9CC);
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(21, 46, 34, 0.04);
}

.intel-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.intel-header-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--brand-primary, #152E22);
}

.intel-header-title .icon {
  width: 16px;
  height: 16px;
}

.text-terracotta {
  color: #9c4d30;
}

.intel-copy-btn,
.intel-close-btn {
  background: none;
  border: none;
  color: var(--brand-muted, #555C56);
  cursor: pointer;
  padding: 3px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast, 0.15s);
}

.intel-copy-btn:hover,
.intel-close-btn:hover {
  color: var(--brand-primary, #152E22);
  background: rgba(21, 46, 34, 0.06);
}

.intel-close-btn .icon {
  width: 14px;
  height: 14px;
}

.ai-summary-bullets {
  list-style: disc;
  padding-left: 1.15rem;
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--brand-text, #2D3748);
}

.ai-summary-bullets li {
  margin-bottom: 0.45rem;
}

.intel-section-heading {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-muted, #555C56);
  margin-bottom: 0.75rem;
}

.suggested-actions-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.action-pill-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  background: #FAF7F2;
  border: 1px solid var(--brand-border-subtle, #EFE7DB);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--brand-primary, #152E22);
  cursor: pointer;
  outline: none;
  text-align: left;
  transition: all var(--transition-fast, 0.15s);
}

.action-pill-btn:hover {
  background: #FFFFFF;
  border-color: var(--brand-primary, #152E22);
  box-shadow: 0 2px 6px rgba(21, 46, 34, 0.06);
  transform: translateY(-1px);
}

.action-pill-btn .icon {
  width: 14px;
  height: 14px;
  color: var(--brand-muted, #555C56);
  stroke-width: 2;
  flex-shrink: 0;
  transition: color var(--transition-fast, 0.15s);
}

.action-pill-btn:hover .icon {
  color: var(--brand-primary, #152E22);
}

.detected-cards-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.detected-item-card {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem;
  background: #FAF7F2;
  border-radius: 8px;
  border: 1px solid var(--brand-border-subtle, #EFE7DB);
}

.detected-icon-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 0.85rem;
}

.detected-icon-circle .icon {
  width: 14px;
  height: 14px;
  stroke-width: 2.2;
}

.green-circle {
  background: rgba(46, 125, 50, 0.12);
  color: #2E7D32;
}

.orange-circle {
  background: rgba(230, 81, 0, 0.12);
  color: #9C4221;
}

.blue-circle {
  background: rgba(2, 136, 209, 0.12);
  color: #005691;
}

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

.detected-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--brand-muted, #555C56);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detected-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--brand-primary, #152E22);
  margin: 1px 0;
}

.detected-meta {
  font-size: 0.7rem;
  color: var(--brand-muted, #555C56);
}

.workflow-cta-block {
  background: #FDFBF8;
  border: 1px dashed var(--brand-border, #E2D9CC);
}

.workflow-cta-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}

.workflow-cta-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--brand-primary, #152E22);
}

.workflow-cta-desc {
  font-size: 0.76rem;
  color: var(--brand-muted, #555C56);
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

.btn-use-automation {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem;
  border-radius: 6px;
  background: var(--brand-primary, #152E22);
  color: #FFFFFF;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background var(--transition-fast, 0.15s);
}

.btn-use-automation:hover {
  background: var(--brand-primary-light, #1F3D2E);
}

.btn-use-automation .icon {
  width: 14px;
  height: 14px;
  stroke-width: 2.2;
}

/* ==========================================================================
   Docked Composer Modal
   ========================================================================== */
.composer-dock {
  position: fixed;
  bottom: 0;
  right: 2rem;
  width: 640px;
  max-width: calc(100vw - 2rem);
  background: #FFFFFF;
  border: 1px solid var(--brand-border, #E2D9CC);
  border-bottom: none;
  border-radius: var(--radius-lg, 12px) var(--radius-lg, 12px) 0 0;
  box-shadow: 0 12px 36px rgba(15, 33, 24, 0.22);
  z-index: 1000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.composer-dock.open {
  display: flex;
}

.composer-dock.maximized {
  position: fixed;
  top: 50% !important;
  left: 50% !important;
  bottom: auto !important;
  right: auto !important;
  transform: translate(-50%, -50%);
  width: 920px !important;
  max-width: 95vw !important;
  height: 85vh !important;
  max-height: 820px !important;
  border-radius: 12px !important;
  border: 1px solid var(--brand-border, #E2D9CC) !important;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.35) !important;
  z-index: 2500 !important;
}

.composer-dock.maximized .composer-textarea,
.composer-dock.maximized .composer-editor {
  min-height: 320px;
  flex: 1;
}

.composer-dock.minimized {
  bottom: 0 !important;
  right: 2rem !important;
  width: 340px !important;
  height: auto !important;
  border-radius: 8px 8px 0 0 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15) !important;
}

.composer-dock.minimized .composer-content,
.composer-dock.minimized .composer-footer,
.composer-dock.minimized .elept-suggestion-box {
  display: none !important;
}

.composer-bar {
  background: var(--brand-primary, #152E22);
  color: #FFFFFF;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.composer-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.composer-header-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 0.95rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.composer-header-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
}

.composer-content {
  padding: 1rem 1.25rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1;
  overflow-y: auto;
}

.composer-field-row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--brand-border-subtle, #EFE7DB);
  padding-bottom: 0.35rem;
  gap: 0.5rem;
}

.composer-field-label {
  width: 55px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand-muted, #555C56);
  flex-shrink: 0;
}

.composer-field-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.88rem;
  font-family: inherit;
  background: transparent;
  color: var(--brand-primary, #152E22);
}

.composer-field-select {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.86rem;
  font-family: inherit;
  background: transparent;
  color: var(--brand-primary, #152E22);
  font-weight: 600;
  cursor: pointer;
}

.composer-cc-bcc-btn {
  background: none;
  border: none;
  font-size: 0.75rem;
  color: var(--brand-muted, #555C56);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}

.composer-cc-bcc-btn:hover {
  color: var(--brand-primary, #152E22);
  background: #F0EDE8;
}

.composer-rich-toolbar {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 6px;
  background: #FAF7F2;
  border: 1px solid var(--brand-border-subtle, #EFE7DB);
  border-radius: 6px;
  flex-wrap: wrap;
}

.composer-tool-btn {
  background: transparent;
  border: none;
  color: var(--brand-text, #2D3748);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  min-width: 24px;
  height: 24px;
  transition: all 0.15s ease;
}

.composer-tool-btn:hover {
  background: #EFE7DB;
  color: var(--brand-primary, #152E22);
}

.composer-tool-divider {
  width: 1px;
  height: 16px;
  background: var(--brand-border, #E2D9CC);
  margin: 0 2px;
}

.composer-textarea {
  min-height: 170px;
  border: none;
  outline: none;
  font-size: 0.92rem;
  font-family: var(--font-body, inherit);
  line-height: 1.6;
  resize: vertical;
  color: var(--brand-text, #2D3748);
}

.composer-editor {
  min-height: 180px;
  max-height: 420px;
  overflow-y: auto;
  border: none;
  outline: none;
  font-size: 0.94rem;
  font-family: var(--font-body, inherit);
  line-height: 1.6;
  color: var(--brand-text, #2D3748);
  padding: 0.5rem 0.25rem;
  word-break: break-word;
  white-space: pre-wrap;
}

.composer-dock.maximized .composer-editor {
  min-height: 380px;
  max-height: calc(100vh - 280px);
  flex: 1;
}

.composer-editor:empty:before {
  content: attr(placeholder);
  color: var(--brand-muted, #555C56);
  pointer-events: none;
  display: block;
}

.composer-editor .composer-embed-card {
  user-select: none;
  cursor: default;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.composer-editor .composer-embed-card:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

.composer-editor blockquote {
  margin: 10px 0;
  padding: 6px 14px;
  border-left: 3px solid var(--brand-primary, #152E22);
  background: #FAF7F2;
  color: var(--brand-text, #2D3748);
  border-radius: 0 4px 4px 0;
}

.composer-editor pre {
  margin: 10px 0;
  padding: 10px 14px;
  background: #2D3748;
  color: #EDF2F7;
  border-radius: 6px;
  font-family: var(--font-mono, monospace);
  font-size: 0.85rem;
  overflow-x: auto;
}

.composer-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FFFFFF;
  border: 1px solid var(--brand-border, #E2D9CC);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand-primary, #152E22);
}

.elept-suggestion-box {
  background: #FAF6F0;
  border: 1px solid var(--brand-border, #E2D9CC);
  border-radius: var(--radius-sm, 6px);
  padding: 0.6rem 0.85rem;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--brand-border, #E2D9CC);
  background: #FAF7F2;
}

/* ==========================================================================
   Shortcuts Modal Overlay & Global Modal Polish
   ========================================================================== */
.shortcuts-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 30, 22, 0.58);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.shortcuts-modal-overlay.open {
  display: flex;
  opacity: 1;
}

.shortcuts-modal-overlay.open .shortcuts-card,
.shortcuts-modal-overlay.open .card,
.shortcuts-modal-overlay.open .mail-settings-card {
  animation: modalPopIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalPopIn {
  0% {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.shortcuts-card {
  width: 560px;
  max-width: 94vw;
  max-height: 88vh;
  overflow-y: auto;
  background: #FFFFFF;
  border-radius: 14px;
  padding: 1.75rem 2rem;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(226, 217, 204, 0.6);
  border: 1px solid var(--brand-border, #E2D9CC);
}

.shortcut-group-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-muted, #555C56);
  margin: 1.25rem 0 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.shortcut-group-title:first-child {
  margin-top: 0;
}

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--brand-border-subtle, #EFE7DB);
  font-size: 0.86rem;
  color: var(--brand-primary, #152E22);
}

.shortcut-row:last-child {
  border-bottom: none;
}

.shortcut-keys {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.key-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  background: #FAF7F2;
  border: 1px solid #D7C3A5;
  border-bottom-width: 2px;
  border-radius: 5px;
  font-family: var(--font-mono, monospace);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--brand-primary, #152E22);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

/* Admin / Full Content Container */
.admin-main-content {
  flex: 1;
  background: #FFFFFF;
  overflow-y: auto;
  padding: 2.5rem 3.5rem;
}

/* ==========================================================================
   Mobile Responsiveness (Screens <= 960px)
   ========================================================================== */
.mobile-fab,
.mobile-back-btn,
.mobile-bottom-nav,
.mobile-drawer-overlay {
  display: none;
}

@media (max-width: 960px) {
  .app-workspace-body {
    height: calc(100vh - 52px - 60px);
  }

  .mobile-menu-trigger {
    display: inline-flex;
  }

  .mac-window-dots {
    display: none;
  }

  .topbar-center {
    display: none;
  }

  /* Off-canvas Sidebar */
  .app-sidebar {
    position: fixed;
    top: 52px;
    bottom: 60px;
    left: 0;
    width: 280px;
    z-index: 1500;
    transform: translateX(-100%);
    transition: transform var(--transition-normal, 0.25s ease);
    box-shadow: none;
  }

  .app-container.drawer-open .app-sidebar {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(21, 46, 34, 0.15);
  }

  .mobile-drawer-overlay {
    display: none;
    position: fixed;
    top: 52px;
    bottom: 60px;
    left: 0;
    right: 0;
    background: rgba(21, 46, 34, 0.35);
    z-index: 1400;
  }

  .app-container.drawer-open .mobile-drawer-overlay {
    display: block;
  }

  /* Single-Pane Switch: List View vs Reading View */
  .app-message-list {
    width: 100vw !important;
    display: flex !important;
    border-right: none;
  }

  .app-reading-pane {
    display: none !important;
    width: 100vw !important;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 300;
    background: #FFFFFF;
  }

  .app-container.show-reading-pane .app-message-list {
    display: none !important;
  }

  .app-container.show-reading-pane .app-reading-pane {
    display: flex !important;
  }

  .mobile-back-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
    color: var(--brand-primary, #152E22);
    cursor: pointer;
    font-size: 0.88rem;
  }

  .app-intel-rail {
    display: none;
  }

  .pane-topbar,
  .pane-action-bar {
    padding: 0 1rem;
    height: 48px;
  }

  .pane-content-scroll {
    padding: 1.25rem 1rem;
  }

  .thread-subject-title {
    font-size: 1.35rem;
  }

  /* Bottom Navigation Bar */
  .mobile-bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #FAF7F2;
    border-top: 1px solid var(--brand-border, #E2D9CC);
    z-index: 1000;
  }

  .mobile-bottom-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--brand-muted, #555C56);
    font-size: 0.72rem;
    font-weight: 600;
    text-decoration: none;
    gap: 2px;
  }

  .mobile-bottom-item.active {
    color: var(--brand-primary, #152E22);
  }

  .mobile-bottom-item .icon {
    width: 20px;
    height: 20px;
  }

  .mobile-fab {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: 74px;
    right: 18px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background-color: var(--brand-primary, #152E22);
    color: #FFFFFF;
    box-shadow: var(--shadow-lg, 0 10px 15px -3px rgba(0,0,0,0.1));
    border: none;
    z-index: 999;
    cursor: pointer;
  }

  .composer-dock {
    width: 100vw !important;
    height: 100vh !important;
    right: 0 !important;
    bottom: 0 !important;
    border-radius: 0 !important;
    z-index: 2200;
  }

  .composer-textarea,
  .composer-editor {
    min-height: 240px;
  }

  .shortcuts-card {
    width: 92vw;
    padding: 1.25rem;
  }
}


/* ==========================================================================
   Photo Avatars & Visual Polish
   ========================================================================== */
.row-avatar-img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.sender-photo-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.topbar-user-avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.reply-user-photo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

/* Unread Indicators */
.message-row.row-unread {
  background-color: #FFFFFF;
}

.message-row.row-unread .row-sender {
  font-weight: 700;
  color: #000000;
}

.message-row.row-unread .row-subject-text {
  font-weight: 700;
  color: #111827;
}

.message-row.thread-removing {
  transform: translateX(-40px);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.pane-icon-btn.star-active {
  color: #744210 !important;
}

.pane-icon-btn.star-active svg {
  fill: #744210;
}

/* ==========================================================================
   Email Thread Body Isolation & Strict Containment
   ========================================================================== */
.thread-body-text {
  contain: layout paint;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  word-break: break-word;
  overflow-wrap: anywhere;
  padding: 1.25rem 0;
  min-height: 80px;
}

.thread-body-text img,
.thread-body-text table {
  max-width: 100% !important;
}

/* ==========================================================================
   Document Preview Lightbox Modal
   ========================================================================== */
.doc-preview-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 30, 22, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.doc-preview-modal-overlay.open {
  display: flex;
  opacity: 1;
}

.doc-preview-modal-overlay.open .doc-preview-card {
  animation: modalPopIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.doc-preview-card {
  width: 940px;
  max-width: 95vw;
  height: 88vh;
  background: #FFFFFF;
  border-radius: 14px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(226, 217, 204, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--brand-border);
}

#meetRoomModal .doc-preview-card {
  height: auto;
  max-height: 90vh;
}

.doc-preview-header {
  height: 64px;
  padding: 0 1.5rem;
  background: #FAF7F2;
  border-bottom: 1px solid var(--brand-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.doc-preview-title-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.doc-preview-badge {
  background: #E53E3E;
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.doc-preview-filename {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--brand-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 480px;
}

.doc-preview-meta {
  font-size: 0.76rem;
  color: var(--brand-muted);
}

.doc-preview-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

/* Document Lightbox Modal Zoom Toolbar */
.doc-zoom-toolbar {
  display: inline-flex;
  align-items: center;
  background: #FAF7F2;
  border: 1px solid var(--brand-border, #E2D9CC);
  border-radius: 6px;
  padding: 2px 4px;
  gap: 2px;
}

.doc-zoom-btn {
  padding: 3px 6px !important;
  font-size: 0.72rem !important;
  line-height: 1 !important;
  color: var(--brand-primary, #152E22) !important;
}

.doc-zoom-btn .icon {
  width: 13px;
  height: 13px;
}

.doc-zoom-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand-primary, #152E22);
  min-width: 42px;
  text-align: center;
  cursor: pointer;
  user-select: none;
}

.doc-zoom-label:hover {
  color: var(--brand-accent, #9c4d30);
}

.doc-preview-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--brand-muted);
  cursor: pointer;
  padding: 0 6px;
  line-height: 1;
}

.doc-preview-close:hover {
  color: var(--brand-primary);
}

.doc-preview-canvas {
  flex: 1;
  background: #F4EFE6;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
}

.doc-preview-iframe {
  width: 100%;
  height: 100%;
  min-height: 65vh;
  border: none;
  background: #FFFFFF;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.doc-image-zoom-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 1rem;
}

.doc-canvas-image {
  max-width: 92%;
  max-height: 92%;
  object-fit: contain;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  border-radius: 8px;
  transform-origin: center center;
  transition: transform 0.15s ease-out;
}

.doc-sheet-table-wrap {
  width: 100%;
  height: 100%;
  background: #FFFFFF;
  border-radius: 8px;
  border: 1px solid var(--brand-border);
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  overflow: auto;
  padding: 1.25rem;
}

.doc-preview-footer {
  height: 52px;
  padding: 0 1.5rem;
  background: #FAF7F2;
  border-top: 1px solid var(--brand-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--brand-muted);
  flex-shrink: 0;
}

.doc-page-controls,
.doc-zoom-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* ==========================================================================
   Workflow Execution Modal
   ========================================================================== */
.workflow-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 30, 22, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.workflow-modal-overlay.open {
  display: flex;
  opacity: 1;
}

.workflow-modal-overlay.open .workflow-modal-card {
  animation: modalPopIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.workflow-modal-card {
  width: 580px;
  max-width: 92vw;
  background: #FFFFFF;
  border-radius: 14px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(226, 217, 204, 0.6);
  border: 1px solid var(--brand-border);
  overflow: hidden;
}

.workflow-modal-header {
  padding: 1.25rem 1.5rem;
  background: #FAF7F2;
  border-bottom: 1px solid var(--brand-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.workflow-pulse-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(196, 111, 78, 0.15);
  color: #9c4d30;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.workflow-modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand-primary);
  margin: 0;
}

.workflow-modal-subtitle {
  font-size: 0.78rem;
  color: var(--brand-muted);
}

.workflow-pipeline-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.pipeline-step-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: #FAF7F2;
  border: 1px solid var(--brand-border-subtle);
  transition: all 0.25s ease;
}

.pipeline-step-row.step-done {
  background: #F0FDF4;
  border-color: #86EFAC;
}

.pipeline-step-row.step-active {
  background: #FFFBEB;
  border-color: #FCD34D;
}

.step-num-bubble {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #E2D9CC;
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
}

.step-done .step-num-bubble {
  background: #22C55E;
  color: #FFFFFF;
}

.step-content {
  flex: 1;
}

.step-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--brand-primary);
}

.step-detail {
  font-size: 0.74rem;
  color: var(--brand-muted);
}

.step-status-chip {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--brand-muted);
}

.step-done .step-status-chip {
  color: #22543D;
}

.chip-pulse {
  animation: pulseAnim 1.5s infinite;
}

@keyframes pulseAnim {
  0% { opacity: 0.5; }
  50% { opacity: 1; }
  100% { opacity: 0.5; }
}

.workflow-modal-footer {
  padding: 1rem 1.5rem;
  background: #FAF7F2;
  border-top: 1px solid var(--brand-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ==========================================================================
   Snooze Dropdown Floating Menu
   ========================================================================== */
.snooze-dropdown-menu {
  position: fixed;
  width: 250px;
  background: #FFFFFF;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--brand-border);
  z-index: 2500;
  padding: 0.5rem;
  overflow: hidden;
}

.snooze-menu-header {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brand-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.5rem 0.5rem;
  border-bottom: 1px solid var(--brand-border-subtle);
  margin-bottom: 0.35rem;
}

.snooze-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease;
}

.snooze-option:hover {
  background: #FAF7F2;
}

.snooze-option .icon {
  width: 16px;
  height: 16px;
  color: var(--brand-muted);
}

.snooze-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brand-primary);
}

.snooze-time {
  font-size: 0.72rem;
  color: var(--brand-muted);
}


/* ==========================================================================
   Admin Portal Layout & Responsive Content
   ========================================================================== */
.admin-sidebar {
  width: 250px;
  background-color: #FAF7F2;
  border-right: 1px solid var(--brand-border, #E2D9CC);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  user-select: none;
  z-index: 100;
  overflow: hidden;
}

.admin-main-content {
  flex: 1;
  overflow-y: auto;
  padding: 2.25rem 2.75rem;
  background-color: var(--brand-background, #FAF7F2);
  min-width: 0;
  height: calc(100vh - 52px);
}

.admin-content-inner {
  max-width: 1120px;
  margin: 0 auto;
  width: 100%;
}

.sidebar-brand-img {
  height: 28px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  display: block;
}

.mobile-topbar-brand {
  height: 28px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  display: block;
}

.mobile-topbar {
  display: none;
}

/* Mobile drawer overlay & responsive behavior */
.mobile-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(21, 46, 34, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
}

.app-container.drawer-open .mobile-drawer-overlay {
  display: block;
}

@media (max-width: 960px) {
  .mobile-menu-trigger {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  .topbar-center {
    display: none;
  }

  .app-sidebar {
    position: fixed !important;
    top: 52px;
    left: 0;
    bottom: 0;
    width: 260px;
    transform: translateX(-100%);
    transition: transform var(--transition-normal, 0.25s ease);
    z-index: 999;
    box-shadow: var(--shadow-modal, 0 16px 40px rgba(0,0,0,0.18));
  }

  .app-container.drawer-open .app-sidebar {
    transform: translateX(0);
  }

  .admin-main-content,
  .app-workspace-body > main,
  .app-settings-pane,
  .admin-main-scroll {
    padding: 1.25rem 1rem !important;
    max-width: 100vw;
    box-sizing: border-box;
  }
}

/* ==========================================================================
   Utility Animations
   ========================================================================== */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spinning {
  animation: spin 0.85s linear infinite !important;
  transform-origin: center center;
}

/* ==========================================================================
   Skeleton Shimmer, Empty & Error States (Next8)
   ========================================================================== */
@keyframes elShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.el-skeleton-shimmer {
  background: linear-gradient(90deg, #ECE6DC 25%, #F7F4EE 50%, #ECE6DC 75%);
  background-size: 200% 100%;
  animation: elShimmer 1.5s infinite;
  border-radius: 6px;
}

.el-empty-state-box {
  background: #FFFFFF;
  border: 1px dashed var(--brand-border, #E2D9CC);
  border-radius: 12px;
  padding: 3.5rem 1.5rem;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.el-error-state-box {
  background: #FFF9F5;
  border: 1px solid #E2D9CC;
  border-left: 4px solid #C46F4E;
  border-radius: 10px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

/* Top Progress Bar for AJAX Navigation */
#ajaxProgressBar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--brand-accent, #9C4D30);
  z-index: 100000;
  transition: width 0.2s ease, opacity 0.3s ease;
  pointer-events: none;
}

/* Mobile Touch Target Standards: Sidebar items at <= 768px (including 390px) */
@media (max-width: 768px) {
  .app-sidebar .nav-item-link {
    min-height: 44px !important;
    height: 44px;
    padding: 0 0.75rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }
}
