:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --border: #e0e2e7;
  --text: #1f2430;
  --text-muted: #6b7280;
  --primary: #4338ca;
  --primary-hover: #3730a3;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --warning: #b45309;
  --warning-bg: #fffbeb;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

body.loading > * {
  visibility: hidden;
}

a {
  color: var(--primary);
}

h1,
h2,
h3 {
  margin: 0 0 0.5rem;
}

/* Navegação */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.topbar-brand {
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  color: var(--text);
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.topbar-nav a {
  text-decoration: none;
  color: var(--text);
  font-size: 0.95rem;
}

.topbar-nav a:hover {
  color: var(--primary);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.badge-role {
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Cartões / superfícies */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

/* Formulários */

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"],
select,
textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

textarea {
  resize: vertical;
  min-height: 4.5rem;
}

.field-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkbox-row label {
  margin: 0;
  font-weight: 500;
}

/* Botões */

button,
.btn {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

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

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--bg);
}

.btn-danger {
  background: var(--danger);
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-small {
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
}

/* Mensagens */

#toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  max-width: 22rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast-msg {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger);
}

.toast-msg.success {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success);
}

.form-error {
  color: var(--danger);
  font-size: 0.85rem;
  min-height: 1.2rem;
}

/* Quadro (kanban) */

.board-filters {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.board-filters .field {
  min-width: 10rem;
}

.board {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.board-column {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  min-height: 6rem;
}

.board-column h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.board-card {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.7rem;
  margin-top: 0.6rem;
  text-decoration: none;
  color: var(--text);
}

.board-card:hover {
  border-color: var(--primary);
}

.board-card .titulo {
  font-weight: 600;
  font-size: 0.9rem;
  display: block;
  margin-bottom: 0.25rem;
}

.board-card .meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
}

.board-card img.thumb {
  width: 100%;
  height: 6rem;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 0.4rem;
  display: block;
}

.video-placeholder {
  width: 100%;
  height: 6rem;
  border-radius: 6px;
  margin-bottom: 0.4rem;
  background: #111827;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.pill {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.72rem;
}

.pill.warning {
  background: var(--warning-bg);
  color: var(--warning);
  border-color: var(--warning);
}

@media (max-width: 900px) {
  .board {
    grid-template-columns: 1fr;
  }
}

/* Detalhe de conteúdo */

.detail-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.detail-grid img,
.detail-grid video {
  width: 100%;
  border-radius: var(--radius);
  background: #000;
  display: block;
}

.detail-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.comment {
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
}

.comment:last-child {
  border-bottom: none;
}

.comment .autor {
  font-weight: 600;
  font-size: 0.85rem;
}

.comment .data {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 0.4rem;
}

.comment p {
  margin: 0.25rem 0 0;
  white-space: pre-wrap;
}

@media (max-width: 800px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

/* Tabelas */

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

th,
td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
}

/* Login */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-card {
  width: 100%;
  max-width: 22rem;
}

.login-card h1 {
  text-align: center;
  margin-bottom: 1.25rem;
}

/* Progresso de upload */

.progress-wrap {
  display: none;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.progress-track {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--primary);
  transition: width 0.15s ease;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.empty-state {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0.5rem 0;
}
