:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #10b981;
  --accent: #f59e0b;
  --dark: #1e293b;
  --muted: #64748b;
  --line: #dbeafe;
  --soft: #f8fafc;
  --card: #ffffff;
  --danger: #ef4444;
  --shadow: 0 18px 45px rgba(37, 99, 235, 0.12);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--dark);
  background:
    radial-gradient(circle at 15% 5%, rgba(37, 99, 235, 0.09), transparent 34%),
    radial-gradient(circle at 90% 12%, rgba(16, 185, 129, 0.12), transparent 28%),
    linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  min-height: 100vh;
}

.entry-page {
  background: #f6f8fb;
}

.entry-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 48px;
}

.entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
}

.entry-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #0f172a;
  text-decoration: none;
}

.entry-brand img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.entry-brand strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
}

.entry-brand small {
  display: block;
  color: #64748b;
  font-size: 12px;
}

.entry-link {
  color: #475569;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}

.entry-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: 28px;
  align-items: center;
  min-height: 560px;
}

.entry-copy {
  max-width: 580px;
}

.entry-kicker,
.entry-card-label {
  margin: 0 0 10px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.entry-copy h1 {
  margin: 0;
  color: #0f172a;
  font-family: Inter, system-ui, sans-serif;
  font-size: clamp(38px, 7vw, 72px);
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.entry-copy p {
  max-width: 520px;
  color: #475569;
  font-size: 17px;
  line-height: 1.7;
}

.entry-cards {
  display: grid;
  gap: 14px;
}

.entry-card {
  display: grid;
  gap: 10px;
  padding: 22px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  color: #0f172a;
  text-decoration: none;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.entry-card:hover {
  transform: translateY(-3px);
  border-color: #bfdbfe;
  box-shadow: 0 24px 54px rgba(37, 99, 235, 0.12);
}

.entry-card.primary-card {
  border-color: rgba(37, 99, 235, 0.24);
}

.entry-card strong {
  font-size: 25px;
  font-weight: 800;
}

.entry-card p {
  margin: 0;
  color: #64748b;
  line-height: 1.6;
}

.entry-card-action {
  width: fit-content;
  margin-top: 4px;
  padding: 9px 13px;
  border-radius: 999px;
  color: #fff;
  background: #2563eb;
  font-size: 13px;
  font-weight: 800;
}

.entry-card:not(.primary-card) .entry-card-action {
  color: #2563eb;
  background: #eff6ff;
}

.entry-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding-top: 8px;
}

.entry-strip div {
  padding: 13px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  color: #334155;
  background: rgba(255, 255, 255, 0.7);
  font-weight: 700;
}

.entry-strip span {
  display: block;
  margin-bottom: 5px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 900;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.app-shell {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 56px;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(219, 234, 254, 0.9);
  border-radius: var(--radius);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-logo {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  font-family: Poppins, sans-serif;
  font-weight: 800;
}

.brand-logo-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
}

.brand strong,
h1,
h2,
h3,
h4 {
  font-family: Poppins, sans-serif;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.topnav,
.session-actions,
.hero-actions,
.stack-actions,
.form-actions,
.admin-tabs,
.segmented {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.topnav {
  justify-content: center;
}

.session-actions {
  justify-content: end;
}

.icon-action {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid #dbeafe;
  border-radius: 50%;
  color: var(--primary);
  background: #fff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.icon-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.16);
}

.nav-link,
.segment {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
}

.nav-link.active,
.segment.active {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.22);
  color: var(--primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.25);
}

.btn.secondary {
  color: #fff;
  background: linear-gradient(135deg, var(--secondary), #059669);
  box-shadow: 0 12px 24px rgba(16, 185, 129, 0.23);
}

.btn.ghost {
  color: var(--primary);
  background: #fff;
  border: 1px solid var(--line);
}

.btn.small {
  padding: 9px 12px;
  font-size: 13px;
}

.btn.full {
  width: 100%;
}

code {
  border-radius: 6px;
  padding: 2px 5px;
  background: #eff6ff;
  color: var(--primary-dark);
}

.view,
.auth-layout {
  margin-top: 26px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 24px;
  align-items: stretch;
  min-height: 430px;
}

.hero-copy,
.hero-panel,
.card,
.stat-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(219, 234, 254, 0.92);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: clamp(28px, 5vw, 58px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.04;
  letter-spacing: 0;
}

.lede,
.section-head p,
.form-status,
.empty-state {
  color: var(--muted);
}

.lede {
  font-size: 18px;
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
}

.hero-panel {
  padding: 22px;
  display: grid;
  gap: 16px;
  align-content: center;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.92), rgba(16, 185, 129, 0.86)),
    #2563eb;
  color: #fff;
}

.metric-card {
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: var(--radius);
  padding: 22px;
  background: rgba(255, 255, 255, 0.12);
}

.metric-card span {
  display: block;
  opacity: 0.78;
  margin-bottom: 8px;
}

.metric-card strong {
  display: block;
  font-size: 30px;
  line-height: 1.15;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mini-grid div {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 800;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(280px, 0.42fr);
  gap: 22px;
}

.client-login {
  min-height: calc(100vh - 130px);
  display: grid;
  place-items: center;
}

.client-login .auth-card {
  width: min(100%, 460px);
  padding: 28px;
}

.client-login .section-head h2 {
  font-size: 28px;
  line-height: 1.16;
}

.client-login .section-head p {
  line-height: 1.6;
}

.card,
.stat-card {
  padding: 22px;
}

.section-head {
  margin-bottom: 18px;
}

.section-head h2,
.section-head h3,
.section-head h4 {
  margin: 0;
  line-height: 1.14;
}

.section-head h2 {
  font-size: clamp(26px, 4vw, 38px);
}

.section-head.compact {
  margin-bottom: 14px;
}

.section-head.compact p:last-child {
  margin-bottom: 0;
}

.section-head.with-actions {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
}

.form-grid {
  display: grid;
  gap: 14px;
}

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

label {
  display: grid;
  gap: 7px;
  font-weight: 800;
  color: #334155;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 12px 13px;
  color: var(--dark);
  background: #fff;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.check-row {
  grid-template-columns: auto 1fr;
  align-items: center;
  justify-content: start;
  font-weight: 700;
}

.check-row input {
  width: auto;
}

.dynamic-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.wide-field,
.dynamic-fields label:has(textarea) {
  grid-column: 1 / -1;
}

.feature-list {
  display: grid;
  gap: 10px;
  padding-left: 20px;
  margin: 0;
  color: #334155;
  font-weight: 700;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-weight: 800;
  margin-bottom: 8px;
}

.stat-card strong {
  display: block;
  font-size: 24px;
}

.stat-card.danger-stat {
  border-color: rgba(239, 68, 68, 0.22);
  background: linear-gradient(135deg, #fff, #fef2f2);
}

.stat-card.danger-stat strong {
  color: var(--danger);
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.card.wide {
  grid-column: 1 / -1;
}

.preview-frame {
  min-height: 260px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed #bfdbfe;
  border-radius: var(--radius);
  text-decoration: none;
  background: #f8fafc;
  color: var(--muted);
  font-weight: 800;
}

.preview-frame img {
  display: none;
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
}

.preview-frame.has-image img {
  display: block;
}

.preview-frame.has-image span {
  display: none;
}

.list,
.answer-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  max-height: 420px;
  overflow: auto;
}

.list-item,
.answer-item,
.product-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 13px;
  background: #fff;
}

.list-item {
  display: grid;
  gap: 6px;
}

.list-item strong,
.answer-item strong {
  color: #0f172a;
}

.list-item small,
.answer-item small {
  color: var(--muted);
}

.selectable .list-item {
  cursor: pointer;
}

.selectable .list-item.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.product-card {
  position: relative;
  display: grid;
  gap: 10px;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 18px 38px rgba(37, 99, 235, 0.16);
}

.product-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
  background: #eff6ff;
}

.product-card .price {
  color: var(--secondary);
  font-family: Poppins, sans-serif;
  font-size: 22px;
  font-weight: 900;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.old-price {
  color: var(--muted);
  text-decoration: line-through;
  font-weight: 800;
}

.deal-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  border-radius: 999px;
  padding: 5px 9px;
  background: linear-gradient(135deg, var(--accent), #d97706);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 10px 18px rgba(245, 158, 11, 0.22);
}

.feature-cart {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #eff6ff, #f0fdf4);
  animation: cart-in 0.45s ease both;
}

.feature-cart.has-items {
  border-color: rgba(16, 185, 129, 0.48);
  box-shadow: 0 16px 36px rgba(16, 185, 129, 0.12);
}

.feature-cart span {
  display: block;
  color: var(--muted);
}

.cart-total {
  text-align: right;
}

.cart-total strong {
  display: block;
  font-family: Poppins, sans-serif;
  font-size: 24px;
  color: var(--secondary);
}

.invoice-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.invoice-summary div {
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #f8fafc;
}

.invoice-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.invoice-summary strong {
  display: block;
  margin-top: 3px;
  font-family: Poppins, sans-serif;
  font-size: 20px;
}

.invoice-summary .pending-box {
  border-color: rgba(239, 68, 68, 0.24);
  background: #fef2f2;
}

.invoice-summary .pending-box strong {
  color: var(--danger);
}

.compact-form {
  gap: 10px;
}

.compact-form label {
  font-size: 13px;
}

.compact-form input,
.compact-form select,
.compact-form textarea {
  padding: 9px 10px;
  border-radius: 10px;
}

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

.discount-popup {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
}

.discount-card {
  position: relative;
  width: min(430px, 100%);
  overflow: hidden;
  border: 1px solid rgba(251, 191, 36, 0.55);
  border-radius: 18px;
  padding: 28px;
  background:
    radial-gradient(circle at 50% 0%, rgba(251, 191, 36, 0.24), transparent 34%),
    linear-gradient(135deg, #ffffff, #f8fafc);
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.28);
  animation: discount-pop 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.discount-card h3 {
  margin: 6px 0 8px;
  font-size: 28px;
  line-height: 1.12;
}

.discount-card p:not(.eyebrow) {
  color: var(--muted);
}

.discount-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  font-weight: 900;
}

.discount-gift {
  position: relative;
  width: 94px;
  height: 78px;
  margin-bottom: 14px;
}

.gift-lid,
.gift-box,
.chest-lid,
.chest-body,
.chest-glow {
  position: absolute;
  display: block;
}

.gift-lid {
  top: 0;
  left: 10px;
  width: 74px;
  height: 24px;
  border-radius: 10px 10px 5px 5px;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  animation: lid-pop 1.35s ease-in-out infinite;
}

.gift-box {
  left: 16px;
  bottom: 0;
  width: 62px;
  height: 54px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  box-shadow: inset 24px 0 rgba(255, 255, 255, 0.18);
}

.discount-chest {
  position: fixed;
  top: 50%;
  right: 18px;
  z-index: 25;
  width: 82px;
  height: 74px;
  border: 0;
  background: transparent;
  transform: translateY(-50%);
  filter: drop-shadow(0 16px 20px rgba(15, 23, 42, 0.22));
  animation: chest-float 2.4s ease-in-out infinite;
}

.discount-chest.just-dropped {
  animation: chest-drop 0.8s cubic-bezier(0.18, 0.85, 0.28, 1.2), chest-float 2.4s ease-in-out 0.8s infinite;
}

.chest-lid {
  top: 8px;
  left: 12px;
  width: 58px;
  height: 22px;
  border-radius: 12px 12px 4px 4px;
  background: linear-gradient(135deg, #92400e, #f59e0b);
  transform-origin: left bottom;
  animation: chest-lid 1.8s ease-in-out infinite;
}

.chest-body {
  left: 9px;
  bottom: 10px;
  width: 64px;
  height: 40px;
  border-radius: 7px 7px 12px 12px;
  background: linear-gradient(135deg, #78350f, #d97706);
  box-shadow: inset 29px 0 rgba(251, 191, 36, 0.25);
}

.chest-glow {
  top: 16px;
  left: 26px;
  width: 30px;
  height: 20px;
  border-radius: 50%;
  background: rgba(251, 191, 36, 0.65);
  filter: blur(8px);
  animation: glow-pulse 1.5s ease-in-out infinite;
}

.discount-chest strong {
  position: absolute;
  left: 50%;
  bottom: -13px;
  transform: translateX(-50%);
  border-radius: 999px;
  padding: 2px 8px;
  background: #fff;
  color: var(--primary);
  font-size: 11px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.16);
}

.contact-float {
  position: fixed;
  right: 18px;
  top: 58%;
  z-index: 24;
  display: grid;
  gap: 10px;
  transform: translateY(-50%);
}

.contact-float-btn {
  display: grid;
  grid-template-columns: 42px 0fr;
  align-items: center;
  gap: 0;
  min-width: 42px;
  min-height: 42px;
  overflow: hidden;
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.22);
  transition: grid-template-columns 0.24s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-float-btn:hover {
  grid-template-columns: 42px 112px;
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.28);
}

.contact-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  font-size: 17px;
}

.contact-copy {
  display: grid;
  min-width: 0;
  padding: 0 13px 0 2px;
  white-space: nowrap;
}

.contact-copy small {
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  opacity: 0.8;
}

.contact-copy strong {
  font-size: 13px;
  line-height: 1.1;
}

.contact-float-btn.call {
  background: linear-gradient(135deg, var(--primary), #1d4ed8);
}

.contact-float-btn.whatsapp {
  background: linear-gradient(135deg, #10b981, #059669);
}

.review-float-btn {
  position: fixed;
  right: 20px;
  top: calc(58% - 132px);
  z-index: 26;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, var(--accent), #d97706);
  box-shadow: 0 12px 24px rgba(245, 158, 11, 0.24);
  font-size: 12px;
  font-weight: 900;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.review-float-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(245, 158, 11, 0.3);
}

.mobile-cart-bar {
  display: none;
}

.mobile-cart-summary {
  display: grid;
  gap: 1px;
  min-width: 0;
  border: 0;
  padding: 0;
  text-align: left;
  color: #0f172a;
  background: transparent;
}

.mobile-cart-summary small {
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
}

.mobile-cart-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.mobile-cart-summary strong {
  overflow: hidden;
  font-family: Poppins, sans-serif;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes discount-pop {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes lid-pop {
  0%, 100% {
    transform: rotate(0deg) translateY(0);
  }
  45% {
    transform: rotate(-8deg) translateY(-5px);
  }
}

@keyframes chest-float {
  0%, 100% {
    transform: translateY(-50%) translateX(0);
  }
  50% {
    transform: translateY(calc(-50% - 8px)) translateX(-2px);
  }
}

@keyframes chest-drop {
  from {
    transform: translateY(-90%) translateX(36px) scale(0.7);
    opacity: 0;
  }
  to {
    transform: translateY(-50%) translateX(0) scale(1);
    opacity: 1;
  }
}

@keyframes chest-lid {
  0%, 100% {
    transform: rotate(0deg);
  }
  45% {
    transform: rotate(-10deg);
  }
}

@keyframes glow-pulse {
  0%, 100% {
    opacity: 0.45;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.42fr) minmax(0, 1fr);
  gap: 20px;
}

.admin-grid.bottom {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 20px;
}

.admin-detail {
  min-height: 620px;
}

.admin-tabs {
  margin-bottom: 16px;
}

.split-lists {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.client-profile-panel {
  display: grid;
  gap: 14px;
  margin: 0 0 18px;
}

.profile-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 16px;
  border: 1px solid #dbeafe;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #eff6ff, #f8fafc);
}

.profile-hero h4 {
  margin: 0 0 6px;
  font-size: 22px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.profile-field {
  min-width: 0;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}

.profile-field span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 4px;
}

.profile-field strong {
  display: block;
  overflow-wrap: anywhere;
}

.profile-section {
  margin-top: 20px;
}

.pill-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 10px;
  background: #eff6ff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.danger {
  color: var(--danger);
}

.empty-state {
  padding: 18px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  text-align: center;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.58);
}

.modal-card {
  width: min(920px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
  border-radius: var(--radius);
  border: 1px solid #dbeafe;
  background: #fff;
  box-shadow: 0 25px 70px rgba(15, 23, 42, 0.28);
  padding: 20px;
}

.modal-head,
.modal-actions,
.invoice-sheet-head,
.invoice-line {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.invoice-sheet {
  display: grid;
  gap: 16px;
}

.invoice-sheet h2,
.modal-head h3 {
  margin: 0;
}

.invoice-line {
  border: 1px solid #dbeafe;
  border-radius: 12px;
  padding: 16px;
  background: #f8fafc;
}

.invoice-line small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.invoice-page {
  max-width: 920px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid #d8dee8;
  background: #fff;
  color: #111827;
  font-family: "IBM Plex Sans", Inter, "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.12);
}

.invoice-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  padding: 34px 40px 26px;
  color: #fff;
  background: linear-gradient(135deg, #0f3d91, #0b2f70);
}

.invoice-brand {
  display: grid;
  gap: 8px;
}

.invoice-brand small,
.invoice-meta-card span,
.invoice-block span,
.invoice-summary-cell span,
.invoice-footer span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.invoice-brand h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
}

.invoice-brand p {
  max-width: 420px;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
}

.invoice-badge {
  align-self: start;
  min-width: 158px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 4px;
  text-align: right;
  background: rgba(255, 255, 255, 0.08);
}

.invoice-badge span {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.invoice-badge strong {
  display: block;
  margin-top: 4px;
  font-size: 19px;
}

.invoice-section {
  padding: 28px 40px;
}

.invoice-meta-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 18px;
  margin-bottom: 24px;
}

.invoice-block,
.invoice-meta-card,
.invoice-summary-cell {
  border: 1px solid #e5e7eb;
  background: #fff;
}

.invoice-block {
  padding: 18px;
}

.invoice-block h2,
.invoice-block h3 {
  margin: 4px 0 6px;
  font-size: 18px;
  line-height: 1.2;
}

.invoice-block p {
  margin: 2px 0;
  color: #6b7280;
}

.invoice-meta-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.invoice-meta-card div {
  padding: 14px;
  border-right: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
}

.invoice-meta-card div:nth-child(2n) {
  border-right: 0;
}

.invoice-meta-card div:nth-last-child(-n+2) {
  border-bottom: 0;
}

.invoice-meta-card strong,
.invoice-summary-cell strong {
  display: block;
  margin-top: 3px;
  color: #111827;
  font-size: 13px;
}

.status-paid {
  color: #047857;
}

.status-pending {
  color: #b45309;
}

.invoice-table {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-collapse: collapse;
}

.invoice-table th {
  padding: 12px 14px;
  color: #374151;
  background: #f3f6fb;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-align: left;
  text-transform: uppercase;
}

.invoice-table td {
  padding: 16px 14px;
  border-top: 1px solid #e5e7eb;
  vertical-align: top;
}

.invoice-table .amount {
  text-align: right;
  white-space: nowrap;
  font-weight: 800;
}

.invoice-item-title {
  color: #111827;
  font-weight: 800;
}

.invoice-note {
  margin-top: 4px;
  color: #6b7280;
  font-size: 12px;
}

.invoice-total-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  margin-top: 24px;
}

.invoice-terms {
  padding: 16px;
  border-left: 3px solid #0f3d91;
  color: #374151;
  background: #f8fafc;
}

.invoice-terms strong {
  display: block;
  margin-bottom: 5px;
}

.invoice-summary {
  display: grid;
  border: 1px solid #e5e7eb;
}

.invoice-summary-cell {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid #e5e7eb;
}

.invoice-summary-cell.total {
  border-bottom: 0;
  color: #fff;
  background: #0f172a;
}

.invoice-summary-cell.total strong {
  color: #fff;
  font-size: 20px;
}

.invoice-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: end;
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid #e5e7eb;
  color: #6b7280;
}

.invoice-sign {
  min-width: 180px;
  color: #111827;
  text-align: center;
}

.invoice-sign strong {
  display: block;
  padding-top: 8px;
  border-top: 1px solid #9ca3af;
}

@media (max-width: 720px) {
  .invoice-page {
    border: 0;
    box-shadow: none;
  }

  .invoice-top,
  .invoice-section,
  .invoice-meta-grid,
  .invoice-total-row,
  .invoice-footer {
    grid-template-columns: 1fr;
  }

  .invoice-top,
  .invoice-section {
    padding: 22px;
  }

  .invoice-badge {
    text-align: left;
  }

  .invoice-meta-card {
    grid-template-columns: 1fr;
  }

  .invoice-meta-card div {
    border-right: 0;
  }

  .invoice-meta-card div:nth-last-child(2) {
    border-bottom: 1px solid #e5e7eb;
  }
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .entry-hero,
  .topbar,
  .hero,
  .auth-layout,
  .portal-grid,
  .admin-grid,
  .admin-grid.bottom,
  .split-lists {
    grid-template-columns: 1fr;
  }

  .topnav {
    justify-content: flex-start;
  }

  .dashboard-grid,
  .product-grid,
  .entry-strip,
  .profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .entry-shell {
    width: min(100% - 20px, 1120px);
    padding: 14px 0 32px;
  }

  .entry-header {
    padding: 4px 0 12px;
  }

  .entry-link {
    font-size: 12px;
  }

  .entry-hero {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 18px;
    padding-top: 24px;
  }

  .entry-copy h1 {
    font-size: 42px;
  }

  .entry-copy p {
    font-size: 15px;
  }

  .entry-card {
    padding: 17px;
    border-radius: 14px;
  }

  .entry-card strong {
    font-size: 21px;
  }

  .entry-strip {
    grid-template-columns: 1fr;
    margin-top: 18px;
  }

  .app-shell {
    width: min(100% - 16px, 1220px);
    padding-top: 8px;
    padding-bottom: 82px;
  }

  body.cart-active .app-shell {
    padding-bottom: 152px;
  }

  .topbar {
    position: sticky;
    top: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 7px 9px;
    border-radius: 12px;
  }

  .brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    font-size: 14px;
  }

  .brand-logo-img {
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }

  .brand {
    gap: 8px;
  }

  .brand strong {
    font-size: 13px;
  }

  .brand small {
    font-size: 10px;
  }

  .session-actions {
    width: auto;
    display: flex;
    gap: 6px;
  }

  .nav-link,
  .segment,
  .btn.small {
    justify-content: center;
    padding: 8px 9px;
    font-size: 12px;
    white-space: nowrap;
  }

  .icon-action {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .view,
  .auth-layout {
    margin-top: 18px;
  }

  .client-login {
    min-height: calc(100vh - 92px);
    place-items: start center;
    padding-top: 28px;
  }

  .client-login .auth-card {
    padding: 18px;
  }

  .client-login .section-head h2 {
    font-size: 23px;
  }

  .card,
  .stat-card {
    padding: 14px;
    border-radius: 12px;
  }

  .hero-copy {
    padding: 14px 2px;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .section-head {
    margin-bottom: 13px;
  }

  .section-head.with-actions {
    gap: 12px;
  }

  .section-head h2 {
    font-size: 25px;
  }

  .section-head p {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.55;
  }

  .eyebrow {
    font-size: 10px;
    margin-bottom: 5px;
  }

  .section-head.with-actions .btn {
    width: 100%;
    padding: 10px 14px;
  }

  .dashboard-grid {
    gap: 10px;
  }

  .stat-card span {
    margin-bottom: 4px;
    font-size: 12px;
  }

  .stat-card strong {
    font-size: 18px;
    line-height: 1.25;
  }

  .dashboard-grid,
  .product-grid,
  .profile-grid,
  .feature-cart,
  .dynamic-fields,
  .form-grid.two,
  .mini-grid {
    grid-template-columns: 1fr;
  }

  .section-head.with-actions {
    display: grid;
  }

  .hero h1 {
    font-size: 34px;
  }

  .profile-hero {
    grid-template-columns: 1fr;
  }

  .contact-float {
    left: 10px;
    right: 10px;
    top: auto;
    bottom: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    transform: none;
  }

  body.cart-active .contact-float {
    bottom: 84px;
  }

  .review-float-btn {
    right: 16px;
    top: auto;
    bottom: 178px;
    padding: 7px 11px;
    font-size: 11px;
  }

  body.cart-active .review-float-btn {
    bottom: 252px;
  }

  .contact-float-btn {
    grid-template-columns: 36px 1fr;
    min-width: 0;
    min-height: 46px;
    border-radius: 14px;
  }

  .contact-float-btn:hover {
    grid-template-columns: 36px 1fr;
    transform: translateY(-1px);
  }

  .contact-icon {
    width: 36px;
    height: 46px;
  }

  .contact-copy {
    padding-right: 8px;
  }

  .discount-chest {
    right: 14px;
    top: auto;
    bottom: 82px;
    width: 58px;
    height: 54px;
    transform: none;
  }

  body.cart-active .discount-chest {
    bottom: 156px;
  }

  .mobile-cart-bar.has-items {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 35;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 10px;
    border: 1px solid rgba(16, 185, 129, 0.36);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
    backdrop-filter: blur(16px);
  }

  .mobile-cart-bar .btn {
    min-height: 38px;
    padding: 9px 15px;
  }

  .chest-lid {
    top: 6px;
    left: 9px;
    width: 42px;
    height: 16px;
  }

  .chest-body {
    left: 7px;
    bottom: 8px;
    width: 46px;
    height: 30px;
  }

  .chest-glow {
    top: 11px;
    left: 18px;
    width: 24px;
    height: 16px;
  }

  .discount-chest strong {
    bottom: -10px;
    font-size: 9px;
    padding: 1px 6px;
  }

  .portal-grid {
    gap: 12px;
  }

  .preview-frame {
    min-height: 190px;
  }
}

@media (max-width: 420px) {
  body {
    background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 48%, #eef2ff 100%);
  }

  .app-shell {
    width: min(100% - 12px, 1220px);
  }

  .topbar {
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
  }

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

  .stat-card {
    min-height: 86px;
  }

  .stat-card:nth-child(1),
  .stat-card:nth-child(2) {
    grid-column: span 2;
  }

  .portal-grid .card {
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.08);
  }

  .section-head.with-actions h2 {
    font-size: 24px;
  }
}
