/* ============================================================
   THIDROCALIDOS MAIL — Design System
   Dark mode · Indigo/Violet accent · Inter font
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

:root {
  --bg-base:        #07070f;
  --bg-sidebar:     #0d0d1a;
  --bg-card:        #111122;
  --bg-card-hover:  #181830;
  --bg-elevated:    #1a1a35;
  --bg-input:       #0f0f20;

  --accent:         #6366f1;
  --accent-hover:   #7c7ff5;
  --accent-light:   rgba(99,102,241,0.12);
  --accent-glow:    rgba(99,102,241,0.35);
  --violet:         #8b5cf6;

  --text-primary:   #e8eaf6;
  --text-secondary: #9098c0;
  --text-muted:     #5a6080;

  --border:         rgba(99,102,241,0.14);
  --border-light:   rgba(255,255,255,0.06);

  --danger:         #ef4444;
  --danger-light:   rgba(239,68,68,0.12);

  --sidebar-w:      260px;
  --header-h:       60px;
  --font:           'Inter', system-ui, sans-serif;
  --t:              180ms ease;
  --t-slow:         320ms ease;

  --shadow-sm:   0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 20px var(--accent-glow);
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── Utility ─────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Login Page ──────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  position: relative;
  overflow: hidden;
}

.login-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% -10%, rgba(99,102,241,0.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 110%, rgba(139,92,246,0.14) 0%, transparent 60%);
  pointer-events: none;
}

.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: orbFloat 8s ease-in-out infinite;
}
.login-orb-1 { width: 400px; height: 400px; background: rgba(99,102,241,0.12); top: -100px; left: -100px; }
.login-orb-2 { width: 300px; height: 300px; background: rgba(139,92,246,0.1); bottom: -80px; right: -80px; animation-delay: -4s; }

@keyframes orbFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-30px) scale(1.05); }
}

.login-card {
  position: relative;
  width: 420px;
  max-width: calc(100vw - 32px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 48px 40px;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(99,102,241,0.08);
  animation: loginFadeIn 0.5s ease;
}

@keyframes loginFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 36px; }
.login-logo-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-glow);
}
.login-logo-icon svg { width: 22px; height: 22px; color: white; }
.login-logo-text { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; }

.login-headline { font-size: 24px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 6px; }
.login-sub { font-size: 14px; color: var(--text-secondary); margin-bottom: 32px; }

.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 15px;
  font-family: var(--font);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.form-input::placeholder { color: var(--text-muted); }

.btn-primary {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  color: white;
  cursor: pointer;
  transition: transform var(--t), box-shadow var(--t);
  box-shadow: 0 4px 20px var(--accent-glow);
  margin-top: 8px;
}
.btn-primary:hover  { transform: translateY(-1px); box-shadow: 0 6px 28px var(--accent-glow); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.login-error {
  background: var(--danger-light);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  color: #fca5a5;
  margin-top: 14px;
  display: none;
}
.login-error.visible { display: block; animation: shake 0.3s ease; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-6px); }
  75%       { transform: translateX(6px); }
}

/* ── App Layout ──────────────────────────────────────────── */
.app { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  height: 100vh;
  transition: transform var(--t-slow);
  z-index: 20;
  flex-shrink: 0;
}

