* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #0f172a; color: #e2e8f0; min-height: 100vh;
}
#app { max-width: 860px; margin: 0 auto; padding: 12px 14px 90px; }

.topbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 0; border-bottom: 1px solid #334155; margin-bottom: 14px;
}
.topbar .brand { font-weight: 700; font-size: 18px; color: #fbbf24; }
.topbar .user { margin-left: auto; font-size: 13px; color: #94a3b8; }

.nav {
  display: flex; gap: 6px; overflow-x: auto; padding: 6px 0;
  position: sticky; top: 0; background: #0f172a; z-index: 10;
}
.nav button {
  flex: 0 0 auto; padding: 10px 14px; border: 1px solid #334155; border-radius: 10px;
  background: #1e293b; color: #cbd5e1; font-size: 15px; cursor: pointer; white-space: nowrap;
}
.nav button.active { background: #f59e0b; border-color: #f59e0b; color: #111827; font-weight: 700; }
.nav button.external-hidden { display: none; }

.card {
  background: #1e293b; border: 1px solid #334155; border-radius: 14px;
  padding: 16px; margin-bottom: 14px;
}
.card h2 { margin: 0 0 12px; font-size: 18px; color: #f8fafc; }
.card h3 { margin: 14px 0 8px; font-size: 15px; color: #cbd5e1; }

label { display: block; font-size: 13px; color: #94a3b8; margin: 10px 0 4px; }
input, select, textarea {
  width: 100%; padding: 12px; border-radius: 10px; border: 1px solid #475569;
  background: #0f172a; color: #e2e8f0; font-size: 16px;
}
textarea { min-height: 64px; }
input:focus, select:focus, textarea:focus { outline: 2px solid #f59e0b; border-color: #f59e0b; }

.btn {
  display: inline-block; padding: 13px 20px; border: none; border-radius: 10px;
  background: #f59e0b; color: #111827; font-size: 16px; font-weight: 700; cursor: pointer;
  margin-top: 12px;
}
.btn.secondary { background: #334155; color: #e2e8f0; }
.btn.danger { background: #dc2626; color: #fff; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 140px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label {
  display: flex; align-items: center; gap: 6px; margin: 0;
  background: #0f172a; border: 1px solid #475569; border-radius: 999px;
  padding: 8px 14px; font-size: 14px; color: #cbd5e1; cursor: pointer;
}
.checks input { width: auto; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid #334155; }
th { color: #94a3b8; font-weight: 600; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.received { background: #334155; color: #cbd5e1; }
.badge.processing { background: #1d4ed8; color: #dbeafe; }
.badge.waiting_part { background: #b45309; color: #fef3c7; }
.badge.ready { background: #047857; color: #d1fae5; }
.badge.paid_collected { background: #065f46; color: #a7f3d0; }
.badge.cancelled { background: #7f1d1d; color: #fecaca; }
.badge.pending { background: #334155; color: #cbd5e1; }
.badge.printing { background: #1d4ed8; color: #dbeafe; }
.badge.done { background: #047857; color: #d1fae5; }
.badge.failed { background: #dc2626; color: #fff; }

.msg { padding: 12px; border-radius: 10px; margin-top: 12px; font-size: 14px; }
.msg.ok { background: #064e3b; color: #a7f3d0; }
.msg.err { background: #7f1d1d; color: #fecaca; }
.msg.info { background: #1e3a8a; color: #bfdbfe; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.stat { background: #0f172a; border: 1px solid #334155; border-radius: 12px; padding: 14px; text-align: center; }
.stat .num { font-size: 26px; font-weight: 800; color: #fbbf24; }
.stat .lbl { font-size: 12px; color: #94a3b8; margin-top: 4px; }

.login-wrap { max-width: 380px; margin: 10vh auto 0; }
.login-wrap .brand-big { text-align: center; font-size: 26px; font-weight: 800; color: #fbbf24; margin-bottom: 6px; }
.login-wrap .sub { text-align: center; color: #94a3b8; font-size: 13px; margin-bottom: 20px; }

.kbd-hint { font-size: 12px; color: #64748b; margin-top: 8px; }
.order-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.mono { font-family: Consolas, monospace; }
