/* Variables */
:root {
  --background: hsl(210, 20%, 98%);
  --foreground: hsl(222, 47%, 11%);
  --card: hsl(0, 0%, 100%);
  --card-foreground: hsl(222, 47%, 11%);
  --primary: hsl(199, 89%, 48%);
  --primary-foreground: hsl(0, 0%, 100%);
  --secondary: hsl(210, 40%, 96%);
  --secondary-foreground: hsl(222, 47%, 11%);
  --muted: hsl(210, 40%, 96%);
  --muted-foreground: hsl(215, 16%, 47%);
  --border: hsl(214, 32%, 91%);
  --destructive: hsl(0, 84%, 60%);
  --destructive-foreground: hsl(0, 0%, 100%);
  --success: hsl(142, 76%, 36%);
  --success-foreground: hsl(0, 0%, 100%);
  --warning: hsl(38, 92%, 50%);
  --warning-foreground: hsl(0, 0%, 100%);
  --raiox-header: hsl(213, 94%, 18%);
  --raiox-header-foreground: hsl(0, 0%, 100%);
  --radius: 0.75rem;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Container */
.container {
    /* full width layout for implanted panel; no fixed max-width */
    width: 100%;
    /* keep some horizontal padding instead of centering margins */
    margin: 0;
    padding: 20px;
    background-color: white;
    min-height: 100vh;
}

/* Header */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-buttons {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.header-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background-color: var(--primary);
  color: var(--primary-foreground);
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

.subtitle {
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background-color: var(--primary);
  color: var(--primary-foreground);
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-success {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background-color: var(--success);
  color: var(--success-foreground);
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-success:hover {
  opacity: 0.9;
}

.btn-success.hidden {
  display: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background-color: var(--secondary);
  color: var(--secondary-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-secondary:hover {
  background-color: var(--muted);
}

.btn-info {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background-color: hsl(199, 89%, 48%);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-info:hover {
  opacity: 0.9;
}

.btn-destructive {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background-color: var(--destructive);
  color: var(--destructive-foreground);
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-destructive:hover {
  opacity: 0.9;
}

.csv-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.csv-actions.hidden {
  display: none;
}

.csv-upload-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.csv-upload-wrapper.hidden {
  display: none;
}

/* Filters */
.filters-card {
  background-color: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.filters-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  color: var(--muted-foreground);
}

.filters-header h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--foreground);
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.filter-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.input-with-icon {
  position: relative;
}

.input-with-icon svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
}

.input-with-icon input {
  width: 100%;
  padding: 0.625rem 0.75rem 0.625rem 2.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  background-color: var(--card);
  color: var(--foreground);
}

select {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  background-color: var(--card);
  color: var(--foreground);
  cursor: pointer;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px hsla(199, 89%, 48%, 0.1);
}

/* Loading */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 5rem 0;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 0;
  text-align: center;
  color: var(--muted-foreground);
}

.empty-state svg {
  opacity: 0.5;
  margin-bottom: 1rem;
}

.empty-state h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* Content */
.content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Client Header */
.client-header {
  background: var(--raiox-header);
  color: var(--raiox-header-foreground);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.client-header-content {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.client-info {
  display: flex;
  gap: 1rem;
}

.client-logo {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background-color: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  object-fit: cover;
}

.client-name {
  font-size: 1.5rem;
  font-weight: 700;
}

.client-project {
  opacity: 0.7;
}

.client-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  background-color: rgba(255, 255, 255, 0.1);
}

.client-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.go-live-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
}

.go-live-box span {
  font-size: 0.75rem;
  opacity: 0.7;
}

.go-live-box strong {
  font-size: 0.875rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-badge.atrasado {
  background-color: var(--destructive);
  color: var(--destructive-foreground);
}

.status-badge.concluido {
  background-color: var(--success);
  color: var(--success-foreground);
}

.status-badge.em-andamento {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.status-badge.pendente {
  background-color: var(--warning);
  color: var(--warning-foreground);
}

/* Progress Card */
.progress-card {
  background-color: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
}

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

.progress-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.progress-header h3 {
  font-weight: 600;
}

.progress-header span {
  color: var(--primary);
  font-weight: 500;
}

.progress-bar-container {
  height: 8px;
  background-color: var(--muted);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.progress-bar {
  height: 100%;
  background-color: var(--primary);
  border-radius: 9999px;
  transition: width 0.5s ease;
}

.phases-container {
  display: flex;
  justify-content: space-between;
}

.phase {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.phase-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
  transition: all 0.3s;
}

.phase-icon.concluido {
  background-color: var(--success);
  color: var(--success-foreground);
}

.phase-icon.em-andamento {
  background-color: var(--primary);
  color: var(--primary-foreground);
  box-shadow: 0 0 0 4px hsla(199, 89%, 48%, 0.2);
}

.phase-icon.pendente {
  background-color: var(--muted);
  color: var(--muted-foreground);
  border: 2px solid var(--border);
}

.phase-name {
  font-size: 0.875rem;
  font-weight: 500;
}

.phase-status {
  font-size: 0.75rem;
}

.phase-status.concluido { color: var(--success); }
.phase-status.em-andamento { color: var(--primary); }
.phase-status.pendente { color: var(--muted-foreground); }

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.info-card {
  background-color: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
}

.info-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.info-card-header svg {
  color: var(--primary);
}

.info-card-header h4 {
  font-weight: 600;
}

.info-card ul {
  list-style: none;
}

.info-card li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.info-card li:last-child {
  border-bottom: none;
}

.info-card li svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  background-color: var(--secondary);
  color: var(--secondary-foreground);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.tag.objetivo-1 { background-color: hsla(0, 84%, 60%, 0.1); color: hsl(0, 84%, 60%); }
.tag.objetivo-2 { background-color: hsla(199, 89%, 48%, 0.1); color: hsl(199, 89%, 48%); }
.tag.objetivo-3 { background-color: hsla(142, 76%, 36%, 0.1); color: hsl(142, 76%, 36%); }
.tag.objetivo-4 { background-color: hsla(38, 92%, 50%, 0.1); color: hsl(38, 92%, 50%); }

.responsavel-card {
  background-color: var(--secondary);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.5rem;
}

.responsavel-card:last-child {
  margin-bottom: 0;
}

.responsavel-name {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.responsavel-cargo {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-bottom: 0.5rem;
}

.responsavel-contact {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.empty-card-text {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  font-style: italic;
}

/* Footer */
.footer {
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  padding-top: 2rem;
  margin-top: auto;
  border-top: 1px solid var(--border);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  position: relative;
  background-color: var(--card);
  border-radius: var(--radius);
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  margin: 1rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted-foreground);
  padding: 0.25rem;
  border-radius: var(--radius);
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--foreground);
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.5rem;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.checkbox-item label {
  font-size: 0.875rem;
  cursor: pointer;
  margin: 0;
}

.responsavel-form {
  background-color: var(--secondary);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.5rem;
}

.responsavel-form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.responsavel-form-header span {
  font-weight: 500;
  font-size: 0.875rem;
}

.btn-remove {
  background: none;
  border: none;
  color: var(--destructive);
  cursor: pointer;
  padding: 0.25rem;
}

.responsavel-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.responsavel-form-grid input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  background-color: var(--card);
}

textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  background-color: var(--card);
  color: var(--foreground);
  resize: vertical;
  font-family: inherit;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* Utility Classes */
.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .client-header-content {
    flex-direction: column;
  }

  .client-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .phases-container {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .phase {
    flex: 1 1 80px;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .responsavel-form-grid {
    grid-template-columns: 1fr;
  }
}
