/* ===== layout.css — Header, Stats, Kanban, Search ===== */

/* ── Header ── */
header {
  background: var(--primary);
  color: #fff;
  padding: 0 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--primary);
}

.brand { display: flex; align-items: center; }
.brand-logo-img {
  height: 32px;
  width: auto;
  display: block;
}

/* ── Header left / right ── */
.header-left {
  display: flex;
  align-items: center;
  position: relative;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hamburger-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  width: 42px;
  height: 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s;
}
.hamburger-btn:hover { background: rgba(255,255,255,0.2); }
.hamburger-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--surface);
  border-radius: 2px;
  transition: all 0.25s;
}
.hamburger-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; }
.hamburger-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Dropdown menu ── */
.header-menu {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(26,26,26,0.22);
  border: 1px solid var(--border);
  min-width: 220px;
  padding: 8px;
  z-index: 100;
  animation: menuSlide 0.18s ease;
}
.header-menu.open { display: flex; flex-direction: column; }

@keyframes menuSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.menu-api-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-soft);
  background: var(--surface-2);
  margin-bottom: 4px;
  transition: background 0.15s;
}
.menu-api-badge:hover { background: var(--accent-soft); }

.menu-item {
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 11px 14px;
  text-align: left;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  width: 100%;
  transition: background 0.15s, color 0.15s;
  display: block;
}
.menu-item:hover { background: var(--surface-2); color: var(--primary); }
.menu-item.btn-whatsapp { color: var(--whatsapp); }
.menu-item.btn-whatsapp:hover { background: #e9faf0; color: #1a9e4a; }
.menu-item.btn-primary { color: var(--primary); }
.menu-item.btn-primary:hover { background: #f5e6e9; }
.menu-item-danger { color: var(--danger) !important; }
.menu-item-danger:hover { background: #fdeaea !important; }

.menu-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

/* ── Stats ── */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  padding: 24px 32px 0;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px 22px;
  border-left: 3px solid var(--primary);
  box-shadow: var(--shadow);
}
.stat-card .label { font-size: 11px; color: var(--text-soft); text-transform: uppercase; letter-spacing: 2px; font-weight: 500; }
.stat-card .value { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 36px; font-weight: 400; color: var(--primary); margin-top: 6px; letter-spacing: 1px; }

/* ── Search ── */
.search-bar {
  padding: 0 32px;
  margin-top: 16px;
}
.search-bar input {
  width: 100%;
  max-width: 400px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  background: var(--surface);
}

/* ── Kanban ── */
.kanban-wrapper {
  padding: 24px 32px 60px;
  overflow-x: auto;
}
.kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(280px, 1fr));
  gap: 18px;
  min-width: 1400px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  header { flex-direction: column; gap: 12px; padding: 16px; }
  .brand-logo-img { height: 60px; }
  .stats { padding: 16px; }
  .kanban-wrapper { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-footer { flex-direction: column; }
  .modal-footer button { width: 100%; }
  .meta-template-grid { grid-template-columns: 1fr; }
}

/* Quadro que desliza para o lado ao apertar e arrastar fora dos cards */
.kanban-wrapper.pode-arrastar { cursor: grab; }
.kanban-wrapper.pode-arrastar .card { cursor: pointer; }
.kanban-wrapper.arrastando { cursor: grabbing; user-select: none; }
.kanban-wrapper.arrastando * { user-select: none; }
