:root {
  --sn-blue: #173f95;
  --sn-blue-dark: #08275f;
  --sn-yellow: #ffd21c;
  --sn-green: #20a35b;
  --sn-bg: #f4f7fb;
  --sn-line: #d9e2f2;
}

body {
  background: var(--sn-bg);
  font-family: "Sarabun", "Noto Sans Thai", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.site-body {
  background: #fff;
}

.site-header {
  background: var(--sn-blue-dark);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-logo {
  height: 54px;
  width: auto;
  object-fit: contain;
}

.store-hero {
  min-height: 380px;
  background:
    radial-gradient(circle at 78% 28%, rgba(255, 210, 28, 0.22), transparent 24%),
    linear-gradient(135deg, #233b93 0%, #173f95 38%, #0b2d77 68%, #071e4d 100%);
  color: #fff;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.store-hero::after {
  content: none;
}

.hero-title {
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 900;
  line-height: 1.08;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-visual {
  position: relative;
  z-index: 1;
  min-height: 285px;
}

.hero-tractor {
  width: min(470px, 100%);
  max-height: 320px;
  object-fit: contain;
  filter: drop-shadow(0 26px 32px rgba(0, 0, 0, 0.45));
}

.quick-search {
  margin-top: -34px;
  position: relative;
  z-index: 3;
}

.mobile-store-menu {
  background: #071e4d;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.mobile-store-menu a {
  color: #fff;
  text-decoration: none;
  display: block;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.feature-tile {
  border: 1px solid var(--sn-line);
  border-radius: 8px;
  padding: 22px;
  height: 100%;
  background: #fff;
}

.login-page {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(8, 39, 95, 0.96), rgba(23, 63, 149, 0.78)),
    url("brand-board.jfif") center / cover no-repeat;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(440px, 100%);
  background: #fff;
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  background: var(--sn-blue-dark);
  color: #fff;
  padding: 20px 16px;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.brand-logo {
  width: 52px;
  height: 52px;
  background: var(--sn-yellow);
  border-radius: 8px;
  object-fit: cover;
}

.brand-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.brand-subtitle {
  color: #b9c9ea;
  font-size: 12px;
}

.nav-link {
  color: #dbe6ff;
  border-radius: 8px;
  margin-bottom: 4px;
  font-weight: 600;
}

.nav-link:hover,
.nav-link.active {
  background: var(--sn-yellow);
  color: var(--sn-blue-dark);
}

.main {
  padding: 24px;
}

.topbar {
  background: #fff;
  border: 1px solid var(--sn-line);
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.panel {
  background: #fff;
  border: 1px solid var(--sn-line);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(8, 39, 95, 0.06);
}

.metric {
  padding: 18px;
  border-left: 5px solid var(--sn-yellow);
}

.metric-label {
  color: #65718a;
  font-size: 13px;
}

.metric-value {
  color: var(--sn-blue-dark);
  font-weight: 800;
  font-size: 26px;
}

.btn-primary {
  background: var(--sn-blue);
  border-color: var(--sn-blue);
}

.btn-warning {
  background: var(--sn-yellow);
  border-color: var(--sn-yellow);
  color: var(--sn-blue-dark);
  font-weight: 800;
}

.table thead th {
  background: #eaf0fb;
  color: var(--sn-blue-dark);
  white-space: nowrap;
}

.stock-low {
  background: #fff3cd;
  color: #8a5a00;
}

.stock-ok {
  background: #dcfce7;
  color: #166534;
}

.pos-list {
  max-height: 520px;
  overflow: auto;
}

.product-hit {
  cursor: pointer;
  transition: background 0.15s ease;
}

.product-hit:hover {
  background: #fff8d6;
}

.cart-table input {
  min-width: 78px;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }
}
