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


/* ══════════════════════════════════════════════════════
   SYNOPTYK COMMAND CENTER — CSS v2.0
   Premium dark glassmorphism CEO dashboard
══════════════════════════════════════════════════════ */
:root, .theme-light, .theme-google {
  --cc-bg: #f8f9fa;
  --cc-surface: #ffffff;
  --cc-surface-hover: #f1f3f4;
  --cc-border: #dadce0;
  --cc-border-active: #1a73e8;
  --cc-text: #202124;
  --cc-text-secondary: #3c4043;
  --cc-text-muted: #5f6368;
  --cc-accent: #1a73e8;
  --cc-accent-hover: #1557b0;
  
  --cc-topbar-bg: #ffffff;
  --cc-sidebar-bg: #1e1f20;
  --cc-sidebar-text: #bdc1c6;
  --cc-sidebar-text-hover: #ffffff;
  --cc-sidebar-border: #3c4043;
  --cc-icon-color: #1a73e8;
  
  --cc-sidebar-w: 240px;
  --cc-topbar-h: 56px;
  --cc-bottombar-h: 32px;
  --cc-transition: 0.15s ease-in-out;
  --cc-shadow: 0 1px 3px rgba(60,64,67,0.15);
}
.theme-dark {
  --cc-bg: #0f172a;
  --cc-surface: #1e293b;
  --cc-surface-hover: #334155;
  --cc-border: #334155;
  --cc-border-active: #60a5fa;
  --cc-text: #f8fafc;
  --cc-text-secondary: #cbd5e1;
  --cc-text-muted: #94a3b8;
  --cc-accent: #60a5fa;
  --cc-accent-hover: #3b82f6;
  
  --cc-topbar-bg: #1e293b;
  --cc-sidebar-bg: #020617;
  --cc-sidebar-text: #94a3b8;
  --cc-sidebar-text-hover: #f8fafc;
  --cc-sidebar-border: #0f172a;
  --cc-icon-color: #94a3b8;
}
.theme-gradient {
  --cc-bg: #f3f4f6;
  --cc-surface: #ffffff;
  --cc-surface-hover: #f1f5f9;
  --cc-border: #e2e8f0;
  --cc-border-active: #8b5cf6;
  --cc-text: #1e293b;
  --cc-text-secondary: #475569;
  --cc-text-muted: #64748b;
  --cc-accent: #8b5cf6;
  --cc-accent-hover: #7c3aed;
  
  --cc-topbar-bg: linear-gradient(135deg, #ffffff, #f8fafc);
  --cc-sidebar-bg: linear-gradient(180deg, #1e1b4b, #312e81);
  --cc-sidebar-text: #c7d2fe;
  --cc-sidebar-text-hover: #ffffff;
  --cc-sidebar-border: #3730a3;
  --cc-icon-color: #8b5cf6;
}
/* ══ OCEAN THEME ══ */
.theme-ocean {
  --cc-bg: #f0f9ff;
  --cc-surface: #ffffff;
  --cc-surface-hover: #e0f2fe;
  --cc-border: #bae6fd;
  --cc-border-active: #0ea5e9;
  --cc-text: #0c4a6e;
  --cc-text-secondary: #075985;
  --cc-text-muted: #0369a1;
  --cc-accent: #0ea5e9;
  --cc-accent-hover: #0284c7;
  --cc-topbar-bg: linear-gradient(90deg, #f0f9ff, #e0f2fe);
  --cc-sidebar-bg: linear-gradient(180deg, #0c4a6e 0%, #0369a1 100%);
  --cc-sidebar-text: #bae6fd;
  --cc-sidebar-text-hover: #ffffff;
  --cc-sidebar-border: #0284c7;
  --cc-icon-color: #0ea5e9;
}
/* ══ FOREST THEME ══ */
.theme-forest {
  --cc-bg: #f0fdf4;
  --cc-surface: #ffffff;
  --cc-surface-hover: #dcfce7;
  --cc-border: #bbf7d0;
  --cc-border-active: #16a34a;
  --cc-text: #052e16;
  --cc-text-secondary: #166534;
  --cc-text-muted: #15803d;
  --cc-accent: #16a34a;
  --cc-accent-hover: #15803d;
  --cc-topbar-bg: linear-gradient(90deg, #f0fdf4, #dcfce7);
  --cc-sidebar-bg: linear-gradient(180deg, #052e16 0%, #166534 100%);
  --cc-sidebar-text: #bbf7d0;
  --cc-sidebar-text-hover: #ffffff;
  --cc-sidebar-border: #15803d;
  --cc-icon-color: #16a34a;
}
/* ══ SUNSET THEME ══ */
.theme-sunset {
  --cc-bg: #fff7ed;
  --cc-surface: #ffffff;
  --cc-surface-hover: #ffedd5;
  --cc-border: #fed7aa;
  --cc-border-active: #f97316;
  --cc-text: #431407;
  --cc-text-secondary: #7c2d12;
  --cc-text-muted: #9a3412;
  --cc-accent: #f97316;
  --cc-accent-hover: #ea580c;
  --cc-topbar-bg: linear-gradient(90deg, #fff7ed, #ffedd5);
  --cc-sidebar-bg: linear-gradient(180deg, #431407 0%, #9a3412 100%);
  --cc-sidebar-text: #fed7aa;
  --cc-sidebar-text-hover: #ffffff;
  --cc-sidebar-border: #c2410c;
  --cc-icon-color: #f97316;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
.cc-body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--cc-bg);
  color: var(--cc-text);
  min-height: 100vh;
  overflow: hidden;
}
/* ════ VIDEO BG ════ */
.video-bg {
  display: none; 
}
.cc-overlay {
  position: fixed;
  inset: 0;
  background: var(--cc-bg);
  z-index: -1;
}
/* ════════════════════════════════════════
   COMMAND CENTER LAYOUT
════════════════════════════════════════ */
.command-center {
  display: flex !important;
  flex-direction: row !important;
  height: 100vh !important;
  width: 100vw !important;
  overflow: hidden !important;
}
/* ════════════════════════════════════════
   SIDEBAR
════════════════════════════════════════ */
.cc-sidebar {
  width: var(--cc-sidebar-w, 260px);
  height: 100vh;
  background: var(--cc-sidebar-bg, var(--cc-surface));
  border-right: 1px solid var(--cc-sidebar-border, var(--cc-border));
  box-shadow: 2px 0 10px rgba(0,0,0,0.03);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width var(--cc-transition);
  overflow: hidden;
  z-index: 100;
}
.cc-sidebar.collapsed { width: 72px; }
.cc-sidebar.collapsed .sidebar-brand-name,
.cc-sidebar.collapsed .nav-label,
.cc-sidebar.collapsed .nav-badge,
.cc-sidebar.collapsed .nav-section-label,
.cc-sidebar.collapsed .mini-user-info {
  opacity: 0;
  width: 0;
  overflow: hidden;
}
/* ════ MEDIA QUERY SIDEBAR MÓVIL ════ */
@media (max-width: 768px) {
  .cc-sidebar {
    position: fixed;
    left: -100%;
    z-index: 9999;
    box-shadow: 10px 0 30px rgba(0,0,0,0.1);
  }
  .cc-sidebar.mobile-open {
    left: 0;
  }
  /* Ocultar elementos de topbar en móvil para que quepa */
  .topbar-center { display: none; }
  .topbar-breadcrumb { display: none; }
}
/* Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1.4rem 1.2rem;
  border-bottom: 1px solid var(--cc-border);
  flex-shrink: 0;
}
.sidebar-logo {
  width: 36px; height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(14, 165, 233, 0.5));
  flex-shrink: 0;
}
.sidebar-brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--cc-accent);
  text-shadow: 1px 1px 0px rgba(255,255,255,0.8), 2px 2px 3px rgba(14, 165, 233, 0.25);
  white-space: nowrap;
  transition: opacity var(--cc-transition);
}
/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
  overflow-y: auto;
  overflow-x: hidden;
}
.nav-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--cc-text-muted);
  letter-spacing: 2px;
  padding: 1.2rem 1.4rem 0.4rem;
  white-space: nowrap;
  transition: opacity var(--cc-transition);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem 1.2rem;
  margin: 0.35rem 0.8rem;
  border-radius: 10px;
  color: var(--cc-sidebar-text, var(--cc-text-secondary));
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--cc-transition);
  white-space: nowrap;
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.04);
  color: var(--cc-sidebar-text-hover, var(--cc-sidebar-text));
}
.nav-item.active {
  background: linear-gradient(135deg, rgba(249,115,22,0.15), rgba(245,158,11,0.05));
  color: var(--cc-accent-orange);
  border: 1px solid rgba(249,115,22,0.25);
  border-left: 4px solid var(--cc-accent-orange);
  border-radius: 4px 10px 10px 4px;
  box-shadow: 0 4px 12px rgba(249,115,22,0.1);
}
.nav-item.active .nav-icon { color: var(--cc-accent-orange); }
.nav-icon {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  transition: color var(--cc-transition);
}
.nav-label {
  flex: 1;
  transition: opacity var(--cc-transition);
}
.nav-badge {
  background: rgba(14, 165, 233, 0.15);
  color: var(--cc-accent);
  border: 1px solid rgba(14, 165, 233, 0.2);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
  transition: opacity var(--cc-transition);
}
/* Sidebar Footer */
.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--cc-border);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-shrink: 0;
}
.sidebar-user-mini {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex: 1;
  min-width: 0;
}
.mini-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cc-accent), var(--cc-accent-2));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem;
  flex-shrink: 0;
}
.mini-user-info {
  display: flex; flex-direction: column;
  min-width: 0;
  transition: opacity var(--cc-transition);
}
.mini-name {
  font-size: 0.85rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mini-role {
  font-size: 0.7rem; color: var(--cc-text-secondary);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.sidebar-logout-btn {
  background: transparent;
  border: none;
  color: var(--cc-text-secondary);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.sidebar-logout-btn:hover { color: var(--cc-danger); background: rgba(239,68,68,0.1); }
/* ════════════════════════════════════════
   MAIN AREA
════════════════════════════════════════ */
.cc-main {
  flex: 1 !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
/* ════ TOPBAR ════ */
.cc-topbar {
  height: var(--cc-topbar-h);
  background: var(--cc-topbar-bg, var(--cc-surface));
  border-bottom: 1px solid var(--cc-border);
  color: var(--cc-text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1.5rem;
  flex-shrink: 0;
  z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 1rem; }
.topbar-center { flex: 1; max-width: 420px; margin: 0 auto; }
.topbar-right { display: flex; align-items: center; gap: 1.2rem; margin-left: auto; }
.sidebar-toggle {
  background: transparent;
  border: none;
  color: var(--cc-text-secondary);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 4px;
  display: flex; align-items: center;
  transition: all 0.2s;
}
.sidebar-toggle:hover { color: var(--cc-text); background: rgba(0,0,0,0.05); }
.topbar-breadcrumb { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
.breadcrumb-root { color: var(--cc-text-muted); }
.breadcrumb-sep { color: var(--cc-border); }
.breadcrumb-current { color: var(--cc-text); font-weight: 600; }
.topbar-search {
  position: relative;
  display: flex;
  align-items: center;
}
.topbar-search svg {
  position: absolute; left: 0.9rem;
  color: var(--cc-text-muted); pointer-events: none;
}
.topbar-search input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--cc-border);
  padding: 0.55rem 1rem 0.55rem 2.4rem;
  border-radius: 100px;
  color: var(--cc-text);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s;
}
.topbar-search input:focus {
  border-color: var(--cc-accent);
  background: rgba(14, 165, 233, 0.05);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}
.topbar-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--cc-text-secondary);
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cc-text-muted);
  flex-shrink: 0;
}
.status-dot.dot-online {
  background: var(--cc-accent-3);
  box-shadow: 0 0 8px var(--cc-accent-3);
  animation: pulse-dot 2s infinite;
}
.status-dot.dot-offline { background: var(--cc-danger); }
@keyframes pulse-dot {
  0%, 100% { opacity: 1; } 50% { opacity: 0.5; }
}
.topbar-user {
  display: flex; align-items: center; gap: 0.7rem;
  cursor: pointer;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  transition: background 0.2s;
  color: var(--cc-text);
}
.topbar-user:hover { background: rgba(0,0,0,0.05); }
.topbar-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--cc-accent);
  color: #ffffff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem;
}
.topbar-user-info { display: flex; flex-direction: column; }
.topbar-user-name { font-size: 0.9rem; font-weight: 600; }
.topbar-user-role { font-size: 0.75rem; color: var(--cc-text-muted); }
/* ════ CONTENT AREA ════ */
.cc-content {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  position: relative !important;
  width: 100% !important;
  min-width: 0 !important;
  overflow: hidden !important;
  background: var(--cc-bg, #f8fafc);
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.1) transparent;
}
.cc-content::-webkit-scrollbar { width: 4px; }
.cc-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
/* Compact toolbar buttons */
.btn-toolbar-card {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 7px;
    border: 1px solid var(--cc-border);
    background: rgba(255,255,255,0.04);
    color: var(--cc-text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.18s;
    flex-shrink: 0;
  }
.btn-toolbar-card:hover {
    background: rgba(255,255,255,0.1);
    color: var(--cc-text);
    border-color: var(--cc-accent);
    transform: translateY(-1px);
  }
.btn-toolbar-card.danger { color: #ef4444; border-color: rgba(239,68,68,0.3); }
.btn-toolbar-card.danger:hover { background: rgba(239,68,68,0.1); border-color: #ef4444; }
.btn-toolbar-card.ai-btn { color: #9333ea; border-color: rgba(147,51,234,0.3); }
.btn-toolbar-card.ai-btn:hover { background: rgba(147,51,234,0.1); border-color: #9333ea; }
/* Expand mail overlay */
#mail-expand-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: var(--cc-bg);
    flex-direction: column;
    overflow: hidden;
  }
#mail-expand-overlay.active { display: flex; }
#mail-expand-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--cc-border);
    background: var(--cc-surface);
    flex-shrink: 0;
  }
#mail-expand-body {
    flex: 1;
    overflow-y: auto;
    background: #fff;
  }
/* ════ EMAIL360 ENTERPRISE STYLES ════ */
.mail-item {
  transition: background 0.15s ease, transform 0.1s ease;
  border-left: 3px solid transparent;
}
.mail-item.active {
  background: var(--cc-bg-hover, #f1f5f9) !important;
  border-left-color: var(--cc-accent, #3b82f6) !important;
}
.mail-item:hover {
  background: var(--cc-bg, #f8fafc);
}
.mail-thread-badge {
  background: rgba(99, 102, 241, 0.12);
  color: #6366f1;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}
.ai-chip-btn:hover {
  background: #f3e8ff !important;
  border-color: #c026d3 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(192, 38, 211, 0.15);
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
#cal-ai-prompt:focus {
  border-color: #a855f7 !important;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15) !important;
}
.fc .fc-event {
  border-radius: 8px !important;
  padding: 2px 4px !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1) !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}
#office-ai-dropdown, #office-export-dropdown {
  animation: slideDown 0.2s ease;
}
#btn-insert-indicators:hover {
  background: #dbeafe !important;
  border-color: #2563eb !important;
}
/* ════ VIEW PANELS ════ */
.view-panel {
  display: none !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  flex: 1 !important;
  overflow: hidden;
  box-sizing: border-box !important;
}
.view-panel.active-modal {
  display: flex !important;
  flex-direction: column;
  position: fixed;
  top: 10vh;
  left: 10vw;
  width: 80vw;
  height: 80vh;
  z-index: 999999;
  background: #0f172a;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
  animation: modalFadeIn 0.3s ease forwards;
}
.view-panel.active {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  position: relative !important;
  overflow: hidden;
  box-sizing: border-box !important;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1rem;
}
.view-title {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--cc-text);
  text-shadow: 1px 1px 0px rgba(255,255,255,1), 2px 2px 5px rgba(0,0,0,0.15);
  line-height: 1.2;
}
.view-subtitle {
  font-size: 0.9rem;
  color: var(--cc-text-secondary);
  margin-top: 0.3rem;
}
/* AI Pill */
.ai-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--cc-accent-3);
  padding: 0.5rem 1rem;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}
.pulsing-dot {
  width: 8px; height: 8px;
  background: var(--cc-accent-3);
  border-radius: 50%;
  animation: pulse-dot 1.5s infinite;
  box-shadow: 0 0 8px var(--cc-accent-3);
}
/* ════ KPI GRID ════ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.kpi-card {
  background: var(--cc-surface);
  
  border: 1px solid var(--cc-border);
  border-radius: 6px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  transition: all var(--cc-transition);
  cursor: default;
}
.kpi-card:hover {
  border-color: var(--cc-border-active);
  background: var(--cc-surface-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(14, 165, 233, 0.1);
}
.kpi-icon {
  width: 52px; height: 52px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.kpi-blue { background: rgba(14, 165, 233, 0.15); color: var(--cc-accent); }
.kpi-purple { background: rgba(139, 92, 246, 0.15); color: var(--cc-accent-2); }
.kpi-green { background: rgba(16, 185, 129, 0.15); color: var(--cc-accent-3); }
.kpi-amber { background: rgba(245, 158, 11, 0.15); color: var(--cc-accent-4); }
.kpi-data { display: flex; flex-direction: column; }
.kpi-value {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
  color: var(--cc-text);
  text-shadow: 1px 1px 0px rgba(255,255,255,1), 2px 2px 5px rgba(0,0,0,0.15);
}
.kpi-label {
  font-size: 0.8rem;
  color: var(--cc-text-secondary);
  margin-top: 0.3rem;
}
/* ════ SECTION HEADER ════ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}
.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--cc-text);
}
/* ════ APPS DOCK ════ */
.apps-dock {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.apps-dock--large {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.5rem;
}
.app-dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  cursor: pointer;
  animation: fadeIn 0.4s ease both;
  transition: transform 0.2s;
}
.app-dock-item:hover { transform: scale(1.03); }
.dock-icon {
  width: 80px; height: 80px;
  background: var(--cc-surface);
  
  border: 1px solid var(--cc-border);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  color: var(--cc-accent);
  transition: all var(--cc-transition);
  position: relative;
  overflow: visible;
}
.apps-dock--large .dock-icon {
  width: 100px; height: 100px;
  border-radius: 6px;
  font-size: 2.5rem;
}
.dock-icon img {
  width: 60%; height: 60%;
  object-fit: contain;
  border-radius: 4px;
}
.dock-icon:hover {
  border-color: var(--cc-border-active);
  box-shadow: 0 0 30px rgba(14, 165, 233, 0.2), 0 8px 24px rgba(0,0,0,0.3);
}
.dock-edit-btn {
  position: absolute;
  top: -6px; right: -6px;
  background: var(--cc-accent-2);
  border: none;
  border-radius: 50%;
  width: 22px; height: 22px;
  font-size: 0.6rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 10;
}
.app-dock-item:hover .dock-edit-btn { opacity: 1; }
.dock-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cc-text-secondary);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.apps-empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 3rem;
  color: var(--cc-text-muted);
  font-size: 0.95rem;
}
/* ════ USERS TABLE ════ */
.users-table-wrapper {
  background: var(--cc-surface);
  
  border: 1px solid var(--cc-border);
  border-radius: 6px;
  overflow: hidden;
}
.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.users-table th {
  padding: 1rem 1.2rem;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--cc-text-muted);
  border-bottom: 1px solid var(--cc-border);
  background: rgba(255,255,255,0.02);
}
.users-table td {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--cc-border);
  vertical-align: middle;
}
.users-table tr:last-child td { border-bottom: none; }
.users-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.table-loading {
  text-align: center;
  padding: 2.5rem !important;
  color: var(--cc-text-secondary);
}
.user-cell {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.user-cell-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cc-accent), var(--cc-accent-2));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.8rem;
  flex-shrink: 0;
}
.text-secondary { color: var(--cc-text-secondary); }
/* Role chips */
.role-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.role-chip--admin { background: rgba(14,165,233,0.15); color: var(--cc-accent); }
.role-chip--manager { background: rgba(139,92,246,0.15); color: var(--cc-accent-2); }
.role-chip--developer { background: rgba(16,185,129,0.15); color: var(--cc-accent-3); }
.role-chip--viewer { background: rgba(100,116,139,0.15); color: var(--cc-text-secondary); }
/* Status chips */
.status-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
}
.status-active { background: rgba(16,185,129,0.15); color: var(--cc-accent-3); }
.status-inactive { background: rgba(239,68,68,0.15); color: var(--cc-danger); }
/* Action buttons */
.action-btns { display: flex; gap: 0.4rem; }
.btn-icon {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--cc-border);
  color: var(--cc-text-secondary);
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}
.btn-icon:hover { background: rgba(255,255,255,0.1); color: var(--cc-text); }
.btn-icon--danger:hover { background: rgba(239,68,68,0.15); color: var(--cc-danger); border-color: rgba(239,68,68,0.3); }
/* ════ ROLES GRID ════ */
.roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}
.role-card {
  background: var(--cc-surface);
  
  border: 1px solid var(--cc-border);
  border-radius: 6px;
  padding: 1.5rem;
  transition: all var(--cc-transition);
}
.role-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.role-admin { border-top: 3px solid var(--cc-accent); }
.role-manager { border-top: 3px solid var(--cc-accent-2); }
.role-developer { border-top: 3px solid var(--cc-accent-3); }
.role-viewer { border-top: 3px solid var(--cc-text-muted); }
.role-header { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1rem; }
.role-badge {
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1px;
}
.role-badge--admin { background: rgba(14,165,233,0.2); color: var(--cc-accent); }
.role-badge--manager { background: rgba(139,92,246,0.2); color: var(--cc-accent-2); }
.role-badge--developer { background: rgba(16,185,129,0.2); color: var(--cc-accent-3); }
.role-badge--viewer { background: rgba(100,116,139,0.2); color: var(--cc-text-secondary); }
.role-title { font-size: 1rem; font-weight: 700; }
.role-desc { font-size: 0.85rem; color: var(--cc-text-secondary); line-height: 1.5; margin-bottom: 1rem; }
.role-perms { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.role-perms li { font-size: 0.85rem; }
.perm-on { color: var(--cc-accent-3); }
.perm-off { color: var(--cc-text-muted); }
/* ════ CONFIG ════ */
.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.config-card {
  background: var(--cc-surface);
  
  border: 1px solid var(--cc-border);
  border-radius: 6px;
  padding: 1.5rem;
}
.config-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
  color: var(--cc-text);
}
.config-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--cc-border);
  font-size: 0.875rem;
}
.config-row:last-child { border-bottom: none; }
.config-row span:first-child { color: var(--cc-text-secondary); }
.config-val { color: var(--cc-text); font-weight: 500; }
/* ════ BOTTOMBAR ════ */
.cc-bottombar {
  height: var(--cc-bottombar-h);
  background: rgba(8, 12, 20, 0.85);
  
  border-top: 1px solid var(--cc-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  font-size: 0.75rem;
  color: var(--cc-text-secondary);
  flex-shrink: 0;
}
.bottombar-left, .bottombar-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.bottom-indicator { display: flex; align-items: center; gap: 0.4rem; }
.bottom-divider { color: var(--cc-text-muted); }
/* ════ MODALS ════ */
.cc-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  animation: fadeIn 0.2s ease;
}
.cc-modal-overlay.hidden { display: none; }
.cc-modal {
  background: rgba(15, 23, 42, 0.95);
  
  border: 1px solid var(--cc-border);
  border-radius: 6px;
  padding: 2rem;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.cc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.cc-modal-header h2 { font-size: 1.2rem; font-weight: 700; }
.cc-modal-close {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--cc-border);
  color: var(--cc-text-secondary);
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  line-height: 1;
}
.cc-modal-close:hover { background: rgba(239,68,68,0.15); color: var(--cc-danger); }
.cc-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}
.cc-form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--cc-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.cc-form-group input,
.cc-form-group select,
.cc-select {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--cc-border);
  color: var(--cc-text);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s;
  width: 100%;
}
.cc-form-group input:focus,
.cc-form-group select:focus,
.cc-select:focus {
  border-color: var(--cc-accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}
.cc-form-group input::placeholder { color: var(--cc-text-muted); }
.cc-form-group select option,
.cc-select option {
  background: #0f172a;
  color: var(--cc-text);
}
.file-input {
  background: rgba(255,255,255,0.03) !important;
  cursor: pointer;
}
.cc-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--cc-border);
}
/* ════ BUTTONS ════ */
.btn-primary {
  background: linear-gradient(135deg, var(--cc-accent), #0284c7);
  color: white;
  border: none;
  padding: 0.65rem 1.4rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.35);
}
.btn-primary:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.2);
}
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-danger {
  background: rgba(239,68,68,0.15);
  color: var(--cc-danger);
  border: 1px solid rgba(239,68,68,0.3);
  padding: 0.65rem 1.4rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.btn-danger:hover { background: rgba(239,68,68,0.25); transform: translateY(-1px); }
.btn-danger:active { transform: scale(0.97); }
.btn-ghost {
  background: transparent;
  color: var(--cc-accent);
  border: 1px solid rgba(14, 165, 233, 0.3);
  padding: 0.55rem 1.2rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.btn-ghost:hover { background: rgba(14, 165, 233, 0.1); transform: translateY(-1px); }
.btn-ghost:active { transform: scale(0.97); }
.hidden { display: none !important; }
/* ════ IFRAME OVERLAY ════ */
.iframe-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  flex-direction: column;
  background: #080c14;
  animation: fadeIn 0.25s ease;
}
.iframe-overlay.hidden { display: none; }
.iframe-header {
  height: 56px;
  background: rgba(8, 12, 20, 0.95);
  
  border-bottom: 1px solid var(--cc-border);
  display: flex;
  align-items: center;
  padding: 0 1.2rem;
  gap: 0.8rem;
  flex-shrink: 0;
}
.iframe-header .logo { display: flex; align-items: center; }
.iframe-action-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--cc-border);
  color: var(--cc-text-secondary);
  width: 38px; height: 38px;
  border-radius: 6px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.iframe-action-btn:hover { background: rgba(255,255,255,0.1); color: var(--cc-text); }
