:root {
  --vp-primary: #3498db;
  --vp-primary-hover: #2980b9;
  --vp-primary-glow: rgba(52, 152, 219, 0.3);
  --vp-bg-body: #12141a;
  --vp-bg-dark: #1a1d23;
  --vp-bg-surface: #22262e;
  --vp-bg-surface-hover: #2a2e38;
  --vp-bg-elevated: #272b35;
  --vp-border: #333940;
  --vp-border-light: #2a2e38;
  --vp-text-primary: #e8eaed;
  --vp-text-secondary: #94a3b8;
  --vp-text-muted: #64748b;
  --vp-success: #10b981;
  --vp-warning: #f59e0b;
  --vp-danger: #ef4444;
  --vp-critical: #ef4444;
  --vp-milestone: #f59e0b;
  --vp-project-bar: #64748b;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --toolbar-height: 72px;
  --tabbar-height: 38px;
  --statusbar-height: 28px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--vp-bg-body);
  color: var(--vp-text-primary);
  font-family: var(--font-family);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--vp-bg-dark);
}
::-webkit-scrollbar-thumb {
  background: var(--vp-border);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--vp-text-muted);
}

/* TOOLBAR */
#toolbar {
  height: var(--toolbar-height);
  background: rgba(26, 29, 35, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--vp-border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  flex-shrink: 0;
  user-select: none;
}

.toolbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 24px;
}

.brand-name {
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  letter-spacing: 0.5px;
}

.brand-version {
  font-size: 11px;
  color: var(--vp-primary);
  background: rgba(52, 152, 219, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.toolbar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 12px;
}

.toolbar-group-label {
  font-size: 10px;
  color: var(--vp-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
  font-weight: 600;
}

.toolbar-buttons {
  display: flex;
  gap: 4px;
}

.tb-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--vp-text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 44px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-family);
  gap: 2px;
}

.tb-btn:hover {
  background: var(--vp-bg-surface-hover);
  border-color: var(--vp-border);
}

.tb-btn:active {
  background: var(--vp-bg-elevated);
  transform: translateY(1px);
}

.tb-btn.toggle.active {
  background: var(--vp-bg-surface);
  border-bottom: 2px solid var(--vp-primary);
}

.tb-btn.danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--vp-danger);
}

.tb-btn.success:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--vp-success);
}

.tb-icon {
  font-size: 16px;
  line-height: 1;
}

.tb-label {
  font-size: 10px;
  color: var(--vp-text-secondary);
}

.tb-btn:hover .tb-label {
  color: var(--vp-text-primary);
}

.tb-select {
  background: var(--vp-bg-surface);
  color: var(--vp-text-primary);
  border: 1px solid var(--vp-border);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  height: 28px;
  align-self: center;
  outline: none;
  font-family: var(--font-family);
}

.tb-select:focus {
  border-color: var(--vp-primary);
  box-shadow: 0 0 0 2px var(--vp-primary-glow);
}

.toolbar-divider {
  width: 1px;
  height: 60%;
  background-color: var(--vp-border);
  margin: 0 8px;
}

/* TAB BAR */
#tab-bar {
  height: var(--tabbar-height);
  background: var(--vp-bg-dark);
  border-bottom: 1px solid var(--vp-border);
  display: flex;
  align-items: flex-end;
  padding: 0 16px;
  flex-shrink: 0;
}

.tab {
  background: transparent;
  color: var(--vp-text-secondary);
  border: none;
  padding: 8px 16px;
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  transition: all 0.2s ease;
  margin-right: 4px;
  border-bottom: 2px solid transparent;
}

.tab:hover {
  background: var(--vp-bg-surface);
  color: var(--vp-text-primary);
}

.tab.active {
  background: var(--vp-bg-surface-hover);
  color: var(--vp-text-primary);
  border-bottom-color: var(--vp-primary);
}

.project-stats {
  margin-left: auto;
  display: flex;
  gap: 16px;
  align-items: center;
  height: 100%;
  padding-bottom: 8px;
}

