/* ============================================================
   ProvaEntrega — Design System
   Mobile-first, 375px base, 768px desktop breakpoint
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

/* ── Custom Properties ─────────────────────────────────────── */
:root {
  --blue:       #1E3A5F;
  --blue-dark:  #152D4A;
  --blue-light: #EEF2F7;
  --blue-mid:   #B8CCDF;
  --dark:       #0D1B2A;
  --dark2:      #1C2B3A;
  --gray:       #5A6A7A;
  --gray-light: #8A9BAB;
  --surface:    #F4F6F8;
  --border:     #DDE3EA;
  --white:      #FFFFFF;
  --green:      #16A34A;
  --green-bg:   #F0FDF4;
  --red:        #DC2626;
  --red-bg:     #FEF2F2;
  --yellow:     #D97706;
  --yellow-bg:  #FFFBEB;
  --radius:     12px;
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  color: var(--dark);
  background: var(--surface);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img, video {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ── Screens ───────────────────────────────────────────────── */
.screen {
  display: none;
  flex-direction: column;
  min-height: 100vh;
}

.screen.active {
  display: flex;
}

/* ── Page Container ────────────────────────────────────────── */
.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ── Navigation Bar ────────────────────────────────────────── */
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 17px;
  font-weight: 700;
  color: var(--blue);
}

.nav-logo .logo-check {
  color: var(--green);
  font-size: 18px;
}

.nav-back {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray);
  cursor: pointer;
  min-height: 44px;
  padding: 0 4px;
}

.nav-back:hover {
  color: var(--blue);
}

.nav-step {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-light);
  text-align: right;
}

/* ── Page Header (public pages) ────────────────────────────── */
.page-header {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  padding: 16px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  white-space: nowrap;
}

.header-logo .logo-check {
  color: rgba(255,255,255,.7);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-meta {
  font-size: 12px;
  color: rgba(255,255,255,.65);
  white-space: nowrap;
}

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  padding: 28px 20px;
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(255,255,255,.07) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.3;
}

.hero-subtitle {
  font-size: 14px;
  color: rgba(255,255,255,.75);
  line-height: 1.5;
}

.hero-logo {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-logo .logo-check {
  color: rgba(255,255,255,.7);
}

.hero-tagline {
  font-size: 13px;
  color: rgba(255,255,255,.6);
  margin-bottom: 20px;
}

/* Conferente hero (dark bg) */
.conferente-hero {
  background: linear-gradient(135deg, var(--dark2) 0%, var(--dark) 100%);
  padding: 20px;
  border-radius: 16px;
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.conferente-hero-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.conferente-hero-text {
  flex: 1;
}

.conferente-hero-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
}

.conferente-hero-sub {
  font-size: 13px;
  color: rgba(255,255,255,.65);
  line-height: 1.5;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.card-title {
  background: var(--surface);
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--gray);
}

.card-body {
  padding: 20px;
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.meta-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.meta-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.meta-label {
  color: var(--gray);
  font-weight: 500;
  flex-shrink: 0;
}

.meta-value {
  color: var(--dark);
  font-weight: 600;
  text-align: right;
}

/* ── Info Rows ─────────────────────────────────────────────── */
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  color: var(--gray);
  font-weight: 500;
  font-size: 13px;
}

.info-value {
  color: var(--dark);
  font-weight: 600;
  font-size: 13px;
  text-align: right;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s, border-color .15s;
  min-height: 52px;
  border: none;
}

.btn:active {
  transform: scale(.98);
}

.btn-primary {
  background: var(--blue);
  color: var(--white);
}

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

.btn-secondary {
  background: var(--surface);
  color: var(--dark);
  border: 1.5px solid var(--border);
  padding: 14px;
}

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

.btn-danger {
  background: var(--red-bg);
  color: var(--red);
  border: 1.5px solid var(--red);
}

.btn-danger:hover {
  background: var(--red);
  color: var(--white);
}

.btn-whatsapp {
  background: #25D366;
  color: var(--white);
}

.btn-whatsapp:hover {
  background: #20BD5A;
}

.btn-pdf {
  background: var(--dark);
  color: var(--white);
  font-size: 14px;
}

.btn-pdf:hover {
  background: var(--dark2);
}

.btn-pdf-mobile {
  background: var(--dark);
  color: var(--white);
  font-size: 15px;
  border-radius: 0;
  min-height: 56px;
}

.btn-unlock {
  background: var(--blue);
  color: var(--white);
  padding: 14px;
}

.btn-unlock:hover {
  background: var(--blue-dark);
}

.btn-icon {
  width: auto;
  padding: 10px 14px;
  font-size: 13px;
  min-height: 44px;
}

/* ── Status Buttons (conferência) ──────────────────────────── */
.status-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.status-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  font-size: 11px;
  font-weight: 600;
  color: var(--gray);
  cursor: pointer;
  transition: all .15s;
  min-height: 60px;
}