.close-btn-red:hover { background: rgba(239,68,68,0.15); color: var(--cc-danger); border-color: rgba(239,68,68,0.3); }
.iframe-container { flex: 1; overflow: hidden; }
.iframe-container iframe { width: 100%; height: 100%; border: none; }
/* ════ SYNOPTYK MAIL ════ */
.mail-layout { 
  display: grid; 
  grid-template-columns: 75px minmax(320px, 420px) 1fr;
  grid-template-rows: 1fr;
  gap: 0.75rem; 
  height: calc(100vh - 200px); 
  position: relative;
  overflow: visible;
}
/* Panel de Calendario Sidepanel - Estilos base para transición */
.calendar-sidepanel {
  width: 250px;
  background: white;
  border-radius: 6px;
  border: 1px solid var(--cc-border);
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
.calendar-sidepanel:not(.open) {
  width: 0;
  opacity: 0;
  border: none;
  padding: 0;
  margin: 0;
}
.calendar-sidepanel.open {
  padding: 1rem;
}
/* ════ MEDIA QUERIES RESPONSIVE (CORREO) ════ */
@media (max-width: 1300px) {
  /* Calendario Off-Canvas */
  .mail-layout {
    grid-template-columns: 220px 320px 1fr;
  }
  .calendar-sidepanel {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    z-index: 50;
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
  }
  #close-calendar-mobile-btn {
    display: block !important;
  }
  .mail-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}