.stat {
  font-size: 12px;
  color: var(--vp-text-secondary);
}

.stat strong {
  color: var(--vp-text-primary);
  font-weight: 600;
}

/* MAIN CONTENT */
#main-content {
  flex: 1;
  overflow: hidden;
  position: relative;
  background: var(--vp-bg-body);
}

.view {
  display: none;
  width: 100%;
  height: 100%;
  flex-direction: column;
  animation: fadeIn 0.3s ease;
}

.view.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Gantt */
#gantt-container {
  width: 100%;
  height: 100%;
}

/* Cashflow View */
#cashflow-header, #resources-header {
  padding: 20px;
  border-bottom: 1px solid var(--vp-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#cashflow-header h2, #resources-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.cashflow-controls {
  display: flex;
  gap: 16px;
  align-items: center;
}

.cashflow-controls select {
  background: var(--vp-bg-surface);
  color: var(--vp-text-primary);
  border: 1px solid var(--vp-border);
  padding: 6px 12px;
  border-radius: 4px;
}

.cashflow-totals {
  background: var(--vp-bg-surface);
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid var(--vp-border);
  font-size: 14px;
}

#cf-total {
  color: var(--vp-primary);
}

#cashflow-view {
  overflow-y: auto !important;
  display: none;
  height: 100%;
}
#cashflow-view.active {
  display: block !important;
}

#cashflow-chart-container {
  height: 400px !important;
  min-height: 400px !important;
  padding: 20px;
  flex: none;
}

#cashflow-table-container {
  height: auto !important;
  border-top: 1px solid var(--vp-border);
  padding: 20px;
  overflow-x: auto !important; /* Scroll horizontal si hay muchas semanas */
}

#resources-table-container {
  height: 100% !important;
  overflow-y: auto !important;
  padding: 20px;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  background: var(--vp-bg-elevated);
  color: var(--vp-text-secondary);
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  border-bottom: 2px solid var(--vp-border);
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--vp-border-light);
}

tr:nth-child(even) td {
  background: var(--vp-bg-surface);
}

tr:hover td {
  background: var(--vp-bg-surface-hover);
}

#cashflow-table-container th,
#cashflow-table-container td {
  min-width: 95px;
  text-align: center;
}
#cashflow-table-container td:first-child,
#cashflow-table-container th:first-child {
  min-width: 140px;
  text-align: left;
  position: sticky;
  left: 0;
  background-color: var(--vp-bg-dark);
  z-index: 10;
}

/* STATUS BAR */
#status-bar {
  height: var(--statusbar-height);
  background: var(--vp-bg-dark);
  border-top: 1px solid var(--vp-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  font-size: 11px;
  color: var(--vp-text-muted);
  flex-shrink: 0;
}

#status-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

#status-right {
  font-weight: 500;
}

/* LANDING COMERCIAL PÚBLICA (MODO UX EXTERNO) */
#vsuite-public-landing {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, rgba(8, 10, 16, 0.90) 0%, rgba(12, 16, 26, 0.94) 100%), 
              url('../assets/banners/vprojects_banner.png') no-repeat center center / cover;
  z-index: 99998;
  overflow-y: auto;
  font-family: 'Inter', sans-serif;
  color: #fff;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.landing-slogan {
  font-size: 22px;
  font-weight: 700;
  color: #3498db;
  margin: -5px 0 12px 0;
  letter-spacing: 0.5px;
  text-shadow: 0 0 15px rgba(52, 152, 219, 0.3);
}

.landing-hero {
  text-align: center;
  max-width: 850px;
  margin-top: 20px;
  margin-bottom: 50px;
}

