/* ============================
🎨 GENERAL LAYOUT & RESET
============================= */
body {
  margin: 0;
  font-family: 'Roboto', sans-serif;
  background: #f5f5f5;
}

.hidden {
  display: none;
}

button {
  cursor: pointer;
  font-family: inherit;
}

/* ============================
🔷 TOP HEADER
============================= */
.main-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  background-color: #0277bd;
  color: white;
  padding: 1rem;
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-logo {
  height: 50px;
  width: auto;
  max-height: 10vh;
}

.disabled-btn {
  margin-left: auto;
  opacity: 0.5;
  pointer-events: none;
  background: transparent;
  border: none;
  font-weight: bold;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ============================
🔍 FILTER & ORDER BARS
============================= */
.bar-section {
  background: #eee;
  padding: 1rem;
  border-bottom: 1px solid #ccc;
}

details summary {
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.bar-label {
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}

.filter-order-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.5rem;
}

.filter-select {
  padding: 0.5rem;
  font-size: 0.95rem;
  border: 1px solid #bbb;
  border-radius: 4px;
}

.scroll-order {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.order-btn {
  background: white;
  border: 1px solid #bbb;
  border-radius: 4px;
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
}

.order-btn.active {
  background: #0277bd;
  color: white;
  font-weight: bold;
}

/* ============================
🧱 TASK CARDS - GRID
============================= */
.card-grid {
  padding: 1.5rem;
}

.group-title {
  font-size: 1rem;
  font-weight: bold;
  margin: 2rem 0 0.5rem;
  border-top: 2px solid #ccc;
  padding-top: 0.5rem;
}

.card-list {
  column-count: 4;
  column-gap: 1.5rem;
}

@media (max-width: 1000px) {
  .card-list { column-count: 2; }
}
@media (max-width: 600px) {
  .card-list { column-count: 1; }
}

/* ============================
🧱 CARD STYLING
============================= */
.card-task {
  display: inline-block;
  width: 100%;
  margin: 0 0 1.5rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  overflow: hidden;
  break-inside: avoid;
  position: relative;
}

.card-header {
  padding: 0.8rem 1rem 0.3rem;
  background: #fafafa;
  font-weight: bold;
  cursor: pointer;
  position: relative;
}

.reference-text {
  display: block;
  margin-bottom: 0.5rem;
}

.header-icons {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.priority-inline {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 2px 8px;
  font-size: 0.85rem;
  color: white;
  border-radius: 20px;
  white-space: nowrap;
}

.card-status-badge {
  font-weight: bold;
  font-size: 0.8rem;
  background: #e0e0e0;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

/* PRIORITY COLORS */
.priority-1 { background: #b71c1c; }
.priority-2 { background: #f48fb1; }
.priority-3 { background: #ffcc80; }
.priority-4 { background: #81d4fa; }
.priority-5 { background: #b2dfdb; }
.priority-6, .priority-7 { background: #e0e0e0; color: #333; }

/* STATUS COLORS */
.status-NOVA { color: white; background: #8e24aa; }
.status-EM_ANALISE, .status-AGUARDA_INFO { background: #fbc02d; color: black; }
.status-ENCAMINHADA, .status-EM_ANDAMENTO { background: #4caf50; color: white; }
.status-PENDENTE { background: #f06292; }
.status-CONCLUIDA { background: #bdbdbd; color: black; }
.status-ORÇAMENTO, .status-AGUARDA_APROV { background: #e0e0e0; color: black; }

/* BODY CONTENT */
.card-body {
  padding: 1rem;
  font-size: 0.9rem;
  line-height: 1.4;
}

.card-body .label {
  font-weight: bold;
}

/* EDIT BUTTON */
.edit-icon {
  position: absolute;
  right: 0.8rem;
  bottom: 0.8rem;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0.7;
}
.edit-icon:hover {
  opacity: 1;
}

/* ===============
📦 MODAL
=============== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 6px;
  max-width: 600px;
  width: 90%;
  position: relative;
}

.close-btn {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
}

.modal-content textarea {
  width: 100%;
  resize: vertical;
  margin-top: 0.5rem;
}

.modal-footer {
  font-size: 0.8rem;
  color: #555;
  margin-top: 1rem;
  border-top: 1px solid #ccc;
  padding-top: 0.5rem;
}

/* 🆙 TO TOP BUTTON */
.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  background: #333;
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1rem;
  width: 2.2rem;
  height: 2.2rem;
  display: none;
  align-items: center;
  justify-content: center;
}

.back-to-top.show {
  display: flex;
}
