@import url('painel-mobile.css');

:root {
  --bg: #f3f4f6;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #16a34a;
  --accent-soft: #dcfce7;
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.07);
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
a { color: #1d4ed8; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(255,255,255,0.8) inset;
}
.brand {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  color: #111827;
  white-space: nowrap;
}
.brand span { color: var(--accent); }
.brand a { color: inherit; text-decoration: none; }
.brand a:hover { text-decoration: none; opacity: 0.9; }
.search-mock {
  flex: 1;
  max-width: 420px;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.search-mock input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font: inherit;
  font-size: 0.88rem;
}
.search-mock button {
  border: none;
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-weight: 700;
  font-size: 0.82rem;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
.user-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #374151;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(145deg, #e5e7eb, #d1d5db);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 64px);
  max-width: 1400px;
  margin: 0 auto;
}
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--border); }
  .search-mock { display: none; }
}

.sidebar {
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 1.25rem 1rem 2rem;
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.04);
}
.welcome-card {
  position: relative;
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 0.9rem;
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.welcome-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 28px; height: 36px;
  background: var(--accent-soft);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 20% 85%, 0 60%);
}
.welcome-card h1 {
  margin: 0 0 0.2rem;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.welcome-card p {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #111827;
}
.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-list li a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  color: #374151;
  font-weight: 600;
  font-size: 0.88rem;
}
.nav-list li a:hover { background: #f3f4f6; text-decoration: none; }
.nav-list li.is-active a {
  background: #eff6ff;
  color: #1d4ed8;
}
.nav-ico {
  width: 1.1rem;
  text-align: center;
  opacity: 0.85;
}

.main {
  padding: 1.5rem 1.5rem 2.5rem;
}
.main h2 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #111827;
}

.page-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.2rem;
  margin-bottom: 1rem;
  max-width: 720px;
}
.page-card h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 800;
  color: #111827;
}
.data-dl {
  margin: 0;
  display: grid;
  gap: 0.5rem 1rem;
}
.data-dl dt {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.data-dl dd {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: #111827;
}

.grid-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 1rem;
}
@media (max-width: 720px) {
  .grid-stats { grid-template-columns: 1fr; }
  .stat-cell { border-right: none !important; border-bottom: 1px solid var(--border); }
  .stat-cell:last-child { border-bottom: none; }
}
.stat-cell {
  padding: 1rem 1.1rem;
  text-align: center;
  border-right: 1px solid var(--border);
}
.stat-cell:last-child { border-right: none; }
.stat-cell .label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.stat-cell .num {
  font-size: 1.65rem;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.03em;
}
.stat-cell .sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.section-title {
  margin: 1.5rem 0 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
  font-size: 1.05rem;
  font-weight: 800;
  color: #111827;
}

.order-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 0.85rem 1rem;
}
@media (max-width: 600px) {
  .order-card { grid-template-columns: 1fr; text-align: left; }
}
.order-bar {
  width: 5px;
  align-self: stretch;
  border-radius: 4px;
  background: var(--accent);
  min-height: 3rem;
}
.order-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: #111827;
}
.order-meta {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.15rem;
}
.order-status {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1d4ed8;
  text-align: right;
  padding-left: 0.5rem;
  border-left: 1px solid var(--border);
}
@media (max-width: 600px) {
  .order-status { border-left: none; padding-left: 0; text-align: left; }
}

.timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 560px;
}
.timeline-list li {
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.4rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fafafa;
  font-size: 0.9rem;
  font-weight: 600;
}
.timeline-list li.is-done { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.timeline-list li.is-current { background: #eff6ff; border-color: #93c5fd; color: #1e40af; }
.timeline-list li.is-pend { color: var(--muted); }

.hint-banner {
  margin-top: 2rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  background: #fffbeb;
  border: 1px solid #fde68a;
  font-size: 0.82rem;
  color: #92400e;
  line-height: 1.45;
}
.actions-row {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.1rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.88rem;
  border: 1px solid var(--border);
  background: var(--card);
  color: #374151;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: #f9fafb; }
.btn--primary {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}
.btn--primary:hover { background: #1e40af; text-decoration: none; }

.muted { color: var(--muted); font-size: 0.88rem; line-height: 1.5; }

.pc-resumo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem 1.25rem;
}
@media (max-width: 640px) {
  .pc-resumo-grid { grid-template-columns: 1fr; }
}
.pc-resumo-grid > div {
  min-width: 0;
}

.pc-inline-line {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.55;
  color: #111827;
  font-weight: 600;
  word-break: break-word;
}

.pc-timeline-h {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  overflow-y: visible;
  padding: 0.35rem 0 0.5rem;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
.pc-timeline-step {
  flex: 0 0 auto;
  scroll-snap-align: start;
  min-width: 4.75rem;
  max-width: 6.5rem;
  text-align: center;
  padding: 0 0.15rem;
}
.pc-tl-ico {
  width: 2.5rem;
  height: 2.5rem;
  margin: 0 auto 0.4rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  background: #f1f5f9;
  border: 1px solid var(--border);
}
.pc-tl-ico svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}
.pc-tl-label {
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--muted);
  hyphens: auto;
}
.pc-timeline-step.is-done .pc-tl-ico {
  color: #047857;
  background: #ecfdf5;
  border-color: #a7f3d0;
}
.pc-timeline-step.is-done .pc-tl-label {
  color: #065f46;
}
.pc-timeline-step.is-current .pc-tl-ico {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #93c5fd;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}
.pc-timeline-step.is-current .pc-tl-label {
  color: #1e40af;
}
.pc-timeline-connector {
  flex: 1 0 1rem;
  min-width: 0.75rem;
  max-width: 2rem;
  align-self: center;
  height: 3px;
  margin: 0 0.1rem;
  border-radius: 2px;
  background: #e5e7eb;
}
.pc-timeline-connector.is-done {
  background: linear-gradient(90deg, #34d399, #6ee7b7);
}

.adm-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.15fr) minmax(320px, 1fr);
  gap: 1rem;
}
@media (max-width: 1100px) {
  .adm-grid { grid-template-columns: 1fr; }
}
.adm-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}
@media (max-width: 900px) {
  .adm-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .adm-filters { grid-template-columns: 1fr; }
}
.adm-filter label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.32rem;
}
.adm-filter input,
.adm-filter select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  font: inherit;
  font-size: 0.86rem;
  background: #fff;
}
.adm-kpis {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}
@media (max-width: 760px) {
  .adm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.adm-kpi {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.62rem;
  background: #f8fafc;
}
.adm-kpi .k { margin: 0; font-size: 0.7rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.adm-kpi .v { margin: 0.15rem 0 0; font-size: 1.22rem; font-weight: 900; color: #111827; }
.adm-list {
  margin-top: 0.85rem;
  display: grid;
  gap: 0.6rem;
  max-height: 58vh;
  overflow: auto;
  padding-right: 0.2rem;
}
.adm-item {
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #fff;
  padding: 0.72rem 0.75rem;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.adm-item:hover { border-color: #93c5fd; box-shadow: 0 6px 18px rgba(59, 130, 246, 0.15); }
.adm-item.is-selected { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,0.2); }
.adm-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}
.adm-item-id { margin: 0; font-weight: 900; color: #0f172a; font-size: 0.87rem; }
.adm-item-meta { margin: 0.26rem 0 0; color: var(--muted); font-size: 0.81rem; }
.adm-badges { display: inline-flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.4rem; }
.adm-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.adm-badge--ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.adm-badge--warn { background: #fff7ed; color: #c2410c; border: 1px solid #fdba74; }
.adm-badge--danger { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.adm-alert-list { margin: 0.45rem 0 0; padding-left: 1rem; color: #b45309; font-size: 0.76rem; line-height: 1.35; }
.adm-detail {
  position: sticky;
  top: 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  padding: 1rem;
}
.adm-detail h3 { margin: 0 0 0.55rem; font-size: 1.02rem; }
.adm-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 0.8rem;
}
@media (max-width: 620px) {
  .adm-detail-grid { grid-template-columns: 1fr; }
}
.adm-detail-grid dt { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 0; }
.adm-detail-grid dd { margin: 0.12rem 0 0; font-size: 0.87rem; font-weight: 600; color: #111827; }
.adm-detail-actions { margin-top: 0.9rem; display: flex; gap: 0.55rem; flex-wrap: wrap; }
.adm-empty { color: var(--muted); font-size: 0.88rem; margin: 0.5rem 0; }

.pc-table-wrap { overflow-x: auto; margin-top: 0.65rem; }
.pc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}
.pc-table th,
.pc-table td {
  border: 1px solid var(--border);
  padding: 0.45rem 0.55rem;
  text-align: left;
  vertical-align: top;
}
.pc-table th {
  background: #f9fafb;
  font-weight: 800;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.pc-table tr:hover td { background: #fafafa; }
.pc-table a { font-weight: 700; }
.status-pill {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  border: 1px solid transparent;
}
.status-pill--st-pedido_criado { background: #3B82F6; }
.status-pill--st-pagamento_processando { background: #2563EB; }
.status-pill--st-pagamento_aprovado { background: #22C55E; }
.status-pill--st-arquivos_enviados { background: #14B8A6; }
.status-pill--st-aguardando_analise { background: #FACC15; color: #1f2937; }
.status-pill--st-pre_impressao { background: #EAB308; color: #1f2937; }
.status-pill--st-refile { background: #F97316; }
.status-pill--st-embalagem { background: #8B5CF6; }
.status-pill--st-aguardando_despacho { background: #6D28D9; }
.status-pill--st-em_transito { background: #1D4ED8; }
.status-pill--st-entregue { background: #16A34A; }
.status-pill--st-entregue_com_ocorrencia { background: #F59E0B; color: #1f2937; }
.status-pill--st-cancelado { background: #EF4444; }
.pc-muted { color: var(--muted); font-size: 0.82rem; }
.pc-stack { display: flex; flex-direction: column; gap: 0.5rem; }
.pc-file-row { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; }

/* Bloqueio até sessão cliente (token) válida */
body.pl-auth-locked .topbar,
body.pl-auth-locked .shell {
  display: none !important;
}
#pl-auth-gate {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(15, 23, 42, 0.55);
}
.pl-auth-gate__card {
  width: min(460px, 100%);
  background: #fff;
  border-radius: 16px;
  padding: 1.15rem 1.15rem 1.05rem;
  box-shadow: 0 24px 70px rgba(2, 6, 23, 0.28);
  border: 1px solid #e2e8f0;
}
.pl-auth-gate__brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}
.pl-auth-gate__brand-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  color: #fff;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
}
.pl-auth-gate__brand strong {
  display: block;
  line-height: 1.1;
  color: #0f172a;
  font-size: 0.92rem;
}
.pl-auth-gate__brand span {
  display: block;
  line-height: 1.2;
  color: #64748b;
  font-size: 0.75rem;
}
.pl-auth-gate__title {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
}
.pl-auth-gate__lead {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}
.pl-auth-gate__grid {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.pl-auth-gate__field span {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.pl-auth-gate__field input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  font: inherit;
}
.pl-auth-gate__inline {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.35rem 0 0.1rem;
}
.pl-auth-gate__inline label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.84rem;
  color: #334155;
}
.pl-auth-gate__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}
.pl-auth-gate__actions .btn {
  width: 100%;
  min-height: 2.45rem;
  font-size: 0.92rem;
}
.pl-auth-gate__links {
  margin-top: 0.6rem;
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.7rem;
}
.pl-auth-gate__links button {
  border: 0;
  background: transparent;
  color: #1d4ed8;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0;
}
.pl-auth-gate__links button:hover {
  text-decoration: underline;
}
.pl-auth-dialog[hidden] { display: none !important; }
.pl-auth-dialog {
  position: fixed;
  inset: 0;
  z-index: 2147483001;
}
.pl-auth-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
}
.pl-auth-dialog__card {
  position: relative;
  width: min(520px, calc(100% - 1.5rem));
  max-height: min(86vh, 760px);
  overflow: auto;
  margin: 6vh auto 0;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  padding: 0.95rem 1rem 1rem;
  box-shadow: 0 26px 70px rgba(2, 6, 23, 0.32);
}
.pl-auth-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.pl-auth-dialog__head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
}
.pl-auth-gate__msg {
  margin: 0.65rem 0 0;
  font-size: 0.84rem;
  color: #b45309;
  min-height: 1.2em;
}
