/* Mail center — Zoho layout, dashboard (light) colors */
.settings-page, .users-page, .analytics-page, .mail-page { display: none; }
body.page-mail #leadHome,
body.page-mail .lead-only { display: none !important; }
body.page-mail #mailPage { display: block; }
body.page-mail .main-content {
  background: linear-gradient(180deg, #eef2f7 0%, #f6f5f3 240px);
}

.mail-page { min-height: calc(100vh - 88px); }
.zm {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: calc(100vh - 100px);
  background: #fff;
  color: #2c3340;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line, #e5e7eb);
  box-shadow: 0 8px 24px rgba(26, 38, 54, .06);
}
.zm-rail {
  background: #f8fafc;
  border-right: 1px solid var(--line, #e5e7eb);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.zm-compose {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: var(--accent, #f05a50);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(240, 90, 80, .22);
}
.zm-compose:hover { filter: brightness(1.05); }
.zm-compose-more { display: flex; gap: 6px; }
.zm-compose-more button {
  flex: 1;
  min-height: 52px;
  border: 1px solid var(--line, #e5e7eb);
  background: #fff;
  color: #4b5563;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
}
.zm-compose-more button i { font-size: 14px; color: #1a2636; }
.zm-compose-more button span { color: #6b7280; letter-spacing: .01em; }
.zm-compose-more button:hover { border-color: #93c5fd; color: #1d4ed8; background: #eff6ff; }
.zm-compose-more button:hover i,
.zm-compose-more button:hover span { color: #1d4ed8; }
.zm-folders, .zm-views { display: flex; flex-direction: column; gap: 2px; }
.zm-views { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line, #e5e7eb); }
.zm-views-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gray-500, #6b7280);
  padding: 4px 10px 6px;
}
.zm-folder {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: #374151;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 560;
}
.zm-folder i { width: 16px; text-align: center; color: #6b7280; }
.zm-folder em {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  min-width: 1.2em;
  text-align: right;
}
.zm-folder:hover { background: #eef2f7; color: #111827; }
.zm-folder.on { background: #e8eef8; color: #1a2636; }
.zm-folder.on i { color: #2563eb; }
.zm-sync {
  margin-top: auto;
  border: 1px dashed #cbd5e1;
  background: #fff;
  color: #64748b;
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}
.zm-sync:hover { border-color: #2563eb; color: #1e3a5f; }
.zm-sync.is-busy i { animation: zm-spin .8s linear infinite; }
@keyframes zm-spin { to { transform: rotate(360deg); } }

.zm-main { display: flex; flex-direction: column; min-width: 0; background: #fff; }
.zm-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line, #e5e7eb);
  background: #f8fafc;
}
.zm-tab {
  border: 0;
  background: transparent;
  color: #6b7280;
  padding: 8px 12px;
  border-radius: 8px 8px 0 0;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.zm-tab.on { background: #fff; color: #1a2636; box-shadow: inset 0 -2px 0 #2563eb; }
.zm-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 999px;
  padding: 6px 12px;
  min-width: min(320px, 42vw);
}
.zm-search i { color: #9ca3af; font-size: 12px; }
.zm-search input {
  border: 0;
  background: transparent;
  color: #1f2937;
  outline: none;
  width: 100%;
  font-size: 13px;
}
.zm-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line, #e5e7eb);
  background: #fff;
}
.zm-check { display: inline-flex; align-items: center; margin-right: 4px; }
.zm-tool, .zm-icon-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.zm-tool:hover:not(:disabled), .zm-icon-btn:hover { background: #eef2f7; color: #1a2636; }
.zm-tool:disabled { opacity: .35; cursor: default; }
.zm-tool.danger:hover:not(:disabled) { color: #dc2626; background: #fef2f2; }
.zm-folder-title {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.zm-body { position: relative; flex: 1; min-height: 0; display: flex; }
.zm-list-pane { flex: 1; min-width: 0; overflow: auto; }
.zm-list { display: flex; flex-direction: column; }
.zm-day {
  padding: 8px 14px 4px;
  font-size: 11px;
  font-weight: 750;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: .05em;
  background: #f8fafc;
  border-bottom: 1px solid #eef2f7;
  position: sticky;
  top: 0;
  z-index: 1;
}
.zm-row {
  display: grid;
  grid-template-columns: 28px 28px 160px minmax(0, 1fr) 64px 72px;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  position: relative;
}
.zm-row::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: transparent;
}
.zm-row:hover { background: #f8fafc; }
.zm-row.unread { background: #f5f8fc; }
.zm-row.unread::before { background: #2563eb; }
.zm-row.unread .zm-from,
.zm-row.unread .zm-subj { font-weight: 750; color: #111827; }
.zm-row.on { background: #eef4ff; }
.zm-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: #1a2636; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 750;
}
.zm-from { font-size: 13px; color: #1f2937; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zm-mid { min-width: 0; display: flex; gap: 8px; align-items: baseline; }
.zm-subj { font-size: 13px; color: #374151; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42%; }
.zm-prev { font-size: 12px; color: #9ca3af; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.zm-size { font-size: 11px; color: #9ca3af; text-align: right; }
.zm-time { font-size: 11px; color: #6b7280; text-align: right; white-space: nowrap; }
.zm-empty {
  padding: 48px 20px;
  text-align: center;
  color: #6b7280;
  font-size: 13px;
}

.zm-read-pane, .zm-compose-pane, .zm-bulk-pane {
  flex: 1;
  min-width: 0;
  overflow: auto;
  background: #fff;
  padding: 0 0 24px;
}
.zm-read-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line, #e5e7eb);
  background: #f8fafc;
}
.zm-read-meta { flex: 1; min-width: 0; }
.zm-read-meta h2 { margin: 0 0 6px; font-size: 18px; color: #111827; font-weight: 750; }
.zm-read-from, .zm-read-to { font-size: 12px; color: #6b7280; }
.zm-read-actions { display: flex; gap: 4px; }
.zm-read-body {
  padding: 18px 20px;
  color: #1f2937;
  font-size: 14px;
  line-height: 1.55;
  background: #fff;
  margin: 14px 16px;
  border-radius: 10px;
  border: 1px solid #eef2f7;
  min-height: 220px;
}
.zm-read-body a { color: #2563eb; }

.zm-compose-form, .zm-bulk-pane { padding: 14px 16px; }
.zm-compose-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.zm-compose-top h2 { margin: 0; font-size: 16px; color: #111827; }
.zm-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.zm-field label { font-size: 11px; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: .04em; }
.zm-field input, .zm-field textarea, .zm-bulk-search input, .zm-schedule-row input {
  border: 1px solid var(--line, #e5e7eb);
  background: #fff;
  color: #1f2937;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  outline: none;
}
.zm-field input:focus, .zm-field textarea:focus, .zm-bulk-search input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.zm-field.grow { flex: 1; }
.zm-field textarea { resize: vertical; min-height: 180px; font-family: inherit; }
.zm-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.zm-compose-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.zm-schedule-row { display: flex; align-items: center; gap: 10px; margin: 8px 0 12px; }
.zm-schedule-row label { font-size: 12px; color: #6b7280; font-weight: 650; }
.zm-hint { font-size: 12px; color: #6b7280; margin: 0 0 12px; }
.zm-hint code { background: #eef2f7; padding: 1px 6px; border-radius: 4px; color: #1d4ed8; }
.zm-bulk-sub { margin: 4px 0 0; font-size: 12px; color: #6b7280; font-weight: 500; }
.zm-bulk-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .9fr);
  gap: 16px;
  align-items: start;
}
.zm-bulk-col { min-width: 0; }
.zm-bulk-section-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 8px;
}
.zm-bulk-section-label span { font-size: 11px; letter-spacing: 0; text-transform: none; color: #2563eb; font-weight: 700; }
.zm-tpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.zm-tpl {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  border: 1px solid var(--line, #e5e7eb);
  background: #fff;
  border-radius: 10px;
  padding: 10px 10px;
  cursor: pointer;
  color: #374151;
  min-height: 64px;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.zm-tpl i {
  width: 28px; height: 28px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #eef2f7; color: #1a2636; font-size: 12px; flex-shrink: 0;
}
.zm-tpl span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.zm-tpl strong { font-size: 12px; font-weight: 750; color: #111827; line-height: 1.2; }
.zm-tpl em { font-style: normal; font-size: 11px; color: #6b7280; }
.zm-tpl:hover { border-color: #93c5fd; background: #f8fbff; }
.zm-tpl.on {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.zm-tpl.on i { background: #2563eb; color: #fff; }
.zm-bulk-leads-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.zm-bulk-leads-head .zm-bulk-section-label { margin: 0; flex: 1; }
.zm-bulk-select-actions { display: flex; gap: 4px; flex-shrink: 0; }
.zm-link-btn {
  border: 0;
  background: transparent;
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.zm-link-btn:hover { background: #eff6ff; }
.zm-bulk-search { margin-bottom: 10px; }
.zm-bulk-leads {
  max-height: min(360px, 48vh);
  overflow: auto;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 10px;
  margin-bottom: 12px;
  background: #f8fafc;
}
.zm-lead {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid #eef2f7;
  font-size: 12px;
  color: #374151;
  cursor: pointer;
}
.zm-lead:hover { background: #fff; }
.zm-lead:has(input:checked) { background: #eff6ff; }
.zm-lead strong { display: block; color: #111827; font-size: 13px; }
.zm-lead span { color: #6b7280; }
.zm-bulk-col-leads .zm-compose-actions { position: sticky; bottom: 0; background: #fff; padding-top: 4px; }

@media (max-width: 900px) {
  .zm-bulk-layout { grid-template-columns: 1fr; }
  .zm-bulk-leads { max-height: 220px; }
}

@media (max-width: 980px) {
  .zm { grid-template-columns: 1fr; min-height: auto; }
  .zm-rail { border-right: 0; border-bottom: 1px solid var(--line, #e5e7eb); }
  .zm-folders { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .zm-views { display: none; }
  .zm-row { grid-template-columns: 24px 28px minmax(0, 1fr) 56px; }
  .zm-from, .zm-size { display: none; }
  .zm-field-row { grid-template-columns: 1fr; }
  .zm-search { min-width: 0; flex: 1; }
}
