:root {
  --primary: #1976d2;
  --primary-dark: #1565c0;
  --bg: #f5f5f5;
  --text: #212121;
  --muted: #757575;
  --ok: #2e7d32;
  --warn: #f57c00;
  --err: #d32f2f;
  --card: #fff;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Sarabun", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
body { padding-bottom: 72px; }
.hidden { display: none !important; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--primary);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar h1 { font-size: 18px; margin: 0; font-weight: 700; }
.icon-btn {
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 22px;
  position: relative;
  min-width: 40px;
}
.badge {
  position: absolute;
  top: 0;
  right: 0;
  background: #e53935;
  color: #fff;
  border-radius: 10px;
  font-size: 11px;
  min-width: 18px;
  padding: 1px 5px;
}
.wrap { padding: 16px; max-width: 560px; margin: 0 auto; }
.card {
  background: var(--card);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.card .label { color: var(--muted); font-size: 13px; }
.card .value { font-size: 18px; font-weight: 700; margin-top: 4px; }
.btn {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
}
.btn:disabled { background: #bdbdbd !important; }
.btn-ok { background: var(--ok); }
.btn-primary { background: var(--primary-dark); }
.btn-warn { background: var(--warn); }
.btn-gray { background: #607d8b; }
input, textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #cfd8dc;
  border-radius: 12px;
  font-size: 16px;
  margin-bottom: 12px;
}
label { display: block; font-size: 13px; margin-bottom: 6px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.login-hero { padding: 40px 16px 10px; }
.nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: #fff;
  display: flex;
  border-top: 1px solid #eee;
  z-index: 20;
}
select {
  width: 100%;
  padding: 12px;
  border: 1px solid #cfd8dc;
  border-radius: 12px;
  font-size: 16px;
  margin-bottom: 12px;
  background: #fff;
}
textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #cfd8dc;
  border-radius: 12px;
  font-size: 16px;
  margin-bottom: 12px;
  font-family: inherit;
}
.nav button {
  flex: 1;
  border: 0;
  background: #fff;
  padding: 10px 2px 12px;
  font-size: 11px;
  color: var(--muted);
}
.nav button.active { color: var(--primary); font-weight: 700; }
.msg { padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; }
.msg.err { background: #ffebee; color: var(--err); }
.msg.ok { background: #e8f5e9; color: var(--ok); }
.station h3 { margin: 0 0 6px; }
.prod-row {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}
.prod-row2 {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 13px;
}
.prod-row2 > div { flex: 1; min-width: 0; }
.row-btns { display: flex; gap: 10px; }
.row-btns .btn { margin: 0; }
.lock {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 80;
  display: flex;
  flex-direction: column;
}
.lock-head {
  background: var(--primary);
  color: #fff;
  padding: 18px 20px;
}
.lock-body {
  flex: 1;
  overflow: auto;
  padding: 20px;
  font-size: 18px;
  line-height: 1.55;
  white-space: pre-wrap;
}
.lock-foot { padding: 12px 16px 20px; }
.hint { color: var(--warn); font-weight: 600; text-align: center; margin-bottom: 8px; }
.hist { font-size: 14px; }
.hist + .hist { border-top: 1px solid #eee; padding-top: 10px; }
.busy {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.7);
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.admin-tag { color: var(--ok); font-size: 13px; font-weight: 600; }
.session-block {
  margin-top: 10px;
  padding: 10px;
  background: #f7f9fc;
  border: 1px solid #e3e8ef;
  border-radius: 10px;
}
.attach-collapse {
  margin-top: 6px;
}
.attach-toggle {
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  color: #607d8b;
  cursor: pointer;
}
.attach-toggle:hover { color: var(--primary-dark); }
.attach-chevron { font-size: 11px; }
.attach-open {
  font-size: 12px;
  margin-left: 6px;
}
.attach-box {
  margin-top: 6px;
  padding: 8px;
  background: #fff;
  border: 1px dashed #cfd8dc;
  border-radius: 8px;
}
.attach-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #546e7a;
  margin-bottom: 6px;
}
.attach-input {
  width: 100%;
  font-size: 13px;
}
