/* ========== WEMVY DESIGN SYSTEM v5 ========== */
/* Apple-inspired light theme | Glassmorphism accents */

:root {
  --sidebar-w: 240px;
  --sidebar-collapsed: 80px;
  --apple-bg: #F5F5F7;
  --apple-text: #1D1D1F;
  --apple-muted: #86868B;
  --apple-subtle: #A1A1A6;
  --apple-border: rgba(0,0,0,0.04);
  --apple-border-medium: rgba(0,0,0,0.08);
  --wemvy-cyan: #00D0D4;
  --wemvy-cyan-dark: #00B8BC;
  --wemvy-pink: #FA47C9;
  --wemvy-pink-dark: #E03DB5;
}

* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
  letter-spacing: -0.01em;
  background: var(--apple-bg);
  color: var(--apple-text);
}

/* Scrollbar Apple */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); }

/* ========== SIDEBAR GLASS ========== */
.sidebar {
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-right: 1px solid var(--apple-border);
}
.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}
.sidebar.collapsed .sidebar-text,
.sidebar.collapsed .sidebar-section-title,
.sidebar.collapsed .sidebar-user-info {
  opacity: 0; pointer-events: none; width: 0; overflow: hidden;
}
.sidebar.collapsed .nav-item {
  justify-content: center; padding: 10px;
}
.sidebar.collapsed .nav-item .nav-badge {
  display: none;
}
.sidebar.collapsed .sidebar-logo-text {
  opacity: 0; width: 0; overflow: hidden;
}
.sidebar.collapsed .sidebar-logo-icon {
  margin: 0 auto;
}

/* Nav item Apple */
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 12px;
  font-size: 13px; font-weight: 500; color: var(--apple-muted);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer; white-space: nowrap;
}
.nav-item:hover {
  background: rgba(0,0,0,0.03); color: var(--apple-text);
}
.nav-item.active {
  background: rgba(0,208,212,0.08); color: #00B8BC; font-weight: 600;
}
.nav-item svg { width: 18px; height: 18px; stroke-width: 1.5; flex-shrink: 0; }

/* Icono redondo limpio */
.nav-icon-wrap {
  width: 32px; height: 32px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: transform 0.2s ease;
}
.nav-item:hover .nav-icon-wrap { transform: scale(1.06); }
.nav-item.active .nav-icon-wrap { background: rgba(0,208,212,0.10) !important; }

/* Gradient text */
.text-gradient {
  background: linear-gradient(135deg, #00D0D4, #FA47C9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========== CARDS PREMIUM ========== */
.card-premium {
  background: #FFFFFF;
  border: 1px solid var(--apple-border);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02), 0 4px 12px rgba(0,0,0,0.03);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-premium:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.04);
}

/* ========== STAT CARD ========== */
.stat-card {
  background: #FFFFFF;
  border: 1px solid var(--apple-border);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02), 0 4px 12px rgba(0,0,0,0.03);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.03);
}

/* ========== INPUT APPLE ========== */
.input-apple {
  background: rgba(255,255,255,0.8);
  border: 1px solid var(--apple-border-medium);
  border-radius: 10px;
  transition: all 0.2s ease;
}
.input-apple:focus {
  outline: none;
  border-color: rgba(0,208,212,0.4);
  box-shadow: 0 0 0 3px rgba(0,208,212,0.08);
}

/* ========== BUTTON PREMIUM ========== */
.btn-premium {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(180deg, #00D0D4, #00B8BC);
  box-shadow: 0 2px 8px rgba(0,208,212,0.25), inset 0 1px 0 rgba(255,255,255,0.2);
  transition: all 0.2s ease;
}
.btn-premium:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,208,212,0.35), inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-premium:active { transform: scale(0.97); }

/* ========== TABLE PREMIUM ========== */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; padding: 12px 16px; font-size: 11px;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--apple-muted); border-bottom: 1px solid var(--apple-border);
}
.data-table td {
  padding: 14px 16px; font-size: 13px; color: var(--apple-text);
  border-bottom: 1px solid var(--apple-border); transition: background 0.15s;
}
.data-table tr:hover td { background: rgba(0,0,0,0.015); }

