:root {
  --cream: #fff6d9;
  --sand: #ffe9a6;
  --latte: #ffd86b;
  --pink: #f25aa8;
  --pink-deep: #c0186e;
  --berry: #6d0f46;
  --cocoa: #3a1f2a;
  --espresso: #2a151c;
  --accent: #f25aa8;
  --accent-2: #ffd34d;
  --ink: #2a151c;
  --muted: #6f4b57;
  --glass: rgba(255, 255, 255, 0.7);
  --shadow: 0 12px 30px rgba(109, 15, 70, 0.12);
  --shadow-strong: 0 18px 40px rgba(109, 15, 70, 0.22);
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(255, 220, 112, 0.55) 0%, rgba(255, 220, 112, 0.12) 60%, transparent 100%),
    radial-gradient(900px 500px at 90% 0%, rgba(242, 90, 168, 0.45) 0%, rgba(242, 90, 168, 0.1) 60%, transparent 100%),
    linear-gradient(180deg, #fff3c7 0%, #ffe39e 55%, #ffd07d 100%);
  color: var(--ink);
  min-height: 100vh;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.35) 0%, transparent 35%),
    radial-gradient(circle at 80% 30%, rgba(255, 255, 255, 0.25) 0%, transparent 40%),
    radial-gradient(circle at 30% 80%, rgba(255, 255, 255, 0.2) 0%, transparent 45%);
  pointer-events: none;
  z-index: -1;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: repeating-linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.22) 0px,
    rgba(255, 255, 255, 0.22) 1px,
    transparent 1px,
    transparent 12px
  );
  opacity: 0.2;
  pointer-events: none;
  z-index: -2;
}

.page-shell {
  max-width: 1280px;
  margin: 0 auto;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  background: rgba(242, 90, 168, 0.2);
  color: var(--berry);
  font-weight: 600;
}

.hero-card {
  background: linear-gradient(130deg, #fff4c9 0%, #ffe29c 55%, #ffd278 100%);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: var(--shadow-strong);
  border: 1px solid rgba(242, 90, 168, 0.2);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: '';
  position: absolute;
  right: -120px;
  top: -80px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.6) 0%, transparent 70%);
  opacity: 0.9;
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.6rem;
  color: var(--berry);
  margin: 0.5rem 0 0.75rem;
}

.hero-subtitle {
  color: var(--muted);
  font-size: 1rem;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.stat-card {
  background: rgba(255, 255, 255, 0.75);
  border-radius: 18px;
  padding: 1rem 1.2rem;
  border: 1px solid rgba(109, 15, 70, 0.12);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.stat-value {
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--berry);
  margin-top: 0.2rem;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--berry);
}

.hero-strip {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(242, 90, 168, 0.2);
  border-radius: 18px;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  box-shadow: var(--shadow);
}

.bakery-nav {
  background: linear-gradient(120deg, var(--berry), var(--pink-deep));
  color: #fff;
  box-shadow: var(--shadow-strong);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.bakery-nav .navbar-brand {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  color: #ffe7a6;
  letter-spacing: 0.5px;
}

.bakery-nav .nav-link {
  color: #ffe49b;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  transition: all 0.2s ease;
  position: relative;
}

.bakery-nav .nav-link.active,
.bakery-nav .nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
}

.bakery-nav .nav-link.active::after {
  content: '';
  position: absolute;
  left: 20%;
  right: 20%;
  bottom: -6px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #ffe070, transparent);
  border-radius: 999px;
}

.user-pill {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
}

.page-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  color: var(--berry);
  margin-bottom: 1rem;
  letter-spacing: 0.4px;
  animation: fadeUp 0.6s ease both;
}

.card-bakery {
  background: linear-gradient(160deg, #fff6d9 0%, #ffe6b3 100%);
  border: 1px solid rgba(242, 90, 168, 0.15);
  border-radius: 20px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: fadeUp 0.6s ease both;
  position: relative;
  overflow: hidden;
}

.card-bakery:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-strong);
}

.card-bakery::after {
  content: '';
  position: absolute;
  inset: -40% -20%;
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.55), transparent 55%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.card-bakery::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 4px;
  width: 100%;
  background: linear-gradient(90deg, rgba(242, 90, 168, 0.9), rgba(255, 211, 77, 0.9));
  opacity: 0.65;
}

.card-bakery:hover::after {
  opacity: 0.6;
}

.table thead {
  background: #ffe6a3;
  color: var(--berry);
}

.table tbody tr {
  transition: background-color 0.2s ease;
}

.table tbody tr:hover {
  background-color: rgba(255, 227, 158, 0.35);
}

