:root {
  --font-sans: Inter, Arial, sans-serif;
  --font-serif: "Playfair Display", Georgia, serif;
  --bg: #f6f7f8;
  --surface: #ffffff;
  --surface-2: #eef2f4;
  --text: #111827;
  --muted: #64748b;
  --border: #dbe3ea;
  --primary: #075985;
  --primary-strong: #0c4a6e;
  --primary-contrast: #ffffff;
  --accent: #f2b705;
  --accent-contrast: #111827;
  --danger: #b42318;
  --danger-bg: #fff1f0;
  --ok: #13795b;
  --ok-bg: #ecfdf3;
  --warning: #a15c07;
  --warning-bg: #fff8e6;
  --radius: 8px;
  --shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  letter-spacing: 0;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
}

img,
iframe {
  max-width: 100%;
}

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

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: 2rem;
  line-height: 1.15;
  margin-bottom: 0.45rem;
}

h2 {
  font-size: 1.15rem;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1rem;
  line-height: 1.3;
  margin-bottom: 0.2rem;
}

button,
input,
select,
textarea {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 0.78rem 0.85rem;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
}

textarea {
  resize: vertical;
}

label span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

code {
  background: var(--surface-2);
  border-radius: 5px;
  padding: 0.12rem 0.28rem;
}

.button {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 42px;
  padding: 0.68rem 1rem;
  text-decoration: none;
  white-space: nowrap;
}

.button:hover {
  text-decoration: none;
  border-color: var(--primary);
}

.button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-contrast);
}

.button.ghost {
  background: transparent;
}

