* {
  box-sizing: border-box;
  margin: 0;
  padding: 0
}

body {
  font-family: Segoe UI, Tahoma, sans-serif;
  background: linear-gradient(135deg, rgba(15, 23, 42, .86), rgba(37, 99, 235, .55)), url('https://i.imgur.com/meLkF5r.png') center/cover fixed;
  min-height: 100vh;
  color: #0f172a;
  opacity: 0;
  /* Ẩn mặc định để fade-in */
  animation: fadeInPage 0.6s ease-out forwards;
  transition: opacity 0.4s ease-in;
}

@keyframes fadeInPage {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Hiệu ứng chuyển tab mượt mà */
.tab-animate {
  animation: tabFadeIn 0.4s ease-out forwards;
}

@keyframes tabFadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


body.fade-out {
  opacity: 0 !important;
}

.booting #authScreen,
.booting #appScreen {
  display: none !important
}

.hidden {
  display: none !important
}

.glass {
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, .45);
  box-shadow: 0 18px 40px rgba(15, 23, 42, .15);
  border-radius: 22px
}

.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px
}

.auth-wrap {
  width: min(1100px, 100%);
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 20px
}

.hero {
  padding: 34px;
  color: #fff;
  background: linear-gradient(155deg, rgba(15, 23, 42, .82), rgba(37, 99, 235, .72));
  border-radius: 22px
}

.hero h1 {
  font-size: 3rem;
  line-height: 1.05;
  margin-bottom: 14px
}

.hero p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #dbeafe
}

.hero ul {
  margin-top: 20px;
  padding-left: 18px;
  color: #e2e8f0
}

.hero li {
  margin: 8px 0
}

.auth-panel {
  padding: 18px
}

.tabbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px
}

.tab {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 14px;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 800;
  cursor: pointer
}

.tab.active {
  background: #2563eb;
  color: #fff
}

.panel {
  display: none
}

.panel.active {
  display: block
}

.card {
  padding: 18px;
  background: rgba(255, 255, 255, .94);
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, .08)
}

.card h2,
.card h3 {
  margin-bottom: 8px
}

.muted {
  color: #64748b
}

.field {
  margin: 12px 0
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700
}

.field input,
.field select,
.field textarea,
.search input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  font: inherit
}

.field textarea {
  min-height: 88px;
  resize: vertical
}

.btn {
  border: none;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 800;
  cursor: pointer
}

.btn-primary {
  background: #2563eb;
  color: #fff
}

.btn-success {
  background: #059669;
  color: #fff
}

.btn-soft {
  background: #dbeafe;
  color: #1d4ed8
}

.btn-full {
  width: 100%
}

.app-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 32px
}

nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px;
  margin-top: 16px
}

.logo {
  font-size: 1.4rem;
  font-weight: 900;
  color: #60a5fa
}

.nav-links {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap
}

.nav-links button,
.nav-link {
  background: none;
  border: none;
  color: #f8fafc;
  cursor: pointer;
  font: inherit;
  text-decoration: none
}

.nav-link.active {
  color: #93c5fd;
  font-weight: 800
}

.chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 800
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 12px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 1.4rem;
  font-weight: 900;
  cursor: pointer
}

header {
  padding: 38px 16px 12px;
  text-align: center;
  color: #fff
}

.header-title {
  font-size: 3rem;
  margin-bottom: 10px
}

.search {
  max-width: 720px;
  display: flex;
  gap: 10px;
  margin: 18px auto 0
}

.search input {
  flex: 1;
  border: none
}

body[data-page="products"] .header-title {
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, "Times New Roman", serif;
  font-style: italic;
  font-weight: 700;
  letter-spacing: .03em;
  text-shadow: 0 6px 18px rgba(0, 0, 0, .55);
}

body[data-page="products"] .brand-title-text {
  color: #fff;
  font-size: 3.2rem;
  line-height: 1.1;
}

.section {
  margin-top: 18px;
  padding: 18px
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px
}

.wallet-value {
  font-size: 2rem;
  font-weight: 900;
  color: #059669;
  margin: 8px 0
}

.products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-top: 14px
}

.product {
  padding: 16px
}

.product-icon {
  height: 130px;
  border-radius: 16px;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #fff
}

.tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0
}

.tag {
  padding: 4px 10px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: .8rem;
  font-weight: 800
}

.price {
  font-size: 1.35rem;
  font-weight: 900;
  color: #2563eb;
  margin: 12px 0
}

.actions {
  display: flex;
  gap: 10px
}

.list {
  margin-top: 10px
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #e5e7eb
}

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

.strong-row {
  font-weight: 900
}

.space-top {
  margin-top: 16px
}

.empty {
  padding: 14px 0;
  color: #94a3b8;
  text-align: center
}

.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 800
}

.pending {
  background: #fef3c7;
  color: #92400e
}

.approved {
  background: #dcfce7;
  color: #166534
}

.rejected {
  background: #fee2e2;
  color: #991b1b
}

.msg {
  margin-top: 10px;
  font-size: .92rem;
  font-weight: 800
}

.error {
  color: #dc2626
}

.success {
  color: #059669
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: 320px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #0f172a;
  color: #fff;
  display: none;
  z-index: 50
}

.toast.show {
  display: block
}

footer {
  text-align: center;
  color: #e2e8f0;
  padding: 28px 0 10px
}

@media (max-width:850px) {
  .auth-wrap {
    grid-template-columns: 1fr
  }

  .hero h1,
  .header-title {
    font-size: 2.2rem
  }

  .search,
  .actions {
    flex-direction: column
  }

  nav {
    align-items: flex-start;
    flex-wrap: wrap
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto
  }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-top: 10px
  }

  nav.menu-open .nav-links {
    display: flex
  }

  .nav-links .chip {
    margin-top: 4px
  }
}