/* =========================================
   PANEL DE ADMINISTRACIÓN - CSS OPTIMIZADO
   Basado en las variables de style.css
   ========================================= */

/* ===== LAYOUT PRINCIPAL ===== */
body { 
  background: var(--light-gray);
  min-height: 100vh;
}

.adm-wrap { 
  max-width: 1400px; 
  margin: 0 auto; 
  padding: 20px;
}

/* ===== TOPBAR MEJORADO ===== */
.adm-topbar {
  display: flex; 
  align-items: center; 
  gap: 16px; 
  justify-content: space-between;
  padding: 14px 20px; 
  border: 1px solid var(--border-color); 
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95); 
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-md);
  position: sticky; 
  top: 16px; 
  z-index: 100;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.adm-topbar:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.adm-brand {
  display: flex; 
  align-items: center; 
  gap: 12px; 
  font-weight: 800; 
  font-family: 'Sora', sans-serif;
  color: var(--dark-color);
  font-size: 1.1rem;
  white-space: nowrap;
}

.adm-brand i { 
  color: var(--accent-color);
  font-size: 1.3rem;
}

/* Search mejorado */
.adm-search {
  flex: 1; 
  display: flex; 
  align-items: center; 
  gap: 12px;
  max-width: 600px;
  background: var(--white-color);
  border: 2px solid var(--border-color);
  border-radius: 999px;
  padding: 12px 20px;
  opacity: 0.6;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.adm-search.on {
  opacity: 1;
  pointer-events: auto;
}

.adm-search:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
  background: var(--white-color);
}

.adm-search i {
  color: var(--text-secondary);
  transition: color 0.3s;
}

.adm-search:focus-within i {
  color: var(--primary-color);
}

.adm-search input {
  width: 100%; 
  border: 0; 
  outline: 0; 
  background: transparent;
  font-size: 0.95rem; 
  color: var(--text-color);
  font-weight: 500;
}

.adm-search input::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

.search-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: var(--light-gray);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.search-clear:hover {
  background: var(--primary-color);
  color: var(--white-color);
  transform: rotate(90deg);
}

/* User controls */
.adm-user { 
  display: flex; 
  align-items: center; 
  gap: 10px; 
}

.pill {
  border: 1px solid var(--border-color);
  background: var(--white-color);
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.pill:hover {
  border-color: var(--primary-color);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.pill.primary {
  background: var(--gradient-1);
  border: 0;
  color: var(--white-color);
  box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.3);
}

.pill.primary:hover {
  box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.4);
  transform: translateY(-2px);
}

.pill-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

.user-pill {
  background: var(--light-gray);
  border-color: var(--border-color);
  cursor: default;
}

.user-pill:hover {
  transform: none;
}

/* ===== GATE (PANTALLA DE LOGIN) ===== */
.gate {
  margin-top: 24px;
  border: 1px solid var(--border-color); 
  border-radius: 20px;
  background: var(--white-color);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  animation: fadeIn 0.5s ease;
}

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

.gate-card { 
  max-width: 520px; 
  width: 100%;
}

.gate-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: var(--gradient-1);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.3);
}

.gate-icon i {
  font-size: 2.5rem;
  color: var(--white-color);
}

.gate-title {
  font-family: 'Sora', sans-serif;
  font-weight: 900;
  font-size: 1.8rem;
  color: var(--dark-color);
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.gate-description {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 24px;
}

.gate-actions {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hint {
  margin-top: 20px;
  font-size: 0.92rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0.9;
}

.hint i {
  color: var(--primary-color);
}

/* ===== LAYOUT DE LA APP ===== */
.adm-layout {
  display: grid; 
  grid-template-columns: 300px 1fr;
  gap: 20px; 
  margin-top: 20px;
  animation: slideIn 0.5s ease;
}

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

/* ===== SIDEBAR ===== */
.adm-side {
  border: 1px solid var(--border-color); 
  border-radius: 16px;
  background: var(--white-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  height: fit-content;
  position: sticky;
  top: 100px;
  transition: box-shadow 0.3s;
}

.adm-side:hover {
  box-shadow: var(--shadow-md);
}

.side-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex; 
  gap: 12px; 
  align-items: center; 
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.05) 0%, transparent 100%);
}

