a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
img { max-width: 100%; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  background: var(--sidebar);
  color: white;
  padding: 18px 14px;
  overflow-y: auto;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 24px;
  font-weight: 700;
  font-size: 18px;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), #8b7cf6);
}

.nav-section-title {
  padding: 12px 12px 8px;
  color: #9ca3af;
  font-size: 12px;
  text-transform: uppercase;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  color: #d1d5db;
  transition: 0.2s ease;
}

.nav-item:hover,
.nav-item.active {
  background: var(--primary);
  color: white;
}

.nav-icon {
  width: 22px;
  text-align: center;
}

.main {
  grid-column: 2;
  min-width: 0;
}

.topbar {
  height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-menu {
  display: none;
  border: 0;
  background: transparent;
  font-size: 24px;
}

.page {
  padding: 24px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.page-title {
  margin: 0;
  font-size: 26px;
}

.page-subtitle {
  margin: 6px 0 0;
  color: var(--text-muted);
}

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

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

.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}

.card-title {
  margin: 0 0 16px;
  font-size: 18px;
}

.stat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-label {
  color: var(--text-muted);
  font-size: 14px;
}

.stat-value {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 700;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 22px;
}

.soft-primary { background: var(--primary-soft); color: var(--primary); }
.soft-success { background: var(--success-soft); color: var(--success); }
.soft-warning { background: var(--warning-soft); color: var(--warning); }
.soft-danger { background: var(--danger-soft); color: var(--danger); }
.soft-info { background: var(--info-soft); color: var(--info); }

.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  min-height: 42px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  transition: 0.2s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-outline { background: white; color: var(--text); border-color: var(--border); }
.btn-block { width: 100%; }
.btn-lg { min-height: 52px; font-size: 16px; }

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

.form-group {
  display: grid;
  gap: 7px;
}

.form-label {
  font-weight: 600;
  font-size: 14px;
}

.form-control {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: white;
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.input-group {
  display: flex;
  gap: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-primary { background: var(--primary-soft); color: var(--primary); }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

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

.data-table th,
.data-table td {
  text-align: left;
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table th {
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 13px;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search {
  max-width: 380px;
  flex: 1;
}

.product-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 18px;
  align-items: start;
}

.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.category-tab {
  white-space: nowrap;
  border: 1px solid var(--border);
  background: white;
  border-radius: 999px;
  padding: 8px 14px;
}

.category-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

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

.product-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: white;
  overflow: hidden;
  transition: 0.2s ease;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.product-card.disabled-menu {
  opacity: 0.45;
  cursor: not-allowed;
}

.product-image {
  height: 130px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f7f5ff, #f4fbf7);
  font-size: 52px;
}

.product-info {
  padding: 12px;
}

.product-name {
  font-weight: 700;
}

.product-price {
  color: var(--primary);
  margin-top: 4px;
}

.cart {
  position: sticky;
  top: calc(var(--topbar-height) + 18px);
}

.cart-list {
  display: grid;
  gap: 12px;
  margin: 16px 0;
  min-height: 48px;
}

.cart-empty {
  color: var(--text-muted);
  text-align: center;
  padding: 12px 0;
  font-size: 14px;
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: white;
}

.total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 18px;
  font-weight: 700;
  margin: 16px 0;
}

.payment-options {
  display: grid;
  gap: 12px;
}

.payment-option {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  background: none;
  width: 100%;
  text-align: left;
}

.payment-option.active {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.summary-list {
  display: grid;
  gap: 12px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.summary-row.total {
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 20px;
  font-weight: 700;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 480px);
  background: white;
}

.login-visual {
  display: grid;
  place-items: center;
  padding: 40px;
  background: linear-gradient(135deg, #f1edff, #f3fff8);
}

.login-illustration {
  width: min(560px, 90%);
  min-height: 420px;
  background: white;
  border-radius: 30px;
  box-shadow: var(--shadow-md);
  display: grid;
  place-items: center;
  font-size: 100px;
}

.login-panel {
  padding: 48px;
  display: flex;
  align-items: center;
}

.login-box {
  width: 100%;
  max-width: 380px;
  margin: auto;
}

.login-title {
  font-size: 32px;
  margin-bottom: 8px;
}

.login-help {
  color: var(--text-muted);
  margin-bottom: 28px;
}

.mobile-bottom-nav {
  display: none;
}

@media (max-width: 1100px) {
  .product-layout {
    grid-template-columns: 1fr;
  }

  .cart {
    position: static;
  }

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

@media (max-width: 820px) {
  :root {
    --topbar-height: 58px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main {
    grid-column: 1;
  }

  .mobile-menu {
    display: inline-flex;
  }

  .page {
    padding: 16px;
    padding-bottom: 88px;
  }

  .grid-2,
  .grid-3,
  .grid-4,
  .form-grid {
    grid-template-columns: 1fr;
  }

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

  .login-page {
    grid-template-columns: 1fr;
  }

  .login-visual {
    display: none;
  }

  .login-panel {
    padding: 28px 20px;
  }

  .mobile-bottom-nav {
    position: fixed;
    inset: auto 0 0 0;
    height: 68px;
    background: white;
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    z-index: 45;
  }

  .mobile-bottom-nav a {
    display: grid;
    place-items: center;
    font-size: 12px;
    color: var(--text-muted);
  }

  .mobile-bottom-nav a.active {
    color: var(--primary);
    font-weight: 700;
  }
}

@media (max-width: 520px) {
  .topbar {
    padding: 0 14px;
  }

  .page-header {
    flex-direction: column;
  }

  .product-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .product-image {
    height: 100px;
    font-size: 40px;
  }

  .app-card {
    padding: 16px;
  }
}
