/* Email Module - Professional Email Client Styles */

/* ========================================
   CSS Variables
   ======================================== */
:root {
  --email-bg: #0a0e14;
  --email-surface: #111820;
  --email-surface-hover: #1a2330;
  --email-surface-active: #1e2a3a;
  --email-border: rgba(255, 255, 255, 0.08);
  --email-border-hover: rgba(255, 255, 255, 0.15);
  --email-text: #e8ecf2;
  --email-text-secondary: #8b97a8;
  --email-text-muted: #5f6b7a;
  --email-primary: #3b82f6;
  --email-primary-hover: #2563eb;
  --email-primary-subtle: rgba(59, 130, 246, 0.15);
  --email-success: #10b981;
  --email-success-subtle: rgba(16, 185, 129, 0.15);
  --email-danger: #ef4444;
  --email-danger-subtle: rgba(239, 68, 68, 0.15);
  --email-warning: #f59e0b;
  --email-warning-subtle: rgba(245, 158, 11, 0.15);
  --email-unread: #60a5fa;
  --email-starred: #fbbf24;
  --email-radius: 10px;
  --email-radius-lg: 16px;
  --email-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --email-shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
}

/* ========================================
   Setup Section
   ======================================== */
.email-setup-section {
  display: flex;
  justify-content: center;
  padding: 20px 0;
}

.email-setup-card {
  background: linear-gradient(165deg, var(--email-surface), var(--email-bg));
  border: 1px solid var(--email-border);
  border-radius: var(--email-radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 560px;
  box-shadow: var(--email-shadow);
}

.email-setup-header {
  text-align: center;
  margin-bottom: 28px;
}

.email-setup-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.email-setup-header h2 {
  font-size: 22px;
  font-weight: 600;
  color: var(--email-text);
  margin: 0 0 8px 0;
}

.email-setup-header p {
  font-size: 14px;
  color: var(--email-text-secondary);
  margin: 0;
}

.email-setup-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.email-setup-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.email-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.email-field.full-width {
  grid-column: 1 / -1;
}

.email-field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--email-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.email-field input,
.email-field select {
  padding: 12px 14px;
  background: var(--email-bg);
  border: 1px solid var(--email-border);
  border-radius: var(--email-radius);
  color: var(--email-text);
  font-size: 14px;
  transition: all 0.2s ease;
}

.email-field input:focus,
.email-field select:focus {
  outline: none;
  border-color: var(--email-primary);
  box-shadow: 0 0 0 3px var(--email-primary-subtle);
}

.email-field input::placeholder {
  color: var(--email-text-muted);
}

.email-field-hint {
  font-size: 11px;
  color: var(--email-text-muted);
}

.email-field-hint a {
  color: var(--email-primary);
  text-decoration: none;
}

.email-field-hint a:hover {
  text-decoration: underline;
}

.email-field-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
}

.email-field-divider::before,
.email-field-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--email-border);
}

