:root {
  --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --brand-blue: #3498db;
  --brand-blue-dark: #2980b9;
  --brand-green: #27ae60;
  --brand-green-dark: #229954;
  --deep: #2c3e50;
  --muted: #555;
  --soft: #7f8c8d;
  --line: #e1e8ed;
  --surface: rgba(255, 255, 255, 0.95);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", Tahoma, sans-serif;
  line-height: 1.6;
  color: #333;
  background: var(--bg-gradient);
  min-height: 100vh;
}

a {
  text-decoration: none;
}

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

.container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 16px;
}

.site-header {
  background: var(--surface);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
}

.logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--deep);
}

.logo span {
  color: var(--brand-blue);
}

.main-nav {
  display: flex;
  gap: 1rem;
  flex-wrap: nowrap;
  min-width: 0;
  justify-content: center;
  overflow-x: auto;
  scrollbar-width: none;
}

.main-nav::-webkit-scrollbar {
  display: none;
}

.main-nav a {
  color: var(--muted);
  font-weight: 500;
}

.main-nav a:hover {
  color: var(--brand-blue);
}

.search-bar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: nowrap;
}

.search-bar input {
  padding: 0.65rem 1rem;
  border: 2px solid var(--line);
  border-radius: 25px;
  outline: none;
  width: 180px;
  min-width: 0;
}

.search-bar input:focus {
  border-color: var(--brand-blue);
}

.search-bar button {
  padding: 0.65rem 1rem;
  background: var(--brand-blue);
  color: white;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
}

