/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-base: #0b0b14;
  --bg-surface: #12121f;
  --bg-raised: #18182a;
  --bg-elevated: #1e1e35;
  --bg-hover: #252540;
  --bg-active: #2d2d50;
  --bg-card: #1a1a2f;

  --text-title: #f0f0f8;
  --text-body: #c8c8dc;
  --text-soft: #9999b0;
  --text-muted: #6a6a85;
  --text-dim: #4a4a60;

  --accent-base: #7c5cfc;
  --accent-hover: #9175ff;
  --accent-glow: rgba(124, 92, 252, 0.2);
  --accent-subtle: rgba(124, 92, 252, 0.08);

  --green: #2ecc71;
  --green-subtle: rgba(46, 204, 113, 0.1);
  --red: #e74c3c;
  --red-subtle: rgba(231, 76, 60, 0.1);
  --gold: #f1c40f;
  --gold-subtle: rgba(241, 196, 15, 0.1);
  --orange: #e67e22;

  --border: #24243a;
  --border-light: #2e2e48;
  --border-accent: rgba(124, 92, 252, 0.25);

  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.35);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 24px rgba(124, 92, 252, 0.15);

  --sidebar-w: 230px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
}

html { height: 100%; }
body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-base);
  color: var(--text-body);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }

/* ─── Animations ─── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideRight { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 100% { transform: scale(1); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastOut { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(-16px) scale(0.95); } }
@keyframes mailOut { to { opacity: 0; transform: translateX(-20px); max-height: 0; padding-top: 0; padding-bottom: 0; margin-bottom: 0; overflow: hidden; } }
@keyframes badgePulse { 0% { box-shadow: 0 0 0 0 rgba(124, 92, 252, 0.4); } 70% { box-shadow: 0 0 0 8px rgba(124, 92, 252, 0); } 100% { box-shadow: 0 0 0 0 rgba(124, 92, 252, 0); } }

.anim-fade { animation: fadeIn 0.3s var(--ease) both; }
.anim-up { animation: fadeUp 0.4s var(--ease) both; }
.anim-scale { animation: scaleIn 0.3s var(--ease) both; }
.anim-stagger { animation: fadeUp 0.4s var(--ease) both; animation-fill-mode: both; }
.anim-stagger:nth-child(1) { animation-delay: 0.02s; }
.anim-stagger:nth-child(2) { animation-delay: 0.04s; }
.anim-stagger:nth-child(3) { animation-delay: 0.06s; }
.anim-stagger:nth-child(4) { animation-delay: 0.08s; }
.anim-stagger:nth-child(5) { animation-delay: 0.10s; }
.anim-stagger:nth-child(6) { animation-delay: 0.12s; }
.anim-stagger:nth-child(7) { animation-delay: 0.14s; }
.anim-stagger:nth-child(8) { animation-delay: 0.16s; }
.anim-stagger:nth-child(9) { animation-delay: 0.18s; }
.anim-stagger:nth-child(10) { animation-delay: 0.20s; }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ─── Typography ─── */
h1, h2, h3, h4 { color: var(--text-title); font-weight: 600; letter-spacing: -0.02em; }
.text-muted { color: var(--text-muted); }
.text-soft { color: var(--text-soft); }

/* ═══════════════════════════════════════════
            LOGIN PAGE
   ═══════════════════════════════════════════ */
.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: var(--bg-base);
  background-image: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(124, 92, 252, 0.08), transparent), radial-gradient(ellipse 60% 40% at 80% 90%, rgba(124, 92, 252, 0.04), transparent);
  padding: 20px;
}
.login-container { width: 100%; max-width: 400px; }
.login-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 40px 32px; box-shadow: var(--shadow-xl), var(--shadow-glow);
  animation: fadeUp 0.5s var(--ease-out);
}
.login-header { text-align: center; margin-bottom: 28px; }
.logo-icon {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--accent-base), #a78bfa);
  border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px; box-shadow: 0 4px 12px rgba(124, 92, 252, 0.3);
}
.login-header h1 { font-size: 22px; font-weight: 700; color: var(--text-title); }
.subtitle { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; color: var(--text-soft);
  text-transform: uppercase; letter-spacing: 0.6px;
}
.form-group input, .form-group textarea, .search-input, .select-input {
  background: var(--bg-raised); border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; color: var(--text-body); font-size: 14px; font-family: inherit;
  transition: all 0.2s var(--ease); outline: none;
}
.form-group input:focus, .form-group textarea:focus, .search-input:focus, .select-input:focus {
  border-color: var(--accent-base); box-shadow: 0 0 0 3px var(--accent-glow), var(--shadow-sm);
}
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-dim); }
.form-group textarea { resize: vertical; min-height: 100px; line-height: 1.6; }
.login-footer { text-align: center; margin-top: 20px; }
.login-footer p { color: var(--text-dim); font-size: 11px; }