.email-field-divider span {
  font-size: 11px;
  color: var(--email-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.email-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.email-setup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

.email-setup-presets {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--email-border);
}

.email-setup-presets span {
  font-size: 12px;
  color: var(--email-text-muted);
}

.preset-btn {
  padding: 6px 12px;
  background: var(--email-surface-hover);
  border: 1px solid var(--email-border);
  border-radius: 999px;
  color: var(--email-text-secondary);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-btn:hover {
  background: var(--email-surface-active);
  border-color: var(--email-border-hover);
  color: var(--email-text);
}

/* ========================================
   Buttons
   ======================================== */
.email-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  background: linear-gradient(135deg, var(--email-primary), var(--email-primary-hover));
  border: none;
  border-radius: var(--email-radius);
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.email-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.email-btn-primary:active {
  transform: translateY(0);
}

.email-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--email-surface-hover);
  border: 1px solid var(--email-border);
  border-radius: var(--email-radius);
  color: var(--email-text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.email-btn-secondary:hover {
  background: var(--email-surface-active);
  border-color: var(--email-border-hover);
}

.email-text-btn {
  padding: 4px 8px;
  background: transparent;
  border: none;
  color: var(--email-text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.email-text-btn:hover {
  color: var(--email-text);
}

.email-text-btn.danger {
  color: var(--email-danger);
}

.email-text-btn.danger:hover {
  color: #f87171;
}

.email-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--email-radius);
  color: var(--email-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.email-icon-btn:hover {
  background: var(--email-surface-hover);
  border-color: var(--email-border);
  color: var(--email-text);
}

.email-icon-btn.small {
  width: 30px;
  height: 30px;
}

.email-icon-btn.danger:hover {
  background: var(--email-danger-subtle);
  border-color: transparent;
  color: var(--email-danger);
}

.email-icon-btn.active {
  background: var(--email-primary-subtle);
  color: var(--email-primary);
}

/* ========================================
   Main App Layout
   ======================================== */
.email-app {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Toolbar */
.email-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: var(--email-surface);
  border: 1px solid var(--email-border);
  border-radius: var(--email-radius-lg) var(--email-radius-lg) 0 0;
}

.email-toolbar-left,
.email-toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.email-toolbar-center {
  flex: 1;
  max-width: 480px;
}

.email-account-switcher,
.email-folder-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
}

.email-account-select,
.email-folder-select {
  padding: 8px 12px;
  padding-right: 32px;
  background: var(--email-bg);
  border: 1px solid var(--email-border);
  border-radius: var(--email-radius);
  color: var(--email-text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%238b97a8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  min-width: 160px;
}

.email-account-select:focus,
.email-folder-select:focus {
  outline: none;
  border-color: var(--email-primary);
}

/* Search */
.email-search {
  position: relative;
  display: flex;
  align-items: center;
}

.email-search-icon {
  position: absolute;
  left: 12px;
  color: var(--email-text-muted);
  pointer-events: none;
}

.email-search input {
  width: 100%;
  padding: 10px 40px 10px 40px;
  background: var(--email-bg);
  border: 1px solid var(--email-border);
  border-radius: var(--email-radius);
  color: var(--email-text);
  font-size: 13px;
  transition: all 0.2s ease;
}

.email-search input:focus {
  outline: none;
  border-color: var(--email-primary);
  box-shadow: 0 0 0 3px var(--email-primary-subtle);
}

.email-search input::placeholder {
  color: var(--email-text-muted);
}

.email-search-shortcut {
  position: absolute;
  right: 12px;
  padding: 2px 6px;
  background: var(--email-surface-hover);
  border: 1px solid var(--email-border);
  border-radius: 4px;
  color: var(--email-text-muted);
  font-size: 11px;
  font-family: inherit;
  pointer-events: none;
}

.email-search input:focus + .email-search-shortcut {
  display: none;
}

/* Info Bar */
.email-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--email-bg);
  border-left: 1px solid var(--email-border);
  border-right: 1px solid var(--email-border);
}

.email-info-left {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--email-text-secondary);
}

.email-unread-badge {
  padding: 2px 8px;
  background: var(--email-primary-subtle);
  border-radius: 999px;
  color: var(--email-primary);
  font-size: 11px;
  font-weight: 600;
}

/* Main Layout */
.email-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  min-height: 600px;
  border: 1px solid var(--email-border);
  border-top: none;
  border-radius: 0 0 var(--email-radius-lg) var(--email-radius-lg);
  overflow: hidden;
}

/* List Panel */
.email-list-panel {
  display: flex;
  flex-direction: column;
  background: var(--email-surface);
  border-right: 1px solid var(--email-border);
}

.email-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--email-border);
}

.email-list-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.email-bulk-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: 8px;
  border-left: 1px solid var(--email-border);
}