.btn-bakery {
  background: linear-gradient(135deg, var(--pink), var(--accent-2));
  color: #fff;
  border: none;
  box-shadow: var(--shadow);
  letter-spacing: 0.3px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
  min-height: 48px;
  font-size: 1rem;
}

.btn-bakery:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-strong);
}

.btn-bakery::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 60%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: rotate(20deg);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.4s ease;
}

.btn-bakery:hover::before {
  opacity: 0.7;
  transform: translateX(80%) rotate(20deg);
}

.btn-bakery:active {
  transform: translateY(0) scale(0.98);
}

.badge-soft {
  background: rgba(242, 90, 168, 0.18);
  color: var(--berry);
}

.pos-grid {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 1.5rem;
  height: 100%;
}

.pos-screen {
  height: calc(100vh - 170px);
}

.pos-products {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-grid-wrap {
  flex: 1;
  overflow: auto;
  padding-right: 0.25rem;
  min-height: 0;
}

.pos-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}

.pos-search {
  position: relative;
}

.pos-search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 5;
  max-height: 240px;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.pos-side {
  display: grid;
  gap: 1.25rem;
  height: 100%;
  grid-template-rows: 1fr auto;
}

.cart-card {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.checkout-card {
  position: sticky;
  top: 90px;
}

.cart-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(109, 15, 70, 0.12);
}

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

.cart-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qty-input {
  width: 88px;
  text-align: center;
}

.cart-price {
  min-width: 58px;
  text-align: right;
  font-weight: 600;
  color: var(--berry);
}

.cart-remove {
  min-width: 44px;
  min-height: 44px;
  border-radius: 12px;
}

.list-group-item {
  border: 1px solid rgba(242, 90, 168, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
}

.list-group-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  background: rgba(255, 255, 255, 0.9);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.8rem;
  margin-bottom: 0.75rem;
}

.product-tile {
  border: 1px solid rgba(242, 90, 168, 0.18);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(255, 250, 240, 0.9));
  border-radius: 22px;
  padding: 0.95rem;
  text-align: left;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  cursor: pointer;
}

.product-image {
  background: rgba(255, 255, 255, 0.75);
  border-radius: 18px;
  padding: 0.4rem;
  border: 1px solid rgba(242, 90, 168, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.product-tile img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 14px;
}

.product-tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-strong);
}

.product-name {
  font-weight: 600;
  color: var(--cocoa);
  font-size: 1rem;
  line-height: 1.3;
  min-height: 2.6em;
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-price {
  color: var(--pink-deep);
  font-weight: 600;
  font-size: 0.95rem;
  background: rgba(242, 90, 168, 0.12);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

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

  .pos-controls {
    grid-template-columns: 1fr;
  }

  .checkout-card {
    position: static;
  }

  .pos-screen {
    height: auto;
  }

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

.frosted {
  background: rgba(255, 250, 244, 0.85);
  backdrop-filter: blur(6px);
  border-radius: 16px;
}

.form-label {
  font-weight: 500;
}

.form-control,
.form-select {
  border-radius: 12px;
  border: 1px solid rgba(242, 90, 168, 0.22);
  box-shadow: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  min-height: 48px;
  font-size: 1rem;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(242, 90, 168, 0.65);
  box-shadow: 0 0 0 0.2rem rgba(242, 90, 168, 0.18);
  transform: translateY(-1px);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
}

.login-card {
  max-width: 420px;
  width: 100%;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(242, 90, 168, 0.2);
  box-shadow: var(--shadow-strong);
  backdrop-filter: blur(10px);
}

.login-card h1 {
  font-family: 'Playfair Display', serif;
  color: var(--berry);
}

.line-item {
  display: flex;
  justify-content: space-between;
  font-size: 1rem;
}

.line-item span:last-child {
  font-weight: 600;
}

.text-muted-small {
  font-size: 0.85rem;
  color: var(--muted);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 0 rgba(242, 90, 168, 0.15);
  }
  100% {
    box-shadow: 0 10px 30px rgba(242, 90, 168, 0.25);
  }
}

.pulse-accent {
  animation: pulseGlow 1.6s ease-in-out infinite alternate;
}

.loading-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 2000;
}

.loading-backdrop.show {
  opacity: 1;
  visibility: visible;
}

.loading-dialog {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(242, 90, 168, 0.25);
  border-radius: 18px;
  padding: 1rem 1.4rem;
  box-shadow: var(--shadow-strong);
  color: var(--berry);
  min-width: 220px;
}

.loading-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid rgba(242, 90, 168, 0.25);
  border-top-color: var(--pink-deep);
  animation: spin 0.8s linear infinite;
}

.loading-text {
  font-weight: 500;
  letter-spacing: 0.2px;
}

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

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