.customer-greeting {
  color: var(--deep);
  font-weight: 600;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.header-btn,
.cta-button,
.secondary-button,
.card-link,
.action-btn {
  border: none;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-block;
}

.header-btn,
.action-btn {
  padding: 0.65rem 1rem;
  background: var(--brand-blue);
  color: white;
  font-weight: 600;
}

.green-btn {
  background: var(--brand-green);
}

.profile-menu-wrap {
  position: relative;
}

.profile-icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: white;
  box-shadow: var(--shadow);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.profile-svg {
  width: 20px;
  height: 20px;
  display: block;
  fill: var(--deep);
}

.profile-dropdown {
  position: absolute;
  top: 54px;
  right: 0;
  min-width: 220px;
  background: white;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
  padding: 0.75rem;
  z-index: 120;
}

.profile-dropdown button {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 0.8rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  color: var(--deep);
}

.profile-dropdown button:hover {
  background: #f4f7fb;
}

.header-btn:hover,
.action-btn:hover,
.cta-button:hover,
.secondary-button:hover,
.card-link:hover {
  transform: translateY(-2px);
}

.hero {
  text-align: center;
  padding: 4rem 0;
  color: white;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  font-weight: 300;
}

.hero p {
  font-size: 1.1rem;
  max-width: 850px;
  margin: 0 auto 2rem;
  opacity: 0.95;
}

.cta-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.cta-button,
.secondary-button,
.card-link,
.button-link {
  padding: 1rem 2rem;
  color: white;
  font-weight: 600;
}

.cta-button {
  background: var(--brand-blue);
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.cta-button:hover {
  background: var(--brand-blue-dark);
}

.secondary-button {
  background: var(--brand-green);
  box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.secondary-button:hover {
  background: var(--brand-green-dark);
}

.page-main {
  background: white;
  margin-top: -2rem;
  border-radius: 20px 20px 0 0;
  padding: 3rem 0 4rem;
  position: relative;
  z-index: 10;
}

.panel {
  margin-bottom: 2rem;
}

.section-title {
  text-align: center;
  font-size: 2.3rem;
  margin-bottom: 2rem;
  color: var(--deep);
  font-weight: 300;
}

.portal-grid,
.grid,
.info-grid,
.two-col-layout,
.split-layout,
.two-col-form {
  display: grid;
  gap: 1.5rem;
}

.portal-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

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

.info-grid,
.two-col-layout,
.split-layout {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

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

.full-span {
  grid-column: 1 / -1;
}

.card,
.info-box,
.summary-card,
.order-card {
  background: white;
  border-radius: 15px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.portal-card {
  min-height: 100%;
}

.card-body,
.info-box,
.summary-card,
.order-card {
  padding: 1.5rem;
}

.card h3,
.info-box h3,
.summary-card h3,
.order-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
  color: var(--deep);
}

.card p,
.info-box p,
.summary-card p,
.order-card p,
.order-card li,
.muted-text {
  color: var(--muted);
}

.card-link {
  margin-top: 1rem;
  background: var(--bg-gradient);
}

.toolbar {
  display: grid;
  grid-template-columns: 0.8fr auto 1fr;
  gap: 1rem;
}

.toolbar-note {
  display: flex;
  align-items: center;
  color: var(--muted);
  min-width: 0;
}

.customer-search-bar input {
  max-width: 180px;
}

.main-nav a,
.customer-greeting,
.header-btn,
.search-bar button {
  white-space: nowrap;
}

.header-row > * {
  min-width: 0;
}

.toolbar input,
.toolbar select,
.form-group input,
.form-group select,
.form-group textarea,
.stock-input {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 2px solid var(--line);
  border-radius: 12px;
  outline: none;
}

.form-group textarea {
  min-height: 110px;
  resize: vertical;
}

.toolbar input:focus,
.toolbar select:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--brand-blue);
}

.product-card img,
.cart-item img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.product-card .card-body {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.price {
  color: var(--brand-green);
  font-weight: 700;
  font-size: 1.3rem;
}

.category {
  color: var(--soft);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.status-chip {
  display: inline-block;
  padding: 0.35rem 0.8rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  background: #eef4ff;
  color: var(--brand-blue-dark);
}

.status-ok {
  background: #e8f7ee;
  color: var(--brand-green-dark);
}

.status-warn {
  background: #fff3d6;
  color: #b9770e;
}

.status-danger {
  background: #fdecea;
  color: #c0392b;
}

.action-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.action-btn.alt {
  background: #95a5a6;
}

.danger-action {
  background: #e74c3c;
}

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

.payment-box {
  margin-bottom: 1rem;
}

.payment-pill {
  display: inline-block;
  border-radius: 20px;
  padding: 0.4rem 0.9rem;
  background: #eef4ff;
  color: var(--brand-blue-dark);
  font-weight: 700;
  margin-bottom: 1rem;
}

.verification-code-box {
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: #eef4ff;
  color: var(--brand-blue-dark);
  font-weight: 600;
}

.mono-inline {
  font-family: Consolas, "Courier New", monospace;
  word-break: break-all;
}

.fake-qr {
  margin-top: 1rem;
  text-align: center;
}

.google-auth-btn {
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.9rem;
  border-radius: 10px;
  border: 1px solid #d9e2ec;
  background: white;
  cursor: pointer;
  font-weight: 600;
}

.google-auth-btn:hover {
  background: #f7f9fc;
}

.google-panel-box {
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid #e3e8ef;
  border-radius: 12px;
  background: #f8fafc;
}

.google-note {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.profile-section-title {
  margin: 1.2rem 0 0.8rem;
  color: var(--deep);
}

.qr-grid {
  width: 160px;
  height: 160px;
  margin: 0 auto 0.75rem;
  border-radius: 12px;
  background:
    linear-gradient(90deg, #222 12.5%, transparent 12.5%, transparent 25%, #222 25%, #222 37.5%, transparent 37.5%, transparent 50%, #222 50%, #222 62.5%, transparent 62.5%, transparent 75%, #222 75%, #222 87.5%, transparent 87.5%),
    linear-gradient(#222 12.5%, transparent 12.5%, transparent 25%, #222 25%, #222 37.5%, transparent 37.5%, transparent 50%, #222 50%, #222 62.5%, transparent 62.5%, transparent 75%, #222 75%, #222 87.5%, transparent 87.5%);
  background-size: 32px 32px;
  background-color: white;
  border: 8px solid #fff;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  padding: 1rem;
  overflow-y: auto;
}

.modal-content {
  background-color: white;
  margin: 2rem auto;
  padding: 2rem;
  border-radius: 15px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  position: relative;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.wide-modal {
  max-width: 900px;
}

.modal h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--deep);
}

.close {
  color: #aaa;
  position: absolute;
  right: 18px;
  top: 10px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover {
  color: #000;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--muted);
  font-weight: 500;
}

form button,
.summary-card button {
  width: 100%;
  padding: 0.9rem;
  background: var(--bg-gradient);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  margin-top: 0.5rem;
}

form button:hover,
.summary-card button:hover {
  opacity: 0.95;
}

.switch-form {
  text-align: center;
  margin-top: 1rem;
  color: var(--muted);
}

.switch-form a {
  color: var(--brand-blue);
  font-weight: 500;
}

.hidden {
  display: none !important;
}

.cart-item {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid #eee;
}

.cart-item img {
  width: 90px;
  height: 90px;
  border-radius: 8px;
}

.cart-qty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.7rem;
}

.qty-btn {
  padding: 0.35rem 0.7rem;
  border-radius: 20px;
  background: var(--brand-blue);
  color: white;
  border: none;
}

.summary-card {
  align-self: start;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
  color: var(--muted);
}

.summary-line.total {
  border-top: 1px solid #ddd;
  padding-top: 0.8rem;
  font-weight: 700;
  color: var(--deep);
}

.empty-box {
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
  border: 2px dashed #dbe3ea;
  border-radius: 15px;
}

.order-card {
  margin-bottom: 1rem;
}

.order-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.timeline-step {
  padding: 0.75rem;
  border-radius: 10px;
  background: #f7f9fc;
  border: 1px solid #e7ecf1;
  color: var(--soft);
}

.timeline-step.done {
  background: #e8f7ee;
  color: var(--brand-green-dark);
  border-color: #d0ecd9;
}

.inline-note {
  margin: 1rem 0;
}

.compact-form {
  max-width: 460px;
  margin: 0 auto;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  text-align: left;
  padding: 1rem;
  border-bottom: 1px solid #eef2f5;
  vertical-align: top;
}

th {
  color: var(--soft);
}

.site-footer {
  background: var(--deep);
  color: white;
  padding: 3rem 0 1rem;
}

.contact-section {
  background: white;
  padding: 3rem 0;
}

.contact-lead {
  text-align: center;
  color: var(--muted);
  max-width: 800px;
  margin: 0 auto 2rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}

.footer-section h3 {
  margin-bottom: 1rem;
  color: var(--brand-blue);
}

.footer-section p,
.footer-section a {
  color: #bdc3c7;
}

.footer-section a:hover {
  color: var(--brand-blue);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid #34495e;
  color: #95a5a6;
}

@media (max-width: 768px) {
  .header-row,
  .main-nav,
  .header-actions {
    flex-wrap: wrap;
  }

  .header-row {
    display: flex;
  }

  .header-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .toolbar,
  .two-col-form {
    grid-template-columns: 1fr;
  }

  .customer-search-bar {
    width: 100%;
  }

  .customer-search-bar input {
    width: 100%;
    max-width: none;
  }

  .search-bar {
    width: 100%;
  }

  .modal {
    padding: 0.5rem;
  }

  .modal-content {
    margin: 0.5rem auto;
    padding: 1.25rem;
    max-height: calc(100vh - 1rem);
  }

  .cart-item {
    grid-template-columns: 1fr;
  }

  .cart-item img {
    width: 100%;
    height: 180px;
  }
}