@media (max-width: 900px) {
  .mail-layout {
    grid-template-columns: 80px 300px 1fr;
  }
  .mail-folders span { display: none; }
  .mail-folders .folder-icon { display: inline-block; font-size: 1.5rem; margin: 0; }
  .mail-folder { justify-content: center; padding: 0.8rem; }
}
@media (max-width: 768px) {
  /* Mobile Single Column */
  .mail-layout {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    height: calc(100vh - 180px);
  }
  .mail-folders, .mail-list, .mail-viewer {
    width: 100%;
    height: auto;
    border-radius: 6px !important;
    margin-bottom: 1rem;
    flex: none;
  }
  
  /* Logica de Vistas Móviles (Ocultar/Mostrar via JS classes) */
  .mail-folders { display: none; } /* Podria invocarse con un boton menu */
  
  .mail-list.mobile-hidden { display: none; }
  .mail-viewer.mobile-hidden { display: none; }
  
  /* Asegurar botones arriba no se aprieten */
  .view-header {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 1rem;
  }
  .mail-actions {
    width: 100%;
    justify-content: space-between;
  }
  .mail-actions select { width: 100% !important; margin-bottom: 0.5rem; }
  .mail-actions button { flex: 1; padding: 0.5rem; font-size: 0.8rem; }
}
.mail-folders { 
  display: flex; 
  flex-direction: column; 
  gap: 0.5rem; 
  background: var(--cc-surface); 
  border: 1px solid var(--cc-border); 
  border-radius: 6px; 
  padding: 1rem 0.5rem;
  width: 75px;
  position: relative;
  z-index: 9999;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s;
  overflow: visible;
  white-space: nowrap;
}
.mail-folders:hover {
  width: 260px;
  box-shadow: 4px 0 30px rgba(0,0,0,0.1);
  padding: 1rem;
}
.mail-folder { 
  padding: 0.75rem 0.8rem; 
  border-radius: 6px; 
  cursor: pointer; 
  display: flex; 
  align-items: center; 
  gap: 0.8rem; 
  color: var(--cc-text-secondary); 
  font-size: 0.95rem; 
  transition: all 0.2s; 
}
.mail-folder .folder-text { opacity: 0; white-space: nowrap; transition: opacity 0.2s; width: 0; display: inline-block; overflow: hidden; text-overflow: ellipsis; }
.mail-folders:hover .mail-folder .folder-text { opacity: 1; width: calc(100% - 40px); }
.mail-folder:hover { background: rgba(255,255,255,0.05); color: var(--cc-text); }
.mail-folder.active { background: rgba(29, 138, 153, 0.1); color: var(--cc-accent); font-weight: 600; }
.mail-folder .folder-icon { font-size: 1.2rem; flex-shrink: 0; width: 24px; text-align: center; display: inline-block; }
.mail-folder .badge { margin-left: auto; background: var(--cc-accent); color: white; padding: 0.1rem 0.4rem; border-radius: 6px; font-size: 0.7rem; font-weight: 700; opacity: 0; transition: opacity 0.2s; }
.mail-folders:hover .badge { opacity: 1; }
.mail-folders:not(:hover) .account-text-container,
.mail-folders:not(:hover) .account-chevron {
  display: none !important;
}
.mail-folders:not(:hover) .account-switcher-btn {
  justify-content: center !important;
  padding: 0.5rem !important;
}
.account-text-container {
  min-width: 0; /* Permite truncar en flex */
}
.account-text {
  display: block;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.section-title {
  margin-top: 1rem; 
  font-size: 0.75rem; 
  font-weight: 700; 
  color: var(--cc-text-muted); 
  text-transform: uppercase; 
  letter-spacing: 1px; 
  padding: 0 1rem;
  opacity: 0;
  transition: opacity 0.2s;
}
.mail-folders:hover .section-title {
  opacity: 1;
}
.mail-folder #btn-add-custom-label { overflow: hidden; white-space: nowrap; }
.mail-list { 
  grid-column: 2;
  display: flex; 
  flex-direction: column; 
  gap: 0; 
  background: var(--cc-surface); 
  border: 1px solid var(--cc-border); 
  border-radius: 6px; 
  padding: 0.75rem; 
  overflow: hidden;
  min-width: 0;
  min-height: 0;
}
.mail-viewer {
  grid-column: 3;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  min-height: 0;
}
.mail-search { margin-bottom: 0.75rem; flex-shrink: 0; }
.mail-items { display: flex; flex-direction: column; gap: 0.25rem; flex: 1; overflow-y: auto; padding-right: 4px; min-height: 0; }
.mail-items::-webkit-scrollbar { width: 6px; }
.mail-items::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 4px; }
.mail-items:hover::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); }
/* Mail Item Layout */
.mail-item {
  padding: 0.7rem 0.8rem;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(255,255,255,0.02);
  overflow: hidden;      /* Hard clip anything that bleeds out */
  min-width: 0;
  flex-shrink: 0;
}
.mail-item:hover { background: rgba(255,255,255,0.06); border-color: var(--cc-border); }
.mail-item.active { background: rgba(14, 165, 233, 0.08); border-color: rgba(14, 165, 233, 0.35); }
.mail-item.unread .mail-sender,
.mail-item.unread .mail-subject-line { font-weight: 700; color: var(--cc-text); }
.mail-item-inner {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  min-width: 0;
  overflow: hidden;
}
.mail-item-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--cc-accent-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  color: white;
  flex-shrink: 0;
  overflow: hidden;
}
.mail-item-content {
  flex: 1;
  min-width: 0;       /* Critical: allows flex children to shrink below content size */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}