/* ═══════════════════════════════════════════
            BUTTONS
   ═══════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border: none; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; font-family: inherit;
  cursor: pointer; transition: all 0.2s var(--ease); position: relative;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent-base), #9175ff);
  color: white; box-shadow: 0 2px 8px rgba(124, 92, 252, 0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(124, 92, 252, 0.4); }
.btn-primary:active { transform: translateY(0); }
.btn-block { width: 100%; padding: 12px 20px; }
.btn-ghost { background: transparent; color: var(--text-soft); padding: 8px; border-radius: var(--radius-sm); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-body); }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: var(--radius-xs); }
.btn-xs { padding: 4px 8px; font-size: 11px; border-radius: var(--radius-xs); }
.btn-danger { background: var(--red-subtle); color: var(--red); }
.btn-danger:hover { background: rgba(231, 76, 60, 0.18); }
.btn-icon {
  background: transparent; border: none; color: var(--text-soft);
  cursor: pointer; padding: 8px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s var(--ease);
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text-body); }
.btn-icon.starred { color: var(--gold); }
.btn-icon.danger:hover { background: var(--red-subtle); color: var(--red); }
.btn.loading { color: transparent !important; pointer-events: none; }
.btn.loading::after {
  content: ''; position: absolute; width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.25); border-top-color: white;
  border-radius: 50%; animation: spin 0.6s linear infinite;
}

/* ═══════════════════════════════════════════
            ALERTS & TOASTS
   ═══════════════════════════════════════════ */
.alert {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 13px; animation: fadeDown 0.3s var(--ease);
}
.alert-error { background: var(--red-subtle); border: 1px solid rgba(231,76,60,0.25); color: var(--red); }
.alert-success { background: var(--green-subtle); border: 1px solid rgba(46,204,113,0.25); color: var(--green); }

.toast-container {
  position: fixed; top: 20px; right: 20px; z-index: 2000;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px; padding: 14px 20px;
  border-radius: var(--radius-sm); background: var(--bg-elevated);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  font-size: 13px; font-weight: 500; pointer-events: auto;
  animation: toastIn 0.35s var(--ease-bounce) forwards;
  min-width: 260px; max-width: 420px; backdrop-filter: blur(12px);
}
.toast.removing { animation: toastOut 0.25s var(--ease) forwards; }
.toast-success { border-color: rgba(46,204,113,0.3); background: rgba(46,204,113,0.08); color: var(--green); }
.toast-error { border-color: rgba(231,76,60,0.3); background: rgba(231,76,60,0.08); color: var(--red); }
.toast-info { border-color: rgba(124,92,252,0.3); background: rgba(124,92,252,0.08); color: #a78bfa; }

.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(11,11,20,0.65); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center; z-index: 1000;
  animation: fadeIn 0.2s var(--ease);
}
.loading-overlay.active { display: flex; }
.loading-spinner {
  width: 36px; height: 36px;
  border: 2.5px solid var(--border-light); border-top-color: var(--accent-base);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}

/* ═══════════════════════════════════════════
            APP LAYOUT
   ═══════════════════════════════════════════ */
.app-layout { display: flex; height: 100vh; overflow: hidden; }
.page-enter { animation: fadeUp 0.35s var(--ease); }

.sidebar {
  width: var(--sidebar-w); background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; flex-shrink: 0;
}
.sidebar-header { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.logo-sm { display: flex; align-items: center; gap: 10px; }
.logo-text { font-size: 16px; font-weight: 700; letter-spacing: -0.3px; }
.sidebar-nav { flex: 1; padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  color: var(--text-soft); font-size: 14px; font-weight: 500;
  transition: all 0.15s var(--ease); cursor: pointer;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-body); }