.side-title { 
  font-weight: 800; 
  font-family: 'Sora', sans-serif; 
  color: var(--dark-color);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
}

.side-title i {
  color: var(--primary-color);
}

/* Navigation mejorada */
.side-nav { 
  padding: 12px; 
  display: flex; 
  flex-direction: column; 
  gap: 6px; 
}

.nav-item {
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
  color: var(--text-color);
  font-weight: 600;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
  background: var(--gradient-1);
  transform: scaleY(0);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-item i {
  width: 20px;
  text-align: center;
  transition: transform 0.25s;
}

.nav-item:hover {
  background: rgba(var(--primary-rgb), 0.08); 
  color: var(--primary-color);
  padding-left: 18px;
}

.nav-item:hover i {
  transform: scale(1.1);
}

.nav-item.active {
  background: rgba(var(--primary-rgb), 0.12); 
  color: var(--primary-color);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.nav-item.active::before {
  transform: scaleY(1);
}

.badge {
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(var(--primary-rgb), 0.12);
  color: var(--primary-dark);
  border: 1px solid rgba(var(--primary-rgb), 0.2);
  font-weight: 700;
  transition: all 0.2s;
}

.badge-primary {
  background: var(--gradient-1);
  color: var(--white-color);
  border: none;
  box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.3);
}

.nav-item:hover .badge {
  transform: scale(1.05);
}

/* ===== SETTINGS CARD ===== */
.side-settings {
  padding: 12px;
}

.settings-card {
  border: 1px solid var(--border-color); 
  border-radius: 14px; 
  padding: 16px; 
  background: linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(var(--accent-rgb), 0.03) 100%);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s;
}

.settings-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

.settings-header {
  display: flex; 
  align-items: flex-start; 
  justify-content: space-between; 
  gap: 14px;
  margin-bottom: 14px;
}

.settings-title {
  font-weight: 900; 
  font-family: 'Sora', sans-serif; 
  color: var(--dark-color);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
}

.settings-title i {
  color: var(--accent-color);
}

.settings-hint {
  color: var(--text-secondary); 
  font-size: 0.88rem; 
  margin-top: 6px;
  line-height: 1.5;
}

/* Toggle Switch mejorado */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-color);
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 34px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--gradient-1);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

.settings-status {
  margin-bottom: 14px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  transition: all 0.2s;
}

.status-active {
  background: rgba(16, 185, 129, 0.12); 
  border: 1px solid rgba(16, 185, 129, 0.25); 
  color: #0f766e;
}

.status-inactive {
  background: rgba(239, 68, 68, 0.12); 
  border: 1px solid rgba(239, 68, 68, 0.25); 
  color: #991b1b;
}

/* Form controls mejorados */
.settings-body {
  margin-top: 16px; 
  display: grid; 
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700; 
  color: var(--dark-color);
  font-size: 0.9rem;
}

.form-label i {
  color: var(--primary-color);
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  font-size: 0.92rem;
  color: var(--text-color);
  background: var(--white-color);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
}

.form-control::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

.form-hint {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--text-secondary); 
  font-size: 0.82rem;
  line-height: 1.5;
}

.form-hint i {
  color: var(--primary-color);
  margin-top: 2px;
  flex-shrink: 0;
}

.btn-save {
  width: 100%;
  padding: 12px 20px;
  background: var(--gradient-1);
  border: none;
  border-radius: 10px;
  color: var(--white-color);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

.btn-save:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(var(--primary-rgb), 0.4);
}

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

/* Alerts mejorados */
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.alert-success {
  border: 1px solid rgba(16, 185, 129, 0.25); 
  background: rgba(16, 185, 129, 0.1); 
  color: #0f766e;
}