/* Row 1: Sender name + short date side by side */
.mail-item-row1 {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  min-width: 0;
  overflow: hidden;
}
.mail-sender {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cc-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.mail-date {
  font-size: 0.72rem;
  color: var(--cc-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
/* Row 2: Subject */
.mail-subject-line {
  font-size: 0.875rem;
  color: var(--cc-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
/* Row 3: Labels */
.mail-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0.1rem 0;
  min-width: 0;
  overflow: hidden;
}
/* Row 4: Preview */
.mail-preview {
  font-size: 0.78rem;
  color: var(--cc-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.mail-label-pill { 
  font-size: 0.7rem; 
  font-weight: 600; 
  padding: 0.25rem 0.6rem; 
  border-radius: 6px; 
  color: #fff; 
  flex-shrink: 0; 
  display: inline-block;
  max-width: 130px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  line-height: 1.1;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.mail-label-pill.label-family { background: #55b274; }
/* Proton Green */
.mail-label-pill.label-crypto { background: #e3a936; }
/* Proton Amber */
.mail-label-pill.label-work { background: #7155d8; }
/* Proton Violet */
.mail-label-pill.label-urgent { background: #df4d5b; }
/* Proton Red */
.mail-label-pill.label-general { background: #7b859a; }
/* Proton Slate */
.calendar-sidepanel {
  width: 320px;
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  display: none; /* Oculto por defecto */
}
.calendar-sidepanel.open {
  display: flex;
}
.calendar-sidepanel-header {
  padding: 1rem;
  border-bottom: 1px solid var(--cc-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
}
.calendar-sidepanel-body {
  padding: 1rem;
  flex: 1;
  overflow-y: auto;
}
.mini-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.2rem;
  text-align: center;
  font-size: 0.8rem;
}
.mini-cal-day-header { color: var(--cc-text-muted); font-weight: 600; margin-bottom: 0.5rem; }
.mini-cal-day { padding: 0.3rem; border-radius: 4px; cursor: pointer; transition: background 0.2s; }
.mini-cal-day:hover { background: rgba(255,255,255,0.05); }
.mini-cal-day.today { background: var(--cc-accent); color: white; font-weight: bold; }
.mini-cal-day.has-event { border-bottom: 2px solid var(--cc-accent-2); }
.mail-viewer {
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.mail-toolbar { padding: 1rem 1.5rem; border-bottom: 1px solid var(--cc-border); display: flex; gap: 0.8rem; background: rgba(255,255,255,0.02); flex-wrap: wrap; flex-shrink: 0; }
.mail-viewer-header { padding: 1.5rem; border-bottom: 1px solid var(--cc-border); display: flex; justify-content: space-between; align-items: flex-start; flex-shrink: 0; }
.mail-viewer-subject { font-size: 1.15rem; font-weight: 700; margin-bottom: 1rem; }
.mail-viewer-meta { display: flex; gap: 1rem; align-items: center; }
.mail-viewer-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--cc-accent-2); display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 1.1rem; overflow: hidden; }
.mail-viewer-sender { font-size: 0.95rem; font-weight: 600; }
.mail-viewer-sender span { color: var(--cc-text-muted); font-weight: 400; font-size: 0.85rem; }
.mail-viewer-to { font-size: 0.8rem; color: var(--cc-text-secondary); margin-top: 0.2rem; }
.mail-viewer-body {
  padding: 0 0 3rem 0;   /* extra bottom breathing room */
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-height: 0;
}
.mail-viewer-body iframe {
  width: 100%;
  flex: 1;
  border: none;
  background: #ffffff;
  min-height: 400px;
}
/* ════ CALENDAR ════ */
.calendar-controls { display: flex; align-items: center; gap: 0.5rem; }
.calendar-current-month { font-size: 1.2rem; font-weight: 700; min-width: 140px; text-align: center; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.5rem; background: var(--cc-surface); border-radius: 6px; padding: 1rem; min-height: 100%; }
.cal-header { text-align: center; font-weight: 700; font-size: 0.85rem; color: var(--cc-text-secondary); padding: 0.5rem; text-transform: uppercase; letter-spacing: 1px; }
.cal-day { background: rgba(255,255,255,0.02); border: 1px solid var(--cc-border); border-radius: 6px; padding: 0.5rem; min-height: 120px; transition: background 0.2s; cursor: pointer; display: flex; flex-direction: column; }
.cal-day:hover { background: rgba(255,255,255,0.05); }
.cal-day.empty { background: transparent; border-color: transparent; cursor: default; }
.cal-day.today { background: rgba(14, 165, 233, 0.05); border-color: rgba(14, 165, 233, 0.3); }
.cal-event { 
  margin-top: 0.4rem; padding: 0.4rem 0.6rem; border-radius: 6px; 
  font-size: 0.75rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; 
  cursor: pointer; transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  position: relative;
  display: flex; align-items: center; gap: 0.3rem;
}
.cal-event:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 12px rgba(0,0,0,0.1);
  z-index: 5;
}
.cal-event::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: currentColor; border-radius: 6px 0 0 6px;
}
.cal-event.absolute { position: absolute; left: 5px; right: 5px; z-index: 2; margin-top: 0; }
.event-reunion { background: rgba(16, 185, 129, 0.15); color: #059669; }
.event-videoreunion { background: rgba(239, 68, 68, 0.15); color: #dc2626; }
.event-trabajo { background: rgba(139, 92, 246, 0.15); color: #7c3aed; }
.event-nota { background: rgba(245, 158, 11, 0.15); color: #d97706; }
.event-blue { background: rgba(14, 165, 233, 0.2); color: var(--cc-accent); }
/* Vistas de Semana y Día */
.calendar-week-view, .calendar-day-view {
  display: flex; height: 100%; overflow: auto;
  background: var(--cc-surface); border-radius: 6px;
}
.cal-time-col {
  width: 60px; flex-shrink: 0; border-right: 1px solid var(--cc-border); background: rgba(255,255,255,0.02);
  position: sticky; left: 0; z-index: 10;
}
.cal-time-slot {
  height: 60px; border-bottom: 1px solid var(--cc-border); display: flex; align-items: flex-start; justify-content: center;
  font-size: 0.7rem; color: var(--cc-text-muted); padding-top: 0.3rem;
}
.cal-day-col {
  flex: 1; border-right: 1px solid var(--cc-border); position: relative; min-width: 120px;
}
.cal-day-col-header {
  text-align: center; padding: 0.8rem; border-bottom: 1px solid var(--cc-border); font-weight: 700;
  position: sticky; top: 0; background: var(--cc-surface); z-index: 10;
}
.cal-slot { height: 60px; border-bottom: 1px dashed var(--cc-border); transition: background 0.2s; }
.cal-slot:hover { background: rgba(255,255,255,0.02); }
/* ════ API VAULT ════ */
.apivault-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; }
.apivault-card { background: var(--cc-surface); border: 1px solid var(--cc-border); border-radius: 6px; padding: 1.5rem; transition: transform 0.2s, box-shadow 0.2s; }
.apivault-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0,0,0,0.3); border-color: var(--cc-border-active); }
.apivault-header { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.8rem; }
.apivault-icon { font-size: 1.5rem; }
.apivault-name { font-size: 1.1rem; font-weight: 700; flex: 1; }
.apivault-env { font-size: 0.65rem; font-weight: 800; padding: 3px 8px; border-radius: 4px; letter-spacing: 0.5px; }
.env-prod { background: rgba(239, 68, 68, 0.15); color: var(--cc-danger); }
.env-dev { background: rgba(16, 185, 129, 0.15); color: var(--cc-accent-3); }
.apivault-desc { font-size: 0.85rem; color: var(--cc-text-secondary); margin-bottom: 1.2rem; }
.apivault-key-container { display: flex; gap: 0.5rem; }
.apivault-key-input { flex: 1; background: rgba(0,0,0,0.2); border: 1px solid var(--cc-border); border-radius: 4px; padding: 0.5rem 0.8rem; color: var(--cc-accent); font-family: monospace; font-size: 0.9rem; outline: none; }
/* ════ INSTALLERS ════ */
.installers-list { display: flex; flex-direction: column; gap: 1rem; max-width: 800px; }
.installer-card { background: var(--cc-surface); border: 1px solid var(--cc-border); border-radius: 6px; padding: 1.5rem; display: flex; align-items: center; gap: 1.5rem; transition: transform 0.2s; }
.installer-card:hover { transform: translateX(5px); border-color: var(--cc-border-active); background: rgba(255,255,255,0.03); }
.installer-icon { width: 56px; height: 56px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 2rem; flex-shrink: 0; }
.icon-win { background: rgba(14, 165, 233, 0.15); color: #0ea5e9; }
.icon-mac { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.icon-linux { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.installer-info { flex: 1; }
.installer-info h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.3rem; }
.installer-info p { font-size: 0.85rem; color: var(--cc-text-secondary); }
/* ════ PREMIUM MODAL & MAIL OVERHAULS ════ */
.cc-modal-premium {
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.12), 0 0 40px rgba(29, 138, 153, 0.15);
  background: rgba(255, 255, 255, 0.95);
  
}
.premium-header {
  display: flex; gap: 1.2rem; align-items: center;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  padding-bottom: 1.5rem; margin-bottom: 1.5rem;
}
.premium-header h2 {
  margin: 0; font-size: 1.5rem; font-weight: 700;
  color: #0f172a;
  text-shadow: 1px 1px 0px rgba(255,255,255,1), 2px 2px 4px rgba(0,0,0,0.15);
}
.premium-header p { margin: 0.3rem 0 0 0; font-size: 0.9rem; color: var(--cc-text-secondary); }
.premium-icon-box {
  background: rgba(29, 138, 153, 0.08);
  border: 1px solid rgba(29, 138, 153, 0.2);
  width: 54px; height: 54px; flex-shrink: 0;
  border-radius: 14px; display: flex; align-items: center; justify-content: center;
  color: var(--cc-accent);
}
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.badge-info {
  background: rgba(29, 138, 153, 0.1); color: var(--cc-accent);
  font-size: 0.65rem; padding: 3px 8px; border-radius: 6px; font-weight: 600;
  vertical-align: middle; margin-left: 0.5rem; border: 1px solid rgba(29, 138, 153, 0.2);
}
.premium-footer { border-top: 1px solid rgba(0,0,0,0.06); padding-top: 1.5rem; margin-top: 1.5rem; }
.btn-glow {
  box-shadow: 0 4px 15px rgba(29, 138, 153, 0.3);
  display: flex; align-items: center; gap: 0.5rem; transition: all 0.3s;
}
.btn-glow:hover { box-shadow: 0 6px 20px rgba(29, 138, 153, 0.4); transform: translateY(-2px); }
.pulse-icon { animation: pulseIcon 2s infinite; }
@keyframes pulseIcon { 0% { transform: scale(1); } 50% { transform: scale(1.1); } 100% { transform: scale(1); } }
/* Upgrade Mail Layout panels to glassmorphism (Light Theme) */
.mail-folders, .mail-list, .mail-viewer {
  background: white;
  border-radius: 6px;
  border: 1px solid var(--cc-border);
  display: flex;
  flex-direction: column;
}
.mail-list, .mail-viewer {
  overflow: hidden;
}
.mail-viewer-header {
  border-bottom: 1px solid var(--cc-border) !important;
  background: #f8fafc;
}
.mail-item {
  background: #f8fafc !important;
  border: 1px solid transparent !important;
  display: flex; gap: 1rem; align-items: center;
  padding: 1.2rem !important;
  border-radius: 6px !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
.mail-item:hover {
  background: #ffffff !important;
  border-color: rgba(29, 138, 153, 0.3) !important;
  box-shadow: 0 8px 24px rgba(29, 138, 153, 0.08) !important;
  transform: translateY(-2px);
}
.mail-item-avatar {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 50%; background: linear-gradient(135deg, var(--cc-accent), #0ea5e9);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: white; font-size: 1.1rem;
  box-shadow: 0 4px 10px rgba(29, 138, 153, 0.2);
}
.mail-item-content { flex: 1; min-width: 0; overflow: hidden; }
.mail-item-header { margin-bottom: 0.4rem !important; display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; min-width: 0; }
.mail-sender {
  font-weight: 600;
  color: var(--cc-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.mail-date {
  font-size: 0.75rem;
  color: var(--cc-text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}
.mail-subject {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--cc-text);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
}
.mail-subject span:first-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.mail-preview {
  font-size: 0.85rem;
  color: var(--cc-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* ════ TOOLBAR BUTTONS ════ */
.btn-toolbar-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  width: 36px;
  height: 36px;
  background: white;
  border: 1px solid var(--cc-border);
  border-radius: 4px;
  color: var(--cc-text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
  cursor: pointer;
}
.hover-toolbar {
  opacity: 0.2;
  transform: translateY(-5px);
}
.hover-toolbar:hover, .hover-toolbar:focus-within {
  opacity: 1;
  transform: translateY(0);
}
.btn-toolbar-card svg {
  transition: transform 0.2s;
}
.btn-toolbar-card:hover {
  background: #f8fafc;
  color: var(--cc-text);
  border-color: rgba(29, 138, 153, 0.3);
  box-shadow: 0 4px 12px rgba(29, 138, 153, 0.08);
  transform: translateY(-2px);
}
.btn-toolbar-card:hover svg {
  transform: scale(1.1);
  color: var(--cc-accent);
}
.btn-toolbar-card.danger:hover {
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--cc-danger);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.08);
}
.btn-toolbar-card.danger:hover svg {
  color: var(--cc-danger);
}
.btn-toolbar-card.ai-btn {
  border-color: rgba(139, 92, 246, 0.3);
  background: linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(139, 92, 246, 0.03) 100%);
  color: #8b5cf6;
}
.btn-toolbar-card.ai-btn:hover {
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.6);
}
/* ════ MODERN FORM INPUTS ════ */
.cc-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: var(--cc-text);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}
.cc-input::placeholder {
  color: #94a3b8;
}
.cc-input:focus {
  background: #ffffff;
  border-color: var(--cc-accent);
  box-shadow: 0 0 0 4px rgba(29, 138, 153, 0.15), inset 0 2px 4px rgba(0,0,0,0.02);
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cc-text-secondary);
  display: flex;
  align-items: center;
}
/* ════ BOTONES PREMIUM 3D ════ */
.btn-premium-action {
  background: linear-gradient(145deg, #ffffff, #f0f4f8);
  border: 1px solid #d1d5db;
  color: #374151;
  padding: 0.6rem 1.2rem;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 2px 4px -1px rgba(0, 0, 0, 0.03),
    inset 0 1px 0 rgba(255,255,255,1),
    inset 0 -2px 0 rgba(209,213,219,0.5);
  position: relative;
  overflow: hidden;
}
.btn-premium-action::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 50%; height: 100%;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.8), transparent);
  transform: skewX(-20deg);
  transition: 0.5s;
}
.btn-premium-action:hover::before {
  left: 150%;
}
.btn-premium-action:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 6px 12px -2px rgba(14,165,233, 0.15),
    0 3px 6px -3px rgba(14,165,233, 0.1),
    inset 0 1px 0 rgba(255,255,255,1),
    inset 0 -2px 0 rgba(14,165,233,0.2);
  border-color: #0ea5e9;
  color: #0ea5e9;
  background: linear-gradient(145deg, #ffffff, #e0f2fe);
}
.btn-premium-action:active {
  transform: translateY(1px);
  box-shadow: 
    0 1px 2px rgba(0,0,0,0.05),
    inset 0 2px 4px rgba(0,0,0,0.1);
}
.btn-premium-action svg {
  stroke: currentColor;
}
/* ════ CUSTOM PROMPT MODAL ════ */
.custom-prompt-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}
.custom-prompt-content {
  background: white;
  border-radius: 6px;
  width: 90%;
  max-width: 450px;
  padding: 2rem;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  animation: slideUp 0.3s ease;
  border: 1px solid rgba(226, 232, 240, 0.8);
}
.custom-prompt-content h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: #0f172a;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.custom-prompt-content p {
  color: #64748b;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}
.custom-prompt-content .cc-input {
  margin-bottom: 1.5rem;
}
.custom-prompt-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}
/* ════ PILLS DE ENCABEZADO ════ */
.header-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(0,0,0,0.05);
}
.header-pill svg {
  margin-top: -1px;
}
/* Toast Notifications */
.cc-toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 99999;
}
.cc-toast {
  background: white;
  border-left: 4px solid var(--cc-accent);
  padding: 1rem 1.5rem;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toast-slide-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  font-weight: 500;
  color: var(--cc-text);
}
.cc-toast.error {
  border-left-color: #ef4444;
}
.cc-toast.success {
  border-left-color: #10b981;
}
.cc-toast-icon {
  font-size: 1.2rem;
}
@keyframes toast-slide-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes toast-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}
/* Dropdown */
.cc-dropdown {
  position: relative;
  display: inline-block;
}
.cc-dropdown-content {
  display: none;
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  background-color: white;
  min-width: 220px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border-radius: 6px;
  border: 1px solid var(--cc-border);
  z-index: 1000;
  padding: 0.8rem;
  flex-direction: column;
  gap: 0.5rem;
}
.cc-dropdown.active .cc-dropdown-content {
  display: flex;
  animation: dropdown-fade 0.2s ease;
}
@keyframes dropdown-fade {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}
.cc-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  color: var(--cc-text);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.2s;
}
.cc-dropdown-item:hover {
  background: var(--cc-bg);
}
.cc-dropdown-item svg {
  width: 16px;
  height: 16px;
  color: var(--cc-text-secondary);
}
@media (max-width: 900px) {
  .btn-mail-sidebar-toggle { display: flex; }
  .mail-sidebar { position: absolute; left: -100%; top: 0; height: 100%; z-index: 50; transition: left 0.3s ease; box-shadow: 2px 0 10px rgba(0,0,0,0.1); background:var(--cc-surface); }
  .mail-sidebar.mobile-open { left: 0; }
}
@media (max-width: 768px) {
  .mail-app-layout { grid-template-columns: 1fr; }
  .mail-viewer.mobile-hidden { display: none !important; }
  .mail-list.mobile-hidden { display: none !important; }
  .mail-mobile-back { display: flex; }
}
/* ════ MEDIA QUERIES MOVED TO BOTTOM FOR OVERRIDES ════ */
@media (max-width: 1300px) {
  .mail-layout { grid-template-columns: 220px 320px 1fr; }
  .calendar-sidepanel { position: absolute; right: 0; top: 0; height: 100%; z-index: 50; box-shadow: -10px 0 30px rgba(0,0,0,0.1); }
  .mail-actions { flex-wrap: wrap; justify-content: flex-end; }
}
@media (max-width: 900px) {
  .mail-layout { grid-template-columns: 80px 300px 1fr; }
  .mail-folders span { display: none; }
  .mail-folders .folder-icon { display: inline-block; font-size: 1.5rem; margin: 0; }
  .mail-folder { justify-content: center; padding: 0.8rem; }
}
@media (max-width: 768px) {
  .mail-layout {
    display: flex !important;
    flex-direction: column !important;
    overflow-y: auto;
    height: calc(100vh - 180px) !important;
  }
  .mail-folders, .mail-list, .mail-viewer {
    width: 100% !important;
    height: auto !important;
    border-radius: 6px !important;
    margin-bottom: 1rem !important;
    flex: none !important;
    min-width: 0 !important;
  }
  
  .mail-folders { display: none !important; } 
  .mail-list.mobile-hidden { display: none !important; }
  .mail-viewer.mobile-hidden { display: none !important; }
  
  .view-header {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 1rem;
  }
  .mail-actions {
    width: 100%;
    justify-content: space-between;
  }
  .mail-actions select { width: 100% !important; margin-bottom: 0.5rem; }
  .mail-actions button { flex: 1; padding: 0.5rem; font-size: 0.8rem; }
}
@keyframes pillPop {
  0% { transform: scale(0.8); opacity: 0; }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}
.mail-label-pill {
  animation: pillPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.mail-viewer {
  overflow-y: auto !important;
  overflow-x: hidden !important;
}
.mail-list {
  overflow-y: auto !important;
  overflow-x: hidden !important;
}
/* Overlay for Mobile Sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  
  z-index: 9998; /* Just below sidebar */
}
.sidebar-overlay.active {
  display: block;
}
/* ════ CALENDAR EXPAND OVERLAY ════ */
#calendar-expand-overlay {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: var(--cc-bg);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s;
}
#calendar-expand-overlay.active {
  transform: translateY(0);
  opacity: 1;
}
/* Big Calendar Grid specific */
#calendar-grid-container {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: minmax(120px, auto);
  gap: 1px;
  background: var(--cc-border);
}
.cal-day-cell {
  background: #fff;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  transition: background 0.2s;
  cursor: pointer;
}
.cal-day-cell:hover {
  background: #f8fafc;
}
.cal-day-cell.today .cal-day-num {
  background: var(--cc-accent);
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal-day-num {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--cc-text);
  margin-bottom: 4px;
  align-self: flex-end;
}
.cal-day-cell.other-month {
  background: #fafafa;
  color: #a1a1aa;
}
.cal-event {
  font-size: 0.75rem;
  padding: 4px 6px;
  border-radius: 4px;
  background: rgba(14,165,233,0.1);
  border-left: 3px solid var(--cc-accent);
  color: var(--cc-text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
/* ════ CONTEXT MENU ════ */
.cc-context-menu {
  position: fixed;
  z-index: 10001;
  width: 200px;
  background: rgba(255, 255, 255, 0.95);
  
  border: 1px solid var(--cc-border);
  border-radius: 6px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  padding: 0.5rem;
  font-family: inherit;
}
.cc-context-menu.hidden {
  display: none;
}
.cc-context-menu ul {
  list-style: none;
  padding: 0; margin: 0;
}
.cc-context-menu li {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--cc-text);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}
.cc-context-menu li:hover {
  background: var(--cc-bg-hover);
  color: var(--cc-accent);
}
.cc-context-menu li.danger:hover {
  background: #fee2e2;
  color: #ef4444;
}
.cc-context-menu .menu-divider {
  height: 1px;
  background: var(--cc-border);
  margin: 0.4rem 0;
}
/* ════ MOBILE RESPONSIVE TWEAKS ════ */
@media (max-width: 768px) {
  #mail-expand-toolbar {
    flex-wrap: wrap !important;
    padding: 0.5rem !important;
    gap: 0.5rem !important;
  }
  
  #mail-expand-subject {
    width: 100% !important;
    order: -1;
    font-size: 1.1rem;
    line-height: 1.3;
    margin-bottom: 0.2rem;
  }
  
  #mail-expand-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
    justify-content: center;
  }
  
  #mail-specific-tools {
    justify-content: center;
    padding: 0.5rem !important;
  }
  
  /* Make viewer sender/subject stack on mobile */
  .mail-viewer-header {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
  .mail-viewer-meta {
    margin-top: 0.5rem;
    width: 100%;
    justify-content: space-between;
  }
}
/* ═══════════════ CUSTOM MODALS ═══════════════ */
.cc-modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.3s ease;
}
.cc-modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}
.cc-modal-content {
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  border-radius: 6px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.2);
  transform: scale(1);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.cc-modal-overlay.hidden .cc-modal-content {
  transform: scale(0.9);
}
.cc-modal-header {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--cc-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.5);
}
.cc-modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--cc-text);
}
.cc-modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--cc-text-muted);
  border-radius: 50%;
  padding: 0.3rem;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.cc-modal-close:hover {
  background: rgba(0,0,0,0.05);
  color: var(--cc-text);
}
.cc-modal-body {
  padding: 1.5rem;
  font-size: 0.95rem;
  color: var(--cc-text);
  line-height: 1.5;
}
.cc-modal-footer {
  padding: 1.2rem 1.5rem;
  background: rgba(0,0,0,0.02);
  border-top: 1px solid var(--cc-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
}
.cc-btn-primary, .cc-btn-secondary {
  padding: 0.6rem 1.2rem;
  border-radius: 4px;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}
.cc-btn-primary {
  background: var(--cc-accent);
  color: white;
  border: none;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}
.cc-btn-primary:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}
.cc-btn-secondary {
  background: white;
  color: var(--cc-text);
  border: 1px solid var(--cc-border);
}
.cc-btn-secondary:hover {
  background: rgba(0,0,0,0.02);
}
/* ═══════════════ TRASH ANIMATION ═══════════════ */
@keyframes trash-bounce {
  0% { transform: scale(1); }
  25% { transform: scale(1.2) rotate(-10deg); }
  50% { transform: scale(1.3) rotate(10deg); }
  75% { transform: scale(1.1) rotate(-5deg); }
  100% { transform: scale(1) rotate(0); }
}
.folder-icon.trash-animating {
  animation: trash-bounce 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.mail-folder.has-trash .folder-icon::after {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid white;
}
.mail-folder .folder-icon {
  position: relative; /* For the red dot badge */
}
/* ═══════════════ SIDEBAR COLLAPSE TOGGLE ═══════════════ */
.mail-folders {
  transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, min-width 0.28s ease;
}
.mail-folders--collapsed {
  width: 0 !important;
  min-width: 0 !important;
  overflow: hidden !important;
  opacity: 0;
  pointer-events: none;
}
/* ═══════════════ PROMPT INPUT MODAL ═══════════════ */
.cc-modal-prompt-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--cc-border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--cc-text);
  background: white;
  margin-top: 0.75rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  display: none; /* hidden by default, shown by JS */
}
.cc-modal-prompt-input:focus {
  border-color: var(--cc-accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}
/* ═══════════════ IMPROVED CUSTOM MODAL ═══════════════ */
#custom-modal-overlay .cc-modal-content {
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18), 0 4px 16px rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.06);
  max-width: 440px;
  width: 94%;
  animation: modal-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.9) translateY(12px); }
  to   { opacity: 1; transform: scale(1)   translateY(0);    }
}
#custom-modal-overlay .cc-modal-header {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
}
#custom-modal-overlay .cc-modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}
#custom-modal-overlay .cc-modal-close {
  width: 28px; height: 28px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  background: white;
  color: #64748b;
  transition: all 0.15s;
}
#custom-modal-overlay .cc-modal-close:hover {
  background: #fee2e2;
  color: #ef4444;
  border-color: #fca5a5;
}
#custom-modal-overlay .cc-modal-body {
  padding: 1.4rem 1.5rem 1.2rem;
  font-size: 0.93rem;
  color: #334155;
  line-height: 1.6;
}
#custom-modal-overlay .cc-modal-footer {
  padding: 1rem 1.5rem;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}