.email-list-meta {
  font-size: 11px;
  color: var(--email-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Checkbox */
.email-checkbox-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.email-checkbox-wrapper input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.email-checkbox {
  width: 18px;
  height: 18px;
  background: var(--email-bg);
  border: 2px solid var(--email-border-hover);
  border-radius: 4px;
  transition: all 0.15s ease;
}

.email-checkbox-wrapper input:checked + .email-checkbox {
  background: var(--email-primary);
  border-color: var(--email-primary);
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='10' viewBox='0 0 12 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 5L4.5 8.5L11 1' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.email-checkbox-wrapper:hover .email-checkbox {
  border-color: var(--email-primary);
}

/* Email List */
.email-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.email-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--email-border);
  cursor: pointer;
  transition: background 0.15s ease;
}

.email-item:hover {
  background: var(--email-surface-hover);
}

.email-item.active {
  background: var(--email-primary-subtle);
  border-left: 3px solid var(--email-primary);
  padding-left: 11px;
}

.email-item.unread {
  background: rgba(96, 165, 250, 0.05);
}

.email-item.unread .email-item-subject {
  color: var(--email-text);
  font-weight: 600;
}

.email-item.unread .email-item-from {
  color: var(--email-text);
  font-weight: 600;
}

.email-item-checkbox {
  display: flex;
  align-items: flex-start;
  padding-top: 2px;
}

.email-item-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.email-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.email-item-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--email-primary), #8b5cf6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.email-item-from {
  font-size: 13px;
  color: var(--email-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-item-subject {
  font-size: 13px;
  color: var(--email-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-item-preview {
  font-size: 12px;
  color: var(--email-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-item-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.email-item-date {
  font-size: 11px;
  color: var(--email-text-muted);
  white-space: nowrap;
}

.email-item-indicators {
  display: flex;
  align-items: center;
  gap: 4px;
}

.email-item-star {
  color: var(--email-text-muted);
  cursor: pointer;
  transition: color 0.15s ease;
}

.email-item-star:hover,
.email-item-star.active {
  color: var(--email-starred);
}

.email-item-attachment {
  color: var(--email-text-muted);
}

.email-item-unread-dot {
  width: 8px;
  height: 8px;
  background: var(--email-unread);
  border-radius: 50%;
}

/* Pagination */
.email-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-top: 1px solid var(--email-border);
  background: var(--email-bg);
}

.email-page-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--email-border);
  border-radius: var(--email-radius);
  color: var(--email-text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.email-page-btn:hover:not(:disabled) {
  background: var(--email-surface-hover);
  border-color: var(--email-border-hover);
  color: var(--email-text);
}

.email-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.email-page-info {
  font-size: 12px;
  color: var(--email-text-muted);
}

/* Preview Panel */
.email-preview-panel {
  display: flex;
  flex-direction: column;
  background: var(--email-bg);
}

.email-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--email-border);
  background: var(--email-surface);
}

.email-preview-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.email-action-divider {
  width: 1px;
  height: 24px;
  background: var(--email-border);
  margin: 0 4px;
}

.email-move-dropdown {
  display: flex;
  align-items: center;
  gap: 4px;
}

.email-move-select {
  padding: 6px 10px;
  background: var(--email-bg);
  border: 1px solid var(--email-border);
  border-radius: var(--email-radius);
  color: var(--email-text);
  font-size: 12px;
  cursor: pointer;
  max-width: 120px;
}

/* Email Viewer */
.email-viewer {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.email-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 400px;
  text-align: center;
}

.email-empty-icon {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: 0.8;
}

.email-empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--email-text);
  margin: 0 0 8px 0;
}

.email-empty-state p {
  font-size: 14px;
  color: var(--email-text-secondary);
  margin: 0;
}

.email-shortcuts-hint {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
  padding: 16px;
  background: var(--email-surface);
  border-radius: var(--email-radius);
}

.email-shortcuts-hint span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--email-text-muted);
}

.email-shortcuts-hint kbd {
  padding: 3px 6px;
  background: var(--email-bg);
  border: 1px solid var(--email-border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 11px;
}

/* Email Message View */
.email-message {
  max-width: 800px;
}

.email-message-header {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.email-message-avatar {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--email-primary), #8b5cf6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

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

.email-message-subject {
  font-size: 20px;
  font-weight: 600;
  color: var(--email-text);
  margin: 0 0 8px 0;
}

.email-message-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 13px;
  color: var(--email-text-secondary);
}

.email-message-meta strong {
  color: var(--email-text);
  font-weight: 500;
}

.email-message-body {
  font-size: 14px;
  line-height: 1.7;
  color: var(--email-text);
}

.email-message-body pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: inherit;
  margin: 0;
}

.email-html-frame {
  width: 100%;
  min-height: 400px;
  border: none;
  border-radius: var(--email-radius);
  background: white;
}

/* Loading */
.email-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  gap: 12px;
  color: var(--email-text-muted);
  font-size: 13px;
}

.email-loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--email-border);
  border-top-color: var(--email-primary);
  border-radius: 50%;
  animation: email-spin 0.8s linear infinite;
}

@keyframes email-spin {
  to { transform: rotate(360deg); }
}

/* ========================================
   Modals
   ======================================== */
.email-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.email-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* Compose Modal */
.email-compose-modal {
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  background: var(--email-surface);
  border: 1px solid var(--email-border);
  border-radius: var(--email-radius-lg);
  box-shadow: var(--email-shadow-lg);
  display: flex;
  flex-direction: column;
  transform: translateY(20px);
  transition: transform 0.2s ease;
}

.email-modal-overlay.open .email-compose-modal {
  transform: translateY(0);
}

.email-compose-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--email-border);
}

.email-compose-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--email-text);
  margin: 0;
}

.email-compose-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.email-compose-field {
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--email-border);
}

