/* ═══════════════════════════════════════════════════════════
   HOMEWORK / TEMA DE CASA — Estilos
   ═══════════════════════════════════════════════════════════ */

/* ── Loading ── */
.hw-loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-light);
}

/* ── Header ── */
.hw-wrap { padding: 0; }
.hw-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  gap: 1rem;
  flex-wrap: wrap;
}
.hw-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.hw-title i { color: var(--primary); }

/* ── Empty State ── */
.hw-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-light);
}
.hw-empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.4;
}
.hw-empty h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

/* ═══════════════════════════════════════════════════════════
   TASK CARDS (Conselheira)
   ═══════════════════════════════════════════════════════════ */
.hw-tasks-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hw-task-card {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-light, #e5e7eb);
  border-radius: 12px;
  padding: 1.25rem;
  transition: box-shadow 0.2s;
}
.hw-task-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.hw-task-card.hw-overdue {
  border-left: 4px solid #ef4444;
}

.hw-task-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.hw-task-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0;
}
.hw-task-desc {
  font-size: 0.875rem;
  color: var(--text-light);
  margin: 0.25rem 0 0;
  line-height: 1.4;
}

.hw-btn-delete {
  background: none;
  border: none;
  color: #dc2626;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 6px;
  transition: background 0.2s;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.hw-btn-delete:hover { background: rgba(220,38,38,0.08); }

/* Meta info */
.hw-task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.hw-task-meta span { display: flex; align-items: center; gap: 0.3rem; }
.hw-task-meta i { font-size: 0.75rem; }
.hw-overdue-text { color: #ef4444 !important; font-weight: 600; }

/* Progress stats */
.hw-task-progress { margin-bottom: 0.75rem; }
.hw-progress-stats {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.hw-stat {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
}
.hw-stat-pending   { background: #fef3c7; color: #92400e; }
.hw-stat-submitted { background: #dbeafe; color: #1e40af; }
.hw-stat-approved  { background: #d1fae5; color: #065f46; }
.hw-stat-returned  { background: #fee2e2; color: #991b1b; }

/* Children list */
.hw-children-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  border-top: 1px solid var(--border-light, #e5e7eb);
  padding-top: 0.75rem;
}
.hw-child-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  transition: background 0.15s;
}
.hw-child-row.hw-child-actionable {
  cursor: pointer;
  background: rgba(59,130,246,0.04);
}
.hw-child-row.hw-child-actionable:hover {
  background: rgba(59,130,246,0.1);
}
.hw-child-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary, #2563eb);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.hw-child-name {
  font-size: 0.875rem;
  color: var(--text-dark);
}

/* Info column (name + coordinator log) */
.hw-child-info-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

/* Coordinator finalization log */
.hw-coordinator-log {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  color: #7c3aed;
  font-weight: 500;
  opacity: 0.85;
}
.hw-coordinator-log i {
  font-size: 0.65rem;
  color: #7c3aed;
}

/* Finalize button */
.hw-btn-finalize {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1.5px solid rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.06);
  color: #059669;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.hw-btn-finalize:hover {
  background: #059669;
  color: #fff;
  border-color: #059669;
  transform: scale(1.08);
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}

/* Status badges */
.hw-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  white-space: nowrap;
}
.hw-status-pending   { background: #fef3c7; color: #92400e; }
.hw-status-submitted { background: #dbeafe; color: #1e40af; }
.hw-status-approved  { background: #d1fae5; color: #065f46; }
.hw-status-returned  { background: #fee2e2; color: #991b1b; }

/* ═══════════════════════════════════════════════════════════
   MODAL — Criar / Revisar
   ═══════════════════════════════════════════════════════════ */
.hw-modal {
  background: var(--bg-card, #fff);
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  overflow: hidden;
}
.hw-modal-review { max-width: 640px; }

.hw-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-light, #e5e7eb);
}
.hw-modal-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}
.hw-modal-header h3 i { color: var(--primary); }
.hw-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text-muted);
  padding: 0.3rem;
  border-radius: 6px;
  transition: background 0.15s;
}
.hw-modal-close:hover { background: rgba(0,0,0,0.06); }

.hw-modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
}

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

/* Form elements */
.hw-form-group {
  margin-bottom: 1rem;
}
.hw-form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.4rem;
}
.hw-form-group label i {
  color: var(--primary);
  margin-right: 0.3rem;
}
.hw-input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border-light, #d1d5db);
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
  background: var(--bg-card, #fff);
  color: var(--text-dark);
}
.hw-input:focus { border-color: var(--primary); }

.hw-textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border-light, #d1d5db);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
  background: var(--bg-card, #fff);
  color: var(--text-dark);
}
.hw-textarea:focus { border-color: var(--primary); }

/* Children select */
.hw-select-all {
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.6rem;
  background: rgba(59,130,246,0.04);
  border-radius: 8px;
}
.hw-children-select {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border-light, #e5e7eb);
  border-radius: 8px;
  padding: 0.5rem;
}
.hw-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.4rem;
  cursor: pointer;
  border-radius: 6px;
  font-size: 0.875rem;
  transition: background 0.15s;
}
.hw-checkbox-label:hover { background: rgba(0,0,0,0.03); }
.hw-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════
   REVIEW MODAL
   ═══════════════════════════════════════════════════════════ */
.hw-review-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--bg-subtle, #f9fafb);
  border-radius: 10px;
}
.hw-review-detail {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.hw-review-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.hw-review-label i { font-size: 0.7rem; }
.hw-review-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dark);
}