#custom-modal-overlay .cc-btn-primary {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: white;
  border: none;
  padding: 0.6rem 1.4rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}
#custom-modal-overlay .cc-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.4);
}
#custom-modal-overlay .cc-btn-secondary {
  background: white;
  color: #64748b;
  border: 1px solid #e2e8f0;
  padding: 0.6rem 1.4rem;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}
#custom-modal-overlay .cc-btn-secondary:hover {
  background: #f1f5f9;
  color: #0f172a;
}
#custom-modal-overlay .hidden {
  display: none !important;
}
/* ==========================================
   MICROSOFT WORD 365 CLONE UI (PIXEL PERFECT)
   ========================================== */
#word-editor-wrapper {
  background-color: #f3f4f6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #212529;
}
/* --- 1. Ribbon UI --- */
.word-ribbon {
  background-color: #ffffff;
  border-bottom: 1px solid #e1dfdd;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  z-index: 1000;
}
.word-ribbon-tabs {
  display: flex;
  background-color: #2b579a; /* Word Blue */
  padding: 0 10px;
}
.ribbon-tab {
  color: white;
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  margin-top: 4px;
  transition: background 0.2s;
}
.ribbon-tab:hover {
  background-color: rgba(255, 255, 255, 0.1);
}
.ribbon-tab.active {
  background-color: #ffffff;
  color: #2b579a;
  font-weight: 600;
}
.word-ribbon-panels {
  background-color: #ffffff;
  padding: 8px 16px;
  min-height: 50px;
}
.ribbon-panel {
  display: none;
  align-items: center;
  gap: 16px;
}
.ribbon-panel.active {
  display: flex;
}
.ribbon-group {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ribbon-divider {
  width: 1px;
  height: 30px;
  background-color: #e1dfdd;
}
.ribbon-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 14px;
  color: #323130;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s;
}
.ribbon-btn:hover {
  background-color: #f3f2f1;
  border-color: #edebe9;
}
.ribbon-btn.btn-text {
  font-size: 12px;
}
.ribbon-select {
  border: 1px solid #8a8886;
  border-radius: 2px;
  padding: 2px 4px;
  font-size: 12px;
  outline: none;
}
/* --- 2. Rulers (Horizontal & Vertical) --- */
.word-ruler-h-wrapper {
  background: #f8f8f8;
  border-bottom: 1px solid #e1dfdd;
  display: flex;
  justify-content: center;
  overflow: hidden;
}
.word-ruler-horizontal {
  width: 21cm;
  height: 18px;
  background: white;
  position: relative;
  background-image: repeating-linear-gradient(90deg, transparent, transparent 9.5mm, #94a3b8 9.5mm, #94a3b8 10mm);
  box-shadow: inset 0 0 2px rgba(0,0,0,0.2);
}
.word-ruler-horizontal .ruler-numbers {
  display: flex;
  justify-content: space-between;
  padding: 0 2cm;
  font-size: 9px;
  color: #666;
  line-height: 18px;
}
.margin-overlay {
  position: absolute;
  background: #e1dfdd;
  opacity: 0.8;
  z-index: 1;
}
.margin-overlay.left-margin { left: 0; top: 0; bottom: 0; width: 2cm; }
.margin-overlay.right-margin { right: 0; top: 0; bottom: 0; width: 2cm; }
/* --- 3. Scrollable Workspace --- */
.word-workspace-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  background-color: #e1dfdd; /* The gray backdrop */
  display: flex;
  justify-content: center;
  padding: 20px 0;
}
.word-workspace-inner {
  position: relative;
  display: flex;
}
.word-ruler-vertical {
  width: 18px;
  min-height: 29.7cm;
  background: white;
  position: absolute;
  left: -18px;
  top: 0;
  background-image: repeating-linear-gradient(0deg, transparent, transparent 9.5mm, #94a3b8 9.5mm, #94a3b8 10mm);
  box-shadow: inset 0 0 2px rgba(0,0,0,0.2);
}
.margin-overlay.top-margin { top: 0; left: 0; right: 0; height: 2cm; }
.margin-overlay.bottom-margin { bottom: 0; left: 0; right: 0; height: 2cm; }
/* --- 4. The Paper (Canvas) --- */
#word-paper {
  width: 21cm;
  min-height: 29.7cm;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.2s ease-out;
  transform-origin: top center;
}
/* Page Gap Simulator (Visual Only) */
.page-gap-simulator {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 29.7cm, #e1dfdd 29.7cm, #e1dfdd calc(29.7cm + 20px));
  z-index: 50;
}
#word-editor {
  flex: 1;
  padding: 0 2cm; /* Only L/R padding, T/B handled by header/footer */
  outline: none;
  min-height: 25.7cm;
}
.word-hf {
  width: 100%;
  min-height: 2cm;
  outline: none;
  border: 1px dashed transparent;
  color: #64748b;
  font-family: Calibri, sans-serif;
  font-size: 10pt;
  z-index: 100;
  position: relative;
}
#word-header { padding: 1cm 2cm 0 2cm; }
#word-footer { padding: 0 2cm 1cm 2cm; }
.word-hf:empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
  font-style: italic;
  pointer-events: none;
  display: block;
}
.word-hf:focus {
  border-color: #3b82f6 !important;
  background: rgba(248, 250, 252, 0.5);
}
/* --- 5. Status Bar --- */
.word-statusbar {
  height: 24px;
  background-color: #f3f2f1;
  border-top: 1px solid #e1dfdd;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  font-size: 11px;
  color: #605e5c;
  z-index: 1000;
}
.word-statusbar .status-left, .word-statusbar .status-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.word-statusbar input[type="range"] {
  width: 80px;
  height: 2px;
}
/* Hide default TinyMCE UI inside our word-editor */
#word-paper .tox-tinymce { border: none !important; }
#word-paper .tox-editor-header { display: none !important; }
/* Corrección de Z-Index para Luckysheet: Para que se muestren sobre el modal de edición */
.luckysheet-formula-search-c,
.luckysheet-formula-help-c,
#luckysheet-input-box,
.luckysheet-right-menu,
.luckysheet-cols-menu,
.luckysheet-filter-menu,
.luckysheet-modal-dialog,
#luckysheet-rich-text-editor,
#luckysheet-functionbox-cell,
.luckysheet-cell-input {
    z-index: 100000 !important;
}
/* ==========================================
   PREMIUM TINYMCE TOOLBAR (Office 365 Style)
   ========================================== */
