/* Dashboard Styles */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.dashboard-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  border: 1px solid #e9ecef;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dashboard-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.card-header h2 {
  margin: 0;
  font-size: 1.125rem;
  color: #495057;
  font-weight: 600;
}

.card-value {
  font-size: 2rem;
  font-weight: 700;
  color: #1a73e8;
}

.card-content {
  text-align: center;
}

.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background-color: #1a73e8;
  color: white;
}

.btn-primary:hover {
  background-color: #1557b5;
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background-color: #545b62;
}

/* AI Query Section */
.ai-query-section {
  margin-bottom: 2rem;
}

.ai-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  border: 1px solid #e9ecef;
}

.ai-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 0.875rem;
  line-height: 1.5;
  resize: vertical;
  min-height: 120px;
  margin-bottom: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.ai-textarea:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.ai-loading {
  display: none;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background-color: #e3f2fd;
  border: 1px solid #bbdefb;
  border-radius: 6px;
  color: #1565c0;
  font-size: 0.875rem;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #e3f2fd;
  border-top: 2px solid #1565c0;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.ai-response {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  margin-top: 1rem;
  border: 1px solid #e9ecef;
  border-left: 4px solid #1a73e8;
}

.response-header {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e9ecef;
}

.response-header h3 {
  margin: 0;
  font-size: 1rem;
  color: #495057;
  font-weight: 600;
}

.response-content {
  color: #212529;
  line-height: 1.6;
  font-size: 0.875rem;
}

.response-content p {
  margin: 0.5rem 0;
}

/* Recent Movements Section */
.recent-section {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  border: 1px solid #e9ecef;
}

.recent-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.recent-item {
  padding: 1rem;
  border-bottom: 1px solid #e9ecef;
  transition: background-color 0.3s ease;
}

.recent-item:last-child {
  border-bottom: none;
}

.recent-item:hover {
  background-color: #f8f9fa;
}

.movement-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.movement-link {
  color: #1a73e8;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
}

.movement-link:hover {
  text-decoration: underline;
}

.movement-date {
  color: #6c757d;
  font-size: 0.75rem;
}

.movement-details {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.movement-type {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.movement-type.entry {
  background-color: #d4edda;
  color: #155724;
}

.movement-type.exit {
  background-color: #f8d7da;
  color: #721c24;
}

.movement-quantity {
  font-weight: 700;
  color: #495057;
}

.movement-detail {
  color: #6c757d;
  font-size: 0.875rem;
  font-style: italic;
}

.no-data {
  text-align: center;
  padding: 2rem;
  color: #6c757d;
  font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .dashboard-card {
    padding: 1rem;
  }
  
  .card-value {
    font-size: 1.5rem;
  }
  
  .ai-card {
    padding: 1rem;
  }
  
  .ai-textarea {
    min-height: 100px;
  }
  
  .recent-section {
    padding: 1rem;
  }
  
  .movement-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  .movement-details {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .dashboard-card {
    padding: 0.75rem;
  }
  
  .card-header h2 {
    font-size: 1rem;
  }
  
  .card-value {
    font-size: 1.25rem;
  }
  
  .ai-textarea {
    padding: 0.5rem;
    font-size: 0.8rem;
  }
  
  .movement-details {
    flex-direction: column;
    align-items: flex-start;
  }
}
