/* ============================================================
   SEOS MAIL — LUXURY DARK GLASSMORPHIC WEBMAIL STYLESHEET
   Consistent with Seos Technology Prestige Design System
   ============================================================ */

:root {
  --bg-dark: #060B14;
  --bg-card: rgba(11, 17, 33, 0.82);
  --bg-card-hover: rgba(18, 26, 47, 0.9);
  --bg-elevated: rgba(255, 255, 255, 0.03);
  --bg-input: rgba(255, 255, 255, 0.04);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-active: rgba(16, 185, 129, 0.35);

  --primary: #10B981;
  --primary-hover: #059669;
  --primary-glow: rgba(16, 185, 129, 0.35);
  --primary-light: rgba(16, 185, 129, 0.12);
  --accent-cyan: #06B6D4;
  --danger: #EF4444;
  --danger-light: rgba(239, 68, 68, 0.12);

  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Space Grotesk', var(--font-sans);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Background Ambient Lighting */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}
.glow-1 {
  top: -150px;
  right: -100px;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, transparent 70%);
}
.glow-2 {
  bottom: -150px;
  left: 20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.08) 0%, transparent 70%);
}

/* ============================================================
   1. LOGIN SCREEN
   ============================================================ */
.login-wrapper {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-color);
  border-radius: 1.5rem;
  padding: 2.75rem 2.25rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  animation: fadeInDown 0.4s ease-out;
}

.login-logo-wrap {
  text-align: center;
  margin-bottom: 2rem;
}

.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.5px;
}

.login-brand span {
  background: linear-gradient(135deg, #10B981 0%, #06B6D4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  background: var(--primary-light);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #34D399;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.6rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-wrap i,
.input-icon-wrap svg {
  position: absolute;
  left: 14px;
  color: var(--text-dim);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.form-control {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  color: #fff;
  font-size: 0.92rem;
  transition: all 0.2s ease;
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.form-control::placeholder {
  color: #475569;
}

.server-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: #64748B;
  margin-top: 0.5rem;
}

.btn-primary-block {
  width: 100%;
  padding: 0.85rem;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  border: none;
  border-radius: 0.75rem;
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s ease;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35);
  margin-top: 1.5rem;
}

.btn-primary-block:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.btn-primary-block:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ============================================================
   2. MAIN APPLICATION SPA LAYOUT
   ============================================================ */
.app-container {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 260px 380px 1fr;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background: var(--bg-dark);
}

/* 2.1 SIDEBAR */
.sidebar {
  background: rgba(8, 14, 26, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  user-select: none;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
}

.brand-text {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}
.brand-text span {
  color: #34D399;
}

.btn-compose {
  width: 100%;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  border: none;
  border-radius: 0.75rem;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25);
  margin-bottom: 1.5rem;
  transition: all 0.2s ease;
}

.btn-compose:hover {
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

.nav-folders {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
}

.folder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.9rem;
  border-radius: 0.6rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
}

.folder-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.folder-item i,
.folder-item svg {
  width: 18px;
  height: 18px;
  color: var(--text-dim);
}

.folder-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}

.folder-item.active {
  background: var(--primary-light);
  color: #34D399;
  font-weight: 600;
}

.folder-item.active i,
.folder-item.active svg {
  color: #34D399;
}

.badge-unread {
  background: #10B981;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 9999px;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* Quota Section (Item 7 Clean Layout) */
.sidebar-quota {
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  margin-top: auto;
  margin-bottom: 0.85rem;
}

.quota-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.quota-title-text {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
}

.quota-value-row {
  font-size: 0.82rem;
  font-weight: 600;
  color: #F8FAFC;
  margin-bottom: 0.5rem;
  white-space: nowrap;
}

.quota-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
}

.quota-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10B981 0%, #34D399 100%);
  border-radius: 9999px;
  transition: width 0.5s ease;
}

/* User Profile & Actions */
.sidebar-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #059669 0%, #0D9488 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  flex-shrink: 0;
}

.user-email-text {
  font-size: 0.8rem;
  color: #E2E8F0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  color: #34D399;
}
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34D399;
  box-shadow: 0 0 8px #34D399;
  animation: pulse 2s infinite;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.btn-icon:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* 2.2 MIDDLE: EMAIL LIST PANE */
.mail-list-pane {
  background: rgba(11, 17, 33, 0.5);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.mail-list-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.search-bar {
  position: relative;
  display: flex;
  align-items: center;
}

.search-bar i,
.search-bar svg {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--text-dim);
}

.search-input {
  width: 100%;
  padding: 0.6rem 0.8rem 0.6rem 2.3rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 0.6rem;
  color: #fff;
  font-size: 0.85rem;
  outline: none;
  transition: all 0.2s ease;
}
.search-input:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.06);
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-pill {
  padding: 4px 10px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-pill:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.filter-pill.active {
  background: var(--primary-light);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34D399;
  font-weight: 600;
}

.mail-list-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1.25rem;
  background: rgba(255, 255, 255, 0.01);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.mail-list-scroll {
  flex: 1;
  overflow-y: auto;
}

.mail-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.mail-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.mail-item.selected {
  background: rgba(16, 185, 129, 0.08);
  border-left: 3px solid #10B981;
}

.mail-item.unread {
  background: rgba(255, 255, 255, 0.02);
}

.mail-item.unread .mail-sender {
  color: #fff;
  font-weight: 700;
}

.mail-item.unread .mail-subject {
  color: #F1F5F9;
  font-weight: 600;
}

.mail-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.7);
  flex-shrink: 0;
  margin-top: 6px;
}

