:root {
  --bg-page: #f4f4f4;
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --line: #e6e6e6;
  --line-strong: #d0d0d0;
  --text: #111111;
  --muted: #6b6b6b;
  --accent: #e30613;
  --accent-dark: #b8000c;
  --danger: #e30613;
  --ok: #1a7f37;
  --warn: #c47a00;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.06);
  --radius: 2px;
  --font: "Manrope", "Helvetica Neue", Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* Logo — fundo claro para texto preto + pássaro vermelho */
.logo-wrap {
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.logo-wrap--auth {
  width: 100%;
  padding: 18px 20px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
}
.logo-wrap--header {
  padding: 8px 12px;
  border: 1px solid var(--line);
}
.logo-img {
  display: block;
  height: 36px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
}
.logo-wrap--auth .logo-img {
  height: 48px;
  max-width: 280px;
  margin: 0 auto;
}

.brand-tag {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
.brand-tag--sm {
  margin: 0;
  font-size: 0.68rem;
}

/* Auth */
.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f4f4f4 100%);
}
.auth-panel {
  width: min(420px, 100%);
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 36px 32px 28px;
  box-shadow: var(--shadow);
}
.auth-panel h1 {
  font-weight: 800;
  font-size: 1.75rem;
  letter-spacing: -0.02em;
  margin: 8px 0 6px;
  text-transform: uppercase;
}
.auth-sub, .hint {
  color: var(--muted);
  margin: 0 0 18px;
  line-height: 1.45;
  font-size: 0.95rem;
}
.hint.muted { font-size: 0.85rem; margin-top: 12px; margin-bottom: 0; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--text);
  border-radius: var(--radius);
  padding: 12px 12px;
  font: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--text);
}

.btn {
  border: 1px solid var(--text);
  background: var(--bg);
  color: var(--text);
  border-radius: var(--radius);
  padding: 11px 16px;
  font: inherit;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover {
  background: #111;
  color: #fff;
}
.btn.primary {
  background: #111;
  color: #fff;
  border-color: #111;
  width: 100%;
}
.btn.primary:hover {
  background: var(--accent);
  border-color: var(--accent);
}
.btn-row .btn.primary { width: auto; }
.btn.danger {
  background: #fff;
  border-color: var(--accent);
  color: var(--accent);
}
.btn.danger:hover {
  background: var(--accent);
  color: #fff;
}
.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text);
}
.btn.ghost:hover {
  background: #111;
  color: #fff;
  border-color: #111;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}
.link-btn {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 16px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-btn:hover { color: var(--accent); }
.error {
  color: var(--accent);
  min-height: 1.2em;
  font-size: 0.9rem;
  font-weight: 600;
}

/* App shell */
.app-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 18px 60px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 0 -18px 24px;
  padding: 14px 18px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.user-line {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 42vw;
}
.topbar-actions { display: flex; gap: 6px; flex-shrink: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.panel {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.panel-wide { grid-column: 1 / -1; }
.panel h2 {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 6px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.95rem;
}
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #bbb;
}
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.err { background: var(--accent); }

.qr-box {
  text-align: center;
  margin: 12px 0;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  color: #111;
}
.qr-box img { width: min(240px, 100%); height: auto; }

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
}
.card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: #eee;
}
.card-body { padding: 12px; display: grid; gap: 8px; }
.badge {
  display: inline-block;
  width: fit-content;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 8px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
}
.badge.posted {
  color: var(--ok);
  border-color: #1a7f37;
}
.badge.pending {
  color: var(--accent);
  border-color: var(--accent);
}
.card textarea {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  background: var(--bg-soft);
  color: var(--text);
  border-radius: var(--radius);
  padding: 8px;
  font: inherit;
}
.empty {
  color: var(--muted);
  text-align: center;
  padding: 36px 10px;
  border: 1px dashed var(--line-strong);
  margin-top: 8px;
}

.notif-panel {
  position: fixed;
  top: 72px;
  right: 18px;
  width: min(360px, calc(100vw - 24px));
  max-height: 60vh;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  z-index: 20;
  padding: 12px;
}
.notif-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.notif-head .link-btn { margin-top: 0; }
.notif-panel ul { list-style: none; margin: 0; padding: 0; }
.notif-panel li {
  padding: 10px 8px;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--muted);
}
.notif-panel li.unread { color: var(--text); font-weight: 600; }

@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr; }
  .panel-wide { grid-column: auto; }
  .logo-wrap--header .logo-img { height: 28px; }
  .user-line { max-width: 36vw; }
}