#word-editor-wrapper .tox-tinymce-inline {
  z-index: 1000 !important;
}
#tinymce-toolbar .tox-tinymce {
  border: none !important;
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 4px 15px -5px rgba(0, 0, 0, 0.05) !important;
}
#tinymce-toolbar .tox-editor-header {
  background: transparent !important;
  padding: 8px 16px !important;
  box-shadow: none !important;
}
#tinymce-toolbar .tox-toolbar__primary,
#tinymce-toolbar .tox-toolbar__overflow {
  background: transparent !important;
}
#tinymce-toolbar .tox-tbtn {
  border-radius: 6px !important;
  transition: all 0.2s ease !important;
  margin: 2px !important;
}
#tinymce-toolbar .tox-tbtn:hover {
  background-color: #e2e8f0 !important;
}
#tinymce-toolbar .tox-tbtn--enabled,
#tinymce-toolbar .tox-tbtn--enabled:hover {
  background-color: #cbd5e1 !important;
  color: #0f172a !important;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
/* Custom premium buttons in Toolbar */
#tinymce-toolbar button[title="📄 Vertical"],
#tinymce-toolbar button[title="📄 Horizontal"],
#tinymce-toolbar button[title="📂 Subir DOCX"],
#tinymce-toolbar button[title="📄 Exportar PDF"],
#tinymce-toolbar button[title="📝 Exportar DOCX"],
#tinymce-toolbar button[title="🖨️ Imprimir"],
#tinymce-toolbar button[title="✉️ Correspondencia"] {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  padding: 0 12px !important;
  margin-left: 6px !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
}
#tinymce-toolbar button[title="📂 Subir DOCX"]:hover { background: #f1f5f9 !important; border-color: #bfdbfe !important; color: #2563eb !important; }
#tinymce-toolbar button[title="📄 Exportar PDF"]:hover { background: #fef2f2 !important; border-color: #fecaca !important; color: #dc2626 !important; }
#tinymce-toolbar button[title="📝 Exportar DOCX"]:hover { background: #eff6ff !important; border-color: #bfdbfe !important; color: #1d4ed8 !important; }
/* Remove any third party branding completely */
.tox-promotion,
.tox-statusbar__branding,
a[href*="tinymce.com"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  width: 0 !important;
  pointer-events: none !important;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}
