:root {
  --primary: #0f4c81;
  --primary-light: #2a6db0;
  --danger: #d9534f;
  --success: #28a745;
  --muted: #6c757d;
  --border: #dee2e6;
  --bg: #f5f7fa;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: #212529;
}

header {
  background: var(--primary);
  color: #fff;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

header h1 { font-size: 20px; margin: 0; }

header nav a {
  color: #fff;
  text-decoration: none;
  margin-left: 16px;
  font-size: 14px;
}

header nav a:hover { text-decoration: underline; }

main { max-width: 960px; margin: 24px auto; padding: 0 16px; }

.btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover { background: var(--primary-light); }

.btn-secondary { background: var(--muted); }
.btn-secondary:hover { background: #5a6268; }

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th, td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

th { background: #f8f9fa; }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.badge-ativo { background: #d4edda; color: #155724; }
.badge-inativo { background: #f8d7da; color: #721c24; }

.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}

.form-group input[type="checkbox"] { width: auto; }

.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}

.alert {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 16px;
}

.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

.muted { color: var(--muted); font-size: 13px; }

.empty {
  text-align: center;
  padding: 40px 0;
  color: var(--muted);
}

.spinner {
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 0.8s linear infinite;
  margin: 24px auto;
}

.td-imagens {
  width: 180px;
  vertical-align: middle;
}

.mini-carousel {
  position: relative;
  width: 160px;
  margin: 0 auto;
}

.mini-carousel-track {
  border-radius: 6px;
  overflow: hidden;
  background: #eef1f5;
  height: 100px;
}

.mini-carousel-slide {
  display: none;
  width: 100%;
  height: 100%;
}

.mini-carousel-slide.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-carousel-slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
}

.mini-carousel-btn {
  position: absolute;
  top: 42%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(15, 76, 129, 0.8);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.mini-carousel-btn:hover { background: var(--primary-light); }

.mini-carousel-prev { left: -2px; }
.mini-carousel-next { right: -2px; }

.mini-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
}

.mini-carousel-dot {
  width: 6px;
  height: 6px;
  border: none;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  padding: 0;
}

.mini-carousel-dot.active { background: var(--primary); }

.mini-carousel-empty {
  display: block;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 24px 0;
}

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