.sidebar-header {
  height: var(--header-h);
  padding: 0 20px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.sidebar-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.sidebar-logo-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-logo-icon svg { width: 17px; height: 17px; color: white; }
.sidebar-logo-text { font-size: 15px; font-weight: 700; letter-spacing: -0.3px; }

.btn-compose {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 16px 12px;
  padding: 11px 16px;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: transform var(--t), box-shadow var(--t);
  box-shadow: 0 3px 14px var(--accent-glow);
  flex-shrink: 0;
}
.btn-compose:hover { transform: translateY(-1px); box-shadow: 0 5px 20px var(--accent-glow); }
.btn-compose svg { width: 18px; height: 18px; }

.sidebar-search {
  margin: 0 16px 12px;
  position: relative;
  flex-shrink: 0;
}
.sidebar-search input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 9px 12px 9px 36px;
  font-size: 13px;
  font-family: var(--font);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--t);
}
.sidebar-search input:focus { border-color: var(--accent); }
.sidebar-search input::placeholder { color: var(--text-muted); }
.sidebar-search-icon {
  position: absolute;
  left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted);
  width: 15px; height: 15px;
  pointer-events: none;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 4px 20px 8px;
  flex-shrink: 0;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding-bottom: 8px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 16px;
  margin: 1px 8px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background var(--t), color var(--t);
  border: none;
  background: none;
  width: calc(100% - 16px);
  text-align: left;
  font-family: var(--font);
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.nav-item.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }
.nav-item.active svg { color: var(--accent); }

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 100px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
}
.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  cursor: default;
  transition: background var(--t);
}
.user-card:hover { background: var(--bg-card-hover); }
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: white;
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name  { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-logout {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 6px;
  border-radius: 6px; transition: color var(--t);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.btn-logout:hover { color: var(--danger); }
.btn-logout svg { width: 16px; height: 16px; display: block; }

/* ── Main Area ───────────────────────────────────────────── */
.main { flex: 1; display: flex; overflow: hidden; min-width: 0; }

/* ── Email List Panel ────────────────────────────────────── */
.email-list-panel {
  width: 340px;
  min-width: 280px;
  flex-shrink: 0;
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  background: var(--bg-base);
  overflow: hidden;
}

.panel-header {
  height: var(--header-h);
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}
.panel-header-title { flex: 1; min-width: 0; }
.panel-title { font-size: 15px; font-weight: 700; letter-spacing: -0.3px; }
.panel-subtitle { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.panel-actions { display: flex; gap: 4px; align-items: center; }

.icon-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-muted);
  transition: background var(--t), color var(--t);
}
.icon-btn:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.icon-btn svg { width: 17px; height: 17px; }

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

.email-item {
  padding: 13px 18px 13px 22px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background var(--t);
  position: relative;
}
.email-item:hover { background: var(--bg-card-hover); }
.email-item.active { background: var(--accent-light); border-left: 3px solid var(--accent); padding-left: 19px; }

/* Dot for unread */
.email-item.unread::before {
  content: '';
  position: absolute;
  left: 8px; top: 50%; transform: translateY(-50%);
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.email-item.unread .email-item-from    { font-weight: 700; color: var(--text-primary); }
.email-item.unread .email-item-subject { font-weight: 600; color: var(--text-primary); }

.email-item-row1  { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.email-item-from  { font-size: 13px; font-weight: 500; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.email-item-date  { font-size: 11px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.email-item-subject { font-size: 13px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; }
.email-item-preview { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.email-item-icons { display: flex; gap: 4px; align-items: center; margin-top: 4px; }
.tag-attachment { display: flex; align-items: center; gap: 3px; font-size: 10px; color: var(--text-muted); }
.tag-attachment svg { width: 10px; height: 10px; }

.email-list-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  gap: 12px;
  text-align: center;
  padding: 40px 20px;
}
.email-list-empty svg { width: 48px; height: 48px; opacity: 0.25; }
.email-list-empty p { font-size: 14px; }

/* ── Email View Panel ────────────────────────────────────── */
.email-view-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-base);
  min-width: 0;
}

/* Vista vacía */
.email-view-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  gap: 16px;
  text-align: center;
  padding: 40px;
}
.email-view-empty svg { width: 64px; height: 64px; opacity: 0.12; }
.email-view-empty h3 { font-size: 18px; font-weight: 600; color: var(--text-secondary); }
.email-view-empty p  { font-size: 14px; max-width: 280px; line-height: 1.6; }

/* Contenido del email seleccionado */
.email-view-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.email-view-header {
  padding: 20px 28px 16px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
  overflow-y: auto;
  max-height: 220px;
}
.email-view-subject {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin-bottom: 14px;
  line-height: 1.3;
  color: var(--text-primary);
}
.email-view-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.email-view-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: white;
  flex-shrink: 0;
}
.email-view-from      { flex: 1; min-width: 0; }
.email-view-from-name { font-size: 14px; font-weight: 600; }
.email-view-from-addr { font-size: 12px; color: var(--text-muted); }
.email-view-date      { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

.email-view-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.btn-action {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--t), color var(--t), border-color var(--t);
}
.btn-action:hover        { background: var(--bg-elevated); color: var(--text-primary); border-color: var(--accent); }
.btn-action.danger:hover { border-color: var(--danger); color: #fca5a5; background: var(--danger-light); }
.btn-action svg { width: 14px; height: 14px; }

.email-view-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}

/* Email iframe container */
.email-frame-wrap {
  max-width: 740px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  overflow: hidden;
}
.email-frame-wrap iframe {
  width: 100%;
  border: none;
  display: block;
  min-height: 200px;
}

/* ── Composer ─────────────────────────────────────────────── */
.composer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.composer-overlay.visible { opacity: 1; pointer-events: all; }

.composer {
  width: 560px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 60px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg), 0 0 40px rgba(99,102,241,0.1);
  animation: composerUp 0.25s ease;
}
.composer.maximized {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  border: none !important;
  z-index: 110 !important;
}
.composer-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
/* Estilo del dropdown de Autocompletado */
.autocomplete-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  max-height: 180px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: var(--shadow-md);
}
.autocomplete-suggestion {
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  transition: background var(--t);
}
.autocomplete-suggestion:last-child { border-bottom: none; }
.autocomplete-suggestion:hover, .autocomplete-suggestion.active {
  background: var(--bg-card-hover);
}
.autocomplete-suggestion-name { font-weight: 600; color: var(--text-primary); }
.autocomplete-suggestion-email { font-size: 11px; color: var(--text-muted); }
@keyframes composerUp {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.composer-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.composer-title { font-size: 14px; font-weight: 700; }
.composer-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 4px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: color var(--t);
}
.composer-close:hover { color: var(--danger); }
.composer-close svg { width: 18px; height: 18px; }