.nav-item.active { background: var(--accent-subtle); color: var(--accent-base); }
.nav-item .badge {
  margin-left: auto; background: var(--accent-base); color: white;
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: var(--radius-full);
  min-width: 20px; text-align: center;
}
.sidebar-bottom {
  padding: 12px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 4px;
}
.user-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-base), #a78bfa); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px; flex-shrink: 0;
}
.user-details { display: flex; flex-direction: column; min-width: 0; }
.user-email { font-size: 13px; font-weight: 600; color: var(--text-title); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-domain { font-size: 11px; color: var(--text-muted); }

.main-content { flex: 1; display: flex; overflow: hidden; }

/* ═══════════════════════════════════════════
            MAIL LIST PANEL
   ═══════════════════════════════════════════ */
.mail-list-panel { width: 380px; min-width: 320px; border-right: 1px solid var(--border); display: flex; flex-direction: column; background: var(--bg-surface); }
.panel-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.panel-header h2 { font-size: 16px; font-weight: 600; }
.mail-count { font-size: 12px; color: var(--text-muted); }
.mail-list { flex: 1; overflow-y: auto; }

.mail-item {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background 0.15s var(--ease);
}
.mail-item:hover { background: var(--bg-hover); }
.mail-item.selected { background: var(--bg-active); border-left: 3px solid var(--accent-base); padding-left: 17px; }
.mail-item.unread .mail-from, .mail-item.unread .mail-subject { font-weight: 600; color: var(--text-title); }
.mail-item-top { display: flex; justify-content: space-between; align-items: center; }
.mail-from { font-size: 13px; font-weight: 500; color: var(--text-title); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 70%; }
.mail-date { font-size: 11px; color: var(--text-dim); flex-shrink: 0; }
.mail-item-mid { display: flex; align-items: center; gap: 6px; }
.mail-subject { font-size: 13px; color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.star-icon { flex-shrink: 0; cursor: pointer; line-height: 0; }
.mail-item-bottom { margin-top: 2px; }
.mail-preview { font-size: 12px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

/* ═══════════════════════════════════════════
            MAIL DETAIL PANEL
   ═══════════════════════════════════════════ */
.mail-detail-panel { flex: 1; display: flex; flex-direction: column; background: var(--bg-base); }
.mail-detail-panel.empty { align-items: center; justify-content: center; }
.empty-detail { display: flex; flex-direction: column; align-items: center; gap: 16px; color: var(--text-muted); font-size: 14px; }
.mail-detail-header {
  padding: 12px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.detail-actions { display: flex; gap: 4px; margin-left: auto; }
.mail-detail-body { padding: 24px; overflow-y: auto; flex: 1; }
.detail-subject { font-size: 22px; font-weight: 700; margin-bottom: 20px; letter-spacing: -0.5px; line-height: 1.3; }
.detail-meta { display: flex; align-items: center; gap: 12px; padding-bottom: 20px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.detail-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-base), #a78bfa); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 16px; flex-shrink: 0;
}
.detail-from-info { flex: 1; display: flex; flex-direction: column; }
.detail-from { font-weight: 600; font-size: 14px; }
.detail-to { font-size: 12px; color: var(--text-muted); }
.detail-date { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.detail-body { font-size: 14px; line-height: 1.8; color: var(--text-body); white-space: pre-wrap; }

/* ═══════════════════════════════════════════
            ADMIN
   ═══════════════════════════════════════════ */
.admin-content { overflow-y: auto; padding: 0; }
.admin-panel { max-width: 860px; margin: 0 auto; padding: 32px 24px; width: 100%; }
.admin-panel .panel-header { padding: 0 0 24px 0; border-bottom: 1px solid var(--border); margin-bottom: 24px; display: flex; align-items: center; gap: 12px; }
.admin-panel .panel-header h2 { display: flex; align-items: center; gap: 10px; font-size: 20px; }
.badge-admin { background: var(--orange); color: #fff; font-size: 10px; font-weight: 700; padding: 3px 10px; border-radius: 4px; letter-spacing: 1px; }
.admin-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 24px; margin-bottom: 20px; }
.admin-card h3 { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; margin-bottom: 16px; color: var(--text-title); }
.text-muted { color: var(--text-muted); font-size: 13px; margin-bottom: 16px; }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }
.admin-form { display: flex; flex-direction: column; gap: 16px; }
.examples-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.example-btn {
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; color: var(--text-soft); font-size: 12px; font-weight: 500;
  cursor: pointer; display: flex; align-items: center; gap: 8px;
  transition: all 0.2s var(--ease); font-family: inherit; text-align: left;
}
.example-btn:hover { background: var(--bg-hover); border-color: var(--accent-base); color: var(--text-body); }
.admin-mail-table { display: flex; flex-direction: column; }
.table-header { display: flex; gap: 12px; padding: 10px 12px; background: var(--bg-raised); border-radius: var(--radius-sm) var(--radius-sm) 0 0; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.table-header span:first-child { flex: 2; }
.table-header span:nth-child(2) { flex: 3; }
.table-header span:nth-child(3) { flex: 1.5; }
.table-header span:last-child { flex: 1; text-align: right; }
.table-row { display: flex; gap: 12px; padding: 12px; border-bottom: 1px solid var(--border); align-items: center; font-size: 13px; }
.table-row:hover { background: var(--bg-hover); }
.cell-from { flex: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-subject { flex: 3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-date { flex: 1.5; color: var(--text-muted); font-size: 12px; }
.cell-actions { flex: 1; text-align: right; }

/* ═══════════════════════════════════════════
            LOGS
   ═══════════════════════════════════════════ */
.log-stats { display: flex; gap: 24px; }
.stat { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text-title); }
.stat-value.green { color: var(--green); }
.stat-value.red { color: var(--red); }
.stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 500; }
.log-filters { display: flex; gap: 12px; margin-bottom: 16px; }
.search-input { flex: 1; }
.select-input { width: 200px; background: var(--bg-raised); border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; color: var(--text-body); font-size: 13px; font-family: inherit; outline: none; cursor: pointer; }
.select-input:focus { border-color: var(--accent-base); box-shadow: 0 0 0 3px var(--accent-glow); }
.log-entries { display: flex; flex-direction: column; gap: 4px; max-height: 600px; overflow-y: auto; font-family: 'SF Mono','Fira Code','Cascadia Code',monospace; font-size: 12px; }
.log-entry { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--bg-raised); border-left: 3px solid var(--border-light); line-height: 1.5; }
.log-entry.green { border-left-color: var(--green); }
.log-entry.red { border-left-color: var(--red); }
.log-entry.orange { border-left-color: var(--orange); }
.log-entry.purple { border-left-color: var(--accent-base); }
.log-line { word-break: break-all; color: var(--text-soft); }
.log-entry.green .log-line { color: var(--green); }
.log-entry.red .log-line { color: var(--red); }
.log-entry.orange .log-line { color: var(--gold); }
.log-entry.purple .log-line { color: #a78bfa; }

.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; color: var(--text-muted); gap: 12px; }

/* ═══════════════════════════════════════════
            MOBILE
   ═══════════════════════════════════════════ */
.mobile-toggle { display: none; background: none; border: none; color: var(--text-title); cursor: pointer; padding: 8px; border-radius: var(--radius-sm); }
.mobile-toggle:hover { background: var(--bg-hover); }
.mobile-header { display: none; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--bg-surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.back-btn { display: none !important; }

@media (max-width: 1024px) {
  .mail-list-panel { width: 320px; min-width: 280px; }
  .admin-panel { padding: 24px 16px; }
  .form-row { flex-direction: column; gap: 12px; }
  .examples-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

@media (max-width: 768px) {
  .app-layout { flex-direction: column; }
  .sidebar { display: none; width: 100%; height: auto; max-height: calc(100vh - 56px); overflow-y: auto; border-right: none; border-bottom: 1px solid var(--border); position: fixed; top: 56px; left: 0; right: 0; z-index: 99; background: var(--bg-surface); box-shadow: var(--shadow-lg); }
  .sidebar.open { display: flex; }
  .sidebar-header { display: none; }
  .sidebar-nav { padding: 8px; }
  .sidebar-bottom { border-top: 1px solid var(--border); }
  .mobile-header { display: flex; }
  .mobile-toggle { display: flex; align-items: center; justify-content: center; }
  .main-content { flex-direction: column; overflow: visible; min-height: calc(100vh - 56px); }
  .mail-list-panel { width: 100%; min-width: 0; border-right: none; max-height: 100vh; }
  .mail-list-panel.has-selected { display: none; }
  .mail-detail-panel { width: 100%; }
  .mail-detail-panel.empty { display: none; }
  .back-btn { display: inline-flex !important; align-items: center; gap: 6px; background: none; border: none; color: var(--text-soft); cursor: pointer; padding: 6px 10px; border-radius: var(--radius-sm); font-size: 13px; font-family: inherit; }
  .back-btn:hover { background: var(--bg-hover); color: var(--text-body); }
  .mail-detail-header { padding: 10px 16px; }
  .mail-detail-body { padding: 16px; }
  .detail-subject { font-size: 18px; }
  .detail-meta { flex-wrap: wrap; }
  .detail-date { width: 100%; margin-top: -8px; padding-left: 52px; }
  .admin-panel { padding: 16px 12px; }
  .admin-card { padding: 16px; }
  .table-header { display: none; }
  .table-row { flex-direction: column; gap: 4px; padding: 12px; border-bottom: 1px solid var(--border); }
  .table-row .cell-from { font-weight: 600; font-size: 13px; }
  .table-row .cell-subject { font-size: 13px; color: var(--text-soft); }
  .table-row .cell-date { font-size: 11px; color: var(--text-muted); }
  .table-row .cell-actions { text-align: left; margin-top: 4px; }
  .examples-grid { grid-template-columns: 1fr 1fr; }
  .log-stats { gap: 16px; justify-content: space-around; }
  .stat-value { font-size: 22px; }
  .log-filters { flex-direction: column; gap: 8px; }
  .log-filters .select-input { width: 100%; }
  .log-entries { max-height: 400px; }
  .admin-panel .panel-header { flex-wrap: wrap; }
  .login-card { padding: 32px 24px; }
}

@media (max-width: 480px) {
  .examples-grid { grid-template-columns: 1fr; }
  .login-card { padding: 24px 16px; border-radius: var(--radius-md); }
  .logo-icon { width: 40px; height: 40px; }
  .login-header h1 { font-size: 20px; }
  .mail-item { padding: 10px 14px; }
  .admin-card h3 { font-size: 14px; }
}