.alert-error {
  border: 1px solid rgba(217, 48, 37, 0.25); 
  background: rgba(217, 48, 37, 0.08); 
  color: #991b1b;
}

/* ===== MAIN CONTENT ===== */
.adm-main {
  border: 1px solid var(--border-color); 
  border-radius: 16px;
  background: var(--white-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  min-height: 70vh;
  transition: box-shadow 0.3s;
}

.adm-main:hover {
  box-shadow: var(--shadow-md);
}

.main-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  gap: 12px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.03) 0%, transparent 100%);
}

.main-actions,
.main-tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chips { 
  display: flex; 
  gap: 8px; 
  flex-wrap: wrap; 
}

.chip {
  border: 2px solid var(--border-color);
  background: var(--white-color);
  color: var(--text-color);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.chip:hover {
  border-color: var(--primary-color);
  background: rgba(var(--primary-rgb), 0.05);
  transform: translateY(-1px);
}

.chip.active { 
  background: rgba(var(--primary-rgb), 0.15); 
  border-color: var(--primary-color); 
  color: var(--primary-dark);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.chip-icon {
  padding: 8px 12px;
}

/* ===== MAIL LIST ===== */
.mail-list { 
  display: flex; 
  flex-direction: column; 
}

.mail-row {
  display: grid;
  grid-template-columns: 42px 1fr 170px;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  align-items: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.mail-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
  background: var(--gradient-1);
  transform: scaleX(0);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.mail-row:hover {
  background: rgba(var(--primary-rgb), 0.04);
  padding-left: 22px;
}

.mail-row:hover::before {
  transform: scaleX(1);
}

.mail-row.unread {
  background: rgba(var(--primary-rgb), 0.03);
}

.mail-row.unread .mail-from,
.mail-row.unread .mail-subject { 
  font-weight: 800; 
  color: var(--dark-color); 
}

.mail-from { 
  font-weight: 650;
  transition: color 0.2s;
}

.mail-mid { 
  display: flex; 
  flex-direction: column; 
  gap: 4px; 
  min-width: 0; 
}

.mail-subject { 
  color: var(--text-color);
  line-height: 1.4;
}

.mail-snippet {
  color: var(--text-secondary);
  font-size: 0.9rem;
  white-space: nowrap; 
  overflow: hidden; 
  text-overflow: ellipsis;
  line-height: 1.3;
}

.mail-date {
  text-align: right;
  color: var(--text-secondary);
  font-size: 0.88rem;
  white-space: nowrap;
  font-weight: 600;
}

/* Star icon */
.star { 
  font-size: 1.2rem; 
  color: rgba(0, 0, 0, 0.15);
  transition: all 0.2s;
}

.star:hover {
  color: var(--accent-dark);
  transform: scale(1.1);
}

.star.on { 
  color: var(--accent-dark);
  filter: drop-shadow(0 2px 4px rgba(196, 154, 112, 0.3));
}

/* ===== READER (Vista de mensaje) ===== */
.reader {
  display: none;
  padding: 20px;
  animation: fadeIn 0.4s ease;
}

.reader.active { 
  display: block; 
}

.reader-top {
  display: flex; 
  align-items: flex-start; 
  justify-content: space-between; 
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border-color);
}

.reader h2 {
  font-family: 'Sora', sans-serif; 
  color: var(--dark-color);
  font-size: 1.5rem; 
  margin: 0;
  line-height: 1.3;
  letter-spacing: -0.5px;
}

.reader-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.reader-info {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--light-gray);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.reader-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.reader-label {
  font-weight: 700;
  color: var(--text-secondary);
  min-width: 100px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.reader-label i {
  color: var(--primary-color);
}

.reader-value {
  color: var(--text-color);
  font-weight: 600;
  flex: 1;
}

.reader-message {
  padding: 20px;
  background: var(--white-color);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  line-height: 1.8;
  color: var(--text-color);
  font-size: 1rem;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: min(520px, 100%);
  border-radius: 16px;
  background: var(--white-color);
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay[aria-hidden="false"] .modal-card {
  transform: scale(1);
}

.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, rgba(217, 48, 37, 0.05) 0%, transparent 100%);
}

.modal-title {
  font-family: 'Sora', sans-serif;
  font-weight: 900;
  color: var(--dark-color);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.1rem;
}

.modal-title i {
  color: #d93025;
  font-size: 1.3rem;
}

.modal-body {
  padding: 20px;
  color: var(--text-color);
  line-height: 1.7;
}

.modal-message {
  font-size: 1rem;
  margin-bottom: 12px;
}

.modal-preview {
  margin-top: 12px; 
  font-size: 0.9rem; 
  color: var(--text-secondary);
  padding: 12px;
  background: var(--light-gray);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.modal-actions {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--light-gray);
}

.btn-close {
  border: 1px solid var(--border-color);
  background: var(--light-gray);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.btn-close:hover {
  background: var(--white-color);
  color: var(--dark-color);
  transform: rotate(90deg);
}

.btn-danger {
  background: #d93025;
  color: #fff;
  border: 0;
  box-shadow: 0 4px 12px rgba(217, 48, 37, 0.3);
}

.btn-danger:hover {
  background: #c4281f;
  box-shadow: 0 6px 16px rgba(217, 48, 37, 0.4);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .adm-layout {
    grid-template-columns: 260px 1fr;
  }
}

@media (max-width: 900px) {
  .adm-layout {
    grid-template-columns: 1fr;
  }
  
  .adm-side {
    position: relative;
    top: 0;
  }
  
  .side-settings {
    margin-bottom: 20px;
  }
}

@media (max-width: 768px) {
  .adm-wrap {
    padding: 12px;
  }
  
  .adm-topbar {
    flex-wrap: wrap;
    padding: 12px 14px;
    top: 8px;
  }
  
  .adm-brand span {
    display: none;
  }
  
  .adm-search {
    order: 3;
    width: 100%;
    max-width: 100%;
  }
  
  .pill span {
    display: none;
  }
  
  .pill {
    padding: 10px 12px;
  }
  
  .user-pill {
    display: none !important;
  }
  
  .gate {
    padding: 30px 16px;
    min-height: 50vh;
  }
  
  .gate-title {
    font-size: 1.5rem;
  }
  
  .mail-row {
    grid-template-columns: 36px 1fr 100px;
    padding: 12px 14px;
  }
  
  .mail-date {
    font-size: 0.82rem;
  }
  
  .main-head {
    flex-direction: column;
    align-items: stretch;
  }
  
  .main-actions,
  .main-tools {
    width: 100%;
    justify-content: space-between;
  }
  
  .reader {
    padding: 16px;
  }
  
  .reader h2 {
    font-size: 1.3rem;
  }
  
  .reader-info {
    padding: 12px;
  }
  
  .reader-row {
    flex-direction: column;
    gap: 6px;
  }
  
  .reader-label {
    min-width: auto;
  }
}

@media (max-width: 520px) {
  .mail-row {
    grid-template-columns: 32px 1fr;
  }
  
  .mail-date {
    grid-column: 2;
    text-align: left;
    font-size: 0.78rem;
    margin-top: 4px;
  }
  
  .chip span {
    display: none;
  }
  
  .chip {
    padding: 8px 10px;
  }
}

/* ===== LOADING STATE ===== */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.loading {
  animation: pulse 1.5s ease-in-out infinite;
}

/* ===== SCROLLBAR PERSONALIZADO ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* ===== PRINT STYLES ===== */
@media print {
  .adm-topbar,
  .adm-side,
  .main-head,
  .reader-actions {
    display: none !important;
  }
  
  .adm-layout {
    grid-template-columns: 1fr;
  }
  
  .adm-main {
    border: none;
    box-shadow: none;
  }
}