/* ========== HEADER SCROLL ========== */
.header-glass {
  transition: all 0.3s ease;
}
.header-glass.scrolled {
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  box-shadow: 0 1px 0 var(--apple-border);
}

/* ========== BADGE ========== */
.badge-apple {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 100px; font-size: 11px; font-weight: 600;
  letter-spacing: -0.01em;
}

/* ========== BUTTON GRADIENT PILL ========== */
.btn-gradient {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 16px;
  border-radius: 100px;
  font-size: 13px; font-weight: 600; color: #1D1D1F;
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(245,245,247,0.6));
  border: 1px solid rgba(0,0,0,0.04);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03), inset 0 1px 0 rgba(255,255,255,0.8);
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  cursor: pointer;
}
.btn-gradient:hover {
  background: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.8);
  transform: translateY(-1px);
}
.btn-gradient:active { transform: scale(0.97); }

/* ========== DROPDOWNS ========== */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 180px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.06);
  padding: 6px;
  opacity: 0; visibility: hidden;
  transform: translateY(-6px) scale(0.96);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
}
.dropdown.show .dropdown-menu {
  opacity: 1; visibility: visible;
  transform: translateY(0) scale(1);
}
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 10px;
  font-size: 13px; font-weight: 500; color: var(--apple-text);
  cursor: pointer; transition: all 0.15s ease;
  white-space: nowrap;
}
.dropdown-item:hover { background: rgba(0,0,0,0.04); }
.dropdown-item.danger { color: #EF4444; }
.dropdown-item.danger:hover { background: rgba(239,68,68,0.06); }
.dropdown-divider {
  height: 1px; background: var(--apple-border);
  margin: 4px 6px;
}
.dropdown-header {
  padding: 6px 12px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--apple-muted);
}