.composer-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--border-light);
}
.composer-field-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: 44px;
  flex-shrink: 0;
}
.composer-field input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 14px;
  font-family: var(--font);
  color: var(--text-primary);
}
.composer-field input::placeholder { color: var(--text-muted); }

.composer-toolbar {
  padding: 6px 14px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}
.toolbar-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 5px 8px;
  border-radius: 6px; font-size: 13px; font-weight: 600;
  font-family: var(--font);
  transition: background var(--t), color var(--t);
  display: flex; align-items: center; justify-content: center;
}
.toolbar-btn:hover { background: var(--bg-elevated); color: var(--text-primary); }
.toolbar-btn svg { width: 14px; height: 14px; }

.composer-body { flex: 1; overflow-y: auto; min-height: 180px; }
.composer-editor {
  width: 100%;
  min-height: 180px;
  padding: 14px 18px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--text-primary);
  line-height: 1.65;
  outline: none;
}
.composer-editor:empty::before {
  content: attr(placeholder);
  color: var(--text-muted);
  pointer-events: none;
}

.composer-footer {
  padding: 10px 18px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.composer-footer-left { display: flex; gap: 6px; align-items: center; }
.composer-attach-count { font-size: 12px; color: var(--text-muted); }

.btn-send {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  color: white;
  cursor: pointer;
  transition: transform var(--t), box-shadow var(--t);
  box-shadow: 0 3px 14px var(--accent-glow);
}
.btn-send:hover   { transform: translateY(-1px); box-shadow: 0 5px 20px var(--accent-glow); }
.btn-send:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-send svg { width: 15px; height: 15px; }

/* ── Toasts ──────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 16px; right: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  color: white;
  box-shadow: var(--shadow-md);
  animation: toastIn 0.25s ease forwards;
  pointer-events: all;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 300px;
}
.toast-success { background: linear-gradient(135deg, #059669, #10b981); }
.toast-error   { background: linear-gradient(135deg, #dc2626, #ef4444); }
.toast-info    { background: linear-gradient(135deg, var(--accent), var(--violet)); }
.toast svg { width: 15px; height: 15px; flex-shrink: 0; }

@keyframes toastIn  { from { opacity:0; transform:translateX(16px); } to { opacity:1; transform:translateX(0); } }
@keyframes toastOut { to   { opacity:0; transform:translateX(16px); } }
.toast.out { animation: toastOut 0.25s ease forwards; }

/* ── Spinner ─────────────────────────────────────────────── */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
}

/* ── Skeletons ───────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.skeleton-item    { padding: 14px 18px; border-bottom: 1px solid var(--border-light); }
.skeleton-row1    { display: flex; gap: 8px; margin-bottom: 8px; }
.skeleton-from    { height: 12px; width: 120px; }
.skeleton-date    { height: 12px; width: 55px; margin-left: auto; }
.skeleton-subject { height: 12px; width: 80%; margin-bottom: 8px; }
.skeleton-preview { height: 11px; width: 60%; }

/* ── Pagination ──────────────────────────────────────────── */
.pagination {
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
}
.pagination-info { font-size: 12px; color: var(--text-muted); }
.pagination-btns { display: flex; gap: 6px; }
.btn-page {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 12px;
  font-family: var(--font);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color var(--t), color var(--t);
}
.btn-page:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn-page:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Hamburger button ────────────────────────────────────── */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 5px;
  border-radius: 8px;
  flex-shrink: 0;
  transition: color var(--t);
}
.mobile-menu-btn:hover { color: var(--text-primary); }
.mobile-menu-btn svg { width: 20px; height: 20px; display: block; }

/* ── Sidebar overlay ─────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 30;
}
.sidebar-overlay.visible { display: block; }

/* ── Responsive: Tablet (≤ 900px) ───────────────────────── */
@media (max-width: 900px) {
  /* Sidebar se vuelve drawer */
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 40;
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }

  /* Mostrar botón hamburguesa */
  .mobile-menu-btn { display: flex; }

  /* Lista ocupa todo el ancho */
  .email-list-panel { width: 100%; max-width: 100%; border-right: none; flex-shrink: 1; }

  /* Vista de email se abre en overlay fullscreen */
  .email-view-panel { display: none; }
  .email-view-panel.mobile-open {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 50;
    background: var(--bg-base);
  }
  .mobile-back-bar {
    display: flex !important;
    align-items: center;
    padding: 12px 18px;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-light);
    height: 54px;
    flex-shrink: 0;
  }
}

.mobile-back-bar {
  display: none;
}

/* ── Responsive: Mobile (≤ 480px) ───────────────────────── */
@media (max-width: 480px) {
  .login-card { padding: 36px 24px; }
  .composer { max-height: calc(100vh - 20px); }
  .composer-overlay { padding: 10px; }
  .email-view-header { padding: 16px 18px 12px; }
  .email-view-body { padding: 16px 18px; }
  .email-view-subject { font-size: 16px; }
  .btn-action span { display: none; } /* Solo iconos en móvil */
}
