:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #2563eb;
  --warning: #f59e0b;
  --danger: #dc2626;
  --success: #16a34a;
  --info: #0891b2;
  --shadow: 0 10px 25px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 24px;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, sans-serif;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  background: var(--card);
  padding: 28px;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

h1 { margin: 0; font-size: 30px; }

.subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.actions-top {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1100px;
}

thead th {
  background: #f9fafb;
  color: #374151;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

th, td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  text-align: center;
  vertical-align: middle;
}

tbody tr:hover { background: #fafafa; }

.col-projeto {
  text-align: left;
  min-width: 240px;
}

.projeto-nome {
  font-weight: bold;
  margin-bottom: 4px;
}

.projeto-meta {
  font-size: 12px;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  font-size: 13px;
  line-height: 1.2;
  transition: transform 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); opacity: 0.95; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-view { background-color: #3498db; }
.btn-edit { background-color: #f39c12; }
.btn-delete { background-color: #e74c3c; }
.btn-tasks { background-color: #2ecc71; }
.btn-tempo { background-color: #17a2b8; }
.btn-dashboard { background-color: #10b981; }
.btn-custos { background-color: #7c3aed; }

.badge-status {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: bold;
}

.status-ativo {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
}
.status-pausado {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}
.status-concluido {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}
.status-neutro {
  background: rgba(107, 114, 128, 0.12);
  color: #4b5563;
}

.empty-state,
.error-box {
  margin-top: 24px;
  padding: 16px;
  border-radius: 10px;
  text-align: center;
}

.empty-state {
  background: #f9fafb;
  color: var(--muted);
  border: 1px dashed var(--border);
}

.error-box {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.tempo-total { font-weight: bold; color: #111827; }
.custo-total { font-weight: bold; color: #111827; }
.custo-running { color: var(--success); }

.timer-display {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #1f2937;
}
.timer-running { color: var(--success); }

/* Tempo + cronômetro agora na mesma coluna */
.tempo-box {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.timer-actions {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
}

/* Ações sempre em 1 linha (sem quebrar) */
.acoes-grid {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  white-space: nowrap;
}

/* Ícones */
.icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
}

.btn .label { display: inline; }

/* Em telas menores: vira “modo ícone” para caber */
@media (max-width: 1100px) {
  .btn { padding: 8px 10px; }
  .btn .label { display: none; }  /* opção b */
}

/* Melhor resp geral */
@media (max-width: 768px) {
  body { padding: 14px; }
  .container { padding: 18px; }
  h1 { font-size: 24px; }
}