.status-btn .status-icon {
  font-size: 18px;
}

.status-btn:hover {
  border-color: var(--blue-mid);
  background: var(--blue-light);
}

.status-btn.active-yellow {
  background: var(--yellow-bg);
  border-color: var(--yellow);
  color: var(--yellow);
}

.status-btn.active-red {
  background: var(--red-bg);
  border-color: var(--red);
  color: var(--red);
}

.status-btn.active-blue {
  background: var(--blue-light);
  border-color: var(--blue);
  color: var(--blue);
}

.status-btn.active-gray {
  background: var(--surface);
  border-color: var(--gray-light);
  color: var(--gray);
}

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}

.badge-ok {
  background: var(--green-bg);
  color: var(--green);
}

.badge-av {
  background: var(--yellow-bg);
  color: var(--yellow);
}

.badge-fa {
  background: var(--red-bg);
  color: var(--red);
}

.badge-er {
  background: var(--blue-light);
  color: var(--blue);
}

.badge-pe {
  background: var(--surface);
  color: var(--gray);
  border: 1px solid var(--border);
}

.badge-green {
  background: var(--green-bg);
  color: var(--green);
}

/* ── Chips ─────────────────────────────────────────────────── */
.id-chip {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .06em;
  background: rgba(255,255,255,.12);
  padding: 5px 12px;
  border-radius: 20px;
  color: rgba(255,255,255,.9);
  white-space: nowrap;
}

.id-chip-dark {
  background: var(--dark);
  color: var(--white);
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .06em;
  padding: 5px 12px;
  border-radius: 20px;
}

.format-chip {
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--gray);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

/* ── Summary Chips ─────────────────────────────────────────── */
.summary-chips {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.summary-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px;
  border-radius: 12px;
  text-align: center;
}

.summary-chip-ok {
  background: var(--green-bg);
  border: 1.5px solid #86EFAC;
}

.summary-chip-av {
  background: var(--yellow-bg);
  border: 1.5px solid #FDE68A;
}

.summary-chip-fa {
  background: var(--red-bg);
  border: 1.5px solid #FECACA;
}

.summary-chip-er {
  background: var(--blue-light);
  border: 1.5px solid var(--blue-mid);
}

.chip-number {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}

.chip-number-ok { color: var(--green); }
.chip-number-av { color: var(--yellow); }
.chip-number-fa { color: var(--red); }
.chip-number-er { color: var(--blue); }

.chip-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray);
}

@media (max-width: 480px) {
  .chip-number { font-size: 20px; }
  .summary-chip { padding: 12px 8px; }
}

/* ── Input Fields ──────────────────────────────────────────── */
.input-wrap {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  pointer-events: none;
}

.input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  color: var(--dark);
  background: var(--white);
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
  -webkit-appearance: none;
}

.input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(30,58,95,.1);
  background: var(--white);
}

.input::placeholder {
  color: var(--gray-light);
}

.input-with-icon {
  padding-left: 42px;
}

.textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  color: var(--dark);
  background: var(--white);
  outline: none;
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
}

.textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(30,58,95,.1);
}

.textarea::placeholder {
  color: var(--gray-light);
}

.input-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray);
  margin-bottom: 6px;
}

.input-hint {
  font-size: 12px;
  color: var(--gray-light);
  margin-top: 6px;
  line-height: 1.4;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

/* ── Upload Zone ───────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 40px 24px;
  background: var(--surface);
  text-align: center;
  cursor: pointer;
  transition: all .2s;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--blue);
  background: var(--blue-light);
}

.upload-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.upload-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 4px;
}

.upload-sub {
  font-size: 12px;
  color: var(--gray-light);
}

.upload-formats {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* ── Progress Bar ──────────────────────────────────────────── */
.progress-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.progress-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
}

.progress-count {
  font-size: 12px;
  font-weight: 700;
  background: var(--blue-light);
  color: var(--blue);
  padding: 3px 10px;
  border-radius: 20px;
}

.progress-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 2px;
  transition: width .4s ease;
  width: 0%;
}

/* ── Spinner / Processing ──────────────────────────────────── */
.spinner-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  flex: 1;
}

.spinner {
  width: 80px;
  height: 80px;
  border: 3px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  position: relative;
  margin-bottom: 24px;
}

.spinner-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
}

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

.proc-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 280px;
}

.proc-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--gray-light);
}

.proc-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  background: var(--border);
  color: var(--gray);
}

.proc-step.active {
  color: var(--blue);
}

.proc-step.active .proc-icon {
  background: var(--blue-light);
  color: var(--blue);
  animation: pulse 1s ease infinite;
}

.proc-step.done {
  color: var(--green);
}