.email-compose-field label {
  width: 60px;
  font-size: 13px;
  font-weight: 500;
  color: var(--email-text-secondary);
}

.email-compose-field input {
  flex: 1;
  padding: 12px 0;
  background: transparent;
  border: none;
  color: var(--email-text);
  font-size: 14px;
}

.email-compose-field input:focus {
  outline: none;
}

.email-compose-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.email-compose-field-row .email-compose-field:first-child {
  border-right: 1px solid var(--email-border);
}

.email-compose-body {
  flex: 1;
  min-height: 200px;
  display: flex;
}

.email-compose-body textarea {
  flex: 1;
  padding: 16px 20px;
  background: transparent;
  border: none;
  color: var(--email-text);
  font-size: 14px;
  line-height: 1.6;
  resize: none;
}

.email-compose-body textarea:focus {
  outline: none;
}

.email-compose-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--email-border);
  background: var(--email-bg);
}

.email-compose-left,
.email-compose-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Reader Modal */
.email-reader-modal {
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  background: var(--email-surface);
  border: 1px solid var(--email-border);
  border-radius: var(--email-radius-lg);
  box-shadow: var(--email-shadow-lg);
  display: flex;
  flex-direction: column;
  transform: translateY(20px);
  transition: transform 0.2s ease;
}

.email-modal-overlay.open .email-reader-modal {
  transform: translateY(0);
}

.email-reader-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
  border-bottom: 1px solid var(--email-border);
}

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

.email-reader-info h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--email-text);
  margin: 0 0 8px 0;
  word-wrap: break-word;
}

.email-reader-meta {
  font-size: 13px;
  color: var(--email-text-secondary);
  line-height: 1.5;
}

.email-reader-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.email-reader-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.7;
  color: var(--email-text);
}

.email-reader-body pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: inherit;
  margin: 0;
}

.email-reader-body .email-html-frame {
  min-height: 300px;
}

.email-reader-reply {
  border-top: 1px solid var(--email-border);
  background: var(--email-bg);
}

.email-reply-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--email-border);
  font-size: 13px;
  font-weight: 500;
  color: var(--email-text-secondary);
}

.email-reply-form {
  padding: 12px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.email-reply-form input,
.email-reply-form textarea {
  padding: 10px 12px;
  background: var(--email-surface);
  border: 1px solid var(--email-border);
  border-radius: var(--email-radius);
  color: var(--email-text);
  font-size: 13px;
}

.email-reply-form input:focus,
.email-reply-form textarea:focus {
  outline: none;
  border-color: var(--email-primary);
}

.email-reply-form textarea {
  min-height: 80px;
  resize: vertical;
  line-height: 1.5;
}

.email-reply-actions {
  display: flex;
  justify-content: flex-end;
}

/* ========================================
   Toast Notifications
   ======================================== */
.email-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
}

.email-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--email-surface);
  border: 1px solid var(--email-border);
  border-radius: var(--email-radius);
  box-shadow: var(--email-shadow);
  color: var(--email-text);
  font-size: 13px;
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.3s ease;
}

.email-toast.show {
  transform: translateX(0);
  opacity: 1;
}

.email-toast.success {
  border-left: 3px solid var(--email-success);
}

.email-toast.error {
  border-left: 3px solid var(--email-danger);
}

.email-toast.warning {
  border-left: 3px solid var(--email-warning);
}

.email-toast-icon {
  flex-shrink: 0;
}

.email-toast-close {
  margin-left: auto;
  padding: 4px;
  background: transparent;
  border: none;
  color: var(--email-text-muted);
  cursor: pointer;
  transition: color 0.15s ease;
}

.email-toast-close:hover {
  color: var(--email-text);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 900px) {
  .email-layout {
    grid-template-columns: 1fr;
  }

  .email-list-panel {
    border-right: none;
    border-bottom: 1px solid var(--email-border);
    max-height: 400px;
  }

  .email-toolbar {
    flex-wrap: wrap;
  }

  .email-toolbar-center {
    order: 3;
    flex: none;
    width: 100%;
    max-width: none;
    margin-top: 8px;
  }
}

@media (max-width: 600px) {
  .email-toolbar-left {
    flex-wrap: wrap;
  }

  .email-account-select,
  .email-folder-select {
    min-width: 120px;
    font-size: 12px;
  }

  .email-item {
    padding: 12px;
  }

  .email-compose-modal,
  .email-reader-modal {
    max-height: 100vh;
    border-radius: 0;
  }
}
