/* Fondo blanco solo para el área de trabajo del Gantt */
.frappe-gantt .grid-background rect {
  fill: #fff !important;
}

/* Hacer visible el texto de fechas en el Gantt */
.gantt-container .upper-text,
.gantt-container .lower-text,
.frappe-gantt .upper-text,
.frappe-gantt .lower-text {
  fill: #666 !important;
  color: #666 !important;
  font-weight: 500 !important;
}

/* Estilo para las flechas de dependencias */
.frappe-gantt .arrow {
  stroke: #666 !important;
  stroke-width: 1.5 !important;
  fill: none !important;
  opacity: 0.8 !important;
}

/* Colorear días festivos y fines de semana */
.frappe-gantt .grid-row.weekend {
  fill: #ffe0e0 !important;
}

.frappe-gantt .grid-row.holiday {
  fill: #ffcccc !important;
}

/* Columna de nombre de obra */
.frappe-gantt .bar-label {
  dominant-baseline: middle !important;
  text-anchor: middle !important;
}

#gantt svg {
  background: #fff !important;
  background-color: #fff !important;
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.frappe-gantt {
  background: #fff !important;
  background-color: #fff !important;
  overflow: visible !important;
}

/* Asegurar que las barras sean visibles */
.frappe-gantt .bar {
  opacity: 1 !important;
  visibility: visible !important;
}

.frappe-gantt .bar-wrapper {
  opacity: 1 !important;
  visibility: visible !important;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f6f6f6;
}
#container {
  display: flex;
  height: 100vh;
}
#sidebar {
  width: 320px;
  background: #222;
  color: #fff;
  padding: 20px 10px 20px 20px;
  overflow-y: auto;
  box-sizing: border-box;
}
#sidebar h2, #sidebar h3 {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}
#sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1em 0;
}
#sidebar li {
  margin-bottom: 0.3em;
  padding: 0.3em 0.5em;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5em;
}
#sidebar li.selected {
  background: #444;
}
.btn-group {
  display: flex;
  gap: 0.3em;
  opacity: 1;
  transition: opacity 0.2s;
}
#sidebar li:hover .btn-group {
  opacity: 1;
}
.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.2em 0.4em;
  font-size: 0.9em;
  border-radius: 3px;
  transition: background 0.2s;
  width: auto;
  margin: 0;
}
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}
.delete-btn:hover {
  background: rgba(255, 0, 0, 0.3) !important;
}
.project-yellow { background: #ffe066 !important; color: #222; }
.project-orange { background: #ffb347 !important; color: #222; }
.project-red { background: #ff6666 !important; color: #fff; }
.project-normal { background: #e0e0e0 !important; color: #222; }

#sidebar form {
  margin-bottom: 1em;
}
#sidebar input, #sidebar select, #sidebar button {
  width: 100%;
  margin-bottom: 0.5em;
  padding: 0.4em;
  border-radius: 3px;
  border: 1px solid #ccc;
  box-sizing: border-box;
}
#sidebar button {
  background: #007bff;
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: bold;
}
#sidebar button:hover {
  background: #0056b3;
}
#calendar-info {
  background: #333;
  color: #ffe066;
  padding: 0.5em;
  border-radius: 4px;
  font-size: 0.95em;
}

#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
#filters {
  display: flex;
  gap: 1em;
  padding: 1em;
  background: #f0f0f0;
  border-bottom: 1px solid #ddd;
}
#filters select {
  min-width: 180px;
  padding: 0.4em;
}

/* Contenedor del Gantt con columna fija */
#gantt-container {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
  background: #fff;
}

#project-names-column {
  width: 200px;
  min-width: 200px;
  background: #f5f5f5;
  border-right: 2px solid #ccc;
  overflow: hidden;
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
}

#gantt {
  flex: 1;
  overflow: auto;
  background: #fff !important;
  background-color: #fff !important;
  padding: 1em;
  min-height: 600px;
  position: relative;
}

/* Estilos para las etiquetas de proyectos en la columna fija */
.project-label-item {
  background: #e8e8e8;
  border: 1px solid #999;
  border-radius: 3px;
  margin: 5px;
  padding: 8px 10px;
  font-weight: bold;
  font-size: 13px;
  color: #333;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

#queue-view {
  padding: 1em;
  background: #f9f9f9;
  border-top: 1px solid #eee;
}
#queue-tasks {
  list-style: none;
  padding: 0;
  margin: 0 0 1em 0;
}
#queue-tasks li {
  background: #e0e0e0;
  margin-bottom: 0.3em;
  padding: 0.5em;
  border-radius: 4px;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#queue-tasks li.dragging {
  opacity: 0.5;
}
#queue-tasks li.selected {
  background: #b3d7ff;
}
#save-queue {
  background: #28a745;
  color: #fff;
  border: none;
  padding: 0.5em 1em;
  border-radius: 3px;
  cursor: pointer;
  font-weight: bold;
}
#save-queue:hover {
  background: #218838;
}

#task-detail {
  width: 340px;
  background: #f7f7f7;
  border-left: 1px solid #ddd;
  padding: 1.5em 1em 1em 1.5em;
  box-sizing: border-box;
  overflow-y: auto;
}
#task-detail h2 {
  margin-top: 0;
}
#task-form {
  display: flex;
  flex-direction: column;
  gap: 0.7em;
}
#task-form input, #task-form select, #task-form button {
  width: 100%;
  padding: 0.4em;
  border-radius: 3px;
  border: 1px solid #ccc;
  box-sizing: border-box;
}
#task-form button {
  background: #007bff;
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: bold;
}
#task-form button:hover {
  background: #0056b3;
}
#task-info {
  margin-top: 1em;
  font-size: 0.95em;
  color: #333;
}

::-webkit-scrollbar {
  width: 8px;
  background: #eee;
}
::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

/* Toast notifications */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  min-width: 300px;
  padding: 16px 20px;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: all;
  animation: slideIn 0.3s ease-out;
  font-size: 14px;
  font-weight: 500;
}

.toast.success {
  border-left: 4px solid #28a745;
  color: #155724;
}

.toast.error {
  border-left: 4px solid #dc3545;
  color: #721c24;
}

.toast.info {
  border-left: 4px solid #17a2b8;
  color: #0c5460;
}

.toast.warning {
  border-left: 4px solid #ffc107;
  color: #856404;
}

.toast-icon {
  font-size: 20px;
  font-weight: bold;
}

.toast.success .toast-icon { color: #28a745; }
.toast.error .toast-icon { color: #dc3545; }
.toast.info .toast-icon { color: #17a2b8; }
.toast.warning .toast-icon { color: #ffc107; }

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}