/* ========== NOTIFICATIONS PANEL ========== */
.notif-panel {
  min-width: 320px; max-width: 360px;
}
.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  cursor: pointer; transition: background 0.15s;
}
.notif-item:hover { background: rgba(0,0,0,0.03); }
.notif-item.unread .notif-dot { display: block; }
.notif-dot { display: none; width: 6px; height: 6px; border-radius: 50%; background: #FA47C9; flex-shrink: 0; margin-top: 6px; }
.notif-text { flex: 1; }
.notif-title { font-size: 13px; font-weight: 500; color: var(--apple-text); line-height: 1.4; }
.notif-time { font-size: 11px; color: var(--apple-muted); margin-top: 2px; }

/* ========== SIDEBAR WITH SUBSECTIONS ========== */
.nav-group {
  width: 100%; display: flex; flex-direction: column; align-items: center;
}
.nav-group-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  z-index: 2;
}
.nav-group-toggle:hover { transform: scale(1.05); background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.nav-group-toggle:active { transform: scale(0.95); }
.nav-group-toggle.active { background: rgba(0,208,212,0.08); color: #00B8BC; }
.nav-group-toggle .chevron {
  position: absolute; bottom: 2px; right: 2px;
  width: 14px; height: 14px;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  transition: transform 0.25s ease;
}
.nav-group.open .nav-group-toggle .chevron { transform: rotate(180deg); }

/* Submenu container - despliega desde el padre */
.nav-sub-wrap {
  max-height: 0; overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4,0,0.2,1), opacity 0.25s ease, padding 0.25s ease;
  opacity: 0;
  width: 100%;
  display: flex; flex-direction: column; align-items: center;
}
.nav-group.open .nav-sub-wrap {
  max-height: 260px; opacity: 1;
  padding-top: 6px; padding-bottom: 4px;
}
.nav-sub-box {
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  padding: 6px;
  display: flex; flex-direction: column; align-items: center;
  gap: 4px;
}
.nav-sub-box a {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: all 0.2s ease;
  position: relative;
}
.nav-sub-box a:hover { transform: scale(1.05); background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.nav-sub-box a:active { transform: scale(0.95); }
.nav-sub-box a.active { background: rgba(0,208,212,0.08); color: #00B8BC; }

/* ========== MODAL ========== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0; visibility: hidden;
  transition: all 0.3s ease;
}
.modal-overlay.show { opacity: 1; visibility: visible; }
.modal {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 48px rgba(0,0,0,0.15);
  width: 90%; max-width: 440px;
  z-index: 210;
  opacity: 0; visibility: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal.show { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.modal-header { padding: 20px 24px 0; }
.modal-body { padding: 16px 24px 20px; }
.modal-footer { padding: 0 24px 20px; display: flex; justify-content: flex-end; gap: 8px; }
.modal-fullscreen {
  max-width: none; width: 100%; height: 100%; border-radius: 0;
  top: 0; left: 0; transform: scale(0.98);
}
.modal-fullscreen.show { transform: scale(1); }

/* ========== TOAST ========== */
.toast-container {
  position: fixed; top: 20px; right: 20px;
  z-index: 300;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  font-size: 13px; font-weight: 500;
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 260px;
}
.toast.show { transform: translateX(0); }
.toast-success { border-left: 3px solid #10B981; }
.toast-error   { border-left: 3px solid #EF4444; }
.toast-info    { border-left: 3px solid #3B82F6; }
.toast-warning { border-left: 3px solid #F59E0B; }

/* ========== TABS ========== */
.tabs {
  display: flex; gap: 4px;
  background: rgba(0,0,0,0.03);
  border-radius: 100px;
  padding: 4px;
}
.tab-btn {
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 13px; font-weight: 500;
  border: none; background: transparent;
  color: var(--apple-muted);
  cursor: pointer; transition: all 0.2s ease;
}
.tab-btn.active {
  background: #fff;
  color: var(--apple-text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.tab-btn:hover:not(.active) { color: var(--apple-text); }

/* ========== ACCORDION ========== */
.accordion-item { border-bottom: 1px solid var(--apple-border); }
.accordion-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
  cursor: pointer; font-size: 14px; font-weight: 500;
  color: var(--apple-text);
  transition: color 0.2s;
}
.accordion-header:hover { color: var(--wemvy-cyan); }
.accordion-icon { transition: transform 0.25s ease; }
.accordion-item.open .accordion-icon { transform: rotate(180deg); }
.accordion-body {
  max-height: 0; overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.2s;
  opacity: 0;
  font-size: 13px; color: var(--apple-muted); line-height: 1.6;
}
.accordion-item.open .accordion-body {
  max-height: 300px; opacity: 1; padding-bottom: 14px;
}

/* ========== SKELETON ========== */
.skeleton {
  background: linear-gradient(90deg, rgba(0,0,0,0.04) 25%, rgba(0,0,0,0.08) 50%, rgba(0,0,0,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ========== TOOLTIP ========== */
[title] { position: relative; }
.tooltip {
  position: absolute;
  background: #1D1D1F;
  color: #fff;
  font-size: 11px; font-weight: 500;
  padding: 5px 10px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0; visibility: hidden;
  transform: translateY(4px);
  transition: all 0.2s ease;
  z-index: 150;
}
.tooltip.show { opacity: 1; visibility: visible; transform: translateY(0); }
.tooltip.tooltip-right {
  transform: translateX(-4px);
  left: calc(100% + 8px); top: 50%;
  margin-top: -13px;
}
.tooltip.tooltip-right.show { transform: translateX(0); }
.tooltip.tooltip-right::before {
  content: '';
  position: absolute;
  left: -4px; top: 50%;
  transform: translateY(-50%);
  border-width: 4px 4px 4px 0;
  border-style: solid;
  border-color: transparent #1D1D1F transparent transparent;
}

/* ========== PAGINATION ========== */
.pagination {
  display: flex; align-items: center; gap: 4px;
}
.page-btn {
  width: 32px; height: 32px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 500;
  border: none; background: transparent;
  color: var(--apple-muted);
  cursor: pointer; transition: all 0.2s ease;
}
.page-btn:hover { background: rgba(0,0,0,0.04); color: var(--apple-text); }
.page-btn.active { background: var(--apple-text); color: #fff; }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ========== EMPTY STATE ========== */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  padding: 48px 24px; text-align: center;
}
.empty-state-icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: rgba(0,0,0,0.03);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.empty-state-title { font-size: 15px; font-weight: 600; color: var(--apple-text); }
.empty-state-desc { font-size: 13px; color: var(--apple-muted); margin-top: 4px; }

/* ========== SWITCH ========== */
.switch {
  appearance: none;
  width: 40px; height: 24px;
  background: rgba(0,0,0,0.1);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
}
.switch::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: transform 0.2s ease;
}
.switch:checked { background: #00D0D4; }
.switch:checked::after { transform: translateX(16px); }

/* ========== FILE DROPZONE ========== */
.dropzone {
  border: 2px dashed rgba(0,0,0,0.1);
  border-radius: 16px;
  padding: 40px 24px;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
}
.dropzone:hover, .dropzone.dragover {
  border-color: #00D0D4;
  background: rgba(0,208,212,0.03);
}

/* ========== KANBAN ========== */
.kanban-col {
  background: rgba(0,0,0,0.02);
  border-radius: 16px;
  padding: 12px;
  min-width: 260px;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.kanban-col.drag-over {
  background: rgba(0,208,212,0.04);
  box-shadow: inset 0 0 0 2px rgba(0,208,212,0.25);
}
.kanban-card {
  background: #fff;
  border: 1px solid var(--apple-border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 8px;
  cursor: grab;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
  transition: box-shadow 0.2s, transform 0.2s;
}
.kanban-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.kanban-card.dragging { opacity: 0.5; transform: rotate(2deg); cursor: grabbing; }

/* ========== TIMELINE ========== */
.timeline { position: relative; padding-left: 24px; }
.timeline::before {
  content: '';
  position: absolute; left: 7px; top: 4px; bottom: 4px;
  width: 2px; background: var(--apple-border);
}
.timeline-item { position: relative; padding-bottom: 20px; }
.timeline-dot {
  position: absolute; left: -20px; top: 2px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--wemvy-cyan);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--wemvy-cyan);
}
.timeline-date { font-size: 11px; font-weight: 600; color: var(--apple-muted); text-transform: uppercase; }
.timeline-title { font-size: 13px; font-weight: 600; color: var(--apple-text); margin-top: 2px; }
.timeline-desc { font-size: 12px; color: var(--apple-muted); margin-top: 2px; }

/* ========== WIZARD ========== */
.wizard-steps {
  display: flex; align-items: center; gap: 8px;
}
.wizard-step {
  display: flex; align-items: center; gap: 8px;
}
.wizard-step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  background: rgba(0,0,0,0.06);
  color: var(--apple-muted);
}
.wizard-step.active .wizard-step-num { background: var(--wemvy-cyan); color: #fff; }
.wizard-step.completed .wizard-step-num { background: #10B981; color: #fff; }
.wizard-step-label { font-size: 12px; font-weight: 500; color: var(--apple-muted); }
.wizard-step.active .wizard-step-label { color: var(--apple-text); }
.wizard-connector {
  flex: 1; height: 2px;
  background: rgba(0,0,0,0.06);
  border-radius: 1px;
  max-width: 40px;
}
.wizard-connector.completed { background: #10B981; }

/* Mobile sidebar */
@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.25s ease; width: var(--sidebar-w) !important; background: #fff !important; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: block; }
  .sidebar .sidebar-text, .sidebar .sidebar-section-title, .sidebar .sidebar-user-info { opacity: 1 !important; width: auto !important; }
  .sidebar .sidebar-logo-text { opacity: 1 !important; width: auto !important; }
  .sidebar .nav-item { justify-content: flex-start !important; padding: 10px 14px !important; }
  .sidebar .nav-item .nav-badge { display: inline-flex !important; }
}
@media (min-width: 1024px) {
  .sidebar-overlay { display: none !important; }
}