.mail-status-read {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
  flex-shrink: 0;
  margin-top: 6px;
}

.mail-item-body {
  flex: 1;
  min-width: 0;
}

.mail-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.mail-sender {
  font-size: 0.88rem;
  color: #CBD5E1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.mail-date {
  font-size: 0.75rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.mail-subject {
  font-size: 0.84rem;
  color: #94A3B8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.mail-bottom-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 2rem;
  text-align: center;
  color: var(--text-dim);
}

.empty-state i,
.empty-state svg {
  width: 48px;
  height: 48px;
  color: rgba(255, 255, 255, 0.1);
  margin-bottom: 1rem;
}

/* 2.3 RIGHT: DETAIL READER PANE */
.mail-detail-pane {
  background: var(--bg-dark);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.detail-header-toolbar {
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(11, 17, 33, 0.4);
}

.detail-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-detail-action {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: 0.5rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-detail-action:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-detail-action.btn-danger-action:hover {
  background: var(--danger-light);
  color: #F87171;
  border-color: rgba(239, 68, 68, 0.3);
}

.detail-content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 2.5rem;
}

.detail-subject-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1.5rem;
  line-height: 1.3;
}

.detail-meta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  margin-bottom: 2rem;
}

.detail-sender-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.detail-sender-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10B981 0%, #06B6D4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
}

.detail-sender-name {
  font-size: 0.98rem;
  font-weight: 600;
  color: #fff;
}

.detail-sender-email {
  font-size: 0.82rem;
  color: var(--text-dim);
}

.detail-recipients {
  font-size: 0.78rem;
  color: #64748B;
  margin-top: 2px;
}

.detail-date-badge {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Sanitized Email Body */
.detail-body-container {
  color: #E2E8F0;
  font-size: 0.95rem;
  line-height: 1.7;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  word-break: break-word;
}

.detail-body-container a {
  color: #34D399;
  text-decoration: underline;
}

/* Attachments */
.detail-attachments-card {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
}

.attachments-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.attachments-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.attachment-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.5rem 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  text-decoration: none;
  color: #E2E8F0;
  font-size: 0.82rem;
  transition: all 0.15s ease;
}

.attachment-chip:hover {
  background: var(--primary-light);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34D399;
}

/* ============================================================
   3. COMPOSE MODAL (Floating Gmail Style)
   ============================================================ */
.compose-modal {
  display: none;
  position: fixed;
  bottom: 0;
  right: 30px;
  width: 580px;
  max-width: calc(100vw - 40px);
  height: 600px;
  max-height: 85vh;
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--border-color);
  border-radius: 1rem 1rem 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.7);
  z-index: 1000;
  flex-direction: column;
  animation: slideUp 0.25s ease-out;
}

.compose-modal.open {
  display: flex;
}

.compose-header {
  padding: 0.85rem 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.compose-title {
  font-weight: 600;
  font-size: 0.92rem;
  color: #fff;
}

.compose-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem 1.25rem;
  gap: 0.75rem;
  overflow-y: auto;
}

.compose-input-row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.compose-label {
  width: 60px;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.compose-field {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
}

.compose-textarea {
  flex: 1;
  width: 100%;
  background: transparent;
  border: none;
  color: #E2E8F0;
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.6;
  resize: none;
  outline: none;
  min-height: 200px;
}

.compose-footer {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
}

.btn-send {
  padding: 0.65rem 1.4rem;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  border: none;
  border-radius: 0.6rem;
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
  transition: all 0.2s ease;
}

.btn-send:hover {
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

/* ============================================================
   4. DNS & SETUP MODAL
   ============================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.open {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 680px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1.25rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

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

.modal-header h3 {
  font-size: 1.15rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-content-scroll {
  padding: 1.5rem;
  overflow-y: auto;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.dns-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.82rem;
}

.dns-table th,
.dns-table td {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border-color);
  text-align: left;
}

.dns-table th {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-weight: 600;
}

.dns-table td code {
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  color: #34D399;
  font-family: monospace;
}

/* ============================================================
   5. TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.88rem;
  min-width: 300px;
  max-width: 420px;
  animation: slideInRight 0.3s ease-out;
}

.toast-success {
  border-left: 4px solid #10B981;
}

.toast-error {
  border-left: 4px solid #EF4444;
}

/* Animations */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-15px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* Spinner Smooth Infinite Rotation */
.spin {
  animation: spinAnimation 0.85s linear infinite !important;
  display: inline-block;
  transform-origin: center center;
}
@keyframes spinAnimation {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Checkbox & Selection */
.mail-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  margin-top: 5px;
  flex-shrink: 0;
}
.mail-checkbox:checked {
  background: #10B981;
  border-color: #10B981;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-size: 11px;
  background-position: center;
  background-repeat: no-repeat;
}

/* Row Hover Quick Actions */
.mail-row-actions {
  display: none;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 3px 5px;
  gap: 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  z-index: 5;
}
.mail-item:hover .mail-row-actions {
  display: flex;
}
.mail-row-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 5px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.mail-row-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
.mail-row-btn.btn-del:hover {
  color: #F87171;
  background: rgba(239, 68, 68, 0.2);
}

/* Bulk Actions Toolbar */
.bulk-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.bulk-bar.active {
  display: flex;
}
.btn-bulk-action {
  padding: 4px 9px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-bulk-action:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.btn-bulk-action.btn-bulk-del:hover {
  background: var(--danger-light);
  color: #F87171;
  border-color: rgba(239, 68, 68, 0.3);
}

/* Quota Upgrade Button & Pricing Modal */
.btn-upgrade-quota {
  padding: 2px 8px;
  border-radius: 9999px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(6, 182, 212, 0.2) 100%);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34D399;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.btn-upgrade-quota:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.35) 0%, rgba(6, 182, 212, 0.35) 100%);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
  color: #fff;
}

