/* ─── App pages shared styles ───────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #07070e;
  --bg-alt:   #0d0d1c;
  --primary:  #d4186b;
  --text:     #eeeef4;
  --muted:    #6e7a94;
  --border:   rgba(255,255,255,0.07);
  --card-bg:  rgba(255,255,255,0.03);
  --radius:   14px;
  --radius-sm: 8px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

img  { max-width: 100%; display: block; }
a    { color: inherit; text-decoration: none; }
strong { font-weight: 600; }

/* ─── Nav ───────────────────────────────────────────────────── */
.app-nav {
  background: rgba(7,7,14,0.95);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: inherit;
}

.app-brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
}

.app-brand strong { color: var(--primary); }

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

.nav-email {
  font-size: 0.78rem;
  color: var(--muted);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-logout {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
  font-family: inherit;
  padding: 0.35em 0.8em;
  border-radius: 6px;
  cursor: pointer;
  transition: all .2s;
}

.btn-logout:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }

/* ─── Main content ──────────────────────────────────────────── */
.app-main {
  flex: 1;
  padding: 2.5rem 1.5rem;
  max-width: 760px;
  margin-inline: auto;
  width: 100%;
}

.app-main-wide {
  max-width: 1100px;
}

/* ─── Typography ────────────────────────────────────────────── */
h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 0.5rem; }
h2 { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.015em; margin-bottom: 0.5rem; }
h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; }

.page-title { margin-bottom: 2rem; }
.page-title p { font-size: 0.95rem; color: var(--muted); margin-top: 0.3rem; }

/* ─── Card ──────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 1.25rem;
}

/* ─── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 0.03em;
  border-radius: 999px;
  cursor: pointer;
  transition: all .2s;
  border: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #e82077, #a855f7);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(212,24,107,0.3);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover { background: rgba(255,255,255,0.1); }
.btn-secondary.active {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
  opacity: 1 !important;
}

.btn-danger {
  background: rgba(239,68,68,0.15);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.25);
}

.btn-sm  { font-size: 0.82rem; padding: 0.45em 1.1em; }
.btn-md  { font-size: 0.9rem;  padding: 0.7em 1.5em; }
.btn-lg  { font-size: 0.95rem; padding: 0.85em 2rem; }
.btn-full{ width: 100%; display: flex; }

/* ─── Form ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
  color: #c0cbe0;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color .2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus { border-color: var(--primary); }

.form-select { cursor: pointer; }
.form-select option { background: #0d0d1c; }
.form-textarea { resize: vertical; min-height: 90px; }

/* ─── Upload area ───────────────────────────────────────────── */
.upload-area {
  border: 2px dashed rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  position: relative;
}

.upload-area:hover,
.upload-area.dragging {
  border-color: var(--primary);
  background: rgba(212,24,107,0.05);
}

.upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-icon { font-size: 2rem; margin-bottom: 0.6rem; }

.upload-text { font-size: 0.88rem; color: var(--muted); line-height: 1.6; }
.upload-text strong { color: var(--text); }

.upload-count {
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--primary);
  font-weight: 600;
}

/* ─── Preview grid ──────────────────────────────────────────── */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.6rem;
  margin-top: 1rem;
}

.preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.preview-item img { width: 100%; height: 100%; object-fit: cover; }

.preview-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  background: rgba(0,0,0,0.75);
  border: none;
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}

.preview-remove:hover { background: rgba(239,68,68,0.9); }

/* ─── Progress bar ──────────────────────────────────────────── */
.progress-wrap {
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
  margin: 1rem 0;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #a855f7);
  border-radius: 999px;
  transition: width .3s;
}

/* ─── Alerts ────────────────────────────────────────────────── */
.alert {
  padding: 1rem 1.25rem;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.alert-info    { background: rgba(37,99,235,0.1);  border: 1px solid rgba(37,99,235,0.2);  color: #93c5fd; }
.alert-success { background: rgba(34,197,94,0.1);  border: 1px solid rgba(34,197,94,0.2);  color: #86efac; }
.alert-warn    { background: rgba(234,179,8,0.1);  border: 1px solid rgba(234,179,8,0.2);  color: #fde047; }
.alert-error   { background: rgba(239,68,68,0.1);  border: 1px solid rgba(239,68,68,0.2);  color: #fca5a5; }

/* ─── Status badges ─────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3em 0.85em;
  border-radius: 999px;
}

.status-aguardando { background: rgba(234,179,8,0.15);  color: #fde047; border: 1px solid rgba(234,179,8,0.25); }
.status-enviado    { background: rgba(37,99,235,0.15);   color: #60a5fa; border: 1px solid rgba(37,99,235,0.25); }
.status-concluido  { background: rgba(34,197,94,0.15);   color: #4ade80; border: 1px solid rgba(34,197,94,0.25); }
.status-reembolsado{ background: rgba(239,68,68,0.15);   color: #f87171; border: 1px solid rgba(239,68,68,0.25); }

/* ─── Steps tracker ─────────────────────────────────────────── */
.tracker {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-bottom: 2.5rem;
}

.tracker-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.tracker-step:last-child { flex: none; }

.tracker-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  border: 2px solid rgba(255,255,255,0.1);
  color: var(--muted);
  position: relative;
  z-index: 1;
}

.tracker-dot.done    { background: #22c55e; border-color: #22c55e; color: #fff; }
.tracker-dot.active  { background: var(--primary); border-color: var(--primary); color: #fff; }

.tracker-label {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.4rem;
  text-align: center;
}

.tracker-label.active { color: var(--text); }

.tracker-line {
  flex: 1;
  height: 2px;
  background: rgba(255,255,255,0.08);
  margin-top: 17px;
}

.tracker-line.done { background: #22c55e; }

/* ─── Spinner ───────────────────────────────────────────────── */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .65s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

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

/* ─── Loading screen ────────────────────────────────────────── */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ─── Table (admin) ─────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }

.data-table tbody tr {
  cursor: pointer;
  transition: background .15s;
}

.data-table tbody tr:hover { background: rgba(255,255,255,0.03); }

/* ─── Divider ───────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 1.5rem 0;
}

/* ─── Thumbnails ────────────────────────────────────────────── */
.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.5rem;
}

.thumb-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: opacity .2s;
}

.thumb-grid img:hover { opacity: 0.8; }

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 600px) {
  .app-main { padding: 1.75rem 1rem; }
  .card { padding: 1.25rem; }
  .nav-email { display: none; }
}