.proc-step.done .proc-icon {
  background: var(--green-bg);
  color: var(--green);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .4; }
}

/* ── Item Cards (conferência) ──────────────────────────────── */
.item-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color .2s;
}

.item-card.is-ok {
  border-color: var(--green);
}

.item-card.has-problem {
  border-color: var(--yellow);
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 16px 12px;
  gap: 8px;
}

.item-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--dark);
  flex: 1;
}

.item-code {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--gray-light);
  margin-top: 2px;
}

.item-qty-info {
  font-size: 12px;
  color: var(--gray);
  font-weight: 500;
}

.item-body {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.item-expand {
  display: none;
  flex-direction: column;
  gap: 12px;
  animation: slideDown .2s ease;
}

.item-expand.open {
  display: flex;
}

.ok-photos {
  display: none;
}

.ok-photos.visible {
  display: block;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Photo Buttons & Thumbnails ────────────────────────────── */
.photo-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1.5px dashed var(--blue-mid);
  border-radius: 8px;
  background: var(--blue-light);
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  min-height: 44px;
}

.photo-btn:hover {
  border-color: var(--blue);
  background: var(--blue-light);
}

.photo-btn-green {
  border-color: #86EFAC;
  background: var(--green-bg);
  color: var(--green);
}

.photo-btn-green:hover {
  border-color: var(--green);
}

.photo-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}

.photo-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: var(--blue-light);
  border: 1.5px solid var(--blue-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

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

.photo-thumb-lg {
  width: 100px;
  height: 100px;
  border-radius: 10px;
  font-size: 32px;
}

.photo-thumb-ok {
  border-color: #86EFAC;
  background: var(--green-bg);
}

/* ── Occurrence Card (public pages) ────────────────────────── */
.ocorrencia-card {
  border: 1.5px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.ocorrencia-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 16px;
  background: var(--surface);
  gap: 8px;
  border-bottom: 1px solid var(--border);
}

.ocorrencia-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--dark);
}

.ocorrencia-qty {
  font-size: 12px;
  color: var(--gray);
  margin-top: 2px;
}

.ocorrencia-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ocorrencia-desc {
  background: var(--surface);
  border-left: 3px solid var(--yellow);
  border-radius: 0 10px 10px 0;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--dark);
  line-height: 1.5;
}

.ocorrencia-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Toast ─────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--dark);
  color: var(--white);
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s, transform .3s;
  z-index: 999;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Success State ─────────────────────────────────────────── */
.success-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 24px 32px;
  flex: 1;
}

.success-icon {
  width: 80px;
  height: 80px;
  background: var(--green-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin-bottom: 20px;
  animation: popIn .4s cubic-bezier(.34,1.56,.64,1);
}

@keyframes popIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.success-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 8px;
}

.success-sub {
  font-size: 14px;
  color: var(--gray);
  line-height: 1.6;
  max-width: 320px;
  margin-bottom: 28px;
}

.id-box {
  background: var(--dark);
  border-radius: 12px;
  padding: 16px 20px;
  width: 100%;
  max-width: 320px;
  margin-bottom: 24px;
  text-align: center;
}

.id-box-label {
  font-size: 11px;
  color: rgba(255,255,255,.5);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 6px;
}

.id-box-value {
  font-family: 'DM Mono', monospace;
  font-size: 22px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: .08em;
}

/* ── Share Box ─────────────────────────────────────────────── */
.share-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  width: 100%;
  max-width: 360px;
}

.share-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 8px;
}

.share-url {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--blue);
  word-break: break-all;
  margin-bottom: 12px;
  line-height: 1.5;
}

.share-actions {
  display: flex;
  gap: 8px;
}

.share-actions .btn {
  width: auto;
  flex: 1;
  font-size: 13px;
  padding: 10px 12px;
  min-height: 44px;
}

/* ── Link Card (sidebar) ───────────────────────────────────── */
.link-card {
  background: var(--green-bg);
  border: 1.5px solid #86EFAC;
  border-radius: 16px;
  padding: 18px;
}

.link-card-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 6px;
}

.link-card-url {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--green);
  word-break: break-all;
  margin-bottom: 12px;
  line-height: 1.5;
}

.link-card-actions {
  display: flex;
  gap: 8px;
}

.link-card-actions .btn {
  flex: 1;
  font-size: 13px;
  padding: 10px 12px;
  min-height: 44px;
  width: auto;
}

.btn-bordered-white {
  background: transparent;
  color: var(--green);
  border: 1.5px solid var(--green);
}

.btn-bordered-white:hover {
  background: var(--green);
  color: var(--white);
}

/* ── Unlock Card ───────────────────────────────────────────── */
.unlock-card {
  background: var(--dark2);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
}

.unlock-card-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.unlock-card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
}

.unlock-card-sub {
  font-size: 13px;
  color: rgba(255,255,255,.6);
  margin-bottom: 16px;
  line-height: 1.5;
}

