@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@400;500;700&display=swap');

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: 'Noto Sans Thai', 'Segoe UI', sans-serif;
  background: #f4f4f2;
  color: #222;
  font-size: 16px;
  line-height: 1.5;
}
a { color: #185fa5; text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 480px; margin: 0 auto; padding: 0 0 32px; }

.topbar {
  background: #2c2c2a; color: #fff;
  padding: 14px 16px; display: flex; align-items: center; justify-content: space-between;
}
.topbar .brand { font-weight: 700; font-size: 17px; }
.topbar a { color: #fff; font-size: 14px; opacity: .85; }

.card {
  background: #fff; border: 1px solid #ddd; border-radius: 10px;
  padding: 14px 16px; margin: 12px 16px;
}

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: #666; margin-bottom: 4px; }
input[type=text], input[type=password], input[type=date], input[type=number],
input[type=file], select, textarea {
  width: 100%; padding: 9px 10px; font-size: 16px;
  border: 1px solid #ccc; border-radius: 8px; background: #fff; font-family: inherit;
}
textarea { resize: vertical; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 18px; border-radius: 8px; border: 1px solid #999;
  background: #fff; color: #222; font-size: 15px; cursor: pointer; font-family: inherit;
  text-decoration: none;
}
.btn:hover { background: #f0f0f0; text-decoration: none; }
.btn-block { width: 100%; }
.btn-primary { background: #185fa5; border-color: #185fa5; color: #fff; }
.btn-primary:hover { background: #0c447c; }
.btn-danger { background: #a32d2d; border-color: #a32d2d; color: #fff; }
.btn-danger:hover { background: #791f1f; }
.btn-sm { padding: 6px 10px; font-size: 13px; }

.line-item {
  background: #f7f7f5; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px;
}
.line-item .top { display: flex; justify-content: space-between; align-items: center; }
.line-item .sku { font-weight: 700; font-size: 13px; color: #444; }
.line-item .desc { font-size: 14px; color: #333; margin: 2px 0 6px; }
.line-item .row2 { display: flex; gap: 8px; align-items: center; }
.line-item .row2 input[type=number] { width: 80px; }
.line-item .meta { font-size: 12px; color: #888; }

.remove-x { color: #a32d2d; font-size: 18px; background: none; border: none; cursor: pointer; padding: 4px; }

.total-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 12px 16px; font-size: 15px;
}
.total-row .amount { font-size: 22px; font-weight: 700; }

.category-heading {
  font-size: 13px; color: #666; margin: 18px 16px 6px; font-weight: 700;
}

.item-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  border-top: 1px solid #e5e5e3; background: #fff;
}
.item-row:first-of-type { border-top: none; }
.item-row .thumb {
  width: 40px; height: 40px; border-radius: 6px; object-fit: cover; background: #eee; flex-shrink: 0;
}
.item-row .thumb-placeholder {
  width: 40px; height: 40px; border-radius: 6px; background: #e5e5e3; flex-shrink: 0;
}
.item-row .info { flex: 1; }
.item-row .info .name { font-size: 14px; }
.item-row .info .sub { font-size: 12px; color: #888; }
.item-row.added { background: #eaf3de; }
.item-row button.add-btn {
  border: none; background: none; font-size: 22px; color: #185fa5; cursor: pointer; padding: 4px 8px;
}
.item-row.added button.add-btn { color: #3b6d11; }

.search-box { padding: 12px 16px 4px; position: sticky; top: 48px; background: #f4f4f2; }
.search-box input { padding-left: 32px; }

table.plain { width: 100%; border-collapse: collapse; font-size: 14px; }
table.plain th, table.plain td { text-align: left; padding: 8px 6px; border-bottom: 1px solid #e5e5e3; }
table.plain th { color: #666; font-weight: 500; font-size: 12px; }

.flash { margin: 12px 16px; padding: 10px 14px; border-radius: 8px; font-size: 14px; }
.flash-success { background: #eaf3de; color: #27500a; }
.flash-danger { background: #fcebeb; color: #791f1f; }

.summary-view { background: #fff; margin: 16px; border-radius: 10px; border: 1px solid #ddd; padding: 18px; }
.summary-view h2 { font-size: 17px; margin: 0 0 4px; }
.summary-view .sub { color: #666; font-size: 13px; margin-bottom: 14px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; }
.filters select, .filters input { flex: 1; min-width: 120px; }

.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 0 16px 8px; }
.tabs a {
  white-space: nowrap; padding: 6px 12px; border-radius: 999px; background: #fff;
  border: 1px solid #ccc; font-size: 13px; color: #333;
}
.tabs a.active { background: #185fa5; border-color: #185fa5; color: #fff; }

.empty-state { text-align: center; color: #888; padding: 40px 20px; }

nav.bottom-links { display: flex; justify-content: space-around; padding: 10px 0; border-top: 1px solid #ddd; margin-top: 16px; }
nav.bottom-links a { font-size: 13px; }

.list-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid #e5e5e3; background: #fff; }
.list-row .meta { font-size: 12px; color: #888; }

form.inline { display: inline; }