.hw-review-comment {
  background: var(--bg-subtle, #f9fafb);
  border-radius: 10px;
  padding: 0.75rem;
  margin-bottom: 1rem;
}
.hw-review-comment h4 {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.hw-review-comment h4 i { color: var(--primary); font-size: 0.8rem; }
.hw-review-comment p {
  font-size: 0.875rem;
  color: var(--text-light);
  margin: 0;
  line-height: 1.5;
}

.hw-review-attachments {
  margin-bottom: 1rem;
}
.hw-review-attachments h4 {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 0.6rem;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.hw-review-attachments h4 i { color: var(--primary); font-size: 0.8rem; }

.hw-attachments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}
.hw-attachment {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.hw-attachment-img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s;
  border: 1px solid var(--border-light, #e5e7eb);
}
.hw-attachment-img:hover { transform: scale(1.03); }
.hw-attachment-video {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border-light, #e5e7eb);
}
.hw-att-name {
  font-size: 0.7rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hw-no-attachments {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.75rem;
  background: var(--bg-subtle, #f9fafb);
  border-radius: 8px;
  margin-bottom: 1rem;
}
.hw-no-attachments i { margin-right: 0.3rem; }

/* Review action buttons */
.hw-review-actions {
  justify-content: space-between;
}
.hw-btn-return {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  border: 2px solid #f59e0b;
  background: transparent;
  color: #f59e0b;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.hw-btn-return:hover { background: #fffbeb; }
.hw-btn-approve {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  border: none;
  background: #10b981;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.hw-btn-approve:hover { background: #059669; }

/* ═══════════════════════════════════════════════════════════
   PARENT CARDS
   ═══════════════════════════════════════════════════════════ */
.hw-section { margin-bottom: 1.5rem; }
.hw-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-light, #e5e7eb);
}
.hw-section-pending  { color: #d97706; border-color: #f59e0b; }
.hw-section-submitted { color: #2563eb; border-color: #3b82f6; }
.hw-section-approved  { color: #059669; border-color: #10b981; }
.hw-section-count {
  font-size: 0.75rem;
  background: currentColor;
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hw-section-pending .hw-section-count  { background: #d97706; }
.hw-section-submitted .hw-section-count { background: #2563eb; }
.hw-section-approved .hw-section-count  { background: #059669; }

.hw-parent-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.hw-parent-card {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-light, #e5e7eb);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  transition: box-shadow 0.2s;
}
.hw-parent-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.hw-parent-card.hw-overdue { border-left: 4px solid #ef4444; }
.hw-card-approved { opacity: 0.85; }

.hw-parent-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.hw-parent-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0;
}
.hw-parent-card-desc {
  font-size: 0.85rem;
  color: var(--text-light);
  margin: 0.25rem 0 0;
  line-height: 1.4;
}

.hw-parent-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.hw-parent-card-meta span { display: flex; align-items: center; gap: 0.3rem; }
.hw-parent-card-meta i { font-size: 0.75rem; }

/* Return message */
.hw-return-message {
  display: flex;
  gap: 0.6rem;
  padding: 0.75rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: #92400e;
}
.hw-return-message > i {
  font-size: 1.1rem;
  color: #d97706;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.hw-return-message strong { display: block; margin-bottom: 0.2rem; }
.hw-return-message p { margin: 0; line-height: 1.4; }

/* Submission preview */
.hw-submission-preview {
  margin-bottom: 0.75rem;
}
.hw-att-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* Action button */
.hw-parent-card-action {
  padding-top: 0.5rem;
}
.hw-btn-respond {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.2rem;
  border: none;
  background: var(--primary, #2563eb);
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  width: 100%;
  justify-content: center;
}
.hw-btn-respond:hover { background: #1d4ed8; }

/* Approved ribbon */
.hw-approved-ribbon {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  background: #d1fae5;
  color: #065f46;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Send button */
.hw-btn-send {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.4rem;
  border: none;
  background: var(--primary, #2563eb);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}
.hw-btn-send:hover { background: #1d4ed8; }

/* Submit info */
.hw-submit-info {
  padding: 0.75rem;
  background: var(--bg-subtle, #f9fafb);
  border-radius: 10px;
  margin-bottom: 1rem;
}
.hw-submit-info p {
  margin: 0.25rem 0;
  font-size: 0.9rem;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.hw-submit-info i { color: var(--primary); font-size: 0.85rem; }

/* ═══════════════════════════════════════════════════════════
   UPLOAD AREA (Parent submit modal)
   ═══════════════════════════════════════════════════════════ */
.hw-upload-area {
  border: 2px dashed var(--border-light, #d1d5db);
  border-radius: 10px;
  transition: all 0.2s;
  overflow: hidden;
}
.hw-upload-area.hw-drag-over {
  border-color: var(--primary);
  background: rgba(59,130,246,0.04);
}
.hw-upload-placeholder {
  text-align: center;
  padding: 1.5rem 1rem;
  cursor: pointer;
  color: var(--text-muted);
}
.hw-upload-placeholder i {
  font-size: 2rem;
  color: var(--primary);
  opacity: 0.6;
  margin-bottom: 0.5rem;
}
.hw-upload-placeholder p {
  font-size: 0.9rem;
  margin: 0.25rem 0;
}
.hw-upload-placeholder small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Preview grid */
.hw-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.6rem;
  margin-top: 0.75rem;
}
.hw-preview-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-light, #e5e7eb);
}
.hw-preview-thumb {
  width: 100%;
  height: 80px;
  object-fit: cover;
  display: block;
}
.hw-preview-name {
  font-size: 0.65rem;
  color: var(--text-muted);
  padding: 0.2rem 0.4rem;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hw-preview-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.7rem;
  transition: background 0.15s;
}
.hw-preview-remove:hover { background: #ef4444; }

/* Dashboard badge */
.hw-dashboard-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ef4444;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════════════
   SPECIALTY BADGE — vinculo com especialidade
   ═══════════════════════════════════════════════════════════ */
.hw-specialty-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  margin: 0.5rem 0 0;
  background: linear-gradient(135deg, rgba(245,158,11,.06), rgba(245,158,11,.12));
  border: 1px solid rgba(245,158,11,.2);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}
.hw-specialty-badge > i {
  color: #f59e0b;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.hw-specialty-badge strong {
  color: var(--text-primary);
}
.hw-specialty-status {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}
.hw-specialty-status--pending {
  background: rgba(107,114,128,.1);
  color: #6b7280;
}
.hw-specialty-status--approved {
  background: rgba(5,150,105,.1);
  color: #059669;
}

@media (max-width: 600px) {
  .hw-modal { max-width: 100%; border-radius: 12px; }
  .hw-review-info { grid-template-columns: 1fr; }
  .hw-attachments-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .hw-review-actions { flex-direction: column; }
  .hw-btn-return, .hw-btn-approve { width: 100%; justify-content: center; }
  .hw-parent-card-top { flex-direction: column; }
  .hw-task-top { flex-direction: column; }
  .hw-progress-stats { gap: 0.4rem; }
  .hw-stat { font-size: 0.75rem; padding: 0.2rem 0.5rem; }
  .hw-specialty-badge { flex-direction: column; align-items: flex-start; }
  .hw-specialty-status { margin-left: 0; }
}