.unlock-features {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
  text-align: left;
}

.unlock-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: rgba(255,255,255,.75);
}

.unlock-feature-icon {
  font-size: 16px;
  flex-shrink: 0;
}

/* ── Lock / Warning Boxes ──────────────────────────────────── */
.lock-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12px;
  color: var(--gray);
  line-height: 1.5;
}

.lock-box-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.warning-box {
  background: #FFF7ED;
  border: 1px solid #FED7AA;
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: #92400E;
  line-height: 1.5;
}

.warning-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.hint-box {
  background: var(--blue-light);
  border: 1px solid var(--blue-mid);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--blue);
  line-height: 1.5;
}

/* ── Banner ────────────────────────────────────────────────── */
.banner {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
}

.banner-success {
  background: var(--green-bg);
  border-bottom: 1px solid #86EFAC;
  color: var(--green);
}

/* ── Manual Item Row ───────────────────────────────────────── */
.manual-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  animation: slideDown .2s ease;
}

.manual-item-row:last-child {
  border-bottom: none;
}

.manual-item-info {
  flex: 1;
  min-width: 0;
}

.manual-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
}

.manual-item-code {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--gray-light);
  margin-top: 2px;
}

.manual-item-qty {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-light);
  padding: 2px 8px;
  border-radius: 20px;
  flex-shrink: 0;
}

.btn-remove {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--red-bg);
  color: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  min-height: 32px;
  cursor: pointer;
  transition: background .15s;
}

.btn-remove:hover {
  background: var(--red);
  color: var(--white);
}

/* ── Add Item Form ─────────────────────────────────────────── */
.add-item-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Section Title ─────────────────────────────────────────── */
.section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--gray);
  margin-bottom: 10px;
}

/* ── Divider ───────────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--gray-light);
  font-size: 13px;
  margin: 8px 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Optional Badge ────────────────────────────────────────── */
.optional-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  background: var(--surface);
  color: var(--gray-light);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 4px;
}

/* ── Optional Section ──────────────────────────────────────── */
.optional-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.optional-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.optional-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
}

/* ── Responsáveis (public pages) ───────────────────────────── */
.resp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.resp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}

.resp-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.resp-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 2px;
}

.resp-label {
  font-size: 11px;
  color: var(--gray-light);
  font-weight: 500;
}

.resp-detail {
  font-size: 12px;
  color: var(--gray);
  margin-top: 4px;
}

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

/* ── Info Grid ─────────────────────────────────────────────── */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.info-cell {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.info-cell:nth-child(even) {
  border-right: none;
}

.info-cell:nth-last-child(-n+2) {
  border-bottom: none;
}

.info-cell-label {
  font-size: 11px;
  color: var(--gray-light);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 3px;
}

.info-cell-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
}

@media (max-width: 480px) {
  .info-grid {
    grid-template-columns: 1fr;
  }
  .info-cell {
    border-right: none;
  }
  .info-cell:nth-last-child(-n+2) {
    border-bottom: 1px solid var(--border);
  }
  .info-cell:last-child {
    border-bottom: none;
  }
}

/* ── Review Item Row ───────────────────────────────────────── */
.review-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.review-item:last-child {
  border-bottom: none;
}

.review-item-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.review-item-info {
  flex: 1;
  min-width: 0;
}

.review-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
}

.review-item-qty {
  font-size: 12px;
  color: var(--gray);
  margin-top: 2px;
}

/* ── Layout (public pages) ─────────────────────────────────── */
.public-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

.public-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.public-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 80px;
}

@media (max-width: 768px) {
  .public-layout {
    grid-template-columns: 1fr;
  }

  .public-sidebar {
    position: static;
    order: -1;
  }
}

/* ── PDF Mobile Bar ────────────────────────────────────────── */
.pdf-bar-mobile {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 8px 16px;
  padding-bottom: env(safe-area-inset-bottom, 8px);
}

@media (max-width: 768px) {
  .pdf-bar-mobile {
    display: block;
  }

  .public-layout {
    padding-bottom: 80px;
  }
}

/* ── Content Spacing ───────────────────────────────────────── */
.content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.page-footer {
  padding: 16px 20px;
  background: var(--white);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Signature Canvas ──────────────────────────────────────── */
.signature-pad {
  width: 100%;
  height: 160px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  cursor: crosshair;
  touch-action: none;
  display: block;
}

.signature-pad:focus {
  outline: none;
  border-color: var(--blue);
}

/* ── Misc ──────────────────────────────────────────────────── */
.mono {
  font-family: 'DM Mono', monospace;
}

.text-gray {
  color: var(--gray);
}

.text-sm {
  font-size: 13px;
}

.text-xs {
  font-size: 12px;
}

.text-center {
  text-align: center;
}

.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