.pricing-plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 1.5rem;
}
@media (max-width: 768px) {
  .pricing-plans-grid {
    grid-template-columns: 1fr;
  }
}
.plan-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.25s ease;
}
.plan-card:hover {
  border-color: rgba(16, 185, 129, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}
.plan-card.popular {
  border-color: #10B981;
  background: rgba(16, 185, 129, 0.05);
}
.plan-badge {
  position: absolute;
  top: -10px;
  right: 15px;
  background: #10B981;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  letter-spacing: 0.5px;
}
.plan-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.25rem;
}
.plan-storage {
  font-size: 1.6rem;
  font-weight: 800;
  color: #34D399;
  margin-bottom: 0.4rem;
}
.plan-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1rem;
}
.plan-price span {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 400;
}
.plan-features {
  list-style: none;
  padding: 0;
  margin-bottom: 1.5rem;
  flex: 1;
}
.plan-features li {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 6px;
}
.plan-btn {
  width: 100%;
  padding: 0.7rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.12);
  color: #34D399;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.plan-btn:hover {
  background: #10B981;
  color: #fff;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}
.plan-card.popular .plan-btn {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #fff;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ============================================================
   RESPONSIVE DESIGN (Mobile & Tablet First-Class Experience)
   ============================================================ */

/* Mobile Nav Bar - Hidden on Desktop (>900px) */
.mobile-nav-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(11, 17, 33, 0.95);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.mobile-title-wrap {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
}

.mobile-menu-btn,
.mobile-compose-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: #E2E8F0;
  border-radius: 0.5rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Off-canvas Backdrop */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 90;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.sidebar-backdrop.active {
  display: block;
  opacity: 1;
}

/* Tablets (901px - 1100px) */
@media (max-width: 1100px) and (min-width: 901px) {
  .app-container {
    grid-template-columns: 220px 320px 1fr;
  }
}

/* Mobile & Tablets (<= 900px) */
@media (max-width: 900px) {
  .app-container {
    grid-template-columns: 1fr;
    position: relative;
  }

  .mobile-nav-bar {
    display: flex;
  }

  /* Sidebar transforms into smooth sliding off-canvas drawer */
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -300px;
    width: 280px;
    z-index: 100;
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.8);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    background: #090E1A;
  }

  .sidebar.drawer-open {
    left: 0;
  }

  .mobile-sidebar-close {
    display: inline-flex !important;
  }

  /* Mail List Pane takes full width on mobile/tablet */
  .mail-list-pane {
    width: 100%;
    border-right: none;
  }

  /* Reading Detail Pane: Off-canvas sliding viewer on mobile */
  .mail-detail-pane {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 85;
    background: var(--bg-dark);
    flex-direction: column;
    overflow-y: auto;
  }

  .mail-detail-pane.mobile-open {
    display: flex !important;
  }

  /* Prominent Mobile Back button in reader */
  #btn-back-mobile {
    display: inline-flex !important;
    background: rgba(16, 185, 129, 0.15) !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
    color: #34D399 !important;
    font-weight: 600 !important;
  }

  .detail-header-toolbar {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    gap: 8px;
  }

  .detail-actions-group {
    flex-wrap: wrap;
    gap: 6px;
  }

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

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

  .detail-meta-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  /* Modals on Mobile */
  .modal-container {
    width: 95% !important;
    max-width: 95% !important;
    margin: 1rem auto;
    padding: 1.25rem;
  }

  .compose-modal {
    width: 96% !important;
    right: 2% !important;
    bottom: 2% !important;
  }
}

/* Phones (<= 640px) */
@media (max-width: 640px) {
  .mail-list-header {
    padding: 0.75rem;
  }

  .search-input {
    font-size: 0.85rem;
  }

  .filter-pills {
    gap: 4px;
  }

  .filter-pill {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
  }

  .btn-detail-action span {
    display: none;
  }
}
