:root {
  --pastoral-primary: #556ee6;
  --pastoral-info: #50a5f1;
  --pastoral-success: #34c38f;
  --pastoral-warning: #f1b44c;
  --pastoral-dark: #2a3042;
  --pastoral-soft: #f8f8fb;
  --pastoral-border: #eff2f7;
}

body {
  letter-spacing: 0;
}

a {
  text-decoration: none;
}

.pastoral-logo-sm {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, var(--pastoral-primary), var(--pastoral-info));
  color: #fff;
  font-weight: 800;
}

.pastoral-logo-lg {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .02em;
}

.navbar-brand-box .logo {
  line-height: 70px;
}

.app-search input[readonly] {
  cursor: default;
}

.public-wrap {
  min-height: 100vh;
  padding: 32px clamp(16px, 4vw, 54px);
  background:
    radial-gradient(circle at 12% 10%, rgba(85, 110, 230, .12), transparent 26rem),
    radial-gradient(circle at 90% 0, rgba(80, 165, 241, .15), transparent 24rem),
    var(--pastoral-soft);
}

.public-header {
  max-width: 1120px;
  margin: 0 auto 28px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.public-main {
  max-width: 1120px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--pastoral-dark);
}

.brand:hover {
  color: var(--pastoral-primary);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, var(--pastoral-primary), var(--pastoral-info));
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(85, 110, 230, .25);
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: #74788d;
  font-size: 12px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.topbar h1,
.panel h1 {
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  margin: 0 0 8px;
  font-weight: 700;
}

.topbar p,
.panel p,
.card p {
  color: #74788d;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.panel {
  background: #fff;
  border: 1px solid var(--pastoral-border);
  border-radius: .25rem;
  box-shadow: 0 .75rem 1.5rem rgba(18, 38, 63, .03);
  padding: 24px;
  margin-bottom: 24px;
}

.card {
  border: 1px solid var(--pastoral-border);
  box-shadow: 0 .75rem 1.5rem rgba(18, 38, 63, .03);
  padding: 20px;
}

.metric {
  min-height: 132px;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.metric::after {
  content: "";
  position: absolute;
  right: -18px;
  bottom: -18px;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: rgba(85, 110, 230, .10);
}

.metric span {
  color: #74788d;
  font-weight: 600;
}

.metric b {
  display: block;
  color: var(--pastoral-primary);
  font-size: 2.25rem;
  line-height: 1;
  margin-top: 18px;
}

label {
  display: grid;
  gap: 7px;
  color: #495057;
  font-weight: 600;
}

input,
textarea,
select {
  display: block;
  width: 100%;
  padding: .47rem .75rem;
  font-size: .8125rem;
  font-weight: 400;
  line-height: 1.5;
  color: #495057;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #ced4da;
  border-radius: .25rem;
}

input[type="checkbox"] {
  width: auto;
  display: inline-block;
  margin-right: 7px;
}

textarea {
  min-height: 112px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  color: #495057;
  background-color: #fff;
  border-color: #b1bbc4;
  outline: 0;
  box-shadow: 0 0 0 .15rem rgba(85, 110, 230, .18);
}

.button,
form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: .25rem;
  padding: .47rem .85rem;
  background: var(--pastoral-primary);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(85, 110, 230, .22);
}

.button:hover,
form button:hover {
  color: #fff;
  background: #485ec4;
}

.button.secondary,
form button.secondary {
  background: #eff2f7;
  color: #495057;
  border-color: #eff2f7;
  box-shadow: none;
}

.button.secondary:hover,
form button.secondary:hover {
  background: #e1e6ef;
  color: #343a40;
}

.button.wine {
  background: var(--pastoral-info);
  box-shadow: 0 4px 10px rgba(80, 165, 241, .22);
}

.button.gold {
  background: var(--pastoral-warning);
  color: #2a250f;
  box-shadow: 0 4px 10px rgba(241, 180, 76, .22);
}

.button.danger {
  background: #f46a6a;
}

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

table {
  width: 100%;
  min-width: 760px;
  margin-bottom: 0;
  color: #495057;
  vertical-align: top;
  border-color: var(--pastoral-border);
}

th,
td {
  padding: .75rem;
  border-bottom: 1px solid var(--pastoral-border);
  vertical-align: top;
}

th {
  color: #495057;
  font-weight: 700;
  background: #f8f9fa;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: .25em .55em;
  border-radius: .25rem;
  background: rgba(85, 110, 230, .12);
  color: var(--pastoral-primary);
  font-size: 75%;
  font-weight: 700;
}

.notice {
  padding: .75rem 1rem;
  border-radius: .25rem;
  background: rgba(52, 195, 143, .12);
  border: 1px solid rgba(52, 195, 143, .28);
  color: #1f7558;
  margin-bottom: 16px;
}

.error {
  background: rgba(244, 106, 106, .12);
  border-color: rgba(244, 106, 106, .28);
  color: #a33f3f;
}

.login {
  max-width: 440px;
  margin: 10vh auto;
}

.product-cover {
  width: 76px;
  height: 96px;
  object-fit: cover;
  border-radius: .25rem;
  border: 1px solid var(--pastoral-border);
  background: #f8f9fa;
}

.badge-stage {
  position: relative;
  width: min(420px, 100%);
  aspect-ratio: 3 / 4;
  border: 1px solid var(--pastoral-border);
  border-radius: .25rem;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 .75rem 1.5rem rgba(18, 38, 63, .12);
}

.badge-stage img.base {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.badge-name {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 22%;
  background: rgba(255, 255, 255, .92);
  padding: 10px 12px;
  border-radius: .25rem;
  text-align: center;
  color: #2a3042;
  font-size: 1.4rem;
  font-weight: 700;
}

.badge-qr {
  position: absolute;
  right: 7%;
  bottom: 5%;
  width: 96px;
  height: 96px;
  background: #fff;
  padding: 6px;
  border-radius: .25rem;
  box-shadow: 0 6px 18px rgba(18, 38, 63, .18);
}

.badge-qr img {
  width: 100%;
  height: 100%;
  display: block;
}

.validation-ok {
  border-left: 4px solid var(--pastoral-success);
}

.tiny {
  font-size: .8125rem;
  color: #74788d;
}

@media print {
  body {
    background: #fff;
  }

  #page-topbar,
  .vertical-menu,
  .footer,
  .topbar,
  .no-print {
    display: none !important;
  }

  .main-content {
    margin-left: 0 !important;
  }

  .page-content {
    padding: 0 !important;
  }

  .badge-stage {
    box-shadow: none;
    width: 90mm;
  }
}

@media (max-width: 860px) {
  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4 {
    grid-template-columns: 1fr;
  }

  .topbar,
  .public-header {
    flex-direction: column;
    align-items: stretch;
  }
}
