/* ==========================================================================
   Wisdom Group — Unified Corporate Email Admin Panel
   Palette: Deep Navy #25446F | Executive Navy #0F172A | Vibrant Orange #F58821
   ========================================================================== */

.wg-mail-shell {
  display: grid;
  grid-template-columns: 240px 330px 1fr;
  gap: 0;
  min-height: calc(100vh - 110px);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px -6px rgba(15, 23, 42, 0.08);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

@media (max-width: 1180px) {
  .wg-mail-shell {
    grid-template-columns: 220px 1fr;
  }
  .wg-mail-viewer {
    grid-column: 1 / -1;
    border-top: 1px solid #e2e8f0;
  }
}

@media (max-width: 760px) {
  .wg-mail-shell {
    grid-template-columns: 1fr;
  }
}

/* Left Sidebar */
.wg-mail-sidebar {
  background: #0f172a;
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  gap: 14px;
}

.wg-mail-compose-btn {
  background: #f58821;
  color: #ffffff;
  border: none;
  border-radius: 11px;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.wg-mail-compose-btn:hover {
  opacity: 0.92;
}

.wg-mail-section-lbl {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  padding: 0 8px;
}

.wg-mail-acct-btn,
.wg-mail-folder-btn {
  width: 100%;
  background: transparent;
  border: none;
  border-radius: 9px;
  padding: 8px 10px;
  color: #cbd5e1;
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  text-align: left;
}

.wg-mail-acct-btn:hover,
.wg-mail-folder-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.wg-mail-acct-btn.active,
.wg-mail-folder-btn.active {
  background: #25446f;
  color: #ffffff;
  font-weight: 700;
}

.wg-mail-unread-pill {
  background: #f58821;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
}

.wg-mail-warn-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #fbbf24;
  flex-shrink: 0;
}

/* Middle Message List Pane */
.wg-mail-list-pane {
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.wg-mail-list-head {
  padding: 12px;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wg-mail-search {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 12.5px;
  color: #0f172a;
  background: #f8fafc;
}

.wg-mail-list-body {
  flex: 1;
  overflow-y: auto;
  max-height: 640px;
}

.wg-mail-row {
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  cursor: pointer;
  background: #ffffff;
  transition: background 0.12s ease;
}

.wg-mail-row:hover {
  background: #f1f5f9;
}

.wg-mail-row.active {
  background: #eef2ff;
  border-left: 3px solid #25446f;
}

.wg-mail-row.unread .wg-mail-row-subj,
.wg-mail-row.unread .wg-mail-row-from {
  font-weight: 800;
  color: #0f172a;
}

.wg-mail-row-from {
  font-size: 12.5px;
  color: #334155;
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.wg-mail-row-subj {
  font-size: 12.5px;
  color: #475569;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Right Viewer Pane */
.wg-mail-viewer {
  background: #ffffff;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.wg-mail-viewer-head {
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
}

.wg-mail-viewer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.wg-mail-btn {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  border-radius: 8px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.wg-mail-btn:hover {
  background: #f1f5f9;
}

.wg-mail-btn-primary {
  background: #25446f;
  border-color: #25446f;
  color: #ffffff;
}

.wg-mail-btn-orange {
  background: #f58821;
  border-color: #f58821;
  color: #ffffff;
}

.wg-mail-btn-danger {
  color: #dc2626;
  border-color: #fecaca;
}

.wg-mail-iframe {
  width: 100%;
  min-height: 430px;
  flex: 1;
  border: none;
  background: #ffffff;
}

.wg-mail-err-banner {
  margin: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 12px;
}

/* Modals */
.wg-mail-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.wg-mail-modal {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 680px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
}
