*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:      #141414;
  --card:    #1f1f1f;
  --card2:   #272727;
  --red:     #E63946;
  --red-dark:#c1121f;
  --green:   #2dc653;
  --gray:    #777;
  --gray-dk: #333;
  --white:   #f0f0f0;
  --border:  #2e2e2e;
}

body {
  background: var(--bg);
  color: var(--white);
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: 14px;
  min-height: 100vh;
}

/* ── HEADER ── */
header {
  background: #0e0e0e;
  border-bottom: 2px solid var(--red);
  padding: 0 28px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,.5);
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-img {
  height: 38px;
  width: 38px;
  object-fit: contain;
  border-radius: 6px;
}

.logo-badge {
  background: var(--red);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  padding: 6px 12px;
  border-radius: 7px;
  letter-spacing: 1px;
}

.logo-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
}

.logo-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--gray);
  letter-spacing: .3px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── BUTTONS ── */
.btn {
  cursor: pointer;
  border: none;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-sync {
  background: var(--card2);
  color: var(--white);
  border: 1px solid var(--border);
}

.btn-sync .spin { display: none; }
.btn-sync.loading .spin { display: inline-block; animation: spin .7s linear infinite; }
.btn-sync.loading .icon-sync { display: none; }

.btn-red   { background: var(--red);   color: #fff; }
.btn-gray  { background: var(--gray-dk); color: var(--white); border: 1px solid var(--border); }
.btn-green { background: var(--green); color: #fff; }

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

/* ── FILTERS ── */
.filters-bar {
  background: #0e0e0e;
  border-bottom: 1px solid var(--border);
  padding: 10px 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 7px;
}

.filter-group label {
  color: var(--gray);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap;
}

select {
  background: var(--card2);
  color: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
  outline: none;
  transition: border-color .15s;
}
select:focus { border-color: var(--red); }

.filter-sep {
  width: 1px;
  height: 22px;
  background: var(--border);
  margin: 0 2px;
}

/* ── MAIN ── */
main {
  padding: 22px 28px;
}

.status-bar {
  color: var(--gray);
  font-size: 12px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-bar .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
  box-shadow: 0 0 6px var(--green);
}

/* ── GRID ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 18px;
}

/* ── CARD ── */
.card {
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 24px rgba(0,0,0,.3);
  transition: transform .15s, box-shadow .15s;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}

.card-header {
  background: linear-gradient(135deg, var(--red) 0%, #b91c1c 100%);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.card-count {
  font-size: 11px;
  background: rgba(0,0,0,.3);
  padding: 2px 9px;
  border-radius: 10px;
  font-weight: 700;
}

.card-body {
  padding: 4px 0;
  flex: 1;
}

.card-footer {
  padding: 10px 16px 12px;
  border-top: 1px solid var(--border);
  background: var(--card2);
}

.progress-label {
  font-size: 11px;
  color: var(--gray);
  margin-bottom: 5px;
  display: flex;
  justify-content: space-between;
}

.progress-bar {
  height: 4px;
  background: var(--gray-dk);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--red), #f87171);
  border-radius: 3px;
  transition: width .5s ease;
}

.progress-fill.completo {
  background: linear-gradient(90deg, var(--green), #4ade80);
}

/* ── DEMANDA ITEM ── */
.demanda-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .12s;
  position: relative;
}
.demanda-item:last-child { border-bottom: none; }
.demanda-item:hover { background: rgba(255,255,255,.03); }
.demanda-item.concluido { opacity: .55; }

.demanda-check {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-radius: 5px;
  flex-shrink: 0;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.demanda-item:hover .demanda-check { border-color: var(--gray); }
.demanda-item.concluido .demanda-check {
  border-color: var(--green);
  background: var(--green);
}
.demanda-check svg { display: none; }
.demanda-item.concluido .demanda-check svg { display: block; }

.demanda-info { flex: 1; min-width: 0; }

.demanda-titulo {
  font-size: 13px;
  font-weight: 500;
  color: var(--white);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.demanda-item.concluido .demanda-titulo {
  text-decoration: line-through;
  color: var(--gray);
}

.demanda-meta {
  font-size: 11px;
  color: var(--gray);
  margin-top: 3px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.tag {
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.tag-reel      { background: #1e3a5f; color: #60a5fa; }
.tag-carrossel { background: #3b1f5e; color: #c084fc; }
.tag-foto      { background: #1a3d2b; color: #4ade80; }
.tag-video     { background: #4a2e1e; color: #fb923c; }
.tag-default   { background: var(--gray-dk); color: var(--gray); }
.tag-urgente   { background: var(--red); color: #fff; }
.tag-thiago    { background: #1e3a5c; color: #93c5fd; }
.tag-gabi      { background: #3b1a4a; color: #d8b4fe; }

.demanda-link {
  font-size: 11px;
  color: #60a5fa;
  margin-top: 3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}
.demanda-link:hover { text-decoration: underline; }

/* ── EMPTY STATE ── */
.empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 80px 20px;
  color: var(--gray);
}
.empty-icon { font-size: 52px; margin-bottom: 14px; }
.empty h3 { font-size: 20px; color: var(--white); margin-bottom: 8px; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--card);
  border-radius: 14px;
  width: 100%;
  max-width: 480px;
  border: 1px solid var(--border);
  overflow: hidden;
  transform: translateY(24px) scale(.97);
  transition: transform .2s;
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
}
.modal-overlay.active .modal { transform: translateY(0) scale(1); }

.modal-header {
  background: linear-gradient(135deg, var(--red) 0%, #b91c1c 100%);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 15px; font-weight: 700; }

.modal-close {
  background: rgba(0,0,0,.2);
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.modal-close:hover { background: rgba(0,0,0,.4); }

.modal-body { padding: 20px; }

.modal-demanda-info {
  background: var(--bg);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 13px;
  border-left: 3px solid var(--red);
}

.modal-demanda-info .info-row {
  display: flex;
  gap: 8px;
  margin-bottom: 3px;
  line-height: 1.5;
}
.modal-demanda-info .info-row:last-child { margin-bottom: 0; }
.modal-demanda-info .info-label { color: var(--gray); min-width: 80px; }

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .6px;
}

.form-group input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--white);
  font-size: 13px;
  padding: 10px 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-group input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(230,57,70,.15);
}
.form-group input::placeholder { color: var(--gray); }

.modal-footer {
  padding: 0 20px 20px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px 18px;
  font-size: 13px;
  font-weight: 500;
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(80px);
  opacity: 0;
  transition: all .3s cubic-bezier(.34,1.56,.64,1);
  max-width: 320px;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }

/* ── LOADING ── */
.loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  transition: opacity .4s;
}
.loading-screen.hidden { opacity: 0; pointer-events: none; }

.loader {
  width: 42px; height: 42px;
  border: 3px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.loading-text { color: var(--gray); font-size: 13px; }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  header { padding: 0 16px; height: 54px; }
  main { padding: 14px 16px; }
  .filters-bar { padding: 8px 16px; }
  .cards-grid { grid-template-columns: 1fr; }
}