.button.small {
  min-height: 34px;
  padding: 0.45rem 0.7rem;
  font-size: 0.9rem;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.muted {
  color: var(--muted);
}

.eyebrow {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 900;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

.flash {
  border-radius: var(--radius);
  left: 50%;
  max-width: min(680px, calc(100vw - 2rem));
  padding: 0.8rem 1rem;
  position: fixed;
  top: 1rem;
  transform: translateX(-50%);
  width: max-content;
  z-index: 30;
  box-shadow: var(--shadow);
}

.flash-ok {
  background: var(--ok-bg);
  border: 1px solid #b7e3ce;
  color: var(--ok);
}

.flash-erro {
  background: var(--danger-bg);
  border: 1px solid #f3b9b4;
  color: var(--danger);
}

.notice {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.notice.danger {
  background: var(--danger-bg);
  border-color: #f3b9b4;
  color: var(--danger);
}

.login-shell,
.pin-shell {
  display: grid;
  min-height: 100vh;
  padding: 1.25rem;
  place-items: center;
}

.login-panel,
.pin-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 460px;
  padding: 1.5rem;
  width: 100%;
}

.brand-lockup,
.client-brand {
  align-items: center;
  display: flex;
  gap: 0.85rem;
}

.brand-lockup {
  color: var(--text);
  font-weight: 900;
  margin-bottom: 1.5rem;
}

.brand-lockup.compact {
  margin-bottom: 0;
}

.brand-logo {
  border-radius: 6px;
  height: 44px;
  object-fit: contain;
  width: auto;
}

.client-logo {
  border-radius: 8px;
  height: 56px;
  object-fit: contain;
  width: 56px;
}

.stack {
  display: grid;
  gap: 0.95rem;
}

.compact-stack {
  gap: 0.55rem;
  margin-top: 0.7rem;
}

.form-row {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: 1fr 1fr;
}

.topbar,
.client-header {
  align-items: center;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.85rem max(1rem, calc((100vw - 1180px) / 2));
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-actions {
  display: flex;
  gap: 0.55rem;
}

.app-shell,
.client-shell {
  margin: 0 auto;
  max-width: 1180px;
  padding: 1.25rem;
}

.page-heading {
  align-items: end;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin: 1rem 0 1.25rem;
}

.metric-strip,
.round-status {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  gap: 1rem;
  padding: 0.85rem 1rem;
}

.metric-strip div,
.round-status {
  min-width: 92px;
}

.metric-strip strong,
.round-status strong {
  display: block;
  font-size: 1.35rem;
}

.metric-strip span,
.round-status span {
  color: var(--muted);
  font-size: 0.82rem;
}

.split-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  margin-bottom: 1rem;
  padding: 1.1rem;
}

.section-title,
.copy-row,
.save-bar,
.client-actions,
.finish-bar {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.inline-form,
.copy-row form,
.client-actions form,
.finish-bar form {
  margin: 0;
}

.copy-row {
  align-items: stretch;
}

.copy-row input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.progress {
  appearance: none;
  background: var(--surface-2);
  border: 0;
  border-radius: 999px;
  height: 10px;
  margin-top: 0.8rem;
  overflow: hidden;
  width: 100%;
}

.progress::-webkit-progress-bar {
  background: var(--surface-2);
  border-radius: 999px;
}

.progress::-webkit-progress-value {
  background: var(--accent);
  border-radius: 999px;
}

.progress::-moz-progress-bar {
  background: var(--accent);
  border-radius: 999px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 760px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 0.8rem 0.6rem;
  text-align: left;
  vertical-align: middle;
}

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

td small {
  color: var(--muted);
  display: block;
  margin-top: 0.18rem;
}

.status {
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 0.28rem 0.55rem;
}

.status-rascunho,
.status-pendente {
  background: var(--surface-2);
  color: var(--muted);
}

.status-enviada {
  background: #e0f2fe;
  color: #075985;
}

.status-em-revisao,
.status-ajustes {
  background: var(--warning-bg);
  color: var(--warning);
}

.status-aprovada {
  background: var(--ok-bg);
  color: var(--ok);
}

.upload-box {
  align-items: center;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
}

.art-list {
  display: grid;
  gap: 0.9rem;
}

.art-admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: grid;
  gap: 0.85rem;
  grid-template-columns: 24px 168px 1fr;
  padding: 0.8rem;
}

.art-admin-card.dragging {
  opacity: 0.45;
}

.drag-handle {
  align-self: center;
  color: var(--muted);
  cursor: grab;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 900;
}

.thumb {
  align-items: center;
  background: var(--surface-2);
  border-radius: var(--radius);
  display: flex;
  height: 126px;
  justify-content: center;
  overflow: hidden;
}

.thumb img {
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.art-title-row {
  align-items: start;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.feedback-list {
  background: var(--surface-2);
  border-radius: var(--radius);
  display: grid;
  gap: 0.45rem;
  margin: 0.75rem 0;
  padding: 0.75rem;
}

.feedback-list p {
  margin: 0;
}

.campaign-concept {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--border));
  border-radius: var(--radius);
  color: var(--text);
  line-height: 1.65;
  padding: 1rem;
}

.campaign-concept h2 {
  margin-bottom: 0.45rem;
}

.campaign-concept p:last-child {
  margin-bottom: 0;
}

.client-concept {
  margin-bottom: 1rem;
}

.pin-concept {
  margin: 1rem 0;
  text-align: left;
}

.locked-note {
  background: var(--ok-bg);
  border: 1px solid #b7e3ce;
  border-radius: var(--radius);
  color: var(--ok);
  display: inline-flex;
  font-weight: 800;
  padding: 0.65rem 0.75rem;
}

.inline-details {
  border-top: 1px solid var(--border);
  margin-top: 0.7rem;
  padding-top: 0.7rem;
}

.inline-details summary,
.adjust-box summary {
  color: var(--primary);
  cursor: pointer;
  font-weight: 800;
}

.inline-upload {
  align-items: center;
  display: flex;
  gap: 0.6rem;
  margin-top: 0.7rem;
}

.save-bar {
  border-top: 1px solid var(--border);
  margin-top: 1rem;
  padding-top: 1rem;
}

.client-header {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.client-brand h1 {
  font-size: 1.35rem;
  margin-bottom: 0;
}

.client-progress {
  min-width: 210px;
}

.round-description {
  color: var(--muted);
  margin-bottom: 1rem;
}

.client-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.client-art-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.client-art-media {
  align-items: center;
  background: var(--surface-2);
  display: flex;
  height: 520px;
  justify-content: center;
}

.client-art-media img {
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.client-art-media iframe {
  border: 0;
  height: 100%;
  width: 100%;
}

.client-art-body {
  padding: 1rem;
}

.client-actions {
  align-items: start;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
  padding-top: 1rem;
}

.adjust-box {
  min-width: min(320px, 100%);
}

.finish-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  bottom: 1rem;
  box-shadow: var(--shadow);
  margin-top: 1rem;
  padding: 1rem;
  position: sticky;
}

.pin-panel {
  max-width: 560px;
}

.pin-panel .client-logo {
  height: 72px;
  width: 72px;
}

.pin-brand {
  align-items: center;
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.pin-brand h1 {
  margin-bottom: 0;
}

.pin-description {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
  margin-bottom: 1rem;
}

.pin-context {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 1rem 0;
}

.pin-context div {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
}

.pin-context span {
  color: var(--muted);
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

.pin-context strong {
  display: block;
  font-size: 1.1rem;
}

.pin-form {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: 1fr auto;
  margin-top: 1rem;
}

.pin-form input {
  font-size: 1.4rem;
  font-weight: 900;
  text-align: center;
}

.empty {
  color: var(--muted);
  margin-bottom: 0;
}

@media (max-width: 860px) {
  .topbar,
  .client-header,
  .page-heading,
  .section-title,
  .copy-row,
  .finish-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .split-grid,
  .client-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .metric-strip {
    width: 100%;
  }

  .art-admin-card {
    grid-template-columns: 20px 96px 1fr;
  }

  .thumb {
    height: 96px;
  }

  .client-art-media {
    height: 360px;
  }

  .client-actions,
  .upload-box,
  .inline-upload,
  .pin-form,
  .pin-brand {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .pin-context {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: 1.55rem;
  }

  .app-shell,
  .client-shell {
    padding: 0.85rem;
  }

  .panel {
    padding: 0.85rem;
  }

  .art-admin-card {
    grid-template-columns: 1fr;
  }

  .drag-handle {
    display: none;
  }

  .client-art-media {
    height: 280px;
  }
}
