:root {
  --bg: #0f1220;
  --bg-elev: #171a2b;
  --card: #1d2136;
  --line: #2a2f4a;
  --text: #e7e9f3;
  --muted: #9aa0c0;
  --primary: #6c8cff;
  --primary-d: #4f6fe6;
  --danger: #ff5d6c;
  --ok: #36c98f;
  --warn: #f5b955;
  --radius: 12px;
  /* Margem lateral pequena e responsiva (cresce um pouco em telas largas). */
  --side: clamp(16px, 2vw, 32px);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px var(--side);
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.brand { font-weight: 700; font-size: 1.1rem; color: var(--text); }
.brand span { color: var(--primary); }
.nav { display: flex; gap: 16px; flex: 1; flex-wrap: wrap; }
.nav a { color: var(--muted); padding: 4px 2px; }
.nav a:hover, .nav a.active { color: var(--text); text-decoration: none; }
.nav a.active { border-bottom: 2px solid var(--primary); }
.user-box { display: flex; align-items: center; gap: 10px; }
.user-name { color: var(--muted); }

/* Layout — largura total do monitor, com margem lateral pequena (--side). */
.container { width: 100%; max-width: none; margin: 0; padding: 24px var(--side) 60px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
h1 { font-size: 1.5rem; margin: 0; }
h2 { font-size: 1.15rem; margin: 22px 0 12px; }
.muted { color: var(--muted); }
.footer { text-align: center; color: var(--muted); padding: 24px var(--side); font-size: .85rem; }

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 18px;
}
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .cols { grid-template-columns: 1fr; } }

/* Forms */
label { display: block; margin: 12px 0 6px; font-weight: 600; font-size: .92rem; }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); border-color: var(--primary); }
input[type="checkbox"], input[type="radio"] { width: auto; }
textarea { resize: vertical; }
.form-actions { margin-top: 16px; display: flex; gap: 10px; }
.inline { display: inline; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; }
/* Campo de duração: horas + minutos lado a lado. */
.hm-input { display: flex; align-items: center; gap: 8px; }
.hm-input input { width: 5rem; }
.hm-input span { color: var(--muted, #6b7280); font-weight: 600; }

/* Imagem/gif do Gyazo embutida na descrição (estilo Discord). */
.gyazo-embed { display: block; max-width: 100%; max-height: 400px; height: auto; border-radius: 8px; margin: 8px 0; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-elev);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}
.btn:hover { background: #20243c; text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #0b0e1a; font-weight: 600; }
.btn-primary:hover { background: var(--primary-d); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: rgba(255,93,108,.12); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 5px 10px; font-size: .85rem; }
.btn-link { color: var(--primary); }
.full { width: 100%; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; background: var(--card); }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; }
.table tr:last-child td { border-bottom: none; }
.table .actions { display: flex; gap: 6px; white-space: nowrap; }
.row-cancelled { opacity: .6; }
.row-inactive { opacity: .55; }
.audit code { font-size: .85rem; }
.audit .details { max-width: 280px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: .82rem; }

/* Badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 600; background: var(--line); color: var(--text); }
.role-admin { background: rgba(255,93,108,.2); color: #ff9aa4; }
.role-supervisor { background: rgba(245,185,85,.2); color: var(--warn); }
.role-employee { background: rgba(108,140,255,.2); color: #a9bcff; }
.status-active { background: rgba(54,201,143,.2); color: var(--ok); }
.status-cancelled { background: rgba(255,93,108,.2); color: #ff9aa4; }
.status-approved { background: rgba(108,140,255,.22); color: #a9bcff; }
.kind-png { background: rgba(108,140,255,.2); color: #a9bcff; }
.kind-aseprite { background: rgba(245,185,85,.2); color: var(--warn); }

/* Flash */
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; }
.flash-ok { background: rgba(54,201,143,.14); border: 1px solid var(--ok); color: #b6f0d8; }
.flash-err { background: rgba(255,93,108,.14); border: 1px solid var(--danger); color: #ffc6cc; }

/* Auth */
.auth-wrap { min-height: 60vh; display: flex; align-items: center; justify-content: center; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { margin-bottom: 4px; }
.hint { font-size: .85rem; margin: 6px 0 0; }
.link-box { border-color: var(--ok); }
.link-box input { font-family: ui-monospace, monospace; margin-top: 8px; }

/* Submission detail */
.desc { white-space: pre-wrap; margin: 0; }
.version-head { display: flex; align-items: center; gap: 10px; }
.note { margin: 8px 0 0; }
.files { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; }
.file { width: 160px; }
.thumb {
  width: 160px; height: 160px; object-fit: contain;
  background: #0b0e1a repeating-conic-gradient(#13162a 0% 25%, transparent 0% 50%) 50% / 20px 20px;
  border: 1px solid var(--line); border-radius: 8px; image-rendering: pixelated;
}
.thumb-file { display: flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 600; }

/* Zona de arrastar-e-soltar arquivos. */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; text-align: center; cursor: pointer;
  min-height: 200px;
  border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 36px 24px; margin-top: 4px; color: var(--muted); background: var(--bg-elev);
  transition: border-color .15s, background .15s, color .15s;
}
.dropzone:hover { border-color: var(--primary); color: var(--text); }
.dropzone.dragover { border-color: var(--primary); background: rgba(108,140,255,.12); color: var(--text); }
.dropzone > * { pointer-events: none; }
.dropzone-icon { font-size: 2.6rem; line-height: 1; }
.dropzone-text { font-size: .95rem; }
.dropzone-input { display: none; }

/* Prévia de arquivos selecionados no formulário (antes de enviar). */
.file-preview { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.preview-item { width: 160px; position: relative; }
.preview-name { display: block; font-size: .8rem; margin-top: 6px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-remove {
  position: absolute; top: 4px; right: 4px; width: 26px; height: 26px;
  border: 1px solid var(--line); border-radius: 50%; background: rgba(11,14,26,.85);
  color: var(--text); font-size: 17px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.preview-remove:hover { background: var(--danger); border-color: var(--danger); color: #0b0e1a; }
.file-meta { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; font-size: .85rem; }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Comments */
.comments { list-style: none; padding: 0; margin: 0 0 16px; }
.comments li { border-bottom: 1px solid var(--line); padding: 12px 0; }
.comment-head { display: flex; align-items: center; gap: 8px; }
.comment-body { margin: 6px 0 0; white-space: pre-wrap; }

/* Misc */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--bg-elev); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: .85rem; }
.filters { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.filters > div { display: flex; flex-direction: column; }
.filters select { width: auto; min-width: 180px; }
.filter-actions { display: flex; gap: 8px; }
.assign-list { list-style: none; padding: 0; margin: 0; }
.assign-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.empty { text-align: center; padding: 40px 20px; }
.pager { display: flex; gap: 14px; align-items: center; justify-content: center; margin-top: 18px; }
.message { text-align: center; max-width: 520px; margin: 40px auto; }
.message-err h1 { color: var(--danger); }
.col-check { width: 36px; text-align: center; }
.bulk-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.list-toolbar { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.desc-cell { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.presets { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: -6px 0 16px; }
.summary { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.summary-total { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.size-form { display: inline-flex; align-items: center; gap: 8px; }
.size-form label { margin: 0; font-weight: 400; color: var(--muted); }
.size-form select { width: auto; padding: 6px 10px; }
.filters .grow { flex: 1 1 240px; }
.filters input[type="search"], .filters input[type="date"] { width: 100%; }
