/* Painel de Demandas — estilos complementares ao Tailwind */

:root {
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #e5e5ea;
  --canvas: #f5f5f7;
  --priority-alta: #ef4444;
  --priority-media: #eab308;
  --priority-baixa: #22c55e;
}

/* Tipografia suave */
body {
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

/* Cards base */
.card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.06);
}

/* Stats */
.stat-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.stat-icon {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 8px;
  background: var(--canvas);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  margin-bottom: 0.65rem;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-top: 0.15rem;
  color: var(--ink);
}

/* Form controls */
.label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.4rem;
}

.field {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  font-size: 0.875rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field:focus {
  border-color: #a1a1a6;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
}

.field-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236E6E73' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
  cursor: pointer;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-danger,
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 10px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease, opacity 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.btn-primary:active,
.btn-secondary:active,
.btn-ghost:active,
.btn-danger:active,
.btn-icon:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--ink);
  color: #fff;
  padding: 0.65rem 1.1rem;
}

.btn-primary:hover {
  background: #333336;
}

.btn-secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 0.65rem 0.95rem;
}

.btn-secondary:hover,
.btn-secondary.is-active {
  background: var(--canvas);
  border-color: #d2d2d7;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  padding: 0.65rem 0.95rem;
}

.btn-ghost:hover {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.04);
}

.btn-danger {
  background: #dc2626;
  color: #fff;
  padding: 0.65rem 1.1rem;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-icon {
  width: 2rem;
  height: 2rem;
  padding: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
}

.btn-icon:hover {
  background: var(--canvas);
  color: var(--ink);
}

.btn-icon.is-danger:hover {
  background: #fef2f2;
  color: #dc2626;
}

/* Filters */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.filters-panel {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.filters-search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.filters-subtle-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.35rem;
  padding-left: 0.15rem;
}

.field-subtle {
  appearance: none;
  background: transparent;
  border: none;
  border-radius: 6px;
  padding: 0.25rem 1.5rem 0.25rem 0.35rem;
  font-size: 0.75rem;
  font-weight: 450;
  color: var(--muted);
  outline: none;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
  max-width: 100%;
}

.field-subtle:hover {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.03);
}

.field-subtle:focus {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.04);
}

.field-subtle.field-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23A1A1A6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.2rem center;
  padding-right: 1.35rem;
}

/* File upload */
.file-drop {
  position: relative;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  background: #fafafa;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.file-drop:hover {
  border-color: #c7c7cc;
  background: #f5f5f7;
}

.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

/* Demand card */
.demanda-card {
  position: relative;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease, opacity 0.25s ease;
  animation: cardIn 0.35s ease both;
}

.demanda-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
}

.demanda-card.is-atrasada {
  border-color: rgba(239, 68, 68, 0.35);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.08), 0 1px 2px rgba(0, 0, 0, 0.03);
}

.demanda-card.is-dragging {
  opacity: 0.55;
  transform: scale(0.99);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

.demanda-card.is-drag-over {
  border-color: #a1a1a6;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.06);
}

.priority-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.priority-bar.alta { background: var(--priority-alta); }
.priority-bar.media { background: var(--priority-media); }
.priority-bar.baixa { background: var(--priority-baixa); }

.demanda-body {
  padding: 1.15rem 1.25rem 1.15rem 1.4rem;
}

.ordem-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 1.5rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  background: var(--canvas);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.badge-pendente {
  background: #f3f4f6;
  color: #4b5563;
}

.badge-em_andamento {
  background: #eff6ff;
  color: #2563eb;
}

.badge-aguardando_terceiros {
  background: #fff7ed;
  color: #ea580c;
}

.badge-concluida {
  background: #f0fdf4;
  color: #16a34a;
}

.badge-prioridade-alta {
  background: #fef2f2;
  color: #dc2626;
}

.badge-prioridade-media {
  background: #fefce8;
  color: #ca8a04;
}

.badge-prioridade-baixa {
  background: #f0fdf4;
  color: #16a34a;
}

.aviso-atraso {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: #dc2626;
  background: #fef2f2;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 0.85rem;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.meta-item i,
.meta-item svg {
  width: 0.85rem;
  height: 0.85rem;
  flex-shrink: 0;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Drag handle */
.drag-handle {
  cursor: grab;
  color: #c7c7cc;
  padding: 0.25rem;
  border-radius: 6px;
  transition: color 0.2s ease, background 0.2s ease;
}

.drag-handle:hover {
  color: var(--muted);
  background: var(--canvas);
}

.drag-handle:active {
  cursor: grabbing;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(29, 29, 31, 0.35);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

.modal-panel {
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  animation: scaleIn 0.22s ease;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.45s ease both;
}

.animate-fade-in-up {
  animation: cardIn 0.5s ease both;
}

.delay-1 {
  animation-delay: 0.08s;
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 14px;
  height: 96px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