.landing-company {
  font-size: 11px;
  color: #ffd700;
  letter-spacing: 4px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 12px;
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

.landing-title {
  font-size: 52px;
  font-weight: 800;
  letter-spacing: 2px;
  margin: 0 0 15px 0;
  background: linear-gradient(135deg, #ffffff 30%, #a1a1a1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.landing-tagline {
  font-size: 16px;
  color: #94a3b8;
  line-height: 1.5;
}

.landing-access-btn {
  background: linear-gradient(135deg, #ffd700, #b8860b);
  color: #000;
  border: none;
  padding: 14px 28px;
  border-radius: 8px;
  font-weight: 750;
  font-size: 14px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(212,175,55,0.25);
}

.landing-access-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(212,175,55,0.4);
}

.landing-grid-container {
  width: 100%;
  max-width: 1100px;
  margin-bottom: 50px;
}

.grid-section-title {
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  color: #94a3b8;
  margin-bottom: 30px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.landing-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.landing-card-item {
  background: rgba(22, 25, 35, 0.6);
  border: 1px solid rgba(255,255,255,0.03);
  border-radius: 12px;
  padding: 24px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.landing-card-item::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 3px;
  opacity: 0.8;
}

/* Colores de identidad corporativa en tarjetas */
.card-vbox::before { background: #10b981; }
.card-vbox:hover { border-color: rgba(16,185,129,0.3); box-shadow: 0 10px 30px rgba(16,185,129,0.08); }

.card-vidocx::before { background: #ef4444; }
.card-vidocx:hover { border-color: rgba(239,68,68,0.3); box-shadow: 0 10px 30px rgba(239,68,68,0.08); }

.card-vcleaner::before { background: #1abc9c; }
.card-vcleaner:hover { border-color: rgba(26,188,156,0.3); box-shadow: 0 10px 30px rgba(26,188,156,0.08); }

.card-vcontrolt::before { background: #ffd700; }
.card-vcontrolt:hover { border-color: rgba(255,215,0,0.3); box-shadow: 0 10px 30px rgba(255,215,0,0.08); }

.card-icon {
  font-size: 28px;
  margin-bottom: 15px;
}

.card-app-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
}

.card-slogan {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.5;
  margin-bottom: 20px;
  flex-grow: 1;
}

.card-action {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #ffd700;
  transition: opacity 0.2s;
}

.landing-card-item:hover .card-action {
  opacity: 0.8;
}

.landing-footer {
  font-size: 10px;
  color: #64748b;
  text-align: center;
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,0.04);
  width: 100%;
  max-width: 1100px;
  padding-top: 20px;
}

/* === RESPONSIVE Y MODAL CELULAR === */
@media (max-width: 768px) {
  .landing-title {
    font-size: 38px;
  }
  .landing-hero {
    margin-top: 10px;
    margin-bottom: 30px;
  }
  
  /* Toolbar táctil compacto */
  #toolbar {
    height: auto !important;
    min-height: 52px;
    padding: 6px 8px !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .toolbar-group {
    padding: 0 4px !important;
    border: none !important;
  }
  .toolbar-group-label {
    display: none !important; /* Ocultar etiquetas chicas */
  }
  .toolbar-divider {
    display: none !important;
  }
  .tb-btn {
    min-width: 44px !important;
    padding: 6px 8px !important;
    height: 38px !important;
  }
  .tb-btn .tb-label {
    font-size: 9.5px !important;
  }
  
  /* Ajustar grilla Gantt */
  #gantt-container {
    height: calc(100% - 36px) !important;
  }
}

/* MODO PRESENTACIÓN DE OBRA (VISTA ESTÁTICA FOTO DE REUNIÓN INFORMAL DE OBRA) */
.gantt-site-photo-mode {
  transform-origin: top left;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}

.site-photo-badge {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

/* Estilo para la máscara/formulario táctil flotante de edición en móvil */
.mobile-task-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 8, 0.95);
  backdrop-filter: blur(10px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.mobile-task-card {
  width: 100%;
  max-width: 440px;
  background: var(--vp-bg-surface);
  border: 1px solid var(--vp-border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  color: #fff;
  font-family: 'Inter', sans-serif;
}

.mobile-modal-header {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--vp-border-light);
  padding-bottom: 10px;
  color: var(--vp-primary);
}

.mobile-field-group {
  margin-bottom: 15px;
}

.mobile-label {
  display: block;
  font-size: 11px;
  color: var(--vp-text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.mobile-input {
  width: 100%;
  background: var(--vp-bg-dark);
  color: #fff;
  border: 1px solid var(--vp-border);
  padding: 12px;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
.mobile-input:focus {
  border-color: var(--vp-primary);
}

.mobile-actions {
  display: flex;
  gap: 12px;
  margin-top: 25px;
}

.mobile-btn {
  flex: 1;
  padding: 12px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.mobile-btn.save {
  background: var(--vp-primary);
  color: #000;
}
.mobile-btn.cancel {
  background: var(--vp-bg-surface-hover);
  color: var(--vp-text-secondary);
  border: 1px solid var(--vp-border);
}

/* ESTILOS DE VIRTUDES Y PLANES COMERCIALES (MERCADO PAGO) */
.landing-features-container, .landing-plans-container {
  width: 100%;
  max-width: 1100px;
  margin-bottom: 60px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.feature-card {
  background: rgba(20, 24, 35, 0.7);
  border: 1px solid rgba(52, 152, 219, 0.2);
  border-radius: 12px;
  padding: 25px 20px;
  text-align: center;
  backdrop-filter: blur(10px);
  transition: transform 0.3s, border-color 0.3s;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(52, 152, 219, 0.6);
  box-shadow: 0 10px 30px rgba(52, 152, 219, 0.15);
}

.feature-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.feature-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.4;
  margin: 0;
}

/* TABLA DE PLANES */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  align-items: stretch;
}

.plan-card {
  background: rgba(18, 22, 32, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 30px 25px;
  display: flex;
  flex-direction: column;
  position: relative;
  backdrop-filter: blur(12px);
  transition: transform 0.3s, border-color 0.3s;
}

.plan-card:hover {
  transform: translateY(-5px);
  border-color: rgba(52, 152, 219, 0.4);
}

.plan-card.featured {
  background: linear-gradient(180deg, rgba(26, 35, 54, 0.95) 0%, rgba(15, 20, 32, 0.95) 100%);
  border: 2px solid #3498db;
  box-shadow: 0 12px 40px rgba(52, 152, 219, 0.25);
}

.plan-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #94a3b8;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.featured-badge {
  color: #3498db;
}

.plan-name {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 15px;
}

.plan-price {
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}

.plan-subprice {
  font-size: 11.5px;
  font-weight: 600;
  color: #3498db;
  margin-bottom: 20px;
  letter-spacing: 0.3px;
}

.plan-period {
  font-size: 14px;
  font-weight: 500;
  color: #94a3b8;
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 30px 0;
  flex: 1;
}

.plan-features li {
  font-size: 13px;
  color: #cbd5e1;
  margin-bottom: 12px;
  line-height: 1.4;
}

.plan-btn {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.plan-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #3498db;
  color: #3498db;
}

.plan-btn.featured-btn {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: #fff;
  border: none;
  box-shadow: 0 4px 20px rgba(52, 152, 219, 0.4);
}

.plan-btn.featured-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(52, 152, 219, 0.6);
}

.landing-card-item {
  background-size: cover !important;
  background-position: center !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.card-desc {
  font-size: 12px;
  color: #cbd5e1;
  margin-top: 4px;
  line-height: 1.3;
}

/* BARRA FICHA DE OBRA SUPERIOR */
.project-info-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--vp-bg-elevated);
  border-bottom: 1px solid var(--vp-border);
  padding: 6px 16px;
  font-size: 12px;
  flex-wrap: wrap;
  min-height: 36px;
}

.project-info-bar .info-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--vp-text-secondary);
}

.project-info-bar .info-item strong {
  color: var(--vp-text-primary);
  font-weight: 600;
}

.info-edit-btn {
  margin-left: auto;
  background: rgba(52, 152, 219, 0.15);
  color: var(--vp-primary);
  border: 1px solid rgba(52, 152, 219, 0.3);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.info-edit-btn:hover {
  background: var(--vp-primary);
  color: #fff;
}