.document-body-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  transition: all 0.3s ease;
}
.document-ruler-vertical {
  width: 22px;
  min-height: 29.7cm;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  margin-right: 8px;
  background-image: repeating-linear-gradient(0deg, transparent, transparent 9.5mm, #94a3b8 9.5mm, #94a3b8 10mm);
  background-size: 8px 100%;
  background-repeat: no-repeat;
  background-position: right;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
}
.ruler-handle {
  position: absolute;
  top: 0;
  width: 14px;
  height: 22px;
  background: #3b82f6;
  border: 1px solid #2563eb;
  border-radius: 2px;
  cursor: ew-resize;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.left-handle { left: 2cm; transform: translateX(-50%); }
.right-handle { right: 2cm; transform: translateX(50%); }
.word-hf:empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
  font-style: italic;
  pointer-events: none;
  display: block;
}
.word-hf:focus {
  border-color: #3b82f6 !important;
  background: rgba(248, 250, 252, 0.5);
}
/* Fix collapsed mail folders */
.mail-layout:has(.mail-folders--collapsed) {
  grid-template-columns: 0px minmax(320px, 420px) 1fr !important;
}
@media (max-width: 1300px) {
  .mail-layout:has(.mail-folders--collapsed) {
    grid-template-columns: 0px 320px 1fr !important;
  }
}
@media (max-width: 900px) {
  .mail-layout:has(.mail-folders--collapsed) {
    grid-template-columns: 0px 300px 1fr !important;
  }
}
.mail-viewer-header, .mail-viewer-body {
  width: 100% !important;
  max-width: none !important;
}
/* Fix for out of frame modules */
.cc-content {
  min-height: 0 !important;
}
.cc-main {
  min-height: 0 !important;
}
/* Fix for mail viewer empty space */
/* ════ ULTRA-INTELLIGENT RESIZABLE EMAIL360° LAYOUT ════ */
:root {
  --mail-folders-width: 240px;
  --mail-list-width: 360px;
}
.mail-layout { 
  display: grid !important; 
  grid-template-columns: var(--mail-folders-width, 240px) 6px var(--mail-list-width, 360px) 6px minmax(400px, 1fr) !important;
  grid-template-rows: 1fr !important;
  gap: 0 !important; 
  height: calc(100vh - 125px) !important; 
  height: calc(100dvh - 125px) !important; 
  position: relative !important;
  overflow: hidden !important;
  width: 100% !important;
}
.mail-folders.mail-folders--collapsed {
  display: none !important;
}
.mail-layout:has(.mail-folders--collapsed) {
  grid-template-columns: 0px 0px var(--mail-list-width, 360px) 6px minmax(400px, 1fr) !important;
}
/* Vertical Splitter Handle */
.mail-splitter {
  width: 6px !important;
  height: 100% !important;
  background: transparent !important;
  cursor: col-resize !important;
  position: relative !important;
  z-index: 20 !important;
  user-select: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: background 0.2s !important;
  touch-action: none !important;
}
.mail-splitter::after {
  content: '' !important;
  width: 2px !important;
  height: 24px !important;
  border-radius: 2px !important;
  background: var(--cc-border, #cbd5e1) !important;
  transition: all 0.2s !important;
}
.mail-splitter:hover, .mail-splitter.dragging {
  background: rgba(11, 87, 208, 0.12) !important;
}
.mail-splitter:hover::after, .mail-splitter.dragging::after {
  background: var(--cc-accent, #0b57d0) !important;
  height: 48px !important;
  width: 4px !important;
}
/* Mail Viewer Ultra Dimensions & Styling */
.mail-viewer, #mail-viewer-container {
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  overflow-y: auto !important;
  background: var(--cc-surface, #ffffff) !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
}
.mail-viewer-header {
  padding: 1.5rem 2rem 1rem 2rem !important;
  border-bottom: 1px solid var(--cc-border, #e2e8f0) !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
.mail-viewer-body {
  padding: 1.75rem 2.25rem !important;
  font-family: system-ui, -apple-system, sans-serif !important;
  font-size: 1rem !important;
  line-height: 1.65 !important;
  color: var(--cc-text, #1e293b) !important;
  width: 100% !important;
  box-sizing: border-box !important;
  overflow-x: auto !important;
}
.mail-viewer-body iframe {
  width: 100% !important;
  min-height: 500px !important;
  border: none !important;
}
/* ════════════════════════════════════════════════════════════════════
   FULLCALENDAR GOOGLE MATERIAL 3 SUITE OVERRIDES
   ════════════════════════════════════════════════════════════════════ */
.fc {
  font-family: inherit !important;
  border: none !important;
}
.fc .fc-toolbar {
  margin-bottom: 1.25rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 1rem !important;
}
.fc .fc-toolbar-title {
  font-size: 1.35rem !important;
  font-weight: 800 !important;
  color: var(--cc-text, #1f1f1f) !important;
  letter-spacing: -0.3px !important;
}
.fc .fc-button {
  background: var(--cc-surface, #ffffff) !important;
  border: 1px solid var(--cc-border, #dadce0) !important;
  color: var(--cc-text, #3c4043) !important;
  font-weight: 600 !important;
  font-size: 0.88rem !important;
  border-radius: 20px !important;
  padding: 0.45rem 1rem !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
  transition: all 0.2s !important;
  text-transform: capitalize !important;
}
.fc .fc-button:hover {
  background: var(--cc-surface-hover, #f1f3f4) !important;
  color: var(--cc-accent, #0b57d0) !important;
  border-color: var(--cc-accent, #0b57d0) !important;
}
.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
  background: var(--cc-sidebar-active-bg, #c2e7ff) !important;
  color: var(--cc-sidebar-active-text, #001d35) !important;
  border-color: transparent !important;
  font-weight: 700 !important;
  box-shadow: none !important;
}
.fc .fc-button .fc-icon {
  font-size: 1.1rem !important;
  vertical-align: middle !important;
}
.fc .fc-prev-button, .fc .fc-next-button {
  border-radius: 50% !important;
  width: 36px !important;
  height: 36px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.fc .fc-col-header-cell {
  background: var(--cc-surface, #f8f9fa) !important;
  border: 1px solid var(--cc-border, #e0e3e7) !important;
  padding: 8px 0 !important;
}
.fc .fc-col-header-cell-cushion {
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  color: var(--cc-text-secondary, #444746) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}
.fc .fc-day-today {
  background: var(--cc-surface-hover, #edf2fa) !important;
}
.fc .fc-day-today .fc-col-header-cell-cushion {
  color: #0b57d0 !important;
}
.fc .fc-timegrid-slot {
  height: 3rem !important;
  border-bottom: 1px solid var(--cc-border, #f1f3f4) !important;
}
.fc .fc-timegrid-slot-label-cushion {
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  color: var(--cc-text-muted, #747775) !important;
}
.fc-event {
  border-radius: 8px !important;
  padding: 4px 8px !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12) !important;
  border: none !important;
  transition: transform 0.15s, box-shadow 0.15s !important;
  cursor: pointer !important;
}
.fc-event:hover {
  transform: translateY(-1px) scale(1.01) !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2) !important;
}
.fc-event-title {
  font-weight: 700 !important;
  font-size: 0.85rem !important;
}
.fc-event-time {
  font-size: 0.75rem !important;
  opacity: 0.9 !important;
}
.fc .fc-timegrid-now-indicator-line {
  border-color: #ea4335 !important;
  border-width: 2px !important;
}
.fc .fc-timegrid-now-indicator-arrow {
  border-color: #ea4335 !important;
}
/* Picture-in-Picture Floating Video */
.floating-pip {
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  width: 320px !important;
  height: 180px !important;
  z-index: 999999 !important;
  border-radius: 16px !important;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
}
